506 lines
660 KiB
JavaScript
506 lines
660 KiB
JavaScript
function pv(r,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 r)){const u=Object.getOwnPropertyDescriptor(o,c);u&&Object.defineProperty(r,c,u.get?u:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(r,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 u of c)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function l(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(c){if(c.ep)return;c.ep=!0;const u=l(c);fetch(c.href,u)}})();function Ex(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var xd={exports:{}},Nl={},pd={exports:{}},Xe={};/**
|
||
* @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 pf;function gv(){if(pf)return Xe;pf=1;var r=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"),u=Symbol.for("react.provider"),m=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.iterator;function E(A){return A===null||typeof A!="object"?null:(A=v&&A[v]||A["@@iterator"],typeof A=="function"?A:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,b={};function j(A,O,L){this.props=A,this.context=O,this.refs=b,this.updater=L||P}j.prototype.isReactComponent={},j.prototype.setState=function(A,O){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,O,"setState")},j.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function w(){}w.prototype=j.prototype;function C(A,O,L){this.props=A,this.context=O,this.refs=b,this.updater=L||P}var N=C.prototype=new w;N.constructor=C,T(N,j.prototype),N.isPureReactComponent=!0;var _=Array.isArray,V=Object.prototype.hasOwnProperty,U={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function k(A,O,L){var X,G={},de=null,Y=null;if(O!=null)for(X in O.ref!==void 0&&(Y=O.ref),O.key!==void 0&&(de=""+O.key),O)V.call(O,X)&&!I.hasOwnProperty(X)&&(G[X]=O[X]);var pe=arguments.length-2;if(pe===1)G.children=L;else if(1<pe){for(var Ce=Array(pe),D=0;D<pe;D++)Ce[D]=arguments[D+2];G.children=Ce}if(A&&A.defaultProps)for(X in pe=A.defaultProps,pe)G[X]===void 0&&(G[X]=pe[X]);return{$$typeof:r,type:A,key:de,ref:Y,props:G,_owner:U.current}}function R(A,O){return{$$typeof:r,type:A.type,key:O,ref:A.ref,props:A.props,_owner:A._owner}}function ee(A){return typeof A=="object"&&A!==null&&A.$$typeof===r}function ne(A){var O={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(L){return O[L]})}var ie=/\/+/g;function te(A,O){return typeof A=="object"&&A!==null&&A.key!=null?ne(""+A.key):O.toString(36)}function se(A,O,L,X,G){var de=typeof A;(de==="undefined"||de==="boolean")&&(A=null);var Y=!1;if(A===null)Y=!0;else switch(de){case"string":case"number":Y=!0;break;case"object":switch(A.$$typeof){case r:case a:Y=!0}}if(Y)return Y=A,G=G(Y),A=X===""?"."+te(Y,0):X,_(G)?(L="",A!=null&&(L=A.replace(ie,"$&/")+"/"),se(G,O,L,"",function(D){return D})):G!=null&&(ee(G)&&(G=R(G,L+(!G.key||Y&&Y.key===G.key?"":(""+G.key).replace(ie,"$&/")+"/")+A)),O.push(G)),1;if(Y=0,X=X===""?".":X+":",_(A))for(var pe=0;pe<A.length;pe++){de=A[pe];var Ce=X+te(de,pe);Y+=se(de,O,L,Ce,G)}else if(Ce=E(A),typeof Ce=="function")for(A=Ce.call(A),pe=0;!(de=A.next()).done;)de=de.value,Ce=X+te(de,pe++),Y+=se(de,O,L,Ce,G);else if(de==="object")throw O=String(A),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.");return Y}function H(A,O,L){if(A==null)return A;var X=[],G=0;return se(A,X,"","",function(de){return O.call(L,de,G++)}),X}function ae(A){if(A._status===-1){var O=A._result;O=O(),O.then(function(L){(A._status===0||A._status===-1)&&(A._status=1,A._result=L)},function(L){(A._status===0||A._status===-1)&&(A._status=2,A._result=L)}),A._status===-1&&(A._status=0,A._result=O)}if(A._status===1)return A._result.default;throw A._result}var ve={current:null},$={transition:null},ce={ReactCurrentDispatcher:ve,ReactCurrentBatchConfig:$,ReactCurrentOwner:U};function K(){throw Error("act(...) is not supported in production builds of React.")}return Xe.Children={map:H,forEach:function(A,O,L){H(A,function(){O.apply(this,arguments)},L)},count:function(A){var O=0;return H(A,function(){O++}),O},toArray:function(A){return H(A,function(O){return O})||[]},only:function(A){if(!ee(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},Xe.Component=j,Xe.Fragment=l,Xe.Profiler=c,Xe.PureComponent=C,Xe.StrictMode=o,Xe.Suspense=g,Xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ce,Xe.act=K,Xe.cloneElement=function(A,O,L){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var X=T({},A.props),G=A.key,de=A.ref,Y=A._owner;if(O!=null){if(O.ref!==void 0&&(de=O.ref,Y=U.current),O.key!==void 0&&(G=""+O.key),A.type&&A.type.defaultProps)var pe=A.type.defaultProps;for(Ce in O)V.call(O,Ce)&&!I.hasOwnProperty(Ce)&&(X[Ce]=O[Ce]===void 0&&pe!==void 0?pe[Ce]:O[Ce])}var Ce=arguments.length-2;if(Ce===1)X.children=L;else if(1<Ce){pe=Array(Ce);for(var D=0;D<Ce;D++)pe[D]=arguments[D+2];X.children=pe}return{$$typeof:r,type:A.type,key:G,ref:de,props:X,_owner:Y}},Xe.createContext=function(A){return A={$$typeof:m,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:u,_context:A},A.Consumer=A},Xe.createElement=k,Xe.createFactory=function(A){var O=k.bind(null,A);return O.type=A,O},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(A){return{$$typeof:f,render:A}},Xe.isValidElement=ee,Xe.lazy=function(A){return{$$typeof:p,_payload:{_status:-1,_result:A},_init:ae}},Xe.memo=function(A,O){return{$$typeof:y,type:A,compare:O===void 0?null:O}},Xe.startTransition=function(A){var O=$.transition;$.transition={};try{A()}finally{$.transition=O}},Xe.unstable_act=K,Xe.useCallback=function(A,O){return ve.current.useCallback(A,O)},Xe.useContext=function(A){return ve.current.useContext(A)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(A){return ve.current.useDeferredValue(A)},Xe.useEffect=function(A,O){return ve.current.useEffect(A,O)},Xe.useId=function(){return ve.current.useId()},Xe.useImperativeHandle=function(A,O,L){return ve.current.useImperativeHandle(A,O,L)},Xe.useInsertionEffect=function(A,O){return ve.current.useInsertionEffect(A,O)},Xe.useLayoutEffect=function(A,O){return ve.current.useLayoutEffect(A,O)},Xe.useMemo=function(A,O){return ve.current.useMemo(A,O)},Xe.useReducer=function(A,O,L){return ve.current.useReducer(A,O,L)},Xe.useRef=function(A){return ve.current.useRef(A)},Xe.useState=function(A){return ve.current.useState(A)},Xe.useSyncExternalStore=function(A,O,L){return ve.current.useSyncExternalStore(A,O,L)},Xe.useTransition=function(){return ve.current.useTransition()},Xe.version="18.3.1",Xe}var gf;function du(){return gf||(gf=1,pd.exports=gv()),pd.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 yf;function yv(){if(yf)return Nl;yf=1;var r=du(),a=Symbol.for("react.element"),l=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function m(f,g,y){var p,v={},E=null,P=null;y!==void 0&&(E=""+y),g.key!==void 0&&(E=""+g.key),g.ref!==void 0&&(P=g.ref);for(p in g)o.call(g,p)&&!u.hasOwnProperty(p)&&(v[p]=g[p]);if(f&&f.defaultProps)for(p in g=f.defaultProps,g)v[p]===void 0&&(v[p]=g[p]);return{$$typeof:a,type:f,key:E,ref:P,props:v,_owner:c.current}}return Nl.Fragment=l,Nl.jsx=m,Nl.jsxs=m,Nl}var vf;function vv(){return vf||(vf=1,xd.exports=yv()),xd.exports}var e=vv(),h=du();const Zr=Ex(h),yo=pv({__proto__:null,default:Zr},[h]);var Wi={},gd={exports:{}},ms={},yd={exports:{}},vd={};/**
|
||
* @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 jf;function jv(){return jf||(jf=1,(function(r){function a($,ce){var K=$.length;$.push(ce);e:for(;0<K;){var A=K-1>>>1,O=$[A];if(0<c(O,ce))$[A]=ce,$[K]=O,K=A;else break e}}function l($){return $.length===0?null:$[0]}function o($){if($.length===0)return null;var ce=$[0],K=$.pop();if(K!==ce){$[0]=K;e:for(var A=0,O=$.length,L=O>>>1;A<L;){var X=2*(A+1)-1,G=$[X],de=X+1,Y=$[de];if(0>c(G,K))de<O&&0>c(Y,G)?($[A]=Y,$[de]=K,A=de):($[A]=G,$[X]=K,A=X);else if(de<O&&0>c(Y,K))$[A]=Y,$[de]=K,A=de;else break e}}return ce}function c($,ce){var K=$.sortIndex-ce.sortIndex;return K!==0?K:$.id-ce.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;r.unstable_now=function(){return u.now()}}else{var m=Date,f=m.now();r.unstable_now=function(){return m.now()-f}}var g=[],y=[],p=1,v=null,E=3,P=!1,T=!1,b=!1,j=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N($){for(var ce=l(y);ce!==null;){if(ce.callback===null)o(y);else if(ce.startTime<=$)o(y),ce.sortIndex=ce.expirationTime,a(g,ce);else break;ce=l(y)}}function _($){if(b=!1,N($),!T)if(l(g)!==null)T=!0,ae(V);else{var ce=l(y);ce!==null&&ve(_,ce.startTime-$)}}function V($,ce){T=!1,b&&(b=!1,w(k),k=-1),P=!0;var K=E;try{for(N(ce),v=l(g);v!==null&&(!(v.expirationTime>ce)||$&&!ne());){var A=v.callback;if(typeof A=="function"){v.callback=null,E=v.priorityLevel;var O=A(v.expirationTime<=ce);ce=r.unstable_now(),typeof O=="function"?v.callback=O:v===l(g)&&o(g),N(ce)}else o(g);v=l(g)}if(v!==null)var L=!0;else{var X=l(y);X!==null&&ve(_,X.startTime-ce),L=!1}return L}finally{v=null,E=K,P=!1}}var U=!1,I=null,k=-1,R=5,ee=-1;function ne(){return!(r.unstable_now()-ee<R)}function ie(){if(I!==null){var $=r.unstable_now();ee=$;var ce=!0;try{ce=I(!0,$)}finally{ce?te():(U=!1,I=null)}}else U=!1}var te;if(typeof C=="function")te=function(){C(ie)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,H=se.port2;se.port1.onmessage=ie,te=function(){H.postMessage(null)}}else te=function(){j(ie,0)};function ae($){I=$,U||(U=!0,te())}function ve($,ce){k=j(function(){$(r.unstable_now())},ce)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function($){$.callback=null},r.unstable_continueExecution=function(){T||P||(T=!0,ae(V))},r.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<$?Math.floor(1e3/$):5},r.unstable_getCurrentPriorityLevel=function(){return E},r.unstable_getFirstCallbackNode=function(){return l(g)},r.unstable_next=function($){switch(E){case 1:case 2:case 3:var ce=3;break;default:ce=E}var K=E;E=ce;try{return $()}finally{E=K}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function($,ce){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var K=E;E=$;try{return ce()}finally{E=K}},r.unstable_scheduleCallback=function($,ce,K){var A=r.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?A+K:A):K=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=K+O,$={id:p++,callback:ce,priorityLevel:$,startTime:K,expirationTime:O,sortIndex:-1},K>A?($.sortIndex=K,a(y,$),l(g)===null&&$===l(y)&&(b?(w(k),k=-1):b=!0,ve(_,K-A))):($.sortIndex=O,a(g,$),T||P||(T=!0,ae(V))),$},r.unstable_shouldYield=ne,r.unstable_wrapCallback=function($){var ce=E;return function(){var K=E;E=ce;try{return $.apply(this,arguments)}finally{E=K}}}})(vd)),vd}var bf;function bv(){return bf||(bf=1,yd.exports=jv()),yd.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 Nf;function Nv(){if(Nf)return ms;Nf=1;var r=du(),a=bv();function l(t){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)s+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,c={};function u(t,s){m(t,s),m(t+"Capture",s)}function m(t,s){for(c[t]=s,t=0;t<s.length;t++)o.add(s[t])}var f=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=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]*$/,p={},v={};function E(t){return g.call(v,t)?!0:g.call(p,t)?!1:y.test(t)?v[t]=!0:(p[t]=!0,!1)}function P(t,s,n,i){if(n!==null&&n.type===0)return!1;switch(typeof s){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,s,n,i){if(s===null||typeof s>"u"||P(t,s,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function b(t,s,n,i,d,x,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=n,this.propertyName=t,this.type=s,this.sanitizeURL=x,this.removeEmptyString=S}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){j[t]=new b(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var s=t[0];j[s]=new b(s,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){j[t]=new b(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){j[t]=new b(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){j[t]=new b(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){j[t]=new b(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){j[t]=new b(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){j[t]=new b(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){j[t]=new b(t,5,!1,t.toLowerCase(),null,!1,!1)});var w=/[\-:]([a-z])/g;function C(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 s=t.replace(w,C);j[s]=new b(s,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var s=t.replace(w,C);j[s]=new b(s,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var s=t.replace(w,C);j[s]=new b(s,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){j[t]=new b(t,1,!1,t.toLowerCase(),null,!1,!1)}),j.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){j[t]=new b(t,1,!1,t.toLowerCase(),null,!0,!0)});function N(t,s,n,i){var d=j.hasOwnProperty(s)?j[s]:null;(d!==null?d.type!==0:i||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(T(s,n,d,i)&&(n=null),i||d===null?E(s)&&(n===null?t.removeAttribute(s):t.setAttribute(s,""+n)):d.mustUseProperty?t[d.propertyName]=n===null?d.type===3?!1:"":n:(s=d.attributeName,i=d.attributeNamespace,n===null?t.removeAttribute(s):(d=d.type,n=d===3||d===4&&n===!0?"":""+n,i?t.setAttributeNS(i,s,n):t.setAttribute(s,n))))}var _=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,V=Symbol.for("react.element"),U=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),ee=Symbol.for("react.provider"),ne=Symbol.for("react.context"),ie=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ve=Symbol.for("react.offscreen"),$=Symbol.iterator;function ce(t){return t===null||typeof t!="object"?null:(t=$&&t[$]||t["@@iterator"],typeof t=="function"?t:null)}var K=Object.assign,A;function O(t){if(A===void 0)try{throw Error()}catch(n){var s=n.stack.trim().match(/\n( *(at )?)/);A=s&&s[1]||""}return`
|
||
`+A+t}var L=!1;function X(t,s){if(!t||L)return"";L=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(re){var i=re}Reflect.construct(t,[],s)}else{try{s.call()}catch(re){i=re}t.call(s.prototype)}else{try{throw Error()}catch(re){i=re}t()}}catch(re){if(re&&i&&typeof re.stack=="string"){for(var d=re.stack.split(`
|
||
`),x=i.stack.split(`
|
||
`),S=d.length-1,M=x.length-1;1<=S&&0<=M&&d[S]!==x[M];)M--;for(;1<=S&&0<=M;S--,M--)if(d[S]!==x[M]){if(S!==1||M!==1)do if(S--,M--,0>M||d[S]!==x[M]){var z=`
|
||
`+d[S].replace(" at new "," at ");return t.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",t.displayName)),z}while(1<=S&&0<=M);break}}}finally{L=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?O(t):""}function G(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 de(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 I:return"Fragment";case U:return"Portal";case R:return"Profiler";case k:return"StrictMode";case te:return"Suspense";case se:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case ne:return(t.displayName||"Context")+".Consumer";case ee:return(t._context.displayName||"Context")+".Provider";case ie:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return s=t.displayName||null,s!==null?s:de(t.type)||"Memo";case ae:s=t._payload,t=t._init;try{return de(t(s))}catch{}}return null}function Y(t){var s=t.type;switch(t.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=s.render,t=t.displayName||t.name||"",s.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(s);case 8:return s===k?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function pe(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Ce(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function D(t){var s=Ce(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),i=""+t[s];if(!t.hasOwnProperty(s)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var d=n.get,x=n.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return d.call(this)},set:function(S){i=""+S,x.call(this,S)}}),Object.defineProperty(t,s,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(S){i=""+S},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function ue(t){t._valueTracker||(t._valueTracker=D(t))}function ke(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var n=s.getValue(),i="";return t&&(i=Ce(t)?t.checked?"true":"false":t.value),t=i,t!==n?(s.setValue(t),!0):!1}function Ie(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 Ue(t,s){var n=s.checked;return K({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Ze(t,s){var n=s.defaultValue==null?"":s.defaultValue,i=s.checked!=null?s.checked:s.defaultChecked;n=pe(s.value!=null?s.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function et(t,s){s=s.checked,s!=null&&N(t,"checked",s,!1)}function tt(t,s){et(t,s);var n=pe(s.value),i=s.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}s.hasOwnProperty("value")?fe(t,s.type,n):s.hasOwnProperty("defaultValue")&&fe(t,s.type,pe(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(t.defaultChecked=!!s.defaultChecked)}function ge(t,s,n){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var i=s.type;if(!(i!=="submit"&&i!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+t._wrapperState.initialValue,n||s===t.value||(t.value=s),t.defaultValue=s}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function fe(t,s,n){(s!=="number"||Ie(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ot=Array.isArray;function ss(t,s,n,i){if(t=t.options,s){s={};for(var d=0;d<n.length;d++)s["$"+n[d]]=!0;for(n=0;n<t.length;n++)d=s.hasOwnProperty("$"+t[n].value),t[n].selected!==d&&(t[n].selected=d),d&&i&&(t[n].defaultSelected=!0)}else{for(n=""+pe(n),s=null,d=0;d<t.length;d++){if(t[d].value===n){t[d].selected=!0,i&&(t[d].defaultSelected=!0);return}s!==null||t[d].disabled||(s=t[d])}s!==null&&(s.selected=!0)}}function dr(t,s){if(s.dangerouslySetInnerHTML!=null)throw Error(l(91));return K({},s,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Ht(t,s){var n=s.value;if(n==null){if(n=s.children,s=s.defaultValue,n!=null){if(s!=null)throw Error(l(92));if(ot(n)){if(1<n.length)throw Error(l(93));n=n[0]}s=n}s==null&&(s=""),n=s}t._wrapperState={initialValue:pe(n)}}function Cs(t,s){var n=pe(s.value),i=pe(s.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),s.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),i!=null&&(t.defaultValue=""+i)}function Kt(t){var s=t.textContent;s===t._wrapperState.initialValue&&s!==""&&s!==null&&(t.value=s)}function vn(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 Mt(t,s){return t==null||t==="http://www.w3.org/1999/xhtml"?vn(s):t==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var ur,Vn=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,n,i,d){MSApp.execUnsafeLocalFunction(function(){return t(s,n,i,d)})}:t})(function(t,s){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=s;else{for(ur=ur||document.createElement("div"),ur.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=ur.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;s.firstChild;)t.appendChild(s.firstChild)}});function ls(t,s){if(s){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=s;return}}t.textContent=s}var ks={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},jn=["Webkit","ms","Moz","O"];Object.keys(ks).forEach(function(t){jn.forEach(function(s){s=s+t.charAt(0).toUpperCase()+t.substring(1),ks[s]=ks[t]})});function Es(t,s,n){return s==null||typeof s=="boolean"||s===""?"":n||typeof s!="number"||s===0||ks.hasOwnProperty(t)&&ks[t]?(""+s).trim():s+"px"}function Ls(t,s){t=t.style;for(var n in s)if(s.hasOwnProperty(n)){var i=n.indexOf("--")===0,d=Es(n,s[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,d):t[n]=d}}var hr=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bn(t,s){if(s){if(hr[t]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(l(137,t));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(l(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(l(61))}if(s.style!=null&&typeof s.style!="object")throw Error(l(62))}}function mr(t,s){if(t.indexOf("-")===-1)return typeof s.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 Rr=null;function Ps(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Nn=null,qs=null,Xs=null;function Wn(t){if(t=il(t)){if(typeof Nn!="function")throw Error(l(280));var s=t.stateNode;s&&(s=ai(s),Nn(t.stateNode,t.type,s))}}function Hn(t){qs?Xs?Xs.push(t):Xs=[t]:qs=t}function Kn(){if(qs){var t=qs,s=Xs;if(Xs=qs=null,Wn(t),s)for(t=0;t<s.length;t++)Wn(s[t])}}function Gn(t,s){return t(s)}function Yn(){}var Ir=!1;function wn(t,s,n){if(Ir)return t(s,n);Ir=!0;try{return Gn(t,s,n)}finally{Ir=!1,(qs!==null||Xs!==null)&&(Yn(),Kn())}}function qt(t,s){var n=t.stateNode;if(n===null)return null;var i=ai(n);if(i===null)return null;n=i[s];e:switch(s){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,s,typeof n));return n}var _r=!1;if(f)try{var Js={};Object.defineProperty(Js,"passive",{get:function(){_r=!0}}),window.addEventListener("test",Js,Js),window.removeEventListener("test",Js,Js)}catch{_r=!1}function Qn(t,s,n,i,d,x,S,M,z){var re=Array.prototype.slice.call(arguments,3);try{s.apply(n,re)}catch(me){this.onError(me)}}var ys=!1,F=null,oe=!1,Ne=null,Te={onError:function(t){ys=!0,F=t}};function ut(t,s,n,i,d,x,S,M,z){ys=!1,F=null,Qn.apply(Te,arguments)}function rs(t,s,n,i,d,x,S,M,z){if(ut.apply(this,arguments),ys){if(ys){var re=F;ys=!1,F=null}else throw Error(l(198));oe||(oe=!0,Ne=re)}}function at(t){var s=t,n=t;if(t.alternate)for(;s.return;)s=s.return;else{t=s;do s=t,(s.flags&4098)!==0&&(n=s.return),t=s.return;while(t)}return s.tag===3?n:null}function is(t){if(t.tag===13){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function B(t){if(at(t)!==t)throw Error(l(188))}function We(t){var s=t.alternate;if(!s){if(s=at(t),s===null)throw Error(l(188));return s!==t?null:t}for(var n=t,i=s;;){var d=n.return;if(d===null)break;var x=d.alternate;if(x===null){if(i=d.return,i!==null){n=i;continue}break}if(d.child===x.child){for(x=d.child;x;){if(x===n)return B(d),t;if(x===i)return B(d),s;x=x.sibling}throw Error(l(188))}if(n.return!==i.return)n=d,i=x;else{for(var S=!1,M=d.child;M;){if(M===n){S=!0,n=d,i=x;break}if(M===i){S=!0,i=d,n=x;break}M=M.sibling}if(!S){for(M=x.child;M;){if(M===n){S=!0,n=x,i=d;break}if(M===i){S=!0,i=x,n=d;break}M=M.sibling}if(!S)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:s}function He(t){return t=We(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 s=rt(t);if(s!==null)return s;t=t.sibling}return null}var Ts=a.unstable_scheduleCallback,Vu=a.unstable_cancelCallback,Eg=a.unstable_shouldYield,Pg=a.unstable_requestPaint,Tt=a.unstable_now,Tg=a.unstable_getCurrentPriorityLevel,Do=a.unstable_ImmediatePriority,Wu=a.unstable_UserBlockingPriority,zl=a.unstable_NormalPriority,Rg=a.unstable_LowPriority,Hu=a.unstable_IdlePriority,$l=null,Zs=null;function Ig(t){if(Zs&&typeof Zs.onCommitFiberRoot=="function")try{Zs.onCommitFiberRoot($l,t,void 0,(t.current.flags&128)===128)}catch{}}var Os=Math.clz32?Math.clz32:Ag,_g=Math.log,Mg=Math.LN2;function Ag(t){return t>>>=0,t===0?32:31-(_g(t)/Mg|0)|0}var Bl=64,Ul=4194304;function Va(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 Vl(t,s){var n=t.pendingLanes;if(n===0)return 0;var i=0,d=t.suspendedLanes,x=t.pingedLanes,S=n&268435455;if(S!==0){var M=S&~d;M!==0?i=Va(M):(x&=S,x!==0&&(i=Va(x)))}else S=n&~d,S!==0?i=Va(S):x!==0&&(i=Va(x));if(i===0)return 0;if(s!==0&&s!==i&&(s&d)===0&&(d=i&-i,x=s&-s,d>=x||d===16&&(x&4194240)!==0))return s;if((i&4)!==0&&(i|=n&16),s=t.entangledLanes,s!==0)for(t=t.entanglements,s&=i;0<s;)n=31-Os(s),d=1<<n,i|=t[n],s&=~d;return i}function Dg(t,s){switch(t){case 1:case 2:case 4:return s+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 s+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 Lg(t,s){for(var n=t.suspendedLanes,i=t.pingedLanes,d=t.expirationTimes,x=t.pendingLanes;0<x;){var S=31-Os(x),M=1<<S,z=d[S];z===-1?((M&n)===0||(M&i)!==0)&&(d[S]=Dg(M,s)):z<=s&&(t.expiredLanes|=M),x&=~M}}function Lo(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Ku(){var t=Bl;return Bl<<=1,(Bl&4194240)===0&&(Bl=64),t}function Oo(t){for(var s=[],n=0;31>n;n++)s.push(t);return s}function Wa(t,s,n){t.pendingLanes|=s,s!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,s=31-Os(s),t[s]=n}function Og(t,s){var n=t.pendingLanes&~s;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=s,t.mutableReadLanes&=s,t.entangledLanes&=s,s=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0<n;){var d=31-Os(n),x=1<<d;s[d]=0,i[d]=-1,t[d]=-1,n&=~x}}function Fo(t,s){var n=t.entangledLanes|=s;for(t=t.entanglements;n;){var i=31-Os(n),d=1<<i;d&s|t[i]&s&&(t[i]|=s),n&=~d}}var ct=0;function Gu(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var Yu,zo,Qu,qu,Xu,$o=!1,Wl=[],Mr=null,Ar=null,Dr=null,Ha=new Map,Ka=new Map,Lr=[],Fg="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 Ju(t,s){switch(t){case"focusin":case"focusout":Mr=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":Dr=null;break;case"pointerover":case"pointerout":Ha.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ka.delete(s.pointerId)}}function Ga(t,s,n,i,d,x){return t===null||t.nativeEvent!==x?(t={blockedOn:s,domEventName:n,eventSystemFlags:i,nativeEvent:x,targetContainers:[d]},s!==null&&(s=il(s),s!==null&&zo(s)),t):(t.eventSystemFlags|=i,s=t.targetContainers,d!==null&&s.indexOf(d)===-1&&s.push(d),t)}function zg(t,s,n,i,d){switch(s){case"focusin":return Mr=Ga(Mr,t,s,n,i,d),!0;case"dragenter":return Ar=Ga(Ar,t,s,n,i,d),!0;case"mouseover":return Dr=Ga(Dr,t,s,n,i,d),!0;case"pointerover":var x=d.pointerId;return Ha.set(x,Ga(Ha.get(x)||null,t,s,n,i,d)),!0;case"gotpointercapture":return x=d.pointerId,Ka.set(x,Ga(Ka.get(x)||null,t,s,n,i,d)),!0}return!1}function Zu(t){var s=Sn(t.target);if(s!==null){var n=at(s);if(n!==null){if(s=n.tag,s===13){if(s=is(n),s!==null){t.blockedOn=s,Xu(t.priority,function(){Qu(n)});return}}else if(s===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Hl(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var n=Uo(t.domEventName,t.eventSystemFlags,s[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);Rr=i,n.target.dispatchEvent(i),Rr=null}else return s=il(n),s!==null&&zo(s),t.blockedOn=n,!1;s.shift()}return!0}function eh(t,s,n){Hl(t)&&n.delete(s)}function $g(){$o=!1,Mr!==null&&Hl(Mr)&&(Mr=null),Ar!==null&&Hl(Ar)&&(Ar=null),Dr!==null&&Hl(Dr)&&(Dr=null),Ha.forEach(eh),Ka.forEach(eh)}function Ya(t,s){t.blockedOn===s&&(t.blockedOn=null,$o||($o=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,$g)))}function Qa(t){function s(d){return Ya(d,t)}if(0<Wl.length){Ya(Wl[0],t);for(var n=1;n<Wl.length;n++){var i=Wl[n];i.blockedOn===t&&(i.blockedOn=null)}}for(Mr!==null&&Ya(Mr,t),Ar!==null&&Ya(Ar,t),Dr!==null&&Ya(Dr,t),Ha.forEach(s),Ka.forEach(s),n=0;n<Lr.length;n++)i=Lr[n],i.blockedOn===t&&(i.blockedOn=null);for(;0<Lr.length&&(n=Lr[0],n.blockedOn===null);)Zu(n),n.blockedOn===null&&Lr.shift()}var qn=_.ReactCurrentBatchConfig,Kl=!0;function Bg(t,s,n,i){var d=ct,x=qn.transition;qn.transition=null;try{ct=1,Bo(t,s,n,i)}finally{ct=d,qn.transition=x}}function Ug(t,s,n,i){var d=ct,x=qn.transition;qn.transition=null;try{ct=4,Bo(t,s,n,i)}finally{ct=d,qn.transition=x}}function Bo(t,s,n,i){if(Kl){var d=Uo(t,s,n,i);if(d===null)ac(t,s,i,Gl,n),Ju(t,i);else if(zg(d,t,s,n,i))i.stopPropagation();else if(Ju(t,i),s&4&&-1<Fg.indexOf(t)){for(;d!==null;){var x=il(d);if(x!==null&&Yu(x),x=Uo(t,s,n,i),x===null&&ac(t,s,i,Gl,n),x===d)break;d=x}d!==null&&i.stopPropagation()}else ac(t,s,i,null,n)}}var Gl=null;function Uo(t,s,n,i){if(Gl=null,t=Ps(i),t=Sn(t),t!==null)if(s=at(t),s===null)t=null;else if(n=s.tag,n===13){if(t=is(s),t!==null)return t;t=null}else if(n===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;t=null}else s!==t&&(t=null);return Gl=t,null}function th(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(Tg()){case Do:return 1;case Wu:return 4;case zl:case Rg:return 16;case Hu:return 536870912;default:return 16}default:return 16}}var Or=null,Vo=null,Yl=null;function sh(){if(Yl)return Yl;var t,s=Vo,n=s.length,i,d="value"in Or?Or.value:Or.textContent,x=d.length;for(t=0;t<n&&s[t]===d[t];t++);var S=n-t;for(i=1;i<=S&&s[n-i]===d[x-i];i++);return Yl=d.slice(t,1<i?1-i:void 0)}function Ql(t){var s=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&s===13&&(t=13)):t=s,t===10&&(t=13),32<=t||t===13?t:0}function ql(){return!0}function rh(){return!1}function vs(t){function s(n,i,d,x,S){this._reactName=n,this._targetInst=d,this.type=i,this.nativeEvent=x,this.target=S,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(n=t[M],this[M]=n?n(x):x[M]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?ql:rh,this.isPropagationStopped=rh,this}return K(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ql)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ql)},persist:function(){},isPersistent:ql}),s}var Xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wo=vs(Xn),qa=K({},Xn,{view:0,detail:0}),Vg=vs(qa),Ho,Ko,Xa,Xl=K({},qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yo,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!==Xa&&(Xa&&t.type==="mousemove"?(Ho=t.screenX-Xa.screenX,Ko=t.screenY-Xa.screenY):Ko=Ho=0,Xa=t),Ho)},movementY:function(t){return"movementY"in t?t.movementY:Ko}}),nh=vs(Xl),Wg=K({},Xl,{dataTransfer:0}),Hg=vs(Wg),Kg=K({},qa,{relatedTarget:0}),Go=vs(Kg),Gg=K({},Xn,{animationName:0,elapsedTime:0,pseudoElement:0}),Yg=vs(Gg),Qg=K({},Xn,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),qg=vs(Qg),Xg=K({},Xn,{data:0}),ah=vs(Xg),Jg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zg={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"},ey={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ty(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=ey[t])?!!s[t]:!1}function Yo(){return ty}var sy=K({},qa,{key:function(t){if(t.key){var s=Jg[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=Ql(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Zg[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yo,charCode:function(t){return t.type==="keypress"?Ql(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ql(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ry=vs(sy),ny=K({},Xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lh=vs(ny),ay=K({},qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yo}),ly=vs(ay),iy=K({},Xn,{propertyName:0,elapsedTime:0,pseudoElement:0}),oy=vs(iy),cy=K({},Xl,{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}),dy=vs(cy),uy=[9,13,27,32],Qo=f&&"CompositionEvent"in window,Ja=null;f&&"documentMode"in document&&(Ja=document.documentMode);var hy=f&&"TextEvent"in window&&!Ja,ih=f&&(!Qo||Ja&&8<Ja&&11>=Ja),oh=" ",ch=!1;function dh(t,s){switch(t){case"keyup":return uy.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Jn=!1;function my(t,s){switch(t){case"compositionend":return uh(s);case"keypress":return s.which!==32?null:(ch=!0,oh);case"textInput":return t=s.data,t===oh&&ch?null:t;default:return null}}function fy(t,s){if(Jn)return t==="compositionend"||!Qo&&dh(t,s)?(t=sh(),Yl=Vo=Or=null,Jn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return ih&&s.locale!=="ko"?null:s.data;default:return null}}var xy={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 hh(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!xy[t.type]:s==="textarea"}function mh(t,s,n,i){Hn(i),s=si(s,"onChange"),0<s.length&&(n=new Wo("onChange","change",null,n,i),t.push({event:n,listeners:s}))}var Za=null,el=null;function py(t){Ih(t,0)}function Jl(t){var s=ra(t);if(ke(s))return t}function gy(t,s){if(t==="change")return s}var fh=!1;if(f){var qo;if(f){var Xo="oninput"in document;if(!Xo){var xh=document.createElement("div");xh.setAttribute("oninput","return;"),Xo=typeof xh.oninput=="function"}qo=Xo}else qo=!1;fh=qo&&(!document.documentMode||9<document.documentMode)}function ph(){Za&&(Za.detachEvent("onpropertychange",gh),el=Za=null)}function gh(t){if(t.propertyName==="value"&&Jl(el)){var s=[];mh(s,el,t,Ps(t)),wn(py,s)}}function yy(t,s,n){t==="focusin"?(ph(),Za=s,el=n,Za.attachEvent("onpropertychange",gh)):t==="focusout"&&ph()}function vy(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Jl(el)}function jy(t,s){if(t==="click")return Jl(s)}function by(t,s){if(t==="input"||t==="change")return Jl(s)}function Ny(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var Fs=typeof Object.is=="function"?Object.is:Ny;function tl(t,s){if(Fs(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;var n=Object.keys(t),i=Object.keys(s);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var d=n[i];if(!g.call(s,d)||!Fs(t[d],s[d]))return!1}return!0}function yh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function vh(t,s){var n=yh(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=s&&i>=s)return{node:n,offset:s-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=yh(n)}}function jh(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?jh(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function bh(){for(var t=window,s=Ie();s instanceof t.HTMLIFrameElement;){try{var n=typeof s.contentWindow.location.href=="string"}catch{n=!1}if(n)t=s.contentWindow;else break;s=Ie(t.document)}return s}function Jo(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}function wy(t){var s=bh(),n=t.focusedElem,i=t.selectionRange;if(s!==n&&n&&n.ownerDocument&&jh(n.ownerDocument.documentElement,n)){if(i!==null&&Jo(n)){if(s=i.start,t=i.end,t===void 0&&(t=s),"selectionStart"in n)n.selectionStart=s,n.selectionEnd=Math.min(t,n.value.length);else if(t=(s=n.ownerDocument||document)&&s.defaultView||window,t.getSelection){t=t.getSelection();var d=n.textContent.length,x=Math.min(i.start,d);i=i.end===void 0?x:Math.min(i.end,d),!t.extend&&x>i&&(d=i,i=x,x=d),d=vh(n,x);var S=vh(n,i);d&&S&&(t.rangeCount!==1||t.anchorNode!==d.node||t.anchorOffset!==d.offset||t.focusNode!==S.node||t.focusOffset!==S.offset)&&(s=s.createRange(),s.setStart(d.node,d.offset),t.removeAllRanges(),x>i?(t.addRange(s),t.extend(S.node,S.offset)):(s.setEnd(S.node,S.offset),t.addRange(s)))}}for(s=[],t=n;t=t.parentNode;)t.nodeType===1&&s.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<s.length;n++)t=s[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var Sy=f&&"documentMode"in document&&11>=document.documentMode,Zn=null,Zo=null,sl=null,ec=!1;function Nh(t,s,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ec||Zn==null||Zn!==Ie(i)||(i=Zn,"selectionStart"in i&&Jo(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}),sl&&tl(sl,i)||(sl=i,i=si(Zo,"onSelect"),0<i.length&&(s=new Wo("onSelect","select",null,s,n),t.push({event:s,listeners:i}),s.target=Zn)))}function Zl(t,s){var n={};return n[t.toLowerCase()]=s.toLowerCase(),n["Webkit"+t]="webkit"+s,n["Moz"+t]="moz"+s,n}var ea={animationend:Zl("Animation","AnimationEnd"),animationiteration:Zl("Animation","AnimationIteration"),animationstart:Zl("Animation","AnimationStart"),transitionend:Zl("Transition","TransitionEnd")},tc={},wh={};f&&(wh=document.createElement("div").style,"AnimationEvent"in window||(delete ea.animationend.animation,delete ea.animationiteration.animation,delete ea.animationstart.animation),"TransitionEvent"in window||delete ea.transitionend.transition);function ei(t){if(tc[t])return tc[t];if(!ea[t])return t;var s=ea[t],n;for(n in s)if(s.hasOwnProperty(n)&&n in wh)return tc[t]=s[n];return t}var Sh=ei("animationend"),Ch=ei("animationiteration"),kh=ei("animationstart"),Eh=ei("transitionend"),Ph=new Map,Th="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 Fr(t,s){Ph.set(t,s),u(s,[t])}for(var sc=0;sc<Th.length;sc++){var rc=Th[sc],Cy=rc.toLowerCase(),ky=rc[0].toUpperCase()+rc.slice(1);Fr(Cy,"on"+ky)}Fr(Sh,"onAnimationEnd"),Fr(Ch,"onAnimationIteration"),Fr(kh,"onAnimationStart"),Fr("dblclick","onDoubleClick"),Fr("focusin","onFocus"),Fr("focusout","onBlur"),Fr(Eh,"onTransitionEnd"),m("onMouseEnter",["mouseout","mouseover"]),m("onMouseLeave",["mouseout","mouseover"]),m("onPointerEnter",["pointerout","pointerover"]),m("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rl="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(" "),Ey=new Set("cancel close invalid load scroll toggle".split(" ").concat(rl));function Rh(t,s,n){var i=t.type||"unknown-event";t.currentTarget=n,rs(i,s,void 0,t),t.currentTarget=null}function Ih(t,s){s=(s&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],d=i.event;i=i.listeners;e:{var x=void 0;if(s)for(var S=i.length-1;0<=S;S--){var M=i[S],z=M.instance,re=M.currentTarget;if(M=M.listener,z!==x&&d.isPropagationStopped())break e;Rh(d,M,re),x=z}else for(S=0;S<i.length;S++){if(M=i[S],z=M.instance,re=M.currentTarget,M=M.listener,z!==x&&d.isPropagationStopped())break e;Rh(d,M,re),x=z}}}if(oe)throw t=Ne,oe=!1,Ne=null,t}function xt(t,s){var n=s[uc];n===void 0&&(n=s[uc]=new Set);var i=t+"__bubble";n.has(i)||(_h(s,t,2,!1),n.add(i))}function nc(t,s,n){var i=0;s&&(i|=4),_h(n,t,i,s)}var ti="_reactListening"+Math.random().toString(36).slice(2);function nl(t){if(!t[ti]){t[ti]=!0,o.forEach(function(n){n!=="selectionchange"&&(Ey.has(n)||nc(n,!1,t),nc(n,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[ti]||(s[ti]=!0,nc("selectionchange",!1,s))}}function _h(t,s,n,i){switch(th(s)){case 1:var d=Bg;break;case 4:d=Ug;break;default:d=Bo}n=d.bind(null,s,n,t),d=void 0,!_r||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(d=!0),i?d!==void 0?t.addEventListener(s,n,{capture:!0,passive:d}):t.addEventListener(s,n,!0):d!==void 0?t.addEventListener(s,n,{passive:d}):t.addEventListener(s,n,!1)}function ac(t,s,n,i,d){var x=i;if((s&1)===0&&(s&2)===0&&i!==null)e:for(;;){if(i===null)return;var S=i.tag;if(S===3||S===4){var M=i.stateNode.containerInfo;if(M===d||M.nodeType===8&&M.parentNode===d)break;if(S===4)for(S=i.return;S!==null;){var z=S.tag;if((z===3||z===4)&&(z=S.stateNode.containerInfo,z===d||z.nodeType===8&&z.parentNode===d))return;S=S.return}for(;M!==null;){if(S=Sn(M),S===null)return;if(z=S.tag,z===5||z===6){i=x=S;continue e}M=M.parentNode}}i=i.return}wn(function(){var re=x,me=Ps(n),ye=[];e:{var he=Ph.get(t);if(he!==void 0){var Pe=Wo,_e=t;switch(t){case"keypress":if(Ql(n)===0)break e;case"keydown":case"keyup":Pe=ry;break;case"focusin":_e="focus",Pe=Go;break;case"focusout":_e="blur",Pe=Go;break;case"beforeblur":case"afterblur":Pe=Go;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":Pe=nh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=Hg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=ly;break;case Sh:case Ch:case kh:Pe=Yg;break;case Eh:Pe=oy;break;case"scroll":Pe=Vg;break;case"wheel":Pe=dy;break;case"copy":case"cut":case"paste":Pe=qg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=lh}var De=(s&4)!==0,Rt=!De&&t==="scroll",Q=De?he!==null?he+"Capture":null:he;De=[];for(var W=re,J;W!==null;){J=W;var je=J.stateNode;if(J.tag===5&&je!==null&&(J=je,Q!==null&&(je=qt(W,Q),je!=null&&De.push(al(W,je,J)))),Rt)break;W=W.return}0<De.length&&(he=new Pe(he,_e,null,n,me),ye.push({event:he,listeners:De}))}}if((s&7)===0){e:{if(he=t==="mouseover"||t==="pointerover",Pe=t==="mouseout"||t==="pointerout",he&&n!==Rr&&(_e=n.relatedTarget||n.fromElement)&&(Sn(_e)||_e[fr]))break e;if((Pe||he)&&(he=me.window===me?me:(he=me.ownerDocument)?he.defaultView||he.parentWindow:window,Pe?(_e=n.relatedTarget||n.toElement,Pe=re,_e=_e?Sn(_e):null,_e!==null&&(Rt=at(_e),_e!==Rt||_e.tag!==5&&_e.tag!==6)&&(_e=null)):(Pe=null,_e=re),Pe!==_e)){if(De=nh,je="onMouseLeave",Q="onMouseEnter",W="mouse",(t==="pointerout"||t==="pointerover")&&(De=lh,je="onPointerLeave",Q="onPointerEnter",W="pointer"),Rt=Pe==null?he:ra(Pe),J=_e==null?he:ra(_e),he=new De(je,W+"leave",Pe,n,me),he.target=Rt,he.relatedTarget=J,je=null,Sn(me)===re&&(De=new De(Q,W+"enter",_e,n,me),De.target=J,De.relatedTarget=Rt,je=De),Rt=je,Pe&&_e)t:{for(De=Pe,Q=_e,W=0,J=De;J;J=ta(J))W++;for(J=0,je=Q;je;je=ta(je))J++;for(;0<W-J;)De=ta(De),W--;for(;0<J-W;)Q=ta(Q),J--;for(;W--;){if(De===Q||Q!==null&&De===Q.alternate)break t;De=ta(De),Q=ta(Q)}De=null}else De=null;Pe!==null&&Mh(ye,he,Pe,De,!1),_e!==null&&Rt!==null&&Mh(ye,Rt,_e,De,!0)}}e:{if(he=re?ra(re):window,Pe=he.nodeName&&he.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&he.type==="file")var Le=gy;else if(hh(he))if(fh)Le=by;else{Le=vy;var Fe=yy}else(Pe=he.nodeName)&&Pe.toLowerCase()==="input"&&(he.type==="checkbox"||he.type==="radio")&&(Le=jy);if(Le&&(Le=Le(t,re))){mh(ye,Le,n,me);break e}Fe&&Fe(t,he,re),t==="focusout"&&(Fe=he._wrapperState)&&Fe.controlled&&he.type==="number"&&fe(he,"number",he.value)}switch(Fe=re?ra(re):window,t){case"focusin":(hh(Fe)||Fe.contentEditable==="true")&&(Zn=Fe,Zo=re,sl=null);break;case"focusout":sl=Zo=Zn=null;break;case"mousedown":ec=!0;break;case"contextmenu":case"mouseup":case"dragend":ec=!1,Nh(ye,n,me);break;case"selectionchange":if(Sy)break;case"keydown":case"keyup":Nh(ye,n,me)}var ze;if(Qo)e:{switch(t){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Jn?dh(t,n)&&(Ve="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(Ve="onCompositionStart");Ve&&(ih&&n.locale!=="ko"&&(Jn||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Jn&&(ze=sh()):(Or=me,Vo="value"in Or?Or.value:Or.textContent,Jn=!0)),Fe=si(re,Ve),0<Fe.length&&(Ve=new ah(Ve,t,null,n,me),ye.push({event:Ve,listeners:Fe}),ze?Ve.data=ze:(ze=uh(n),ze!==null&&(Ve.data=ze)))),(ze=hy?my(t,n):fy(t,n))&&(re=si(re,"onBeforeInput"),0<re.length&&(me=new ah("onBeforeInput","beforeinput",null,n,me),ye.push({event:me,listeners:re}),me.data=ze))}Ih(ye,s)})}function al(t,s,n){return{instance:t,listener:s,currentTarget:n}}function si(t,s){for(var n=s+"Capture",i=[];t!==null;){var d=t,x=d.stateNode;d.tag===5&&x!==null&&(d=x,x=qt(t,n),x!=null&&i.unshift(al(t,x,d)),x=qt(t,s),x!=null&&i.push(al(t,x,d))),t=t.return}return i}function ta(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Mh(t,s,n,i,d){for(var x=s._reactName,S=[];n!==null&&n!==i;){var M=n,z=M.alternate,re=M.stateNode;if(z!==null&&z===i)break;M.tag===5&&re!==null&&(M=re,d?(z=qt(n,x),z!=null&&S.unshift(al(n,z,M))):d||(z=qt(n,x),z!=null&&S.push(al(n,z,M)))),n=n.return}S.length!==0&&t.push({event:s,listeners:S})}var Py=/\r\n?/g,Ty=/\u0000|\uFFFD/g;function Ah(t){return(typeof t=="string"?t:""+t).replace(Py,`
|
||
`).replace(Ty,"")}function ri(t,s,n){if(s=Ah(s),Ah(t)!==s&&n)throw Error(l(425))}function ni(){}var lc=null,ic=null;function oc(t,s){return t==="textarea"||t==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var cc=typeof setTimeout=="function"?setTimeout:void 0,Ry=typeof clearTimeout=="function"?clearTimeout:void 0,Dh=typeof Promise=="function"?Promise:void 0,Iy=typeof queueMicrotask=="function"?queueMicrotask:typeof Dh<"u"?function(t){return Dh.resolve(null).then(t).catch(_y)}:cc;function _y(t){setTimeout(function(){throw t})}function dc(t,s){var n=s,i=0;do{var d=n.nextSibling;if(t.removeChild(n),d&&d.nodeType===8)if(n=d.data,n==="/$"){if(i===0){t.removeChild(d),Qa(s);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=d}while(n);Qa(s)}function zr(t){for(;t!=null;t=t.nextSibling){var s=t.nodeType;if(s===1||s===3)break;if(s===8){if(s=t.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return t}function Lh(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(s===0)return t;s--}else n==="/$"&&s++}t=t.previousSibling}return null}var sa=Math.random().toString(36).slice(2),er="__reactFiber$"+sa,ll="__reactProps$"+sa,fr="__reactContainer$"+sa,uc="__reactEvents$"+sa,My="__reactListeners$"+sa,Ay="__reactHandles$"+sa;function Sn(t){var s=t[er];if(s)return s;for(var n=t.parentNode;n;){if(s=n[fr]||n[er]){if(n=s.alternate,s.child!==null||n!==null&&n.child!==null)for(t=Lh(t);t!==null;){if(n=t[er])return n;t=Lh(t)}return s}t=n,n=t.parentNode}return null}function il(t){return t=t[er]||t[fr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ra(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(l(33))}function ai(t){return t[ll]||null}var hc=[],na=-1;function $r(t){return{current:t}}function pt(t){0>na||(t.current=hc[na],hc[na]=null,na--)}function ht(t,s){na++,hc[na]=t.current,t.current=s}var Br={},Xt=$r(Br),os=$r(!1),Cn=Br;function aa(t,s){var n=t.type.contextTypes;if(!n)return Br;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===s)return i.__reactInternalMemoizedMaskedChildContext;var d={},x;for(x in n)d[x]=s[x];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=d),d}function cs(t){return t=t.childContextTypes,t!=null}function li(){pt(os),pt(Xt)}function Oh(t,s,n){if(Xt.current!==Br)throw Error(l(168));ht(Xt,s),ht(os,n)}function Fh(t,s,n){var i=t.stateNode;if(s=s.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var d in i)if(!(d in s))throw Error(l(108,Y(t)||"Unknown",d));return K({},n,i)}function ii(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Br,Cn=Xt.current,ht(Xt,t),ht(os,os.current),!0}function zh(t,s,n){var i=t.stateNode;if(!i)throw Error(l(169));n?(t=Fh(t,s,Cn),i.__reactInternalMemoizedMergedChildContext=t,pt(os),pt(Xt),ht(Xt,t)):pt(os),ht(os,n)}var xr=null,oi=!1,mc=!1;function $h(t){xr===null?xr=[t]:xr.push(t)}function Dy(t){oi=!0,$h(t)}function Ur(){if(!mc&&xr!==null){mc=!0;var t=0,s=ct;try{var n=xr;for(ct=1;t<n.length;t++){var i=n[t];do i=i(!0);while(i!==null)}xr=null,oi=!1}catch(d){throw xr!==null&&(xr=xr.slice(t+1)),Ts(Do,Ur),d}finally{ct=s,mc=!1}}return null}var la=[],ia=0,ci=null,di=0,Rs=[],Is=0,kn=null,pr=1,gr="";function En(t,s){la[ia++]=di,la[ia++]=ci,ci=t,di=s}function Bh(t,s,n){Rs[Is++]=pr,Rs[Is++]=gr,Rs[Is++]=kn,kn=t;var i=pr;t=gr;var d=32-Os(i)-1;i&=~(1<<d),n+=1;var x=32-Os(s)+d;if(30<x){var S=d-d%5;x=(i&(1<<S)-1).toString(32),i>>=S,d-=S,pr=1<<32-Os(s)+d|n<<d|i,gr=x+t}else pr=1<<x|n<<d|i,gr=t}function fc(t){t.return!==null&&(En(t,1),Bh(t,1,0))}function xc(t){for(;t===ci;)ci=la[--ia],la[ia]=null,di=la[--ia],la[ia]=null;for(;t===kn;)kn=Rs[--Is],Rs[Is]=null,gr=Rs[--Is],Rs[Is]=null,pr=Rs[--Is],Rs[Is]=null}var js=null,bs=null,jt=!1,zs=null;function Uh(t,s){var n=Ds(5,null,null,0);n.elementType="DELETED",n.stateNode=s,n.return=t,s=t.deletions,s===null?(t.deletions=[n],t.flags|=16):s.push(n)}function Vh(t,s){switch(t.tag){case 5:var n=t.type;return s=s.nodeType!==1||n.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(t.stateNode=s,js=t,bs=zr(s.firstChild),!0):!1;case 6:return s=t.pendingProps===""||s.nodeType!==3?null:s,s!==null?(t.stateNode=s,js=t,bs=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(n=kn!==null?{id:pr,overflow:gr}:null,t.memoizedState={dehydrated:s,treeContext:n,retryLane:1073741824},n=Ds(18,null,null,0),n.stateNode=s,n.return=t,t.child=n,js=t,bs=null,!0):!1;default:return!1}}function pc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function gc(t){if(jt){var s=bs;if(s){var n=s;if(!Vh(t,s)){if(pc(t))throw Error(l(418));s=zr(n.nextSibling);var i=js;s&&Vh(t,s)?Uh(i,n):(t.flags=t.flags&-4097|2,jt=!1,js=t)}}else{if(pc(t))throw Error(l(418));t.flags=t.flags&-4097|2,jt=!1,js=t}}}function Wh(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;js=t}function ui(t){if(t!==js)return!1;if(!jt)return Wh(t),jt=!0,!1;var s;if((s=t.tag!==3)&&!(s=t.tag!==5)&&(s=t.type,s=s!=="head"&&s!=="body"&&!oc(t.type,t.memoizedProps)),s&&(s=bs)){if(pc(t))throw Hh(),Error(l(418));for(;s;)Uh(t,s),s=zr(s.nextSibling)}if(Wh(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));e:{for(t=t.nextSibling,s=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(s===0){bs=zr(t.nextSibling);break e}s--}else n!=="$"&&n!=="$!"&&n!=="$?"||s++}t=t.nextSibling}bs=null}}else bs=js?zr(t.stateNode.nextSibling):null;return!0}function Hh(){for(var t=bs;t;)t=zr(t.nextSibling)}function oa(){bs=js=null,jt=!1}function yc(t){zs===null?zs=[t]:zs.push(t)}var Ly=_.ReactCurrentBatchConfig;function ol(t,s,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 d=i,x=""+t;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===x?s.ref:(s=function(S){var M=d.refs;S===null?delete M[x]:M[x]=S},s._stringRef=x,s)}if(typeof t!="string")throw Error(l(284));if(!n._owner)throw Error(l(290,t))}return t}function hi(t,s){throw t=Object.prototype.toString.call(s),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t))}function Kh(t){var s=t._init;return s(t._payload)}function Gh(t){function s(Q,W){if(t){var J=Q.deletions;J===null?(Q.deletions=[W],Q.flags|=16):J.push(W)}}function n(Q,W){if(!t)return null;for(;W!==null;)s(Q,W),W=W.sibling;return null}function i(Q,W){for(Q=new Map;W!==null;)W.key!==null?Q.set(W.key,W):Q.set(W.index,W),W=W.sibling;return Q}function d(Q,W){return Q=qr(Q,W),Q.index=0,Q.sibling=null,Q}function x(Q,W,J){return Q.index=J,t?(J=Q.alternate,J!==null?(J=J.index,J<W?(Q.flags|=2,W):J):(Q.flags|=2,W)):(Q.flags|=1048576,W)}function S(Q){return t&&Q.alternate===null&&(Q.flags|=2),Q}function M(Q,W,J,je){return W===null||W.tag!==6?(W=cd(J,Q.mode,je),W.return=Q,W):(W=d(W,J),W.return=Q,W)}function z(Q,W,J,je){var Le=J.type;return Le===I?me(Q,W,J.props.children,je,J.key):W!==null&&(W.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===ae&&Kh(Le)===W.type)?(je=d(W,J.props),je.ref=ol(Q,W,J),je.return=Q,je):(je=Li(J.type,J.key,J.props,null,Q.mode,je),je.ref=ol(Q,W,J),je.return=Q,je)}function re(Q,W,J,je){return W===null||W.tag!==4||W.stateNode.containerInfo!==J.containerInfo||W.stateNode.implementation!==J.implementation?(W=dd(J,Q.mode,je),W.return=Q,W):(W=d(W,J.children||[]),W.return=Q,W)}function me(Q,W,J,je,Le){return W===null||W.tag!==7?(W=Dn(J,Q.mode,je,Le),W.return=Q,W):(W=d(W,J),W.return=Q,W)}function ye(Q,W,J){if(typeof W=="string"&&W!==""||typeof W=="number")return W=cd(""+W,Q.mode,J),W.return=Q,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case V:return J=Li(W.type,W.key,W.props,null,Q.mode,J),J.ref=ol(Q,null,W),J.return=Q,J;case U:return W=dd(W,Q.mode,J),W.return=Q,W;case ae:var je=W._init;return ye(Q,je(W._payload),J)}if(ot(W)||ce(W))return W=Dn(W,Q.mode,J,null),W.return=Q,W;hi(Q,W)}return null}function he(Q,W,J,je){var Le=W!==null?W.key:null;if(typeof J=="string"&&J!==""||typeof J=="number")return Le!==null?null:M(Q,W,""+J,je);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case V:return J.key===Le?z(Q,W,J,je):null;case U:return J.key===Le?re(Q,W,J,je):null;case ae:return Le=J._init,he(Q,W,Le(J._payload),je)}if(ot(J)||ce(J))return Le!==null?null:me(Q,W,J,je,null);hi(Q,J)}return null}function Pe(Q,W,J,je,Le){if(typeof je=="string"&&je!==""||typeof je=="number")return Q=Q.get(J)||null,M(W,Q,""+je,Le);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case V:return Q=Q.get(je.key===null?J:je.key)||null,z(W,Q,je,Le);case U:return Q=Q.get(je.key===null?J:je.key)||null,re(W,Q,je,Le);case ae:var Fe=je._init;return Pe(Q,W,J,Fe(je._payload),Le)}if(ot(je)||ce(je))return Q=Q.get(J)||null,me(W,Q,je,Le,null);hi(W,je)}return null}function _e(Q,W,J,je){for(var Le=null,Fe=null,ze=W,Ve=W=0,Vt=null;ze!==null&&Ve<J.length;Ve++){ze.index>Ve?(Vt=ze,ze=null):Vt=ze.sibling;var nt=he(Q,ze,J[Ve],je);if(nt===null){ze===null&&(ze=Vt);break}t&&ze&&nt.alternate===null&&s(Q,ze),W=x(nt,W,Ve),Fe===null?Le=nt:Fe.sibling=nt,Fe=nt,ze=Vt}if(Ve===J.length)return n(Q,ze),jt&&En(Q,Ve),Le;if(ze===null){for(;Ve<J.length;Ve++)ze=ye(Q,J[Ve],je),ze!==null&&(W=x(ze,W,Ve),Fe===null?Le=ze:Fe.sibling=ze,Fe=ze);return jt&&En(Q,Ve),Le}for(ze=i(Q,ze);Ve<J.length;Ve++)Vt=Pe(ze,Q,Ve,J[Ve],je),Vt!==null&&(t&&Vt.alternate!==null&&ze.delete(Vt.key===null?Ve:Vt.key),W=x(Vt,W,Ve),Fe===null?Le=Vt:Fe.sibling=Vt,Fe=Vt);return t&&ze.forEach(function(Xr){return s(Q,Xr)}),jt&&En(Q,Ve),Le}function De(Q,W,J,je){var Le=ce(J);if(typeof Le!="function")throw Error(l(150));if(J=Le.call(J),J==null)throw Error(l(151));for(var Fe=Le=null,ze=W,Ve=W=0,Vt=null,nt=J.next();ze!==null&&!nt.done;Ve++,nt=J.next()){ze.index>Ve?(Vt=ze,ze=null):Vt=ze.sibling;var Xr=he(Q,ze,nt.value,je);if(Xr===null){ze===null&&(ze=Vt);break}t&&ze&&Xr.alternate===null&&s(Q,ze),W=x(Xr,W,Ve),Fe===null?Le=Xr:Fe.sibling=Xr,Fe=Xr,ze=Vt}if(nt.done)return n(Q,ze),jt&&En(Q,Ve),Le;if(ze===null){for(;!nt.done;Ve++,nt=J.next())nt=ye(Q,nt.value,je),nt!==null&&(W=x(nt,W,Ve),Fe===null?Le=nt:Fe.sibling=nt,Fe=nt);return jt&&En(Q,Ve),Le}for(ze=i(Q,ze);!nt.done;Ve++,nt=J.next())nt=Pe(ze,Q,Ve,nt.value,je),nt!==null&&(t&&nt.alternate!==null&&ze.delete(nt.key===null?Ve:nt.key),W=x(nt,W,Ve),Fe===null?Le=nt:Fe.sibling=nt,Fe=nt);return t&&ze.forEach(function(xv){return s(Q,xv)}),jt&&En(Q,Ve),Le}function Rt(Q,W,J,je){if(typeof J=="object"&&J!==null&&J.type===I&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case V:e:{for(var Le=J.key,Fe=W;Fe!==null;){if(Fe.key===Le){if(Le=J.type,Le===I){if(Fe.tag===7){n(Q,Fe.sibling),W=d(Fe,J.props.children),W.return=Q,Q=W;break e}}else if(Fe.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===ae&&Kh(Le)===Fe.type){n(Q,Fe.sibling),W=d(Fe,J.props),W.ref=ol(Q,Fe,J),W.return=Q,Q=W;break e}n(Q,Fe);break}else s(Q,Fe);Fe=Fe.sibling}J.type===I?(W=Dn(J.props.children,Q.mode,je,J.key),W.return=Q,Q=W):(je=Li(J.type,J.key,J.props,null,Q.mode,je),je.ref=ol(Q,W,J),je.return=Q,Q=je)}return S(Q);case U:e:{for(Fe=J.key;W!==null;){if(W.key===Fe)if(W.tag===4&&W.stateNode.containerInfo===J.containerInfo&&W.stateNode.implementation===J.implementation){n(Q,W.sibling),W=d(W,J.children||[]),W.return=Q,Q=W;break e}else{n(Q,W);break}else s(Q,W);W=W.sibling}W=dd(J,Q.mode,je),W.return=Q,Q=W}return S(Q);case ae:return Fe=J._init,Rt(Q,W,Fe(J._payload),je)}if(ot(J))return _e(Q,W,J,je);if(ce(J))return De(Q,W,J,je);hi(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"?(J=""+J,W!==null&&W.tag===6?(n(Q,W.sibling),W=d(W,J),W.return=Q,Q=W):(n(Q,W),W=cd(J,Q.mode,je),W.return=Q,Q=W),S(Q)):n(Q,W)}return Rt}var ca=Gh(!0),Yh=Gh(!1),mi=$r(null),fi=null,da=null,vc=null;function jc(){vc=da=fi=null}function bc(t){var s=mi.current;pt(mi),t._currentValue=s}function Nc(t,s,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,i!==null&&(i.childLanes|=s)):i!==null&&(i.childLanes&s)!==s&&(i.childLanes|=s),t===n)break;t=t.return}}function ua(t,s){fi=t,vc=da=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&s)!==0&&(ds=!0),t.firstContext=null)}function _s(t){var s=t._currentValue;if(vc!==t)if(t={context:t,memoizedValue:s,next:null},da===null){if(fi===null)throw Error(l(308));da=t,fi.dependencies={lanes:0,firstContext:t}}else da=da.next=t;return s}var Pn=null;function wc(t){Pn===null?Pn=[t]:Pn.push(t)}function Qh(t,s,n,i){var d=s.interleaved;return d===null?(n.next=n,wc(s)):(n.next=d.next,d.next=n),s.interleaved=n,yr(t,i)}function yr(t,s){t.lanes|=s;var n=t.alternate;for(n!==null&&(n.lanes|=s),n=t,t=t.return;t!==null;)t.childLanes|=s,n=t.alternate,n!==null&&(n.childLanes|=s),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Vr=!1;function Sc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qh(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function vr(t,s){return{eventTime:t,lane:s,tag:0,payload:null,callback:null,next:null}}function Wr(t,s,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(st&2)!==0){var d=i.pending;return d===null?s.next=s:(s.next=d.next,d.next=s),i.pending=s,yr(t,n)}return d=i.interleaved,d===null?(s.next=s,wc(i)):(s.next=d.next,d.next=s),i.interleaved=s,yr(t,n)}function xi(t,s,n){if(s=s.updateQueue,s!==null&&(s=s.shared,(n&4194240)!==0)){var i=s.lanes;i&=t.pendingLanes,n|=i,s.lanes=n,Fo(t,n)}}function Xh(t,s){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var d=null,x=null;if(n=n.firstBaseUpdate,n!==null){do{var S={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};x===null?d=x=S:x=x.next=S,n=n.next}while(n!==null);x===null?d=x=s:x=x.next=s}else d=x=s;n={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:x,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=s:t.next=s,n.lastBaseUpdate=s}function pi(t,s,n,i){var d=t.updateQueue;Vr=!1;var x=d.firstBaseUpdate,S=d.lastBaseUpdate,M=d.shared.pending;if(M!==null){d.shared.pending=null;var z=M,re=z.next;z.next=null,S===null?x=re:S.next=re,S=z;var me=t.alternate;me!==null&&(me=me.updateQueue,M=me.lastBaseUpdate,M!==S&&(M===null?me.firstBaseUpdate=re:M.next=re,me.lastBaseUpdate=z))}if(x!==null){var ye=d.baseState;S=0,me=re=z=null,M=x;do{var he=M.lane,Pe=M.eventTime;if((i&he)===he){me!==null&&(me=me.next={eventTime:Pe,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var _e=t,De=M;switch(he=s,Pe=n,De.tag){case 1:if(_e=De.payload,typeof _e=="function"){ye=_e.call(Pe,ye,he);break e}ye=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=De.payload,he=typeof _e=="function"?_e.call(Pe,ye,he):_e,he==null)break e;ye=K({},ye,he);break e;case 2:Vr=!0}}M.callback!==null&&M.lane!==0&&(t.flags|=64,he=d.effects,he===null?d.effects=[M]:he.push(M))}else Pe={eventTime:Pe,lane:he,tag:M.tag,payload:M.payload,callback:M.callback,next:null},me===null?(re=me=Pe,z=ye):me=me.next=Pe,S|=he;if(M=M.next,M===null){if(M=d.shared.pending,M===null)break;he=M,M=he.next,he.next=null,d.lastBaseUpdate=he,d.shared.pending=null}}while(!0);if(me===null&&(z=ye),d.baseState=z,d.firstBaseUpdate=re,d.lastBaseUpdate=me,s=d.shared.interleaved,s!==null){d=s;do S|=d.lane,d=d.next;while(d!==s)}else x===null&&(d.shared.lanes=0);In|=S,t.lanes=S,t.memoizedState=ye}}function Jh(t,s,n){if(t=s.effects,s.effects=null,t!==null)for(s=0;s<t.length;s++){var i=t[s],d=i.callback;if(d!==null){if(i.callback=null,i=n,typeof d!="function")throw Error(l(191,d));d.call(i)}}}var cl={},tr=$r(cl),dl=$r(cl),ul=$r(cl);function Tn(t){if(t===cl)throw Error(l(174));return t}function Cc(t,s){switch(ht(ul,s),ht(dl,t),ht(tr,cl),t=s.nodeType,t){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:Mt(null,"");break;default:t=t===8?s.parentNode:s,s=t.namespaceURI||null,t=t.tagName,s=Mt(s,t)}pt(tr),ht(tr,s)}function ha(){pt(tr),pt(dl),pt(ul)}function Zh(t){Tn(ul.current);var s=Tn(tr.current),n=Mt(s,t.type);s!==n&&(ht(dl,t),ht(tr,n))}function kc(t){dl.current===t&&(pt(tr),pt(dl))}var Nt=$r(0);function gi(t){for(var s=t;s!==null;){if(s.tag===13){var n=s.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Ec=[];function Pc(){for(var t=0;t<Ec.length;t++)Ec[t]._workInProgressVersionPrimary=null;Ec.length=0}var yi=_.ReactCurrentDispatcher,Tc=_.ReactCurrentBatchConfig,Rn=0,wt=null,Ft=null,Bt=null,vi=!1,hl=!1,ml=0,Oy=0;function Jt(){throw Error(l(321))}function Rc(t,s){if(s===null)return!1;for(var n=0;n<s.length&&n<t.length;n++)if(!Fs(t[n],s[n]))return!1;return!0}function Ic(t,s,n,i,d,x){if(Rn=x,wt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,yi.current=t===null||t.memoizedState===null?By:Uy,t=n(i,d),hl){x=0;do{if(hl=!1,ml=0,25<=x)throw Error(l(301));x+=1,Bt=Ft=null,s.updateQueue=null,yi.current=Vy,t=n(i,d)}while(hl)}if(yi.current=Ni,s=Ft!==null&&Ft.next!==null,Rn=0,Bt=Ft=wt=null,vi=!1,s)throw Error(l(300));return t}function _c(){var t=ml!==0;return ml=0,t}function sr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?wt.memoizedState=Bt=t:Bt=Bt.next=t,Bt}function Ms(){if(Ft===null){var t=wt.alternate;t=t!==null?t.memoizedState:null}else t=Ft.next;var s=Bt===null?wt.memoizedState:Bt.next;if(s!==null)Bt=s,Ft=t;else{if(t===null)throw Error(l(310));Ft=t,t={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},Bt===null?wt.memoizedState=Bt=t:Bt=Bt.next=t}return Bt}function fl(t,s){return typeof s=="function"?s(t):s}function Mc(t){var s=Ms(),n=s.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=t;var i=Ft,d=i.baseQueue,x=n.pending;if(x!==null){if(d!==null){var S=d.next;d.next=x.next,x.next=S}i.baseQueue=d=x,n.pending=null}if(d!==null){x=d.next,i=i.baseState;var M=S=null,z=null,re=x;do{var me=re.lane;if((Rn&me)===me)z!==null&&(z=z.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),i=re.hasEagerState?re.eagerState:t(i,re.action);else{var ye={lane:me,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};z===null?(M=z=ye,S=i):z=z.next=ye,wt.lanes|=me,In|=me}re=re.next}while(re!==null&&re!==x);z===null?S=i:z.next=M,Fs(i,s.memoizedState)||(ds=!0),s.memoizedState=i,s.baseState=S,s.baseQueue=z,n.lastRenderedState=i}if(t=n.interleaved,t!==null){d=t;do x=d.lane,wt.lanes|=x,In|=x,d=d.next;while(d!==t)}else d===null&&(n.lanes=0);return[s.memoizedState,n.dispatch]}function Ac(t){var s=Ms(),n=s.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=t;var i=n.dispatch,d=n.pending,x=s.memoizedState;if(d!==null){n.pending=null;var S=d=d.next;do x=t(x,S.action),S=S.next;while(S!==d);Fs(x,s.memoizedState)||(ds=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),n.lastRenderedState=x}return[x,i]}function em(){}function tm(t,s){var n=wt,i=Ms(),d=s(),x=!Fs(i.memoizedState,d);if(x&&(i.memoizedState=d,ds=!0),i=i.queue,Dc(nm.bind(null,n,i,t),[t]),i.getSnapshot!==s||x||Bt!==null&&Bt.memoizedState.tag&1){if(n.flags|=2048,xl(9,rm.bind(null,n,i,d,s),void 0,null),Ut===null)throw Error(l(349));(Rn&30)!==0||sm(n,s,d)}return d}function sm(t,s,n){t.flags|=16384,t={getSnapshot:s,value:n},s=wt.updateQueue,s===null?(s={lastEffect:null,stores:null},wt.updateQueue=s,s.stores=[t]):(n=s.stores,n===null?s.stores=[t]:n.push(t))}function rm(t,s,n,i){s.value=n,s.getSnapshot=i,am(s)&&lm(t)}function nm(t,s,n){return n(function(){am(s)&&lm(t)})}function am(t){var s=t.getSnapshot;t=t.value;try{var n=s();return!Fs(t,n)}catch{return!0}}function lm(t){var s=yr(t,1);s!==null&&Vs(s,t,1,-1)}function im(t){var s=sr();return typeof t=="function"&&(t=t()),s.memoizedState=s.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:t},s.queue=t,t=t.dispatch=$y.bind(null,wt,t),[s.memoizedState,t]}function xl(t,s,n,i){return t={tag:t,create:s,destroy:n,deps:i,next:null},s=wt.updateQueue,s===null?(s={lastEffect:null,stores:null},wt.updateQueue=s,s.lastEffect=t.next=t):(n=s.lastEffect,n===null?s.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,s.lastEffect=t)),t}function om(){return Ms().memoizedState}function ji(t,s,n,i){var d=sr();wt.flags|=t,d.memoizedState=xl(1|s,n,void 0,i===void 0?null:i)}function bi(t,s,n,i){var d=Ms();i=i===void 0?null:i;var x=void 0;if(Ft!==null){var S=Ft.memoizedState;if(x=S.destroy,i!==null&&Rc(i,S.deps)){d.memoizedState=xl(s,n,x,i);return}}wt.flags|=t,d.memoizedState=xl(1|s,n,x,i)}function cm(t,s){return ji(8390656,8,t,s)}function Dc(t,s){return bi(2048,8,t,s)}function dm(t,s){return bi(4,2,t,s)}function um(t,s){return bi(4,4,t,s)}function hm(t,s){if(typeof s=="function")return t=t(),s(t),function(){s(null)};if(s!=null)return t=t(),s.current=t,function(){s.current=null}}function mm(t,s,n){return n=n!=null?n.concat([t]):null,bi(4,4,hm.bind(null,s,t),n)}function Lc(){}function fm(t,s){var n=Ms();s=s===void 0?null:s;var i=n.memoizedState;return i!==null&&s!==null&&Rc(s,i[1])?i[0]:(n.memoizedState=[t,s],t)}function xm(t,s){var n=Ms();s=s===void 0?null:s;var i=n.memoizedState;return i!==null&&s!==null&&Rc(s,i[1])?i[0]:(t=t(),n.memoizedState=[t,s],t)}function pm(t,s,n){return(Rn&21)===0?(t.baseState&&(t.baseState=!1,ds=!0),t.memoizedState=n):(Fs(n,s)||(n=Ku(),wt.lanes|=n,In|=n,t.baseState=!0),s)}function Fy(t,s){var n=ct;ct=n!==0&&4>n?n:4,t(!0);var i=Tc.transition;Tc.transition={};try{t(!1),s()}finally{ct=n,Tc.transition=i}}function gm(){return Ms().memoizedState}function zy(t,s,n){var i=Yr(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},ym(t))vm(s,n);else if(n=Qh(t,s,n,i),n!==null){var d=as();Vs(n,t,i,d),jm(n,s,i)}}function $y(t,s,n){var i=Yr(t),d={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(ym(t))vm(s,d);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var S=s.lastRenderedState,M=x(S,n);if(d.hasEagerState=!0,d.eagerState=M,Fs(M,S)){var z=s.interleaved;z===null?(d.next=d,wc(s)):(d.next=z.next,z.next=d),s.interleaved=d;return}}catch{}finally{}n=Qh(t,s,d,i),n!==null&&(d=as(),Vs(n,t,i,d),jm(n,s,i))}}function ym(t){var s=t.alternate;return t===wt||s!==null&&s===wt}function vm(t,s){hl=vi=!0;var n=t.pending;n===null?s.next=s:(s.next=n.next,n.next=s),t.pending=s}function jm(t,s,n){if((n&4194240)!==0){var i=s.lanes;i&=t.pendingLanes,n|=i,s.lanes=n,Fo(t,n)}}var Ni={readContext:_s,useCallback:Jt,useContext:Jt,useEffect:Jt,useImperativeHandle:Jt,useInsertionEffect:Jt,useLayoutEffect:Jt,useMemo:Jt,useReducer:Jt,useRef:Jt,useState:Jt,useDebugValue:Jt,useDeferredValue:Jt,useTransition:Jt,useMutableSource:Jt,useSyncExternalStore:Jt,useId:Jt,unstable_isNewReconciler:!1},By={readContext:_s,useCallback:function(t,s){return sr().memoizedState=[t,s===void 0?null:s],t},useContext:_s,useEffect:cm,useImperativeHandle:function(t,s,n){return n=n!=null?n.concat([t]):null,ji(4194308,4,hm.bind(null,s,t),n)},useLayoutEffect:function(t,s){return ji(4194308,4,t,s)},useInsertionEffect:function(t,s){return ji(4,2,t,s)},useMemo:function(t,s){var n=sr();return s=s===void 0?null:s,t=t(),n.memoizedState=[t,s],t},useReducer:function(t,s,n){var i=sr();return s=n!==void 0?n(s):s,i.memoizedState=i.baseState=s,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},i.queue=t,t=t.dispatch=zy.bind(null,wt,t),[i.memoizedState,t]},useRef:function(t){var s=sr();return t={current:t},s.memoizedState=t},useState:im,useDebugValue:Lc,useDeferredValue:function(t){return sr().memoizedState=t},useTransition:function(){var t=im(!1),s=t[0];return t=Fy.bind(null,t[1]),sr().memoizedState=t,[s,t]},useMutableSource:function(){},useSyncExternalStore:function(t,s,n){var i=wt,d=sr();if(jt){if(n===void 0)throw Error(l(407));n=n()}else{if(n=s(),Ut===null)throw Error(l(349));(Rn&30)!==0||sm(i,s,n)}d.memoizedState=n;var x={value:n,getSnapshot:s};return d.queue=x,cm(nm.bind(null,i,x,t),[t]),i.flags|=2048,xl(9,rm.bind(null,i,x,n,s),void 0,null),n},useId:function(){var t=sr(),s=Ut.identifierPrefix;if(jt){var n=gr,i=pr;n=(i&~(1<<32-Os(i)-1)).toString(32)+n,s=":"+s+"R"+n,n=ml++,0<n&&(s+="H"+n.toString(32)),s+=":"}else n=Oy++,s=":"+s+"r"+n.toString(32)+":";return t.memoizedState=s},unstable_isNewReconciler:!1},Uy={readContext:_s,useCallback:fm,useContext:_s,useEffect:Dc,useImperativeHandle:mm,useInsertionEffect:dm,useLayoutEffect:um,useMemo:xm,useReducer:Mc,useRef:om,useState:function(){return Mc(fl)},useDebugValue:Lc,useDeferredValue:function(t){var s=Ms();return pm(s,Ft.memoizedState,t)},useTransition:function(){var t=Mc(fl)[0],s=Ms().memoizedState;return[t,s]},useMutableSource:em,useSyncExternalStore:tm,useId:gm,unstable_isNewReconciler:!1},Vy={readContext:_s,useCallback:fm,useContext:_s,useEffect:Dc,useImperativeHandle:mm,useInsertionEffect:dm,useLayoutEffect:um,useMemo:xm,useReducer:Ac,useRef:om,useState:function(){return Ac(fl)},useDebugValue:Lc,useDeferredValue:function(t){var s=Ms();return Ft===null?s.memoizedState=t:pm(s,Ft.memoizedState,t)},useTransition:function(){var t=Ac(fl)[0],s=Ms().memoizedState;return[t,s]},useMutableSource:em,useSyncExternalStore:tm,useId:gm,unstable_isNewReconciler:!1};function $s(t,s){if(t&&t.defaultProps){s=K({},s),t=t.defaultProps;for(var n in t)s[n]===void 0&&(s[n]=t[n]);return s}return s}function Oc(t,s,n,i){s=t.memoizedState,n=n(i,s),n=n==null?s:K({},s,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var wi={isMounted:function(t){return(t=t._reactInternals)?at(t)===t:!1},enqueueSetState:function(t,s,n){t=t._reactInternals;var i=as(),d=Yr(t),x=vr(i,d);x.payload=s,n!=null&&(x.callback=n),s=Wr(t,x,d),s!==null&&(Vs(s,t,d,i),xi(s,t,d))},enqueueReplaceState:function(t,s,n){t=t._reactInternals;var i=as(),d=Yr(t),x=vr(i,d);x.tag=1,x.payload=s,n!=null&&(x.callback=n),s=Wr(t,x,d),s!==null&&(Vs(s,t,d,i),xi(s,t,d))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var n=as(),i=Yr(t),d=vr(n,i);d.tag=2,s!=null&&(d.callback=s),s=Wr(t,d,i),s!==null&&(Vs(s,t,i,n),xi(s,t,i))}};function bm(t,s,n,i,d,x,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,x,S):s.prototype&&s.prototype.isPureReactComponent?!tl(n,i)||!tl(d,x):!0}function Nm(t,s,n){var i=!1,d=Br,x=s.contextType;return typeof x=="object"&&x!==null?x=_s(x):(d=cs(s)?Cn:Xt.current,i=s.contextTypes,x=(i=i!=null)?aa(t,d):Br),s=new s(n,x),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=wi,t.stateNode=s,s._reactInternals=t,i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=d,t.__reactInternalMemoizedMaskedChildContext=x),s}function wm(t,s,n,i){t=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(n,i),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(n,i),s.state!==t&&wi.enqueueReplaceState(s,s.state,null)}function Fc(t,s,n,i){var d=t.stateNode;d.props=n,d.state=t.memoizedState,d.refs={},Sc(t);var x=s.contextType;typeof x=="object"&&x!==null?d.context=_s(x):(x=cs(s)?Cn:Xt.current,d.context=aa(t,x)),d.state=t.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(Oc(t,s,x,n),d.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(s=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),s!==d.state&&wi.enqueueReplaceState(d,d.state,null),pi(t,n,d,i),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308)}function ma(t,s){try{var n="",i=s;do n+=G(i),i=i.return;while(i);var d=n}catch(x){d=`
|
||
Error generating stack: `+x.message+`
|
||
`+x.stack}return{value:t,source:s,stack:d,digest:null}}function zc(t,s,n){return{value:t,source:null,stack:n??null,digest:s??null}}function $c(t,s){try{console.error(s.value)}catch(n){setTimeout(function(){throw n})}}var Wy=typeof WeakMap=="function"?WeakMap:Map;function Sm(t,s,n){n=vr(-1,n),n.tag=3,n.payload={element:null};var i=s.value;return n.callback=function(){Ri||(Ri=!0,td=i),$c(t,s)},n}function Cm(t,s,n){n=vr(-1,n),n.tag=3;var i=t.type.getDerivedStateFromError;if(typeof i=="function"){var d=s.value;n.payload=function(){return i(d)},n.callback=function(){$c(t,s)}}var x=t.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(n.callback=function(){$c(t,s),typeof i!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})}),n}function km(t,s,n){var i=t.pingCache;if(i===null){i=t.pingCache=new Wy;var d=new Set;i.set(s,d)}else d=i.get(s),d===void 0&&(d=new Set,i.set(s,d));d.has(n)||(d.add(n),t=nv.bind(null,t,s,n),s.then(t,t))}function Em(t){do{var s;if((s=t.tag===13)&&(s=t.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return t;t=t.return}while(t!==null);return null}function Pm(t,s,n,i,d){return(t.mode&1)===0?(t===s?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(s=vr(-1,1),s.tag=2,Wr(n,s,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=d,t)}var Hy=_.ReactCurrentOwner,ds=!1;function ns(t,s,n,i){s.child=t===null?Yh(s,null,n,i):ca(s,t.child,n,i)}function Tm(t,s,n,i,d){n=n.render;var x=s.ref;return ua(s,d),i=Ic(t,s,n,i,x,d),n=_c(),t!==null&&!ds?(s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~d,jr(t,s,d)):(jt&&n&&fc(s),s.flags|=1,ns(t,s,i,d),s.child)}function Rm(t,s,n,i,d){if(t===null){var x=n.type;return typeof x=="function"&&!od(x)&&x.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(s.tag=15,s.type=x,Im(t,s,x,i,d)):(t=Li(n.type,null,i,s,s.mode,d),t.ref=s.ref,t.return=s,s.child=t)}if(x=t.child,(t.lanes&d)===0){var S=x.memoizedProps;if(n=n.compare,n=n!==null?n:tl,n(S,i)&&t.ref===s.ref)return jr(t,s,d)}return s.flags|=1,t=qr(x,i),t.ref=s.ref,t.return=s,s.child=t}function Im(t,s,n,i,d){if(t!==null){var x=t.memoizedProps;if(tl(x,i)&&t.ref===s.ref)if(ds=!1,s.pendingProps=i=x,(t.lanes&d)!==0)(t.flags&131072)!==0&&(ds=!0);else return s.lanes=t.lanes,jr(t,s,d)}return Bc(t,s,n,i,d)}function _m(t,s,n){var i=s.pendingProps,d=i.children,x=t!==null?t.memoizedState:null;if(i.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},ht(xa,Ns),Ns|=n;else{if((n&1073741824)===0)return t=x!==null?x.baseLanes|n:n,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:t,cachePool:null,transitions:null},s.updateQueue=null,ht(xa,Ns),Ns|=t,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=x!==null?x.baseLanes:n,ht(xa,Ns),Ns|=i}else x!==null?(i=x.baseLanes|n,s.memoizedState=null):i=n,ht(xa,Ns),Ns|=i;return ns(t,s,d,n),s.child}function Mm(t,s){var n=s.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(s.flags|=512,s.flags|=2097152)}function Bc(t,s,n,i,d){var x=cs(n)?Cn:Xt.current;return x=aa(s,x),ua(s,d),n=Ic(t,s,n,i,x,d),i=_c(),t!==null&&!ds?(s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~d,jr(t,s,d)):(jt&&i&&fc(s),s.flags|=1,ns(t,s,n,d),s.child)}function Am(t,s,n,i,d){if(cs(n)){var x=!0;ii(s)}else x=!1;if(ua(s,d),s.stateNode===null)Ci(t,s),Nm(s,n,i),Fc(s,n,i,d),i=!0;else if(t===null){var S=s.stateNode,M=s.memoizedProps;S.props=M;var z=S.context,re=n.contextType;typeof re=="object"&&re!==null?re=_s(re):(re=cs(n)?Cn:Xt.current,re=aa(s,re));var me=n.getDerivedStateFromProps,ye=typeof me=="function"||typeof S.getSnapshotBeforeUpdate=="function";ye||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M!==i||z!==re)&&wm(s,S,i,re),Vr=!1;var he=s.memoizedState;S.state=he,pi(s,i,S,d),z=s.memoizedState,M!==i||he!==z||os.current||Vr?(typeof me=="function"&&(Oc(s,n,me,i),z=s.memoizedState),(M=Vr||bm(s,n,M,i,he,z,re))?(ye||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(s.flags|=4194308)):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=i,s.memoizedState=z),S.props=i,S.state=z,S.context=re,i=M):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),i=!1)}else{S=s.stateNode,qh(t,s),M=s.memoizedProps,re=s.type===s.elementType?M:$s(s.type,M),S.props=re,ye=s.pendingProps,he=S.context,z=n.contextType,typeof z=="object"&&z!==null?z=_s(z):(z=cs(n)?Cn:Xt.current,z=aa(s,z));var Pe=n.getDerivedStateFromProps;(me=typeof Pe=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M!==ye||he!==z)&&wm(s,S,i,z),Vr=!1,he=s.memoizedState,S.state=he,pi(s,i,S,d);var _e=s.memoizedState;M!==ye||he!==_e||os.current||Vr?(typeof Pe=="function"&&(Oc(s,n,Pe,i),_e=s.memoizedState),(re=Vr||bm(s,n,re,i,he,_e,z)||!1)?(me||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(i,_e,z),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(i,_e,z)),typeof S.componentDidUpdate=="function"&&(s.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof S.componentDidUpdate!="function"||M===t.memoizedProps&&he===t.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===t.memoizedProps&&he===t.memoizedState||(s.flags|=1024),s.memoizedProps=i,s.memoizedState=_e),S.props=i,S.state=_e,S.context=z,i=re):(typeof S.componentDidUpdate!="function"||M===t.memoizedProps&&he===t.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===t.memoizedProps&&he===t.memoizedState||(s.flags|=1024),i=!1)}return Uc(t,s,n,i,x,d)}function Uc(t,s,n,i,d,x){Mm(t,s);var S=(s.flags&128)!==0;if(!i&&!S)return d&&zh(s,n,!1),jr(t,s,x);i=s.stateNode,Hy.current=s;var M=S&&typeof n.getDerivedStateFromError!="function"?null:i.render();return s.flags|=1,t!==null&&S?(s.child=ca(s,t.child,null,x),s.child=ca(s,null,M,x)):ns(t,s,M,x),s.memoizedState=i.state,d&&zh(s,n,!0),s.child}function Dm(t){var s=t.stateNode;s.pendingContext?Oh(t,s.pendingContext,s.pendingContext!==s.context):s.context&&Oh(t,s.context,!1),Cc(t,s.containerInfo)}function Lm(t,s,n,i,d){return oa(),yc(d),s.flags|=256,ns(t,s,n,i),s.child}var Vc={dehydrated:null,treeContext:null,retryLane:0};function Wc(t){return{baseLanes:t,cachePool:null,transitions:null}}function Om(t,s,n){var i=s.pendingProps,d=Nt.current,x=!1,S=(s.flags&128)!==0,M;if((M=S)||(M=t!==null&&t.memoizedState===null?!1:(d&2)!==0),M?(x=!0,s.flags&=-129):(t===null||t.memoizedState!==null)&&(d|=1),ht(Nt,d&1),t===null)return gc(s),t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((s.mode&1)===0?s.lanes=1:t.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(S=i.children,t=i.fallback,x?(i=s.mode,x=s.child,S={mode:"hidden",children:S},(i&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=S):x=Oi(S,i,0,null),t=Dn(t,i,n,null),x.return=s,t.return=s,x.sibling=t,s.child=x,s.child.memoizedState=Wc(n),s.memoizedState=Vc,t):Hc(s,S));if(d=t.memoizedState,d!==null&&(M=d.dehydrated,M!==null))return Ky(t,s,S,i,M,d,n);if(x){x=i.fallback,S=s.mode,d=t.child,M=d.sibling;var z={mode:"hidden",children:i.children};return(S&1)===0&&s.child!==d?(i=s.child,i.childLanes=0,i.pendingProps=z,s.deletions=null):(i=qr(d,z),i.subtreeFlags=d.subtreeFlags&14680064),M!==null?x=qr(M,x):(x=Dn(x,S,n,null),x.flags|=2),x.return=s,i.return=s,i.sibling=x,s.child=i,i=x,x=s.child,S=t.child.memoizedState,S=S===null?Wc(n):{baseLanes:S.baseLanes|n,cachePool:null,transitions:S.transitions},x.memoizedState=S,x.childLanes=t.childLanes&~n,s.memoizedState=Vc,i}return x=t.child,t=x.sibling,i=qr(x,{mode:"visible",children:i.children}),(s.mode&1)===0&&(i.lanes=n),i.return=s,i.sibling=null,t!==null&&(n=s.deletions,n===null?(s.deletions=[t],s.flags|=16):n.push(t)),s.child=i,s.memoizedState=null,i}function Hc(t,s){return s=Oi({mode:"visible",children:s},t.mode,0,null),s.return=t,t.child=s}function Si(t,s,n,i){return i!==null&&yc(i),ca(s,t.child,null,n),t=Hc(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function Ky(t,s,n,i,d,x,S){if(n)return s.flags&256?(s.flags&=-257,i=zc(Error(l(422))),Si(t,s,S,i)):s.memoizedState!==null?(s.child=t.child,s.flags|=128,null):(x=i.fallback,d=s.mode,i=Oi({mode:"visible",children:i.children},d,0,null),x=Dn(x,d,S,null),x.flags|=2,i.return=s,x.return=s,i.sibling=x,s.child=i,(s.mode&1)!==0&&ca(s,t.child,null,S),s.child.memoizedState=Wc(S),s.memoizedState=Vc,x);if((s.mode&1)===0)return Si(t,s,S,null);if(d.data==="$!"){if(i=d.nextSibling&&d.nextSibling.dataset,i)var M=i.dgst;return i=M,x=Error(l(419)),i=zc(x,i,void 0),Si(t,s,S,i)}if(M=(S&t.childLanes)!==0,ds||M){if(i=Ut,i!==null){switch(S&-S){case 4:d=2;break;case 16:d=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:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(i.suspendedLanes|S))!==0?0:d,d!==0&&d!==x.retryLane&&(x.retryLane=d,yr(t,d),Vs(i,t,d,-1))}return id(),i=zc(Error(l(421))),Si(t,s,S,i)}return d.data==="$?"?(s.flags|=128,s.child=t.child,s=av.bind(null,t),d._reactRetry=s,null):(t=x.treeContext,bs=zr(d.nextSibling),js=s,jt=!0,zs=null,t!==null&&(Rs[Is++]=pr,Rs[Is++]=gr,Rs[Is++]=kn,pr=t.id,gr=t.overflow,kn=s),s=Hc(s,i.children),s.flags|=4096,s)}function Fm(t,s,n){t.lanes|=s;var i=t.alternate;i!==null&&(i.lanes|=s),Nc(t.return,s,n)}function Kc(t,s,n,i,d){var x=t.memoizedState;x===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:d}:(x.isBackwards=s,x.rendering=null,x.renderingStartTime=0,x.last=i,x.tail=n,x.tailMode=d)}function zm(t,s,n){var i=s.pendingProps,d=i.revealOrder,x=i.tail;if(ns(t,s,i.children,n),i=Nt.current,(i&2)!==0)i=i&1|2,s.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Fm(t,n,s);else if(t.tag===19)Fm(t,n,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===s)break e;for(;t.sibling===null;){if(t.return===null||t.return===s)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(ht(Nt,i),(s.mode&1)===0)s.memoizedState=null;else switch(d){case"forwards":for(n=s.child,d=null;n!==null;)t=n.alternate,t!==null&&gi(t)===null&&(d=n),n=n.sibling;n=d,n===null?(d=s.child,s.child=null):(d=n.sibling,n.sibling=null),Kc(s,!1,d,n,x);break;case"backwards":for(n=null,d=s.child,s.child=null;d!==null;){if(t=d.alternate,t!==null&&gi(t)===null){s.child=d;break}t=d.sibling,d.sibling=n,n=d,d=t}Kc(s,!0,n,null,x);break;case"together":Kc(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Ci(t,s){(s.mode&1)===0&&t!==null&&(t.alternate=null,s.alternate=null,s.flags|=2)}function jr(t,s,n){if(t!==null&&(s.dependencies=t.dependencies),In|=s.lanes,(n&s.childLanes)===0)return null;if(t!==null&&s.child!==t.child)throw Error(l(153));if(s.child!==null){for(t=s.child,n=qr(t,t.pendingProps),s.child=n,n.return=s;t.sibling!==null;)t=t.sibling,n=n.sibling=qr(t,t.pendingProps),n.return=s;n.sibling=null}return s.child}function Gy(t,s,n){switch(s.tag){case 3:Dm(s),oa();break;case 5:Zh(s);break;case 1:cs(s.type)&&ii(s);break;case 4:Cc(s,s.stateNode.containerInfo);break;case 10:var i=s.type._context,d=s.memoizedProps.value;ht(mi,i._currentValue),i._currentValue=d;break;case 13:if(i=s.memoizedState,i!==null)return i.dehydrated!==null?(ht(Nt,Nt.current&1),s.flags|=128,null):(n&s.child.childLanes)!==0?Om(t,s,n):(ht(Nt,Nt.current&1),t=jr(t,s,n),t!==null?t.sibling:null);ht(Nt,Nt.current&1);break;case 19:if(i=(n&s.childLanes)!==0,(t.flags&128)!==0){if(i)return zm(t,s,n);s.flags|=128}if(d=s.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ht(Nt,Nt.current),i)break;return null;case 22:case 23:return s.lanes=0,_m(t,s,n)}return jr(t,s,n)}var $m,Gc,Bm,Um;$m=function(t,s){for(var n=s.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===s)break;for(;n.sibling===null;){if(n.return===null||n.return===s)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Gc=function(){},Bm=function(t,s,n,i){var d=t.memoizedProps;if(d!==i){t=s.stateNode,Tn(tr.current);var x=null;switch(n){case"input":d=Ue(t,d),i=Ue(t,i),x=[];break;case"select":d=K({},d,{value:void 0}),i=K({},i,{value:void 0}),x=[];break;case"textarea":d=dr(t,d),i=dr(t,i),x=[];break;default:typeof d.onClick!="function"&&typeof i.onClick=="function"&&(t.onclick=ni)}bn(n,i);var S;n=null;for(re in d)if(!i.hasOwnProperty(re)&&d.hasOwnProperty(re)&&d[re]!=null)if(re==="style"){var M=d[re];for(S in M)M.hasOwnProperty(S)&&(n||(n={}),n[S]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(c.hasOwnProperty(re)?x||(x=[]):(x=x||[]).push(re,null));for(re in i){var z=i[re];if(M=d!=null?d[re]:void 0,i.hasOwnProperty(re)&&z!==M&&(z!=null||M!=null))if(re==="style")if(M){for(S in M)!M.hasOwnProperty(S)||z&&z.hasOwnProperty(S)||(n||(n={}),n[S]="");for(S in z)z.hasOwnProperty(S)&&M[S]!==z[S]&&(n||(n={}),n[S]=z[S])}else n||(x||(x=[]),x.push(re,n)),n=z;else re==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,M=M?M.__html:void 0,z!=null&&M!==z&&(x=x||[]).push(re,z)):re==="children"?typeof z!="string"&&typeof z!="number"||(x=x||[]).push(re,""+z):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(c.hasOwnProperty(re)?(z!=null&&re==="onScroll"&&xt("scroll",t),x||M===z||(x=[])):(x=x||[]).push(re,z))}n&&(x=x||[]).push("style",n);var re=x;(s.updateQueue=re)&&(s.flags|=4)}},Um=function(t,s,n,i){n!==i&&(s.flags|=4)};function pl(t,s){if(!jt)switch(t.tailMode){case"hidden":s=t.tail;for(var n=null;s!==null;)s.alternate!==null&&(n=s),s=s.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?s||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Zt(t){var s=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(s)for(var d=t.child;d!==null;)n|=d.lanes|d.childLanes,i|=d.subtreeFlags&14680064,i|=d.flags&14680064,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)n|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=i,t.childLanes=n,s}function Yy(t,s,n){var i=s.pendingProps;switch(xc(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(s),null;case 1:return cs(s.type)&&li(),Zt(s),null;case 3:return i=s.stateNode,ha(),pt(os),pt(Xt),Pc(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(ui(s)?s.flags|=4:t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,zs!==null&&(nd(zs),zs=null))),Gc(t,s),Zt(s),null;case 5:kc(s);var d=Tn(ul.current);if(n=s.type,t!==null&&s.stateNode!=null)Bm(t,s,n,i,d),t.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!i){if(s.stateNode===null)throw Error(l(166));return Zt(s),null}if(t=Tn(tr.current),ui(s)){i=s.stateNode,n=s.type;var x=s.memoizedProps;switch(i[er]=s,i[ll]=x,t=(s.mode&1)!==0,n){case"dialog":xt("cancel",i),xt("close",i);break;case"iframe":case"object":case"embed":xt("load",i);break;case"video":case"audio":for(d=0;d<rl.length;d++)xt(rl[d],i);break;case"source":xt("error",i);break;case"img":case"image":case"link":xt("error",i),xt("load",i);break;case"details":xt("toggle",i);break;case"input":Ze(i,x),xt("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!x.multiple},xt("invalid",i);break;case"textarea":Ht(i,x),xt("invalid",i)}bn(n,x),d=null;for(var S in x)if(x.hasOwnProperty(S)){var M=x[S];S==="children"?typeof M=="string"?i.textContent!==M&&(x.suppressHydrationWarning!==!0&&ri(i.textContent,M,t),d=["children",M]):typeof M=="number"&&i.textContent!==""+M&&(x.suppressHydrationWarning!==!0&&ri(i.textContent,M,t),d=["children",""+M]):c.hasOwnProperty(S)&&M!=null&&S==="onScroll"&&xt("scroll",i)}switch(n){case"input":ue(i),ge(i,x,!0);break;case"textarea":ue(i),Kt(i);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(i.onclick=ni)}i=d,s.updateQueue=i,i!==null&&(s.flags|=4)}else{S=d.nodeType===9?d:d.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=vn(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=S.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=S.createElement(n,{is:i.is}):(t=S.createElement(n),n==="select"&&(S=t,i.multiple?S.multiple=!0:i.size&&(S.size=i.size))):t=S.createElementNS(t,n),t[er]=s,t[ll]=i,$m(t,s,!1,!1),s.stateNode=t;e:{switch(S=mr(n,i),n){case"dialog":xt("cancel",t),xt("close",t),d=i;break;case"iframe":case"object":case"embed":xt("load",t),d=i;break;case"video":case"audio":for(d=0;d<rl.length;d++)xt(rl[d],t);d=i;break;case"source":xt("error",t),d=i;break;case"img":case"image":case"link":xt("error",t),xt("load",t),d=i;break;case"details":xt("toggle",t),d=i;break;case"input":Ze(t,i),d=Ue(t,i),xt("invalid",t);break;case"option":d=i;break;case"select":t._wrapperState={wasMultiple:!!i.multiple},d=K({},i,{value:void 0}),xt("invalid",t);break;case"textarea":Ht(t,i),d=dr(t,i),xt("invalid",t);break;default:d=i}bn(n,d),M=d;for(x in M)if(M.hasOwnProperty(x)){var z=M[x];x==="style"?Ls(t,z):x==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,z!=null&&Vn(t,z)):x==="children"?typeof z=="string"?(n!=="textarea"||z!=="")&&ls(t,z):typeof z=="number"&&ls(t,""+z):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(c.hasOwnProperty(x)?z!=null&&x==="onScroll"&&xt("scroll",t):z!=null&&N(t,x,z,S))}switch(n){case"input":ue(t),ge(t,i,!1);break;case"textarea":ue(t),Kt(t);break;case"option":i.value!=null&&t.setAttribute("value",""+pe(i.value));break;case"select":t.multiple=!!i.multiple,x=i.value,x!=null?ss(t,!!i.multiple,x,!1):i.defaultValue!=null&&ss(t,!!i.multiple,i.defaultValue,!0);break;default:typeof d.onClick=="function"&&(t.onclick=ni)}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&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return Zt(s),null;case 6:if(t&&s.stateNode!=null)Um(t,s,t.memoizedProps,i);else{if(typeof i!="string"&&s.stateNode===null)throw Error(l(166));if(n=Tn(ul.current),Tn(tr.current),ui(s)){if(i=s.stateNode,n=s.memoizedProps,i[er]=s,(x=i.nodeValue!==n)&&(t=js,t!==null))switch(t.tag){case 3:ri(i.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&ri(i.nodeValue,n,(t.mode&1)!==0)}x&&(s.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[er]=s,s.stateNode=i}return Zt(s),null;case 13:if(pt(Nt),i=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(jt&&bs!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Hh(),oa(),s.flags|=98560,x=!1;else if(x=ui(s),i!==null&&i.dehydrated!==null){if(t===null){if(!x)throw Error(l(318));if(x=s.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(l(317));x[er]=s}else oa(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Zt(s),x=!1}else zs!==null&&(nd(zs),zs=null),x=!0;if(!x)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=n,s):(i=i!==null,i!==(t!==null&&t.memoizedState!==null)&&i&&(s.child.flags|=8192,(s.mode&1)!==0&&(t===null||(Nt.current&1)!==0?zt===0&&(zt=3):id())),s.updateQueue!==null&&(s.flags|=4),Zt(s),null);case 4:return ha(),Gc(t,s),t===null&&nl(s.stateNode.containerInfo),Zt(s),null;case 10:return bc(s.type._context),Zt(s),null;case 17:return cs(s.type)&&li(),Zt(s),null;case 19:if(pt(Nt),x=s.memoizedState,x===null)return Zt(s),null;if(i=(s.flags&128)!==0,S=x.rendering,S===null)if(i)pl(x,!1);else{if(zt!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(S=gi(t),S!==null){for(s.flags|=128,pl(x,!1),i=S.updateQueue,i!==null&&(s.updateQueue=i,s.flags|=4),s.subtreeFlags=0,i=n,n=s.child;n!==null;)x=n,t=i,x.flags&=14680066,S=x.alternate,S===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=S.childLanes,x.lanes=S.lanes,x.child=S.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=S.memoizedProps,x.memoizedState=S.memoizedState,x.updateQueue=S.updateQueue,x.type=S.type,t=S.dependencies,x.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return ht(Nt,Nt.current&1|2),s.child}t=t.sibling}x.tail!==null&&Tt()>pa&&(s.flags|=128,i=!0,pl(x,!1),s.lanes=4194304)}else{if(!i)if(t=gi(S),t!==null){if(s.flags|=128,i=!0,n=t.updateQueue,n!==null&&(s.updateQueue=n,s.flags|=4),pl(x,!0),x.tail===null&&x.tailMode==="hidden"&&!S.alternate&&!jt)return Zt(s),null}else 2*Tt()-x.renderingStartTime>pa&&n!==1073741824&&(s.flags|=128,i=!0,pl(x,!1),s.lanes=4194304);x.isBackwards?(S.sibling=s.child,s.child=S):(n=x.last,n!==null?n.sibling=S:s.child=S,x.last=S)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=Tt(),s.sibling=null,n=Nt.current,ht(Nt,i?n&1|2:n&1),s):(Zt(s),null);case 22:case 23:return ld(),i=s.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(s.flags|=8192),i&&(s.mode&1)!==0?(Ns&1073741824)!==0&&(Zt(s),s.subtreeFlags&6&&(s.flags|=8192)):Zt(s),null;case 24:return null;case 25:return null}throw Error(l(156,s.tag))}function Qy(t,s){switch(xc(s),s.tag){case 1:return cs(s.type)&&li(),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return ha(),pt(os),pt(Xt),Pc(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 5:return kc(s),null;case 13:if(pt(Nt),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));oa()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return pt(Nt),null;case 4:return ha(),null;case 10:return bc(s.type._context),null;case 22:case 23:return ld(),null;case 24:return null;default:return null}}var ki=!1,es=!1,qy=typeof WeakSet=="function"?WeakSet:Set,Re=null;function fa(t,s){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){Et(t,s,i)}else n.current=null}function Yc(t,s,n){try{n()}catch(i){Et(t,s,i)}}var Vm=!1;function Xy(t,s){if(lc=Kl,t=bh(),Jo(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 d=i.anchorOffset,x=i.focusNode;i=i.focusOffset;try{n.nodeType,x.nodeType}catch{n=null;break e}var S=0,M=-1,z=-1,re=0,me=0,ye=t,he=null;t:for(;;){for(var Pe;ye!==n||d!==0&&ye.nodeType!==3||(M=S+d),ye!==x||i!==0&&ye.nodeType!==3||(z=S+i),ye.nodeType===3&&(S+=ye.nodeValue.length),(Pe=ye.firstChild)!==null;)he=ye,ye=Pe;for(;;){if(ye===t)break t;if(he===n&&++re===d&&(M=S),he===x&&++me===i&&(z=S),(Pe=ye.nextSibling)!==null)break;ye=he,he=ye.parentNode}ye=Pe}n=M===-1||z===-1?null:{start:M,end:z}}else n=null}n=n||{start:0,end:0}}else n=null;for(ic={focusedElem:t,selectionRange:n},Kl=!1,Re=s;Re!==null;)if(s=Re,t=s.child,(s.subtreeFlags&1028)!==0&&t!==null)t.return=s,Re=t;else for(;Re!==null;){s=Re;try{var _e=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var De=_e.memoizedProps,Rt=_e.memoizedState,Q=s.stateNode,W=Q.getSnapshotBeforeUpdate(s.elementType===s.type?De:$s(s.type,De),Rt);Q.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var J=s.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(je){Et(s,s.return,je)}if(t=s.sibling,t!==null){t.return=s.return,Re=t;break}Re=s.return}return _e=Vm,Vm=!1,_e}function gl(t,s,n){var i=s.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var d=i=i.next;do{if((d.tag&t)===t){var x=d.destroy;d.destroy=void 0,x!==void 0&&Yc(s,n,x)}d=d.next}while(d!==i)}}function Ei(t,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var n=s=s.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==s)}}function Qc(t){var s=t.ref;if(s!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof s=="function"?s(t):s.current=t}}function Wm(t){var s=t.alternate;s!==null&&(t.alternate=null,Wm(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&(delete s[er],delete s[ll],delete s[uc],delete s[My],delete s[Ay])),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 Hm(t){return t.tag===5||t.tag===3||t.tag===4}function Km(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Hm(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 qc(t,s,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.nodeType===8?n.parentNode.insertBefore(t,s):n.insertBefore(t,s):(n.nodeType===8?(s=n.parentNode,s.insertBefore(t,n)):(s=n,s.appendChild(t)),n=n._reactRootContainer,n!=null||s.onclick!==null||(s.onclick=ni));else if(i!==4&&(t=t.child,t!==null))for(qc(t,s,n),t=t.sibling;t!==null;)qc(t,s,n),t=t.sibling}function Xc(t,s,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.insertBefore(t,s):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(Xc(t,s,n),t=t.sibling;t!==null;)Xc(t,s,n),t=t.sibling}var Gt=null,Bs=!1;function Hr(t,s,n){for(n=n.child;n!==null;)Gm(t,s,n),n=n.sibling}function Gm(t,s,n){if(Zs&&typeof Zs.onCommitFiberUnmount=="function")try{Zs.onCommitFiberUnmount($l,n)}catch{}switch(n.tag){case 5:es||fa(n,s);case 6:var i=Gt,d=Bs;Gt=null,Hr(t,s,n),Gt=i,Bs=d,Gt!==null&&(Bs?(t=Gt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Gt.removeChild(n.stateNode));break;case 18:Gt!==null&&(Bs?(t=Gt,n=n.stateNode,t.nodeType===8?dc(t.parentNode,n):t.nodeType===1&&dc(t,n),Qa(t)):dc(Gt,n.stateNode));break;case 4:i=Gt,d=Bs,Gt=n.stateNode.containerInfo,Bs=!0,Hr(t,s,n),Gt=i,Bs=d;break;case 0:case 11:case 14:case 15:if(!es&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){d=i=i.next;do{var x=d,S=x.destroy;x=x.tag,S!==void 0&&((x&2)!==0||(x&4)!==0)&&Yc(n,s,S),d=d.next}while(d!==i)}Hr(t,s,n);break;case 1:if(!es&&(fa(n,s),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(M){Et(n,s,M)}Hr(t,s,n);break;case 21:Hr(t,s,n);break;case 22:n.mode&1?(es=(i=es)||n.memoizedState!==null,Hr(t,s,n),es=i):Hr(t,s,n);break;default:Hr(t,s,n)}}function Ym(t){var s=t.updateQueue;if(s!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new qy),s.forEach(function(i){var d=lv.bind(null,t,i);n.has(i)||(n.add(i),i.then(d,d))})}}function Us(t,s){var n=s.deletions;if(n!==null)for(var i=0;i<n.length;i++){var d=n[i];try{var x=t,S=s,M=S;e:for(;M!==null;){switch(M.tag){case 5:Gt=M.stateNode,Bs=!1;break e;case 3:Gt=M.stateNode.containerInfo,Bs=!0;break e;case 4:Gt=M.stateNode.containerInfo,Bs=!0;break e}M=M.return}if(Gt===null)throw Error(l(160));Gm(x,S,d),Gt=null,Bs=!1;var z=d.alternate;z!==null&&(z.return=null),d.return=null}catch(re){Et(d,s,re)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)Qm(s,t),s=s.sibling}function Qm(t,s){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Us(s,t),rr(t),i&4){try{gl(3,t,t.return),Ei(3,t)}catch(De){Et(t,t.return,De)}try{gl(5,t,t.return)}catch(De){Et(t,t.return,De)}}break;case 1:Us(s,t),rr(t),i&512&&n!==null&&fa(n,n.return);break;case 5:if(Us(s,t),rr(t),i&512&&n!==null&&fa(n,n.return),t.flags&32){var d=t.stateNode;try{ls(d,"")}catch(De){Et(t,t.return,De)}}if(i&4&&(d=t.stateNode,d!=null)){var x=t.memoizedProps,S=n!==null?n.memoizedProps:x,M=t.type,z=t.updateQueue;if(t.updateQueue=null,z!==null)try{M==="input"&&x.type==="radio"&&x.name!=null&&et(d,x),mr(M,S);var re=mr(M,x);for(S=0;S<z.length;S+=2){var me=z[S],ye=z[S+1];me==="style"?Ls(d,ye):me==="dangerouslySetInnerHTML"?Vn(d,ye):me==="children"?ls(d,ye):N(d,me,ye,re)}switch(M){case"input":tt(d,x);break;case"textarea":Cs(d,x);break;case"select":var he=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!x.multiple;var Pe=x.value;Pe!=null?ss(d,!!x.multiple,Pe,!1):he!==!!x.multiple&&(x.defaultValue!=null?ss(d,!!x.multiple,x.defaultValue,!0):ss(d,!!x.multiple,x.multiple?[]:"",!1))}d[ll]=x}catch(De){Et(t,t.return,De)}}break;case 6:if(Us(s,t),rr(t),i&4){if(t.stateNode===null)throw Error(l(162));d=t.stateNode,x=t.memoizedProps;try{d.nodeValue=x}catch(De){Et(t,t.return,De)}}break;case 3:if(Us(s,t),rr(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Qa(s.containerInfo)}catch(De){Et(t,t.return,De)}break;case 4:Us(s,t),rr(t);break;case 13:Us(s,t),rr(t),d=t.child,d.flags&8192&&(x=d.memoizedState!==null,d.stateNode.isHidden=x,!x||d.alternate!==null&&d.alternate.memoizedState!==null||(ed=Tt())),i&4&&Ym(t);break;case 22:if(me=n!==null&&n.memoizedState!==null,t.mode&1?(es=(re=es)||me,Us(s,t),es=re):Us(s,t),rr(t),i&8192){if(re=t.memoizedState!==null,(t.stateNode.isHidden=re)&&!me&&(t.mode&1)!==0)for(Re=t,me=t.child;me!==null;){for(ye=Re=me;Re!==null;){switch(he=Re,Pe=he.child,he.tag){case 0:case 11:case 14:case 15:gl(4,he,he.return);break;case 1:fa(he,he.return);var _e=he.stateNode;if(typeof _e.componentWillUnmount=="function"){i=he,n=he.return;try{s=i,_e.props=s.memoizedProps,_e.state=s.memoizedState,_e.componentWillUnmount()}catch(De){Et(i,n,De)}}break;case 5:fa(he,he.return);break;case 22:if(he.memoizedState!==null){Jm(ye);continue}}Pe!==null?(Pe.return=he,Re=Pe):Jm(ye)}me=me.sibling}e:for(me=null,ye=t;;){if(ye.tag===5){if(me===null){me=ye;try{d=ye.stateNode,re?(x=d.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(M=ye.stateNode,z=ye.memoizedProps.style,S=z!=null&&z.hasOwnProperty("display")?z.display:null,M.style.display=Es("display",S))}catch(De){Et(t,t.return,De)}}}else if(ye.tag===6){if(me===null)try{ye.stateNode.nodeValue=re?"":ye.memoizedProps}catch(De){Et(t,t.return,De)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===t)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===t)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===t)break e;me===ye&&(me=null),ye=ye.return}me===ye&&(me=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:Us(s,t),rr(t),i&4&&Ym(t);break;case 21:break;default:Us(s,t),rr(t)}}function rr(t){var s=t.flags;if(s&2){try{e:{for(var n=t.return;n!==null;){if(Hm(n)){var i=n;break e}n=n.return}throw Error(l(160))}switch(i.tag){case 5:var d=i.stateNode;i.flags&32&&(ls(d,""),i.flags&=-33);var x=Km(t);Xc(t,x,d);break;case 3:case 4:var S=i.stateNode.containerInfo,M=Km(t);qc(t,M,S);break;default:throw Error(l(161))}}catch(z){Et(t,t.return,z)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function Jy(t,s,n){Re=t,qm(t)}function qm(t,s,n){for(var i=(t.mode&1)!==0;Re!==null;){var d=Re,x=d.child;if(d.tag===22&&i){var S=d.memoizedState!==null||ki;if(!S){var M=d.alternate,z=M!==null&&M.memoizedState!==null||es;M=ki;var re=es;if(ki=S,(es=z)&&!re)for(Re=d;Re!==null;)S=Re,z=S.child,S.tag===22&&S.memoizedState!==null?Zm(d):z!==null?(z.return=S,Re=z):Zm(d);for(;x!==null;)Re=x,qm(x),x=x.sibling;Re=d,ki=M,es=re}Xm(t)}else(d.subtreeFlags&8772)!==0&&x!==null?(x.return=d,Re=x):Xm(t)}}function Xm(t){for(;Re!==null;){var s=Re;if((s.flags&8772)!==0){var n=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:es||Ei(5,s);break;case 1:var i=s.stateNode;if(s.flags&4&&!es)if(n===null)i.componentDidMount();else{var d=s.elementType===s.type?n.memoizedProps:$s(s.type,n.memoizedProps);i.componentDidUpdate(d,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var x=s.updateQueue;x!==null&&Jh(s,x,i);break;case 3:var S=s.updateQueue;if(S!==null){if(n=null,s.child!==null)switch(s.child.tag){case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}Jh(s,S,n)}break;case 5:var M=s.stateNode;if(n===null&&s.flags&4){n=M;var z=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":z.autoFocus&&n.focus();break;case"img":z.src&&(n.src=z.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var re=s.alternate;if(re!==null){var me=re.memoizedState;if(me!==null){var ye=me.dehydrated;ye!==null&&Qa(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}es||s.flags&512&&Qc(s)}catch(he){Et(s,s.return,he)}}if(s===t){Re=null;break}if(n=s.sibling,n!==null){n.return=s.return,Re=n;break}Re=s.return}}function Jm(t){for(;Re!==null;){var s=Re;if(s===t){Re=null;break}var n=s.sibling;if(n!==null){n.return=s.return,Re=n;break}Re=s.return}}function Zm(t){for(;Re!==null;){var s=Re;try{switch(s.tag){case 0:case 11:case 15:var n=s.return;try{Ei(4,s)}catch(z){Et(s,n,z)}break;case 1:var i=s.stateNode;if(typeof i.componentDidMount=="function"){var d=s.return;try{i.componentDidMount()}catch(z){Et(s,d,z)}}var x=s.return;try{Qc(s)}catch(z){Et(s,x,z)}break;case 5:var S=s.return;try{Qc(s)}catch(z){Et(s,S,z)}}}catch(z){Et(s,s.return,z)}if(s===t){Re=null;break}var M=s.sibling;if(M!==null){M.return=s.return,Re=M;break}Re=s.return}}var Zy=Math.ceil,Pi=_.ReactCurrentDispatcher,Jc=_.ReactCurrentOwner,As=_.ReactCurrentBatchConfig,st=0,Ut=null,At=null,Yt=0,Ns=0,xa=$r(0),zt=0,yl=null,In=0,Ti=0,Zc=0,vl=null,us=null,ed=0,pa=1/0,br=null,Ri=!1,td=null,Kr=null,Ii=!1,Gr=null,_i=0,jl=0,sd=null,Mi=-1,Ai=0;function as(){return(st&6)!==0?Tt():Mi!==-1?Mi:Mi=Tt()}function Yr(t){return(t.mode&1)===0?1:(st&2)!==0&&Yt!==0?Yt&-Yt:Ly.transition!==null?(Ai===0&&(Ai=Ku()),Ai):(t=ct,t!==0||(t=window.event,t=t===void 0?16:th(t.type)),t)}function Vs(t,s,n,i){if(50<jl)throw jl=0,sd=null,Error(l(185));Wa(t,n,i),((st&2)===0||t!==Ut)&&(t===Ut&&((st&2)===0&&(Ti|=n),zt===4&&Qr(t,Yt)),hs(t,i),n===1&&st===0&&(s.mode&1)===0&&(pa=Tt()+500,oi&&Ur()))}function hs(t,s){var n=t.callbackNode;Lg(t,s);var i=Vl(t,t===Ut?Yt:0);if(i===0)n!==null&&Vu(n),t.callbackNode=null,t.callbackPriority=0;else if(s=i&-i,t.callbackPriority!==s){if(n!=null&&Vu(n),s===1)t.tag===0?Dy(tf.bind(null,t)):$h(tf.bind(null,t)),Iy(function(){(st&6)===0&&Ur()}),n=null;else{switch(Gu(i)){case 1:n=Do;break;case 4:n=Wu;break;case 16:n=zl;break;case 536870912:n=Hu;break;default:n=zl}n=df(n,ef.bind(null,t))}t.callbackPriority=s,t.callbackNode=n}}function ef(t,s){if(Mi=-1,Ai=0,(st&6)!==0)throw Error(l(327));var n=t.callbackNode;if(ga()&&t.callbackNode!==n)return null;var i=Vl(t,t===Ut?Yt:0);if(i===0)return null;if((i&30)!==0||(i&t.expiredLanes)!==0||s)s=Di(t,i);else{s=i;var d=st;st|=2;var x=rf();(Ut!==t||Yt!==s)&&(br=null,pa=Tt()+500,Mn(t,s));do try{sv();break}catch(M){sf(t,M)}while(!0);jc(),Pi.current=x,st=d,At!==null?s=0:(Ut=null,Yt=0,s=zt)}if(s!==0){if(s===2&&(d=Lo(t),d!==0&&(i=d,s=rd(t,d))),s===1)throw n=yl,Mn(t,0),Qr(t,i),hs(t,Tt()),n;if(s===6)Qr(t,i);else{if(d=t.current.alternate,(i&30)===0&&!ev(d)&&(s=Di(t,i),s===2&&(x=Lo(t),x!==0&&(i=x,s=rd(t,x))),s===1))throw n=yl,Mn(t,0),Qr(t,i),hs(t,Tt()),n;switch(t.finishedWork=d,t.finishedLanes=i,s){case 0:case 1:throw Error(l(345));case 2:An(t,us,br);break;case 3:if(Qr(t,i),(i&130023424)===i&&(s=ed+500-Tt(),10<s)){if(Vl(t,0)!==0)break;if(d=t.suspendedLanes,(d&i)!==i){as(),t.pingedLanes|=t.suspendedLanes&d;break}t.timeoutHandle=cc(An.bind(null,t,us,br),s);break}An(t,us,br);break;case 4:if(Qr(t,i),(i&4194240)===i)break;for(s=t.eventTimes,d=-1;0<i;){var S=31-Os(i);x=1<<S,S=s[S],S>d&&(d=S),i&=~x}if(i=d,i=Tt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Zy(i/1960))-i,10<i){t.timeoutHandle=cc(An.bind(null,t,us,br),i);break}An(t,us,br);break;case 5:An(t,us,br);break;default:throw Error(l(329))}}}return hs(t,Tt()),t.callbackNode===n?ef.bind(null,t):null}function rd(t,s){var n=vl;return t.current.memoizedState.isDehydrated&&(Mn(t,s).flags|=256),t=Di(t,s),t!==2&&(s=us,us=n,s!==null&&nd(s)),t}function nd(t){us===null?us=t:us.push.apply(us,t)}function ev(t){for(var s=t;;){if(s.flags&16384){var n=s.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var i=0;i<n.length;i++){var d=n[i],x=d.getSnapshot;d=d.value;try{if(!Fs(x(),d))return!1}catch{return!1}}}if(n=s.child,s.subtreeFlags&16384&&n!==null)n.return=s,s=n;else{if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Qr(t,s){for(s&=~Zc,s&=~Ti,t.suspendedLanes|=s,t.pingedLanes&=~s,t=t.expirationTimes;0<s;){var n=31-Os(s),i=1<<n;t[n]=-1,s&=~i}}function tf(t){if((st&6)!==0)throw Error(l(327));ga();var s=Vl(t,0);if((s&1)===0)return hs(t,Tt()),null;var n=Di(t,s);if(t.tag!==0&&n===2){var i=Lo(t);i!==0&&(s=i,n=rd(t,i))}if(n===1)throw n=yl,Mn(t,0),Qr(t,s),hs(t,Tt()),n;if(n===6)throw Error(l(345));return t.finishedWork=t.current.alternate,t.finishedLanes=s,An(t,us,br),hs(t,Tt()),null}function ad(t,s){var n=st;st|=1;try{return t(s)}finally{st=n,st===0&&(pa=Tt()+500,oi&&Ur())}}function _n(t){Gr!==null&&Gr.tag===0&&(st&6)===0&&ga();var s=st;st|=1;var n=As.transition,i=ct;try{if(As.transition=null,ct=1,t)return t()}finally{ct=i,As.transition=n,st=s,(st&6)===0&&Ur()}}function ld(){Ns=xa.current,pt(xa)}function Mn(t,s){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,Ry(n)),At!==null)for(n=At.return;n!==null;){var i=n;switch(xc(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&li();break;case 3:ha(),pt(os),pt(Xt),Pc();break;case 5:kc(i);break;case 4:ha();break;case 13:pt(Nt);break;case 19:pt(Nt);break;case 10:bc(i.type._context);break;case 22:case 23:ld()}n=n.return}if(Ut=t,At=t=qr(t.current,null),Yt=Ns=s,zt=0,yl=null,Zc=Ti=In=0,us=vl=null,Pn!==null){for(s=0;s<Pn.length;s++)if(n=Pn[s],i=n.interleaved,i!==null){n.interleaved=null;var d=i.next,x=n.pending;if(x!==null){var S=x.next;x.next=d,i.next=S}n.pending=i}Pn=null}return t}function sf(t,s){do{var n=At;try{if(jc(),yi.current=Ni,vi){for(var i=wt.memoizedState;i!==null;){var d=i.queue;d!==null&&(d.pending=null),i=i.next}vi=!1}if(Rn=0,Bt=Ft=wt=null,hl=!1,ml=0,Jc.current=null,n===null||n.return===null){zt=1,yl=s,At=null;break}e:{var x=t,S=n.return,M=n,z=s;if(s=Yt,M.flags|=32768,z!==null&&typeof z=="object"&&typeof z.then=="function"){var re=z,me=M,ye=me.tag;if((me.mode&1)===0&&(ye===0||ye===11||ye===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 Pe=Em(S);if(Pe!==null){Pe.flags&=-257,Pm(Pe,S,M,x,s),Pe.mode&1&&km(x,re,s),s=Pe,z=re;var _e=s.updateQueue;if(_e===null){var De=new Set;De.add(z),s.updateQueue=De}else _e.add(z);break e}else{if((s&1)===0){km(x,re,s),id();break e}z=Error(l(426))}}else if(jt&&M.mode&1){var Rt=Em(S);if(Rt!==null){(Rt.flags&65536)===0&&(Rt.flags|=256),Pm(Rt,S,M,x,s),yc(ma(z,M));break e}}x=z=ma(z,M),zt!==4&&(zt=2),vl===null?vl=[x]:vl.push(x),x=S;do{switch(x.tag){case 3:x.flags|=65536,s&=-s,x.lanes|=s;var Q=Sm(x,z,s);Xh(x,Q);break e;case 1:M=z;var W=x.type,J=x.stateNode;if((x.flags&128)===0&&(typeof W.getDerivedStateFromError=="function"||J!==null&&typeof J.componentDidCatch=="function"&&(Kr===null||!Kr.has(J)))){x.flags|=65536,s&=-s,x.lanes|=s;var je=Cm(x,M,s);Xh(x,je);break e}}x=x.return}while(x!==null)}af(n)}catch(Le){s=Le,At===n&&n!==null&&(At=n=n.return);continue}break}while(!0)}function rf(){var t=Pi.current;return Pi.current=Ni,t===null?Ni:t}function id(){(zt===0||zt===3||zt===2)&&(zt=4),Ut===null||(In&268435455)===0&&(Ti&268435455)===0||Qr(Ut,Yt)}function Di(t,s){var n=st;st|=2;var i=rf();(Ut!==t||Yt!==s)&&(br=null,Mn(t,s));do try{tv();break}catch(d){sf(t,d)}while(!0);if(jc(),st=n,Pi.current=i,At!==null)throw Error(l(261));return Ut=null,Yt=0,zt}function tv(){for(;At!==null;)nf(At)}function sv(){for(;At!==null&&!Eg();)nf(At)}function nf(t){var s=cf(t.alternate,t,Ns);t.memoizedProps=t.pendingProps,s===null?af(t):At=s,Jc.current=null}function af(t){var s=t;do{var n=s.alternate;if(t=s.return,(s.flags&32768)===0){if(n=Yy(n,s,Ns),n!==null){At=n;return}}else{if(n=Qy(n,s),n!==null){n.flags&=32767,At=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{zt=6,At=null;return}}if(s=s.sibling,s!==null){At=s;return}At=s=t}while(s!==null);zt===0&&(zt=5)}function An(t,s,n){var i=ct,d=As.transition;try{As.transition=null,ct=1,rv(t,s,n,i)}finally{As.transition=d,ct=i}return null}function rv(t,s,n,i){do ga();while(Gr!==null);if((st&6)!==0)throw Error(l(327));n=t.finishedWork;var d=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(Og(t,x),t===Ut&&(At=Ut=null,Yt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Ii||(Ii=!0,df(zl,function(){return ga(),null})),x=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||x){x=As.transition,As.transition=null;var S=ct;ct=1;var M=st;st|=4,Jc.current=null,Xy(t,n),Qm(n,t),wy(ic),Kl=!!lc,ic=lc=null,t.current=n,Jy(n),Pg(),st=M,ct=S,As.transition=x}else t.current=n;if(Ii&&(Ii=!1,Gr=t,_i=d),x=t.pendingLanes,x===0&&(Kr=null),Ig(n.stateNode),hs(t,Tt()),s!==null)for(i=t.onRecoverableError,n=0;n<s.length;n++)d=s[n],i(d.value,{componentStack:d.stack,digest:d.digest});if(Ri)throw Ri=!1,t=td,td=null,t;return(_i&1)!==0&&t.tag!==0&&ga(),x=t.pendingLanes,(x&1)!==0?t===sd?jl++:(jl=0,sd=t):jl=0,Ur(),null}function ga(){if(Gr!==null){var t=Gu(_i),s=As.transition,n=ct;try{if(As.transition=null,ct=16>t?16:t,Gr===null)var i=!1;else{if(t=Gr,Gr=null,_i=0,(st&6)!==0)throw Error(l(331));var d=st;for(st|=4,Re=t.current;Re!==null;){var x=Re,S=x.child;if((Re.flags&16)!==0){var M=x.deletions;if(M!==null){for(var z=0;z<M.length;z++){var re=M[z];for(Re=re;Re!==null;){var me=Re;switch(me.tag){case 0:case 11:case 15:gl(8,me,x)}var ye=me.child;if(ye!==null)ye.return=me,Re=ye;else for(;Re!==null;){me=Re;var he=me.sibling,Pe=me.return;if(Wm(me),me===re){Re=null;break}if(he!==null){he.return=Pe,Re=he;break}Re=Pe}}}var _e=x.alternate;if(_e!==null){var De=_e.child;if(De!==null){_e.child=null;do{var Rt=De.sibling;De.sibling=null,De=Rt}while(De!==null)}}Re=x}}if((x.subtreeFlags&2064)!==0&&S!==null)S.return=x,Re=S;else e:for(;Re!==null;){if(x=Re,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:gl(9,x,x.return)}var Q=x.sibling;if(Q!==null){Q.return=x.return,Re=Q;break e}Re=x.return}}var W=t.current;for(Re=W;Re!==null;){S=Re;var J=S.child;if((S.subtreeFlags&2064)!==0&&J!==null)J.return=S,Re=J;else e:for(S=W;Re!==null;){if(M=Re,(M.flags&2048)!==0)try{switch(M.tag){case 0:case 11:case 15:Ei(9,M)}}catch(Le){Et(M,M.return,Le)}if(M===S){Re=null;break e}var je=M.sibling;if(je!==null){je.return=M.return,Re=je;break e}Re=M.return}}if(st=d,Ur(),Zs&&typeof Zs.onPostCommitFiberRoot=="function")try{Zs.onPostCommitFiberRoot($l,t)}catch{}i=!0}return i}finally{ct=n,As.transition=s}}return!1}function lf(t,s,n){s=ma(n,s),s=Sm(t,s,1),t=Wr(t,s,1),s=as(),t!==null&&(Wa(t,1,s),hs(t,s))}function Et(t,s,n){if(t.tag===3)lf(t,t,n);else for(;s!==null;){if(s.tag===3){lf(s,t,n);break}else if(s.tag===1){var i=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Kr===null||!Kr.has(i))){t=ma(n,t),t=Cm(s,t,1),s=Wr(s,t,1),t=as(),s!==null&&(Wa(s,1,t),hs(s,t));break}}s=s.return}}function nv(t,s,n){var i=t.pingCache;i!==null&&i.delete(s),s=as(),t.pingedLanes|=t.suspendedLanes&n,Ut===t&&(Yt&n)===n&&(zt===4||zt===3&&(Yt&130023424)===Yt&&500>Tt()-ed?Mn(t,0):Zc|=n),hs(t,s)}function of(t,s){s===0&&((t.mode&1)===0?s=1:(s=Ul,Ul<<=1,(Ul&130023424)===0&&(Ul=4194304)));var n=as();t=yr(t,s),t!==null&&(Wa(t,s,n),hs(t,n))}function av(t){var s=t.memoizedState,n=0;s!==null&&(n=s.retryLane),of(t,n)}function lv(t,s){var n=0;switch(t.tag){case 13:var i=t.stateNode,d=t.memoizedState;d!==null&&(n=d.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(s),of(t,n)}var cf;cf=function(t,s,n){if(t!==null)if(t.memoizedProps!==s.pendingProps||os.current)ds=!0;else{if((t.lanes&n)===0&&(s.flags&128)===0)return ds=!1,Gy(t,s,n);ds=(t.flags&131072)!==0}else ds=!1,jt&&(s.flags&1048576)!==0&&Bh(s,di,s.index);switch(s.lanes=0,s.tag){case 2:var i=s.type;Ci(t,s),t=s.pendingProps;var d=aa(s,Xt.current);ua(s,n),d=Ic(null,s,i,t,d,n);var x=_c();return s.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,cs(i)?(x=!0,ii(s)):x=!1,s.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Sc(s),d.updater=wi,s.stateNode=d,d._reactInternals=s,Fc(s,i,t,n),s=Uc(null,s,i,!0,x,n)):(s.tag=0,jt&&x&&fc(s),ns(null,s,d,n),s=s.child),s;case 16:i=s.elementType;e:{switch(Ci(t,s),t=s.pendingProps,d=i._init,i=d(i._payload),s.type=i,d=s.tag=ov(i),t=$s(i,t),d){case 0:s=Bc(null,s,i,t,n);break e;case 1:s=Am(null,s,i,t,n);break e;case 11:s=Tm(null,s,i,t,n);break e;case 14:s=Rm(null,s,i,$s(i.type,t),n);break e}throw Error(l(306,i,""))}return s;case 0:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:$s(i,d),Bc(t,s,i,d,n);case 1:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:$s(i,d),Am(t,s,i,d,n);case 3:e:{if(Dm(s),t===null)throw Error(l(387));i=s.pendingProps,x=s.memoizedState,d=x.element,qh(t,s),pi(s,i,null,n);var S=s.memoizedState;if(i=S.element,x.isDehydrated)if(x={element:i,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){d=ma(Error(l(423)),s),s=Lm(t,s,i,n,d);break e}else if(i!==d){d=ma(Error(l(424)),s),s=Lm(t,s,i,n,d);break e}else for(bs=zr(s.stateNode.containerInfo.firstChild),js=s,jt=!0,zs=null,n=Yh(s,null,i,n),s.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(oa(),i===d){s=jr(t,s,n);break e}ns(t,s,i,n)}s=s.child}return s;case 5:return Zh(s),t===null&&gc(s),i=s.type,d=s.pendingProps,x=t!==null?t.memoizedProps:null,S=d.children,oc(i,d)?S=null:x!==null&&oc(i,x)&&(s.flags|=32),Mm(t,s),ns(t,s,S,n),s.child;case 6:return t===null&&gc(s),null;case 13:return Om(t,s,n);case 4:return Cc(s,s.stateNode.containerInfo),i=s.pendingProps,t===null?s.child=ca(s,null,i,n):ns(t,s,i,n),s.child;case 11:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:$s(i,d),Tm(t,s,i,d,n);case 7:return ns(t,s,s.pendingProps,n),s.child;case 8:return ns(t,s,s.pendingProps.children,n),s.child;case 12:return ns(t,s,s.pendingProps.children,n),s.child;case 10:e:{if(i=s.type._context,d=s.pendingProps,x=s.memoizedProps,S=d.value,ht(mi,i._currentValue),i._currentValue=S,x!==null)if(Fs(x.value,S)){if(x.children===d.children&&!os.current){s=jr(t,s,n);break e}}else for(x=s.child,x!==null&&(x.return=s);x!==null;){var M=x.dependencies;if(M!==null){S=x.child;for(var z=M.firstContext;z!==null;){if(z.context===i){if(x.tag===1){z=vr(-1,n&-n),z.tag=2;var re=x.updateQueue;if(re!==null){re=re.shared;var me=re.pending;me===null?z.next=z:(z.next=me.next,me.next=z),re.pending=z}}x.lanes|=n,z=x.alternate,z!==null&&(z.lanes|=n),Nc(x.return,n,s),M.lanes|=n;break}z=z.next}}else if(x.tag===10)S=x.type===s.type?null:x.child;else if(x.tag===18){if(S=x.return,S===null)throw Error(l(341));S.lanes|=n,M=S.alternate,M!==null&&(M.lanes|=n),Nc(S,n,s),S=x.sibling}else S=x.child;if(S!==null)S.return=x;else for(S=x;S!==null;){if(S===s){S=null;break}if(x=S.sibling,x!==null){x.return=S.return,S=x;break}S=S.return}x=S}ns(t,s,d.children,n),s=s.child}return s;case 9:return d=s.type,i=s.pendingProps.children,ua(s,n),d=_s(d),i=i(d),s.flags|=1,ns(t,s,i,n),s.child;case 14:return i=s.type,d=$s(i,s.pendingProps),d=$s(i.type,d),Rm(t,s,i,d,n);case 15:return Im(t,s,s.type,s.pendingProps,n);case 17:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:$s(i,d),Ci(t,s),s.tag=1,cs(i)?(t=!0,ii(s)):t=!1,ua(s,n),Nm(s,i,d),Fc(s,i,d,n),Uc(null,s,i,!0,t,n);case 19:return zm(t,s,n);case 22:return _m(t,s,n)}throw Error(l(156,s.tag))};function df(t,s){return Ts(t,s)}function iv(t,s,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=s,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 Ds(t,s,n,i){return new iv(t,s,n,i)}function od(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ov(t){if(typeof t=="function")return od(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ie)return 11;if(t===H)return 14}return 2}function qr(t,s){var n=t.alternate;return n===null?(n=Ds(t.tag,s,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=s,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,s=t.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Li(t,s,n,i,d,x){var S=2;if(i=t,typeof t=="function")od(t)&&(S=1);else if(typeof t=="string")S=5;else e:switch(t){case I:return Dn(n.children,d,x,s);case k:S=8,d|=8;break;case R:return t=Ds(12,n,s,d|2),t.elementType=R,t.lanes=x,t;case te:return t=Ds(13,n,s,d),t.elementType=te,t.lanes=x,t;case se:return t=Ds(19,n,s,d),t.elementType=se,t.lanes=x,t;case ve:return Oi(n,d,x,s);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ee:S=10;break e;case ne:S=9;break e;case ie:S=11;break e;case H:S=14;break e;case ae:S=16,i=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return s=Ds(S,n,s,d),s.elementType=t,s.type=i,s.lanes=x,s}function Dn(t,s,n,i){return t=Ds(7,t,i,s),t.lanes=n,t}function Oi(t,s,n,i){return t=Ds(22,t,i,s),t.elementType=ve,t.lanes=n,t.stateNode={isHidden:!1},t}function cd(t,s,n){return t=Ds(6,t,null,s),t.lanes=n,t}function dd(t,s,n){return s=Ds(4,t.children!==null?t.children:[],t.key,s),s.lanes=n,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}function cv(t,s,n,i,d){this.tag=s,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=Oo(0),this.expirationTimes=Oo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oo(0),this.identifierPrefix=i,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function ud(t,s,n,i,d,x,S,M,z){return t=new cv(t,s,n,M,z),s===1?(s=1,x===!0&&(s|=8)):s=0,x=Ds(3,null,null,s),t.current=x,x.stateNode=t,x.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sc(x),t}function dv(t,s,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:U,key:i==null?null:""+i,children:t,containerInfo:s,implementation:n}}function uf(t){if(!t)return Br;t=t._reactInternals;e:{if(at(t)!==t||t.tag!==1)throw Error(l(170));var s=t;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(cs(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(l(171))}if(t.tag===1){var n=t.type;if(cs(n))return Fh(t,n,s)}return s}function hf(t,s,n,i,d,x,S,M,z){return t=ud(n,i,!0,t,d,x,S,M,z),t.context=uf(null),n=t.current,i=as(),d=Yr(n),x=vr(i,d),x.callback=s??null,Wr(n,x,d),t.current.lanes=d,Wa(t,d,i),hs(t,i),t}function Fi(t,s,n,i){var d=s.current,x=as(),S=Yr(d);return n=uf(n),s.context===null?s.context=n:s.pendingContext=n,s=vr(x,S),s.payload={element:t},i=i===void 0?null:i,i!==null&&(s.callback=i),t=Wr(d,s,S),t!==null&&(Vs(t,d,S,x),xi(t,d,S)),S}function zi(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 mf(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<s?n:s}}function hd(t,s){mf(t,s),(t=t.alternate)&&mf(t,s)}function uv(){return null}var ff=typeof reportError=="function"?reportError:function(t){console.error(t)};function md(t){this._internalRoot=t}$i.prototype.render=md.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(l(409));Fi(t,s,null,null)},$i.prototype.unmount=md.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;_n(function(){Fi(null,t,null,null)}),s[fr]=null}};function $i(t){this._internalRoot=t}$i.prototype.unstable_scheduleHydration=function(t){if(t){var s=qu();t={blockedOn:null,target:t,priority:s};for(var n=0;n<Lr.length&&s!==0&&s<Lr[n].priority;n++);Lr.splice(n,0,t),n===0&&Zu(t)}};function fd(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Bi(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function xf(){}function hv(t,s,n,i,d){if(d){if(typeof i=="function"){var x=i;i=function(){var re=zi(S);x.call(re)}}var S=hf(s,i,t,0,null,!1,!1,"",xf);return t._reactRootContainer=S,t[fr]=S.current,nl(t.nodeType===8?t.parentNode:t),_n(),S}for(;d=t.lastChild;)t.removeChild(d);if(typeof i=="function"){var M=i;i=function(){var re=zi(z);M.call(re)}}var z=ud(t,0,!1,null,null,!1,!1,"",xf);return t._reactRootContainer=z,t[fr]=z.current,nl(t.nodeType===8?t.parentNode:t),_n(function(){Fi(s,z,n,i)}),z}function Ui(t,s,n,i,d){var x=n._reactRootContainer;if(x){var S=x;if(typeof d=="function"){var M=d;d=function(){var z=zi(S);M.call(z)}}Fi(s,S,t,d)}else S=hv(n,s,t,d,i);return zi(S)}Yu=function(t){switch(t.tag){case 3:var s=t.stateNode;if(s.current.memoizedState.isDehydrated){var n=Va(s.pendingLanes);n!==0&&(Fo(s,n|1),hs(s,Tt()),(st&6)===0&&(pa=Tt()+500,Ur()))}break;case 13:_n(function(){var i=yr(t,1);if(i!==null){var d=as();Vs(i,t,1,d)}}),hd(t,1)}},zo=function(t){if(t.tag===13){var s=yr(t,134217728);if(s!==null){var n=as();Vs(s,t,134217728,n)}hd(t,134217728)}},Qu=function(t){if(t.tag===13){var s=Yr(t),n=yr(t,s);if(n!==null){var i=as();Vs(n,t,s,i)}hd(t,s)}},qu=function(){return ct},Xu=function(t,s){var n=ct;try{return ct=t,s()}finally{ct=n}},Nn=function(t,s,n){switch(s){case"input":if(tt(t,n),s=n.name,n.type==="radio"&&s!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<n.length;s++){var i=n[s];if(i!==t&&i.form===t.form){var d=ai(i);if(!d)throw Error(l(90));ke(i),tt(i,d)}}}break;case"textarea":Cs(t,n);break;case"select":s=n.value,s!=null&&ss(t,!!n.multiple,s,!1)}},Gn=ad,Yn=_n;var mv={usingClientEntryPoint:!1,Events:[il,ra,ai,Hn,Kn,ad]},bl={findFiberByHostInstance:Sn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fv={bundleType:bl.bundleType,version:bl.version,rendererPackageName:bl.rendererPackageName,rendererConfig:bl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=He(t),t===null?null:t.stateNode},findFiberByHostInstance:bl.findFiberByHostInstance||uv,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 Vi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vi.isDisabled&&Vi.supportsFiber)try{$l=Vi.inject(fv),Zs=Vi}catch{}}return ms.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mv,ms.createPortal=function(t,s){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fd(s))throw Error(l(200));return dv(t,s,null,n)},ms.createRoot=function(t,s){if(!fd(t))throw Error(l(299));var n=!1,i="",d=ff;return s!=null&&(s.unstable_strictMode===!0&&(n=!0),s.identifierPrefix!==void 0&&(i=s.identifierPrefix),s.onRecoverableError!==void 0&&(d=s.onRecoverableError)),s=ud(t,1,!1,null,null,n,!1,i,d),t[fr]=s.current,nl(t.nodeType===8?t.parentNode:t),new md(s)},ms.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var s=t._reactInternals;if(s===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=He(s),t=t===null?null:t.stateNode,t},ms.flushSync=function(t){return _n(t)},ms.hydrate=function(t,s,n){if(!Bi(s))throw Error(l(200));return Ui(null,t,s,!0,n)},ms.hydrateRoot=function(t,s,n){if(!fd(t))throw Error(l(405));var i=n!=null&&n.hydratedSources||null,d=!1,x="",S=ff;if(n!=null&&(n.unstable_strictMode===!0&&(d=!0),n.identifierPrefix!==void 0&&(x=n.identifierPrefix),n.onRecoverableError!==void 0&&(S=n.onRecoverableError)),s=hf(s,null,t,1,n??null,d,!1,x,S),t[fr]=s.current,nl(t),i)for(t=0;t<i.length;t++)n=i[t],d=n._getVersion,d=d(n._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[n,d]:s.mutableSourceEagerHydrationData.push(n,d);return new $i(s)},ms.render=function(t,s,n){if(!Bi(s))throw Error(l(200));return Ui(null,t,s,!1,n)},ms.unmountComponentAtNode=function(t){if(!Bi(t))throw Error(l(40));return t._reactRootContainer?(_n(function(){Ui(null,null,t,!1,function(){t._reactRootContainer=null,t[fr]=null})}),!0):!1},ms.unstable_batchedUpdates=ad,ms.unstable_renderSubtreeIntoContainer=function(t,s,n,i){if(!Bi(n))throw Error(l(200));if(t==null||t._reactInternals===void 0)throw Error(l(38));return Ui(t,s,n,!1,i)},ms.version="18.3.1-next-f1338f8080-20240426",ms}var wf;function Px(){if(wf)return gd.exports;wf=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),gd.exports=Nv(),gd.exports}var Sf;function wv(){if(Sf)return Wi;Sf=1;var r=Px();return Wi.createRoot=r.createRoot,Wi.hydrateRoot=r.hydrateRoot,Wi}var Sv=wv(),Al=Px();const Cv=Ex(Al);/**
|
||
* @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 El(){return El=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(r[o]=l[o])}return r},El.apply(this,arguments)}var rn;(function(r){r.Pop="POP",r.Push="PUSH",r.Replace="REPLACE"})(rn||(rn={}));const Cf="popstate";function kv(r){r===void 0&&(r={});function a(o,c){let{pathname:u,search:m,hash:f}=o.location;return zd("",{pathname:u,search:m,hash:f},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function l(o,c){return typeof c=="string"?c:no(c)}return Pv(a,l,null,r)}function It(r,a){if(r===!1||r===null||typeof r>"u")throw new Error(a)}function uu(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Ev(){return Math.random().toString(36).substr(2,8)}function kf(r,a){return{usr:r.state,key:r.key,idx:a}}function zd(r,a,l,o){return l===void 0&&(l=null),El({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Ma(a):a,{state:l,key:a&&a.key||o||Ev()})}function no(r){let{pathname:a="/",search:l="",hash:o=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function Ma(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let o=r.indexOf("?");o>=0&&(a.search=r.substr(o),r=r.substr(0,o)),r&&(a.pathname=r)}return a}function Pv(r,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:u=!1}=o,m=c.history,f=rn.Pop,g=null,y=p();y==null&&(y=0,m.replaceState(El({},m.state,{idx:y}),""));function p(){return(m.state||{idx:null}).idx}function v(){f=rn.Pop;let j=p(),w=j==null?null:j-y;y=j,g&&g({action:f,location:b.location,delta:w})}function E(j,w){f=rn.Push;let C=zd(b.location,j,w);y=p()+1;let N=kf(C,y),_=b.createHref(C);try{m.pushState(N,"",_)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;c.location.assign(_)}u&&g&&g({action:f,location:b.location,delta:1})}function P(j,w){f=rn.Replace;let C=zd(b.location,j,w);y=p();let N=kf(C,y),_=b.createHref(C);m.replaceState(N,"",_),u&&g&&g({action:f,location:b.location,delta:0})}function T(j){let w=c.location.origin!=="null"?c.location.origin:c.location.href,C=typeof j=="string"?j:no(j);return C=C.replace(/ $/,"%20"),It(w,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,w)}let b={get action(){return f},get location(){return r(c,m)},listen(j){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(Cf,v),g=j,()=>{c.removeEventListener(Cf,v),g=null}},createHref(j){return a(c,j)},createURL:T,encodeLocation(j){let w=T(j);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:E,replace:P,go(j){return m.go(j)}};return b}var Ef;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Ef||(Ef={}));function Tv(r,a,l){return l===void 0&&(l="/"),Rv(r,a,l)}function Rv(r,a,l,o){let c=typeof a=="string"?Ma(a):a,u=hu(c.pathname||"/",l);if(u==null)return null;let m=Tx(r);Iv(m);let f=null;for(let g=0;f==null&&g<m.length;++g){let y=Vv(u);f=$v(m[g],y)}return f}function Tx(r,a,l,o){a===void 0&&(a=[]),l===void 0&&(l=[]),o===void 0&&(o="");let c=(u,m,f)=>{let g={relativePath:f===void 0?u.path||"":f,caseSensitive:u.caseSensitive===!0,childrenIndex:m,route:u};g.relativePath.startsWith("/")&&(It(g.relativePath.startsWith(o),'Absolute route path "'+g.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),g.relativePath=g.relativePath.slice(o.length));let y=an([o,g.relativePath]),p=l.concat(g);u.children&&u.children.length>0&&(It(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Tx(u.children,a,p,y)),!(u.path==null&&!u.index)&&a.push({path:y,score:Fv(y,u.index),routesMeta:p})};return r.forEach((u,m)=>{var f;if(u.path===""||!((f=u.path)!=null&&f.includes("?")))c(u,m);else for(let g of Rx(u.path))c(u,m,g)}),a}function Rx(r){let a=r.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let m=Rx(o.join("/")),f=[];return f.push(...m.map(g=>g===""?u:[u,g].join("/"))),c&&f.push(...m),f.map(g=>r.startsWith("/")&&g===""?"/":g)}function Iv(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:zv(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const _v=/^:[\w-]+$/,Mv=3,Av=2,Dv=1,Lv=10,Ov=-2,Pf=r=>r==="*";function Fv(r,a){let l=r.split("/"),o=l.length;return l.some(Pf)&&(o+=Ov),a&&(o+=Av),l.filter(c=>!Pf(c)).reduce((c,u)=>c+(_v.test(u)?Mv:u===""?Dv:Lv),o)}function zv(r,a){return r.length===a.length&&r.slice(0,-1).every((o,c)=>o===a[c])?r[r.length-1]-a[a.length-1]:0}function $v(r,a,l){let{routesMeta:o}=r,c={},u="/",m=[];for(let f=0;f<o.length;++f){let g=o[f],y=f===o.length-1,p=u==="/"?a:a.slice(u.length)||"/",v=Bv({path:g.relativePath,caseSensitive:g.caseSensitive,end:y},p),E=g.route;if(!v)return null;Object.assign(c,v.params),m.push({params:c,pathname:an([u,v.pathname]),pathnameBase:Yv(an([u,v.pathnameBase])),route:E}),v.pathnameBase!=="/"&&(u=an([u,v.pathnameBase]))}return m}function Bv(r,a){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[l,o]=Uv(r.path,r.caseSensitive,r.end),c=a.match(l);if(!c)return null;let u=c[0],m=u.replace(/(.)\/+$/,"$1"),f=c.slice(1);return{params:o.reduce((y,p,v)=>{let{paramName:E,isOptional:P}=p;if(E==="*"){let b=f[v]||"";m=u.slice(0,u.length-b.length).replace(/(.)\/+$/,"$1")}const T=f[v];return P&&!T?y[E]=void 0:y[E]=(T||"").replace(/%2F/g,"/"),y},{}),pathname:u,pathnameBase:m,pattern:r}}function Uv(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),uu(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let o=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,f,g)=>(o.push({paramName:f,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(o.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function Vv(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return uu(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),r}}function hu(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=r.charAt(l);return o&&o!=="/"?null:r.slice(l)||"/"}const Wv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hv=r=>Wv.test(r);function Kv(r,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof r=="string"?Ma(r):r,u;if(l)if(Hv(l))u=l;else{if(l.includes("//")){let m=l;l=l.replace(/\/\/+/g,"/"),uu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(m+" -> "+l))}l.startsWith("/")?u=Tf(l.substring(1),"/"):u=Tf(l,a)}else u=a;return{pathname:u,search:Qv(o),hash:qv(c)}}function Tf(r,a){let l=a.replace(/\/+$/,"").split("/");return r.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function jd(r,a,l,o){return"Cannot include a '"+r+"' 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 Gv(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function mu(r,a){let l=Gv(r);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function fu(r,a,l,o){o===void 0&&(o=!1);let c;typeof r=="string"?c=Ma(r):(c=El({},r),It(!c.pathname||!c.pathname.includes("?"),jd("?","pathname","search",c)),It(!c.pathname||!c.pathname.includes("#"),jd("#","pathname","hash",c)),It(!c.search||!c.search.includes("#"),jd("#","search","hash",c)));let u=r===""||c.pathname==="",m=u?"/":c.pathname,f;if(m==null)f=l;else{let v=a.length-1;if(!o&&m.startsWith("..")){let E=m.split("/");for(;E[0]==="..";)E.shift(),v-=1;c.pathname=E.join("/")}f=v>=0?a[v]:"/"}let g=Kv(c,f),y=m&&m!=="/"&&m.endsWith("/"),p=(u||m===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(y||p)&&(g.pathname+="/"),g}const an=r=>r.join("/").replace(/\/\/+/g,"/"),Yv=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Qv=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,qv=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function Xv(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Ix=["post","put","patch","delete"];new Set(Ix);const Jv=["get",...Ix];new Set(Jv);/**
|
||
* 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 Pl(){return Pl=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(r[o]=l[o])}return r},Pl.apply(this,arguments)}const xu=h.createContext(null),Zv=h.createContext(null),fn=h.createContext(null),vo=h.createContext(null),Tr=h.createContext({outlet:null,matches:[],isDataRoute:!1}),_x=h.createContext(null);function ej(r,a){let{relative:l}=a===void 0?{}:a;Aa()||It(!1);let{basename:o,navigator:c}=h.useContext(fn),{hash:u,pathname:m,search:f}=Ax(r,{relative:l}),g=m;return o!=="/"&&(g=m==="/"?o:an([o,m])),c.createHref({pathname:g,search:f,hash:u})}function Aa(){return h.useContext(vo)!=null}function xn(){return Aa()||It(!1),h.useContext(vo).location}function Mx(r){h.useContext(fn).static||h.useLayoutEffect(r)}function Da(){let{isDataRoute:r}=h.useContext(Tr);return r?xj():tj()}function tj(){Aa()||It(!1);let r=h.useContext(xu),{basename:a,future:l,navigator:o}=h.useContext(fn),{matches:c}=h.useContext(Tr),{pathname:u}=xn(),m=JSON.stringify(mu(c,l.v7_relativeSplatPath)),f=h.useRef(!1);return Mx(()=>{f.current=!0}),h.useCallback(function(y,p){if(p===void 0&&(p={}),!f.current)return;if(typeof y=="number"){o.go(y);return}let v=fu(y,JSON.parse(m),u,p.relative==="path");r==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:an([a,v.pathname])),(p.replace?o.replace:o.push)(v,p.state,p)},[a,o,m,u,r])}const sj=h.createContext(null);function rj(r){let a=h.useContext(Tr).outlet;return a&&h.createElement(sj.Provider,{value:r},a)}function Ax(r,a){let{relative:l}=a===void 0?{}:a,{future:o}=h.useContext(fn),{matches:c}=h.useContext(Tr),{pathname:u}=xn(),m=JSON.stringify(mu(c,o.v7_relativeSplatPath));return h.useMemo(()=>fu(r,JSON.parse(m),u,l==="path"),[r,m,u,l])}function nj(r,a){return aj(r,a)}function aj(r,a,l,o){Aa()||It(!1);let{navigator:c}=h.useContext(fn),{matches:u}=h.useContext(Tr),m=u[u.length-1],f=m?m.params:{};m&&m.pathname;let g=m?m.pathnameBase:"/";m&&m.route;let y=xn(),p;if(a){var v;let j=typeof a=="string"?Ma(a):a;g==="/"||(v=j.pathname)!=null&&v.startsWith(g)||It(!1),p=j}else p=y;let E=p.pathname||"/",P=E;if(g!=="/"){let j=g.replace(/^\//,"").split("/");P="/"+E.replace(/^\//,"").split("/").slice(j.length).join("/")}let T=Tv(r,{pathname:P}),b=dj(T&&T.map(j=>Object.assign({},j,{params:Object.assign({},f,j.params),pathname:an([g,c.encodeLocation?c.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?g:an([g,c.encodeLocation?c.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),u,l,o);return a&&b?h.createElement(vo.Provider,{value:{location:Pl({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:rn.Pop}},b):b}function lj(){let r=fj(),a=Xv(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),l=r instanceof Error?r.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},a),l?h.createElement("pre",{style:c},l):null,null)}const ij=h.createElement(lj,null);class oj extends h.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?h.createElement(Tr.Provider,{value:this.props.routeContext},h.createElement(_x.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function cj(r){let{routeContext:a,match:l,children:o}=r,c=h.useContext(xu);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),h.createElement(Tr.Provider,{value:a},o)}function dj(r,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),r==null){var u;if(!l)return null;if(l.errors)r=l.matches;else if((u=o)!=null&&u.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let m=r,f=(c=l)==null?void 0:c.errors;if(f!=null){let p=m.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);p>=0||It(!1),m=m.slice(0,Math.min(m.length,p+1))}let g=!1,y=-1;if(l&&o&&o.v7_partialHydration)for(let p=0;p<m.length;p++){let v=m[p];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(y=p),v.route.id){let{loaderData:E,errors:P}=l,T=v.route.loader&&E[v.route.id]===void 0&&(!P||P[v.route.id]===void 0);if(v.route.lazy||T){g=!0,y>=0?m=m.slice(0,y+1):m=[m[0]];break}}}return m.reduceRight((p,v,E)=>{let P,T=!1,b=null,j=null;l&&(P=f&&v.route.id?f[v.route.id]:void 0,b=v.route.errorElement||ij,g&&(y<0&&E===0?(pj("route-fallback"),T=!0,j=null):y===E&&(T=!0,j=v.route.hydrateFallbackElement||null)));let w=a.concat(m.slice(0,E+1)),C=()=>{let N;return P?N=b:T?N=j:v.route.Component?N=h.createElement(v.route.Component,null):v.route.element?N=v.route.element:N=p,h.createElement(cj,{match:v,routeContext:{outlet:p,matches:w,isDataRoute:l!=null},children:N})};return l&&(v.route.ErrorBoundary||v.route.errorElement||E===0)?h.createElement(oj,{location:l.location,revalidation:l.revalidation,component:b,error:P,children:C(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):C()},null)}var Dx=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(Dx||{}),Lx=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(Lx||{});function uj(r){let a=h.useContext(xu);return a||It(!1),a}function hj(r){let a=h.useContext(Zv);return a||It(!1),a}function mj(r){let a=h.useContext(Tr);return a||It(!1),a}function Ox(r){let a=mj(),l=a.matches[a.matches.length-1];return l.route.id||It(!1),l.route.id}function fj(){var r;let a=h.useContext(_x),l=hj(),o=Ox();return a!==void 0?a:(r=l.errors)==null?void 0:r[o]}function xj(){let{router:r}=uj(Dx.UseNavigateStable),a=Ox(Lx.UseNavigateStable),l=h.useRef(!1);return Mx(()=>{l.current=!0}),h.useCallback(function(c,u){u===void 0&&(u={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,Pl({fromRouteId:a},u)))},[r,a])}const Rf={};function pj(r,a,l){Rf[r]||(Rf[r]=!0)}function gj(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function bd(r){let{to:a,replace:l,state:o,relative:c}=r;Aa()||It(!1);let{future:u,static:m}=h.useContext(fn),{matches:f}=h.useContext(Tr),{pathname:g}=xn(),y=Da(),p=fu(a,mu(f,u.v7_relativeSplatPath),g,c==="path"),v=JSON.stringify(p);return h.useEffect(()=>y(JSON.parse(v),{replace:l,state:o,relative:c}),[y,v,c,l,o]),null}function yj(r){return rj(r.context)}function gt(r){It(!1)}function vj(r){let{basename:a="/",children:l=null,location:o,navigationType:c=rn.Pop,navigator:u,static:m=!1,future:f}=r;Aa()&&It(!1);let g=a.replace(/^\/*/,"/"),y=h.useMemo(()=>({basename:g,navigator:u,static:m,future:Pl({v7_relativeSplatPath:!1},f)}),[g,f,u,m]);typeof o=="string"&&(o=Ma(o));let{pathname:p="/",search:v="",hash:E="",state:P=null,key:T="default"}=o,b=h.useMemo(()=>{let j=hu(p,g);return j==null?null:{location:{pathname:j,search:v,hash:E,state:P,key:T},navigationType:c}},[g,p,v,E,P,T,c]);return b==null?null:h.createElement(fn.Provider,{value:y},h.createElement(vo.Provider,{children:l,value:b}))}function jj(r){let{children:a,location:l}=r;return nj($d(a),l)}new Promise(()=>{});function $d(r,a){a===void 0&&(a=[]);let l=[];return h.Children.forEach(r,(o,c)=>{if(!h.isValidElement(o))return;let u=[...a,c];if(o.type===h.Fragment){l.push.apply(l,$d(o.props.children,u));return}o.type!==gt&&It(!1),!o.props.index||!o.props.children||It(!1);let m={id:o.props.id||u.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&&(m.children=$d(o.props.children,u)),l.push(m)}),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 Bd(){return Bd=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(r[o]=l[o])}return r},Bd.apply(this,arguments)}function bj(r,a){if(r==null)return{};var l={},o=Object.keys(r),c,u;for(u=0;u<o.length;u++)c=o[u],!(a.indexOf(c)>=0)&&(l[c]=r[c]);return l}function Nj(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function wj(r,a){return r.button===0&&(!a||a==="_self")&&!Nj(r)}function Ud(r){return r===void 0&&(r=""),new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((a,l)=>{let o=r[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function Sj(r,a){let l=Ud(r);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(u=>{l.append(c,u)})}),l}const Cj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],kj="6";try{window.__reactRouterVersion=kj}catch{}const Ej="startTransition",If=yo[Ej];function Pj(r){let{basename:a,children:l,future:o,window:c}=r,u=h.useRef();u.current==null&&(u.current=kv({window:c,v5Compat:!0}));let m=u.current,[f,g]=h.useState({action:m.action,location:m.location}),{v7_startTransition:y}=o||{},p=h.useCallback(v=>{y&&If?If(()=>g(v)):g(v)},[g,y]);return h.useLayoutEffect(()=>m.listen(p),[m,p]),h.useEffect(()=>gj(o),[o]),h.createElement(vj,{basename:a,children:l,location:f.location,navigationType:f.action,navigator:m,future:o})}const Tj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Rj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vd=h.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:u,replace:m,state:f,target:g,to:y,preventScrollReset:p,viewTransition:v}=a,E=bj(a,Cj),{basename:P}=h.useContext(fn),T,b=!1;if(typeof y=="string"&&Rj.test(y)&&(T=y,Tj))try{let N=new URL(window.location.href),_=y.startsWith("//")?new URL(N.protocol+y):new URL(y),V=hu(_.pathname,P);_.origin===N.origin&&V!=null?y=V+_.search+_.hash:b=!0}catch{}let j=ej(y,{relative:c}),w=Ij(y,{replace:m,state:f,target:g,preventScrollReset:p,relative:c,viewTransition:v});function C(N){o&&o(N),N.defaultPrevented||w(N)}return h.createElement("a",Bd({},E,{href:T||j,onClick:b||u?o:C,ref:l,target:g}))});var _f;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(_f||(_f={}));var Mf;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(Mf||(Mf={}));function Ij(r,a){let{target:l,replace:o,state:c,preventScrollReset:u,relative:m,viewTransition:f}=a===void 0?{}:a,g=Da(),y=xn(),p=Ax(r,{relative:m});return h.useCallback(v=>{if(wj(v,l)){v.preventDefault();let E=o!==void 0?o:no(y)===no(p);g(r,{replace:E,state:c,preventScrollReset:u,relative:m,viewTransition:f})}},[y,g,p,o,c,l,r,u,m,f])}function _j(r){let a=h.useRef(Ud(r)),l=h.useRef(!1),o=xn(),c=h.useMemo(()=>Sj(o.search,l.current?null:a.current),[o.search]),u=Da(),m=h.useCallback((f,g)=>{const y=Ud(typeof f=="function"?f(c):f);l.current=!0,u("?"+y,g)},[u,c]);return[c,m]}/**
|
||
* @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=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Aj=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,o)=>o?o.toUpperCase():l.toLowerCase()),Af=r=>{const a=Aj(r);return a.charAt(0).toUpperCase()+a.slice(1)},Fx=(...r)=>r.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim(),Dj=r=>{for(const a in r)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 Lj={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 Oj=h.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:m,...f},g)=>h.createElement("svg",{ref:g,...Lj,width:a,height:a,stroke:r,strokeWidth:o?Number(l)*24/Number(a):l,className:Fx("lucide",c),...!u&&!Dj(f)&&{"aria-hidden":"true"},...f},[...m.map(([y,p])=>h.createElement(y,p)),...Array.isArray(u)?u:[u]]));/**
|
||
* @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 Ee=(r,a)=>{const l=h.forwardRef(({className:o,...c},u)=>h.createElement(Oj,{ref:u,iconNode:a,className:Fx(`lucide-${Mj(Af(r))}`,`lucide-${r}`,o),...c}));return l.displayName=Af(r),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 Fj=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],zj=Ee("activity",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 $j=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Bj=Ee("arrow-up-down",$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:"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"}]],Df=Ee("bitcoin",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=[["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"}]],Ks=Ee("book-open",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 Wj=[["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"}]],ao=Ee("calendar",Wj);/**
|
||
* @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=[["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"}]],Kj=Ee("chart-column",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 Gj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jo=Ee("check",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 Yj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Tl=Ee("chevron-down",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 Qj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],en=Ee("chevron-right",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=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],zx=Ee("chevron-up",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=[["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"}]],Jj=Ee("circle-alert",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 Zj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Lf=Ee("circle-check-big",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 eb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Wd=Ee("circle-check",eb);/**
|
||
* @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=[["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"}]],$x=Ee("circle-question-mark",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 sb=[["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"}]],Nd=Ee("circle-user",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 rb=[["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"}]],Bx=Ee("circle-x",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 nb=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Hd=Ee("clock",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 ab=[["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"}]],Ux=Ee("copy",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=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Of=Ee("credit-card",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 ib=[["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"}]],sn=Ee("crown",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 ob=[["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"}]],Rl=Ee("dollar-sign",ob);/**
|
||
* @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:"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"}]],db=Ee("download",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=[["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"}]],lo=Ee("external-link",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:"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"}]],Cr=Ee("eye",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 mb=[["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"}]],fb=Ee("file-text",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 xb=[["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"}]],Vx=Ee("funnel",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 pb=[["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"}]],gb=Ee("gift",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 yb=[["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"}]],vb=Ee("git-merge",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 jb=[["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"}]],Kd=Ee("globe",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:"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"}]],Nb=Ee("graduation-cap",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 wb=[["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"}]],Nr=Ee("grip-vertical",wb);/**
|
||
* @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:"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"}]],Cb=Ee("handshake",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 kb=[["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"}]],Eb=Ee("house",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:"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"}]],Wx=Ee("image",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 Tb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Hi=Ee("info",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:"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"}]],Ff=Ee("key",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 Ib=[["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"}]],_b=Ee("layout-dashboard",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 Mb=[["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"}]],ln=Ee("link-2",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 Ab=[["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"}]],zf=Ee("link",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 Db=[["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"}]],Lb=Ee("lock",Db);/**
|
||
* @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 Ob=[["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"}]],Fb=Ee("log-out",Ob);/**
|
||
* @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:"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"}]],Hx=Ee("map-pin",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 $b=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Bb=Ee("menu",$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 Ub=[["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"}]],Vb=Ee("message-circle",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 Wb=[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]],Ca=Ee("navigation",Wb);/**
|
||
* @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:"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"}]],Kb=Ee("palette",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 Gb=[["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"}]],mt=Ee("pen-line",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 Yb=[["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"}]],Qb=Ee("percent",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 qb=[["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"}]],Xb=Ee("phone",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 Jb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pt=Ee("plus",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=[["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"}]],$f=Ee("qr-code",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=[["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=Ee("refresh-cw",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:"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"}]],_t=Ee("save",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:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],on=Ee("search",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 rN=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],nN=Ee("send",rN);/**
|
||
* @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.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"}]],On=Ee("settings",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:"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"}]],wd=Ee("settings-2",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:"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"}]],pu=Ee("shield-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 oN=[["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"}]],Gd=Ee("shopping-bag",oN);/**
|
||
* @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=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Il=Ee("smartphone",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:"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"}]],Sd=Ee("tag",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:"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"}]],Wt=Ee("trash-2",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:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ka=Ee("trending-up",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 mN=[["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"}]],Kx=Ee("undo-2",mN);/**
|
||
* @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:"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"}]],io=Ee("upload",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 xN=[["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"}]],pN=Ee("user-check",xN);/**
|
||
* @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 gN=[["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"}]],Yd=Ee("user-plus",gN);/**
|
||
* @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 yN=[["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"}]],Ea=Ee("user",yN);/**
|
||
* @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 vN=[["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=Ee("users",vN);/**
|
||
* @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 jN=[["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"}]],Ra=Ee("wallet",jN);/**
|
||
* @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 bN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fs=Ee("x",bN);/**
|
||
* @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:"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"}]],nn=Ee("zap",NN),gu="admin_token";function yu(){try{return localStorage.getItem(gu)}catch{return null}}function wN(r){try{localStorage.setItem(gu,r)}catch{}}function SN(){try{localStorage.removeItem(gu)}catch{}}const CN="https://soulapi.quwanzhi.com",kN=15e3,EN=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):CN};function Ia(r){const a=EN(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function bo(r,a={}){const{data:l,...o}=a,c=Ia(r),u=new Headers(o.headers),m=yu();m&&u.set("Authorization",`Bearer ${m}`),l!=null&&!u.has("Content-Type")&&u.set("Content-Type","application/json");const f=l!=null?JSON.stringify(l):o.body,g=new AbortController,y=setTimeout(()=>g.abort(),kN),p=await fetch(c,{...o,headers:u,body:f,credentials:"include",signal:g.signal}).finally(()=>clearTimeout(y)),E=(p.headers.get("Content-Type")||"").includes("application/json")?await p.json():p;if(!p.ok){const P=new Error((E==null?void 0:E.error)||`HTTP ${p.status}`);throw P.status=p.status,P.data=E,P}return E}function Be(r,a){return bo(r,{...a,method:"GET"})}function ft(r,a,l){return bo(r,{...l,method:"POST",data:a})}function yt(r,a,l){return bo(r,{...l,method:"PUT",data:a})}function kr(r,a){return bo(r,{...a,method:"DELETE"})}const PN=[{icon:_b,label:"数据概览",href:"/dashboard"},{icon:Ks,label:"内容管理",href:"/content"},{icon:Qt,label:"用户管理",href:"/users"},{icon:vb,label:"找伙伴",href:"/find-partner"},{icon:Ra,label:"推广中心",href:"/distribution"}];function TN(){const r=xn(),a=Da(),[l,o]=h.useState(!1),[c,u]=h.useState(!1);h.useEffect(()=>{o(!0)},[]),h.useEffect(()=>{if(!l)return;u(!1);let f=!1;return Be("/api/admin").then(g=>{f||(g&&g.success!==!1?u(!0):a("/login",{replace:!0}))}).catch(()=>{f||a("/login",{replace:!0})}),()=>{f=!0}},[l,a]);const m=async()=>{SN();try{await ft("/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:[PN.map(f=>{const g=r.pathname===f.href;return e.jsxs(Vd,{to:f.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(f.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:f.label})]},f.href)}),e.jsx("div",{className:"pt-4 mt-4 border-t border-gray-700/50",children:e.jsxs(Vd,{to:"/settings",className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${r.pathname==="/settings"?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(On,{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:m,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(Fb,{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(yj,{})})})]})}function Bf(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function vu(...r){return a=>{let l=!1;const o=r.map(c=>{const u=Bf(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c<o.length;c++){const u=o[c];typeof u=="function"?u():Bf(r[c],null)}}}}function lt(...r){return h.useCallback(vu(...r),r)}var RN=Symbol.for("react.lazy"),oo=yo[" use ".trim().toString()];function IN(r){return typeof r=="object"&&r!==null&&"then"in r}function Gx(r){return r!=null&&typeof r=="object"&&"$$typeof"in r&&r.$$typeof===RN&&"_payload"in r&&IN(r._payload)}function Yx(r){const a=_N(r),l=h.forwardRef((o,c)=>{let{children:u,...m}=o;Gx(u)&&typeof oo=="function"&&(u=oo(u._payload));const f=h.Children.toArray(u),g=f.find(AN);if(g){const y=g.props.children,p=f.map(v=>v===g?h.Children.count(y)>1?h.Children.only(null):h.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(y)?h.cloneElement(y,void 0,p):null})}return e.jsx(a,{...m,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}var Qx=Yx("Slot");function _N(r){const a=h.forwardRef((l,o)=>{let{children:c,...u}=l;if(Gx(c)&&typeof oo=="function"&&(c=oo(c._payload)),h.isValidElement(c)){const m=LN(c),f=DN(u,c.props);return c.type!==h.Fragment&&(f.ref=o?vu(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var MN=Symbol("radix.slottable");function AN(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===MN}function DN(r,a){const l={...a};for(const o in a){const c=r[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...f)=>{const g=u(...f);return c(...f),g}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function LN(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}function qx(r){var a,l,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;a<c;a++)r[a]&&(l=qx(r[a]))&&(o&&(o+=" "),o+=l)}else for(l in r)r[l]&&(o&&(o+=" "),o+=l);return o}function Xx(){for(var r,a,l=0,o="",c=arguments.length;l<c;l++)(r=arguments[l])&&(a=qx(r))&&(o&&(o+=" "),o+=a);return o}const Uf=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,Vf=Xx,Jx=(r,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return Vf(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:u}=a,m=Object.keys(c).map(y=>{const p=l==null?void 0:l[y],v=u==null?void 0:u[y];if(p===null)return null;const E=Uf(p)||Uf(v);return c[y][E]}),f=l&&Object.entries(l).reduce((y,p)=>{let[v,E]=p;return E===void 0||(y[v]=E),y},{}),g=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((y,p)=>{let{class:v,className:E,...P}=p;return Object.entries(P).every(T=>{let[b,j]=T;return Array.isArray(j)?j.includes({...u,...f}[b]):{...u,...f}[b]===j})?[...y,v,E]:y},[]);return Vf(r,m,g,l==null?void 0:l.class,l==null?void 0:l.className)},ON=(r,a)=>{const l=new Array(r.length+a.length);for(let o=0;o<r.length;o++)l[o]=r[o];for(let o=0;o<a.length;o++)l[r.length+o]=a[o];return l},FN=(r,a)=>({classGroupId:r,validator:a}),Zx=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),co="-",Wf=[],zN="arbitrary..",$N=r=>{const a=UN(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return BN(m);const f=m.split(co),g=f[0]===""&&f.length>1?1:0;return ep(f,g,a)},getConflictingClassGroupIds:(m,f)=>{if(f){const g=o[m],y=l[m];return g?y?ON(y,g):g:y||Wf}return l[m]||Wf}}},ep=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],u=l.nextPart.get(c);if(u){const y=ep(r,a+1,u);if(y)return y}const m=l.validators;if(m===null)return;const f=a===0?r.join(co):r.slice(a).join(co),g=m.length;for(let y=0;y<g;y++){const p=m[y];if(p.validator(f))return p.classGroupId}},BN=r=>r.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?zN+o:void 0})(),UN=r=>{const{theme:a,classGroups:l}=r;return VN(l,a)},VN=(r,a)=>{const l=Zx();for(const o in r){const c=r[o];ju(c,l,o,a)}return l},ju=(r,a,l,o)=>{const c=r.length;for(let u=0;u<c;u++){const m=r[u];WN(m,a,l,o)}},WN=(r,a,l,o)=>{if(typeof r=="string"){HN(r,a,l);return}if(typeof r=="function"){KN(r,a,l,o);return}GN(r,a,l,o)},HN=(r,a,l)=>{const o=r===""?a:tp(a,r);o.classGroupId=l},KN=(r,a,l,o)=>{if(YN(r)){ju(r(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(FN(l,r))},GN=(r,a,l,o)=>{const c=Object.entries(r),u=c.length;for(let m=0;m<u;m++){const[f,g]=c[m];ju(g,tp(a,f),l,o)}},tp=(r,a)=>{let l=r;const o=a.split(co),c=o.length;for(let u=0;u<c;u++){const m=o[u];let f=l.nextPart.get(m);f||(f=Zx(),l.nextPart.set(m,f)),l=f}return l},YN=r=>"isThemeGetter"in r&&r.isThemeGetter===!0,QN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(u,m)=>{l[u]=m,a++,a>r&&(a=0,o=l,l=Object.create(null))};return{get(u){let m=l[u];if(m!==void 0)return m;if((m=o[u])!==void 0)return c(u,m),m},set(u,m){u in l?l[u]=m:c(u,m)}}},Qd="!",Hf=":",qN=[],Kf=(r,a,l,o,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),XN=r=>{const{prefix:a,experimentalParseClassName:l}=r;let o=c=>{const u=[];let m=0,f=0,g=0,y;const p=c.length;for(let b=0;b<p;b++){const j=c[b];if(m===0&&f===0){if(j===Hf){u.push(c.slice(g,b)),g=b+1;continue}if(j==="/"){y=b;continue}}j==="["?m++:j==="]"?m--:j==="("?f++:j===")"&&f--}const v=u.length===0?c:c.slice(g);let E=v,P=!1;v.endsWith(Qd)?(E=v.slice(0,-1),P=!0):v.startsWith(Qd)&&(E=v.slice(1),P=!0);const T=y&&y>g?y-g:void 0;return Kf(u,P,E,T)};if(a){const c=a+Hf,u=o;o=m=>m.startsWith(c)?u(m.slice(c.length)):Kf(qN,!1,m,void 0,!0)}if(l){const c=o;o=u=>l({className:u,parseClassName:c})}return o},JN=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let u=0;u<l.length;u++){const m=l[u],f=m[0]==="[",g=a.has(m);f||g?(c.length>0&&(c.sort(),o.push(...c),c=[]),o.push(m)):c.push(m)}return c.length>0&&(c.sort(),o.push(...c)),o}},ZN=r=>({cache:QN(r.cacheSize),parseClassName:XN(r),sortModifiers:JN(r),...$N(r)}),ew=/\s+/,tw=(r,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:u}=a,m=[],f=r.trim().split(ew);let g="";for(let y=f.length-1;y>=0;y-=1){const p=f[y],{isExternal:v,modifiers:E,hasImportantModifier:P,baseClassName:T,maybePostfixModifierPosition:b}=l(p);if(v){g=p+(g.length>0?" "+g:g);continue}let j=!!b,w=o(j?T.substring(0,b):T);if(!w){if(!j){g=p+(g.length>0?" "+g:g);continue}if(w=o(T),!w){g=p+(g.length>0?" "+g:g);continue}j=!1}const C=E.length===0?"":E.length===1?E[0]:u(E).join(":"),N=P?C+Qd:C,_=N+w;if(m.indexOf(_)>-1)continue;m.push(_);const V=c(w,j);for(let U=0;U<V.length;++U){const I=V[U];m.push(N+I)}g=p+(g.length>0?" "+g:g)}return g},sw=(...r)=>{let a=0,l,o,c="";for(;a<r.length;)(l=r[a++])&&(o=sp(l))&&(c&&(c+=" "),c+=o);return c},sp=r=>{if(typeof r=="string")return r;let a,l="";for(let o=0;o<r.length;o++)r[o]&&(a=sp(r[o]))&&(l&&(l+=" "),l+=a);return l},rw=(r,...a)=>{let l,o,c,u;const m=g=>{const y=a.reduce((p,v)=>v(p),r());return l=ZN(y),o=l.cache.get,c=l.cache.set,u=f,f(g)},f=g=>{const y=o(g);if(y)return y;const p=tw(g,l);return c(g,p),p};return u=m,(...g)=>u(sw(...g))},nw=[],$t=r=>{const a=l=>l[r]||nw;return a.isThemeGetter=!0,a},rp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,np=/^\((?:(\w[\w-]*):)?(.+)\)$/i,aw=/^\d+\/\d+$/,lw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iw=/\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$/,ow=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ya=r=>aw.test(r),Qe=r=>!!r&&!Number.isNaN(Number(r)),Jr=r=>!!r&&Number.isInteger(Number(r)),Cd=r=>r.endsWith("%")&&Qe(r.slice(0,-1)),wr=r=>lw.test(r),uw=()=>!0,hw=r=>iw.test(r)&&!ow.test(r),ap=()=>!1,mw=r=>cw.test(r),fw=r=>dw.test(r),xw=r=>!Me(r)&&!Ae(r),pw=r=>La(r,op,ap),Me=r=>rp.test(r),Ln=r=>La(r,cp,hw),kd=r=>La(r,bw,Qe),Gf=r=>La(r,lp,ap),gw=r=>La(r,ip,fw),Ki=r=>La(r,dp,mw),Ae=r=>np.test(r),wl=r=>Oa(r,cp),yw=r=>Oa(r,Nw),Yf=r=>Oa(r,lp),vw=r=>Oa(r,op),jw=r=>Oa(r,ip),Gi=r=>Oa(r,dp,!0),La=(r,a,l)=>{const o=rp.exec(r);return o?o[1]?a(o[1]):l(o[2]):!1},Oa=(r,a,l=!1)=>{const o=np.exec(r);return o?o[1]?a(o[1]):l:!1},lp=r=>r==="position"||r==="percentage",ip=r=>r==="image"||r==="url",op=r=>r==="length"||r==="size"||r==="bg-size",cp=r=>r==="length",bw=r=>r==="number",Nw=r=>r==="family-name",dp=r=>r==="shadow",ww=()=>{const r=$t("color"),a=$t("font"),l=$t("text"),o=$t("font-weight"),c=$t("tracking"),u=$t("leading"),m=$t("breakpoint"),f=$t("container"),g=$t("spacing"),y=$t("radius"),p=$t("shadow"),v=$t("inset-shadow"),E=$t("text-shadow"),P=$t("drop-shadow"),T=$t("blur"),b=$t("perspective"),j=$t("aspect"),w=$t("ease"),C=$t("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],V=()=>[..._(),Ae,Me],U=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],k=()=>[Ae,Me,g],R=()=>[ya,"full","auto",...k()],ee=()=>[Jr,"none","subgrid",Ae,Me],ne=()=>["auto",{span:["full",Jr,Ae,Me]},Jr,Ae,Me],ie=()=>[Jr,"auto",Ae,Me],te=()=>["auto","min","max","fr",Ae,Me],se=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],ae=()=>["auto",...k()],ve=()=>[ya,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],$=()=>[r,Ae,Me],ce=()=>[..._(),Yf,Gf,{position:[Ae,Me]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",vw,pw,{size:[Ae,Me]}],O=()=>[Cd,wl,Ln],L=()=>["","none","full",y,Ae,Me],X=()=>["",Qe,wl,Ln],G=()=>["solid","dashed","dotted","double"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[Qe,Cd,Yf,Gf],pe=()=>["","none",T,Ae,Me],Ce=()=>["none",Qe,Ae,Me],D=()=>["none",Qe,Ae,Me],ue=()=>[Qe,Ae,Me],ke=()=>[ya,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[wr],breakpoint:[wr],color:[uw],container:[wr],"drop-shadow":[wr],ease:["in","out","in-out"],font:[xw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[wr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[wr],shadow:[wr],spacing:["px",Qe],text:[wr],"text-shadow":[wr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ya,Me,Ae,j]}],container:["container"],columns:[{columns:[Qe,Me,Ae,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:V()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[Jr,"auto",Ae,Me]}],basis:[{basis:[ya,"full","auto",f,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,ya,"auto","initial","none",Me]}],grow:[{grow:["",Qe,Ae,Me]}],shrink:[{shrink:["",Qe,Ae,Me]}],order:[{order:[Jr,"first","last","none",Ae,Me]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:ne()}],"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":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...se(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...se()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":se()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:ae()}],mx:[{mx:ae()}],my:[{my:ae()}],ms:[{ms:ae()}],me:[{me:ae()}],mt:[{mt:ae()}],mr:[{mr:ae()}],mb:[{mb:ae()}],ml:[{ml:ae()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:ve()}],w:[{w:[f,"screen",...ve()]}],"min-w":[{"min-w":[f,"screen","none",...ve()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[m]},...ve()]}],h:[{h:["screen","lh",...ve()]}],"min-h":[{"min-h":["screen","lh","none",...ve()]}],"max-h":[{"max-h":["screen","lh",...ve()]}],"font-size":[{text:["base",l,wl,Ln]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ae,kd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cd,Me]}],"font-family":[{font:[yw,Me,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,Ae,Me]}],"line-clamp":[{"line-clamp":[Qe,"none",Ae,kd]}],leading:[{leading:[u,...k()]}],"list-image":[{"list-image":["none",Ae,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",Ae,Ln]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Qe,"auto",Ae,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,Me]}],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",Ae,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Jr,Ae,Me],radial:["",Ae,Me],conic:[Jr,Ae,Me]},jw,gw]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"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:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,Ae,Me]}],"outline-w":[{outline:["",Qe,wl,Ln]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",p,Gi,Ki]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",v,Gi,Ki]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Qe,Ln]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",E,Gi,Ki]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Qe,Ae,Me]}],"mix-blend":[{"mix-blend":[...de(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":de()}],"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":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Ae,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,Me]}],filter:[{filter:["","none",Ae,Me]}],blur:[{blur:pe()}],brightness:[{brightness:[Qe,Ae,Me]}],contrast:[{contrast:[Qe,Ae,Me]}],"drop-shadow":[{"drop-shadow":["","none",P,Gi,Ki]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Qe,Ae,Me]}],"hue-rotate":[{"hue-rotate":[Qe,Ae,Me]}],invert:[{invert:["",Qe,Ae,Me]}],saturate:[{saturate:[Qe,Ae,Me]}],sepia:[{sepia:["",Qe,Ae,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,Me]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,Ae,Me]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,Ae,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,Ae,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,Ae,Me]}],"backdrop-invert":[{"backdrop-invert":["",Qe,Ae,Me]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,Ae,Me]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,Ae,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,Ae,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",Ae,Me]}],ease:[{ease:["linear","initial",w,Ae,Me]}],delay:[{delay:[Qe,Ae,Me]}],animate:[{animate:["none",C,Ae,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ae,Me]}],"perspective-origin":[{"perspective-origin":V()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[Ae,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:V()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"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",Ae,Me]}],"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":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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",Ae,Me]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Qe,wl,Ln,kd]}],stroke:[{stroke:["none",...$()]}],"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"]}},Sw=rw(ww);function it(...r){return Sw(Xx(r))}const Cw=Jx("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 q({className:r,variant:a,size:l,asChild:o=!1,...c}){const u=o?Qx:"button";return e.jsx(u,{"data-slot":"button",className:it(Cw({variant:a,size:l,className:r})),...c})}function le({className:r,type:a,...l}){return e.jsx("input",{type:a,"data-slot":"input",className:it("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",r),...l})}function kw(){const r=Da(),[a,l]=h.useState(""),[o,c]=h.useState(""),[u,m]=h.useState(""),[f,g]=h.useState(!1),y=async()=>{m(""),g(!0);try{const p=await ft("/api/admin",{username:a.trim(),password:o});if((p==null?void 0:p.success)!==!1&&(p!=null&&p.token)){wN(p.token),r("/dashboard",{replace:!0});return}m(p.error||"用户名或密码错误")}catch(p){const v=p;m(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{g(!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(pu,{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(Ea,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(le,{type:"text",value:a,onChange:p=>l(p.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(Lb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(le,{type:"password",value:o,onChange:p=>c(p.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:p=>p.key==="Enter"&&y()})]})]}),u&&e.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:u}),e.jsx(q,{onClick:y,disabled:f,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:f?"登录中...":"登录"})]})]}),e.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const we=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("rounded-xl border bg-card text-card-foreground shadow",r),...a}));we.displayName="Card";const Ke=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("flex flex-col space-y-1.5 p-6",r),...a}));Ke.displayName="CardHeader";const Ge=h.forwardRef(({className:r,...a},l)=>e.jsx("h3",{ref:l,className:it("font-semibold leading-none tracking-tight",r),...a}));Ge.displayName="CardTitle";const vt=h.forwardRef(({className:r,...a},l)=>e.jsx("p",{ref:l,className:it("text-sm text-muted-foreground",r),...a}));vt.displayName="CardDescription";const Se=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("p-6 pt-0",r),...a}));Se.displayName="CardContent";const Ew=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:it("flex items-center p-6 pt-0",r),...a}));Ew.displayName="CardFooter";function Pw(){const r=Da(),[a,l]=h.useState(!0),[o,c]=h.useState([]),[u,m]=h.useState([]),[f,g]=h.useState(0),[y,p]=h.useState(0),[v,E]=h.useState(0),[P,T]=h.useState(0),[b,j]=h.useState(null);async function w(){var V;l(!0),j(null);try{try{const H=await Be("/api/admin/dashboard/overview");if(H!=null&&H.success){g(H.totalUsers??0),p(H.paidOrderCount??0),E(H.totalRevenue??0),T(H.conversionRate??0),m(H.recentOrders??[]),c(H.newUsers??[]);return}}catch(H){console.error("数据概览接口失败,尝试降级拉取",H)}const[U,I]=await Promise.all([Be("/api/db/users?page=1&pageSize=10"),Be("/api/orders?page=1&pageSize=20&status=paid")]),k=typeof(U==null?void 0:U.total)=="number"?U.total:((V=U==null?void 0:U.users)==null?void 0:V.length)??0,R=(I==null?void 0:I.orders)??[],ee=typeof(I==null?void 0:I.total)=="number"?I.total:R.length,ne=R.filter(H=>H.status==="paid"||H.status==="completed"||H.status==="success"),ie=ne.reduce((H,ae)=>H+Number(ae.amount||0),0),te=new Set(ne.map(H=>H.userId).filter(Boolean)),se=k>0&&te.size>0?te.size/k*100:0;g(k),p(ee),E(ie),T(se),m(R.slice(0,5)),c((U==null?void 0:U.users)??[])}catch(U){console.error("降级拉取失败",U);const I=U;(I==null?void 0:I.status)===401?j("登录已过期,请重新登录"):(I==null?void 0:I.name)==="AbortError"?j("请求超时,请检查网络后点击重试"):j("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(h.useEffect(()=>{w();const V=setInterval(w,3e4);return()=>clearInterval(V)},[]),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 C=f,N=V=>{const U=V.productType||"",I=V.description||"";if(I){if(U==="section"&&I.includes("章节")){if(I.includes("-")){const k=I.split("-");if(k.length>=3)return{title:`第${k[1]}章 第${k[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:I,subtitle:"章节购买"}}return U==="fullbook"||I.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"||I.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:I,subtitle:U==="section"?"单章":U==="fullbook"?"全书":"其他"}}return U==="section"?{title:`章节 ${V.productId||""}`,subtitle:"单章购买"}:U==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:U||"其他"}},_=[{title:"总用户数",value:C,icon:Qt,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${(v??0).toFixed(2)}`,icon:ka,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:Gd,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${typeof P=="number"?P.toFixed(1):0}%`,icon:Ks,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:"数据概览"}),b&&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:b}),e.jsx("button",{type:"button",onClick:()=>w(),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:_.map((V,U)=>e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>V.link&&r(V.link),children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(Ge,{className:"text-sm font-medium text-gray-400",children:V.title}),e.jsx("div",{className:`p-2 rounded-lg ${V.bg}`,children:e.jsx(V.icon,{className:`w-4 h-4 ${V.color}`})})]}),e.jsx(Se,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-2xl font-bold text-white",children:V.value}),e.jsx(en,{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(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsx(Ge,{className:"text-white",children:"最近订单"}),e.jsxs("button",{type:"button",onClick:()=>w(),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(Se,{children:e.jsxs("div",{className:"space-y-3",children:[u.slice(0,5).map(V=>{var ee;const U=V.referrerId?o.find(ne=>ne.id===V.referrerId):void 0,I=V.referralCode||(U==null?void 0:U.referralCode)||(U==null?void 0:U.nickname)||(V.referrerId?String(V.referrerId).slice(0,8):""),k=N(V),R=V.userNickname||((ee=o.find(ne=>ne.id===V.userId))==null?void 0:ee.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:[V.userAvatar?e.jsx("img",{src:V.userAvatar,alt:R,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:ne=>{ne.currentTarget.style.display="none";const ie=ne.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 ${V.userAvatar?"hidden":""}`,children:R.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:R}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:k.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:k.subtitle}),e.jsx("span",{children:new Date(V.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),I&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",I]})]})]}),e.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(V.amount).toFixed(2)]}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:V.paymentMethod||"微信"})]})]},V.id)}),u.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Gd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ke,{children:e.jsx(Ge,{className:"text-white",children:"新注册用户"})}),e.jsx(Se,{children:e.jsxs("div",{className:"space-y-3",children:[o.slice(0,5).map(V=>{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=V.nickname)==null?void 0:U.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-white",children:V.nickname||"匿名用户"}),e.jsx("p",{className:"text-xs text-gray-500",children:V.phone||"-"})]})]}),e.jsx("p",{className:"text-xs text-gray-400",children:V.createdAt?new Date(V.createdAt).toLocaleDateString():"-"})]},V.id)}),o.length===0&&e.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const xs=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:l,className:it("w-full caption-bottom text-sm",r),...a})}));xs.displayName="Table";const ps=h.forwardRef(({className:r,...a},l)=>e.jsx("thead",{ref:l,className:it("[&_tr]:border-b",r),...a}));ps.displayName="TableHeader";const gs=h.forwardRef(({className:r,...a},l)=>e.jsx("tbody",{ref:l,className:it("[&_tr:last-child]:border-0",r),...a}));gs.displayName="TableBody";const Je=h.forwardRef(({className:r,...a},l)=>e.jsx("tr",{ref:l,className:it("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));Je.displayName="TableRow";const be=h.forwardRef(({className:r,...a},l)=>e.jsx("th",{ref:l,className:it("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));be.displayName="TableHead";const xe=h.forwardRef(({className:r,...a},l)=>e.jsx("td",{ref:l,className:it("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));xe.displayName="TableCell";const Tw=Jx("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:r,variant:a,asChild:l=!1,...o}){const c=l?Qx:"span";return e.jsx(c,{className:it(Tw({variant:a}),r),...o})}function Ye(r,a,{checkForDefaultPrevented:l=!0}={}){return function(c){if(r==null||r(c),l===!1||!c.defaultPrevented)return a==null?void 0:a(c)}}function Rw(r,a){const l=h.createContext(a),o=u=>{const{children:m,...f}=u,g=h.useMemo(()=>f,Object.values(f));return e.jsx(l.Provider,{value:g,children:m})};o.displayName=r+"Provider";function c(u){const m=h.useContext(l);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${r}\``)}return[o,c]}function pn(r,a=[]){let l=[];function o(u,m){const f=h.createContext(m),g=l.length;l=[...l,m];const y=v=>{var w;const{scope:E,children:P,...T}=v,b=((w=E==null?void 0:E[r])==null?void 0:w[g])||f,j=h.useMemo(()=>T,Object.values(T));return e.jsx(b.Provider,{value:j,children:P})};y.displayName=u+"Provider";function p(v,E){var b;const P=((b=E==null?void 0:E[r])==null?void 0:b[g])||f,T=h.useContext(P);if(T)return T;if(m!==void 0)return m;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[y,p]}const c=()=>{const u=l.map(m=>h.createContext(m));return function(f){const g=(f==null?void 0:f[r])||u;return h.useMemo(()=>({[`__scope${r}`]:{...f,[r]:g}}),[f,g])}};return c.scopeName=r,[o,Iw(c,...a)]}function Iw(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const o=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(u){const m=o.reduce((f,{useScope:g,scopeName:y})=>{const v=g(u)[`__scope${y}`];return{...f,...v}},{});return h.useMemo(()=>({[`__scope${a.scopeName}`]:m}),[m])}};return l.scopeName=a.scopeName,l}var ts=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},_w=yo[" useId ".trim().toString()]||(()=>{}),Mw=0;function cn(r){const[a,l]=h.useState(_w());return ts(()=>{l(o=>o??String(Mw++))},[r]),a?`radix-${a}`:""}var Aw=yo[" useInsertionEffect ".trim().toString()]||ts;function Fn({prop:r,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,u,m]=Dw({defaultProp:a,onChange:l}),f=r!==void 0,g=f?r:c;{const p=h.useRef(r!==void 0);h.useEffect(()=>{const v=p.current;v!==f&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${f?"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.`),p.current=f},[f,o])}const y=h.useCallback(p=>{var v;if(f){const E=Lw(p)?p(r):p;E!==r&&((v=m.current)==null||v.call(m,E))}else u(p)},[f,r,u,m]);return[g,y]}function Dw({defaultProp:r,onChange:a}){const[l,o]=h.useState(r),c=h.useRef(l),u=h.useRef(a);return Aw(()=>{u.current=a},[a]),h.useEffect(()=>{var m;c.current!==l&&((m=u.current)==null||m.call(u,l),c.current=l)},[l,c]),[l,o,u]}function Lw(r){return typeof r=="function"}function _l(r){const a=Ow(r),l=h.forwardRef((o,c)=>{const{children:u,...m}=o,f=h.Children.toArray(u),g=f.find(zw);if(g){const y=g.props.children,p=f.map(v=>v===g?h.Children.count(y)>1?h.Children.only(null):h.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(y)?h.cloneElement(y,void 0,p):null})}return e.jsx(a,{...m,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}function Ow(r){const a=h.forwardRef((l,o)=>{const{children:c,...u}=l;if(h.isValidElement(c)){const m=Bw(c),f=$w(u,c.props);return c.type!==h.Fragment&&(f.ref=o?vu(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var Fw=Symbol("radix.slottable");function zw(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Fw}function $w(r,a){const l={...a};for(const o in a){const c=r[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...f)=>{const g=u(...f);return c(...f),g}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function Bw(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Uw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=Uw.reduce((r,a)=>{const l=_l(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:m,...f}=c,g=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(g,{...f,ref:u})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{});function Vw(r,a){r&&Al.flushSync(()=>r.dispatchEvent(a))}function un(r){const a=h.useRef(r);return h.useEffect(()=>{a.current=r}),h.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function Ww(r,a=globalThis==null?void 0:globalThis.document){const l=un(r);h.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 Hw="DismissableLayer",qd="dismissableLayer.update",Kw="dismissableLayer.pointerDownOutside",Gw="dismissableLayer.focusOutside",Qf,up=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bu=h.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:m,onDismiss:f,...g}=r,y=h.useContext(up),[p,v]=h.useState(null),E=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=h.useState({}),T=lt(a,I=>v(I)),b=Array.from(y.layers),[j]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(j),C=p?b.indexOf(p):-1,N=y.layersWithOutsidePointerEventsDisabled.size>0,_=C>=w,V=qw(I=>{const k=I.target,R=[...y.branches].some(ee=>ee.contains(k));!_||R||(c==null||c(I),m==null||m(I),I.defaultPrevented||f==null||f())},E),U=Xw(I=>{const k=I.target;[...y.branches].some(ee=>ee.contains(k))||(u==null||u(I),m==null||m(I),I.defaultPrevented||f==null||f())},E);return Ww(I=>{C===y.layers.size-1&&(o==null||o(I),!I.defaultPrevented&&f&&(I.preventDefault(),f()))},E),h.useEffect(()=>{if(p)return l&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Qf=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(p)),y.layers.add(p),qf(),()=>{l&&y.layersWithOutsidePointerEventsDisabled.size===1&&(E.body.style.pointerEvents=Qf)}},[p,E,l,y]),h.useEffect(()=>()=>{p&&(y.layers.delete(p),y.layersWithOutsidePointerEventsDisabled.delete(p),qf())},[p,y]),h.useEffect(()=>{const I=()=>P({});return document.addEventListener(qd,I),()=>document.removeEventListener(qd,I)},[]),e.jsx(qe.div,{...g,ref:T,style:{pointerEvents:N?_?"auto":"none":void 0,...r.style},onFocusCapture:Ye(r.onFocusCapture,U.onFocusCapture),onBlurCapture:Ye(r.onBlurCapture,U.onBlurCapture),onPointerDownCapture:Ye(r.onPointerDownCapture,V.onPointerDownCapture)})});bu.displayName=Hw;var Yw="DismissableLayerBranch",Qw=h.forwardRef((r,a)=>{const l=h.useContext(up),o=h.useRef(null),c=lt(a,o);return h.useEffect(()=>{const u=o.current;if(u)return l.branches.add(u),()=>{l.branches.delete(u)}},[l.branches]),e.jsx(qe.div,{...r,ref:c})});Qw.displayName=Yw;function qw(r,a=globalThis==null?void 0:globalThis.document){const l=un(r),o=h.useRef(!1),c=h.useRef(()=>{});return h.useEffect(()=>{const u=f=>{if(f.target&&!o.current){let g=function(){hp(Kw,l,y,{discrete:!0})};const y={originalEvent:f};f.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=g,a.addEventListener("click",c.current,{once:!0})):g()}else a.removeEventListener("click",c.current);o.current=!1},m=window.setTimeout(()=>{a.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(m),a.removeEventListener("pointerdown",u),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>o.current=!0}}function Xw(r,a=globalThis==null?void 0:globalThis.document){const l=un(r),o=h.useRef(!1);return h.useEffect(()=>{const c=u=>{u.target&&!o.current&&hp(Gw,l,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function qf(){const r=new CustomEvent(qd);document.dispatchEvent(r)}function hp(r,a,l,{discrete:o}){const c=l.originalEvent.target,u=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),o?Vw(c,u):c.dispatchEvent(u)}var Ed="focusScope.autoFocusOnMount",Pd="focusScope.autoFocusOnUnmount",Xf={bubbles:!1,cancelable:!0},Jw="FocusScope",Nu=h.forwardRef((r,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:u,...m}=r,[f,g]=h.useState(null),y=un(c),p=un(u),v=h.useRef(null),E=lt(a,b=>g(b)),P=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let b=function(N){if(P.paused||!f)return;const _=N.target;f.contains(_)?v.current=_:tn(v.current,{select:!0})},j=function(N){if(P.paused||!f)return;const _=N.relatedTarget;_!==null&&(f.contains(_)||tn(v.current,{select:!0}))},w=function(N){if(document.activeElement===document.body)for(const V of N)V.removedNodes.length>0&&tn(f)};document.addEventListener("focusin",b),document.addEventListener("focusout",j);const C=new MutationObserver(w);return f&&C.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",j),C.disconnect()}}},[o,f,P.paused]),h.useEffect(()=>{if(f){Zf.add(P);const b=document.activeElement;if(!f.contains(b)){const w=new CustomEvent(Ed,Xf);f.addEventListener(Ed,y),f.dispatchEvent(w),w.defaultPrevented||(Zw(n1(mp(f)),{select:!0}),document.activeElement===b&&tn(f))}return()=>{f.removeEventListener(Ed,y),setTimeout(()=>{const w=new CustomEvent(Pd,Xf);f.addEventListener(Pd,p),f.dispatchEvent(w),w.defaultPrevented||tn(b??document.body,{select:!0}),f.removeEventListener(Pd,p),Zf.remove(P)},0)}}},[f,y,p,P]);const T=h.useCallback(b=>{if(!l&&!o||P.paused)return;const j=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,w=document.activeElement;if(j&&w){const C=b.currentTarget,[N,_]=e1(C);N&&_?!b.shiftKey&&w===_?(b.preventDefault(),l&&tn(N,{select:!0})):b.shiftKey&&w===N&&(b.preventDefault(),l&&tn(_,{select:!0})):w===C&&b.preventDefault()}},[l,o,P.paused]);return e.jsx(qe.div,{tabIndex:-1,...m,ref:E,onKeyDown:T})});Nu.displayName=Jw;function Zw(r,{select:a=!1}={}){const l=document.activeElement;for(const o of r)if(tn(o,{select:a}),document.activeElement!==l)return}function e1(r){const a=mp(r),l=Jf(a,r),o=Jf(a.reverse(),r);return[l,o]}function mp(r){const a=[],l=document.createTreeWalker(r,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 Jf(r,a){for(const l of r)if(!t1(l,{upTo:a}))return l}function t1(r,{upTo:a}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(a!==void 0&&r===a)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function s1(r){return r instanceof HTMLInputElement&&"select"in r}function tn(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&s1(r)&&a&&r.select()}}var Zf=r1();function r1(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=ex(r,a),r.unshift(a)},remove(a){var l;r=ex(r,a),(l=r[0])==null||l.resume()}}}function ex(r,a){const l=[...r],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function n1(r){return r.filter(a=>a.tagName!=="A")}var a1="Portal",wu=h.forwardRef((r,a)=>{var f;const{container:l,...o}=r,[c,u]=h.useState(!1);ts(()=>u(!0),[]);const m=l||c&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return m?Cv.createPortal(e.jsx(qe.div,{...o,ref:a}),m):null});wu.displayName=a1;function l1(r,a){return h.useReducer((l,o)=>a[l][o]??l,r)}var Dl=r=>{const{present:a,children:l}=r,o=i1(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),u=lt(o.ref,o1(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:u}):null};Dl.displayName="Presence";function i1(r){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(r),u=h.useRef("none"),m=r?"mounted":"unmounted",[f,g]=l1(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const y=Yi(o.current);u.current=f==="mounted"?y:"none"},[f]),ts(()=>{const y=o.current,p=c.current;if(p!==r){const E=u.current,P=Yi(y);r?g("MOUNT"):P==="none"||(y==null?void 0:y.display)==="none"?g("UNMOUNT"):g(p&&E!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,g]),ts(()=>{if(a){let y;const p=a.ownerDocument.defaultView??window,v=P=>{const b=Yi(o.current).includes(CSS.escape(P.animationName));if(P.target===a&&b&&(g("ANIMATION_END"),!c.current)){const j=a.style.animationFillMode;a.style.animationFillMode="forwards",y=p.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=j)})}},E=P=>{P.target===a&&(u.current=Yi(o.current))};return a.addEventListener("animationstart",E),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{p.clearTimeout(y),a.removeEventListener("animationstart",E),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else g("ANIMATION_END")},[a,g]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:h.useCallback(y=>{o.current=y?getComputedStyle(y):null,l(y)},[])}}function Yi(r){return(r==null?void 0:r.animationName)||"none"}function o1(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Td=0;function fp(){h.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??tx()),document.body.insertAdjacentElement("beforeend",r[1]??tx()),Td++,()=>{Td===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Td--}},[])}function tx(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var ar=function(){return ar=Object.assign||function(a){for(var l,o=1,c=arguments.length;o<c;o++){l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},ar.apply(this,arguments)};function xp(r,a){var l={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&a.indexOf(o)<0&&(l[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(r);c<o.length;c++)a.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(r,o[c])&&(l[o[c]]=r[o[c]]);return l}function c1(r,a,l){if(l||arguments.length===2)for(var o=0,c=a.length,u;o<c;o++)(u||!(o in a))&&(u||(u=Array.prototype.slice.call(a,0,o)),u[o]=a[o]);return r.concat(u||Array.prototype.slice.call(a))}var to="right-scroll-bar-position",so="width-before-scroll-bar",d1="with-scroll-bars-hidden",u1="--removed-body-scroll-bar-size";function Rd(r,a){return typeof r=="function"?r(a):r&&(r.current=a),r}function h1(r,a){var l=h.useState(function(){return{value:r,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 m1=typeof window<"u"?h.useLayoutEffect:h.useEffect,sx=new WeakMap;function f1(r,a){var l=h1(null,function(o){return r.forEach(function(c){return Rd(c,o)})});return m1(function(){var o=sx.get(l);if(o){var c=new Set(o),u=new Set(r),m=l.current;c.forEach(function(f){u.has(f)||Rd(f,null)}),u.forEach(function(f){c.has(f)||Rd(f,m)})}sx.set(l,r)},[r]),l}function x1(r){return r}function p1(r,a){a===void 0&&(a=x1);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]:r},useMedium:function(u){var m=a(u,o);return l.push(m),function(){l=l.filter(function(f){return f!==m})}},assignSyncMedium:function(u){for(o=!0;l.length;){var m=l;l=[],m.forEach(u)}l={push:function(f){return u(f)},filter:function(){return l}}},assignMedium:function(u){o=!0;var m=[];if(l.length){var f=l;l=[],f.forEach(u),m=l}var g=function(){var p=m;m=[],p.forEach(u)},y=function(){return Promise.resolve().then(g)};y(),l={push:function(p){m.push(p),y()},filter:function(p){return m=m.filter(p),l}}}};return c}function g1(r){r===void 0&&(r={});var a=p1(null);return a.options=ar({async:!0,ssr:!1},r),a}var pp=function(r){var a=r.sideCar,l=xp(r,["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 h.createElement(o,ar({},l))};pp.isSideCarExport=!0;function y1(r,a){return r.useMedium(a),pp}var gp=g1(),Id=function(){},No=h.forwardRef(function(r,a){var l=h.useRef(null),o=h.useState({onScrollCapture:Id,onWheelCapture:Id,onTouchMoveCapture:Id}),c=o[0],u=o[1],m=r.forwardProps,f=r.children,g=r.className,y=r.removeScrollBar,p=r.enabled,v=r.shards,E=r.sideCar,P=r.noRelative,T=r.noIsolation,b=r.inert,j=r.allowPinchZoom,w=r.as,C=w===void 0?"div":w,N=r.gapMode,_=xp(r,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),V=E,U=f1([l,a]),I=ar(ar({},_),c);return h.createElement(h.Fragment,null,p&&h.createElement(V,{sideCar:gp,removeScrollBar:y,shards:v,noRelative:P,noIsolation:T,inert:b,setCallbacks:u,allowPinchZoom:!!j,lockRef:l,gapMode:N}),m?h.cloneElement(h.Children.only(f),ar(ar({},I),{ref:U})):h.createElement(C,ar({},I,{className:g,ref:U}),f))});No.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};No.classNames={fullWidth:so,zeroRight:to};var v1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function j1(){if(!document)return null;var r=document.createElement("style");r.type="text/css";var a=v1();return a&&r.setAttribute("nonce",a),r}function b1(r,a){r.styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a))}function N1(r){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(r)}var w1=function(){var r=0,a=null;return{add:function(l){r==0&&(a=j1())&&(b1(a,l),N1(a)),r++},remove:function(){r--,!r&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},S1=function(){var r=w1();return function(a,l){h.useEffect(function(){return r.add(a),function(){r.remove()}},[a&&l])}},yp=function(){var r=S1(),a=function(l){var o=l.styles,c=l.dynamic;return r(o,c),null};return a},C1={left:0,top:0,right:0,gap:0},_d=function(r){return parseInt(r||"",10)||0},k1=function(r){var a=window.getComputedStyle(document.body),l=a[r==="padding"?"paddingLeft":"marginLeft"],o=a[r==="padding"?"paddingTop":"marginTop"],c=a[r==="padding"?"paddingRight":"marginRight"];return[_d(l),_d(o),_d(c)]},E1=function(r){if(r===void 0&&(r="margin"),typeof window>"u")return C1;var a=k1(r),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])}},P1=yp(),Pa="data-scroll-locked",T1=function(r,a,l,o){var c=r.left,u=r.top,m=r.right,f=r.gap;return l===void 0&&(l="margin"),`
|
||
.`.concat(d1,` {
|
||
overflow: hidden `).concat(o,`;
|
||
padding-right: `).concat(f,"px ").concat(o,`;
|
||
}
|
||
body[`).concat(Pa,`] {
|
||
overflow: hidden `).concat(o,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&`
|
||
padding-left: `.concat(c,`px;
|
||
padding-top: `).concat(u,`px;
|
||
padding-right: `).concat(m,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(f,"px ").concat(o,`;
|
||
`),l==="padding"&&"padding-right: ".concat(f,"px ").concat(o,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(to,` {
|
||
right: `).concat(f,"px ").concat(o,`;
|
||
}
|
||
|
||
.`).concat(so,` {
|
||
margin-right: `).concat(f,"px ").concat(o,`;
|
||
}
|
||
|
||
.`).concat(to," .").concat(to,` {
|
||
right: 0 `).concat(o,`;
|
||
}
|
||
|
||
.`).concat(so," .").concat(so,` {
|
||
margin-right: 0 `).concat(o,`;
|
||
}
|
||
|
||
body[`).concat(Pa,`] {
|
||
`).concat(u1,": ").concat(f,`px;
|
||
}
|
||
`)},rx=function(){var r=parseInt(document.body.getAttribute(Pa)||"0",10);return isFinite(r)?r:0},R1=function(){h.useEffect(function(){return document.body.setAttribute(Pa,(rx()+1).toString()),function(){var r=rx()-1;r<=0?document.body.removeAttribute(Pa):document.body.setAttribute(Pa,r.toString())}},[])},I1=function(r){var a=r.noRelative,l=r.noImportant,o=r.gapMode,c=o===void 0?"margin":o;R1();var u=h.useMemo(function(){return E1(c)},[c]);return h.createElement(P1,{styles:T1(u,!a,c,l?"":"!important")})},Xd=!1;if(typeof window<"u")try{var Qi=Object.defineProperty({},"passive",{get:function(){return Xd=!0,!0}});window.addEventListener("test",Qi,Qi),window.removeEventListener("test",Qi,Qi)}catch{Xd=!1}var va=Xd?{passive:!1}:!1,_1=function(r){return r.tagName==="TEXTAREA"},vp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!_1(r)&&l[a]==="visible")},M1=function(r){return vp(r,"overflowY")},A1=function(r){return vp(r,"overflowX")},nx=function(r,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=jp(r,o);if(c){var u=bp(r,o),m=u[1],f=u[2];if(m>f)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},D1=function(r){var a=r.scrollTop,l=r.scrollHeight,o=r.clientHeight;return[a,l,o]},L1=function(r){var a=r.scrollLeft,l=r.scrollWidth,o=r.clientWidth;return[a,l,o]},jp=function(r,a){return r==="v"?M1(a):A1(a)},bp=function(r,a){return r==="v"?D1(a):L1(a)},O1=function(r,a){return r==="h"&&a==="rtl"?-1:1},F1=function(r,a,l,o,c){var u=O1(r,window.getComputedStyle(a).direction),m=u*o,f=l.target,g=a.contains(f),y=!1,p=m>0,v=0,E=0;do{if(!f)break;var P=bp(r,f),T=P[0],b=P[1],j=P[2],w=b-j-u*T;(T||w)&&jp(r,f)&&(v+=w,E+=T);var C=f.parentNode;f=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!g&&f!==document.body||g&&(a.contains(f)||a===f));return(p&&Math.abs(v)<1||!p&&Math.abs(E)<1)&&(y=!0),y},qi=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},ax=function(r){return[r.deltaX,r.deltaY]},lx=function(r){return r&&"current"in r?r.current:r},z1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},$1=function(r){return`
|
||
.block-interactivity-`.concat(r,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(r,` {pointer-events: all;}
|
||
`)},B1=0,ja=[];function U1(r){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState(B1++)[0],u=h.useState(yp)[0],m=h.useRef(r);h.useEffect(function(){m.current=r},[r]),h.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var b=c1([r.lockRef.current],(r.shards||[]).map(lx),!0).filter(Boolean);return b.forEach(function(j){return j.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),b.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var f=h.useCallback(function(b,j){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!m.current.allowPinchZoom;var w=qi(b),C=l.current,N="deltaX"in b?b.deltaX:C[0]-w[0],_="deltaY"in b?b.deltaY:C[1]-w[1],V,U=b.target,I=Math.abs(N)>Math.abs(_)?"h":"v";if("touches"in b&&I==="h"&&U.type==="range")return!1;var k=window.getSelection(),R=k&&k.anchorNode,ee=R?R===U||R.contains(U):!1;if(ee)return!1;var ne=nx(I,U);if(!ne)return!0;if(ne?V=I:(V=I==="v"?"h":"v",ne=nx(I,U)),!ne)return!1;if(!o.current&&"changedTouches"in b&&(N||_)&&(o.current=V),!V)return!0;var ie=o.current||V;return F1(ie,j,b,ie==="h"?N:_)},[]),g=h.useCallback(function(b){var j=b;if(!(!ja.length||ja[ja.length-1]!==u)){var w="deltaY"in j?ax(j):qi(j),C=a.current.filter(function(V){return V.name===j.type&&(V.target===j.target||j.target===V.shadowParent)&&z1(V.delta,w)})[0];if(C&&C.should){j.cancelable&&j.preventDefault();return}if(!C){var N=(m.current.shards||[]).map(lx).filter(Boolean).filter(function(V){return V.contains(j.target)}),_=N.length>0?f(j,N[0]):!m.current.noIsolation;_&&j.cancelable&&j.preventDefault()}}},[]),y=h.useCallback(function(b,j,w,C){var N={name:b,delta:j,target:w,should:C,shadowParent:V1(w)};a.current.push(N),setTimeout(function(){a.current=a.current.filter(function(_){return _!==N})},1)},[]),p=h.useCallback(function(b){l.current=qi(b),o.current=void 0},[]),v=h.useCallback(function(b){y(b.type,ax(b),b.target,f(b,r.lockRef.current))},[]),E=h.useCallback(function(b){y(b.type,qi(b),b.target,f(b,r.lockRef.current))},[]);h.useEffect(function(){return ja.push(u),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:E}),document.addEventListener("wheel",g,va),document.addEventListener("touchmove",g,va),document.addEventListener("touchstart",p,va),function(){ja=ja.filter(function(b){return b!==u}),document.removeEventListener("wheel",g,va),document.removeEventListener("touchmove",g,va),document.removeEventListener("touchstart",p,va)}},[]);var P=r.removeScrollBar,T=r.inert;return h.createElement(h.Fragment,null,T?h.createElement(u,{styles:$1(c)}):null,P?h.createElement(I1,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function V1(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const W1=y1(gp,U1);var Su=h.forwardRef(function(r,a){return h.createElement(No,ar({},r,{ref:a,sideCar:W1}))});Su.classNames=No.classNames;var H1=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},ba=new WeakMap,Xi=new WeakMap,Ji={},Md=0,Np=function(r){return r&&(r.host||Np(r.parentNode))},K1=function(r,a){return a.map(function(l){if(r.contains(l))return l;var o=Np(l);return o&&r.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},G1=function(r,a,l,o){var c=K1(a,Array.isArray(r)?r:[r]);Ji[l]||(Ji[l]=new WeakMap);var u=Ji[l],m=[],f=new Set,g=new Set(c),y=function(v){!v||f.has(v)||(f.add(v),y(v.parentNode))};c.forEach(y);var p=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(E){if(f.has(E))p(E);else try{var P=E.getAttribute(o),T=P!==null&&P!=="false",b=(ba.get(E)||0)+1,j=(u.get(E)||0)+1;ba.set(E,b),u.set(E,j),m.push(E),b===1&&T&&Xi.set(E,!0),j===1&&E.setAttribute(l,"true"),T||E.setAttribute(o,"true")}catch(w){console.error("aria-hidden: cannot operate on ",E,w)}})};return p(a),f.clear(),Md++,function(){m.forEach(function(v){var E=ba.get(v)-1,P=u.get(v)-1;ba.set(v,E),u.set(v,P),E||(Xi.has(v)||v.removeAttribute(o),Xi.delete(v)),P||v.removeAttribute(l)}),Md--,Md||(ba=new WeakMap,ba=new WeakMap,Xi=new WeakMap,Ji={})}},wp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(r)?r:[r]),c=H1(r);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),G1(o,c,l,"aria-hidden")):function(){return null}},wo="Dialog",[Sp]=pn(wo),[Y1,Qs]=Sp(wo),Cp=r=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:u,modal:m=!0}=r,f=h.useRef(null),g=h.useRef(null),[y,p]=Fn({prop:o,defaultProp:c??!1,onChange:u,caller:wo});return e.jsx(Y1,{scope:a,triggerRef:f,contentRef:g,contentId:cn(),titleId:cn(),descriptionId:cn(),open:y,onOpenChange:p,onOpenToggle:h.useCallback(()=>p(v=>!v),[p]),modal:m,children:l})};Cp.displayName=wo;var kp="DialogTrigger",Q1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(kp,l),u=lt(a,c.triggerRef);return e.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Eu(c.open),...o,ref:u,onClick:Ye(r.onClick,c.onOpenToggle)})});Q1.displayName=kp;var Cu="DialogPortal",[q1,Ep]=Sp(Cu,{forceMount:void 0}),Pp=r=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=r,u=Qs(Cu,a);return e.jsx(q1,{scope:a,forceMount:l,children:h.Children.map(o,m=>e.jsx(Dl,{present:l||u.open,children:e.jsx(wu,{asChild:!0,container:c,children:m})}))})};Pp.displayName=Cu;var uo="DialogOverlay",Tp=h.forwardRef((r,a)=>{const l=Ep(uo,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,u=Qs(uo,r.__scopeDialog);return u.modal?e.jsx(Dl,{present:o||u.open,children:e.jsx(J1,{...c,ref:a})}):null});Tp.displayName=uo;var X1=_l("DialogOverlay.RemoveScroll"),J1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(uo,l);return e.jsx(Su,{as:X1,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(qe.div,{"data-state":Eu(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),zn="DialogContent",Rp=h.forwardRef((r,a)=>{const l=Ep(zn,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,u=Qs(zn,r.__scopeDialog);return e.jsx(Dl,{present:o||u.open,children:u.modal?e.jsx(Z1,{...c,ref:a}):e.jsx(e2,{...c,ref:a})})});Rp.displayName=zn;var Z1=h.forwardRef((r,a)=>{const l=Qs(zn,r.__scopeDialog),o=h.useRef(null),c=lt(a,l.contentRef,o);return h.useEffect(()=>{const u=o.current;if(u)return wp(u)},[]),e.jsx(Ip,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ye(r.onCloseAutoFocus,u=>{var m;u.preventDefault(),(m=l.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Ye(r.onPointerDownOutside,u=>{const m=u.detail.originalEvent,f=m.button===0&&m.ctrlKey===!0;(m.button===2||f)&&u.preventDefault()}),onFocusOutside:Ye(r.onFocusOutside,u=>u.preventDefault())})}),e2=h.forwardRef((r,a)=>{const l=Qs(zn,r.__scopeDialog),o=h.useRef(!1),c=h.useRef(!1);return e.jsx(Ip,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var m,f;(m=r.onCloseAutoFocus)==null||m.call(r,u),u.defaultPrevented||(o.current||(f=l.triggerRef.current)==null||f.focus(),u.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:u=>{var g,y;(g=r.onInteractOutside)==null||g.call(r,u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const m=u.target;((y=l.triggerRef.current)==null?void 0:y.contains(m))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&c.current&&u.preventDefault()}})}),Ip=h.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u,...m}=r,f=Qs(zn,l),g=h.useRef(null),y=lt(a,g);return fp(),e.jsxs(e.Fragment,{children:[e.jsx(Nu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:u,children:e.jsx(bu,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Eu(f.open),...m,ref:y,onDismiss:()=>f.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(t2,{titleId:f.titleId}),e.jsx(r2,{contentRef:g,descriptionId:f.descriptionId})]})]})}),ku="DialogTitle",_p=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(ku,l);return e.jsx(qe.h2,{id:c.titleId,...o,ref:a})});_p.displayName=ku;var Mp="DialogDescription",Ap=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(Mp,l);return e.jsx(qe.p,{id:c.descriptionId,...o,ref:a})});Ap.displayName=Mp;var Dp="DialogClose",Lp=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Qs(Dp,l);return e.jsx(qe.button,{type:"button",...o,ref:a,onClick:Ye(r.onClick,()=>c.onOpenChange(!1))})});Lp.displayName=Dp;function Eu(r){return r?"open":"closed"}var Op="DialogTitleWarning",[ZC,Fp]=Rw(Op,{contentName:zn,titleName:ku,docsSlug:"dialog"}),t2=({titleId:r})=>{const a=Fp(Op),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 h.useEffect(()=>{r&&(document.getElementById(r)||console.error(l))},[l,r]),null},s2="DialogDescriptionWarning",r2=({contentRef:r,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fp(s2).contentName}}.`;return h.useEffect(()=>{var u;const c=(u=r.current)==null?void 0:u.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(o))},[o,r,a]),null},n2=Cp,a2=Pp,l2=Tp,i2=Rp,o2=_p,c2=Ap,d2=Lp;function St(r){return e.jsx(n2,{"data-slot":"dialog",...r})}function u2(r){return e.jsx(a2,{...r})}const zp=h.forwardRef(({className:r,...a},l)=>e.jsx(l2,{ref:l,className:it("fixed inset-0 z-50 bg-black/50",r),...a}));zp.displayName="DialogOverlay";const bt=h.forwardRef(({className:r,children:a,showCloseButton:l=!0,...o},c)=>e.jsxs(u2,{children:[e.jsx(zp,{}),e.jsxs(i2,{ref:c,"aria-describedby":void 0,className:it("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",r),...o,children:[a,l&&e.jsxs(d2,{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(fs,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bt.displayName="DialogContent";function Ct({className:r,...a}){return e.jsx("div",{className:it("flex flex-col gap-2 text-center sm:text-left",r),...a})}function Dt({className:r,...a}){return e.jsx("div",{className:it("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function kt(r){return e.jsx(o2,{className:"text-lg font-semibold leading-none",...r})}function h2(r){return e.jsx(c2,{className:"text-sm text-muted-foreground",...r})}function Pu(r,a){const[l,o]=h.useState(r);return h.useEffect(()=>{const c=setTimeout(()=>o(r),a);return()=>clearTimeout(c)},[r,a]),l}function Hs({page:r,totalPages:a,total:l,pageSize:o,onPageChange:c,onPageSizeChange:u,pageSizeOptions:m=[10,20,50,100]}){return a<=1&&!u?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," 条"]}),u&&e.jsx("select",{value:o,onChange:f=>u(Number(f.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:m.map(f=>e.jsxs("option",{value:f,children:[f," 条/页"]},f))})]}),a>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>c(1),disabled:r<=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(r-1),disabled:r<=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:[r," / ",a]}),e.jsx("button",{type:"button",onClick:()=>c(r+1),disabled:r>=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:r>=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 m2(){const[r,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState(0),[m,f]=h.useState(0),[g,y]=h.useState(0),[p,v]=h.useState(1),[E,P]=h.useState(10),[T,b]=h.useState(""),j=Pu(T,300),[w,C]=h.useState("all"),[N,_]=h.useState(!0),[V,U]=h.useState(null),[I,k]=h.useState(null),[R,ee]=h.useState(""),[ne,ie]=h.useState(!1);async function te(){_(!0),U(null);try{const K=w==="all"?"":w==="completed"?"completed":w,A=new URLSearchParams({page:String(p),pageSize:String(E),...K&&{status:K},...j&&{search:j}}),[O,L]=await Promise.all([Be(`/api/orders?${A}`),Be("/api/db/users?page=1&pageSize=500")]);O!=null&&O.success&&(a(O.orders||[]),u(O.total??0),f(O.totalRevenue??0),y(O.todayRevenue??0)),L!=null&&L.success&&L.users&&o(L.users)}catch(K){console.error("加载订单失败",K),U("加载订单失败,请检查网络后重试")}finally{_(!1)}}h.useEffect(()=>{v(1)},[j,w]),h.useEffect(()=>{te()},[p,E,j,w]);const se=K=>{var A;return K.userNickname||((A=l.find(O=>O.id===K.userId))==null?void 0:A.nickname)||"匿名用户"},H=K=>{var A;return((A=l.find(O=>O.id===K))==null?void 0:A.phone)||"-"},ae=K=>{const A=K.productType||K.type||"",O=K.description||"";if(O){if(A==="section"&&O.includes("章节")){if(O.includes("-")){const L=O.split("-");if(L.length>=3)return{name:`第${L[1]}章 第${L[2]}节`,type:"《一场Soul的创业实验》"}}return{name:O,type:"章节购买"}}return A==="fullbook"||O.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:A==="vip"||O.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:A==="match"||O.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:O,type:"其他"}}return A==="section"?{name:`章节 ${K.productId||K.sectionId||""}`,type:"单章"}:A==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:A==="vip"?{name:"VIP年度会员",type:"VIP"}:A==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:A||"其他"}},ve=Math.ceil(c/E)||1;async function $(){var K;if(!(!(I!=null&&I.orderSn)&&!(I!=null&&I.id))){ie(!0),U(null);try{const A=await yt("/api/admin/orders/refund",{orderSn:I.orderSn||I.id,reason:R||void 0});A!=null&&A.success?(k(null),ee(""),te()):U((A==null?void 0:A.error)||"退款失败")}catch(A){const O=A;U(((K=O==null?void 0:O.data)==null?void 0:K.error)||"退款失败,请检查网络后重试")}finally{ie(!1)}}}function ce(){if(r.length===0){alert("暂无数据可导出");return}const K=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],A=r.map(de=>{const Y=ae(de);return[de.orderSn||de.id||"",se(de),H(de.userId),Y.name,Number(de.amount||0).toFixed(2),de.paymentMethod==="wechat"?"微信支付":de.paymentMethod==="alipay"?"支付宝":de.paymentMethod||"微信支付",de.status==="refunded"?"已退款":de.status==="paid"||de.status==="completed"?"已完成":de.status==="pending"||de.status==="created"?"待支付":"已失败",de.status==="refunded"&&de.refundReason?de.refundReason:"-",de.referrerEarnings?Number(de.referrerEarnings).toFixed(2):"-",de.createdAt?new Date(de.createdAt).toLocaleString("zh-CN"):""].join(",")}),O="\uFEFF"+[K.join(","),...A].join(`
|
||
`),L=new Blob([O],{type:"text/csv;charset=utf-8"}),X=URL.createObjectURL(L),G=document.createElement("a");G.href=X,G.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,G.click(),URL.revokeObjectURL(X)}return e.jsxs("div",{className:"p-8 w-full",children:[V&&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:V}),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:["共 ",r.length," 笔订单"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(q,{variant:"outline",onClick:te,disabled:N,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 ${N?"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:["¥",m.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:["¥",g.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(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(le,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:T,onChange:K=>b(K.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Vx,{className:"w-4 h-4 text-gray-400"}),e.jsxs("select",{value:w,onChange:K=>C(K.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(q,{variant:"outline",onClick:ce,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(db,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Se,{className:"p-0",children:N?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(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"订单号"}),e.jsx(be,{className:"text-gray-400",children:"用户"}),e.jsx(be,{className:"text-gray-400",children:"商品"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"支付方式"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"退款原因"}),e.jsx(be,{className:"text-gray-400",children:"分销佣金"}),e.jsx(be,{className:"text-gray-400",children:"下单时间"}),e.jsx(be,{className:"text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(K=>{const A=ae(K);return e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(xe,{className:"font-mono text-xs text-gray-400",children:[(K.orderSn||K.id||"").slice(0,12),"..."]}),e.jsx(xe,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:se(K)}),e.jsx("p",{className:"text-gray-500 text-xs",children:H(K.userId)})]})}),e.jsx(xe,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[A.name,(K.productType||K.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:A.type})]})}),e.jsxs(xe,{className:"text-[#38bdac] font-bold",children:["¥",Number(K.amount||0).toFixed(2)]}),e.jsx(xe,{className:"text-gray-300",children:K.paymentMethod==="wechat"?"微信支付":K.paymentMethod==="alipay"?"支付宝":K.paymentMethod||"微信支付"}),e.jsx(xe,{children:K.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):K.status==="paid"||K.status==="completed"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):K.status==="pending"||K.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(xe,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:K.refundReason,children:K.status==="refunded"&&K.refundReason?K.refundReason:"-"}),e.jsx(xe,{className:"text-[#FFD700]",children:K.referrerEarnings?`¥${Number(K.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(xe,{className:"text-gray-400 text-sm",children:new Date(K.createdAt).toLocaleString("zh-CN")}),e.jsx(xe,{children:(K.status==="paid"||K.status==="completed")&&e.jsxs(q,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{k(K),ee("")},children:[e.jsx(Kx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},K.id)}),r.length===0&&e.jsx(Je,{children:e.jsx(xe,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Hs,{page:p,totalPages:ve,total:c,pageSize:E,onPageChange:v,onPageSizeChange:K=>{P(K),v(1)}})]})})}),e.jsx(St,{open:!!I,onOpenChange:K=>!K&&k(null),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:"订单退款"})}),I&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",I.orderSn||I.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(I.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(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:R,onChange:K=>ee(K.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>k(null),disabled:ne,children:"取消"}),e.jsx(q,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:$,disabled:ne,children:ne?"退款中...":"确认退款"})]})]})})]})}var f2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],x2=f2.reduce((r,a)=>{const l=Yx(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:m,...f}=c,g=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(g,{...f,ref:u})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{}),p2="Label",$p=h.forwardRef((r,a)=>e.jsx(x2.label,{...r,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=r.onMouseDown)==null||c.call(r,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));$p.displayName=p2;var Bp=$p;const Z=h.forwardRef(({className:r,...a},l)=>e.jsx(Bp,{ref:l,className:it("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));Z.displayName=Bp.displayName;function Tu(r){const a=r+"CollectionProvider",[l,o]=pn(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),m=b=>{const{scope:j,children:w}=b,C=Zr.useRef(null),N=Zr.useRef(new Map).current;return e.jsx(c,{scope:j,itemMap:N,collectionRef:C,children:w})};m.displayName=a;const f=r+"CollectionSlot",g=_l(f),y=Zr.forwardRef((b,j)=>{const{scope:w,children:C}=b,N=u(f,w),_=lt(j,N.collectionRef);return e.jsx(g,{ref:_,children:C})});y.displayName=f;const p=r+"CollectionItemSlot",v="data-radix-collection-item",E=_l(p),P=Zr.forwardRef((b,j)=>{const{scope:w,children:C,...N}=b,_=Zr.useRef(null),V=lt(j,_),U=u(p,w);return Zr.useEffect(()=>(U.itemMap.set(_,{ref:_,...N}),()=>void U.itemMap.delete(_))),e.jsx(E,{[v]:"",ref:V,children:C})});P.displayName=p;function T(b){const j=u(r+"CollectionConsumer",b);return Zr.useCallback(()=>{const C=j.collectionRef.current;if(!C)return[];const N=Array.from(C.querySelectorAll(`[${v}]`));return Array.from(j.itemMap.values()).sort((U,I)=>N.indexOf(U.ref.current)-N.indexOf(I.ref.current))},[j.collectionRef,j.itemMap])}return[{Provider:m,Slot:y,ItemSlot:P},T,o]}var g2=h.createContext(void 0);function So(r){const a=h.useContext(g2);return r||a||"ltr"}var Ad="rovingFocusGroup.onEntryFocus",y2={bubbles:!1,cancelable:!0},Ll="RovingFocusGroup",[Jd,Up,v2]=Tu(Ll),[j2,Vp]=pn(Ll,[v2]),[b2,N2]=j2(Ll),Wp=h.forwardRef((r,a)=>e.jsx(Jd.Provider,{scope:r.__scopeRovingFocusGroup,children:e.jsx(Jd.Slot,{scope:r.__scopeRovingFocusGroup,children:e.jsx(w2,{...r,ref:a})})}));Wp.displayName=Ll;var w2=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:u,currentTabStopId:m,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:g,onEntryFocus:y,preventScrollOnEntryFocus:p=!1,...v}=r,E=h.useRef(null),P=lt(a,E),T=So(u),[b,j]=Fn({prop:m,defaultProp:f??null,onChange:g,caller:Ll}),[w,C]=h.useState(!1),N=un(y),_=Up(l),V=h.useRef(!1),[U,I]=h.useState(0);return h.useEffect(()=>{const k=E.current;if(k)return k.addEventListener(Ad,N),()=>k.removeEventListener(Ad,N)},[N]),e.jsx(b2,{scope:l,orientation:o,dir:T,loop:c,currentTabStopId:b,onItemFocus:h.useCallback(k=>j(k),[j]),onItemShiftTab:h.useCallback(()=>C(!0),[]),onFocusableItemAdd:h.useCallback(()=>I(k=>k+1),[]),onFocusableItemRemove:h.useCallback(()=>I(k=>k-1),[]),children:e.jsx(qe.div,{tabIndex:w||U===0?-1:0,"data-orientation":o,...v,ref:P,style:{outline:"none",...r.style},onMouseDown:Ye(r.onMouseDown,()=>{V.current=!0}),onFocus:Ye(r.onFocus,k=>{const R=!V.current;if(k.target===k.currentTarget&&R&&!w){const ee=new CustomEvent(Ad,y2);if(k.currentTarget.dispatchEvent(ee),!ee.defaultPrevented){const ne=_().filter(ae=>ae.focusable),ie=ne.find(ae=>ae.active),te=ne.find(ae=>ae.id===b),H=[ie,te,...ne].filter(Boolean).map(ae=>ae.ref.current);Gp(H,p)}}V.current=!1}),onBlur:Ye(r.onBlur,()=>C(!1))})})}),Hp="RovingFocusGroupItem",Kp=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:u,children:m,...f}=r,g=cn(),y=u||g,p=N2(Hp,l),v=p.currentTabStopId===y,E=Up(l),{onFocusableItemAdd:P,onFocusableItemRemove:T,currentTabStopId:b}=p;return h.useEffect(()=>{if(o)return P(),()=>T()},[o,P,T]),e.jsx(Jd.ItemSlot,{scope:l,id:y,focusable:o,active:c,children:e.jsx(qe.span,{tabIndex:v?0:-1,"data-orientation":p.orientation,...f,ref:a,onMouseDown:Ye(r.onMouseDown,j=>{o?p.onItemFocus(y):j.preventDefault()}),onFocus:Ye(r.onFocus,()=>p.onItemFocus(y)),onKeyDown:Ye(r.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){p.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const w=k2(j,p.orientation,p.dir);if(w!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let N=E().filter(_=>_.focusable).map(_=>_.ref.current);if(w==="last")N.reverse();else if(w==="prev"||w==="next"){w==="prev"&&N.reverse();const _=N.indexOf(j.currentTarget);N=p.loop?E2(N,_+1):N.slice(_+1)}setTimeout(()=>Gp(N))}}),children:typeof m=="function"?m({isCurrentTabStop:v,hasTabStop:b!=null}):m})})});Kp.displayName=Hp;var S2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function C2(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function k2(r,a,l){const o=C2(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return S2[o]}function Gp(r,a=!1){const l=document.activeElement;for(const o of r)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function E2(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var P2=Wp,T2=Kp,Co="Tabs",[R2]=pn(Co,[Vp]),Yp=Vp(),[I2,Ru]=R2(Co),Qp=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:u,orientation:m="horizontal",dir:f,activationMode:g="automatic",...y}=r,p=So(f),[v,E]=Fn({prop:o,onChange:c,defaultProp:u??"",caller:Co});return e.jsx(I2,{scope:l,baseId:cn(),value:v,onValueChange:E,orientation:m,dir:p,activationMode:g,children:e.jsx(qe.div,{dir:p,"data-orientation":m,...y,ref:a})})});Qp.displayName=Co;var qp="TabsList",Xp=h.forwardRef((r,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=r,u=Ru(qp,l),m=Yp(l);return e.jsx(P2,{asChild:!0,...m,orientation:u.orientation,dir:u.dir,loop:o,children:e.jsx(qe.div,{role:"tablist","aria-orientation":u.orientation,...c,ref:a})})});Xp.displayName=qp;var Jp="TabsTrigger",Zp=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...u}=r,m=Ru(Jp,l),f=Yp(l),g=s0(m.baseId,o),y=r0(m.baseId,o),p=o===m.value;return e.jsx(T2,{asChild:!0,...f,focusable:!c,active:p,children:e.jsx(qe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":y,"data-state":p?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:g,...u,ref:a,onMouseDown:Ye(r.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?m.onValueChange(o):v.preventDefault()}),onKeyDown:Ye(r.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&m.onValueChange(o)}),onFocus:Ye(r.onFocus,()=>{const v=m.activationMode!=="manual";!p&&!c&&v&&m.onValueChange(o)})})})});Zp.displayName=Jp;var e0="TabsContent",t0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:u,...m}=r,f=Ru(e0,l),g=s0(f.baseId,o),y=r0(f.baseId,o),p=o===f.value,v=h.useRef(p);return h.useEffect(()=>{const E=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(E)},[]),e.jsx(Dl,{present:c||p,children:({present:E})=>e.jsx(qe.div,{"data-state":p?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":g,hidden:!E,id:y,tabIndex:0,...m,ref:a,style:{...r.style,animationDuration:v.current?"0s":void 0},children:E&&u})})});t0.displayName=e0;function s0(r,a){return`${r}-trigger-${a}`}function r0(r,a){return`${r}-content-${a}`}var _2=Qp,n0=Xp,a0=Zp,l0=t0;const Ol=_2,Fa=h.forwardRef(({className:r,...a},l)=>e.jsx(n0,{ref:l,className:it("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));Fa.displayName=n0.displayName;const Lt=h.forwardRef(({className:r,...a},l)=>e.jsx(a0,{ref:l,className:it("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",r),...a}));Lt.displayName=a0.displayName;const Ot=h.forwardRef(({className:r,...a},l)=>e.jsx(l0,{ref:l,className:it("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...a}));Ot.displayName=l0.displayName;function Iu(r){const a=h.useRef({value:r,previous:r});return h.useMemo(()=>(a.current.value!==r&&(a.current.previous=a.current.value,a.current.value=r),a.current.previous),[r])}function _u(r){const[a,l]=h.useState(void 0);return ts(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let m,f;if("borderBoxSize"in u){const g=u.borderBoxSize,y=Array.isArray(g)?g[0]:g;m=y.inlineSize,f=y.blockSize}else m=r.offsetWidth,f=r.offsetHeight;l({width:m,height:f})});return o.observe(r,{box:"border-box"}),()=>o.unobserve(r)}else l(void 0)},[r]),a}var ko="Switch",[M2]=pn(ko),[A2,D2]=M2(ko),i0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:u,required:m,disabled:f,value:g="on",onCheckedChange:y,form:p,...v}=r,[E,P]=h.useState(null),T=lt(a,N=>P(N)),b=h.useRef(!1),j=E?p||!!E.closest("form"):!0,[w,C]=Fn({prop:c,defaultProp:u??!1,onChange:y,caller:ko});return e.jsxs(A2,{scope:l,checked:w,disabled:f,children:[e.jsx(qe.button,{type:"button",role:"switch","aria-checked":w,"aria-required":m,"data-state":u0(w),"data-disabled":f?"":void 0,disabled:f,value:g,...v,ref:T,onClick:Ye(r.onClick,N=>{C(_=>!_),j&&(b.current=N.isPropagationStopped(),b.current||N.stopPropagation())})}),j&&e.jsx(d0,{control:E,bubbles:!b.current,name:o,value:g,checked:w,required:m,disabled:f,form:p,style:{transform:"translateX(-100%)"}})]})});i0.displayName=ko;var o0="SwitchThumb",c0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,...o}=r,c=D2(o0,l);return e.jsx(qe.span,{"data-state":u0(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});c0.displayName=o0;var L2="SwitchBubbleInput",d0=h.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:o=!0,...c},u)=>{const m=h.useRef(null),f=lt(m,u),g=Iu(l),y=_u(a);return h.useEffect(()=>{const p=m.current;if(!p)return;const v=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(v,"checked").set;if(g!==l&&P){const T=new Event("click",{bubbles:o});P.call(p,l),p.dispatchEvent(T)}},[g,l,o]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:f,style:{...c.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});d0.displayName=L2;function u0(r){return r?"checked":"unchecked"}var h0=i0,O2=c0;const dt=h.forwardRef(({className:r,...a},l)=>e.jsx(h0,{className:it("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]",r),...a,ref:l,children:e.jsx(O2,{className:it("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")})}));dt.displayName=h0.displayName;const dn=h.forwardRef(({className:r,...a},l)=>e.jsx("textarea",{className:it("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",r),ref:l,...a}));dn.displayName="Textarea";function F2({open:r,onClose:a,userId:l,onUserUpdated:o}){var tt;const[c,u]=h.useState(null),[m,f]=h.useState([]),[g,y]=h.useState([]),[p,v]=h.useState(!1),[E,P]=h.useState(!1),[T,b]=h.useState(!1),[j,w]=h.useState("info"),[C,N]=h.useState(""),[_,V]=h.useState(""),[U,I]=h.useState([]),[k,R]=h.useState(""),[ee,ne]=h.useState(!1),[ie,te]=h.useState(null),[se,H]=h.useState(null),[ae,ve]=h.useState(""),[$,ce]=h.useState(""),[K,A]=h.useState(""),[O,L]=h.useState(!1),[X,G]=h.useState(null),[de,Y]=h.useState("");h.useEffect(()=>{r&&l&&(w("info"),te(null),H(null),G(null),Y(""),pe())},[r,l]);async function pe(){if(l){v(!0);try{const ge=await Be(`/api/db/users?id=${encodeURIComponent(l)}`);if(ge!=null&&ge.success&&ge.user){const fe=ge.user;u(fe),N(fe.phone||""),V(fe.nickname||""),ve(fe.phone||""),ce(fe.wechatId||""),A(fe.openId||"");try{I(typeof fe.tags=="string"?JSON.parse(fe.tags||"[]"):[])}catch{I([])}}try{const fe=await Be(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);fe!=null&&fe.success&&fe.tracks&&f(fe.tracks)}catch{f([])}try{const fe=await Be(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);fe!=null&&fe.success&&fe.referrals&&y(fe.referrals)}catch{y([])}}catch(ge){console.error("Load user detail error:",ge)}finally{v(!1)}}}async function Ce(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}P(!0);try{const ge=await ft("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});ge!=null&&ge.success?(alert("同步成功"),pe()):alert("同步失败: "+(ge==null?void 0:ge.error))}catch(ge){console.error("Sync CKB error:",ge),alert("同步失败")}finally{P(!1)}}async function D(){if(c){b(!0);try{const ge={id:c.id,phone:C||void 0,nickname:_||void 0,tags:JSON.stringify(U)},fe=await yt("/api/db/users",ge);fe!=null&&fe.success?(alert("保存成功"),pe(),o==null||o()):alert("保存失败: "+(fe==null?void 0:fe.error))}catch(ge){console.error("Save user error:",ge),alert("保存失败")}finally{b(!1)}}}const ue=()=>{k&&!U.includes(k)&&(I([...U,k]),R(""))},ke=ge=>I(U.filter(fe=>fe!==ge));async function Ie(){if(!ae&&!K&&!$){H("请至少输入手机号、微信号或 OpenID 中的一项");return}ne(!0),H(null),te(null);try{const ge=new URLSearchParams;ae&&ge.set("phone",ae),K&&ge.set("openId",K),$&&ge.set("wechatId",$);const fe=await Be(`/api/admin/shensheshou/query?${ge}`);fe!=null&&fe.success&&fe.data?(te(fe.data),c&&await Ue(fe.data)):H((fe==null?void 0:fe.error)||"未查询到数据,该用户可能未在神射手收录")}catch(ge){console.error("SSS query error:",ge),H("请求失败,请检查神射手接口配置")}finally{ne(!1)}}async function Ue(ge){if(c)try{await ft("/api/admin/shensheshou/enrich",{userId:c.id,phone:ae||c.phone||"",openId:K||c.openId||"",wechatId:$||c.wechatId||""}),pe()}catch(fe){console.error("SSS enrich error:",fe)}}async function Ze(){if(c){L(!0),G(null);try{const ge={users:[{phone:c.phone||"",name:c.nickname||"",openId:c.openId||"",tags:U}]},fe=await ft("/api/admin/shensheshou/ingest",ge);fe!=null&&fe.success&&fe.data?G(fe.data):G({error:(fe==null?void 0:fe.error)||"推送失败"})}catch(ge){console.error("SSS ingest error:",ge),G({error:"请求失败"})}finally{L(!1)}}}const et=ge=>{const ot={view_chapter:Ks,purchase:Gd,match:Qt,login:Ea,register:Ea,share:ln,bind_phone:Xb,bind_wechat:Vb,fill_profile:Sd,visit_page:Ca}[ge]||Hd;return e.jsx(ot,{className:"w-4 h-4"})};return r?e.jsx(St,{open:r,onOpenChange:()=>a(),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Ea,{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:"已绑定手机"}),(c==null?void 0:c.isVip)&&e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 border-0",children:"VIP"})]})}),p?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-[75vh]",children:[e.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-3",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac] shrink-0",children:c.avatar?e.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((tt=c.nickname)==null?void 0:tt.charAt(0))||"?"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",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:"全书已购"}),c.vipRole&&e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 border-0",children:c.vipRole})]}),e.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`,c.mbti&&` · ${c.mbti}`]}),e.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[e.jsxs("p",{className:"text-gray-600 text-xs",children:["ID: ",c.id.slice(0,16),"…"]}),c.referralCode&&e.jsxs("p",{className:"text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"推广码:"}),e.jsx("code",{className:"text-[#38bdac] bg-[#38bdac]/10 px-1.5 py-0.5 rounded",children:c.referralCode})]})]})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsxs("p",{className:"text-[#38bdac] font-bold text-lg",children:["¥",(c.earnings||0).toFixed(2)]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),e.jsxs(Ol,{value:j,onValueChange:w,className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(Fa,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-3 flex-wrap h-auto gap-1",children:[e.jsx(Lt,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"基础信息"}),e.jsx(Lt,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"标签体系"}),e.jsxs(Lt,{value:"journey",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:[e.jsx(Ca,{className:"w-3 h-3 mr-1"}),"用户旅程"]}),e.jsx(Lt,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"关系链路"}),e.jsxs(Lt,{value:"shensheshou",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:[e.jsx(nn,{className:"w-3 h-3 mr-1"}),"用户资料完善"]})]}),e.jsxs(Ot,{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(Z,{className:"text-gray-300",children:"手机号"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:C,onChange:ge=>N(ge.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"昵称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:_,onChange:ge=>V(ge.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.openId&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"微信 OpenID"}),e.jsx("p",{className:"text-gray-300 font-mono text-xs break-all",children:c.openId})]}),c.region&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg flex items-center gap-2",children:[e.jsx(Hx,{className:"w-4 h-4 text-gray-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs",children:"地区"}),e.jsx("p",{className:"text-white",children:c.region})]})]}),c.industry&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"行业"}),e.jsx("p",{className:"text-white",children:c.industry})]}),c.position&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"职位"}),e.jsx("p",{className:"text-white",children:c.position})]})]}),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():"-"})]})]}),c.isVip&&e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg border border-amber-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(sn,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{className:"text-white font-medium",children:"VIP 信息"}),e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 border-0 text-xs",children:c.vipRole||"VIP"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.vipName&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"展示名:"}),e.jsx("span",{className:"text-white",children:c.vipName})]}),c.vipProject&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"项目:"}),e.jsx("span",{className:"text-white",children:c.vipProject})]}),c.vipContact&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"联系方式:"}),e.jsx("span",{className:"text-white",children:c.vipContact})]}),c.vipExpireDate&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"到期时间:"}),e.jsx("span",{className:"text-white",children:new Date(c.vipExpireDate).toLocaleDateString()})]})]}),c.vipBio&&e.jsx("p",{className:"text-gray-400 text-sm mt-2",children:c.vipBio})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg border border-purple-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Il,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"微信归属"}),e.jsx("span",{className:"text-gray-500 text-xs",children:"该用户归属在哪个微信号下"})]}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"输入归属微信号(如 wxid_xxxx)",value:de,onChange:ge=>Y(ge.target.value)}),e.jsxs(q,{size:"sm",onClick:async()=>{if(!(!de||!c))try{await yt("/api/db/users",{id:c.id,wechatId:de}),alert("已保存微信归属"),pe()}catch{alert("保存失败")}},className:"bg-purple-500/20 hover:bg-purple-500/30 text-purple-400 border border-purple-500/30 shrink-0",children:[e.jsx(_t,{className:"w-4 h-4 mr-1"})," 保存"]})]}),c.wechatId&&e.jsxs("p",{className:"text-gray-500 text-xs mt-2",children:["当前归属:",e.jsx("span",{className:"text-purple-400",children:c.wechatId})]})]}),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(ln,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),e.jsx(q,{size:"sm",onClick:Ce,disabled:E||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?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.jsxs(Ot,{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(Sd,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"用户标签"}),e.jsx("span",{className:"text-gray-500 text-xs",children:"基于《一场 Soul 的创业实验》维度打标"})]}),e.jsxs("div",{className:"mb-3 p-2.5 bg-[#38bdac]/5 border border-[#38bdac]/20 rounded-lg flex items-center gap-2 text-xs text-gray-400",children:[e.jsx(Wd,{className:"w-3.5 h-3.5 text-[#38bdac] shrink-0"}),"命中的标签自动高亮 · 系统根据行为轨迹和填写资料自动打标 · 手动点击补充或取消"]}),e.jsx("div",{className:"mb-4 space-y-3",children:[{category:"身份类型",tags:["创业者","打工人","自由职业","学生","投资人","合伙人"]},{category:"行业背景",tags:["电商","内容","传统行业","科技/AI","金融","教育","餐饮"]},{category:"痛点标签",tags:["找资源","找方向","找合伙人","想赚钱","想学习","找情感出口"]},{category:"付费意愿",tags:["高意向","已付费","观望中","薅羊毛"]},{category:"MBTI",tags:["ENTJ","INTJ","ENFP","INFP","ENTP","INTP","ESTJ","ISFJ"]}].map(ge=>e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1.5",children:ge.category}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:ge.tags.map(fe=>e.jsxs("button",{type:"button",onClick:()=>{U.includes(fe)?ke(fe):I([...U,fe])},className:`px-2 py-0.5 rounded text-xs border transition-all ${U.includes(fe)?"bg-[#38bdac]/20 border-[#38bdac]/50 text-[#38bdac]":"bg-transparent border-gray-700 text-gray-500 hover:border-gray-500 hover:text-gray-300"}`,children:[U.includes(fe)?"✓ ":"",fe]},fe))})]},ge.category))}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-3",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-2",children:"已选标签"}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-3 min-h-[32px]",children:[U.map((ge,fe)=>e.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[ge,e.jsx("button",{type:"button",onClick:()=>ke(ge),className:"ml-1 hover:text-red-400",children:e.jsx(fs,{className:"w-3 h-3"})})]},fe)),U.length===0&&e.jsx("span",{className:"text-gray-600 text-sm",children:"暂未选择标签"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"自定义标签(回车添加)",value:k,onChange:ge=>R(ge.target.value),onKeyDown:ge=>ge.key==="Enter"&&ue()}),e.jsx(q,{onClick:ue,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})]}),c.ckbTags&&e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Sd,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝标签"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:(typeof c.ckbTags=="string"?c.ckbTags.split(","):[]).map((ge,fe)=>e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:ge.trim()},fe))})]})]}),e.jsxs(Ot,{value:"journey",className:"flex-1 overflow-auto",children:[e.jsxs("div",{className:"mb-3 p-3 bg-[#0a1628] rounded-lg flex items-center gap-2",children:[e.jsx(Ca,{className:"w-4 h-4 text-[#38bdac]"}),e.jsxs("span",{className:"text-gray-400 text-sm",children:["记录用户从注册到付费的完整行动路径,共 ",m.length," 条记录"]})]}),e.jsx("div",{className:"space-y-2",children:m.length>0?m.map((ge,fe)=>e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:et(ge.action)}),fe<m.length-1&&e.jsx("div",{className:"w-0.5 h-4 bg-gray-700/50 mt-1"})]}),e.jsxs("div",{className:"flex-1 pb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-white font-medium",children:ge.actionLabel}),ge.chapterTitle&&e.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",ge.chapterTitle]})]}),e.jsxs("p",{className:"text-gray-500 text-xs mt-0.5",children:[e.jsx(Hd,{className:"w-3 h-3 inline mr-1"}),ge.timeAgo," · ",new Date(ge.createdAt).toLocaleString()]})]})]},ge.id)):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Ca,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400",children:"暂无用户旅程记录"}),e.jsx("p",{className:"text-gray-600 text-sm mt-1",children:"当用户浏览章节、购买或完善信息时会自动记录"})]})})]}),e.jsx(Ot,{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(ln,{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:["共 ",g.length," 人"]})]}),e.jsx("div",{className:"space-y-2 max-h-[250px] overflow-y-auto",children:g.length>0?g.map((ge,fe)=>{var ss;const ot=ge;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:((ss=ot.nickname)==null?void 0:ss.charAt(0))||"?"}),e.jsx("span",{className:"text-white text-sm",children:ot.nickname})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[ot.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:ot.createdAt?new Date(ot.createdAt).toLocaleDateString():""})]})]},ot.id||fe)}):e.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})}),e.jsxs(Ot,{value:"shensheshou",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(nn,{className:"w-5 h-5 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"用户资料完善"}),e.jsx("span",{className:"text-gray-500 text-xs",children:"通过多维度查询神射手数据,自动回填用户基础信息"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[e.jsxs("div",{children:[e.jsx(Z,{className:"text-gray-500 text-xs mb-1 block",children:"手机号"}),e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"11位手机号",value:ae,onChange:ge=>ve(ge.target.value)})]}),e.jsxs("div",{children:[e.jsx(Z,{className:"text-gray-500 text-xs mb-1 block",children:"微信号"}),e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"微信 ID",value:$,onChange:ge=>ce(ge.target.value)})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx(Z,{className:"text-gray-500 text-xs mb-1 block",children:"微信 OpenID"}),e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"openid_xxxx(自动填入)",value:K,onChange:ge=>A(ge.target.value)})]})]}),e.jsx(q,{onClick:Ie,disabled:ee,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:ee?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"})," 查询并自动回填中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(on,{className:"w-4 h-4 mr-1"})," 查询并自动完善用户资料"]})}),e.jsx("p",{className:"text-gray-600 text-xs mt-2",children:"查询成功后,神射手返回的标签将自动同步到该用户"}),se&&e.jsx("div",{className:"mt-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400 text-sm",children:se}),ie&&e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"神射手 RFM 分"}),e.jsx("p",{className:"text-2xl font-bold text-[#38bdac]",children:ie.rfm_score??"-"})]}),e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"用户等级"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:ie.user_level??"-"})]})]}),ie.tags&&ie.tags.length>0&&e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-2",children:"神射手标签"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:ie.tags.map((ge,fe)=>e.jsx(Oe,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/20",children:ge},fe))})]}),ie.last_active&&e.jsxs("div",{className:"text-sm text-gray-500",children:["最近活跃:",ie.last_active]})]})]}),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",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(nn,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"推送用户数据到神射手"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"将本用户信息(手机号、昵称、标签等)同步至神射手,自动完善用户画像"})]}),e.jsx(q,{onClick:Ze,disabled:O||!c.phone,variant:"outline",className:"border-purple-500/40 text-purple-400 hover:bg-purple-500/10 bg-transparent shrink-0 ml-4",children:O?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"})," 推送中"]}):e.jsxs(e.Fragment,{children:[e.jsx(nn,{className:"w-4 h-4 mr-1"})," 推送"]})})]}),!c.phone&&e.jsx("p",{className:"text-yellow-500/70 text-xs",children:"⚠ 用户未绑定手机号,无法推送"}),X&&e.jsx("div",{className:"mt-3 p-3 bg-[#162840] rounded-lg text-sm",children:X.error?e.jsx("p",{className:"text-red-400",children:String(X.error)}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-green-400 flex items-center gap-1",children:[e.jsx(Wd,{className:"w-4 h-4"})," 推送成功"]}),X.enriched!==void 0&&e.jsxs("p",{className:"text-gray-400",children:["自动补全标签数:",String(X.new_tags_added??0)]})]})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-3 border-t border-gray-700 mt-3",children:[e.jsxs(q,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"关闭"]}),e.jsxs(q,{onClick:D,disabled:T,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),T?"保存中...":"保存修改"]})]})]}):e.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Dd={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function z2({open:r,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[u,m]=h.useState(Dd),[f,g]=h.useState([]),[y,p]=h.useState(!1),[v,E]=h.useState(!1);h.useEffect(()=>{if(!r){m(Dd);return}let T=!1;return p(!0),Promise.all([Be("/api/db/vip-roles"),l?Be(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([b,j])=>{if(T)return;const w=b!=null&&b.success&&b.data?b.data:[];g(w);const C=j&&j.user?j.user:null;if(C){const N=String(C.vipRole??""),_=w.some(V=>V.name===N);m({isVip:!!(C.isVip??!1),vipExpireDate:C.vipExpireDate?String(C.vipExpireDate).slice(0,10):"",vipSort:typeof C.vipSort=="number"?C.vipSort:"",vipRole:_?N:N?"__custom__":"",vipRoleCustom:_?"":N,vipName:String(C.vipName??""),vipProject:String(C.vipProject??""),vipContact:String(C.vipContact??""),vipBio:String(C.vipBio??"")})}else m(Dd)}).catch(b=>{T||console.error("Load error:",b)}).finally(()=>{T||p(!1)}),()=>{T=!0}},[r,l]);async function P(){if(l){if(u.isVip&&!u.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(u.isVip&&u.vipExpireDate.trim()){const T=new Date(u.vipExpireDate);if(isNaN(T.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}E(!0);try{const T=u.vipRole==="__custom__"?u.vipRoleCustom.trim():u.vipRole,b={id:l,isVip:u.isVip,vipExpireDate:u.isVip?u.vipExpireDate:void 0,vipSort:u.vipSort===""?void 0:u.vipSort,vipRole:T||void 0,vipName:u.vipName||void 0,vipProject:u.vipProject||void 0,vipContact:u.vipContact||void 0,vipBio:u.vipBio||void 0},j=await yt("/api/db/users",b);j!=null&&j.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(j==null?void 0:j.error))}catch(T){console.error("Save VIP error:",T),alert("保存失败")}finally{E(!1)}}}return r?e.jsx(St,{open:r,onOpenChange:()=>a(),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(sn,{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(Z,{className:"text-gray-300",children:"VIP 会员"}),e.jsx(dt,{checked:u.isVip,onCheckedChange:T=>m(b=>({...b,isVip:T}))})]}),u.isVip&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",e.jsx("span",{className:"text-amber-400",children:"*"})]}),e.jsx(le,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:u.vipExpireDate,onChange:T=>m(b=>({...b,vipExpireDate:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"排序"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:u.vipSort===""?"":u.vipSort,onChange:T=>{const b=T.target.value;m(j=>({...j,vipSort:b===""?"":parseInt(b,10)||0}))}})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{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:u.vipRole,onChange:T=>m(b=>({...b,vipRole:T.target.value})),children:[e.jsx("option",{value:"",children:"请选择或下方手动填写"}),f.map(T=>e.jsx("option",{value:T.name,children:T.name},T.id)),e.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),u.vipRole==="__custom__"&&e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:u.vipRoleCustom,onChange:T=>m(b=>({...b,vipRoleCustom:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:u.vipName,onChange:T=>m(b=>({...b,vipName:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"项目/公司"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:u.vipProject,onChange:T=>m(b=>({...b,vipProject:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"联系方式"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:u.vipContact,onChange:T=>m(b=>({...b,vipContact:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"一句话简介"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:u.vipBio,onChange:T=>m(b=>({...b,vipBio:T.target.value}))})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:P,disabled:v||y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})}):null}const Zi=[{id:"register",label:"注册/登录",icon:"👤",color:"bg-blue-500/20 border-blue-500/40 text-blue-400",desc:"微信授权登录或手机号注册"},{id:"browse",label:"浏览章节",icon:"📖",color:"bg-purple-500/20 border-purple-500/40 text-purple-400",desc:"点击免费/付费章节预览"},{id:"bind_phone",label:"绑定手机",icon:"📱",color:"bg-cyan-500/20 border-cyan-500/40 text-cyan-400",desc:"触发付费章节后绑定手机"},{id:"first_pay",label:"首次付款",icon:"💳",color:"bg-green-500/20 border-green-500/40 text-green-400",desc:"购买单章或全书"},{id:"fill_profile",label:"完善资料",icon:"✍️",color:"bg-yellow-500/20 border-yellow-500/40 text-yellow-400",desc:"填写头像、MBTI、行业等"},{id:"match",label:"派对房匹配",icon:"🤝",color:"bg-orange-500/20 border-orange-500/40 text-orange-400",desc:"参与 Soul 派对房"},{id:"vip",label:"升级 VIP",icon:"👑",color:"bg-amber-500/20 border-amber-500/40 text-amber-400",desc:"付款 ¥1980 购买全书"},{id:"distribution",label:"开启分销",icon:"🔗",color:"bg-[#38bdac]/20 border-[#38bdac]/40 text-[#38bdac]",desc:"生成推广码并推荐好友"}];function $2(){var Te,ut,rs,at,is;const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[g,y]=h.useState(""),p=Pu(g,300),[v,E]=h.useState("all"),[P,T]=h.useState(!0),[b,j]=h.useState(null),[w,C]=h.useState(!1),[N,_]=h.useState("desc"),[V,U]=h.useState(!1),[I,k]=h.useState(!1),[R,ee]=h.useState(null),[ne,ie]=h.useState(""),[te,se]=h.useState(""),[H,ae]=h.useState(!1),[ve,$]=h.useState(!1),[ce,K]=h.useState({referrals:[],stats:{}}),[A,O]=h.useState(!1),[L,X]=h.useState(null),[G,de]=h.useState(!1),[Y,pe]=h.useState(null),[Ce,D]=h.useState(!1),[ue,ke]=h.useState(null),[Ie,Ue]=h.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),[Ze,et]=h.useState([]),[tt,ge]=h.useState(!1),[fe,ot]=h.useState(!1),[ss,dr]=h.useState(null),[Ht,Cs]=h.useState({title:"",description:"",trigger:"",sort:0,enabled:!0}),[Kt,vn]=h.useState([]),[Mt,ur]=h.useState(!1),[Vn,ls]=h.useState(!1),[ks,jn]=h.useState(null),[Es,Ls]=h.useState({name:"",sort:0}),[hr,bn]=h.useState({}),[mr,Rr]=h.useState(!1);async function Ps(){var B;T(!0),j(null);try{if(w){const We=new URLSearchParams({search:p,limit:String(m*5)}),He=await Be(`/api/db/users/rfm?${We}`);if(He!=null&&He.success){let rt=He.users||[];N==="asc"&&(rt=[...rt].reverse());const Ts=(c-1)*m;a(rt.slice(Ts,Ts+m)),o(((B=He.users)==null?void 0:B.length)??0),rt.length===0&&(C(!1),j("暂无订单数据,RFM 排序需要用户有购买记录后才能生效"))}else C(!1),j((He==null?void 0:He.error)||"RFM 加载失败,已切回普通模式")}else{const We=new URLSearchParams({page:String(c),pageSize:String(m),search:p,...v==="vip"&&{vip:"true"}}),He=await Be(`/api/db/users?${We}`);He!=null&&He.success?(a(He.users||[]),o(He.total??0)):j((He==null?void 0:He.error)||"加载失败")}}catch(We){console.error("Load users error:",We),j("网络错误")}finally{T(!1)}}h.useEffect(()=>{u(1)},[p,v,w]),h.useEffect(()=>{Ps()},[c,m,p,v,w,N]);const Nn=Math.ceil(l/m)||1,qs=()=>{w?N==="desc"?_("asc"):(C(!1),_("desc")):(C(!0),_("desc"))},Xs=B=>({S:"bg-amber-500/20 text-amber-400",A:"bg-green-500/20 text-green-400",B:"bg-blue-500/20 text-blue-400",C:"bg-gray-500/20 text-gray-400",D:"bg-red-500/20 text-red-400"})[B||""]||"bg-gray-500/20 text-gray-400";async function Wn(B){if(confirm("确定要删除这个用户吗?"))try{const We=await kr(`/api/db/users?id=${encodeURIComponent(B)}`);We!=null&&We.success?Ps():alert("删除失败: "+((We==null?void 0:We.error)||""))}catch{alert("删除失败")}}const Hn=B=>{ee(B),Ue({phone:B.phone||"",nickname:B.nickname||"",password:"",isAdmin:!!(B.isAdmin??!1),hasFullBook:!!(B.hasFullBook??!1)}),U(!0)},Kn=()=>{ee(null),Ue({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),U(!0)};async function Gn(){if(!Ie.phone||!Ie.nickname){alert("请填写手机号和昵称");return}ae(!0);try{if(R){const B=await yt("/api/db/users",{id:R.id,nickname:Ie.nickname,isAdmin:Ie.isAdmin,hasFullBook:Ie.hasFullBook,...Ie.password&&{password:Ie.password}});if(!(B!=null&&B.success)){alert("更新失败: "+((B==null?void 0:B.error)||""));return}}else{const B=await ft("/api/db/users",{phone:Ie.phone,nickname:Ie.nickname,password:Ie.password,isAdmin:Ie.isAdmin});if(!(B!=null&&B.success)){alert("创建失败: "+((B==null?void 0:B.error)||""));return}}U(!1),Ps()}catch{alert("保存失败")}finally{ae(!1)}}const Yn=B=>{ee(B),ie(""),se(""),k(!0)};async function Ir(B){X(B),$(!0),O(!0);try{const We=await Be(`/api/db/users/referrals?userId=${encodeURIComponent(B.id)}`);We!=null&&We.success?K({referrals:We.referrals||[],stats:We.stats||{}}):K({referrals:[],stats:{}})}catch{K({referrals:[],stats:{}})}finally{O(!1)}}async function wn(){if(!ne){alert("请输入新密码");return}if(ne!==te){alert("两次密码不一致");return}if(ne.length<6){alert("密码至少6位");return}ae(!0);try{const B=await yt("/api/db/users",{id:R==null?void 0:R.id,password:ne});B!=null&&B.success?(alert("修改成功"),k(!1)):alert("修改失败: "+((B==null?void 0:B.error)||""))}catch{alert("修改失败")}finally{ae(!1)}}const qt=h.useCallback(async()=>{ge(!0);try{const B=await Be("/api/db/user-rules");B!=null&&B.success&&et(B.rules||[])}catch{}finally{ge(!1)}},[]);async function _r(){if(!Ht.title){alert("请填写规则标题");return}ae(!0);try{if(ss){const B=await yt("/api/db/user-rules",{id:ss.id,...Ht});if(!(B!=null&&B.success)){alert("更新失败: "+((B==null?void 0:B.error)||""));return}}else{const B=await ft("/api/db/user-rules",Ht);if(!(B!=null&&B.success)){alert("创建失败: "+((B==null?void 0:B.error)||""));return}}ot(!1),qt()}catch{alert("保存失败")}finally{ae(!1)}}async function Js(B){if(confirm("确定删除?"))try{const We=await kr(`/api/db/user-rules?id=${B}`);We!=null&&We.success&&qt()}catch{}}async function Qn(B){try{await yt("/api/db/user-rules",{id:B.id,enabled:!B.enabled}),qt()}catch{}}const ys=h.useCallback(async()=>{ur(!0);try{const B=await Be("/api/db/vip-roles");B!=null&&B.success&&vn(B.roles||[])}catch{}finally{ur(!1)}},[]);async function F(){if(!Es.name){alert("请填写角色名称");return}ae(!0);try{if(ks){const B=await yt("/api/db/vip-roles",{id:ks.id,...Es});if(!(B!=null&&B.success)){alert("更新失败");return}}else{const B=await ft("/api/db/vip-roles",Es);if(!(B!=null&&B.success)){alert("创建失败");return}}ls(!1),ys()}catch{alert("保存失败")}finally{ae(!1)}}async function oe(B){if(confirm("确定删除?"))try{const We=await kr(`/api/db/vip-roles?id=${B}`);We!=null&&We.success&&ys()}catch{}}const Ne=h.useCallback(async()=>{Rr(!0);try{const B=await Be("/api/db/users/journey-stats");B!=null&&B.success&&B.stats&&bn(B.stats)}catch{}finally{Rr(!1)}},[]);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:()=>j(null),children:"×"})]}),e.jsx("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.jsxs("p",{className:"text-gray-400 mt-1 text-sm",children:["共 ",l," 位注册用户",w&&" · RFM 排序中"]})]})}),e.jsxs(Ol,{defaultValue:"users",className:"w-full",children:[e.jsxs(Fa,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-6 flex-wrap h-auto gap-1",children:[e.jsxs(Lt,{value:"users",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",children:[e.jsx(Qt,{className:"w-4 h-4"})," 用户列表"]}),e.jsxs(Lt,{value:"journey",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:Ne,children:[e.jsx(Ca,{className:"w-4 h-4"})," 用户旅程总览"]}),e.jsxs(Lt,{value:"rules",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:qt,children:[e.jsx(On,{className:"w-4 h-4"})," 规则配置"]}),e.jsxs(Lt,{value:"vip-roles",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:ys,children:[e.jsx(sn,{className:"w-4 h-4"})," VIP 角色"]})]}),e.jsxs(Ot,{value:"users",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4 justify-end flex-wrap",children:[e.jsxs(q,{variant:"outline",onClick:Ps,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:B=>{E(B.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",disabled:w,children:[e.jsx("option",{value:"all",children:"全部用户"}),e.jsx("option",{value:"vip",children:"VIP会员"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(le,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-56",value:g,onChange:B=>y(B.target.value)})]}),e.jsxs(q,{onClick:Kn,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Yd,{className:"w-4 h-4 mr-2"})," 添加用户"]})]}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Se,{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(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"用户信息"}),e.jsx(be,{className:"text-gray-400",children:"绑定信息"}),e.jsx(be,{className:"text-gray-400",children:"购买状态"}),e.jsx(be,{className:"text-gray-400",children:"分销收益"}),e.jsxs(be,{className:"text-gray-400 cursor-pointer select-none",onClick:qs,children:[e.jsxs("div",{className:"flex items-center gap-1 group",children:[e.jsx(ka,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"RFM分值"}),w?N==="desc"?e.jsx(Tl,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(zx,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Bj,{className:"w-3.5 h-3.5 text-gray-600 group-hover:text-gray-400"})]}),w&&e.jsx("div",{className:"text-[10px] text-[#38bdac] font-normal mt-0.5",children:"点击切换方向/关闭"})]}),e.jsx(be,{className:"text-gray-400",children:"注册时间"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(B=>{var We,He,rt;return e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(xe,{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:B.avatar?e.jsx("img",{src:B.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((We=B.nickname)==null?void 0:We.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("p",{className:"font-medium text-white",children:B.nickname}),B.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),B.openId&&!((He=B.id)!=null&&He.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:B.openId?B.openId.slice(0,12)+"...":(rt=B.id)==null?void 0:rt.slice(0,12)})]})]})}),e.jsx(xe,{children:e.jsxs("div",{className:"space-y-1",children:[B.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:B.phone})]}),B.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:B.wechatId})]}),B.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:B.openId,children:[B.openId.slice(0,12),"..."]})]}),!B.phone&&!B.wechatId&&!B.openId&&e.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),e.jsx(xe,{children:B.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(xe,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(B.earnings||0)).toFixed(2)]}),parseFloat(String(B.pendingEarnings||0))>0&&e.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(B.pendingEarnings||0)).toFixed(2)]}),e.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>Ir(B),role:"button",tabIndex:0,onKeyDown:Ts=>Ts.key==="Enter"&&Ir(B),children:[e.jsx(Qt,{className:"w-3 h-3"})," 绑定",B.referralCount||0,"人"]})]})}),e.jsx(xe,{children:B.rfmScore!==void 0?e.jsx("div",{className:"flex flex-col gap-1",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-white font-bold text-base",children:B.rfmScore}),e.jsx(Oe,{className:`border-0 text-xs ${Xs(B.rfmLevel)}`,children:B.rfmLevel})]})}):e.jsxs("span",{className:"text-gray-600 text-sm",children:["— ",e.jsx("span",{className:"text-xs text-gray-700",children:"点列头排序"})]})}),e.jsx(xe,{className:"text-gray-400",children:B.createdAt?new Date(B.createdAt).toLocaleDateString():"-"}),e.jsx(xe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{ke(B),D(!0)},className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:e.jsx(sn,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{pe(B.id),de(!0)},className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:e.jsx(Cr,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>Hn(B),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>Yn(B),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx(Ff,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Wn(B.id),title:"删除",children:e.jsx(Wt,{className:"w-4 h-4"})})]})})]},B.id)}),r.length===0&&e.jsx(Je,{children:e.jsx(xe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Hs,{page:c,totalPages:Nn,total:l,pageSize:m,onPageChange:u,onPageSizeChange:B=>{f(B),u(1)}})]})})})]}),e.jsxs(Ot,{value:"journey",children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"用户从注册到 VIP 的完整行动路径,点击各阶段查看用户动态"}),e.jsxs(q,{variant:"outline",onClick:Ne,disabled:mr,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 ${mr?"animate-spin":""}`})," 刷新数据"]})]}),e.jsxs("div",{className:"relative mb-8",children:[e.jsx("div",{className:"absolute top-16 left-0 right-0 h-0.5 bg-gradient-to-r from-blue-500/20 via-[#38bdac]/30 to-amber-500/20 mx-20"}),e.jsx("div",{className:"grid grid-cols-4 gap-4 lg:grid-cols-8",children:Zi.map((B,We)=>e.jsxs("div",{className:"relative flex flex-col items-center",children:[e.jsxs("div",{className:`relative w-full p-3 rounded-xl border ${B.color} text-center cursor-default`,children:[e.jsx("div",{className:"text-2xl mb-1",children:B.icon}),e.jsx("div",{className:`text-xs font-medium ${B.color.split(" ").find(He=>He.startsWith("text-"))}`,children:B.label}),hr[B.id]!==void 0&&e.jsxs("div",{className:"mt-1.5 text-xs text-gray-400",children:[e.jsx("span",{className:"font-bold text-white",children:hr[B.id]})," 人"]}),e.jsx("div",{className:"absolute -top-2.5 -left-2.5 w-5 h-5 rounded-full bg-[#0a1628] border border-gray-700 flex items-center justify-center text-[10px] text-gray-500",children:We+1})]}),We<Zi.length-1&&e.jsx("div",{className:"hidden lg:block absolute right-0 top-1/2 -translate-y-1/2 translate-x-1/2 z-10",children:e.jsx("svg",{width:"20",height:"12",viewBox:"0 0 20 12",fill:"none",children:e.jsx("path",{d:"M0 6H16M16 6L11 1M16 6L11 11",stroke:"#374151",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("p",{className:"text-[10px] text-gray-600 text-center mt-2 leading-tight",children:B.desc})]},B.id))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-[#0f2137] border border-gray-700/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Ca,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"旅程关键节点"})]}),e.jsx("div",{className:"space-y-2 text-sm",children:[{step:"① 注册",action:"微信 OAuth 或手机号注册",next:"引导填写头像"},{step:"② 浏览",action:"点击章节/阅读免费内容",next:"触发绑定手机"},{step:"③ 首付",action:"购买单章或全书",next:"推送分销功能"},{step:"④ VIP",action:"¥1980 购买全书",next:"进入 VIP 私域群"},{step:"⑤ 分销",action:"推广好友购买",next:"提现分销收益"}].map(B=>e.jsxs("div",{className:"flex items-start gap-3 p-2 bg-[#0a1628] rounded",children:[e.jsx("span",{className:"text-[#38bdac] font-mono text-xs shrink-0 mt-0.5",children:B.step}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-300",children:B.action}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["→ ",B.next]})]})]},B.step))})]}),e.jsxs("div",{className:"bg-[#0f2137] border border-gray-700/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Ks,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"行为锚点统计"}),e.jsx("span",{className:"text-gray-500 text-xs ml-auto",children:"实时更新"})]}),mr?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx($e,{className:"w-5 h-5 text-[#38bdac] animate-spin"})}):Object.keys(hr).length>0?e.jsx("div",{className:"space-y-2",children:Zi.map(B=>{const We=hr[B.id]||0,He=Math.max(...Zi.map(Ts=>hr[Ts.id]||0),1),rt=Math.round(We/He*100);return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-gray-500 text-xs w-20 shrink-0",children:[B.icon," ",B.label]}),e.jsx("div",{className:"flex-1 h-2 bg-[#0a1628] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#38bdac]/60 rounded-full transition-all",style:{width:`${rt}%`}})}),e.jsx("span",{className:"text-gray-400 text-xs w-10 text-right",children:We})]},B.id)})}):e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-gray-500 text-sm",children:"点击「刷新数据」加载统计"})})]})]})]}),e.jsxs(Ot,{value:"rules",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"用户旅程引导规则,定义各行为节点的触发条件与引导内容"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(q,{variant:"outline",onClick:qt,disabled:tt,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 ${tt?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:()=>{dr(null),Cs({title:"",description:"",trigger:"",sort:0,enabled:!0}),ot(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"})," 添加规则"]})]})]}),tt?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):Ze.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(Ks,{className:"w-12 h-12 text-[#38bdac]/30 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400 mb-4",children:"暂无规则(重启服务将自动写入10条默认规则)"}),e.jsxs(q,{onClick:qt,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($e,{className:"w-4 h-4 mr-2"})," 重新加载"]})]}):e.jsx("div",{className:"space-y-2",children:Ze.map(B=>e.jsx("div",{className:`p-4 rounded-lg border transition-all ${B.enabled?"bg-[#0f2137] border-gray-700/50":"bg-[#0a1628]/50 border-gray-700/30 opacity-55"}`,children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[e.jsx(mt,{className:"w-4 h-4 text-[#38bdac] shrink-0"}),e.jsx("span",{className:"text-white font-medium",children:B.title}),B.trigger&&e.jsxs(Oe,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/30 text-xs",children:["触发:",B.trigger]}),e.jsx(Oe,{className:`text-xs border-0 ${B.enabled?"bg-green-500/20 text-green-400":"bg-gray-500/20 text-gray-400"}`,children:B.enabled?"启用":"禁用"})]}),B.description&&e.jsx("p",{className:"text-gray-400 text-sm ml-6",children:B.description})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4 shrink-0",children:[e.jsx(dt,{checked:B.enabled,onCheckedChange:()=>Qn(B)}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{dr(B),Cs({title:B.title,description:B.description,trigger:B.trigger,sort:B.sort,enabled:B.enabled}),ot(!0)},className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>Js(B.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]})},B.id))})]}),e.jsxs(Ot,{value:"vip-roles",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"管理用户 VIP 角色分类,这些角色将在用户详情和会员展示中使用"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(q,{variant:"outline",onClick:ys,disabled:Mt,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 ${Mt?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:()=>{jn(null),Ls({name:"",sort:0}),ls(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"})," 添加角色"]})]})]}),Mt?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):Kt.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(sn,{className:"w-12 h-12 text-amber-400/30 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400 mb-4",children:"暂无 VIP 角色"}),e.jsxs(q,{onClick:()=>{jn(null),Ls({name:"",sort:0}),ls(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"})," 添加第一个角色"]})]}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Kt.map(B=>e.jsxs("div",{className:"p-4 bg-[#0f2137] border border-amber-500/20 rounded-xl hover:border-amber-500/40 transition-all group",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(sn,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{className:"text-white font-medium",children:B.name})]}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{type:"button",onClick:()=>{jn(B),Ls({name:B.name,sort:B.sort}),ls(!0)},className:"text-gray-500 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>oe(B.id),className:"text-gray-500 hover:text-red-400",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["排序: ",B.sort]})]},B.id))})]})]}),e.jsx(St,{open:V,onOpenChange:U,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[R?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Yd,{className:"w-5 h-5 text-[#38bdac]"}),R?"编辑用户":"添加用户"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"手机号"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:Ie.phone,onChange:B=>Ue({...Ie,phone:B.target.value}),disabled:!!R})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"昵称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:Ie.nickname,onChange:B=>Ue({...Ie,nickname:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:R?"新密码 (留空则不修改)":"密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:R?"留空则不修改":"请输入密码",value:Ie.password,onChange:B=>Ue({...Ie,password:B.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Z,{className:"text-gray-300",children:"管理员权限"}),e.jsx(dt,{checked:Ie.isAdmin,onCheckedChange:B=>Ue({...Ie,isAdmin:B})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Z,{className:"text-gray-300",children:"已购全书"}),e.jsx(dt,{checked:Ie.hasFullBook,onCheckedChange:B=>Ue({...Ie,hasFullBook:B})})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>U(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:Gn,disabled:H,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),H?"保存中...":"保存"]})]})]})}),e.jsx(St,{open:I,onOpenChange:k,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Ff,{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:["用户:",R==null?void 0:R.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",R==null?void 0:R.phone]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"新密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:ne,onChange:B=>ie(B.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"确认密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入",value:te,onChange:B=>se(B.target.value)})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>k(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:wn,disabled:H,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:H?"保存中...":"确认修改"})]})]})}),e.jsx(St,{open:fe,onOpenChange:ot,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),ss?"编辑规则":"添加规则"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"规则标题 *"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:匹配后填写头像、付款1980需填写信息",value:Ht.title,onChange:B=>Cs({...Ht,title:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"规则描述"}),e.jsx(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[80px] resize-none",placeholder:"详细说明规则内容...",value:Ht.description,onChange:B=>Cs({...Ht,description:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"触发条件"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:完成匹配、付款后、注册时",value:Ht.trigger,onChange:B=>Cs({...Ht,trigger:B.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx(Z,{className:"text-gray-300",children:"启用状态"})}),e.jsx(dt,{checked:Ht.enabled,onCheckedChange:B=>Cs({...Ht,enabled:B})})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>ot(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:_r,disabled:H,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),H?"保存中...":"保存"]})]})]})}),e.jsx(St,{open:Vn,onOpenChange:ls,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(sn,{className:"w-5 h-5 text-amber-400"}),ks?"编辑 VIP 角色":"添加 VIP 角色"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"角色名称 *"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:创业者、资源整合者、技术咖",value:Es.name,onChange:B=>Ls({...Es,name:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"排序(越小越前)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Es.sort,onChange:B=>Ls({...Es,sort:parseInt(B.target.value)||0})})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>ls(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:F,disabled:H,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),H?"保存中...":"保存"]})]})]})}),e.jsx(St,{open:ve,onOpenChange:$,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系 - ",L==null?void 0:L.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:((Te=ce.stats)==null?void 0:Te.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:((ut=ce.stats)==null?void 0:ut.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:["¥",(((rs=ce.stats)==null?void 0:rs.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:["¥",(((at=ce.stats)==null?void 0:at.pendingEarnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),A?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:"加载中..."})]}):(((is=ce.referrals)==null?void 0:is.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(ce.referrals??[]).map((B,We)=>{var rt;const He=B;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:((rt=He.nickname)==null?void 0:rt.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white text-sm",children:He.nickname}),e.jsx("div",{className:"text-xs text-gray-500",children:He.phone||(He.hasOpenId?"微信用户":"未绑定")})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[He.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),He.status==="paid"&&e.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",He.purchasedSections,"章"]}),He.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:He.createdAt?new Date(He.createdAt).toLocaleDateString():""})]})]},He.id||We)})}):e.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),e.jsx(Dt,{children:e.jsx(q,{variant:"outline",onClick:()=>$(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),e.jsx(F2,{open:G,onClose:()=>de(!1),userId:Y,onUserUpdated:Ps}),e.jsx(z2,{open:Ce,onClose:()=>{D(!1),ke(null)},userId:(ue==null?void 0:ue.id)??null,userNickname:ue==null?void 0:ue.nickname,onSaved:Ps})]})}function ho(r,[a,l]){return Math.min(l,Math.max(a,r))}var m0=["PageUp","PageDown"],f0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],x0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},za="Slider",[Zd,B2,U2]=Tu(za),[p0]=pn(za,[U2]),[V2,Eo]=p0(za),g0=h.forwardRef((r,a)=>{const{name:l,min:o=0,max:c=100,step:u=1,orientation:m="horizontal",disabled:f=!1,minStepsBetweenThumbs:g=0,defaultValue:y=[o],value:p,onValueChange:v=()=>{},onValueCommit:E=()=>{},inverted:P=!1,form:T,...b}=r,j=h.useRef(new Set),w=h.useRef(0),N=m==="horizontal"?W2:H2,[_=[],V]=Fn({prop:p,defaultProp:y,onChange:ne=>{var te;(te=[...j.current][w.current])==null||te.focus(),v(ne)}}),U=h.useRef(_);function I(ne){const ie=q2(_,ne);ee(ne,ie)}function k(ne){ee(ne,w.current)}function R(){const ne=U.current[w.current];_[w.current]!==ne&&E(_)}function ee(ne,ie,{commit:te}={commit:!1}){const se=e4(u),H=t4(Math.round((ne-o)/u)*u+o,se),ae=ho(H,[o,c]);V((ve=[])=>{const $=Y2(ve,ae,ie);if(Z2($,g*u)){w.current=$.indexOf(ae);const ce=String($)!==String(ve);return ce&&te&&E($),ce?$:ve}else return ve})}return e.jsx(V2,{scope:r.__scopeSlider,name:l,disabled:f,min:o,max:c,valueIndexToChangeRef:w,thumbs:j.current,values:_,orientation:m,form:T,children:e.jsx(Zd.Provider,{scope:r.__scopeSlider,children:e.jsx(Zd.Slot,{scope:r.__scopeSlider,children:e.jsx(N,{"aria-disabled":f,"data-disabled":f?"":void 0,...b,ref:a,onPointerDown:Ye(b.onPointerDown,()=>{f||(U.current=_)}),min:o,max:c,inverted:P,onSlideStart:f?void 0:I,onSlideMove:f?void 0:k,onSlideEnd:f?void 0:R,onHomeKeyDown:()=>!f&&ee(o,0,{commit:!0}),onEndKeyDown:()=>!f&&ee(c,_.length-1,{commit:!0}),onStepKeyDown:({event:ne,direction:ie})=>{if(!f){const H=m0.includes(ne.key)||ne.shiftKey&&f0.includes(ne.key)?10:1,ae=w.current,ve=_[ae],$=u*H*ie;ee(ve+$,ae,{commit:!0})}}})})})})});g0.displayName=za;var[y0,v0]=p0(za,{startEdge:"left",endEdge:"right",size:"width",direction:1}),W2=h.forwardRef((r,a)=>{const{min:l,max:o,dir:c,inverted:u,onSlideStart:m,onSlideMove:f,onSlideEnd:g,onStepKeyDown:y,...p}=r,[v,E]=h.useState(null),P=lt(a,N=>E(N)),T=h.useRef(void 0),b=So(c),j=b==="ltr",w=j&&!u||!j&&u;function C(N){const _=T.current||v.getBoundingClientRect(),V=[0,_.width],I=Mu(V,w?[l,o]:[o,l]);return T.current=_,I(N-_.left)}return e.jsx(y0,{scope:r.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:e.jsx(j0,{dir:b,"data-orientation":"horizontal",...p,ref:P,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const _=C(N.clientX);m==null||m(_)},onSlideMove:N=>{const _=C(N.clientX);f==null||f(_)},onSlideEnd:()=>{T.current=void 0,g==null||g()},onStepKeyDown:N=>{const V=x0[w?"from-left":"from-right"].includes(N.key);y==null||y({event:N,direction:V?-1:1})}})})}),H2=h.forwardRef((r,a)=>{const{min:l,max:o,inverted:c,onSlideStart:u,onSlideMove:m,onSlideEnd:f,onStepKeyDown:g,...y}=r,p=h.useRef(null),v=lt(a,p),E=h.useRef(void 0),P=!c;function T(b){const j=E.current||p.current.getBoundingClientRect(),w=[0,j.height],N=Mu(w,P?[o,l]:[l,o]);return E.current=j,N(b-j.top)}return e.jsx(y0,{scope:r.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:e.jsx(j0,{"data-orientation":"vertical",...y,ref:v,style:{...y.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const j=T(b.clientY);u==null||u(j)},onSlideMove:b=>{const j=T(b.clientY);m==null||m(j)},onSlideEnd:()=>{E.current=void 0,f==null||f()},onStepKeyDown:b=>{const w=x0[P?"from-bottom":"from-top"].includes(b.key);g==null||g({event:b,direction:w?-1:1})}})})}),j0=h.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:u,onHomeKeyDown:m,onEndKeyDown:f,onStepKeyDown:g,...y}=r,p=Eo(za,l);return e.jsx(qe.span,{...y,ref:a,onKeyDown:Ye(r.onKeyDown,v=>{v.key==="Home"?(m(v),v.preventDefault()):v.key==="End"?(f(v),v.preventDefault()):m0.concat(f0).includes(v.key)&&(g(v),v.preventDefault())}),onPointerDown:Ye(r.onPointerDown,v=>{const E=v.target;E.setPointerCapture(v.pointerId),v.preventDefault(),p.thumbs.has(E)?E.focus():o(v)}),onPointerMove:Ye(r.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:Ye(r.onPointerUp,v=>{const E=v.target;E.hasPointerCapture(v.pointerId)&&(E.releasePointerCapture(v.pointerId),u(v))})})}),b0="SliderTrack",N0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Eo(b0,l);return e.jsx(qe.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});N0.displayName=b0;var eu="SliderRange",w0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Eo(eu,l),u=v0(eu,l),m=h.useRef(null),f=lt(a,m),g=c.values.length,y=c.values.map(E=>k0(E,c.min,c.max)),p=g>1?Math.min(...y):0,v=100-Math.max(...y);return e.jsx(qe.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:f,style:{...r.style,[u.startEdge]:p+"%",[u.endEdge]:v+"%"}})});w0.displayName=eu;var tu="SliderThumb",S0=h.forwardRef((r,a)=>{const l=B2(r.__scopeSlider),[o,c]=h.useState(null),u=lt(a,f=>c(f)),m=h.useMemo(()=>o?l().findIndex(f=>f.ref.current===o):-1,[l,o]);return e.jsx(K2,{...r,ref:u,index:m})}),K2=h.forwardRef((r,a)=>{const{__scopeSlider:l,index:o,name:c,...u}=r,m=Eo(tu,l),f=v0(tu,l),[g,y]=h.useState(null),p=lt(a,C=>y(C)),v=g?m.form||!!g.closest("form"):!0,E=_u(g),P=m.values[o],T=P===void 0?0:k0(P,m.min,m.max),b=Q2(o,m.values.length),j=E==null?void 0:E[f.size],w=j?X2(j,T,f.direction):0;return h.useEffect(()=>{if(g)return m.thumbs.add(g),()=>{m.thumbs.delete(g)}},[g,m.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${T}% + ${w}px)`},children:[e.jsx(Zd.ItemSlot,{scope:r.__scopeSlider,children:e.jsx(qe.span,{role:"slider","aria-label":r["aria-label"]||b,"aria-valuemin":m.min,"aria-valuenow":P,"aria-valuemax":m.max,"aria-orientation":m.orientation,"data-orientation":m.orientation,"data-disabled":m.disabled?"":void 0,tabIndex:m.disabled?void 0:0,...u,ref:p,style:P===void 0?{display:"none"}:r.style,onFocus:Ye(r.onFocus,()=>{m.valueIndexToChangeRef.current=o})})}),v&&e.jsx(C0,{name:c??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:P},o)]})});S0.displayName=tu;var G2="RadioBubbleInput",C0=h.forwardRef(({__scopeSlider:r,value:a,...l},o)=>{const c=h.useRef(null),u=lt(c,o),m=Iu(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const g=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(g,"value").set;if(m!==a&&p){const v=new Event("input",{bubbles:!0});p.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(qe.input,{style:{display:"none"},...l,ref:u,defaultValue:a})});C0.displayName=G2;function Y2(r=[],a,l){const o=[...r];return o[l]=a,o.sort((c,u)=>c-u)}function k0(r,a,l){const u=100/(l-a)*(r-a);return ho(u,[0,100])}function Q2(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function q2(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function X2(r,a,l){const o=r/2,u=Mu([0,50],[0,o]);return(o-u(a)*l)*l}function J2(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function Z2(r,a){if(a>0){const l=J2(r);return Math.min(...l)>=a}return!0}function Mu(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(r[1]-r[0]);return a[0]+o*(l-r[0])}}function e4(r){return(String(r).split(".")[1]||"").length}function t4(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var s4=g0,r4=N0,n4=w0,a4=S0;function l4({className:r,defaultValue:a,value:l,min:o=0,max:c=100,...u}){const m=h.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return e.jsxs(s4,{defaultValue:a,value:l,min:o,max:c,className:it("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...u,children:[e.jsx(r4,{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:m.length},(f,g)=>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"},g))]})}const i4={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function E0({embedded:r=!1}){const[a,l]=h.useState(i4),[o,c]=h.useState(!0),[u,m]=h.useState(!1);h.useEffect(()=>{Be("/api/admin/referral-settings").then(y=>{const p=y==null?void 0:y.data;p&&typeof p=="object"&&l({distributorShare:p.distributorShare??90,minWithdrawAmount:p.minWithdrawAmount??10,bindingDays:p.bindingDays??30,userDiscount:p.userDiscount??5,enableAutoWithdraw:p.enableAutoWithdraw??!1,vipOrderShareVip:p.vipOrderShareVip??20,vipOrderShareNonVip:p.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>c(!1))},[]);const f=async()=>{m(!0);try{const y={distributorShare:Number(a.distributorShare)||0,minWithdrawAmount:Number(a.minWithdrawAmount)||0,bindingDays:Number(a.bindingDays)||0,userDiscount:Number(a.userDiscount)||0,enableAutoWithdraw:!!a.enableAutoWithdraw,vipOrderShareVip:Number(a.vipOrderShareVip)||20,vipOrderShareNonVip:Number(a.vipOrderShareNonVip)||10},p=await ft("/api/admin/referral-settings",y);if(!p||p.success===!1){alert("保存失败: "+(p&&typeof p=="object"&&"error"in p?p.error:""));return}alert(`✅ 分销配置已保存成功!
|
||
|
||
• 小程序与网站的推广规则会一起生效
|
||
• 绑定关系会使用新的天数配置
|
||
• 佣金比例会立即应用到新订单
|
||
|
||
如有缓存,请刷新前台/小程序页面。`)}catch(y){console.error(y),alert("保存失败: "+(y instanceof Error?y.message:String(y)))}finally{m(!1)}},g=y=>p=>{const v=parseFloat(p.target.value||"0");l(E=>({...E,[y]:isNaN(v)?0:v}))};return o?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:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),e.jsxs(q,{onClick:f,disabled:u||o,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),u?"保存中...":"保存配置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"flex items-center gap-2 text-white",children:[e.jsx(Qb,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),e.jsx(vt,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),e.jsx(Se,{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(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Hi,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),e.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.userDiscount,onChange:g("userDiscount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{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:[a.distributorShare],onValueChange:([y])=>l(p=>({...p,distributorShare:y}))}),e.jsx(le,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:a.distributorShare,onChange:g("distributorShare")})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["内容订单佣金 = 订单金额 ×"," ",e.jsxs("span",{className:"text-[#38bdac] font-mono",children:[a.distributorShare,"%"]}),";会员订单见下方。"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Hi,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),e.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.vipOrderShareVip,onChange:g("vipOrderShareVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Hi,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),e.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.vipOrderShareNonVip,onChange:g("vipOrderShareNonVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Qt,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),e.jsx(le,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:a.bindingDays,onChange:g("bindingDays")}),e.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"flex items-center gap-2 text-white",children:[e.jsx(Ra,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),e.jsx(vt,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),e.jsx(Se,{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(Z,{className:"text-gray-300",children:"最低提现金额(元)"}),e.jsx(le,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:a.minWithdrawAmount,onChange:g("minWithdrawAmount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{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(dt,{checked:a.enableAutoWithdraw,onCheckedChange:y=>l(p=>({...p,enableAutoWithdraw:y}))}),e.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ge,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[e.jsx(Hi,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),e.jsxs(Se,{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. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}function o4(){var Ce;const[r,a]=h.useState("overview"),[l,o]=h.useState([]),[c,u]=h.useState(null),[m,f]=h.useState([]),[g,y]=h.useState([]),[p,v]=h.useState([]),[E,P]=h.useState(!0),[T,b]=h.useState(null),[j,w]=h.useState(""),[C,N]=h.useState("all"),[_,V]=h.useState(1),[U,I]=h.useState(10),[k,R]=h.useState(0),[ee,ne]=h.useState(new Set),[ie,te]=h.useState(null),[se,H]=h.useState(""),[ae,ve]=h.useState(!1);h.useEffect(()=>{$()},[]),h.useEffect(()=>{V(1)},[r,C]),h.useEffect(()=>{ce(r)},[r]),h.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&ce(r,!0)},[_,U,C,j]);async function $(){b(null);try{const D=await Be("/api/admin/distribution/overview");D!=null&&D.success&&D.overview&&u(D.overview)}catch(D){console.error("[Admin] 概览接口异常:",D),b("加载概览失败")}try{const D=await Be("/api/db/users");v((D==null?void 0:D.users)||[])}catch(D){console.error("[Admin] 用户数据加载失败:",D)}}async function ce(D,ue=!1){var ke;if(!(!ue&&ee.has(D))){P(!0);try{const Ie=p;switch(D){case"overview":break;case"orders":{try{const Ue=new URLSearchParams({page:String(_),pageSize:String(U),...C!=="all"&&{status:C},...j&&{search:j}}),Ze=await Be(`/api/orders?${Ue}`);if(Ze!=null&&Ze.success&&Ze.orders){const et=Ze.orders.map(tt=>{const ge=Ie.find(ot=>ot.id===tt.userId),fe=tt.referrerId?Ie.find(ot=>ot.id===tt.referrerId):null;return{...tt,amount:parseFloat(String(tt.amount))||0,userNickname:(ge==null?void 0:ge.nickname)||tt.userNickname||"未知用户",userPhone:(ge==null?void 0:ge.phone)||tt.userPhone||"-",referrerNickname:(fe==null?void 0:fe.nickname)||null,referrerCode:(fe==null?void 0:fe.referralCode)??null,type:tt.productType||tt.type}});o(et),R(Ze.total??et.length)}else o([]),R(0)}catch(Ue){console.error(Ue),b("加载订单失败"),o([])}break}case"bindings":{try{const Ue=new URLSearchParams({page:String(_),pageSize:String(U),...C!=="all"&&{status:C}}),Ze=await Be(`/api/db/distribution?${Ue}`);f((Ze==null?void 0:Ze.bindings)||[]),R((Ze==null?void 0:Ze.total)??((ke=Ze==null?void 0:Ze.bindings)==null?void 0:ke.length)??0)}catch(Ue){console.error(Ue),b("加载绑定数据失败"),f([])}break}case"withdrawals":{try{const Ue=C==="completed"?"success":C==="rejected"?"failed":C,Ze=new URLSearchParams({...Ue&&Ue!=="all"&&{status:Ue},page:String(_),pageSize:String(U)}),et=await Be(`/api/admin/withdrawals?${Ze}`);if(et!=null&&et.success&&et.withdrawals){const tt=et.withdrawals.map(ge=>({...ge,account:ge.account??"未绑定微信号",status:ge.status==="success"?"completed":ge.status==="failed"?"rejected":ge.status}));y(tt),R((et==null?void 0:et.total)??tt.length)}else et!=null&&et.success||b(`获取提现记录失败: ${(et==null?void 0:et.error)||"未知错误"}`),y([])}catch(Ue){console.error(Ue),b("加载提现数据失败"),y([])}break}}ne(Ue=>new Set(Ue).add(D))}catch(Ie){console.error(Ie)}finally{P(!1)}}}async function K(){b(null),ne(D=>{const ue=new Set(D);return ue.delete(r),ue}),r==="overview"&&$(),await ce(r,!0)}async function A(D){if(confirm("确认审核通过并打款?"))try{const ue=await yt("/api/admin/withdrawals",{id:D,action:"approve"});if(!(ue!=null&&ue.success)){const ke=(ue==null?void 0:ue.message)||(ue==null?void 0:ue.error)||"操作失败";alert(ke);return}await K()}catch(ue){console.error(ue),alert("操作失败")}}async function O(D){const ue=prompt("请输入拒绝原因:");if(ue)try{const ke=await yt("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:ue});if(!(ke!=null&&ke.success)){alert((ke==null?void 0:ke.error)||"操作失败");return}await K()}catch(ke){console.error(ke),alert("操作失败")}}async function L(){var D;if(!(!(ie!=null&&ie.orderSn)&&!(ie!=null&&ie.id))){ve(!0),b(null);try{const ue=await yt("/api/admin/orders/refund",{orderSn:ie.orderSn||ie.id,reason:se||void 0});ue!=null&&ue.success?(te(null),H(""),await ce("orders",!0)):b((ue==null?void 0:ue.error)||"退款失败")}catch(ue){const ke=ue;b(((D=ke==null?void 0:ke.data)==null?void 0:D.error)||"退款失败,请检查网络后重试")}finally{ve(!1)}}}function X(D){const ue={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"},ke={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return e.jsx(Oe,{className:`${ue[D]||"bg-gray-500/20 text-gray-400"} border-0`,children:ke[D]||D})}const G=Math.ceil(k/U)||1,de=l,Y=m.filter(D=>{var ke,Ie,Ue,Ze;if(!j)return!0;const ue=j.toLowerCase();return((ke=D.refereeNickname)==null?void 0:ke.toLowerCase().includes(ue))||((Ie=D.refereePhone)==null?void 0:Ie.includes(ue))||((Ue=D.referrerName)==null?void 0:Ue.toLowerCase().includes(ue))||((Ze=D.referrerCode)==null?void 0:Ze.toLowerCase().includes(ue))}),pe=g.filter(D=>{var ke;if(!j)return!0;const ue=j.toLowerCase();return((ke=D.userName)==null?void 0:ke.toLowerCase().includes(ue))||D.account&&D.account.toLowerCase().includes(ue)});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:()=>b(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(q,{onClick:K,disabled:E,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${E?"animate-spin":""}`}),"刷新数据"]})]}),e.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4 flex-wrap",children:[{key:"overview",label:"数据概览",icon:ka},{key:"orders",label:"订单管理",icon:Rl},{key:"bindings",label:"绑定管理",icon:ln},{key:"withdrawals",label:"提现审核",icon:Ra},{key:"settings",label:"推广设置",icon:On}].map(D=>e.jsxs("button",{type:"button",onClick:()=>{a(D.key),N("all"),w("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===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))}),E?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:[r==="overview"&&c&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{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(Cr,{className:"w-6 h-6 text-blue-400"})})]})})}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{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(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{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(ka,{className:"w-6 h-6 text-amber-400"})})]})})}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{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(ln,{className:"w-6 h-6 text-green-400"})})]})})}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{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(Lf,{className:"w-6 h-6 text-purple-400"})})]})})}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{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(Rl,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),(((Ce=c.todayClicksByPage)==null?void 0:Ce.length)??0)>0&&e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Cr,{className:"w-5 h-5 text-[#38bdac]"}),"每篇文章今日点击(按来源页/文章统计)"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"实际用户与实际文章的点击均计入;今日总点击与上表一致"})]}),e.jsx(Se,{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,ue)=>ue.clicks-D.clicks).map((D,ue)=>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,"%"]})]},ue))})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(we,{className:"bg-orange-500/10 border-orange-500/30",children:e.jsx(Se,{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(Hd,{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(we,{className:"bg-blue-500/10 border-blue-500/30",children:e.jsx(Se,{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(Ra,{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(q,{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(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(ao,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),e.jsx(Se,{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(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(ka,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),e.jsxs(Se,{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(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),e.jsx(Se,{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:"绑定有效期"})]})]})})]})]}),r==="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(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(le,{value:j,onChange:D=>w(D.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:C,onChange:D=>N(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(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Se,{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:de.map(D=>{var ue,ke;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:[(ue=D.id)==null?void 0:ue.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 Ie=D.productType||D.type;return Ie==="fullbook"?`${D.bookName||"《底层逻辑》"} - 全本`:Ie==="match"?"匹配次数购买":`${D.bookName||"《底层逻辑》"} - ${D.sectionTitle||D.chapterTitle||`章节${D.productId||D.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const Ie=D.productType||D.type;return Ie==="fullbook"?"全书解锁":Ie==="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||((ke=D.referrerId)==null?void 0:ke.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(q,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{te(D),H("")},children:[e.jsx(Kx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},D.id)})})]})}),r==="orders"&&e.jsx(Hs,{page:_,totalPages:G,total:k,pageSize:U,onPageChange:V,onPageSizeChange:D=>{I(D),V(1)}})]})})]}),r==="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(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(le,{value:j,onChange:D=>w(D.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:C,onChange:D=>N(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(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Se,{className:"p-0",children:[Y.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:Y.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))})]})}),r==="bindings"&&e.jsx(Hs,{page:_,totalPages:G,total:k,pageSize:U,onPageChange:V,onPageSizeChange:D=>{I(D),V(1)}})]})})]}),r==="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(on,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(le,{value:j,onChange:D=>w(D.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:C,onChange:D=>N(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(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Se,{className:"p-0",children:[pe.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:pe.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(q,{size:"sm",onClick:()=>A(D.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Lf,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(q,{size:"sm",variant:"outline",onClick:()=>O(D.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx(Bx,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},D.id))})]})}),r==="withdrawals"&&e.jsx(Hs,{page:_,totalPages:G,total:k,pageSize:U,onPageChange:V,onPageSizeChange:D=>{I(D),V(1)}})]})})]})]}),e.jsx(St,{open:!!ie,onOpenChange:D=>!D&&te(null),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(Ct,{children:e.jsx(kt,{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(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:se,onChange:D=>H(D.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>te(null),disabled:ae,children:"取消"}),e.jsx(q,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:L,disabled:ae,children:ae?"退款中...":"确认退款"})]})]})}),r==="settings"&&e.jsx("div",{className:"-mx-8 -mt-6",children:e.jsx(E0,{embedded:!0})})]})}function c4(){const[r,a]=h.useState([]),[l,o]=h.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,u]=h.useState(!0),[m,f]=h.useState(null),[g,y]=h.useState("all"),[p,v]=h.useState(1),[E,P]=h.useState(10),[T,b]=h.useState(0),[j,w]=h.useState(null);async function C(){var I,k,R,ee,ne,ie,te;u(!0),f(null);try{const se=new URLSearchParams({status:g,page:String(p),pageSize:String(E)}),H=await Be(`/api/admin/withdrawals?${se}`);if(H!=null&&H.success){const ae=H.withdrawals||[];a(ae),b(H.total??((I=H.stats)==null?void 0:I.total)??ae.length),o({total:((k=H.stats)==null?void 0:k.total)??H.total??ae.length,pendingCount:((R=H.stats)==null?void 0:R.pendingCount)??0,pendingAmount:((ee=H.stats)==null?void 0:ee.pendingAmount)??0,successCount:((ne=H.stats)==null?void 0:ne.successCount)??0,successAmount:((ie=H.stats)==null?void 0:ie.successAmount)??0,failedCount:((te=H.stats)==null?void 0:te.failedCount)??0})}else f("加载提现记录失败")}catch(se){console.error("Load withdrawals error:",se),f("加载失败,请检查网络后重试")}finally{u(!1)}}h.useEffect(()=>{v(1)},[g]),h.useEffect(()=>{C()},[g,p,E]);const N=Math.ceil(T/E)||1;async function _(I){const k=r.find(R=>R.id===I);if(k!=null&&k.userCommissionInfo&&k.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${k.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。
|
||
|
||
确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;w(I);try{const R=await yt("/api/admin/withdrawals",{id:I,action:"approve"});R!=null&&R.success?C():alert("操作失败: "+((R==null?void 0:R.error)??""))}catch{alert("操作失败")}finally{w(null)}}async function V(I){const k=prompt("请输入拒绝原因(将返还用户余额):");if(k){w(I);try{const R=await yt("/api/admin/withdrawals",{id:I,action:"reject",errorMessage:k});R!=null&&R.success?C():alert("操作失败: "+((R==null?void 0:R.error)??""))}catch{alert("操作失败")}finally{w(null)}}}function U(I){switch(I){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:I})}}return e.jsxs("div",{className:"p-8 w-full",children:[m&&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:m}),e.jsx("button",{type:"button",onClick:()=>f(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(q,{variant:"outline",onClick:C,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(we,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:e.jsx(Se,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Rl,{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(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Se,{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(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Se,{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(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Se,{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(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Se,{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(I=>e.jsx(q,{variant:g===I?"default":"outline",size:"sm",onClick:()=>y(I),className:g===I?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:I==="all"?"全部":I==="pending"?"待处理":I==="success"?"已完成":"已拒绝"},I))}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Se,{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:"加载中..."})]}):r.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Ra,{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:r.map(I=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4 text-gray-400",children:new Date(I.createdAt??"").toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[I.userAvatar?e.jsx("img",{src:I.userAvatar,alt:I.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:(I.userName??"?").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-white",children:I.userName??"未知"}),e.jsx("p",{className:"text-xs text-gray-500",children:I.userPhone??I.referralCode??(I.userId??"").slice(0,10)})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(I.amount).toFixed(2)]})}),e.jsx("td",{className:"p-4",children:I.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:["¥",I.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:["¥",I.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:["¥",I.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:I.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",I.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):e.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),e.jsxs("td",{className:"p-4",children:[U(I.status),I.errorMessage&&e.jsx("p",{className:"text-xs text-red-400 mt-1",children:I.errorMessage})]}),e.jsx("td",{className:"p-4 text-gray-400",children:I.processedAt?new Date(I.processedAt).toLocaleString():"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:I.userConfirmedAt?e.jsxs("span",{className:"text-green-400",title:I.userConfirmedAt,children:["已确认 ",new Date(I.userConfirmedAt).toLocaleString()]}):"-"}),e.jsxs("td",{className:"p-4 text-right",children:[(I.status==="pending"||I.status==="pending_confirm")&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(q,{size:"sm",onClick:()=>_(I.id),disabled:j===I.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(jo,{className:"w-4 h-4 mr-1"}),"批准"]}),e.jsxs(q,{size:"sm",variant:"outline",onClick:()=>V(I.id),disabled:j===I.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(I.status==="success"||I.status==="completed")&&I.transactionId&&e.jsx("span",{className:"text-xs text-gray-500 font-mono",children:I.transactionId})]})]},I.id))})]})}),e.jsx(Hs,{page:p,totalPages:N,total:T,pageSize:E,onPageChange:v,onPageSizeChange:I=>{P(I),v(1)}})]})})})]})}const d4=["top","right","bottom","left"],hn=Math.min,ws=Math.max,mo=Math.round,eo=Math.floor,ir=r=>({x:r,y:r}),u4={left:"right",right:"left",bottom:"top",top:"bottom"},h4={start:"end",end:"start"};function su(r,a,l){return ws(r,hn(a,l))}function Er(r,a){return typeof r=="function"?r(a):r}function Pr(r){return r.split("-")[0]}function $a(r){return r.split("-")[1]}function Au(r){return r==="x"?"y":"x"}function Du(r){return r==="y"?"height":"width"}const m4=new Set(["top","bottom"]);function lr(r){return m4.has(Pr(r))?"y":"x"}function Lu(r){return Au(lr(r))}function f4(r,a,l){l===void 0&&(l=!1);const o=$a(r),c=Lu(r),u=Du(c);let m=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(m=fo(m)),[m,fo(m)]}function x4(r){const a=fo(r);return[ru(r),a,ru(a)]}function ru(r){return r.replace(/start|end/g,a=>h4[a])}const ix=["left","right"],ox=["right","left"],p4=["top","bottom"],g4=["bottom","top"];function y4(r,a,l){switch(r){case"top":case"bottom":return l?a?ox:ix:a?ix:ox;case"left":case"right":return a?p4:g4;default:return[]}}function v4(r,a,l,o){const c=$a(r);let u=y4(Pr(r),l==="start",o);return c&&(u=u.map(m=>m+"-"+c),a&&(u=u.concat(u.map(ru)))),u}function fo(r){return r.replace(/left|right|bottom|top/g,a=>u4[a])}function j4(r){return{top:0,right:0,bottom:0,left:0,...r}}function P0(r){return typeof r!="number"?j4(r):{top:r,right:r,bottom:r,left:r}}function xo(r){const{x:a,y:l,width:o,height:c}=r;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function cx(r,a,l){let{reference:o,floating:c}=r;const u=lr(a),m=Lu(a),f=Du(m),g=Pr(a),y=u==="y",p=o.x+o.width/2-c.width/2,v=o.y+o.height/2-c.height/2,E=o[f]/2-c[f]/2;let P;switch(g){case"top":P={x:p,y:o.y-c.height};break;case"bottom":P={x:p,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($a(a)){case"start":P[m]-=E*(l&&y?-1:1);break;case"end":P[m]+=E*(l&&y?-1:1);break}return P}async function b4(r,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:u,rects:m,elements:f,strategy:g}=r,{boundary:y="clippingAncestors",rootBoundary:p="viewport",elementContext:v="floating",altBoundary:E=!1,padding:P=0}=Er(a,r),T=P0(P),j=f[E?v==="floating"?"reference":"floating":v],w=xo(await u.getClippingRect({element:(l=await(u.isElement==null?void 0:u.isElement(j)))==null||l?j:j.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(f.floating)),boundary:y,rootBoundary:p,strategy:g})),C=v==="floating"?{x:o,y:c,width:m.floating.width,height:m.floating.height}:m.reference,N=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f.floating)),_=await(u.isElement==null?void 0:u.isElement(N))?await(u.getScale==null?void 0:u.getScale(N))||{x:1,y:1}:{x:1,y:1},V=xo(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:C,offsetParent:N,strategy:g}):C);return{top:(w.top-V.top+T.top)/_.y,bottom:(V.bottom-w.bottom+T.bottom)/_.y,left:(w.left-V.left+T.left)/_.x,right:(V.right-w.right+T.right)/_.x}}const N4=async(r,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:m}=l,f=u.filter(Boolean),g=await(m.isRTL==null?void 0:m.isRTL(a));let y=await m.getElementRects({reference:r,floating:a,strategy:c}),{x:p,y:v}=cx(y,o,g),E=o,P={},T=0;for(let j=0;j<f.length;j++){var b;const{name:w,fn:C}=f[j],{x:N,y:_,data:V,reset:U}=await C({x:p,y:v,initialPlacement:o,placement:E,strategy:c,middlewareData:P,rects:y,platform:{...m,detectOverflow:(b=m.detectOverflow)!=null?b:b4},elements:{reference:r,floating:a}});p=N??p,v=_??v,P={...P,[w]:{...P[w],...V}},U&&T<=50&&(T++,typeof U=="object"&&(U.placement&&(E=U.placement),U.rects&&(y=U.rects===!0?await m.getElementRects({reference:r,floating:a,strategy:c}):U.rects),{x:p,y:v}=cx(y,E,g)),j=-1)}return{x:p,y:v,placement:E,strategy:c,middlewareData:P}},w4=r=>({name:"arrow",options:r,async fn(a){const{x:l,y:o,placement:c,rects:u,platform:m,elements:f,middlewareData:g}=a,{element:y,padding:p=0}=Er(r,a)||{};if(y==null)return{};const v=P0(p),E={x:l,y:o},P=Lu(c),T=Du(P),b=await m.getDimensions(y),j=P==="y",w=j?"top":"left",C=j?"bottom":"right",N=j?"clientHeight":"clientWidth",_=u.reference[T]+u.reference[P]-E[P]-u.floating[T],V=E[P]-u.reference[P],U=await(m.getOffsetParent==null?void 0:m.getOffsetParent(y));let I=U?U[N]:0;(!I||!await(m.isElement==null?void 0:m.isElement(U)))&&(I=f.floating[N]||u.floating[T]);const k=_/2-V/2,R=I/2-b[T]/2-1,ee=hn(v[w],R),ne=hn(v[C],R),ie=ee,te=I-b[T]-ne,se=I/2-b[T]/2+k,H=su(ie,se,te),ae=!g.arrow&&$a(c)!=null&&se!==H&&u.reference[T]/2-(se<ie?ee:ne)-b[T]/2<0,ve=ae?se<ie?se-ie:se-te:0;return{[P]:E[P]+ve,data:{[P]:H,centerOffset:se-H-ve,...ae&&{alignmentOffset:ve}},reset:ae}}}),S4=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(a){var l,o;const{placement:c,middlewareData:u,rects:m,initialPlacement:f,platform:g,elements:y}=a,{mainAxis:p=!0,crossAxis:v=!0,fallbackPlacements:E,fallbackStrategy:P="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:b=!0,...j}=Er(r,a);if((l=u.arrow)!=null&&l.alignmentOffset)return{};const w=Pr(c),C=lr(f),N=Pr(f)===f,_=await(g.isRTL==null?void 0:g.isRTL(y.floating)),V=E||(N||!b?[fo(f)]:x4(f)),U=T!=="none";!E&&U&&V.push(...v4(f,b,T,_));const I=[f,...V],k=await g.detectOverflow(a,j),R=[];let ee=((o=u.flip)==null?void 0:o.overflows)||[];if(p&&R.push(k[w]),v){const se=f4(c,m,_);R.push(k[se[0]],k[se[1]])}if(ee=[...ee,{placement:c,overflows:R}],!R.every(se=>se<=0)){var ne,ie;const se=(((ne=u.flip)==null?void 0:ne.index)||0)+1,H=I[se];if(H&&(!(v==="alignment"?C!==lr(H):!1)||ee.every($=>lr($.placement)===C?$.overflows[0]>0:!0)))return{data:{index:se,overflows:ee},reset:{placement:H}};let ae=(ie=ee.filter(ve=>ve.overflows[0]<=0).sort((ve,$)=>ve.overflows[1]-$.overflows[1])[0])==null?void 0:ie.placement;if(!ae)switch(P){case"bestFit":{var te;const ve=(te=ee.filter($=>{if(U){const ce=lr($.placement);return ce===C||ce==="y"}return!0}).map($=>[$.placement,$.overflows.filter(ce=>ce>0).reduce((ce,K)=>ce+K,0)]).sort(($,ce)=>$[1]-ce[1])[0])==null?void 0:te[0];ve&&(ae=ve);break}case"initialPlacement":ae=f;break}if(c!==ae)return{reset:{placement:ae}}}return{}}}};function dx(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function ux(r){return d4.some(a=>r[a]>=0)}const C4=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...u}=Er(r,a);switch(c){case"referenceHidden":{const m=await o.detectOverflow(a,{...u,elementContext:"reference"}),f=dx(m,l.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:ux(f)}}}case"escaped":{const m=await o.detectOverflow(a,{...u,altBoundary:!0}),f=dx(m,l.floating);return{data:{escapedOffsets:f,escaped:ux(f)}}}default:return{}}}}},T0=new Set(["left","top"]);async function k4(r,a){const{placement:l,platform:o,elements:c}=r,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),m=Pr(l),f=$a(l),g=lr(l)==="y",y=T0.has(m)?-1:1,p=u&&g?-1:1,v=Er(a,r);let{mainAxis:E,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 f&&typeof T=="number"&&(P=f==="end"?T*-1:T),g?{x:P*p,y:E*y}:{x:E*y,y:P*p}}const E4=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,o;const{x:c,y:u,placement:m,middlewareData:f}=a,g=await k4(a,r);return m===((l=f.offset)==null?void 0:l.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:c+g.x,y:u+g.y,data:{...g,placement:m}}}}},P4=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:o,placement:c,platform:u}=a,{mainAxis:m=!0,crossAxis:f=!1,limiter:g={fn:w=>{let{x:C,y:N}=w;return{x:C,y:N}}},...y}=Er(r,a),p={x:l,y:o},v=await u.detectOverflow(a,y),E=lr(Pr(c)),P=Au(E);let T=p[P],b=p[E];if(m){const w=P==="y"?"top":"left",C=P==="y"?"bottom":"right",N=T+v[w],_=T-v[C];T=su(N,T,_)}if(f){const w=E==="y"?"top":"left",C=E==="y"?"bottom":"right",N=b+v[w],_=b-v[C];b=su(N,b,_)}const j=g.fn({...a,[P]:T,[E]:b});return{...j,data:{x:j.x-l,y:j.y-o,enabled:{[P]:m,[E]:f}}}}}},T4=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:o,placement:c,rects:u,middlewareData:m}=a,{offset:f=0,mainAxis:g=!0,crossAxis:y=!0}=Er(r,a),p={x:l,y:o},v=lr(c),E=Au(v);let P=p[E],T=p[v];const b=Er(f,a),j=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(g){const N=E==="y"?"height":"width",_=u.reference[E]-u.floating[N]+j.mainAxis,V=u.reference[E]+u.reference[N]-j.mainAxis;P<_?P=_:P>V&&(P=V)}if(y){var w,C;const N=E==="y"?"width":"height",_=T0.has(Pr(c)),V=u.reference[v]-u.floating[N]+(_&&((w=m.offset)==null?void 0:w[v])||0)+(_?0:j.crossAxis),U=u.reference[v]+u.reference[N]+(_?0:((C=m.offset)==null?void 0:C[v])||0)-(_?j.crossAxis:0);T<V?T=V:T>U&&(T=U)}return{[E]:P,[v]:T}}}},R4=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,o;const{placement:c,rects:u,platform:m,elements:f}=a,{apply:g=()=>{},...y}=Er(r,a),p=await m.detectOverflow(a,y),v=Pr(c),E=$a(c),P=lr(c)==="y",{width:T,height:b}=u.floating;let j,w;v==="top"||v==="bottom"?(j=v,w=E===(await(m.isRTL==null?void 0:m.isRTL(f.floating))?"start":"end")?"left":"right"):(w=v,j=E==="end"?"top":"bottom");const C=b-p.top-p.bottom,N=T-p.left-p.right,_=hn(b-p[j],C),V=hn(T-p[w],N),U=!a.middlewareData.shift;let I=_,k=V;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(k=N),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(I=C),U&&!E){const ee=ws(p.left,0),ne=ws(p.right,0),ie=ws(p.top,0),te=ws(p.bottom,0);P?k=T-2*(ee!==0||ne!==0?ee+ne:ws(p.left,p.right)):I=b-2*(ie!==0||te!==0?ie+te:ws(p.top,p.bottom))}await g({...a,availableWidth:k,availableHeight:I});const R=await m.getDimensions(f.floating);return T!==R.width||b!==R.height?{reset:{rects:!0}}:{}}}};function Po(){return typeof window<"u"}function Ba(r){return R0(r)?(r.nodeName||"").toLowerCase():"#document"}function Ss(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function cr(r){var a;return(a=(R0(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function R0(r){return Po()?r instanceof Node||r instanceof Ss(r).Node:!1}function Gs(r){return Po()?r instanceof Element||r instanceof Ss(r).Element:!1}function or(r){return Po()?r instanceof HTMLElement||r instanceof Ss(r).HTMLElement:!1}function hx(r){return!Po()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Ss(r).ShadowRoot}const I4=new Set(["inline","contents"]);function Fl(r){const{overflow:a,overflowX:l,overflowY:o,display:c}=Ys(r);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!I4.has(c)}const _4=new Set(["table","td","th"]);function M4(r){return _4.has(Ba(r))}const A4=[":popover-open",":modal"];function To(r){return A4.some(a=>{try{return r.matches(a)}catch{return!1}})}const D4=["transform","translate","scale","rotate","perspective"],L4=["transform","translate","scale","rotate","perspective","filter"],O4=["paint","layout","strict","content"];function Ou(r){const a=Fu(),l=Gs(r)?Ys(r):r;return D4.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)||L4.some(o=>(l.willChange||"").includes(o))||O4.some(o=>(l.contain||"").includes(o))}function F4(r){let a=mn(r);for(;or(a)&&!_a(a);){if(Ou(a))return a;if(To(a))return null;a=mn(a)}return null}function Fu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const z4=new Set(["html","body","#document"]);function _a(r){return z4.has(Ba(r))}function Ys(r){return Ss(r).getComputedStyle(r)}function Ro(r){return Gs(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function mn(r){if(Ba(r)==="html")return r;const a=r.assignedSlot||r.parentNode||hx(r)&&r.host||cr(r);return hx(a)?a.host:a}function I0(r){const a=mn(r);return _a(a)?r.ownerDocument?r.ownerDocument.body:r.body:or(a)&&Fl(a)?a:I0(a)}function Ml(r,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=I0(r),u=c===((o=r.ownerDocument)==null?void 0:o.body),m=Ss(c);if(u){const f=nu(m);return a.concat(m,m.visualViewport||[],Fl(c)?c:[],f&&l?Ml(f):[])}return a.concat(c,Ml(c,[],l))}function nu(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function _0(r){const a=Ys(r);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=or(r),u=c?r.offsetWidth:l,m=c?r.offsetHeight:o,f=mo(l)!==u||mo(o)!==m;return f&&(l=u,o=m),{width:l,height:o,$:f}}function zu(r){return Gs(r)?r:r.contextElement}function Ta(r){const a=zu(r);if(!or(a))return ir(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=_0(a);let m=(u?mo(l.width):l.width)/o,f=(u?mo(l.height):l.height)/c;return(!m||!Number.isFinite(m))&&(m=1),(!f||!Number.isFinite(f))&&(f=1),{x:m,y:f}}const $4=ir(0);function M0(r){const a=Ss(r);return!Fu()||!a.visualViewport?$4:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function B4(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==Ss(r)?!1:a}function $n(r,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),u=zu(r);let m=ir(1);a&&(o?Gs(o)&&(m=Ta(o)):m=Ta(r));const f=B4(u,l,o)?M0(u):ir(0);let g=(c.left+f.x)/m.x,y=(c.top+f.y)/m.y,p=c.width/m.x,v=c.height/m.y;if(u){const E=Ss(u),P=o&&Gs(o)?Ss(o):o;let T=E,b=nu(T);for(;b&&o&&P!==T;){const j=Ta(b),w=b.getBoundingClientRect(),C=Ys(b),N=w.left+(b.clientLeft+parseFloat(C.paddingLeft))*j.x,_=w.top+(b.clientTop+parseFloat(C.paddingTop))*j.y;g*=j.x,y*=j.y,p*=j.x,v*=j.y,g+=N,y+=_,T=Ss(b),b=nu(T)}}return xo({width:p,height:v,x:g,y})}function Io(r,a){const l=Ro(r).scrollLeft;return a?a.left+l:$n(cr(r)).left+l}function A0(r,a){const l=r.getBoundingClientRect(),o=l.left+a.scrollLeft-Io(r,l),c=l.top+a.scrollTop;return{x:o,y:c}}function U4(r){let{elements:a,rect:l,offsetParent:o,strategy:c}=r;const u=c==="fixed",m=cr(o),f=a?To(a.floating):!1;if(o===m||f&&u)return l;let g={scrollLeft:0,scrollTop:0},y=ir(1);const p=ir(0),v=or(o);if((v||!v&&!u)&&((Ba(o)!=="body"||Fl(m))&&(g=Ro(o)),or(o))){const P=$n(o);y=Ta(o),p.x=P.x+o.clientLeft,p.y=P.y+o.clientTop}const E=m&&!v&&!u?A0(m,g):ir(0);return{width:l.width*y.x,height:l.height*y.y,x:l.x*y.x-g.scrollLeft*y.x+p.x+E.x,y:l.y*y.y-g.scrollTop*y.y+p.y+E.y}}function V4(r){return Array.from(r.getClientRects())}function W4(r){const a=cr(r),l=Ro(r),o=r.ownerDocument.body,c=ws(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),u=ws(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let m=-l.scrollLeft+Io(r);const f=-l.scrollTop;return Ys(o).direction==="rtl"&&(m+=ws(a.clientWidth,o.clientWidth)-c),{width:c,height:u,x:m,y:f}}const mx=25;function H4(r,a){const l=Ss(r),o=cr(r),c=l.visualViewport;let u=o.clientWidth,m=o.clientHeight,f=0,g=0;if(c){u=c.width,m=c.height;const p=Fu();(!p||p&&a==="fixed")&&(f=c.offsetLeft,g=c.offsetTop)}const y=Io(o);if(y<=0){const p=o.ownerDocument,v=p.body,E=getComputedStyle(v),P=p.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,T=Math.abs(o.clientWidth-v.clientWidth-P);T<=mx&&(u-=T)}else y<=mx&&(u+=y);return{width:u,height:m,x:f,y:g}}const K4=new Set(["absolute","fixed"]);function G4(r,a){const l=$n(r,!0,a==="fixed"),o=l.top+r.clientTop,c=l.left+r.clientLeft,u=or(r)?Ta(r):ir(1),m=r.clientWidth*u.x,f=r.clientHeight*u.y,g=c*u.x,y=o*u.y;return{width:m,height:f,x:g,y}}function fx(r,a,l){let o;if(a==="viewport")o=H4(r,l);else if(a==="document")o=W4(cr(r));else if(Gs(a))o=G4(a,l);else{const c=M0(r);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return xo(o)}function D0(r,a){const l=mn(r);return l===a||!Gs(l)||_a(l)?!1:Ys(l).position==="fixed"||D0(l,a)}function Y4(r,a){const l=a.get(r);if(l)return l;let o=Ml(r,[],!1).filter(f=>Gs(f)&&Ba(f)!=="body"),c=null;const u=Ys(r).position==="fixed";let m=u?mn(r):r;for(;Gs(m)&&!_a(m);){const f=Ys(m),g=Ou(m);!g&&f.position==="fixed"&&(c=null),(u?!g&&!c:!g&&f.position==="static"&&!!c&&K4.has(c.position)||Fl(m)&&!g&&D0(r,m))?o=o.filter(p=>p!==m):c=f,m=mn(m)}return a.set(r,o),o}function Q4(r){let{element:a,boundary:l,rootBoundary:o,strategy:c}=r;const m=[...l==="clippingAncestors"?To(a)?[]:Y4(a,this._c):[].concat(l),o],f=m[0],g=m.reduce((y,p)=>{const v=fx(a,p,c);return y.top=ws(v.top,y.top),y.right=hn(v.right,y.right),y.bottom=hn(v.bottom,y.bottom),y.left=ws(v.left,y.left),y},fx(a,f,c));return{width:g.right-g.left,height:g.bottom-g.top,x:g.left,y:g.top}}function q4(r){const{width:a,height:l}=_0(r);return{width:a,height:l}}function X4(r,a,l){const o=or(a),c=cr(a),u=l==="fixed",m=$n(r,!0,u,a);let f={scrollLeft:0,scrollTop:0};const g=ir(0);function y(){g.x=Io(c)}if(o||!o&&!u)if((Ba(a)!=="body"||Fl(c))&&(f=Ro(a)),o){const P=$n(a,!0,u,a);g.x=P.x+a.clientLeft,g.y=P.y+a.clientTop}else c&&y();u&&!o&&c&&y();const p=c&&!o&&!u?A0(c,f):ir(0),v=m.left+f.scrollLeft-g.x-p.x,E=m.top+f.scrollTop-g.y-p.y;return{x:v,y:E,width:m.width,height:m.height}}function Ld(r){return Ys(r).position==="static"}function xx(r,a){if(!or(r)||Ys(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return cr(r)===l&&(l=l.ownerDocument.body),l}function L0(r,a){const l=Ss(r);if(To(r))return l;if(!or(r)){let c=mn(r);for(;c&&!_a(c);){if(Gs(c)&&!Ld(c))return c;c=mn(c)}return l}let o=xx(r,a);for(;o&&M4(o)&&Ld(o);)o=xx(o,a);return o&&_a(o)&&Ld(o)&&!Ou(o)?l:o||F4(r)||l}const J4=async function(r){const a=this.getOffsetParent||L0,l=this.getDimensions,o=await l(r.floating);return{reference:X4(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Z4(r){return Ys(r).direction==="rtl"}const eS={convertOffsetParentRelativeRectToViewportRelativeRect:U4,getDocumentElement:cr,getClippingRect:Q4,getOffsetParent:L0,getElementRects:J4,getClientRects:V4,getDimensions:q4,getScale:Ta,isElement:Gs,isRTL:Z4};function O0(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function tS(r,a){let l=null,o;const c=cr(r);function u(){var f;clearTimeout(o),(f=l)==null||f.disconnect(),l=null}function m(f,g){f===void 0&&(f=!1),g===void 0&&(g=1),u();const y=r.getBoundingClientRect(),{left:p,top:v,width:E,height:P}=y;if(f||a(),!E||!P)return;const T=eo(v),b=eo(c.clientWidth-(p+E)),j=eo(c.clientHeight-(v+P)),w=eo(p),N={rootMargin:-T+"px "+-b+"px "+-j+"px "+-w+"px",threshold:ws(0,hn(1,g))||1};let _=!0;function V(U){const I=U[0].intersectionRatio;if(I!==g){if(!_)return m();I?m(!1,I):o=setTimeout(()=>{m(!1,1e-7)},1e3)}I===1&&!O0(y,r.getBoundingClientRect())&&m(),_=!1}try{l=new IntersectionObserver(V,{...N,root:c.ownerDocument})}catch{l=new IntersectionObserver(V,N)}l.observe(r)}return m(!0),u}function sS(r,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,y=zu(r),p=c||u?[...y?Ml(y):[],...Ml(a)]:[];p.forEach(w=>{c&&w.addEventListener("scroll",l,{passive:!0}),u&&w.addEventListener("resize",l)});const v=y&&f?tS(y,l):null;let E=-1,P=null;m&&(P=new ResizeObserver(w=>{let[C]=w;C&&C.target===y&&P&&(P.unobserve(a),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var N;(N=P)==null||N.observe(a)})),l()}),y&&!g&&P.observe(y),P.observe(a));let T,b=g?$n(r):null;g&&j();function j(){const w=$n(r);b&&!O0(b,w)&&l(),b=w,T=requestAnimationFrame(j)}return l(),()=>{var w;p.forEach(C=>{c&&C.removeEventListener("scroll",l),u&&C.removeEventListener("resize",l)}),v==null||v(),(w=P)==null||w.disconnect(),P=null,g&&cancelAnimationFrame(T)}}const rS=E4,nS=P4,aS=S4,lS=R4,iS=C4,px=w4,oS=T4,cS=(r,a,l)=>{const o=new Map,c={platform:eS,...l},u={...c.platform,_c:o};return N4(r,a,{...c,platform:u})};var dS=typeof document<"u",uS=function(){},ro=dS?h.useLayoutEffect:uS;function po(r,a){if(r===a)return!0;if(typeof r!=typeof a)return!1;if(typeof r=="function"&&r.toString()===a.toString())return!0;let l,o,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!po(r[o],a[o]))return!1;return!0}if(c=Object.keys(r),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 u=c[o];if(!(u==="_owner"&&r.$$typeof)&&!po(r[u],a[u]))return!1}return!0}return r!==r&&a!==a}function F0(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function gx(r,a){const l=F0(r);return Math.round(a*l)/l}function Od(r){const a=h.useRef(r);return ro(()=>{a.current=r}),a}function hS(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:m}={},transform:f=!0,whileElementsMounted:g,open:y}=r,[p,v]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[E,P]=h.useState(o);po(E,o)||P(o);const[T,b]=h.useState(null),[j,w]=h.useState(null),C=h.useCallback($=>{$!==U.current&&(U.current=$,b($))},[]),N=h.useCallback($=>{$!==I.current&&(I.current=$,w($))},[]),_=u||T,V=m||j,U=h.useRef(null),I=h.useRef(null),k=h.useRef(p),R=g!=null,ee=Od(g),ne=Od(c),ie=Od(y),te=h.useCallback(()=>{if(!U.current||!I.current)return;const $={placement:a,strategy:l,middleware:E};ne.current&&($.platform=ne.current),cS(U.current,I.current,$).then(ce=>{const K={...ce,isPositioned:ie.current!==!1};se.current&&!po(k.current,K)&&(k.current=K,Al.flushSync(()=>{v(K)}))})},[E,a,l,ne,ie]);ro(()=>{y===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,v($=>({...$,isPositioned:!1})))},[y]);const se=h.useRef(!1);ro(()=>(se.current=!0,()=>{se.current=!1}),[]),ro(()=>{if(_&&(U.current=_),V&&(I.current=V),_&&V){if(ee.current)return ee.current(_,V,te);te()}},[_,V,te,ee,R]);const H=h.useMemo(()=>({reference:U,floating:I,setReference:C,setFloating:N}),[C,N]),ae=h.useMemo(()=>({reference:_,floating:V}),[_,V]),ve=h.useMemo(()=>{const $={position:l,left:0,top:0};if(!ae.floating)return $;const ce=gx(ae.floating,p.x),K=gx(ae.floating,p.y);return f?{...$,transform:"translate("+ce+"px, "+K+"px)",...F0(ae.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:ce,top:K}},[l,f,ae.floating,p.x,p.y]);return h.useMemo(()=>({...p,update:te,refs:H,elements:ae,floatingStyles:ve}),[p,te,H,ae,ve])}const mS=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:o,padding:c}=typeof r=="function"?r(l):r;return o&&a(o)?o.current!=null?px({element:o.current,padding:c}).fn(l):{}:o?px({element:o,padding:c}).fn(l):{}}}},fS=(r,a)=>({...rS(r),options:[r,a]}),xS=(r,a)=>({...nS(r),options:[r,a]}),pS=(r,a)=>({...oS(r),options:[r,a]}),gS=(r,a)=>({...aS(r),options:[r,a]}),yS=(r,a)=>({...lS(r),options:[r,a]}),vS=(r,a)=>({...iS(r),options:[r,a]}),jS=(r,a)=>({...mS(r),options:[r,a]});var bS="Arrow",z0=h.forwardRef((r,a)=>{const{children:l,width:o=10,height:c=5,...u}=r;return e.jsx(qe.svg,{...u,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});z0.displayName=bS;var NS=z0,$u="Popper",[$0,B0]=pn($u),[wS,U0]=$0($u),V0=r=>{const{__scopePopper:a,children:l}=r,[o,c]=h.useState(null);return e.jsx(wS,{scope:a,anchor:o,onAnchorChange:c,children:l})};V0.displayName=$u;var W0="PopperAnchor",H0=h.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:o,...c}=r,u=U0(W0,l),m=h.useRef(null),f=lt(a,m),g=h.useRef(null);return h.useEffect(()=>{const y=g.current;g.current=(o==null?void 0:o.current)||m.current,y!==g.current&&u.onAnchorChange(g.current)}),o?null:e.jsx(qe.div,{...c,ref:f})});H0.displayName=W0;var Bu="PopperContent",[SS,CS]=$0(Bu),K0=h.forwardRef((r,a)=>{var Y,pe,Ce,D,ue,ke;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:u="center",alignOffset:m=0,arrowPadding:f=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:p=0,sticky:v="partial",hideWhenDetached:E=!1,updatePositionStrategy:P="optimized",onPlaced:T,...b}=r,j=U0(Bu,l),[w,C]=h.useState(null),N=lt(a,Ie=>C(Ie)),[_,V]=h.useState(null),U=_u(_),I=(U==null?void 0:U.width)??0,k=(U==null?void 0:U.height)??0,R=o+(u!=="center"?"-"+u:""),ee=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},ne=Array.isArray(y)?y:[y],ie=ne.length>0,te={padding:ee,boundary:ne.filter(ES),altBoundary:ie},{refs:se,floatingStyles:H,placement:ae,isPositioned:ve,middlewareData:$}=hS({strategy:"fixed",placement:R,whileElementsMounted:(...Ie)=>sS(...Ie,{animationFrame:P==="always"}),elements:{reference:j.anchor},middleware:[fS({mainAxis:c+k,alignmentAxis:m}),g&&xS({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?pS():void 0,...te}),g&&gS({...te}),yS({...te,apply:({elements:Ie,rects:Ue,availableWidth:Ze,availableHeight:et})=>{const{width:tt,height:ge}=Ue.reference,fe=Ie.floating.style;fe.setProperty("--radix-popper-available-width",`${Ze}px`),fe.setProperty("--radix-popper-available-height",`${et}px`),fe.setProperty("--radix-popper-anchor-width",`${tt}px`),fe.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),_&&jS({element:_,padding:f}),PS({arrowWidth:I,arrowHeight:k}),E&&vS({strategy:"referenceHidden",...te})]}),[ce,K]=Q0(ae),A=un(T);ts(()=>{ve&&(A==null||A())},[ve,A]);const O=(Y=$.arrow)==null?void 0:Y.x,L=(pe=$.arrow)==null?void 0:pe.y,X=((Ce=$.arrow)==null?void 0:Ce.centerOffset)!==0,[G,de]=h.useState();return ts(()=>{w&&de(window.getComputedStyle(w).zIndex)},[w]),e.jsx("div",{ref:se.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ve?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(D=$.transformOrigin)==null?void 0:D.x,(ue=$.transformOrigin)==null?void 0:ue.y].join(" "),...((ke=$.hide)==null?void 0:ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:e.jsx(SS,{scope:l,placedSide:ce,onArrowChange:V,arrowX:O,arrowY:L,shouldHideArrow:X,children:e.jsx(qe.div,{"data-side":ce,"data-align":K,...b,ref:N,style:{...b.style,animation:ve?void 0:"none"}})})})});K0.displayName=Bu;var G0="PopperArrow",kS={top:"bottom",right:"left",bottom:"top",left:"right"},Y0=h.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,u=CS(G0,o),m=kS[u.placedSide];return e.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:e.jsx(NS,{...c,ref:l,style:{...c.style,display:"block"}})})});Y0.displayName=G0;function ES(r){return r!==null}var PS=r=>({name:"transformOrigin",options:r,fn(a){var j,w,C;const{placement:l,rects:o,middlewareData:c}=a,m=((j=c.arrow)==null?void 0:j.centerOffset)!==0,f=m?0:r.arrowWidth,g=m?0:r.arrowHeight,[y,p]=Q0(l),v={start:"0%",center:"50%",end:"100%"}[p],E=(((w=c.arrow)==null?void 0:w.x)??0)+f/2,P=(((C=c.arrow)==null?void 0:C.y)??0)+g/2;let T="",b="";return y==="bottom"?(T=m?v:`${E}px`,b=`${-g}px`):y==="top"?(T=m?v:`${E}px`,b=`${o.floating.height+g}px`):y==="right"?(T=`${-g}px`,b=m?v:`${P}px`):y==="left"&&(T=`${o.floating.width+g}px`,b=m?v:`${P}px`),{data:{x:T,y:b}}}});function Q0(r){const[a,l="center"]=r.split("-");return[a,l]}var TS=V0,RS=H0,IS=K0,_S=Y0,q0=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"}),MS="VisuallyHidden",AS=h.forwardRef((r,a)=>e.jsx(qe.span,{...r,ref:a,style:{...q0,...r.style}}));AS.displayName=MS;var DS=[" ","Enter","ArrowUp","ArrowDown"],LS=[" ","Enter"],Bn="Select",[_o,Mo,OS]=Tu(Bn),[Ua]=pn(Bn,[OS,B0]),Ao=B0(),[FS,gn]=Ua(Bn),[zS,$S]=Ua(Bn),X0=r=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:u,value:m,defaultValue:f,onValueChange:g,dir:y,name:p,autoComplete:v,disabled:E,required:P,form:T}=r,b=Ao(a),[j,w]=h.useState(null),[C,N]=h.useState(null),[_,V]=h.useState(!1),U=So(y),[I,k]=Fn({prop:o,defaultProp:c??!1,onChange:u,caller:Bn}),[R,ee]=Fn({prop:m,defaultProp:f,onChange:g,caller:Bn}),ne=h.useRef(null),ie=j?T||!!j.closest("form"):!0,[te,se]=h.useState(new Set),H=Array.from(te).map(ae=>ae.props.value).join(";");return e.jsx(TS,{...b,children:e.jsxs(FS,{required:P,scope:a,trigger:j,onTriggerChange:w,valueNode:C,onValueNodeChange:N,valueNodeHasChildren:_,onValueNodeHasChildrenChange:V,contentId:cn(),value:R,onValueChange:ee,open:I,onOpenChange:k,dir:U,triggerPointerDownPosRef:ne,disabled:E,children:[e.jsx(_o.Provider,{scope:a,children:e.jsx(zS,{scope:r.__scopeSelect,onNativeOptionAdd:h.useCallback(ae=>{se(ve=>new Set(ve).add(ae))},[]),onNativeOptionRemove:h.useCallback(ae=>{se(ve=>{const $=new Set(ve);return $.delete(ae),$})},[]),children:l})}),ie?e.jsxs(vg,{"aria-hidden":!0,required:P,tabIndex:-1,name:p,autoComplete:v,value:R,onChange:ae=>ee(ae.target.value),disabled:E,form:T,children:[R===void 0?e.jsx("option",{value:""}):null,Array.from(te)]},H):null]})})};X0.displayName=Bn;var J0="SelectTrigger",Z0=h.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=r,u=Ao(l),m=gn(J0,l),f=m.disabled||o,g=lt(a,m.onTriggerChange),y=Mo(l),p=h.useRef("touch"),[v,E,P]=bg(b=>{const j=y().filter(N=>!N.disabled),w=j.find(N=>N.value===m.value),C=Ng(j,b,w);C!==void 0&&m.onValueChange(C.value)}),T=b=>{f||(m.onOpenChange(!0),P()),b&&(m.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return e.jsx(RS,{asChild:!0,...u,children:e.jsx(qe.button,{type:"button",role:"combobox","aria-controls":m.contentId,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":jg(m.value)?"":void 0,...c,ref:g,onClick:Ye(c.onClick,b=>{b.currentTarget.focus(),p.current!=="mouse"&&T(b)}),onPointerDown:Ye(c.onPointerDown,b=>{p.current=b.pointerType;const j=b.target;j.hasPointerCapture(b.pointerId)&&j.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(T(b),b.preventDefault())}),onKeyDown:Ye(c.onKeyDown,b=>{const j=v.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&E(b.key),!(j&&b.key===" ")&&DS.includes(b.key)&&(T(),b.preventDefault())})})})});Z0.displayName=J0;var eg="SelectValue",tg=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,children:u,placeholder:m="",...f}=r,g=gn(eg,l),{onValueNodeHasChildrenChange:y}=g,p=u!==void 0,v=lt(a,g.onValueNodeChange);return ts(()=>{y(p)},[y,p]),e.jsx(qe.span,{...f,ref:v,style:{pointerEvents:"none"},children:jg(g.value)?e.jsx(e.Fragment,{children:m}):u})});tg.displayName=eg;var BS="SelectIcon",sg=h.forwardRef((r,a)=>{const{__scopeSelect:l,children:o,...c}=r;return e.jsx(qe.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});sg.displayName=BS;var US="SelectPortal",rg=r=>e.jsx(wu,{asChild:!0,...r});rg.displayName=US;var Un="SelectContent",ng=h.forwardRef((r,a)=>{const l=gn(Un,r.__scopeSelect),[o,c]=h.useState();if(ts(()=>{c(new DocumentFragment)},[]),!l.open){const u=o;return u?Al.createPortal(e.jsx(ag,{scope:r.__scopeSelect,children:e.jsx(_o.Slot,{scope:r.__scopeSelect,children:e.jsx("div",{children:r.children})})}),u):null}return e.jsx(lg,{...r,ref:a})});ng.displayName=Un;var Ws=10,[ag,yn]=Ua(Un),VS="SelectContentImpl",WS=_l("SelectContent.RemoveScroll"),lg=h.forwardRef((r,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:u,onPointerDownOutside:m,side:f,sideOffset:g,align:y,alignOffset:p,arrowPadding:v,collisionBoundary:E,collisionPadding:P,sticky:T,hideWhenDetached:b,avoidCollisions:j,...w}=r,C=gn(Un,l),[N,_]=h.useState(null),[V,U]=h.useState(null),I=lt(a,Y=>_(Y)),[k,R]=h.useState(null),[ee,ne]=h.useState(null),ie=Mo(l),[te,se]=h.useState(!1),H=h.useRef(!1);h.useEffect(()=>{if(N)return wp(N)},[N]),fp();const ae=h.useCallback(Y=>{const[pe,...Ce]=ie().map(ke=>ke.ref.current),[D]=Ce.slice(-1),ue=document.activeElement;for(const ke of Y)if(ke===ue||(ke==null||ke.scrollIntoView({block:"nearest"}),ke===pe&&V&&(V.scrollTop=0),ke===D&&V&&(V.scrollTop=V.scrollHeight),ke==null||ke.focus(),document.activeElement!==ue))return},[ie,V]),ve=h.useCallback(()=>ae([k,N]),[ae,k,N]);h.useEffect(()=>{te&&ve()},[te,ve]);const{onOpenChange:$,triggerPointerDownPosRef:ce}=C;h.useEffect(()=>{if(N){let Y={x:0,y:0};const pe=D=>{var ue,ke;Y={x:Math.abs(Math.round(D.pageX)-(((ue=ce.current)==null?void 0:ue.x)??0)),y:Math.abs(Math.round(D.pageY)-(((ke=ce.current)==null?void 0:ke.y)??0))}},Ce=D=>{Y.x<=10&&Y.y<=10?D.preventDefault():N.contains(D.target)||$(!1),document.removeEventListener("pointermove",pe),ce.current=null};return ce.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[N,$,ce]),h.useEffect(()=>{const Y=()=>$(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[$]);const[K,A]=bg(Y=>{const pe=ie().filter(ue=>!ue.disabled),Ce=pe.find(ue=>ue.ref.current===document.activeElement),D=Ng(pe,Y,Ce);D&&setTimeout(()=>D.ref.current.focus())}),O=h.useCallback((Y,pe,Ce)=>{const D=!H.current&&!Ce;(C.value!==void 0&&C.value===pe||D)&&(R(Y),D&&(H.current=!0))},[C.value]),L=h.useCallback(()=>N==null?void 0:N.focus(),[N]),X=h.useCallback((Y,pe,Ce)=>{const D=!H.current&&!Ce;(C.value!==void 0&&C.value===pe||D)&&ne(Y)},[C.value]),G=o==="popper"?au:ig,de=G===au?{side:f,sideOffset:g,align:y,alignOffset:p,arrowPadding:v,collisionBoundary:E,collisionPadding:P,sticky:T,hideWhenDetached:b,avoidCollisions:j}:{};return e.jsx(ag,{scope:l,content:N,viewport:V,onViewportChange:U,itemRefCallback:O,selectedItem:k,onItemLeave:L,itemTextRefCallback:X,focusSelectedItem:ve,selectedItemText:ee,position:o,isPositioned:te,searchRef:K,children:e.jsx(Su,{as:WS,allowPinchZoom:!0,children:e.jsx(Nu,{asChild:!0,trapped:C.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Ye(c,Y=>{var pe;(pe=C.trigger)==null||pe.focus({preventScroll:!0}),Y.preventDefault()}),children:e.jsx(bu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:e.jsx(G,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:Y=>Y.preventDefault(),...w,...de,onPlaced:()=>se(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Ye(w.onKeyDown,Y=>{const pe=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!pe&&Y.key.length===1&&A(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let D=ie().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const ue=Y.target,ke=D.indexOf(ue);D=D.slice(ke+1)}setTimeout(()=>ae(D)),Y.preventDefault()}})})})})})})});lg.displayName=VS;var HS="SelectItemAlignedPosition",ig=h.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=r,u=gn(Un,l),m=yn(Un,l),[f,g]=h.useState(null),[y,p]=h.useState(null),v=lt(a,I=>p(I)),E=Mo(l),P=h.useRef(!1),T=h.useRef(!0),{viewport:b,selectedItem:j,selectedItemText:w,focusSelectedItem:C}=m,N=h.useCallback(()=>{if(u.trigger&&u.valueNode&&f&&y&&b&&j&&w){const I=u.trigger.getBoundingClientRect(),k=y.getBoundingClientRect(),R=u.valueNode.getBoundingClientRect(),ee=w.getBoundingClientRect();if(u.dir!=="rtl"){const ue=ee.left-k.left,ke=R.left-ue,Ie=I.left-ke,Ue=I.width+Ie,Ze=Math.max(Ue,k.width),et=window.innerWidth-Ws,tt=ho(ke,[Ws,Math.max(Ws,et-Ze)]);f.style.minWidth=Ue+"px",f.style.left=tt+"px"}else{const ue=k.right-ee.right,ke=window.innerWidth-R.right-ue,Ie=window.innerWidth-I.right-ke,Ue=I.width+Ie,Ze=Math.max(Ue,k.width),et=window.innerWidth-Ws,tt=ho(ke,[Ws,Math.max(Ws,et-Ze)]);f.style.minWidth=Ue+"px",f.style.right=tt+"px"}const ne=E(),ie=window.innerHeight-Ws*2,te=b.scrollHeight,se=window.getComputedStyle(y),H=parseInt(se.borderTopWidth,10),ae=parseInt(se.paddingTop,10),ve=parseInt(se.borderBottomWidth,10),$=parseInt(se.paddingBottom,10),ce=H+ae+te+$+ve,K=Math.min(j.offsetHeight*5,ce),A=window.getComputedStyle(b),O=parseInt(A.paddingTop,10),L=parseInt(A.paddingBottom,10),X=I.top+I.height/2-Ws,G=ie-X,de=j.offsetHeight/2,Y=j.offsetTop+de,pe=H+ae+Y,Ce=ce-pe;if(pe<=X){const ue=ne.length>0&&j===ne[ne.length-1].ref.current;f.style.bottom="0px";const ke=y.clientHeight-b.offsetTop-b.offsetHeight,Ie=Math.max(G,de+(ue?L:0)+ke+ve),Ue=pe+Ie;f.style.height=Ue+"px"}else{const ue=ne.length>0&&j===ne[0].ref.current;f.style.top="0px";const Ie=Math.max(X,H+b.offsetTop+(ue?O:0)+de)+Ce;f.style.height=Ie+"px",b.scrollTop=pe-X+b.offsetTop}f.style.margin=`${Ws}px 0`,f.style.minHeight=K+"px",f.style.maxHeight=ie+"px",o==null||o(),requestAnimationFrame(()=>P.current=!0)}},[E,u.trigger,u.valueNode,f,y,b,j,w,u.dir,o]);ts(()=>N(),[N]);const[_,V]=h.useState();ts(()=>{y&&V(window.getComputedStyle(y).zIndex)},[y]);const U=h.useCallback(I=>{I&&T.current===!0&&(N(),C==null||C(),T.current=!1)},[N,C]);return e.jsx(GS,{scope:l,contentWrapper:f,shouldExpandOnScrollRef:P,onScrollButtonChange:U,children:e.jsx("div",{ref:g,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:e.jsx(qe.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});ig.displayName=HS;var KS="SelectPopperPosition",au=h.forwardRef((r,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=Ws,...u}=r,m=Ao(l);return e.jsx(IS,{...m,...u,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...u.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)"}})});au.displayName=KS;var[GS,Uu]=Ua(Un,{}),lu="SelectViewport",og=h.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:o,...c}=r,u=yn(lu,l),m=Uu(lu,l),f=lt(a,u.onViewportChange),g=h.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(_o.Slot,{scope:l,children:e.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Ye(c.onScroll,y=>{const p=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:E}=m;if(E!=null&&E.current&&v){const P=Math.abs(g.current-p.scrollTop);if(P>0){const T=window.innerHeight-Ws*2,b=parseFloat(v.style.minHeight),j=parseFloat(v.style.height),w=Math.max(b,j);if(w<T){const C=w+P,N=Math.min(T,C),_=C-N;v.style.height=N+"px",v.style.bottom==="0px"&&(p.scrollTop=_>0?_:0,v.style.justifyContent="flex-end")}}}g.current=p.scrollTop})})})]})});og.displayName=lu;var cg="SelectGroup",[YS,QS]=Ua(cg),qS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=cn();return e.jsx(YS,{scope:l,id:c,children:e.jsx(qe.div,{role:"group","aria-labelledby":c,...o,ref:a})})});qS.displayName=cg;var dg="SelectLabel",XS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=QS(dg,l);return e.jsx(qe.div,{id:c.id,...o,ref:a})});XS.displayName=dg;var go="SelectItem",[JS,ug]=Ua(go),hg=h.forwardRef((r,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:u,...m}=r,f=gn(go,l),g=yn(go,l),y=f.value===o,[p,v]=h.useState(u??""),[E,P]=h.useState(!1),T=lt(a,C=>{var N;return(N=g.itemRefCallback)==null?void 0:N.call(g,C,o,c)}),b=cn(),j=h.useRef("touch"),w=()=>{c||(f.onValueChange(o),f.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(JS,{scope:l,value:o,disabled:c,textId:b,isSelected:y,onItemTextChange:h.useCallback(C=>{v(N=>N||((C==null?void 0:C.textContent)??"").trim())},[]),children:e.jsx(_o.ItemSlot,{scope:l,value:o,disabled:c,textValue:p,children:e.jsx(qe.div,{role:"option","aria-labelledby":b,"data-highlighted":E?"":void 0,"aria-selected":y&&E,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...m,ref:T,onFocus:Ye(m.onFocus,()=>P(!0)),onBlur:Ye(m.onBlur,()=>P(!1)),onClick:Ye(m.onClick,()=>{j.current!=="mouse"&&w()}),onPointerUp:Ye(m.onPointerUp,()=>{j.current==="mouse"&&w()}),onPointerDown:Ye(m.onPointerDown,C=>{j.current=C.pointerType}),onPointerMove:Ye(m.onPointerMove,C=>{var N;j.current=C.pointerType,c?(N=g.onItemLeave)==null||N.call(g):j.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ye(m.onPointerLeave,C=>{var N;C.currentTarget===document.activeElement&&((N=g.onItemLeave)==null||N.call(g))}),onKeyDown:Ye(m.onKeyDown,C=>{var _;((_=g.searchRef)==null?void 0:_.current)!==""&&C.key===" "||(LS.includes(C.key)&&w(),C.key===" "&&C.preventDefault())})})})})});hg.displayName=go;var kl="SelectItemText",mg=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,...u}=r,m=gn(kl,l),f=yn(kl,l),g=ug(kl,l),y=$S(kl,l),[p,v]=h.useState(null),E=lt(a,w=>v(w),g.onItemTextChange,w=>{var C;return(C=f.itemTextRefCallback)==null?void 0:C.call(f,w,g.value,g.disabled)}),P=p==null?void 0:p.textContent,T=h.useMemo(()=>e.jsx("option",{value:g.value,disabled:g.disabled,children:P},g.value),[g.disabled,g.value,P]),{onNativeOptionAdd:b,onNativeOptionRemove:j}=y;return ts(()=>(b(T),()=>j(T)),[b,j,T]),e.jsxs(e.Fragment,{children:[e.jsx(qe.span,{id:g.textId,...u,ref:E}),g.isSelected&&m.valueNode&&!m.valueNodeHasChildren?Al.createPortal(u.children,m.valueNode):null]})});mg.displayName=kl;var fg="SelectItemIndicator",xg=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return ug(fg,l).isSelected?e.jsx(qe.span,{"aria-hidden":!0,...o,ref:a}):null});xg.displayName=fg;var iu="SelectScrollUpButton",pg=h.forwardRef((r,a)=>{const l=yn(iu,r.__scopeSelect),o=Uu(iu,r.__scopeSelect),[c,u]=h.useState(!1),m=lt(a,o.onScrollButtonChange);return ts(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=g.scrollTop>0;u(y)};const g=l.viewport;return f(),g.addEventListener("scroll",f),()=>g.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(yg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:g}=l;f&&g&&(f.scrollTop=f.scrollTop-g.offsetHeight)}}):null});pg.displayName=iu;var ou="SelectScrollDownButton",gg=h.forwardRef((r,a)=>{const l=yn(ou,r.__scopeSelect),o=Uu(ou,r.__scopeSelect),[c,u]=h.useState(!1),m=lt(a,o.onScrollButtonChange);return ts(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=g.scrollHeight-g.clientHeight,p=Math.ceil(g.scrollTop)<y;u(p)};const g=l.viewport;return f(),g.addEventListener("scroll",f),()=>g.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(yg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:g}=l;f&&g&&(f.scrollTop=f.scrollTop+g.offsetHeight)}}):null});gg.displayName=ou;var yg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=r,u=yn("SelectScrollButton",l),m=h.useRef(null),f=Mo(l),g=h.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return h.useEffect(()=>()=>g(),[g]),ts(()=>{var p;const y=f().find(v=>v.ref.current===document.activeElement);(p=y==null?void 0:y.ref.current)==null||p.scrollIntoView({block:"nearest"})},[f]),e.jsx(qe.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Ye(c.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(o,50))}),onPointerMove:Ye(c.onPointerMove,()=>{var y;(y=u.onItemLeave)==null||y.call(u),m.current===null&&(m.current=window.setInterval(o,50))}),onPointerLeave:Ye(c.onPointerLeave,()=>{g()})})}),ZS="SelectSeparator",eC=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return e.jsx(qe.div,{"aria-hidden":!0,...o,ref:a})});eC.displayName=ZS;var cu="SelectArrow",tC=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=Ao(l),u=gn(cu,l),m=yn(cu,l);return u.open&&m.position==="popper"?e.jsx(_S,{...c,...o,ref:a}):null});tC.displayName=cu;var sC="SelectBubbleInput",vg=h.forwardRef(({__scopeSelect:r,value:a,...l},o)=>{const c=h.useRef(null),u=lt(o,c),m=Iu(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const g=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(g,"value").set;if(m!==a&&p){const v=new Event("change",{bubbles:!0});p.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(qe.select,{...l,style:{...q0,...l.style},ref:u,defaultValue:a})});vg.displayName=sC;function jg(r){return r===""||r===void 0}function bg(r){const a=un(r),l=h.useRef(""),o=h.useRef(0),c=h.useCallback(m=>{const f=l.current+m;a(f),(function g(y){l.current=y,window.clearTimeout(o.current),y!==""&&(o.current=window.setTimeout(()=>g(""),1e3))})(f)},[a]),u=h.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,u]}function Ng(r,a,l){const c=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a,u=l?r.indexOf(l):-1;let m=rC(r,Math.max(u,0));c.length===1&&(m=m.filter(y=>y!==l));const g=m.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==l?g:void 0}function rC(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var nC=X0,wg=Z0,aC=tg,lC=sg,iC=rg,Sg=ng,oC=og,Cg=hg,cC=mg,dC=xg,uC=pg,hC=gg;const Sl=nC,Cl=aC,Na=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(wg,{ref:o,className:it("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",r),...l,children:[a,e.jsx(lC,{asChild:!0,children:e.jsx(Tl,{className:"h-4 w-4 opacity-50"})})]}));Na.displayName=wg.displayName;const wa=h.forwardRef(({className:r,children:a,position:l="popper",...o},c)=>e.jsx(iC,{children:e.jsxs(Sg,{ref:c,className:it("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",r),position:l,...o,children:[e.jsx(uC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(zx,{className:"h-4 w-4"})}),e.jsx(oC,{className:"p-1",children:a}),e.jsx(hC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Tl,{className:"h-4 w-4"})})]})}));wa.displayName=Sg.displayName;const nr=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(Cg,{ref:o,className:it("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",r),...l,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(dC,{children:e.jsx(jo,{className:"h-4 w-4"})})}),e.jsx(cC,{children:a})]}));nr.displayName=Cg.displayName;const mC=["一","二","三","四","五","六","七","八","九","十"];function Fd(r){return r.startsWith("part:")?{type:"part",id:r.slice(5)}:r.startsWith("chapter:")?{type:"chapter",id:r.slice(8)}:r.startsWith("section:")?{type:"section",id:r.slice(8)}:null}function fC({parts:r,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:u,onAddSectionInPart:m,onAddChapterInPart:f,onDeleteChapter:g,onEditPart:y,onDeletePart:p,onEditChapter:v,selectedSectionIds:E=[],onToggleSectionSelect:P,onShowSectionOrders:T}){const[b,j]=h.useState(null),[w,C]=h.useState(null),N=(R,ee)=>(b==null?void 0:b.type)===R&&(b==null?void 0:b.id)===ee,_=(R,ee)=>(w==null?void 0:w.type)===R&&(w==null?void 0:w.id)===ee,V=h.useCallback(()=>{const R=[];for(const ee of r)for(const ne of ee.chapters)for(const ie of ne.sections)R.push({id:ie.id,partId:ee.id,partTitle:ee.title,chapterId:ne.id,chapterTitle:ne.title});return R},[r]),U=h.useCallback(async(R,ee,ne,ie)=>{var ve;R.preventDefault(),R.stopPropagation();const te=R.dataTransfer.getData("text/plain"),se=Fd(te);if(!se||se.type===ee&&se.id===ne)return;const H=V(),ae=new Map(H.map($=>[$.id,$]));if(se.type==="part"&&ee==="part"){const $=r.map(L=>L.id),ce=$.indexOf(se.id),K=$.indexOf(ne);if(ce===-1||K===-1)return;const A=[...$];A.splice(ce,1),A.splice(ce<K?K-1:K,0,se.id);const O=[];for(const L of A){const X=r.find(G=>G.id===L);if(X)for(const G of X.chapters)for(const de of G.sections){const Y=ae.get(de.id);Y&&O.push(Y)}}await o(O);return}if(se.type==="chapter"&&(ee==="chapter"||ee==="section"||ee==="part")){const $=r.find(Y=>Y.chapters.some(pe=>pe.id===se.id)),ce=$==null?void 0:$.chapters.find(Y=>Y.id===se.id);if(!$||!ce)return;let K,A,O=null;if(ee==="section"){const Y=ae.get(ne);if(!Y)return;K=Y.partId,A=Y.partTitle,O=ne}else if(ee==="chapter"){const Y=r.find(D=>D.chapters.some(ue=>ue.id===ne)),pe=Y==null?void 0:Y.chapters.find(D=>D.id===ne);if(!Y||!pe)return;K=Y.id,A=Y.title;const Ce=H.filter(D=>D.chapterId===ne).pop();O=(Ce==null?void 0:Ce.id)??null}else{const Y=r.find(Ce=>Ce.id===ne);if(!Y||!Y.chapters[0])return;K=Y.id,A=Y.title;const pe=H.filter(Ce=>Ce.partId===Y.id&&Ce.chapterId===Y.chapters[0].id);O=((ve=pe[pe.length-1])==null?void 0:ve.id)??null}const L=ce.sections.map(Y=>Y.id),X=H.filter(Y=>!L.includes(Y.id));let G=X.length;if(O){const Y=X.findIndex(pe=>pe.id===O);Y>=0&&(G=Y+1)}const de=L.map(Y=>({...ae.get(Y),partId:K,partTitle:A,chapterId:ce.id,chapterTitle:ce.title}));await o([...X.slice(0,G),...de,...X.slice(G)]);return}if(se.type==="section"&&(ee==="section"||ee==="chapter"||ee==="part")){if(!ie)return;const{partId:$,partTitle:ce,chapterId:K,chapterTitle:A}=ie;let O;if(ee==="section")O=H.findIndex(pe=>pe.id===ne);else if(ee==="chapter"){const pe=H.filter(Ce=>Ce.chapterId===ne).pop();O=pe?H.findIndex(Ce=>Ce.id===pe.id)+1:H.length}else{const pe=r.find(ue=>ue.id===ne);if(!(pe!=null&&pe.chapters[0]))return;const Ce=H.filter(ue=>ue.partId===pe.id&&ue.chapterId===pe.chapters[0].id),D=Ce[Ce.length-1];O=D?H.findIndex(ue=>ue.id===D.id)+1:0}const L=H.findIndex(pe=>pe.id===se.id);if(L===-1)return;const X=H.filter(pe=>pe.id!==se.id),G=L<O?O-1:O,Y={...H[L],partId:$,partTitle:ce,chapterId:K,chapterTitle:A};X.splice(G,0,Y),await o(X)}},[r,V,o]),I=(R,ee,ne)=>({onDragEnter:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",C({type:R,id:ee})},onDragOver:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",C({type:R,id:ee})},onDragLeave:()=>C(null),onDrop:ie=>{C(null);const te=Fd(ie.dataTransfer.getData("text/plain"));if(te&&!(R==="section"&&te.type==="section"&&te.id===ee))if(R==="part")if(te.type==="part")U(ie,"part",ee);else{const se=r.find(ae=>ae.id===ee);(se==null?void 0:se.chapters[0])&&ne&&U(ie,"part",ee,ne)}else R==="chapter"&&ne?(te.type==="section"||te.type==="chapter")&&U(ie,"chapter",ee,ne):R==="section"&&ne&&U(ie,"section",ee,ne)}}),k=R=>mC[R]??String(R+1);return e.jsx("div",{className:"space-y-3",children:r.map((R,ee)=>{var ce,K,A,O;const ne=R.title==="序言"||R.title.includes("序言"),ie=R.title==="尾声"||R.title.includes("尾声"),te=R.title==="附录"||R.title.includes("附录"),se=_("part",R.id),H=a.includes(R.id),ae=R.chapters.length,ve=R.chapters.reduce((L,X)=>L+X.sections.length,0);if(ne&&R.chapters.length===1&&R.chapters[0].sections.length===1){const L=R.chapters[0].sections[0],X=_("section",L.id),G={partId:R.id,partTitle:R.title,chapterId:R.chapters[0].id,chapterTitle:R.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+L.id),de.dataTransfer.effectAllowed="move",j({type:"section",id:L.id})},onDragEnd:()=>{j(null),C(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":""} ${N("section",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...I("section",L.id,G),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(Nr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:de=>de.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:E.includes(L.id),onChange:()=>P(L.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(Ks,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[R.chapters[0].title," | ",L.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[L.price===0||L.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:["¥",L.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",L.clickCount??0," · 付款 ",L.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(L.hotScore??0).toFixed(1)," · 第",L.hotRank&&L.hotRank>0?L.hotRank:"-","名"]}),T&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(L),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(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(L),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]}),e.jsx(en,{className:"w-4 h-4 text-gray-500"})]})]},R.id)}if(R.title==="2026每日派对干货"||R.title.includes("2026每日派对干货")){const L=_("part",R.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${L?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,...I("part",R.id,{partId:R.id,partTitle:R.title,chapterId:((ce=R.chapters[0])==null?void 0:ce.id)??"",chapterTitle:((K=R.chapters[0])==null?void 0:K.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","part:"+R.id),X.dataTransfer.effectAllowed="move",j({type:"part",id:R.id})},onDragEnd:()=>{j(null),C(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${N("part",R.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/50"}`,onClick:()=>l(R.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(Nr,{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:R.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ve," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:X=>X.stopPropagation(),onClick:X=>X.stopPropagation(),children:[m&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(R),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(R),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>p(R),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ae,"章"]}),H?e.jsx(Tl,{className:"w-5 h-5 text-gray-500"}):e.jsx(en,{className:"w-5 h-5 text-gray-500"})]})]}),H&&R.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:R.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:G=>G.stopPropagation(),children:[v&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>v(R,X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),f&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>f(R),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>g(R,X),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:X.sections.map(G=>{const de=_("section",G.id);return e.jsxs("div",{draggable:!0,onDragStart:Y=>{Y.stopPropagation(),Y.dataTransfer.setData("text/plain","section:"+G.id),Y.dataTransfer.effectAllowed="move",j({type:"section",id:G.id})},onDragEnd:()=>{j(null),C(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 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${N("section",G.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...I("section",G.id,{partId:R.id,partTitle:R.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(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:Y=>Y.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:E.includes(G.id),onChange:()=>P(G.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:[G.id," ",G.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",G.clickCount??0," · 付款 ",G.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(G.hotScore??0).toFixed(1)," · 第",G.hotRank&&G.hotRank>0?G.hotRank:"-","名"]}),T&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(G),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(G),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(G),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(G),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]},G.id)})})]},X.id))})]},R.id)}if(te)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:R.chapters.map((L,X)=>L.sections.length>0?L.sections.map(G=>{const de=_("section",G.id);return e.jsxs("div",{draggable:!0,onDragStart:Y=>{Y.stopPropagation(),Y.dataTransfer.setData("text/plain","section:"+G.id),Y.dataTransfer.effectAllowed="move",j({type:"section",id:G.id})},onDragEnd:()=>{j(null),C(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 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${N("section",G.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...I("section",G.id,{partId:R.id,partTitle:R.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:Y=>Y.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:E.includes(G.id),onChange:()=>P(G.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," | ",L.title," | ",G.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",G.clickCount??0," · 付款 ",G.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(G.hotScore??0).toFixed(1)," · 第",G.hotRank&&G.hotRank>0?G.hotRank:"-","名"]}),T&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(G),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(q,{variant:"ghost",size:"sm",onClick:()=>c(G),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>c(G),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>u(G),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(en,{className:"w-4 h-4 text-gray-500 shrink-0"})]},G.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," | ",L.title,"(空)"]}),e.jsx(en,{className:"w-4 h-4 text-gray-500 shrink-0"})]},L.id))})]},R.id);if(ie&&R.chapters.length===1&&R.chapters[0].sections.length===1){const L=R.chapters[0].sections[0],X=_("section",L.id),G={partId:R.id,partTitle:R.title,chapterId:R.chapters[0].id,chapterTitle:R.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+L.id),de.dataTransfer.effectAllowed="move",j({type:"section",id:L.id})},onDragEnd:()=>{j(null),C(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":""} ${N("section",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...I("section",L.id,G),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(Nr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:de=>de.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:E.includes(L.id),onChange:()=>P(L.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(Ks,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[R.chapters[0].title," | ",L.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[L.price===0||L.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:["¥",L.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",L.clickCount??0," · 付款 ",L.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(L.hotScore??0).toFixed(1)," · 第",L.hotRank&&L.hotRank>0?L.hotRank:"-","名"]}),T&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(L),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(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(L),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]}),e.jsx(en,{className:"w-4 h-4 text-gray-500"})]})]},R.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:R.chapters.map(L=>L.sections.map(X=>{const G=_("section",X.id);return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+X.id),de.dataTransfer.effectAllowed="move",j({type:"section",id:X.id})},onDragEnd:()=>{j(null),C(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 ${G?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${N("section",X.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...I("section",X.id,{partId:R.id,partTitle:R.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:de=>de.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:E.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:[L.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(q,{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(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(X),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]})]},X.id)}))})]},R.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${se?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...I("part",R.id,{partId:R.id,partTitle:R.title,chapterId:((A=R.chapters[0])==null?void 0:A.id)??"",chapterTitle:((O=R.chapters[0])==null?void 0:O.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:L=>{L.stopPropagation(),L.dataTransfer.setData("text/plain","part:"+R.id),L.dataTransfer.effectAllowed="move",j({type:"part",id:R.id})},onDragEnd:()=>{j(null),C(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${N("part",R.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(R.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(Nr,{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:k(ee)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:R.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ve," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:L=>L.stopPropagation(),onClick:L=>L.stopPropagation(),children:[m&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(R),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(R),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>p(R),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ae,"章"]}),H?e.jsx(Tl,{className:"w-5 h-5 text-gray-500"}):e.jsx(en,{className:"w-5 h-5 text-gray-500"})]})]}),H&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:R.chapters.map(L=>{const X=_("chapter",L.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:G=>{G.stopPropagation(),G.dataTransfer.setData("text/plain","chapter:"+L.id),G.dataTransfer.effectAllowed="move",j({type:"chapter",id:L.id})},onDragEnd:()=>{j(null),C(null)},onDragEnter:G=>{G.preventDefault(),G.stopPropagation(),G.dataTransfer.dropEffect="move",C({type:"chapter",id:L.id})},onDragOver:G=>{G.preventDefault(),G.stopPropagation(),G.dataTransfer.dropEffect="move",C({type:"chapter",id:L.id})},onDragLeave:()=>C(null),onDrop:G=>{C(null);const de=Fd(G.dataTransfer.getData("text/plain"));if(!de)return;const Y={partId:R.id,partTitle:R.title,chapterId:L.id,chapterTitle:L.title};(de.type==="section"||de.type==="chapter")&&U(G,"chapter",L.id,Y)},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":""} ${N("chapter",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[e.jsx(Nr,{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:L.title})]}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:G=>G.stopPropagation(),children:[v&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>v(R,L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),f&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>f(R),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>g(R,L),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:L.sections.map(G=>{const de=_("section",G.id);return e.jsxs("div",{draggable:!0,onDragStart:Y=>{Y.stopPropagation(),Y.dataTransfer.setData("text/plain","section:"+G.id),Y.dataTransfer.effectAllowed="move",j({type:"section",id:G.id})},onDragEnd:()=>{j(null),C(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 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${N("section",G.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...I("section",G.id,{partId:R.id,partTitle:R.title,chapterId:L.id,chapterTitle:L.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:Y=>Y.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:E.includes(G.id),onChange:()=>P(G.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx(Nr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${G.price===0||G.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[G.id," ",G.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:Y=>Y.stopPropagation(),onClick:Y=>Y.stopPropagation(),children:[G.isNew&&e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),G.price===0||G.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:["¥",G.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",title:"点击次数 · 付款笔数",children:["点击 ",G.clickCount??0," · 付款 ",G.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(G.hotScore??0).toFixed(1)," · 第",G.hotRank&&G.hotRank>0?G.hotRank:"-","名"]}),T&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(G),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(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(G),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Cr,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(G),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(G),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Wt,{className:"w-3.5 h-3.5"})})]}),e.jsx(en,{className:"w-4 h-4 text-gray-500"})]})]},G.id)})})]},L.id)})})]},R.id)})})}function xC(r){const a=new Map;for(const f of r){const g=f.partId||"part-1",y=f.partTitle||"未分类",p=f.chapterId||"chapter-1",v=f.chapterTitle||"未分类";a.has(g)||a.set(g,{id:g,title:y,chapters:new Map});const E=a.get(g);E.chapters.has(p)||E.chapters.set(p,{id:p,title:v,sections:[]}),E.chapters.get(p).sections.push({id:f.id,title:f.title,price:f.price??1,filePath:f.filePath,isFree:f.isFree,isNew:f.isNew,clickCount:f.clickCount??0,payCount:f.payCount??0,hotScore:f.hotScore??0,hotRank:f.hotRank??0})}const l="part-2026-daily",o="2026每日派对干货";Array.from(a.values()).some(f=>f.title===o||f.title.includes(o))||a.set(l,{id:l,title:o,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:o,sections:[]}]])});const u=Array.from(a.values()).map(f=>({...f,chapters:Array.from(f.chapters.values())})),m=f=>f.includes("序言")?0:f.includes(o)?1.5:f.includes("附录")?2:f.includes("尾声")?3:1;return u.sort((f,g)=>{const y=m(f.title),p=m(g.title);return y!==p?y-p:0})}function pC(){var Js,Qn,ys;const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState([]),[m,f]=h.useState(null),[g,y]=h.useState(!1),[p,v]=h.useState(!1),[E,P]=h.useState(!1),[T,b]=h.useState(""),[j,w]=h.useState([]),[C,N]=h.useState(!1),[_,V]=h.useState(!1),U=h.useRef(null),[I,k]=h.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[R,ee]=h.useState(null),[ne,ie]=h.useState(!1),[te,se]=h.useState(!1),[H,ae]=h.useState(null),[ve,$]=h.useState(!1),[ce,K]=h.useState([]),[A,O]=h.useState(!1),[L,X]=h.useState(""),[G,de]=h.useState(""),[Y,pe]=h.useState(!1),[Ce,D]=h.useState(""),[ue,ke]=h.useState(!1),[Ie,Ue]=h.useState(null),[Ze,et]=h.useState(!1),[tt,ge]=h.useState(!1),[fe,ot]=h.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[ss,dr]=h.useState(!1),[Ht,Cs]=h.useState(!1),Kt=xC(r),vn=r.length,Mt=async()=>{o(!0);try{const F=await Be("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray(F==null?void 0:F.sections)?F.sections:[])}catch(F){console.error(F),a([])}finally{o(!1)}};h.useEffect(()=>{Mt()},[]);const ur=F=>{u(oe=>oe.includes(F)?oe.filter(Ne=>Ne!==F):[...oe,F])},Vn=h.useCallback(F=>{const oe=r,Ne=F.flatMap(Te=>{const ut=oe.find(rs=>rs.id===Te.id);return ut?[{...ut,partId:Te.partId,partTitle:Te.partTitle,chapterId:Te.chapterId,chapterTitle:Te.chapterTitle}]:[]});return a(Ne),yt("/api/db/book",{action:"reorder",items:F}).then(Te=>{Te&&Te.success===!1&&(a(oe),alert("排序失败: "+(Te&&typeof Te=="object"&&"error"in Te?Te.error:"未知错误")))}).catch(Te=>{a(oe),console.error("排序失败:",Te),alert("排序失败: "+(Te instanceof Error?Te.message:"网络或服务异常"))}),Promise.resolve()},[r]),ls=async F=>{if(confirm(`确定要删除章节「${F.title}」吗?此操作不可恢复。`))try{const oe=await kr(`/api/db/book?id=${encodeURIComponent(F.id)}`);oe&&oe.success!==!1?(alert("已删除"),Mt()):alert("删除失败: "+(oe&&typeof oe=="object"&&"error"in oe?oe.error:"未知错误"))}catch(oe){console.error(oe),alert("删除失败")}},ks=h.useCallback(async()=>{dr(!0);try{const F=await Be("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),oe=F&&F.data;oe&&typeof oe.readWeight=="number"&&typeof oe.recencyWeight=="number"&&typeof oe.payWeight=="number"&&ot({readWeight:Math.max(0,Math.min(1,oe.readWeight)),recencyWeight:Math.max(0,Math.min(1,oe.recencyWeight)),payWeight:Math.max(0,Math.min(1,oe.payWeight))})}catch{}finally{dr(!1)}},[]);h.useEffect(()=>{tt&&ks()},[tt,ks]);const jn=async()=>{const{readWeight:F,recencyWeight:oe,payWeight:Ne}=fe,Te=F+oe+Ne;if(Math.abs(Te-1)>.001){alert("三个权重之和必须等于 1");return}Cs(!0);try{const ut=await ft("/api/db/config",{key:"article_ranking_weights",value:{readWeight:F,recencyWeight:oe,payWeight:Ne},description:"文章排名算法权重"});ut&&ut.success!==!1?(alert("已保存"),Mt()):alert("保存失败: "+(ut&&typeof ut=="object"&&"error"in ut?ut.error:""))}catch(ut){console.error(ut),alert("保存失败")}finally{Cs(!1)}},Es=async F=>{Ue({section:F,orders:[]}),et(!0);try{const oe=await Be(`/api/db/book?action=section-orders&id=${encodeURIComponent(F.id)}`),Ne=oe!=null&&oe.success&&Array.isArray(oe.orders)?oe.orders:[];Ue(Te=>Te?{...Te,orders:Ne}:null)}catch(oe){console.error(oe),Ue(Ne=>Ne?{...Ne,orders:[]}:null)}finally{et(!1)}},Ls=async F=>{v(!0);try{const oe=await Be(`/api/db/book?action=read&id=${encodeURIComponent(F.id)}`);if(oe!=null&&oe.success&&oe.section){const Ne=oe.section;f({id:F.id,title:oe.section.title??F.title,price:oe.section.price??F.price,content:oe.section.content??"",filePath:F.filePath,isFree:F.isFree||F.price===0,isNew:Ne.isNew??F.isNew})}else f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree,isNew:F.isNew}),oe&&!oe.success&&alert("无法读取文件内容: "+(oe.error||"未知错误"))}catch(oe){console.error(oe),f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree})}finally{v(!1)}},hr=async()=>{var F;if(m){P(!0);try{let oe=m.content||"";const Ne=[new RegExp(`^#+\\s*${m.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${m.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(F=m.title)==null?void 0:F.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const ut of Ne)oe=oe.replace(ut,"");oe=oe.replace(/^\s*\n+/,"").trim();const Te=await yt("/api/db/book",{id:m.id,title:m.title,price:m.isFree?0:m.price,content:oe,isFree:m.isFree||m.price===0,isNew:m.isNew,saveToFile:!0});Te&&Te.success!==!1?(alert(`已保存章节: ${m.title}`),f(null),Mt()):alert("保存失败: "+(Te&&typeof Te=="object"&&"error"in Te?Te.error:"未知错误"))}catch(oe){console.error(oe),alert("保存失败")}finally{P(!1)}}},bn=async()=>{if(!I.id||!I.title){alert("请填写章节ID和标题");return}P(!0);try{const F=await yt("/api/db/book",{id:I.id,title:I.title,price:I.price,content:I.content,partId:I.partId,chapterId:I.chapterId,saveToFile:!1});F&&F.success!==!1?(alert(`章节创建成功: ${I.title}`),y(!1),k({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),Mt()):alert("创建失败: "+(F&&typeof F=="object"&&"error"in F?F.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{P(!1)}},mr=F=>{k(oe=>{var Ne;return{...oe,partId:F.id,chapterId:((Ne=F.chapters[0])==null?void 0:Ne.id)??"chapter-1"}}),y(!0)},Rr=F=>{ee({id:F.id,title:F.title})},Ps=async()=>{var F;if((F=R==null?void 0:R.title)!=null&&F.trim()){ie(!0);try{const oe=r.map(Te=>({id:Te.id,partId:Te.partId||"part-1",partTitle:Te.partId===R.id?R.title.trim():Te.partTitle||"",chapterId:Te.chapterId||"chapter-1",chapterTitle:Te.chapterTitle||""})),Ne=await yt("/api/db/book",{action:"reorder",items:oe});Ne&&Ne.success!==!1?(ee(null),Mt()):alert("更新篇名失败: "+(Ne&&typeof Ne=="object"&&"error"in Ne?Ne.error:"未知错误"))}catch(oe){console.error(oe),alert("更新篇名失败")}finally{ie(!1)}}},Nn=F=>{const oe=F.chapters.length+1,Ne=`chapter-${F.id}-${oe}-${Date.now()}`;k({id:`${oe}.1`,title:"新章节",price:1,partId:F.id,chapterId:Ne,content:""}),y(!0)},qs=(F,oe)=>{ae({part:F,chapter:oe,title:oe.title})},Xs=async()=>{var F;if((F=H==null?void 0:H.title)!=null&&F.trim()){$(!0);try{const oe=r.map(Te=>({id:Te.id,partId:Te.partId||H.part.id,partTitle:Te.partId===H.part.id?H.part.title:Te.partTitle||"",chapterId:Te.chapterId||H.chapter.id,chapterTitle:Te.partId===H.part.id&&Te.chapterId===H.chapter.id?H.title.trim():Te.chapterTitle||""})),Ne=await yt("/api/db/book",{action:"reorder",items:oe});Ne&&Ne.success!==!1?(ae(null),Mt()):alert("保存失败: "+(Ne&&typeof Ne=="object"&&"error"in Ne?Ne.error:"未知错误"))}catch(oe){console.error(oe),alert("保存失败")}finally{$(!1)}}},Wn=async(F,oe)=>{const Ne=oe.sections.map(Te=>Te.id);if(Ne.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${F.chapters.indexOf(oe)+1}章 | ${oe.title}」吗?将删除共 ${Ne.length} 节,此操作不可恢复。`))try{for(const Te of Ne)await kr(`/api/db/book?id=${encodeURIComponent(Te)}`);Mt()}catch(Te){console.error(Te),alert("删除失败")}},Hn=async()=>{if(!Ce.trim()){alert("请输入篇名");return}ke(!0);try{const F=`part-new-${Date.now()}`,oe="chapter-1",Ne=`part-placeholder-${Date.now()}`,Te=await yt("/api/db/book",{id:Ne,title:"占位节(可编辑)",price:0,content:"",partId:F,partTitle:Ce.trim(),chapterId:oe,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Te&&Te.success!==!1?(alert(`篇「${Ce}」创建成功,请编辑占位节`),se(!1),D(""),Mt()):alert("创建失败: "+(Te&&typeof Te=="object"&&"error"in Te?Te.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{ke(!1)}},Kn=async()=>{if(ce.length===0){alert("请先勾选要移动的章节");return}const F=Kt.find(Ne=>Ne.id===L),oe=F==null?void 0:F.chapters.find(Ne=>Ne.id===G);if(!F||!oe||!L||!G){alert("请选择目标篇和章");return}pe(!0);try{const Ne=()=>{const at=new Set(ce),is=r.map(rt=>({id:rt.id,partId:rt.partId||"",partTitle:rt.partTitle||"",chapterId:rt.chapterId||"",chapterTitle:rt.chapterTitle||""})),B=is.filter(rt=>at.has(rt.id)).map(rt=>({...rt,partId:L,partTitle:F.title||L,chapterId:G,chapterTitle:oe.title||G})),We=is.filter(rt=>!at.has(rt.id));let He=We.length;for(let rt=We.length-1;rt>=0;rt-=1){const Ts=We[rt];if(Ts.partId===L&&Ts.chapterId===G){He=rt+1;break}}return[...We.slice(0,He),...B,...We.slice(He)]},Te=async()=>{const at=Ne(),is=await yt("/api/db/book",{action:"reorder",items:at});return is&&is.success!==!1?(alert(`已移动 ${ce.length} 节到「${F.title}」-「${oe.title}」`),O(!1),K([]),await Mt(),!0):!1},ut={action:"move-sections",sectionIds:ce,targetPartId:L,targetChapterId:G,targetPartTitle:F.title||L,targetChapterTitle:oe.title||G},rs=await yt("/api/db/book",ut);if(rs&&rs.success!==!1)alert(`已移动 ${rs.count??ce.length} 节到「${F.title}」-「${oe.title}」`),O(!1),K([]),await Mt();else{const at=rs&&typeof rs=="object"&&"error"in rs?rs.error||"":"未知错误";if((at.includes("缺少 id")||at.includes("无效的 action"))&&await Te())return;alert("移动失败: "+at)}}catch(Ne){console.error(Ne),alert("移动失败: "+(Ne instanceof Error?Ne.message:"网络或服务异常"))}finally{pe(!1)}},Gn=F=>{K(oe=>oe.includes(F)?oe.filter(Ne=>Ne!==F):[...oe,F])},Yn=async F=>{const oe=r.filter(Ne=>Ne.partId===F.id).map(Ne=>Ne.id);if(oe.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${F.title}」整篇吗?将删除共 ${oe.length} 节内容,此操作不可恢复。`))try{for(const Ne of oe)await kr(`/api/db/book?id=${encodeURIComponent(Ne)}`);Mt()}catch(Ne){console.error(Ne),alert("删除失败")}},Ir=async F=>{var Ne,Te;const oe=(Ne=F.target.files)==null?void 0:Ne[0];if(oe){V(!0);try{const ut=new FormData;ut.append("file",oe),ut.append("folder","book-images");const at=await(await fetch(Ia("/api/upload"),{method:"POST",body:ut,credentials:"include"})).json();if(at!=null&&at.success&&((Te=at==null?void 0:at.data)!=null&&Te.url)){const is=``;m&&f({...m,content:(m.content||"")+`
|
||
|
||
`+is}),alert(`图片上传成功: ${at.data.url}`)}else alert("上传失败: "+((at==null?void 0:at.error)||"未知错误"))}catch(ut){console.error(ut),alert("上传失败")}finally{V(!1),U.current&&(U.current.value="")}}},wn=async()=>{var F;if(T.trim()){N(!0);try{const oe=await Be(`/api/search?q=${encodeURIComponent(T)}`);oe!=null&&oe.success&&((F=oe.data)!=null&&F.results)?w(oe.data.results):(w([]),oe&&!oe.success&&alert("搜索失败: "+oe.error))}catch(oe){console.error(oe),w([]),alert("搜索失败")}finally{N(!1)}}},qt=Kt.find(F=>F.id===I.partId),_r=(qt==null?void 0:qt.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:["共 ",Kt.length," 篇 · ",vn," 节内容"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(q,{onClick:()=>ge(!0),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10 bg-transparent",children:[e.jsx(wd,{className:"w-4 h-4 mr-2"}),"排名算法"]}),e.jsxs(q,{onClick:()=>{const F=typeof window<"u"?`${window.location.origin}/api-doc`:"";F&&window.open(F,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ln,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(St,{open:g,onOpenChange:y,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Pt,{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(Z,{className:"text-gray-300",children:"章节ID *"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:I.id,onChange:F=>k({...I,id:F.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:I.price,onChange:F=>k({...I,price:Number(F.target.value)})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"章节标题 *"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:I.title,onChange:F=>k({...I,title:F.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"所属篇"}),e.jsxs(Sl,{value:I.partId,onValueChange:F=>k({...I,partId:F,chapterId:"chapter-1"}),children:[e.jsx(Na,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{})}),e.jsxs(wa,{className:"bg-[#0f2137] border-gray-700",children:[Kt.map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id)),Kt.length===0&&e.jsx(nr,{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(Z,{className:"text-gray-300",children:"所属章"}),e.jsxs(Sl,{value:I.chapterId,onValueChange:F=>k({...I,chapterId:F}),children:[e.jsx(Na,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{})}),e.jsxs(wa,{className:"bg-[#0f2137] border-gray-700",children:[_r.map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id)),_r.length===0&&e.jsx(nr,{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(Z,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsx(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:I.content,onChange:F=>k({...I,content:F.target.value})})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:bn,disabled:E||!I.id||!I.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),e.jsx(St,{open:!!R,onOpenChange:F=>!F&&ee(null),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),R&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"篇名"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:R.title,onChange:F=>ee({...R,title:F.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>ee(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Ps,disabled:ne||!((Js=R==null?void 0:R.title)!=null&&Js.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ne?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(St,{open:!!H,onOpenChange:F=>!F&&ae(null),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),H&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"章节名称(如:第8章|底层结构)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:H.title,onChange:F=>ae({...H,title:F.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>ae(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Xs,disabled:ve||!((Qn=H==null?void 0:H.title)!=null&&Qn.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ve?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(St,{open:A,onOpenChange:F=>{var oe;if(O(F),F&&Kt.length>0){const Ne=Kt[0];X(Ne.id),de(((oe=Ne.chapters[0])==null?void 0:oe.id)??"")}},children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsx(kt,{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:ce.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"目标篇"}),e.jsxs(Sl,{value:L,onValueChange:F=>{var Ne;X(F);const oe=Kt.find(Te=>Te.id===F);de(((Ne=oe==null?void 0:oe.chapters[0])==null?void 0:Ne.id)??"")},children:[e.jsx(Na,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{placeholder:"选择篇"})}),e.jsx(wa,{className:"bg-[#0f2137] border-gray-700",children:Kt.map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"目标章"}),e.jsxs(Sl,{value:G,onValueChange:de,children:[e.jsx(Na,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{placeholder:"选择章"})}),e.jsx(wa,{className:"bg-[#0f2137] border-gray-700",children:(((ys=Kt.find(F=>F.id===L))==null?void 0:ys.chapters)??[]).map(F=>e.jsx(nr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>O(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Kn,disabled:Y||ce.length===0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:Y?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"移动中..."]}):"确认移动"})]})]})}),e.jsx(St,{open:!!Ie,onOpenChange:F=>!F&&Ue(null),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white",children:["付款记录 — ",(Ie==null?void 0:Ie.section.title)??""]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:Ze?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:"加载中..."})]}):Ie&&Ie.orders.length===0?e.jsx("p",{className:"text-gray-500 text-center py-6",children:"暂无付款记录"}):Ie?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:Ie.orders.map(F=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.userId??F.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",F.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:F.payTime??F.createdAt??"-"})]},F.id??F.orderSn??""))})]}):null})]})}),e.jsx(St,{open:tt,onOpenChange:ge,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(wd,{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)"}),ss?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(Z,{className:"text-gray-400 text-xs",children:"阅读权重"}),e.jsx(le,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:fe.readWeight,onChange:F=>ot(oe=>({...oe,readWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(Z,{className:"text-gray-400 text-xs",children:"新度权重"}),e.jsx(le,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:fe.recencyWeight,onChange:F=>ot(oe=>({...oe,recencyWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(Z,{className:"text-gray-400 text-xs",children:"付款权重"}),e.jsx(le,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:fe.payWeight,onChange:F=>ot(oe=>({...oe,payWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(fe.readWeight+fe.recencyWeight+fe.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 名:得分 20~1"}),e.jsx("li",{children:"最近更新前 30 篇:得分 30~1"}),e.jsx("li",{children:"付款数前 20 名:得分 20~1"})]}),e.jsx(q,{onClick:jn,disabled:Ht||Math.abs(fe.readWeight+fe.recencyWeight+fe.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:Ht?"保存中...":"保存权重"})]})]})]})}),e.jsx(St,{open:te,onOpenChange:se,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(Pt,{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(Z,{className:"text-gray-300",children:"篇名(如:第六篇|真实的社会)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:Ce,onChange:F=>D(F.target.value),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>{se(!1),D("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Hn,disabled:ue||!Ce.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:ue?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),e.jsx(St,{open:!!m,onOpenChange:()=>f(null),children:e.jsxs(bt,{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(Ct,{className:"shrink-0 px-6 pt-6 pb-2",children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),m&&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(Z,{className:"text-gray-300",children:"章节ID"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:m.isFree?0:m.price,onChange:F=>f({...m,price:Number(F.target.value),isFree:Number(F.target.value)===0}),disabled:m.isFree})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{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:m.isFree||m.price===0,onChange:F=>f({...m,isFree:F.target.checked,price:F.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(Z,{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:m.isNew??!1,onChange:F=>f({...m,isNew:F.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(Z,{className:"text-gray-300",children:"章节标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.title,onChange:F=>f({...m,title:F.target.value})})]}),m.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"文件路径"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:m.filePath,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Z,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:U,type:"file",accept:"image/*",onChange:Ir,className:"hidden"}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>{var F;return(F=U.current)==null?void 0:F.click()},disabled:_,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[_?e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(Wx,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),p?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(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[400px] font-mono text-sm placeholder:text-gray-500",placeholder:"此处输入章节内容,支持Markdown格式...",value:m.content,onChange:F=>f({...m,content:F.target.value})})]})]}),e.jsxs(Dt,{className:"shrink-0 px-6 py-4 border-t border-gray-700/50",children:[e.jsxs(q,{variant:"outline",onClick:()=>f(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsx(q,{onClick:hr,disabled:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),e.jsxs(Ol,{defaultValue:"chapters",className:"space-y-6",children:[e.jsxs(Fa,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Lt,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(Ks,{className:"w-4 h-4 mr-2"}),"章节管理"]}),e.jsxs(Lt,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(on,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),e.jsxs(Lt,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(wd,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),e.jsxs(Ot,{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(Ks,{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:vn}),e.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(q,{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(Pt,{className:"w-4 h-4 mr-2"}),"新建章节"]}),e.jsxs(q,{onClick:()=>se(!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(Pt,{className:"w-4 h-4 mr-2"}),"新建篇"]}),e.jsxs(q,{variant:"outline",onClick:()=>O(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",ce.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:Kt,expandedParts:c,onTogglePart:ur,onReorder:Vn,onReadSection:Ls,onDeleteSection:ls,onAddSectionInPart:mr,onAddChapterInPart:Nn,onDeleteChapter:Wn,onEditPart:Rr,onDeletePart:Yn,onEditChapter:qs,selectedSectionIds:ce,onToggleSectionSelect:Gn,onShowSectionOrders:Es})]}),e.jsx(Ot,{value:"search",className:"space-y-4",children:e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ke,{children:e.jsx(Ge,{className:"text-white",children:"内容搜索"})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:T,onChange:F=>b(F.target.value),onKeyDown:F=>F.key==="Enter"&&wn()}),e.jsx(q,{onClick:wn,disabled:C||!T.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsx($e,{className:"w-4 h-4 animate-spin"}):e.jsx(on,{className:"w-4 h-4"})})]}),j.length>0&&e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",j.length," 个结果"]}),j.map(F=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>Ls({id:F.id,title:F.title,price:F.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:F.id}),e.jsx("span",{className:"text-white",children:F.title})]}),e.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:F.matchType==="title"?"标题匹配":"内容匹配"})]}),F.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:F.snippet}),(F.partTitle||F.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[F.partTitle," · ",F.chapterTitle]})]},F.id))]})]})]})}),e.jsx(Ot,{value:"hooks",className:"space-y-4",children:e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ke,{children:e.jsx(Ge,{className:"text-white",children:"引流钩子配置"})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[e.jsx(Z,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),e.jsxs(Sl,{defaultValue:"3",children:[e.jsx(Na,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Cl,{placeholder:"选择章节"})}),e.jsxs(wa,{className:"bg-[#0f2137] border-gray-700",children:[e.jsx(nr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),e.jsx(nr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),e.jsx(nr,{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(Z,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),e.jsx(dn,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),e.jsx(q,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}const Sr={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 yx(r){return Array.isArray(r)?r.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):Sr.stats}function vx(r){return Array.isArray(r)?r.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):Sr.highlights}function gC(){const[r,a]=h.useState(Sr),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[m,f]=h.useState(!1),g=h.useRef(null);h.useEffect(()=>{Be("/api/admin/author-settings").then(w=>{const C=w==null?void 0:w.data;C&&typeof C=="object"&&a({name:String(C.name??Sr.name),avatar:String(C.avatar??Sr.avatar),avatarImg:String(C.avatarImg??""),title:String(C.title??Sr.title),bio:String(C.bio??Sr.bio),stats:yx(C.stats).length?yx(C.stats):Sr.stats,highlights:vx(C.highlights).length?vx(C.highlights):Sr.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const y=async()=>{u(!0);try{const w={name:r.name,avatar:r.avatar||"K",avatarImg:r.avatarImg,title:r.title,bio:r.bio,stats:r.stats.filter(_=>_.label||_.value),highlights:r.highlights.filter(Boolean)},C=await ft("/api/admin/author-settings",w);if(!C||C.success===!1){alert("保存失败: "+(C&&typeof C=="object"&&"error"in C?C.error:""));return}u(!1);const N=document.createElement("div");N.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",N.textContent="作者设置已保存",document.body.appendChild(N),setTimeout(()=>N.remove(),2e3)}catch(w){console.error(w),alert("保存失败: "+(w instanceof Error?w.message:String(w)))}finally{u(!1)}},p=async w=>{var N;const C=(N=w.target.files)==null?void 0:N[0];if(C){f(!0);try{const _=new FormData;_.append("file",C),_.append("folder","avatars");const V=yu(),U={};V&&(U.Authorization=`Bearer ${V}`);const k=await(await fetch(Ia("/api/upload"),{method:"POST",body:_,credentials:"include",headers:U})).json();k!=null&&k.success&&(k!=null&&k.url)?a(R=>({...R,avatarImg:k.url})):alert("上传失败: "+((k==null?void 0:k.error)||"未知错误"))}catch(_){console.error(_),alert("上传失败")}finally{f(!1),g.current&&(g.current.value="")}}},v=()=>a(w=>({...w,stats:[...w.stats,{label:"",value:""}]})),E=w=>a(C=>({...C,stats:C.stats.filter((N,_)=>_!==w)})),P=(w,C,N)=>a(_=>({..._,stats:_.stats.map((V,U)=>U===w?{...V,[C]:N}:V)})),T=()=>a(w=>({...w,highlights:[...w.highlights,""]})),b=w=>a(C=>({...C,highlights:C.highlights.filter((N,_)=>_!==w)})),j=(w,C)=>a(N=>({...N,highlights:N.highlights.map((_,V)=>V===w?C:_)}));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(Ea,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),e.jsxs(q,{onClick:y,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"flex items-center gap-2 text-white",children:[e.jsx(Ea,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),e.jsx(vt,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),e.jsxs(Se,{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(Z,{className:"text-gray-300",children:"姓名"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.name,onChange:w=>a(C=>({...C,name:w.target.value})),placeholder:"卡若"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:r.avatar,onChange:w=>a(C=>({...C,avatar:w.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Wx,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:r.avatarImg,onChange:w=>a(C=>({...C,avatarImg:w.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),e.jsx("input",{ref:g,type:"file",accept:"image/*",className:"hidden",onChange:p}),e.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:m,onClick:()=>{var w;return(w=g.current)==null?void 0:w.click()},children:[e.jsx(io,{className:"w-4 h-4 mr-2"}),m?"上传中...":"上传"]})]}),r.avatarImg&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:r.avatarImg.startsWith("http")?r.avatarImg:Ia(r.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(Z,{className:"text-gray-300",children:"头衔"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.title,onChange:w=>a(C=>({...C,title:w.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"个人简介"}),e.jsx(dn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:r.bio,onChange:w=>a(C=>({...C,bio:w.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsx(Ge,{className:"text-white",children:"统计数据"}),e.jsx(vt,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),e.jsxs(Se,{className:"space-y-3",children:[r.stats.map((w,C)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:w.label,onChange:N=>P(C,"label",N.target.value),placeholder:"标签"}),e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:w.value,onChange:N=>P(C,"value",N.target.value),placeholder:"数值"}),e.jsx(q,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>E(C),children:e.jsx(fs,{className:"w-4 h-4"})})]},C)),e.jsxs(q,{variant:"outline",size:"sm",onClick:v,className:"border-gray-600 text-gray-400",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsx(Ge,{className:"text-white",children:"亮点标签"}),e.jsx(vt,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),e.jsxs(Se,{className:"space-y-3",children:[r.highlights.map((w,C)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:w,onChange:N=>j(C,N.target.value),placeholder:"5年私域运营经验"}),e.jsx(q,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>b(C),children:e.jsx(fs,{className:"w-4 h-4"})})]},C)),e.jsxs(q,{variant:"outline",size:"sm",onClick:T,className:"border-gray-600 text-gray-400",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}function yC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m]=h.useState(10),[f,g]=h.useState(0),[y,p]=h.useState(""),v=Pu(y,300),[E,P]=h.useState(!0),[T,b]=h.useState(null),[j,w]=h.useState(!1),[C,N]=h.useState(null),[_,V]=h.useState(""),[U,I]=h.useState(""),[k,R]=h.useState(""),[ee,ne]=h.useState("admin"),[ie,te]=h.useState("active"),[se,H]=h.useState(!1);async function ae(){var O;P(!0),b(null);try{const L=new URLSearchParams({page:String(c),pageSize:String(m)});v.trim()&&L.set("search",v.trim());const X=await Be(`/api/admin/users?${L}`);X!=null&&X.success?(a(X.records||[]),o(X.total??0),g(X.totalPages??0)):b(X.error||"加载失败")}catch(L){const X=L;b(X.status===403?"无权限访问":((O=X==null?void 0:X.data)==null?void 0:O.error)||"加载失败"),a([])}finally{P(!1)}}h.useEffect(()=>{ae()},[c,m,v]);const ve=()=>{N(null),V(""),I(""),R(""),ne("admin"),te("active"),w(!0)},$=O=>{N(O),V(O.username),I(""),R(O.name||""),ne(O.role==="super_admin"?"super_admin":"admin"),te(O.status==="disabled"?"disabled":"active"),w(!0)},ce=async()=>{var O;if(!_.trim()){b("用户名不能为空");return}if(!C&&!U){b("新建时密码必填,至少 6 位");return}if(U&&U.length<6){b("密码至少 6 位");return}b(null),H(!0);try{if(C){const L=await yt("/api/admin/users",{id:C.id,password:U||void 0,name:k.trim(),role:ee,status:ie});L!=null&&L.success?(w(!1),ae()):b((L==null?void 0:L.error)||"保存失败")}else{const L=await ft("/api/admin/users",{username:_.trim(),password:U,name:k.trim(),role:ee});L!=null&&L.success?(w(!1),ae()):b((L==null?void 0:L.error)||"保存失败")}}catch(L){const X=L;b(((O=X==null?void 0:X.data)==null?void 0:O.error)||"保存失败")}finally{H(!1)}},K=async O=>{var L;if(confirm("确定删除该管理员?"))try{const X=await kr(`/api/admin/users?id=${O}`);X!=null&&X.success?ae():b((X==null?void 0:X.error)||"删除失败")}catch(X){const G=X;b(((L=G==null?void 0:G.data)==null?void 0:L.error)||"删除失败")}},A=O=>{if(!O)return"-";try{const L=new Date(O);return isNaN(L.getTime())?O:L.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(pu,{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(le,{placeholder:"搜索用户名/昵称",value:y,onChange:O=>p(O.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(q,{variant:"outline",size:"sm",onClick:ae,disabled:E,className:"border-gray-600 text-gray-300",children:e.jsx($e,{className:`w-4 h-4 ${E?"animate-spin":""}`})}),e.jsxs(q,{onClick:ve,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{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:()=>b(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{className:"p-0",children:E?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户名"}),e.jsx(be,{className:"text-gray-400",children:"昵称"}),e.jsx(be,{className:"text-gray-400",children:"角色"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(O=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(xe,{className:"text-gray-300",children:O.id}),e.jsx(xe,{className:"text-white font-medium",children:O.username}),e.jsx(xe,{className:"text-gray-400",children:O.name||"-"}),e.jsx(xe,{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(xe,{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(xe,{className:"text-gray-500 text-sm",children:A(O.createdAt)}),e.jsxs(xe,{className:"text-right",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>$(O),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>K(O.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]},O.id)),r.length===0&&!E&&e.jsx(Je,{children:e.jsx(xe,{colSpan:7,className:"text-center py-12 text-gray-500",children:T==="无权限访问"?"仅超级管理员可查看":"暂无管理员"})})]})]}),f>1&&e.jsx("div",{className:"p-4 border-t border-gray-700/50",children:e.jsx(Hs,{page:c,pageSize:m,total:l,totalPages:f,onPageChange:u})})]})})}),e.jsx(St,{open:j,onOpenChange:w,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:C?"编辑管理员":"新增管理员"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"用户名"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:_,onChange:O=>V(O.target.value),disabled:!!C}),C&&e.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:C?"新密码(留空不改)":"密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:C?"留空表示不修改":"至少 6 位",value:U,onChange:O=>I(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"昵称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:k,onChange:O=>R(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:ee,onChange:O=>ne(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:"超级管理员"})]})]}),C&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"状态"}),e.jsxs("select",{value:ie,onChange:O=>te(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(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>w(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:ce,disabled:se,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),se?"保存中...":"保存"]})]})]})})]})}const vC={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},jC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},bC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...jC}},NC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},wC=["system","author","admin"];function SC(){const[r,a]=_j(),l=r.get("tab")??"system",o=wC.includes(l)?l:"system",[c,u]=h.useState(bC),[m,f]=h.useState(NC),[g,y]=h.useState(vC),[p,v]=h.useState(!1),[E,P]=h.useState(!0),[T,b]=h.useState(!1),[j,w]=h.useState(""),[C,N]=h.useState(""),[_,V]=h.useState(!1),[U,I]=h.useState(!1),k=(te,se,H=!1)=>{w(te),N(se),V(H),b(!0)};h.useEffect(()=>{(async()=>{try{const se=await Be("/api/admin/settings");if(!se||se.success===!1)return;if(se.featureConfig&&Object.keys(se.featureConfig).length&&f(H=>({...H,...se.featureConfig})),se.mpConfig&&typeof se.mpConfig=="object"&&y(H=>({...H,...se.mpConfig})),se.siteSettings&&typeof se.siteSettings=="object"){const H=se.siteSettings;u(ae=>({...ae,...typeof H.sectionPrice=="number"&&{sectionPrice:H.sectionPrice},...typeof H.baseBookPrice=="number"&&{baseBookPrice:H.baseBookPrice},...typeof H.distributorShare=="number"&&{distributorShare:H.distributorShare},...H.authorInfo&&typeof H.authorInfo=="object"&&{authorInfo:{...ae.authorInfo,...H.authorInfo}}}))}}catch(se){console.error("Load settings error:",se)}finally{P(!1)}})()},[]);const R=async(te,se)=>{I(!0);try{const H=await ft("/api/admin/settings",{featureConfig:te});if(!H||H.success===!1){se(),k("保存失败",(H==null?void 0:H.error)??"未知错误",!0);return}k("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(H){console.error("Save feature config error:",H),se(),k("保存失败",H instanceof Error?H.message:String(H),!0)}finally{I(!1)}},ee=(te,se)=>{const H=m,ae={...H,[te]:se};f(ae),R(ae,()=>f(H))},ne=async()=>{v(!0);try{const te=await ft("/api/admin/settings",{featureConfig:m,siteSettings:{sectionPrice:c.sectionPrice,baseBookPrice:c.baseBookPrice,distributorShare:c.distributorShare,authorInfo:c.authorInfo},mpConfig:{...g,appId:g.appId||"",withdrawSubscribeTmplId:g.withdrawSubscribeTmplId||"",mchId:g.mchId||"",minWithdraw:typeof g.minWithdraw=="number"?g.minWithdraw:10}});if(!te||te.success===!1){k("保存失败",(te==null?void 0:te.error)??"未知错误",!0);return}k("已保存","设置已保存成功。")}catch(te){console.error("Save settings error:",te),k("保存失败",te instanceof Error?te.message:String(te),!0)}finally{v(!1)}},ie=te=>{a(te==="system"?{}:{tab:te})};return E?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(q,{onClick:ne,disabled:p,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),p?"保存中...":"保存设置"]})]}),e.jsxs(Ol,{value:o,onValueChange:ie,className:"w-full",children:[e.jsxs(Fa,{className:"mb-6 bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Lt,{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(On,{className:"w-4 h-4 mr-2"}),"系统设置"]}),e.jsxs(Lt,{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(Nd,{className:"w-4 h-4 mr-2"}),"作者详情"]}),e.jsxs(Lt,{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(pu,{className:"w-4 h-4 mr-2"}),"管理员"]})]}),e.jsx(Ot,{value:"system",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Nd,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),e.jsx(vt,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),e.jsxs(Se,{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(Z,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Nd,{className:"w-3 h-3"}),"主理人名称"]}),e.jsx(le,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.name??"",onChange:te=>u(se=>({...se,authorInfo:{...se.authorInfo,name:te.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(ao,{className:"w-3 h-3"}),"开播日期"]}),e.jsx(le,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:c.authorInfo.startDate??"",onChange:te=>u(se=>({...se,authorInfo:{...se.authorInfo,startDate:te.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(ao,{className:"w-3 h-3"}),"直播时间"]}),e.jsx(le,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:c.authorInfo.liveTime??"",onChange:te=>u(se=>({...se,authorInfo:{...se.authorInfo,liveTime:te.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Hx,{className:"w-3 h-3"}),"直播平台"]}),e.jsx(le,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:c.authorInfo.platform??"",onChange:te=>u(se=>({...se,authorInfo:{...se.authorInfo,platform:te.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Ks,{className:"w-3 h-3"}),"简介描述"]}),e.jsx(le,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.description??"",onChange:te=>u(se=>({...se,authorInfo:{...se.authorInfo,description:te.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),e.jsx(dn,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:c.authorInfo.bio??"",onChange:te=>u(se=>({...se,authorInfo:{...se.authorInfo,bio:te.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(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Rl,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),e.jsx(vt,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),e.jsx(Se,{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(Z,{className:"text-gray-300",children:"单节价格 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.sectionPrice,onChange:te=>u(se=>({...se,sectionPrice:Number.parseFloat(te.target.value)||1}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"整本价格 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.baseBookPrice,onChange:te=>u(se=>({...se,baseBookPrice:Number.parseFloat(te.target.value)||9.9}))})]})]})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Il,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),e.jsx(vt,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),e.jsx(Se,{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(Z,{className:"text-gray-300",children:"小程序 AppID"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:g.appId??"",onChange:te=>y(se=>({...se,appId:te.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"提现订阅模板 ID"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:g.withdrawSubscribeTmplId??"",onChange:te=>y(se=>({...se,withdrawSubscribeTmplId:te.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"微信支付商户号"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:g.mchId??"",onChange:te=>y(se=>({...se,mchId:te.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"最低提现金额 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:g.minWithdraw??10,onChange:te=>y(se=>({...se,minWithdraw:Number.parseFloat(te.target.value)||10}))})]})]})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(On,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),e.jsx(vt,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),e.jsxs(Se,{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(Z,{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(dt,{id:"match-enabled",checked:m.matchEnabled,disabled:U,onCheckedChange:te=>ee("matchEnabled",te)})]}),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(gb,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(Z,{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(dt,{id:"referral-enabled",checked:m.referralEnabled,disabled:U,onCheckedChange:te=>ee("referralEnabled",te)})]}),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(Ks,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(Z,{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(dt,{id:"search-enabled",checked:m.searchEnabled,disabled:U,onCheckedChange:te=>ee("searchEnabled",te)})]}),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(On,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(Z,{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(dt,{id:"about-enabled",checked:m.aboutEnabled,disabled:U,onCheckedChange:te=>ee("aboutEnabled",te)})]})]}),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(Ot,{value:"author",className:"mt-0",children:e.jsx(gC,{})}),e.jsx(Ot,{value:"admin",className:"mt-0",children:e.jsx(yC,{})})]}),e.jsx(St,{open:T,onOpenChange:b,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[e.jsxs(Ct,{children:[e.jsx(kt,{className:_?"text-red-400":"text-[#38bdac]",children:j}),e.jsx(h2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:C})]}),e.jsx(Dt,{className:"mt-4",children:e.jsx(q,{onClick:()=>b(!1),className:_?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const jx={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 CC(){const[r,a]=h.useState(!1),[l,o]=h.useState(jx),[c,u]=h.useState(""),m=async()=>{a(!0);try{const w=await Be("/api/config");w!=null&&w.paymentMethods&&o({...jx,...w.paymentMethods})}catch(w){console.error(w)}finally{a(!1)}};h.useEffect(()=>{m()},[]);const f=async()=>{a(!0);try{await ft("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(w){console.error("保存失败:",w),alert("保存失败: "+(w instanceof Error?w.message:String(w)))}finally{a(!1)}},g=(w,C)=>{navigator.clipboard.writeText(w),u(C),setTimeout(()=>u(""),2e3)},y=(w,C)=>{o(N=>({...N,wechat:{...N.wechat,[w]:C}}))},p=(w,C)=>{o(N=>({...N,alipay:{...N.alipay,[w]:C}}))},v=(w,C)=>{o(N=>({...N,usdt:{...N.usdt,[w]:C}}))},E=(w,C)=>{o(N=>({...N,paypal:{...N.paypal,[w]:C}}))},P=l.wechat,T=l.alipay,b=l.usdt,j=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(q,{variant:"outline",onClick:m,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 ${r?"animate-spin":""}`}),"同步配置"]}),e.jsxs(q,{onClick:f,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{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($x,{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(Ol,{defaultValue:"wechat",className:"space-y-6",children:[e.jsxs(Fa,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[e.jsxs(Lt,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[e.jsx(Il,{className:"w-4 h-4 mr-2"}),"微信"]}),e.jsxs(Lt,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[e.jsx(Of,{className:"w-4 h-4 mr-2"}),"支付宝"]}),e.jsxs(Lt,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[e.jsx(Df,{className:"w-4 h-4 mr-2"}),"USDT"]}),e.jsxs(Lt,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[e.jsx(Kd,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),e.jsx(Ot,{value:"wechat",className:"space-y-4",children:e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Il,{className:"w-5 h-5"}),"微信支付配置"]}),e.jsx(vt,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(dt,{checked:!!P.enabled,onCheckedChange:w=>y("enabled",w)})]}),e.jsxs(Se,{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(Z,{className:"text-gray-300",children:"网站AppID"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:w=>y("websiteAppId",w.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"商户号"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.merchantId??""),onChange:w=>y("merchantId",w.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(lo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"微信收款码/支付链接"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(P.qrCode??""),onChange:w=>y("qrCode",w.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(Z,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),e.jsx(le,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(P.groupQrCode??""),onChange:w=>y("groupQrCode",w.target.value)}),e.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),e.jsx(Ot,{value:"alipay",className:"space-y-4",children:e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"text-[#1677FF] flex items-center gap-2",children:[e.jsx(Of,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(vt,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(dt,{checked:!!T.enabled,onCheckedChange:w=>p("enabled",w)})]}),e.jsxs(Se,{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(Z,{className:"text-gray-300",children:"合作者身份 (PID)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.partnerId??""),onChange:w=>p("partnerId",w.target.value)}),e.jsx(q,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>g(String(T.partnerId??""),"pid"),children:c==="pid"?e.jsx(jo,{className:"w-4 h-4 text-green-500"}):e.jsx(Ux,{className:"w-4 h-4 text-gray-400"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"安全校验码 (Key)"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.securityKey??""),onChange:w=>p("securityKey",w.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(lo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(T.qrCode??""),onChange:w=>p("qrCode",w.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),e.jsx(Ot,{value:"usdt",className:"space-y-4",children:e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"text-[#26A17B] flex items-center gap-2",children:[e.jsx(Df,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(vt,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(dt,{checked:!!b.enabled,onCheckedChange:w=>v("enabled",w)})]}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{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(b.network??"TRC20"),onChange:w=>v("network",w.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(Z,{className:"text-gray-300",children:"收款地址"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(b.address??""),onChange:w=>v("address",w.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:w=>v("exchangeRate",Number.parseFloat(w.target.value)||7.2)})]})]})]})}),e.jsx(Ot,{value:"paypal",className:"space-y-4",children:e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ge,{className:"text-[#169BD7] flex items-center gap-2",children:[e.jsx(Kd,{className:"w-5 h-5"}),"PayPal配置"]}),e.jsx(vt,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(dt,{checked:!!j.enabled,onCheckedChange:w=>E("enabled",w)})]}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"PayPal邮箱"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(j.email??""),onChange:w=>E("email",w.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(j.exchangeRate)??7.2,onChange:w=>E("exchangeRate",Number(w.target.value)||7.2)})]})]})]})})]})]})}const kC={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},EC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},PC={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function TC(){const[r,a]=h.useState({siteConfig:{...kC},menuConfig:{...EC},pageConfig:{...PC}}),[l,o]=h.useState(!1),[c,u]=h.useState(!1);h.useEffect(()=>{Be("/api/config").then(p=>{p!=null&&p.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...p.siteConfig}})),p!=null&&p.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...p.menuConfig}})),p!=null&&p.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...p.pageConfig}}))}).catch(console.error)},[]);const m=async()=>{u(!0);try{await ft("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await ft("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await ft("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(p){console.error(p),alert("保存失败: "+(p instanceof Error?p.message:String(p)))}finally{u(!1)}},f=r.siteConfig,g=r.menuConfig,y=r.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(q,{onClick:m,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Kd,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),e.jsx(vt,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),e.jsxs(Se,{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(Z,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),e.jsx(le,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteName??"",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:p.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),e.jsx(le,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteTitle??"",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:p.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),e.jsx(le,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteDescription??"",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:p.target.value}}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),e.jsx(le,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:f.logo??"",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:p.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),e.jsx(le,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:f.favicon??"",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:p.target.value}}))})]})]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Kb,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),e.jsx(vt,{className:"text-gray-400",children:"配置网站主题色"})]}),e.jsx(Se,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(Z,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(le,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:f.primaryColor??"#00CED1",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:p.target.value}}))}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:f.primaryColor??"#00CED1",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:p.target.value}}))})]})]}),e.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:f.primaryColor??"#00CED1"},children:"预览"})]})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Bb,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),e.jsx(vt,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),e.jsx(Se,{className:"space-y-4",children:Object.entries(g).map(([p,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(dt,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:E=>a(P=>({...P,menuConfig:{...P.menuConfig,[p]:{...v,enabled:E}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:p}),e.jsx(le,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:E=>a(P=>({...P,menuConfig:{...P.menuConfig,[p]:{...v,label:E.target.value}}}))})]}),e.jsx("span",{className:`text-sm ${v!=null&&v.enabled?"text-green-400":"text-gray-500"}`,children:v!=null&&v.enabled?"显示":"隐藏"})]},p))})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(fb,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),e.jsx(vt,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),e.jsxs(Se,{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(Z,{className:"text-gray-300",children:"首页标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:p.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"首页副标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeSubtitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:p.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"目录页标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.chaptersTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:p.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"匹配页标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.matchTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:p.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"我的页标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.myTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:p.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"关于作者标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.aboutTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:p.target.value}}))})]})]})]})]})]})]})}function RC(){const[r,a]=h.useState(""),[l,o]=h.useState(""),[c,u]=h.useState(""),[m,f]=h.useState({}),g=async()=>{var P,T,b,j;try{const w=await Be("/api/config"),C=(T=(P=w==null?void 0:w.liveQRCodes)==null?void 0:P[0])==null?void 0:T.urls;Array.isArray(C)&&a(C.join(`
|
||
`));const N=(j=(b=w==null?void 0:w.paymentMethods)==null?void 0:b.wechat)==null?void 0:j.groupQrCode;N&&o(N),f({paymentMethods:w==null?void 0:w.paymentMethods,liveQRCodes:w==null?void 0:w.liveQRCodes})}catch(w){console.error(w)}};h.useEffect(()=>{g()},[]);const y=(P,T)=>{navigator.clipboard.writeText(P),u(T),setTimeout(()=>u(""),2e3)},p=async()=>{try{const P=r.split(`
|
||
`).map(b=>b.trim()).filter(Boolean),T=[...m.liveQRCodes||[]];T[0]?T[0].urls=P:T.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await ft("/api/db/config",{key:"live_qr_codes",value:T,description:"群活码配置"}),alert("群活码配置已保存!"),await g()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},v=async()=>{var P;try{await ft("/api/db/config",{key:"payment_methods",value:{...m.paymentMethods||{},wechat:{...((P=m.paymentMethods)==null?void 0:P.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await g()}catch(T){console.error(T),alert("保存失败: "+(T instanceof Error?T.message:String(T)))}},E=()=>{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($x,{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(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx($f,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),e.jsx(vt,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(zf,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(le,{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(q,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>y(l,"group"),children:c==="group"?e.jsx(jo,{className:"w-4 h-4 text-green-500"}):e.jsx(Ux,{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(lo,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(q,{onClick:v,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[e.jsx(io,{className:"w-4 h-4 mr-2"}),"保存配置"]}),e.jsxs(q,{onClick:E,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[e.jsx(lo,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx($f,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),e.jsx(vt,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(zf,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),e.jsx(dn,{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:r,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:[r.split(`
|
||
`).filter(Boolean).length," 个"]})]}),e.jsxs(q,{onClick:p,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(io,{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 bx={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}},IC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function _C(){const[r,a]=h.useState(bx),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[m,f]=h.useState(!1),[g,y]=h.useState(null),[p,v]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),E=async()=>{o(!0);try{const N=await Be("/api/db/config/full?key=match_config"),_=(N==null?void 0:N.data)??(N==null?void 0:N.config);_&&a({...bx,..._})}catch(N){console.error("加载匹配配置失败:",N)}finally{o(!1)}};h.useEffect(()=>{E()},[]);const P=async()=>{u(!0);try{const N=await ft("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});N&&N.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(N&&typeof N=="object"&&"error"in N?N.error:"未知错误"))}catch(N){console.error("保存配置失败:",N),alert("保存失败")}finally{u(!1)}},T=N=>{y(N),v({id:N.id,label:N.label,matchLabel:N.matchLabel,icon:N.icon,matchFromDB:N.matchFromDB,showJoinAfterMatch:N.showJoinAfterMatch,price:N.price,enabled:N.enabled}),f(!0)},b=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},j=()=>{if(!p.id||!p.label){alert("请填写类型ID和名称");return}const N=[...r.matchTypes];if(g){const _=N.findIndex(V=>V.id===g.id);_!==-1&&(N[_]={...p})}else{if(N.some(_=>_.id===p.id)){alert("类型ID已存在");return}N.push({...p})}a({...r,matchTypes:N}),f(!1)},w=N=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(_=>_.id!==N)})},C=N=>{a({...r,matchTypes:r.matchTypes.map(_=>_.id===N?{..._,enabled:!_.enabled}:_)})};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(On,{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(q,{variant:"outline",onClick:E,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(q,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),e.jsx(vt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(Se,{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(Z,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:N=>a({...r,freeMatchLimit:parseInt(N.target.value,10)||0})}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:N=>a({...r,matchPrice:parseFloat(N.target.value)||1})}),e.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(le,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:N=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(N.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(dt,{checked:r.settings.enableFreeMatches,onCheckedChange:N=>a({...r,settings:{...r.settings,enableFreeMatches:N}})}),e.jsx(Z,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enablePaidMatches,onCheckedChange:N=>a({...r,settings:{...r.settings,enablePaidMatches:N}})}),e.jsx(Z,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),e.jsx(vt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(q,{onClick:b,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),e.jsx(Se,{children:e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"图标"}),e.jsx(be,{className:"text-gray-400",children:"类型ID"}),e.jsx(be,{className:"text-gray-400",children:"显示名称"}),e.jsx(be,{className:"text-gray-400",children:"匹配标签"}),e.jsx(be,{className:"text-gray-400",children:"价格"}),e.jsx(be,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(gs,{children:r.matchTypes.map(N=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(xe,{children:e.jsx("span",{className:"text-2xl",children:N.icon})}),e.jsx(xe,{className:"font-mono text-gray-300",children:N.id}),e.jsx(xe,{className:"text-white font-medium",children:N.label}),e.jsx(xe,{className:"text-gray-300",children:N.matchLabel}),e.jsx(xe,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",N.price]})}),e.jsx(xe,{children:N.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(xe,{children:e.jsx(dt,{checked:N.enabled,onCheckedChange:()=>C(N.id)})}),e.jsx(xe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(N),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>w(N.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Wt,{className:"w-4 h-4"})})]})})]},N.id))})]})})]}),e.jsx(St,{open:m,onOpenChange:f,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[g?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Pt,{className:"w-5 h-5 text-[#38bdac]"}),g?"编辑匹配类型":"添加匹配类型"]})}),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(Z,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:p.id,onChange:N=>v({...p,id:N.target.value}),disabled:!!g})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:IC.map(N=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${p.icon===N?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...p,icon:N}),children:N},N))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"显示名称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:p.label,onChange:N=>v({...p,label:N.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"匹配标签"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:p.matchLabel,onChange:N=>v({...p,matchLabel:N.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:p.price,onChange:N=>v({...p,price:parseFloat(N.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(dt,{checked:p.matchFromDB,onCheckedChange:N=>v({...p,matchFromDB:N})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:p.showJoinAfterMatch,onCheckedChange:N=>v({...p,showJoinAfterMatch:N})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:p.enabled,onCheckedChange:N=>v({...p,enabled:N})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>f(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(q,{onClick:j,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const Nx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function MC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[g,y]=h.useState(""),[p,v]=h.useState(!0),[E,P]=h.useState(null);async function T(){v(!0),P(null);try{const j=new URLSearchParams({page:String(c),pageSize:String(m)});g&&j.set("matchType",g);const w=await Be(`/api/db/match-records?${j}`);w!=null&&w.success?(a(w.records||[]),o(w.total??0)):P("加载匹配记录失败")}catch(j){console.error("加载匹配记录失败",j),P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{T()},[c,g]);const b=Math.ceil(l/m)||1;return e.jsxs("div",{className:"p-8 w-full",children:[E&&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:E}),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:g,onChange:j=>{y(j.target.value),u(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(Nx).map(([j,w])=>e.jsx("option",{value:j,children:w},j))]}),e.jsxs("button",{type:"button",onClick:T,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(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Se,{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(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(gs,{children:[r.map(j=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(xe,{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:[j.userAvatar?e.jsx("img",{src:j.userAvatar,alt:"",className:"w-full h-full object-cover",onError:w=>{w.currentTarget.style.display="none";const C=w.currentTarget.nextElementSibling;C&&C.classList.remove("hidden")}}):null,e.jsx("span",{className:j.userAvatar?"hidden":"",children:(j.userNickname||j.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:j.userNickname||j.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[j.userId.slice(0,16),"..."]})]})]})}),e.jsx(xe,{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:[j.matchedUserAvatar?e.jsx("img",{src:j.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:w=>{w.currentTarget.style.display="none";const C=w.currentTarget.nextElementSibling;C&&C.classList.remove("hidden")}}):null,e.jsx("span",{className:j.matchedUserAvatar?"hidden":"",children:(j.matchedNickname||j.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:j.matchedNickname||j.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[j.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(xe,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Nx[j.matchType]||j.matchType})}),e.jsxs(xe,{className:"text-gray-400 text-sm",children:[j.phone&&e.jsxs("div",{children:["📱 ",j.phone]}),j.wechatId&&e.jsxs("div",{children:["💬 ",j.wechatId]}),!j.phone&&!j.wechatId&&"-"]}),e.jsx(xe,{className:"text-gray-400",children:j.createdAt?new Date(j.createdAt).toLocaleString():"-"})]},j.id)),r.length===0&&e.jsx(Je,{children:e.jsx(xe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:b,total:l,pageSize:m,onPageChange:u,onPageSizeChange:j=>{f(j),u(1)}})]})})})]})}function AC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[m,f]=h.useState(null),[g,y]=h.useState(""),[p,v]=h.useState(0),[E,P]=h.useState(!1);async function T(){o(!0);try{const N=await Be("/api/db/vip-roles");N!=null&&N.success&&N.data&&a(N.data)}catch(N){console.error("Load roles error:",N)}finally{o(!1)}}h.useEffect(()=>{T()},[]);const b=()=>{f(null),y(""),v(r.length>0?Math.max(...r.map(N=>N.sort))+1:0),u(!0)},j=N=>{f(N),y(N.name),v(N.sort),u(!0)},w=async()=>{if(!g.trim()){alert("角色名称不能为空");return}P(!0);try{if(m){const N=await yt("/api/db/vip-roles",{id:m.id,name:g.trim(),sort:p});N!=null&&N.success?(u(!1),T()):alert("更新失败: "+(N==null?void 0:N.error))}else{const N=await ft("/api/db/vip-roles",{name:g.trim(),sort:p});N!=null&&N.success?(u(!1),T()):alert("新增失败: "+(N==null?void 0:N.error))}}catch(N){console.error("Save error:",N),alert("保存失败")}finally{P(!1)}},C=async N=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const _=await kr(`/api/db/vip-roles?id=${N}`);_!=null&&_.success?T():alert("删除失败: "+(_==null?void 0:_.error))}catch(_){console.error("Delete error:",_),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(sn,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),e.jsxs(q,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"角色名称"}),e.jsx(be,{className:"text-gray-400",children:"排序"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(N=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(xe,{className:"text-gray-300",children:N.id}),e.jsx(xe,{className:"text-white",children:N.name}),e.jsx(xe,{className:"text-gray-400",children:N.sort}),e.jsxs(xe,{className:"text-right",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>j(N),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>C(N.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]},N.id)),r.length===0&&e.jsx(Je,{children:e.jsx(xe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),e.jsx(St,{open:c,onOpenChange:u,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:m?"编辑角色":"新增角色"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"角色名称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:g,onChange:N=>y(N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p,onChange:N=>v(parseInt(N.target.value,10)||0)})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>u(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:w,disabled:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),E?"保存中...":"保存"]})]})]})})]})}function kg({embedded:r=!1}){const[a,l]=h.useState([]),[o,c]=h.useState(!0),[u,m]=h.useState(!1),[f,g]=h.useState(null),[y,p]=h.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[v,E]=h.useState(!1),[P,T]=h.useState(!1),b=h.useRef(null),j=async k=>{var ee;const R=(ee=k.target.files)==null?void 0:ee[0];if(R){T(!0);try{const ne=new FormData;ne.append("file",R),ne.append("folder","mentors");const ie=yu(),te={};ie&&(te.Authorization=`Bearer ${ie}`);const H=await(await fetch(Ia("/api/upload"),{method:"POST",body:ne,credentials:"include",headers:te})).json();H!=null&&H.success&&(H!=null&&H.url)?p(ae=>({...ae,avatar:H.url})):alert("上传失败: "+((H==null?void 0:H.error)||"未知错误"))}catch(ne){console.error(ne),alert("上传失败")}finally{T(!1),b.current&&(b.current.value="")}}};async function w(){c(!0);try{const k=await Be("/api/db/mentors");k!=null&&k.success&&k.data&&l(k.data)}catch(k){console.error("Load mentors error:",k)}finally{c(!1)}}h.useEffect(()=>{w()},[]);const C=()=>{p({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:a.length>0?Math.max(...a.map(k=>k.sort))+1:0,enabled:!0})},N=()=>{g(null),C(),m(!0)},_=k=>{g(k),p({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}),m(!0)},V=async()=>{if(!y.name.trim()){alert("导师姓名不能为空");return}E(!0);try{const k=ee=>ee===""?void 0:parseFloat(ee),R={name:y.name.trim(),avatar:y.avatar.trim()||void 0,intro:y.intro.trim()||void 0,tags:y.tags.trim()||void 0,priceSingle:k(y.priceSingle),priceHalfYear:k(y.priceHalfYear),priceYear:k(y.priceYear),quote:y.quote.trim()||void 0,whyFind:y.whyFind.trim()||void 0,offering:y.offering.trim()||void 0,judgmentStyle:y.judgmentStyle.trim()||void 0,sort:y.sort,enabled:y.enabled};if(f){const ee=await yt("/api/db/mentors",{id:f.id,...R});ee!=null&&ee.success?(m(!1),w()):alert("更新失败: "+(ee==null?void 0:ee.error))}else{const ee=await ft("/api/db/mentors",R);ee!=null&&ee.success?(m(!1),w()):alert("新增失败: "+(ee==null?void 0:ee.error))}}catch(k){console.error("Save error:",k),alert("保存失败")}finally{E(!1)}},U=async k=>{if(confirm("确定删除该导师?"))try{const R=await kr(`/api/db/mentors?id=${k}`);R!=null&&R.success?w():alert("删除失败: "+(R==null?void 0:R.error))}catch(R){console.error("Delete error:",R),alert("删除失败")}},I=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(q,{onClick:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{className:"p-0",children:o?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"姓名"}),e.jsx(be,{className:"text-gray-400",children:"简介"}),e.jsx(be,{className:"text-gray-400",children:"单次"}),e.jsx(be,{className:"text-gray-400",children:"半年"}),e.jsx(be,{className:"text-gray-400",children:"年度"}),e.jsx(be,{className:"text-gray-400",children:"排序"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(gs,{children:[a.map(k=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(xe,{className:"text-gray-300",children:k.id}),e.jsx(xe,{className:"text-white",children:k.name}),e.jsx(xe,{className:"text-gray-400 max-w-[200px] truncate",children:k.intro||"-"}),e.jsx(xe,{className:"text-gray-400",children:I(k.priceSingle)}),e.jsx(xe,{className:"text-gray-400",children:I(k.priceHalfYear)}),e.jsx(xe,{className:"text-gray-400",children:I(k.priceYear)}),e.jsx(xe,{className:"text-gray-400",children:k.sort}),e.jsxs(xe,{className:"text-right",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>_(k),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>U(k.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Wt,{className:"w-4 h-4"})})]})]},k.id)),a.length===0&&e.jsx(Je,{children:e.jsx(xe,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),e.jsx(St,{open:u,onOpenChange:m,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx(Ct,{children:e.jsx(kt,{className:"text-white",children:f?"编辑导师":"新增导师"})}),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(Z,{className:"text-gray-300",children:"姓名 *"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:y.name,onChange:k=>p(R=>({...R,name:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"排序"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:y.sort,onChange:k=>p(R=>({...R,sort:parseInt(k.target.value,10)||0}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"头像"}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:y.avatar,onChange:k=>p(R=>({...R,avatar:k.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:b,type:"file",accept:"image/*",className:"hidden",onChange:j}),e.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:P,onClick:()=>{var k;return(k=b.current)==null?void 0:k.click()},children:[e.jsx(io,{className:"w-4 h-4 mr-2"}),P?"上传中...":"上传"]})]}),y.avatar&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:y.avatar.startsWith("http")?y.avatar:Ia(y.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(Z,{className:"text-gray-300",children:"简介"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:y.intro,onChange:k=>p(R=>({...R,intro:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:y.tags,onChange:k=>p(R=>({...R,tags:k.target.value}))})]}),e.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[e.jsx(Z,{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(Z,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),e.jsx(le,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:y.priceSingle,onChange:k=>p(R=>({...R,priceSingle:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),e.jsx(le,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:y.priceHalfYear,onChange:k=>p(R=>({...R,priceHalfYear:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),e.jsx(le,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:y.priceYear,onChange:k=>p(R=>({...R,priceYear:k.target.value}))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"引言"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:y.quote,onChange:k=>p(R=>({...R,quote:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"为什么找(文本)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:y.whyFind,onChange:k=>p(R=>({...R,whyFind:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"提供什么(文本)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:y.offering,onChange:k=>p(R=>({...R,offering:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:y.judgmentStyle,onChange:k=>p(R=>({...R,judgmentStyle:k.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:y.enabled,onChange:k=>p(R=>({...R,enabled:k.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),e.jsx(Z,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),e.jsxs(Dt,{children:[e.jsxs(q,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(fs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:V,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})})]})}function DC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState("");async function m(){o(!0);try{const y=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",p=await Be(y);p!=null&&p.success&&p.data&&a(p.data)}catch(y){console.error("Load consultations error:",y)}finally{o(!1)}}h.useEffect(()=>{m()},[c]);const f={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},g={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(ao,{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=>u(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(f).map(([y,p])=>e.jsx("option",{value:y,children:p},y))]}),e.jsxs(q,{onClick:m,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(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户ID"}),e.jsx(be,{className:"text-gray-400",children:"导师ID"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(gs,{children:[r.map(y=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(xe,{className:"text-gray-300",children:y.id}),e.jsx(xe,{className:"text-gray-400",children:y.userId}),e.jsx(xe,{className:"text-gray-400",children:y.mentorId}),e.jsx(xe,{className:"text-gray-400",children:g[y.consultationType]||y.consultationType}),e.jsxs(xe,{className:"text-white",children:["¥",y.amount]}),e.jsx(xe,{className:"text-gray-400",children:f[y.status]||y.status}),e.jsx(xe,{className:"text-gray-500 text-sm",children:y.createdAt})]},y.id)),r.length===0&&e.jsx(Je,{children:e.jsx(xe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const Sa={poolSource:"vip",requirePhone:!0,requireNickname:!0,requireAvatar:!1,requireBusiness:!1},wx={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},poolSettings:Sa},LC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function OC(){const[r,a]=h.useState(wx),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[m,f]=h.useState(!1),[g,y]=h.useState(null),[p,v]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),[E,P]=h.useState(null),[T,b]=h.useState(!1),j=async()=>{b(!0);try{const k=await Be("/api/db/match-pool-counts");k!=null&&k.success&&k.data&&P(k.data)}catch(k){console.error("加载池子人数失败:",k)}finally{b(!1)}},w=async()=>{o(!0);try{const k=await Be("/api/db/config/full?key=match_config"),R=(k==null?void 0:k.data)??(k==null?void 0:k.config);R&&a({...wx,...R,poolSettings:R.poolSettings??Sa})}catch(k){console.error("加载匹配配置失败:",k)}finally{o(!1)}};h.useEffect(()=>{w(),j()},[]);const C=async()=>{u(!0);try{const k=await ft("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});alert((k==null?void 0:k.success)!==!1?"配置保存成功!":"保存失败: "+((k==null?void 0:k.error)||"未知错误"))}catch(k){console.error(k),alert("保存失败")}finally{u(!1)}},N=k=>{y(k),v({...k}),f(!0)},_=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},V=()=>{if(!p.id||!p.label){alert("请填写类型ID和名称");return}const k=[...r.matchTypes];if(g){const R=k.findIndex(ee=>ee.id===g.id);R!==-1&&(k[R]={...p})}else{if(k.some(R=>R.id===p.id)){alert("类型ID已存在");return}k.push({...p})}a({...r,matchTypes:k}),f(!1)},U=k=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(R=>R.id!==k)})},I=k=>{a({...r,matchTypes:r.matchTypes.map(R=>R.id===k?{...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(q,{variant:"outline",onClick:w,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(q,{onClick:C,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"})," ",c?"保存中...":"保存配置"]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Vx,{className:"w-5 h-5 text-blue-400"})," 匹配池选择"]}),e.jsx(vt,{className:"text-gray-400",children:"选择匹配的用户池和完善程度要求,只有满足条件的用户才可被匹配到"})]}),e.jsxs(Se,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(Z,{className:"text-gray-300",children:"匹配来源池"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[{value:"vip",label:"超级个体(VIP会员)",desc:"仅匹配付费 ¥1980 的VIP会员",icon:"👑",countKey:"vip"},{value:"complete",label:"完善资料用户",desc:"已完善联系方式+业务信息的用户",icon:"✅",countKey:"complete"},{value:"all",label:"全部流量池",desc:"所有已注册用户(含未完善资料)",icon:"👥",countKey:"all"}].map(k=>{const ee=(r.poolSettings??Sa).poolSource===k.value,ne=E==null?void 0:E[k.countKey];return e.jsxs("button",{type:"button",onClick:()=>a({...r,poolSettings:{...r.poolSettings??Sa,poolSource:k.value}}),className:`p-4 rounded-lg border text-left transition-all ${ee?"border-[#38bdac] bg-[#38bdac]/10":"border-gray-700 bg-[#0a1628] hover:border-gray-600"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xl",children:k.icon}),e.jsx("span",{className:`text-sm font-medium ${ee?"text-[#38bdac]":"text-gray-300"}`,children:k.label})]}),e.jsxs("span",{className:"text-lg font-bold text-white",children:[T?"...":ne??"-",e.jsx("span",{className:"text-xs text-gray-500 font-normal ml-1",children:"人"})]})]}),e.jsx("p",{className:"text-gray-500 text-xs mt-2",children:k.desc}),e.jsx("a",{href:`/users?pool=${k.value}`,onClick:ie=>ie.stopPropagation(),className:"text-[#38bdac] text-xs mt-2 inline-block hover:underline",children:"查看用户列表 →"})]},k.value)})})]}),e.jsxs("div",{className:"space-y-3 pt-4 border-t border-gray-700/50",children:[e.jsx(Z,{className:"text-gray-300",children:"用户资料完善要求(被匹配用户必须满足以下条件)"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{key:"requirePhone",label:"有手机号",icon:"📱"},{key:"requireNickname",label:"有昵称",icon:"👤"},{key:"requireAvatar",label:"有头像",icon:"🖼️"},{key:"requireBusiness",label:"有业务需求",icon:"💼"}].map(k=>{const ee=(r.poolSettings??Sa)[k.key];return e.jsxs("div",{className:"flex items-center gap-3 bg-[#0a1628] rounded-lg p-3",children:[e.jsx(dt,{checked:ee,onCheckedChange:ne=>a({...r,poolSettings:{...r.poolSettings??Sa,[k.key]:ne}})}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{children:k.icon}),e.jsx(Z,{className:"text-gray-300 text-sm",children:k.label})]})]},k.key)})})]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-yellow-400"})," 基础设置"]}),e.jsx(vt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(Se,{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(Z,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:k=>a({...r,freeMatchLimit:parseInt(k.target.value,10)||0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:k=>a({...r,matchPrice:parseFloat(k.target.value)||1})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(le,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:k=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(k.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(dt,{checked:r.settings.enableFreeMatches,onCheckedChange:k=>a({...r,settings:{...r.settings,enableFreeMatches:k}})}),e.jsx(Z,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enablePaidMatches,onCheckedChange:k=>a({...r,settings:{...r.settings,enablePaidMatches:k}})}),e.jsx(Z,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"})," 匹配类型管理"]}),e.jsx(vt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(q,{onClick:_,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Pt,{className:"w-4 h-4 mr-1"})," 添加类型"]})]}),e.jsx(Se,{children:e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"图标"}),e.jsx(be,{className:"text-gray-400",children:"类型ID"}),e.jsx(be,{className:"text-gray-400",children:"显示名称"}),e.jsx(be,{className:"text-gray-400",children:"匹配标签"}),e.jsx(be,{className:"text-gray-400",children:"价格"}),e.jsx(be,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(gs,{children:r.matchTypes.map(k=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(xe,{children:e.jsx("span",{className:"text-2xl",children:k.icon})}),e.jsx(xe,{className:"font-mono text-gray-300",children:k.id}),e.jsx(xe,{className:"text-white font-medium",children:k.label}),e.jsx(xe,{className:"text-gray-300",children:k.matchLabel}),e.jsx(xe,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",k.price]})}),e.jsx(xe,{children:k.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(xe,{children:e.jsx(dt,{checked:k.enabled,onCheckedChange:()=>I(k.id)})}),e.jsx(xe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>N(k),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>U(k.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Wt,{className:"w-4 h-4"})})]})})]},k.id))})]})})]}),e.jsx(St,{open:m,onOpenChange:f,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(Ct,{children:e.jsxs(kt,{className:"text-white flex items-center gap-2",children:[g?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Pt,{className:"w-5 h-5 text-[#38bdac]"}),g?"编辑匹配类型":"添加匹配类型"]})}),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(Z,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:p.id,onChange:k=>v({...p,id:k.target.value}),disabled:!!g})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:LC.map(k=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${p.icon===k?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...p,icon:k}),children:k},k))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"显示名称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:p.label,onChange:k=>v({...p,label:k.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"匹配标签"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:p.matchLabel,onChange:k=>v({...p,matchLabel:k.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Z,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:p.price,onChange:k=>v({...p,price:parseFloat(k.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(dt,{checked:p.matchFromDB,onCheckedChange:k=>v({...p,matchFromDB:k})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:p.showJoinAfterMatch,onCheckedChange:k=>v({...p,showJoinAfterMatch:k})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:p.enabled,onCheckedChange:k=>v({...p,enabled:k})}),e.jsx(Z,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Dt,{children:[e.jsx(q,{variant:"outline",onClick:()=>f(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(q,{onClick:V,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(_t,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const Sx={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function FC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[g,y]=h.useState(""),[p,v]=h.useState(!0),[E,P]=h.useState(null);async function T(){v(!0),P(null);try{const j=new URLSearchParams({page:String(c),pageSize:String(m)});g&&j.set("matchType",g);const w=await Be(`/api/db/match-records?${j}`);w!=null&&w.success?(a(w.records||[]),o(w.total??0)):P("加载匹配记录失败")}catch{P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{T()},[c,g]);const b=Math.ceil(l/m)||1;return e.jsxs("div",{children:[E&&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:E}),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:g,onChange:j=>{y(j.target.value),u(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(Sx).map(([j,w])=>e.jsx("option",{value:j,children:w},j))]}),e.jsxs("button",{type:"button",onClick:T,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(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Se,{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(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(gs,{children:[r.map(j=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(xe,{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:[j.userAvatar?e.jsx("img",{src:j.userAvatar,alt:"",className:"w-full h-full object-cover",onError:w=>{w.currentTarget.style.display="none"}}):null,e.jsx("span",{className:j.userAvatar?"hidden":"",children:(j.userNickname||j.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:j.userNickname||j.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[j.userId.slice(0,16),"..."]})]})]})}),e.jsx(xe,{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:[j.matchedUserAvatar?e.jsx("img",{src:j.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:w=>{w.currentTarget.style.display="none"}}):null,e.jsx("span",{className:j.matchedUserAvatar?"hidden":"",children:(j.matchedNickname||j.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:j.matchedNickname||j.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[j.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(xe,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Sx[j.matchType]||j.matchType})}),e.jsxs(xe,{className:"text-gray-400 text-sm",children:[j.phone&&e.jsxs("div",{children:["📱 ",j.phone]}),j.wechatId&&e.jsxs("div",{children:["💬 ",j.wechatId]}),!j.phone&&!j.wechatId&&"-"]}),e.jsx(xe,{className:"text-gray-400",children:j.createdAt?new Date(j.createdAt).toLocaleString():"-"})]},j.id)),r.length===0&&e.jsx(Je,{children:e.jsx(xe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:b,total:l,pageSize:m,onPageChange:u,onPageSizeChange:j=>{f(j),u(1)}})]})})})]})}function zC(){const[r,a]=h.useState("pool");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>a("pool"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-all ${r==="pool"?"bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/50":"bg-[#0a1628] text-gray-400 border border-gray-700 hover:text-white"}`,children:"匹配池设置"}),e.jsx("button",{type:"button",onClick:()=>a("records"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-all ${r==="records"?"bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/50":"bg-[#0a1628] text-gray-400 border border-gray-700 hover:text-white"}`,children:"匹配记录"})]}),r==="pool"&&e.jsx(OC,{}),r==="records"&&e.jsx(FC,{})]})}const Cx={investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function $C(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[g,y]=h.useState(!0),[p,v]=h.useState("investor"),[E,P]=h.useState(null);async function T(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(m),matchType:p}),N=await Be(`/api/db/match-records?${C}`);N!=null&&N.success&&(a(N.records||[]),o(N.total??0))}catch(C){console.error(C)}finally{y(!1)}}h.useEffect(()=>{T()},[c,p]);const b=async C=>{if(!C.phone&&!C.wechatId){alert("该记录无联系方式,无法推送到存客宝");return}P(C.id);try{const N=await ft("/api/ckb/join",{type:C.matchType||"investor",phone:C.phone||"",wechat:C.wechatId||"",userId:C.userId,name:C.userNickname||""});alert((N==null?void 0:N.message)||(N!=null&&N.success?"推送成功":"推送失败"))}catch(N){alert("推送失败: "+(N instanceof Error?N.message:"网络错误"))}finally{P(null)}},j=Math.ceil(l/m)||1,w=C=>!!(C.phone||C.wechatId);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400",children:"点击获客:有人填写手机号/微信号的直接显示,可一键推送到存客宝"}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["共 ",l," 条记录 — 有联系方式的可触发存客宝添加好友"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:p,onChange:C=>{v(C.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:Object.entries(Cx).map(([C,N])=>e.jsx("option",{value:C,children:N},C))}),e.jsxs(q,{onClick:T,disabled:g,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 ${g?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Se,{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(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"时间"}),e.jsx(be,{className:"text-gray-400 text-right",children:"操作"})]})}),e.jsxs(gs,{children:[r.map(C=>{var N,_;return e.jsxs(Je,{className:`border-gray-700/50 ${w(C)?"hover:bg-[#0a1628]":"opacity-60"}`,children:[e.jsx(xe,{className:"text-white",children:C.userNickname||((N=C.userId)==null?void 0:N.slice(0,12))}),e.jsx(xe,{className:"text-white",children:C.matchedNickname||((_=C.matchedUserId)==null?void 0:_.slice(0,12))}),e.jsx(xe,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Cx[C.matchType]||C.matchType})}),e.jsxs(xe,{className:"text-sm",children:[C.phone&&e.jsxs("div",{className:"text-green-400",children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{className:"text-blue-400",children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&e.jsx("span",{className:"text-gray-600",children:"无联系方式"})]}),e.jsx(xe,{className:"text-gray-400 text-sm",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"}),e.jsx(xe,{className:"text-right",children:w(C)?e.jsxs(q,{size:"sm",onClick:()=>b(C),disabled:E===C.id,className:"bg-[#38bdac] hover:bg-[#2da396] text-white text-xs h-7 px-3",children:[e.jsx(nN,{className:"w-3 h-3 mr-1"}),E===C.id?"推送中...":"推送CKB"]}):e.jsx("span",{className:"text-gray-600 text-xs",children:"—"})})]},C.id)}),r.length===0&&e.jsx(Je,{children:e.jsx(xe,{colSpan:6,className:"text-center py-12 text-gray-500",children:"暂无记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:j,total:l,pageSize:m,onPageChange:u,onPageSizeChange:C=>{f(C),u(1)}})]})})})]})}const kx={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},BC={single:"单次",half_year:"半年",year:"年度"};function UC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState("");async function m(){o(!0);try{const f=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",g=await Be(f);g!=null&&g.success&&g.data&&a(g.data)}catch(f){console.error(f)}finally{o(!1)}}return h.useEffect(()=>{m()},[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:f=>u(f.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(kx).map(([f,g])=>e.jsx("option",{value:f,children:g},f))]}),e.jsxs(q,{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.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户ID"}),e.jsx(be,{className:"text-gray-400",children:"导师ID"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(gs,{children:[r.map(f=>e.jsxs(Je,{className:"border-gray-700/50",children:[e.jsx(xe,{className:"text-gray-300",children:f.id}),e.jsx(xe,{className:"text-gray-400",children:f.userId}),e.jsx(xe,{className:"text-gray-400",children:f.mentorId}),e.jsx(xe,{className:"text-gray-400",children:BC[f.consultationType]||f.consultationType}),e.jsxs(xe,{className:"text-white",children:["¥",f.amount]}),e.jsx(xe,{className:"text-gray-400",children:kx[f.status]||f.status}),e.jsx(xe,{className:"text-gray-500 text-sm",children:f.createdAt?new Date(f.createdAt).toLocaleString():"-"})]},f.id)),r.length===0&&e.jsx(Je,{children:e.jsx(xe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function VC(){const[r,a]=h.useState("booking");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>a("booking"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-all ${r==="booking"?"bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/50":"bg-[#0a1628] text-gray-400 border border-gray-700 hover:text-white"}`,children:"预约记录"}),e.jsx("button",{type:"button",onClick:()=>a("manage"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-all ${r==="manage"?"bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/50":"bg-[#0a1628] text-gray-400 border border-gray-700 hover:text-white"}`,children:"导师管理"})]}),r==="booking"&&e.jsx(UC,{}),r==="manage"&&e.jsx("div",{className:"-mx-8",children:e.jsx(kg,{embedded:!0})})]})}function WC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[g,y]=h.useState(!0);async function p(){y(!0);try{const E=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"team"}),P=await Be(`/api/db/match-records?${E}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(E){console.error(E)}finally{y(!1)}}h.useEffect(()=>{p()},[c]);const v=Math.ceil(l/m)||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:p,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(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Se,{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(xs,{children:[e.jsx(ps,{children:e.jsxs(Je,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(gs,{children:[r.map(E=>e.jsxs(Je,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(xe,{className:"text-white",children:E.userNickname||E.userId}),e.jsx(xe,{className:"text-white",children:E.matchedNickname||E.matchedUserId}),e.jsxs(xe,{className:"text-gray-400 text-sm",children:[E.phone&&e.jsxs("div",{children:["📱 ",E.phone]}),E.wechatId&&e.jsxs("div",{children:["💬 ",E.wechatId]}),!E.phone&&!E.wechatId&&"-"]}),e.jsx(xe,{className:"text-gray-400",children:E.createdAt?new Date(E.createdAt).toLocaleString():"-"})]},E.id)),r.length===0&&e.jsx(Je,{children:e.jsx(xe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无团队招募记录"})})]})]}),e.jsx(Hs,{page:c,totalPages:v,total:l,pageSize:m,onPageChange:u,onPageSizeChange:E=>{f(E),u(1)}})]})})})]})}const HC={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},KC={partner:"⭐",investor:"👥",mentor:"❤️",team:"🎮"};function GC(){const[r,a]=h.useState(null),[l,o]=h.useState(!0),[c,u]=h.useState("13800000000"),[m,f]=h.useState(""),[g,y]=h.useState([{endpoint:"/api/ckb/join",label:"场景获客 — 加入(partner)",description:"用测试手机号添加到存客宝「创业合伙」计划",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"场景获客 — 加入(investor)",description:"用测试手机号添加到存客宝「资源对接」计划",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"场景获客 — 加入(mentor)",description:"用测试手机号添加到存客宝「导师顾问」计划",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"场景获客 — 加入(team)",description:"用测试手机号添加到存客宝「团队招募」计划",method:"POST",status:"idle"},{endpoint:"/api/ckb/match",label:"匹配上报",description:"上报匹配行为到存客宝",method:"POST",status:"idle"},{endpoint:"/api/miniprogram/ckb/lead",label:"链接卡若",description:"首页「链接卡若」留资到存客宝",method:"POST",status:"idle"},{endpoint:"/api/match/config",label:"匹配配置",description:"获取匹配类型、价格等配置",method:"GET",status:"idle"}]),p=h.useCallback(async()=>{o(!0);try{const b=await Be("/api/db/match-records?stats=true");if(b!=null&&b.success&&b.data)a(b.data);else{const j=await Be("/api/db/match-records?page=1&pageSize=1");j!=null&&j.success&&a({totalMatches:j.total??0,todayMatches:0,byType:[],uniqueUsers:0})}}catch(b){console.error("加载统计失败:",b)}finally{o(!1)}},[]);h.useEffect(()=>{p()},[p]);const v=b=>{const j=c.trim(),w=m.trim(),C=["partner","investor","mentor","team"];return b<=3?{type:C[b],phone:j||void 0,wechat:w||void 0,userId:"admin_test",name:"后台测试",canHelp:b===1?"测试-我能帮到你":"",needHelp:b===1?"测试-我需要什么帮助":""}:b===4?{matchType:"partner",phone:j||void 0,wechat:w||void 0,userId:"admin_test",nickname:"后台测试",matchedUser:{id:"test_matched",nickname:"测试匹配用户",matchScore:88}}:b===5?{phone:j||void 0,wechatId:w||void 0,userId:"admin_test",name:"后台测试"}:{}},E=async b=>{const j=g[b];if(j.method==="POST"&&!c.trim()&&!m.trim()){alert("请至少填写测试手机号或微信号");return}const w=[...g];w[b]={...j,status:"testing",message:void 0,responseTime:void 0,ckbResponse:void 0},y(w);const C=performance.now();try{let N;j.method==="GET"?N=await Be(j.endpoint):N=await ft(j.endpoint,v(b));const _=Math.round(performance.now()-C),V=[...g],U=(N==null?void 0:N.success)===!0||(N==null?void 0:N.code)===200;V[b]={...j,status:U?"success":(N==null?void 0:N.success)===!1?"error":"success",message:(N==null?void 0:N.message)||(U?"接口正常":"返回异常"),responseTime:_,ckbResponse:N!=null&&N.data?JSON.stringify(N.data).slice(0,100):void 0},y(V)}catch(N){const _=Math.round(performance.now()-C),V=[...g];V[b]={...j,status:"error",message:N instanceof Error?N.message:"请求失败",responseTime:_},y(V)}},P=async()=>{if(!c.trim()&&!m.trim()){alert("请至少填写测试手机号或微信号");return}for(let b=0;b<g.length;b++)await E(b)},T=b=>l?"-":b??0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{className:"p-5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#38bdac]/20 flex items-center justify-center",children:e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:"总匹配次数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:T(r==null?void 0:r.totalMatches)})]})]})})}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{className:"p-5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-yellow-500/20 flex items-center justify-center",children:e.jsx(nn,{className:"w-5 h-5 text-yellow-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:"今日匹配"}),e.jsx("p",{className:"text-xl font-bold text-white",children:T(r==null?void 0:r.todayMatches)})]})]})})}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{className:"p-5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/20 flex items-center justify-center",children:e.jsx(pN,{className:"w-5 h-5 text-blue-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:"匹配用户数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:T(r==null?void 0:r.uniqueUsers)})]})]})})}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{className:"p-5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-green-500/20 flex items-center justify-center",children:e.jsx(ka,{className:"w-5 h-5 text-green-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:"人均匹配"}),e.jsx("p",{className:"text-xl font-bold text-white",children:l?"-":r!=null&&r.uniqueUsers?(r.totalMatches/r.uniqueUsers).toFixed(1):"0"})]})]})})}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{className:"p-5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-purple-500/20 flex items-center justify-center",children:e.jsx(Rl,{className:"w-5 h-5 text-purple-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:"匹配收益"}),e.jsxs("p",{className:"text-xl font-bold text-white",children:["¥",T(r==null?void 0:r.matchRevenue)]})]})]})})}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Se,{className:"p-5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-orange-500/20 flex items-center justify-center",children:e.jsx(zj,{className:"w-5 h-5 text-orange-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:"付费匹配"}),e.jsx("p",{className:"text-xl font-bold text-white",children:T(r==null?void 0:r.paidMatchCount)})]})]})})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-3",children:[e.jsx(Ge,{className:"text-white text-lg",children:"各类型匹配分布"}),e.jsxs(q,{onClick:p,disabled:l,variant:"outline",size:"sm",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(Se,{children:r!=null&&r.byType&&r.byType.length>0?e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:r.byType.map(b=>{const j=r.totalMatches>0?b.count/r.totalMatches*100:0;return e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"text-xl",children:KC[b.matchType]||"📊"}),e.jsx("span",{className:"text-gray-300 text-sm font-medium",children:HC[b.matchType]||b.matchType})]}),e.jsx("p",{className:"text-2xl font-bold text-white",children:b.count}),e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"w-full h-2 bg-gray-700 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#38bdac] rounded-full transition-all",style:{width:`${Math.min(j,100)}%`}})}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[j.toFixed(1),"% 占比"]})]})]},b.matchType)})}):e.jsx("p",{className:"text-gray-500 text-center py-8",children:l?"加载中...":"暂无匹配数据"})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs(Ge,{className:"text-white flex items-center gap-2",children:[e.jsx(ln,{className:"w-5 h-5 text-[#38bdac]"}),"存客宝接口联通测试"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"点击测试会用下方手机号/微信号真实添加到存客宝对应计划中"})]}),e.jsxs(q,{onClick:P,className:"bg-[#38bdac] hover:bg-[#2da396] text-white shrink-0",children:[e.jsx(nn,{className:"w-4 h-4 mr-2"})," 全部测试"]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mt-4 p-4 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx(Il,{className:"w-4 h-4 text-gray-400 shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx(Z,{className:"text-gray-400 text-xs",children:"测试手机号"}),e.jsx(le,{className:"bg-[#0f2137] border-gray-700 text-white h-9",placeholder:"填写真实手机号添加到存客宝",value:c,onChange:b=>u(b.target.value)})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx("span",{className:"text-gray-400 shrink-0 text-sm",children:"💬"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx(Z,{className:"text-gray-400 text-xs",children:"测试微信号(可选)"}),e.jsx(le,{className:"bg-[#0f2137] border-gray-700 text-white h-9",placeholder:"填写微信号(可选)",value:m,onChange:b=>f(b.target.value)})]})]})]})]}),e.jsx(Se,{children:e.jsx("div",{className:"space-y-2",children:g.map((b,j)=>e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg px-4 py-3 gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[b.status==="idle"&&e.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-500 shrink-0"}),b.status==="testing"&&e.jsx($e,{className:"w-4 h-4 text-yellow-400 animate-spin shrink-0"}),b.status==="success"&&e.jsx(Wd,{className:"w-4 h-4 text-green-400 shrink-0"}),b.status==="error"&&e.jsx(Bx,{className:"w-4 h-4 text-red-400 shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-white text-sm font-medium",children:b.label}),e.jsx("p",{className:"text-gray-500 text-xs truncate",children:b.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[b.message&&e.jsx("span",{className:`text-xs max-w-[200px] truncate ${b.status==="success"?"text-green-400":b.status==="error"?"text-red-400":"text-gray-400"}`,children:b.message}),b.responseTime!==void 0&&e.jsxs(Oe,{className:"bg-gray-700 text-gray-300 border-0 text-xs",children:[b.responseTime,"ms"]}),e.jsx(q,{size:"sm",variant:"outline",onClick:()=>E(j),disabled:b.status==="testing",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent text-xs h-8 px-3",children:"测试"})]})]},`${b.endpoint}-${j}`))})})]})]})}const YC=[{id:"stats",label:"数据统计",icon:Kj},{id:"partner",label:"找伙伴",icon:Qt},{id:"resource",label:"资源对接",icon:Cb},{id:"mentor",label:"导师预约",icon:Nb},{id:"team",label:"团队招募",icon:Yd}];function QC(){const[r,a]=h.useState("stats");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 flex-wrap gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:YC.map(l=>{const o=r===l.id;return e.jsxs("button",{type:"button",onClick:()=>a(l.id),className:`flex items-center gap-2 px-5 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)})}),r==="stats"&&e.jsx(GC,{}),r==="partner"&&e.jsx(zC,{}),r==="resource"&&e.jsx($C,{}),r==="mentor"&&e.jsx(VC,{}),r==="team"&&e.jsx(WC,{})]})}function qC(){return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[e.jsx(ln,{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(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ge,{className:"text-white",children:"1. 接口总览"})}),e.jsxs(Se,{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(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ge,{className:"text-white",children:"2. 书籍内容"})}),e.jsxs(Se,{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(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ge,{className:"text-white",children:"3. 支付"})}),e.jsxs(Se,{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(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ge,{className:"text-white",children:"4. 分销与用户"})}),e.jsxs(Se,{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(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ge,{className:"text-white",children:"5. 管理后台"})}),e.jsxs(Se,{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 XC(){const r=xn();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(Jj,{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:r.pathname}),e.jsx(q,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:e.jsxs(Vd,{to:"/",children:[e.jsx(Eb,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function JC(){return e.jsxs(jj,{children:[e.jsx(gt,{path:"/login",element:e.jsx(kw,{})}),e.jsxs(gt,{path:"/",element:e.jsx(TN,{}),children:[e.jsx(gt,{index:!0,element:e.jsx(bd,{to:"/dashboard",replace:!0})}),e.jsx(gt,{path:"dashboard",element:e.jsx(Pw,{})}),e.jsx(gt,{path:"orders",element:e.jsx(m2,{})}),e.jsx(gt,{path:"users",element:e.jsx($2,{})}),e.jsx(gt,{path:"distribution",element:e.jsx(o4,{})}),e.jsx(gt,{path:"withdrawals",element:e.jsx(c4,{})}),e.jsx(gt,{path:"content",element:e.jsx(pC,{})}),e.jsx(gt,{path:"referral-settings",element:e.jsx(E0,{})}),e.jsx(gt,{path:"author-settings",element:e.jsx(bd,{to:"/settings?tab=author",replace:!0})}),e.jsx(gt,{path:"admin-users",element:e.jsx(bd,{to:"/settings?tab=admin",replace:!0})}),e.jsx(gt,{path:"vip-roles",element:e.jsx(AC,{})}),e.jsx(gt,{path:"mentors",element:e.jsx(kg,{})}),e.jsx(gt,{path:"mentor-consultations",element:e.jsx(DC,{})}),e.jsx(gt,{path:"settings",element:e.jsx(SC,{})}),e.jsx(gt,{path:"payment",element:e.jsx(CC,{})}),e.jsx(gt,{path:"site",element:e.jsx(TC,{})}),e.jsx(gt,{path:"qrcodes",element:e.jsx(RC,{})}),e.jsx(gt,{path:"find-partner",element:e.jsx(QC,{})}),e.jsx(gt,{path:"match",element:e.jsx(_C,{})}),e.jsx(gt,{path:"match-records",element:e.jsx(MC,{})}),e.jsx(gt,{path:"api-doc",element:e.jsx(qC,{})})]}),e.jsx(gt,{path:"*",element:e.jsx(XC,{})})]})}Sv.createRoot(document.getElementById("root")).render(e.jsx(h.StrictMode,{children:e.jsx(Pj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(JC,{})})}));
|