diff --git a/soul-admin/dist/assets/index-BYtTwd_b.js b/soul-admin/dist/assets/index-BYtTwd_b.js new file mode 100644 index 00000000..4e05f733 --- /dev/null +++ b/soul-admin/dist/assets/index-BYtTwd_b.js @@ -0,0 +1,521 @@ +function wv(r,a){for(var l=0;li[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"]'))i(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function $x(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var kd={exports:{}},Al={},Ed={exports:{}},Ze={};/** + * @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 Cf;function Sv(){if(Cf)return Ze;Cf=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),m=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function k(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,N={};function b(A,$,F){this.props=A,this.context=$,this.refs=N,this.updater=F||P}b.prototype.isReactComponent={},b.prototype.setState=function(A,$){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,$,"setState")},b.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=b.prototype;function E(A,$,F){this.props=A,this.context=$,this.refs=N,this.updater=F||P}var j=E.prototype=new C;j.constructor=E,T(j,b.prototype),j.isPureReactComponent=!0;var R=Array.isArray,G=Object.prototype.hasOwnProperty,J={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function I(A,$,F){var ee,K={},de=null,X=null;if($!=null)for(ee in $.ref!==void 0&&(X=$.ref),$.key!==void 0&&(de=""+$.key),$)G.call($,ee)&&!L.hasOwnProperty(ee)&&(K[ee]=$[ee]);var ye=arguments.length-2;if(ye===1)K.children=F;else if(1>>1,$=O[A];if(0>>1;Ac(K,H))de<$&&0>c(X,K)?(O[A]=X,O[de]=H,A=de):(O[A]=K,O[ee]=H,A=ee);else if(de<$&&0>c(X,H))O[A]=X,O[de]=H,A=de;else break e}}return re}function c(O,re){var H=O.sortIndex-re.sortIndex;return H!==0?H:O.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var m=Date,f=m.now();r.unstable_now=function(){return m.now()-f}}var p=[],y=[],g=1,v=null,k=3,P=!1,T=!1,N=!1,b=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(O){for(var re=l(y);re!==null;){if(re.callback===null)i(y);else if(re.startTime<=O)i(y),re.sortIndex=re.expirationTime,a(p,re);else break;re=l(y)}}function R(O){if(N=!1,j(O),!T)if(l(p)!==null)T=!0,Q(G);else{var re=l(y);re!==null&&ue(R,re.startTime-O)}}function G(O,re){T=!1,N&&(N=!1,C(I),I=-1),P=!0;var H=k;try{for(j(re),v=l(p);v!==null&&(!(v.expirationTime>re)||O&&!te());){var A=v.callback;if(typeof A=="function"){v.callback=null,k=v.priorityLevel;var $=A(v.expirationTime<=re);re=r.unstable_now(),typeof $=="function"?v.callback=$:v===l(p)&&i(p),j(re)}else i(p);v=l(p)}if(v!==null)var F=!0;else{var ee=l(y);ee!==null&&ue(R,ee.startTime-re),F=!1}return F}finally{v=null,k=H,P=!1}}var J=!1,L=null,I=-1,w=5,V=-1;function te(){return!(r.unstable_now()-VO||125A?(O.sortIndex=H,a(y,O),l(p)===null&&O===l(y)&&(N?(C(I),I=-1):N=!0,ue(R,H-A))):(O.sortIndex=$,a(p,O),T||P||(T=!0,Q(G))),O},r.unstable_shouldYield=te,r.unstable_wrapCallback=function(O){var re=k;return function(){var H=k;k=re;try{return O.apply(this,arguments)}finally{k=H}}}})(Rd)),Rd}var Rf;function Pv(){return Rf||(Rf=1,Td.exports=Ev()),Td.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 If;function Tv(){if(If)return fs;If=1;var r=Nu(),a=Pv();function l(t){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,y=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},v={};function k(t){return p.call(v,t)?!0:p.call(g,t)?!1:y.test(t)?v[t]=!0:(g[t]=!0,!1)}function P(t,s,n,o){if(n!==null&&n.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return o?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function T(t,s,n,o){if(s===null||typeof s>"u"||P(t,s,n,o))return!0;if(o)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 N(t,s,n,o,h,x,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=o,this.attributeNamespace=h,this.mustUseProperty=n,this.propertyName=t,this.type=s,this.sanitizeURL=x,this.removeEmptyString=S}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){b[t]=new N(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var s=t[0];b[s]=new N(s,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){b[t]=new N(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){b[t]=new N(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){b[t]=new N(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){b[t]=new N(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){b[t]=new N(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){b[t]=new N(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){b[t]=new N(t,5,!1,t.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function E(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var s=t.replace(C,E);b[s]=new N(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(C,E);b[s]=new N(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(C,E);b[s]=new N(s,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){b[t]=new N(t,1,!1,t.toLowerCase(),null,!1,!1)}),b.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){b[t]=new N(t,1,!1,t.toLowerCase(),null,!0,!0)});function j(t,s,n,o){var h=b.hasOwnProperty(s)?b[s]:null;(h!==null?h.type!==0:o||!(2M||h[S]!==x[M]){var B=` +`+h[S].replace(" at new "," at ");return t.displayName&&B.includes("")&&(B=B.replace("",t.displayName)),B}while(1<=S&&0<=M);break}}}finally{F=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?$(t):""}function K(t){switch(t.tag){case 5:return $(t.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return t=ee(t.type,!1),t;case 11:return t=ee(t.type.render,!1),t;case 1:return t=ee(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 L:return"Fragment";case J:return"Portal";case w:return"Profiler";case I:return"StrictMode";case Y:return"Suspense";case ne:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case te:return(t.displayName||"Context")+".Consumer";case V: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 _:return s=t.displayName||null,s!==null?s:de(t.type)||"Memo";case Q:s=t._payload,t=t._init;try{return de(t(s))}catch{}}return null}function X(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===I?"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 ye(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 z(t){var s=Ce(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),o=""+t[s];if(!t.hasOwnProperty(s)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var h=n.get,x=n.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return h.call(this)},set:function(S){o=""+S,x.call(this,S)}}),Object.defineProperty(t,s,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function xe(t){t._valueTracker||(t._valueTracker=z(t))}function Pe(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var n=s.getValue(),o="";return t&&(o=Ce(t)?t.checked?"true":"false":t.value),t=o,t!==n?(s.setValue(t),!0):!1}function Ve(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 He(t,s){var n=s.checked;return H({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Ke(t,s){var n=s.defaultValue==null?"":s.defaultValue,o=s.checked!=null?s.checked:s.defaultChecked;n=ye(s.value!=null?s.value:n),t._wrapperState={initialChecked:o,initialValue:n,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function tt(t,s){s=s.checked,s!=null&&j(t,"checked",s,!1)}function $e(t,s){tt(t,s);var n=ye(s.value),o=s.type;if(n!=null)o==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(o==="submit"||o==="reset"){t.removeAttribute("value");return}s.hasOwnProperty("value")?pe(t,s.type,n):s.hasOwnProperty("defaultValue")&&pe(t,s.type,ye(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(t.defaultChecked=!!s.defaultChecked)}function me(t,s,n){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var o=s.type;if(!(o!=="submit"&&o!=="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 pe(t,s,n){(s!=="number"||Ve(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ft=Array.isArray;function ss(t,s,n,o){if(t=t.options,s){s={};for(var h=0;h"+s.valueOf().toString()+"",s=rs.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;s.firstChild;)t.appendChild(s.firstChild)}});function Xs(t,s){if(s){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=s;return}}t.textContent=s}var ns={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},kn=["Webkit","ms","Moz","O"];Object.keys(ns).forEach(function(t){kn.forEach(function(s){s=s+t.charAt(0).toUpperCase()+t.substring(1),ns[s]=ns[t]})});function ra(t,s,n){return s==null||typeof s=="boolean"||s===""?"":n||typeof s!="number"||s===0||ns.hasOwnProperty(t)&&ns[t]?(""+s).trim():s+"px"}function Es(t,s){t=t.style;for(var n in s)if(s.hasOwnProperty(n)){var o=n.indexOf("--")===0,h=ra(n,s[n],o);n==="float"&&(n="cssFloat"),o?t.setProperty(n,h):t[n]=h}}var _r=H({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 Js(t,s){if(s){if(_r[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 Nt(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 Ps=null;function js(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Zs=null,os=null,Ts=null;function Pt(t){if(t=vl(t)){if(typeof Zs!="function")throw Error(l(280));var s=t.stateNode;s&&(s=fi(s),Zs(t.stateNode,t.type,s))}}function na(t){os?Ts?Ts.push(t):Ts=[t]:os=t}function aa(){if(os){var t=os,s=Ts;if(Ts=os=null,Pt(t),s)for(t=0;t>>=0,t===0?32:31-(tr(t)/Ko|0)|0}var Or=64,Mt=4194304;function Fr(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 Jl(t,s){var n=t.pendingLanes;if(n===0)return 0;var o=0,h=t.suspendedLanes,x=t.pingedLanes,S=n&268435455;if(S!==0){var M=S&~h;M!==0?o=Fr(M):(x&=S,x!==0&&(o=Fr(x)))}else S=n&~h,S!==0?o=Fr(S):x!==0&&(o=Fr(x));if(o===0)return 0;if(s!==0&&s!==o&&(s&h)===0&&(h=o&-o,x=s&-s,h>=x||h===16&&(x&4194240)!==0))return s;if((o&4)!==0&&(o|=n&16),s=t.entangledLanes,s!==0)for(t=t.entanglements,s&=o;0n;n++)s.push(t);return s}function sl(t,s,n){t.pendingLanes|=s,s!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,s=31-nt(s),t[s]=n}function Wg(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 o=t.eventTimes;for(t=t.expirationTimes;0=dl),gh=" ",yh=!1;function vh(t,s){switch(t){case"keyup":return yy.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ha=!1;function jy(t,s){switch(t){case"compositionend":return jh(s);case"keypress":return s.which!==32?null:(yh=!0,gh);case"textInput":return t=s.data,t===gh&&yh?null:t;default:return null}}function by(t,s){if(ha)return t==="compositionend"||!lc&&vh(t,s)?(t=uh(),ri=ec=Vr=null,ha=!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)return{node:n,offset:s-t};t=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Eh(n)}}function Th(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Th(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function Rh(){for(var t=window,s=Ve();s instanceof t.HTMLIFrameElement;){try{var n=typeof s.contentWindow.location.href=="string"}catch{n=!1}if(n)t=s.contentWindow;else break;s=Ve(t.document)}return s}function cc(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 Ry(t){var s=Rh(),n=t.focusedElem,o=t.selectionRange;if(s!==n&&n&&n.ownerDocument&&Th(n.ownerDocument.documentElement,n)){if(o!==null&&cc(n)){if(s=o.start,t=o.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 h=n.textContent.length,x=Math.min(o.start,h);o=o.end===void 0?x:Math.min(o.end,h),!t.extend&&x>o&&(h=o,o=x,x=h),h=Ph(n,x);var S=Ph(n,o);h&&S&&(t.rangeCount!==1||t.anchorNode!==h.node||t.anchorOffset!==h.offset||t.focusNode!==S.node||t.focusOffset!==S.offset)&&(s=s.createRange(),s.setStart(h.node,h.offset),t.removeAllRanges(),x>o?(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=document.documentMode,ma=null,dc=null,fl=null,uc=!1;function Ih(t,s,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uc||ma==null||ma!==Ve(o)||(o=ma,"selectionStart"in o&&cc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),fl&&ml(fl,o)||(fl=o,o=ui(dc,"onSelect"),0ya||(t.current=wc[ya],wc[ya]=null,ya--)}function ht(t,s){ya++,wc[ya]=t.current,t.current=s}var Gr={},Xt=Kr(Gr),cs=Kr(!1),On=Gr;function va(t,s){var n=t.type.contextTypes;if(!n)return Gr;var o=t.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===s)return o.__reactInternalMemoizedMaskedChildContext;var h={},x;for(x in n)h[x]=s[x];return o&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=h),h}function ds(t){return t=t.childContextTypes,t!=null}function xi(){pt(cs),pt(Xt)}function Kh(t,s,n){if(Xt.current!==Gr)throw Error(l(168));ht(Xt,s),ht(cs,n)}function Gh(t,s,n){var o=t.stateNode;if(s=s.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var h in o)if(!(h in s))throw Error(l(108,X(t)||"Unknown",h));return H({},n,o)}function pi(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Gr,On=Xt.current,ht(Xt,t),ht(cs,cs.current),!0}function Yh(t,s,n){var o=t.stateNode;if(!o)throw Error(l(169));n?(t=Gh(t,s,On),o.__reactInternalMemoizedMergedChildContext=t,pt(cs),pt(Xt),ht(Xt,t)):pt(cs),ht(cs,n)}var fr=null,gi=!1,Sc=!1;function Qh(t){fr===null?fr=[t]:fr.push(t)}function Uy(t){gi=!0,Qh(t)}function Yr(){if(!Sc&&fr!==null){Sc=!0;var t=0,s=ct;try{var n=fr;for(ct=1;t>=S,h-=S,xr=1<<32-nt(s)+h|n<Ue?(Kt=ze,ze=null):Kt=ze.sibling;var at=he(Z,ze,ae[Ue],je);if(at===null){ze===null&&(ze=Kt);break}t&&ze&&at.alternate===null&&s(Z,ze),W=x(at,W,Ue),Fe===null?De=at:Fe.sibling=at,Fe=at,ze=Kt}if(Ue===ae.length)return n(Z,ze),jt&&zn(Z,Ue),De;if(ze===null){for(;UeUe?(Kt=ze,ze=null):Kt=ze.sibling;var rn=he(Z,ze,at.value,je);if(rn===null){ze===null&&(ze=Kt);break}t&&ze&&rn.alternate===null&&s(Z,ze),W=x(rn,W,Ue),Fe===null?De=rn:Fe.sibling=rn,Fe=rn,ze=Kt}if(at.done)return n(Z,ze),jt&&zn(Z,Ue),De;if(ze===null){for(;!at.done;Ue++,at=ae.next())at=ve(Z,at.value,je),at!==null&&(W=x(at,W,Ue),Fe===null?De=at:Fe.sibling=at,Fe=at);return jt&&zn(Z,Ue),De}for(ze=o(Z,ze);!at.done;Ue++,at=ae.next())at=Te(ze,Z,Ue,at.value,je),at!==null&&(t&&at.alternate!==null&&ze.delete(at.key===null?Ue:at.key),W=x(at,W,Ue),Fe===null?De=at:Fe.sibling=at,Fe=at);return t&&ze.forEach(function(Nv){return s(Z,Nv)}),jt&&zn(Z,Ue),De}function At(Z,W,ae,je){if(typeof ae=="object"&&ae!==null&&ae.type===L&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case G:e:{for(var De=ae.key,Fe=W;Fe!==null;){if(Fe.key===De){if(De=ae.type,De===L){if(Fe.tag===7){n(Z,Fe.sibling),W=h(Fe,ae.props.children),W.return=Z,Z=W;break e}}else if(Fe.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Q&&tm(De)===Fe.type){n(Z,Fe.sibling),W=h(Fe,ae.props),W.ref=jl(Z,Fe,ae),W.return=Z,Z=W;break e}n(Z,Fe);break}else s(Z,Fe);Fe=Fe.sibling}ae.type===L?(W=Gn(ae.props.children,Z.mode,je,ae.key),W.return=Z,Z=W):(je=Hi(ae.type,ae.key,ae.props,null,Z.mode,je),je.ref=jl(Z,W,ae),je.return=Z,Z=je)}return S(Z);case J:e:{for(Fe=ae.key;W!==null;){if(W.key===Fe)if(W.tag===4&&W.stateNode.containerInfo===ae.containerInfo&&W.stateNode.implementation===ae.implementation){n(Z,W.sibling),W=h(W,ae.children||[]),W.return=Z,Z=W;break e}else{n(Z,W);break}else s(Z,W);W=W.sibling}W=bd(ae,Z.mode,je),W.return=Z,Z=W}return S(Z);case Q:return Fe=ae._init,At(Z,W,Fe(ae._payload),je)}if(ft(ae))return Ie(Z,W,ae,je);if(re(ae))return Ae(Z,W,ae,je);bi(Z,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"?(ae=""+ae,W!==null&&W.tag===6?(n(Z,W.sibling),W=h(W,ae),W.return=Z,Z=W):(n(Z,W),W=jd(ae,Z.mode,je),W.return=Z,Z=W),S(Z)):n(Z,W)}return At}var wa=sm(!0),rm=sm(!1),Ni=Kr(null),wi=null,Sa=null,Rc=null;function Ic(){Rc=Sa=wi=null}function _c(t){var s=Ni.current;pt(Ni),t._currentValue=s}function Mc(t,s,n){for(;t!==null;){var o=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,o!==null&&(o.childLanes|=s)):o!==null&&(o.childLanes&s)!==s&&(o.childLanes|=s),t===n)break;t=t.return}}function Ca(t,s){wi=t,Rc=Sa=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&s)!==0&&(us=!0),t.firstContext=null)}function As(t){var s=t._currentValue;if(Rc!==t)if(t={context:t,memoizedValue:s,next:null},Sa===null){if(wi===null)throw Error(l(308));Sa=t,wi.dependencies={lanes:0,firstContext:t}}else Sa=Sa.next=t;return s}var $n=null;function Ac(t){$n===null?$n=[t]:$n.push(t)}function nm(t,s,n,o){var h=s.interleaved;return h===null?(n.next=n,Ac(s)):(n.next=h.next,h.next=n),s.interleaved=n,gr(t,o)}function gr(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 Qr=!1;function Dc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function am(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 yr(t,s){return{eventTime:t,lane:s,tag:0,payload:null,callback:null,next:null}}function qr(t,s,n){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(st&2)!==0){var h=o.pending;return h===null?s.next=s:(s.next=h.next,h.next=s),o.pending=s,gr(t,n)}return h=o.interleaved,h===null?(s.next=s,Ac(o)):(s.next=h.next,h.next=s),o.interleaved=s,gr(t,n)}function Si(t,s,n){if(s=s.updateQueue,s!==null&&(s=s.shared,(n&4194240)!==0)){var o=s.lanes;o&=t.pendingLanes,n|=o,s.lanes=n,Qo(t,n)}}function lm(t,s){var n=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,n===o)){var h=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?h=x=S:x=x.next=S,n=n.next}while(n!==null);x===null?h=x=s:x=x.next=s}else h=x=s;n={baseState:o.baseState,firstBaseUpdate:h,lastBaseUpdate:x,shared:o.shared,effects:o.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=s:t.next=s,n.lastBaseUpdate=s}function Ci(t,s,n,o){var h=t.updateQueue;Qr=!1;var x=h.firstBaseUpdate,S=h.lastBaseUpdate,M=h.shared.pending;if(M!==null){h.shared.pending=null;var B=M,le=B.next;B.next=null,S===null?x=le:S.next=le,S=B;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,M=fe.lastBaseUpdate,M!==S&&(M===null?fe.firstBaseUpdate=le:M.next=le,fe.lastBaseUpdate=B))}if(x!==null){var ve=h.baseState;S=0,fe=le=B=null,M=x;do{var he=M.lane,Te=M.eventTime;if((o&he)===he){fe!==null&&(fe=fe.next={eventTime:Te,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var Ie=t,Ae=M;switch(he=s,Te=n,Ae.tag){case 1:if(Ie=Ae.payload,typeof Ie=="function"){ve=Ie.call(Te,ve,he);break e}ve=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Ae.payload,he=typeof Ie=="function"?Ie.call(Te,ve,he):Ie,he==null)break e;ve=H({},ve,he);break e;case 2:Qr=!0}}M.callback!==null&&M.lane!==0&&(t.flags|=64,he=h.effects,he===null?h.effects=[M]:he.push(M))}else Te={eventTime:Te,lane:he,tag:M.tag,payload:M.payload,callback:M.callback,next:null},fe===null?(le=fe=Te,B=ve):fe=fe.next=Te,S|=he;if(M=M.next,M===null){if(M=h.shared.pending,M===null)break;he=M,M=he.next,he.next=null,h.lastBaseUpdate=he,h.shared.pending=null}}while(!0);if(fe===null&&(B=ve),h.baseState=B,h.firstBaseUpdate=le,h.lastBaseUpdate=fe,s=h.shared.interleaved,s!==null){h=s;do S|=h.lane,h=h.next;while(h!==s)}else x===null&&(h.shared.lanes=0);Vn|=S,t.lanes=S,t.memoizedState=ve}}function im(t,s,n){if(t=s.effects,s.effects=null,t!==null)for(s=0;sn?n:4,t(!0);var o=$c.transition;$c.transition={};try{t(!1),s()}finally{ct=n,$c.transition=o}}function km(){return Ds().memoizedState}function Ky(t,s,n){var o=en(t);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},Em(t))Pm(s,n);else if(n=nm(t,s,n,o),n!==null){var h=is();Hs(n,t,o,h),Tm(n,s,o)}}function Gy(t,s,n){var o=en(t),h={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(Em(t))Pm(s,h);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(h.hasEagerState=!0,h.eagerState=M,$s(M,S)){var B=s.interleaved;B===null?(h.next=h,Ac(s)):(h.next=B.next,B.next=h),s.interleaved=h;return}}catch{}finally{}n=nm(t,s,h,o),n!==null&&(h=is(),Hs(n,t,o,h),Tm(n,s,o))}}function Em(t){var s=t.alternate;return t===St||s!==null&&s===St}function Pm(t,s){Sl=Pi=!0;var n=t.pending;n===null?s.next=s:(s.next=n.next,n.next=s),t.pending=s}function Tm(t,s,n){if((n&4194240)!==0){var o=s.lanes;o&=t.pendingLanes,n|=o,s.lanes=n,Qo(t,n)}}var Ii={readContext:As,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},Yy={readContext:As,useCallback:function(t,s){return nr().memoizedState=[t,s===void 0?null:s],t},useContext:As,useEffect:ym,useImperativeHandle:function(t,s,n){return n=n!=null?n.concat([t]):null,Ti(4194308,4,bm.bind(null,s,t),n)},useLayoutEffect:function(t,s){return Ti(4194308,4,t,s)},useInsertionEffect:function(t,s){return Ti(4,2,t,s)},useMemo:function(t,s){var n=nr();return s=s===void 0?null:s,t=t(),n.memoizedState=[t,s],t},useReducer:function(t,s,n){var o=nr();return s=n!==void 0?n(s):s,o.memoizedState=o.baseState=s,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},o.queue=t,t=t.dispatch=Ky.bind(null,St,t),[o.memoizedState,t]},useRef:function(t){var s=nr();return t={current:t},s.memoizedState=t},useState:pm,useDebugValue:Gc,useDeferredValue:function(t){return nr().memoizedState=t},useTransition:function(){var t=pm(!1),s=t[0];return t=Hy.bind(null,t[1]),nr().memoizedState=t,[s,t]},useMutableSource:function(){},useSyncExternalStore:function(t,s,n){var o=St,h=nr();if(jt){if(n===void 0)throw Error(l(407));n=n()}else{if(n=s(),Ht===null)throw Error(l(349));(Un&30)!==0||um(o,s,n)}h.memoizedState=n;var x={value:n,getSnapshot:s};return h.queue=x,ym(mm.bind(null,o,x,t),[t]),o.flags|=2048,El(9,hm.bind(null,o,x,n,s),void 0,null),n},useId:function(){var t=nr(),s=Ht.identifierPrefix;if(jt){var n=pr,o=xr;n=(o&~(1<<32-nt(o)-1)).toString(32)+n,s=":"+s+"R"+n,n=Cl++,0<\/script>",t=t.removeChild(t.firstChild)):typeof o.is=="string"?t=S.createElement(n,{is:o.is}):(t=S.createElement(n),n==="select"&&(S=t,o.multiple?S.multiple=!0:o.size&&(S.size=o.size))):t=S.createElementNS(t,n),t[sr]=s,t[yl]=o,Qm(t,s,!1,!1),s.stateNode=t;e:{switch(S=Nt(n,o),n){case"dialog":xt("cancel",t),xt("close",t),h=o;break;case"iframe":case"object":case"embed":xt("load",t),h=o;break;case"video":case"audio":for(h=0;hRa&&(s.flags|=128,o=!0,Pl(x,!1),s.lanes=4194304)}else{if(!o)if(t=ki(S),t!==null){if(s.flags|=128,o=!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*lt()-x.renderingStartTime>Ra&&n!==1073741824&&(s.flags|=128,o=!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=lt(),s.sibling=null,n=wt.current,ht(wt,o?n&1|2:n&1),s):(Zt(s),null);case 22:case 23:return gd(),o=s.memoizedState!==null,t!==null&&t.memoizedState!==null!==o&&(s.flags|=8192),o&&(s.mode&1)!==0?(Ss&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 sv(t,s){switch(kc(s),s.tag){case 1:return ds(s.type)&&xi(),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return ka(),pt(cs),pt(Xt),zc(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 5:return Oc(s),null;case 13:if(pt(wt),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));Na()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return pt(wt),null;case 4:return ka(),null;case 10:return _c(s.type._context),null;case 22:case 23:return gd(),null;case 24:return null;default:return null}}var Di=!1,es=!1,rv=typeof WeakSet=="function"?WeakSet:Set,Re=null;function Pa(t,s){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(o){Tt(t,s,o)}else n.current=null}function ad(t,s,n){try{n()}catch(o){Tt(t,s,o)}}var Jm=!1;function nv(t,s){if(gc=ti,t=Rh(),cc(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var h=o.anchorOffset,x=o.focusNode;o=o.focusOffset;try{n.nodeType,x.nodeType}catch{n=null;break e}var S=0,M=-1,B=-1,le=0,fe=0,ve=t,he=null;t:for(;;){for(var Te;ve!==n||h!==0&&ve.nodeType!==3||(M=S+h),ve!==x||o!==0&&ve.nodeType!==3||(B=S+o),ve.nodeType===3&&(S+=ve.nodeValue.length),(Te=ve.firstChild)!==null;)he=ve,ve=Te;for(;;){if(ve===t)break t;if(he===n&&++le===h&&(M=S),he===x&&++fe===o&&(B=S),(Te=ve.nextSibling)!==null)break;ve=he,he=ve.parentNode}ve=Te}n=M===-1||B===-1?null:{start:M,end:B}}else n=null}n=n||{start:0,end:0}}else n=null;for(yc={focusedElem:t,selectionRange:n},ti=!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 Ie=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Ie!==null){var Ae=Ie.memoizedProps,At=Ie.memoizedState,Z=s.stateNode,W=Z.getSnapshotBeforeUpdate(s.elementType===s.type?Ae:Us(s.type,Ae),At);Z.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var ae=s.stateNode.containerInfo;ae.nodeType===1?ae.textContent="":ae.nodeType===9&&ae.documentElement&&ae.removeChild(ae.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(je){Tt(s,s.return,je)}if(t=s.sibling,t!==null){t.return=s.return,Re=t;break}Re=s.return}return Ie=Jm,Jm=!1,Ie}function Tl(t,s,n){var o=s.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var h=o=o.next;do{if((h.tag&t)===t){var x=h.destroy;h.destroy=void 0,x!==void 0&&ad(s,n,x)}h=h.next}while(h!==o)}}function Li(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 o=n.create;n.destroy=o()}n=n.next}while(n!==s)}}function ld(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 Zm(t){var s=t.alternate;s!==null&&(t.alternate=null,Zm(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&(delete s[sr],delete s[yl],delete s[Nc],delete s[$y],delete s[By])),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 ef(t){return t.tag===5||t.tag===3||t.tag===4}function tf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ef(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 id(t,s,n){var o=t.tag;if(o===5||o===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=mi));else if(o!==4&&(t=t.child,t!==null))for(id(t,s,n),t=t.sibling;t!==null;)id(t,s,n),t=t.sibling}function od(t,s,n){var o=t.tag;if(o===5||o===6)t=t.stateNode,s?n.insertBefore(t,s):n.appendChild(t);else if(o!==4&&(t=t.child,t!==null))for(od(t,s,n),t=t.sibling;t!==null;)od(t,s,n),t=t.sibling}var Qt=null,Vs=!1;function Xr(t,s,n){for(n=n.child;n!==null;)sf(t,s,n),n=n.sibling}function sf(t,s,n){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(ke,n)}catch{}switch(n.tag){case 5:es||Pa(n,s);case 6:var o=Qt,h=Vs;Qt=null,Xr(t,s,n),Qt=o,Vs=h,Qt!==null&&(Vs?(t=Qt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Qt.removeChild(n.stateNode));break;case 18:Qt!==null&&(Vs?(t=Qt,n=n.stateNode,t.nodeType===8?bc(t.parentNode,n):t.nodeType===1&&bc(t,n),il(t)):bc(Qt,n.stateNode));break;case 4:o=Qt,h=Vs,Qt=n.stateNode.containerInfo,Vs=!0,Xr(t,s,n),Qt=o,Vs=h;break;case 0:case 11:case 14:case 15:if(!es&&(o=n.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){h=o=o.next;do{var x=h,S=x.destroy;x=x.tag,S!==void 0&&((x&2)!==0||(x&4)!==0)&&ad(n,s,S),h=h.next}while(h!==o)}Xr(t,s,n);break;case 1:if(!es&&(Pa(n,s),o=n.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=n.memoizedProps,o.state=n.memoizedState,o.componentWillUnmount()}catch(M){Tt(n,s,M)}Xr(t,s,n);break;case 21:Xr(t,s,n);break;case 22:n.mode&1?(es=(o=es)||n.memoizedState!==null,Xr(t,s,n),es=o):Xr(t,s,n);break;default:Xr(t,s,n)}}function rf(t){var s=t.updateQueue;if(s!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new rv),s.forEach(function(o){var h=mv.bind(null,t,o);n.has(o)||(n.add(o),o.then(h,h))})}}function Ws(t,s){var n=s.deletions;if(n!==null)for(var o=0;oh&&(h=S),o&=~x}if(o=h,o=lt()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*lv(o/1960))-o,10t?16:t,Zr===null)var o=!1;else{if(t=Zr,Zr=null,Bi=0,(st&6)!==0)throw Error(l(331));var h=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 B=0;Blt()-ud?Hn(t,0):dd|=n),ms(t,s)}function gf(t,s){s===0&&((t.mode&1)===0?s=1:(s=Mt,Mt<<=1,(Mt&130023424)===0&&(Mt=4194304)));var n=is();t=gr(t,s),t!==null&&(sl(t,s,n),ms(t,n))}function hv(t){var s=t.memoizedState,n=0;s!==null&&(n=s.retryLane),gf(t,n)}function mv(t,s){var n=0;switch(t.tag){case 13:var o=t.stateNode,h=t.memoizedState;h!==null&&(n=h.retryLane);break;case 19:o=t.stateNode;break;default:throw Error(l(314))}o!==null&&o.delete(s),gf(t,n)}var yf;yf=function(t,s,n){if(t!==null)if(t.memoizedProps!==s.pendingProps||cs.current)us=!0;else{if((t.lanes&n)===0&&(s.flags&128)===0)return us=!1,ev(t,s,n);us=(t.flags&131072)!==0}else us=!1,jt&&(s.flags&1048576)!==0&&qh(s,vi,s.index);switch(s.lanes=0,s.tag){case 2:var o=s.type;Ai(t,s),t=s.pendingProps;var h=va(s,Xt.current);Ca(s,n),h=Uc(null,s,o,t,h,n);var x=Vc();return s.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,ds(o)?(x=!0,pi(s)):x=!1,s.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,Dc(s),h.updater=_i,s.stateNode=h,h._reactInternals=s,Qc(s,o,t,n),s=Zc(null,s,o,!0,x,n)):(s.tag=0,jt&&x&&Cc(s),ls(null,s,h,n),s=s.child),s;case 16:o=s.elementType;e:{switch(Ai(t,s),t=s.pendingProps,h=o._init,o=h(o._payload),s.type=o,h=s.tag=xv(o),t=Us(o,t),h){case 0:s=Jc(null,s,o,t,n);break e;case 1:s=Vm(null,s,o,t,n);break e;case 11:s=Fm(null,s,o,t,n);break e;case 14:s=zm(null,s,o,Us(o.type,t),n);break e}throw Error(l(306,o,""))}return s;case 0:return o=s.type,h=s.pendingProps,h=s.elementType===o?h:Us(o,h),Jc(t,s,o,h,n);case 1:return o=s.type,h=s.pendingProps,h=s.elementType===o?h:Us(o,h),Vm(t,s,o,h,n);case 3:e:{if(Wm(s),t===null)throw Error(l(387));o=s.pendingProps,x=s.memoizedState,h=x.element,am(t,s),Ci(s,o,null,n);var S=s.memoizedState;if(o=S.element,x.isDehydrated)if(x={element:o,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){h=Ea(Error(l(423)),s),s=Hm(t,s,o,n,h);break e}else if(o!==h){h=Ea(Error(l(424)),s),s=Hm(t,s,o,n,h);break e}else for(ws=Hr(s.stateNode.containerInfo.firstChild),Ns=s,jt=!0,Bs=null,n=rm(s,null,o,n),s.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Na(),o===h){s=vr(t,s,n);break e}ls(t,s,o,n)}s=s.child}return s;case 5:return om(s),t===null&&Pc(s),o=s.type,h=s.pendingProps,x=t!==null?t.memoizedProps:null,S=h.children,vc(o,h)?S=null:x!==null&&vc(o,x)&&(s.flags|=32),Um(t,s),ls(t,s,S,n),s.child;case 6:return t===null&&Pc(s),null;case 13:return Km(t,s,n);case 4:return Lc(s,s.stateNode.containerInfo),o=s.pendingProps,t===null?s.child=wa(s,null,o,n):ls(t,s,o,n),s.child;case 11:return o=s.type,h=s.pendingProps,h=s.elementType===o?h:Us(o,h),Fm(t,s,o,h,n);case 7:return ls(t,s,s.pendingProps,n),s.child;case 8:return ls(t,s,s.pendingProps.children,n),s.child;case 12:return ls(t,s,s.pendingProps.children,n),s.child;case 10:e:{if(o=s.type._context,h=s.pendingProps,x=s.memoizedProps,S=h.value,ht(Ni,o._currentValue),o._currentValue=S,x!==null)if($s(x.value,S)){if(x.children===h.children&&!cs.current){s=vr(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 B=M.firstContext;B!==null;){if(B.context===o){if(x.tag===1){B=yr(-1,n&-n),B.tag=2;var le=x.updateQueue;if(le!==null){le=le.shared;var fe=le.pending;fe===null?B.next=B:(B.next=fe.next,fe.next=B),le.pending=B}}x.lanes|=n,B=x.alternate,B!==null&&(B.lanes|=n),Mc(x.return,n,s),M.lanes|=n;break}B=B.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),Mc(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}ls(t,s,h.children,n),s=s.child}return s;case 9:return h=s.type,o=s.pendingProps.children,Ca(s,n),h=As(h),o=o(h),s.flags|=1,ls(t,s,o,n),s.child;case 14:return o=s.type,h=Us(o,s.pendingProps),h=Us(o.type,h),zm(t,s,o,h,n);case 15:return $m(t,s,s.type,s.pendingProps,n);case 17:return o=s.type,h=s.pendingProps,h=s.elementType===o?h:Us(o,h),Ai(t,s),s.tag=1,ds(o)?(t=!0,pi(s)):t=!1,Ca(s,n),Im(s,o,h),Qc(s,o,h,n),Zc(null,s,o,!0,t,n);case 19:return Ym(t,s,n);case 22:return Bm(t,s,n)}throw Error(l(156,s.tag))};function vf(t,s){return U(t,s)}function fv(t,s,n,o){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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Os(t,s,n,o){return new fv(t,s,n,o)}function vd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function xv(t){if(typeof t=="function")return vd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ie)return 11;if(t===_)return 14}return 2}function sn(t,s){var n=t.alternate;return n===null?(n=Os(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 Hi(t,s,n,o,h,x){var S=2;if(o=t,typeof t=="function")vd(t)&&(S=1);else if(typeof t=="string")S=5;else e:switch(t){case L:return Gn(n.children,h,x,s);case I:S=8,h|=8;break;case w:return t=Os(12,n,s,h|2),t.elementType=w,t.lanes=x,t;case Y:return t=Os(13,n,s,h),t.elementType=Y,t.lanes=x,t;case ne:return t=Os(19,n,s,h),t.elementType=ne,t.lanes=x,t;case ue:return Ki(n,h,x,s);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case V:S=10;break e;case te:S=9;break e;case ie:S=11;break e;case _:S=14;break e;case Q:S=16,o=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return s=Os(S,n,s,h),s.elementType=t,s.type=o,s.lanes=x,s}function Gn(t,s,n,o){return t=Os(7,t,o,s),t.lanes=n,t}function Ki(t,s,n,o){return t=Os(22,t,o,s),t.elementType=ue,t.lanes=n,t.stateNode={isHidden:!1},t}function jd(t,s,n){return t=Os(6,t,null,s),t.lanes=n,t}function bd(t,s,n){return s=Os(4,t.children!==null?t.children:[],t.key,s),s.lanes=n,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}function pv(t,s,n,o,h){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=Yo(0),this.expirationTimes=Yo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yo(0),this.identifierPrefix=o,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function Nd(t,s,n,o,h,x,S,M,B){return t=new pv(t,s,n,M,B),s===1?(s=1,x===!0&&(s|=8)):s=0,x=Os(3,null,null,s),t.current=x,x.stateNode=t,x.memoizedState={element:o,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dc(x),t}function gv(t,s,n){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),Pd.exports=Tv(),Pd.exports}var Mf;function Rv(){if(Mf)return Zi;Mf=1;var r=Bx();return Zi.createRoot=r.createRoot,Zi.hydrateRoot=r.hydrateRoot,Zi}var Iv=Rv(),Kl=Bx();const _v=$x(Kl);/** + * @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 $l(){return $l=Object.assign?Object.assign.bind():function(r){for(var a=1;a"u")throw new Error(a)}function wu(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Av(){return Math.random().toString(36).substr(2,8)}function Df(r,a){return{usr:r.state,key:r.key,idx:a}}function Xd(r,a,l,i){return l===void 0&&(l=null),$l({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Wa(a):a,{state:l,key:a&&a.key||i||Av()})}function po(r){let{pathname:a="/",search:l="",hash:i=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),i&&i!=="#"&&(a+=i.charAt(0)==="#"?i:"#"+i),a}function Wa(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let i=r.indexOf("?");i>=0&&(a.search=r.substr(i),r=r.substr(0,i)),r&&(a.pathname=r)}return a}function Dv(r,a,l,i){i===void 0&&(i={});let{window:c=document.defaultView,v5Compat:d=!1}=i,m=c.history,f=cn.Pop,p=null,y=g();y==null&&(y=0,m.replaceState($l({},m.state,{idx:y}),""));function g(){return(m.state||{idx:null}).idx}function v(){f=cn.Pop;let b=g(),C=b==null?null:b-y;y=b,p&&p({action:f,location:N.location,delta:C})}function k(b,C){f=cn.Push;let E=Xd(N.location,b,C);y=g()+1;let j=Df(E,y),R=N.createHref(E);try{m.pushState(j,"",R)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;c.location.assign(R)}d&&p&&p({action:f,location:N.location,delta:1})}function P(b,C){f=cn.Replace;let E=Xd(N.location,b,C);y=g();let j=Df(E,y),R=N.createHref(E);m.replaceState(j,"",R),d&&p&&p({action:f,location:N.location,delta:0})}function T(b){let C=c.location.origin!=="null"?c.location.origin:c.location.href,E=typeof b=="string"?b:po(b);return E=E.replace(/ $/,"%20"),Dt(C,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,C)}let N={get action(){return f},get location(){return r(c,m)},listen(b){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Af,v),p=b,()=>{c.removeEventListener(Af,v),p=null}},createHref(b){return a(c,b)},createURL:T,encodeLocation(b){let C=T(b);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:k,replace:P,go(b){return m.go(b)}};return N}var Lf;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Lf||(Lf={}));function Lv(r,a,l){return l===void 0&&(l="/"),Ov(r,a,l)}function Ov(r,a,l,i){let c=typeof a=="string"?Wa(a):a,d=Su(c.pathname||"/",l);if(d==null)return null;let m=Ux(r);Fv(m);let f=null;for(let p=0;f==null&&p{let p={relativePath:f===void 0?d.path||"":f,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};p.relativePath.startsWith("/")&&(Dt(p.relativePath.startsWith(i),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(i.length));let y=un([i,p.relativePath]),g=l.concat(p);d.children&&d.children.length>0&&(Dt(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Ux(d.children,a,g,y)),!(d.path==null&&!d.index)&&a.push({path:y,score:Hv(y,d.index),routesMeta:g})};return r.forEach((d,m)=>{var f;if(d.path===""||!((f=d.path)!=null&&f.includes("?")))c(d,m);else for(let p of Vx(d.path))c(d,m,p)}),a}function Vx(r){let a=r.split("/");if(a.length===0)return[];let[l,...i]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(i.length===0)return c?[d,""]:[d];let m=Vx(i.join("/")),f=[];return f.push(...m.map(p=>p===""?d:[d,p].join("/"))),c&&f.push(...m),f.map(p=>r.startsWith("/")&&p===""?"/":p)}function Fv(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:Kv(a.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}const zv=/^:[\w-]+$/,$v=3,Bv=2,Uv=1,Vv=10,Wv=-2,Of=r=>r==="*";function Hv(r,a){let l=r.split("/"),i=l.length;return l.some(Of)&&(i+=Wv),a&&(i+=Bv),l.filter(c=>!Of(c)).reduce((c,d)=>c+(zv.test(d)?$v:d===""?Uv:Vv),i)}function Kv(r,a){return r.length===a.length&&r.slice(0,-1).every((i,c)=>i===a[c])?r[r.length-1]-a[a.length-1]:0}function Gv(r,a,l){let{routesMeta:i}=r,c={},d="/",m=[];for(let f=0;f{let{paramName:k,isOptional:P}=g;if(k==="*"){let N=f[v]||"";m=d.slice(0,d.length-N.length).replace(/(.)\/+$/,"$1")}const T=f[v];return P&&!T?y[k]=void 0:y[k]=(T||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:m,pattern:r}}function Qv(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),wu(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 i=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,f,p)=>(i.push({paramName:f,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(i.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),i]}function qv(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return wu(!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 Su(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,i=r.charAt(l);return i&&i!=="/"?null:r.slice(l)||"/"}const Xv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jv=r=>Xv.test(r);function Zv(r,a){a===void 0&&(a="/");let{pathname:l,search:i="",hash:c=""}=typeof r=="string"?Wa(r):r,d;if(l)if(Jv(l))d=l;else{if(l.includes("//")){let m=l;l=l.replace(/\/\/+/g,"/"),wu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(m+" -> "+l))}l.startsWith("/")?d=Ff(l.substring(1),"/"):d=Ff(l,a)}else d=a;return{pathname:d,search:sj(i),hash:rj(c)}}function Ff(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 Id(r,a,l,i){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function ej(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Cu(r,a){let l=ej(r);return a?l.map((i,c)=>c===l.length-1?i.pathname:i.pathnameBase):l.map(i=>i.pathnameBase)}function ku(r,a,l,i){i===void 0&&(i=!1);let c;typeof r=="string"?c=Wa(r):(c=$l({},r),Dt(!c.pathname||!c.pathname.includes("?"),Id("?","pathname","search",c)),Dt(!c.pathname||!c.pathname.includes("#"),Id("#","pathname","hash",c)),Dt(!c.search||!c.search.includes("#"),Id("#","search","hash",c)));let d=r===""||c.pathname==="",m=d?"/":c.pathname,f;if(m==null)f=l;else{let v=a.length-1;if(!i&&m.startsWith("..")){let k=m.split("/");for(;k[0]==="..";)k.shift(),v-=1;c.pathname=k.join("/")}f=v>=0?a[v]:"/"}let p=Zv(c,f),y=m&&m!=="/"&&m.endsWith("/"),g=(d||m===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(y||g)&&(p.pathname+="/"),p}const un=r=>r.join("/").replace(/\/\/+/g,"/"),tj=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),sj=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,rj=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function nj(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Wx=["post","put","patch","delete"];new Set(Wx);const aj=["get",...Wx];new Set(aj);/** + * 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 Bl(){return Bl=Object.assign?Object.assign.bind():function(r){for(var a=1;a{f.current=!0}),u.useCallback(function(y,g){if(g===void 0&&(g={}),!f.current)return;if(typeof y=="number"){i.go(y);return}let v=ku(y,JSON.parse(m),d,g.relative==="path");r==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:un([a,v.pathname])),(g.replace?i.replace:i.push)(v,g.state,g)},[a,i,m,d,r])}const cj=u.createContext(null);function dj(r){let a=u.useContext(Rr).outlet;return a&&u.createElement(cj.Provider,{value:r},a)}function Gx(r,a){let{relative:l}=a===void 0?{}:a,{future:i}=u.useContext(yn),{matches:c}=u.useContext(Rr),{pathname:d}=vn(),m=JSON.stringify(Cu(c,i.v7_relativeSplatPath));return u.useMemo(()=>ku(r,JSON.parse(m),d,l==="path"),[r,m,d,l])}function uj(r,a){return hj(r,a)}function hj(r,a,l,i){Ha()||Dt(!1);let{navigator:c}=u.useContext(yn),{matches:d}=u.useContext(Rr),m=d[d.length-1],f=m?m.params:{};m&&m.pathname;let p=m?m.pathnameBase:"/";m&&m.route;let y=vn(),g;if(a){var v;let b=typeof a=="string"?Wa(a):a;p==="/"||(v=b.pathname)!=null&&v.startsWith(p)||Dt(!1),g=b}else g=y;let k=g.pathname||"/",P=k;if(p!=="/"){let b=p.replace(/^\//,"").split("/");P="/"+k.replace(/^\//,"").split("/").slice(b.length).join("/")}let T=Lv(r,{pathname:P}),N=gj(T&&T.map(b=>Object.assign({},b,{params:Object.assign({},f,b.params),pathname:un([p,c.encodeLocation?c.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?p:un([p,c.encodeLocation?c.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),d,l,i);return a&&N?u.createElement(Ro.Provider,{value:{location:Bl({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:cn.Pop}},N):N}function mj(){let r=bj(),a=nj(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 u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},a),l?u.createElement("pre",{style:c},l):null,null)}const fj=u.createElement(mj,null);class xj extends u.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?u.createElement(Rr.Provider,{value:this.props.routeContext},u.createElement(Hx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function pj(r){let{routeContext:a,match:l,children:i}=r,c=u.useContext(Eu);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),u.createElement(Rr.Provider,{value:a},i)}function gj(r,a,l,i){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),i===void 0&&(i=null),r==null){var d;if(!l)return null;if(l.errors)r=l.matches;else if((d=i)!=null&&d.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 g=m.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);g>=0||Dt(!1),m=m.slice(0,Math.min(m.length,g+1))}let p=!1,y=-1;if(l&&i&&i.v7_partialHydration)for(let g=0;g=0?m=m.slice(0,y+1):m=[m[0]];break}}}return m.reduceRight((g,v,k)=>{let P,T=!1,N=null,b=null;l&&(P=f&&v.route.id?f[v.route.id]:void 0,N=v.route.errorElement||fj,p&&(y<0&&k===0?(wj("route-fallback"),T=!0,b=null):y===k&&(T=!0,b=v.route.hydrateFallbackElement||null)));let C=a.concat(m.slice(0,k+1)),E=()=>{let j;return P?j=N:T?j=b:v.route.Component?j=u.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=g,u.createElement(pj,{match:v,routeContext:{outlet:g,matches:C,isDataRoute:l!=null},children:j})};return l&&(v.route.ErrorBoundary||v.route.errorElement||k===0)?u.createElement(xj,{location:l.location,revalidation:l.revalidation,component:N,error:P,children:E(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):E()},null)}var Yx=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(Yx||{}),Qx=(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})(Qx||{});function yj(r){let a=u.useContext(Eu);return a||Dt(!1),a}function vj(r){let a=u.useContext(lj);return a||Dt(!1),a}function jj(r){let a=u.useContext(Rr);return a||Dt(!1),a}function qx(r){let a=jj(),l=a.matches[a.matches.length-1];return l.route.id||Dt(!1),l.route.id}function bj(){var r;let a=u.useContext(Hx),l=vj(),i=qx();return a!==void 0?a:(r=l.errors)==null?void 0:r[i]}function Nj(){let{router:r}=yj(Yx.UseNavigateStable),a=qx(Qx.UseNavigateStable),l=u.useRef(!1);return Kx(()=>{l.current=!0}),u.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,Bl({fromRouteId:a},d)))},[r,a])}const zf={};function wj(r,a,l){zf[r]||(zf[r]=!0)}function Sj(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function _d(r){let{to:a,replace:l,state:i,relative:c}=r;Ha()||Dt(!1);let{future:d,static:m}=u.useContext(yn),{matches:f}=u.useContext(Rr),{pathname:p}=vn(),y=jn(),g=ku(a,Cu(f,d.v7_relativeSplatPath),p,c==="path"),v=JSON.stringify(g);return u.useEffect(()=>y(JSON.parse(v),{replace:l,state:i,relative:c}),[y,v,c,l,i]),null}function Cj(r){return dj(r.context)}function gt(r){Dt(!1)}function kj(r){let{basename:a="/",children:l=null,location:i,navigationType:c=cn.Pop,navigator:d,static:m=!1,future:f}=r;Ha()&&Dt(!1);let p=a.replace(/^\/*/,"/"),y=u.useMemo(()=>({basename:p,navigator:d,static:m,future:Bl({v7_relativeSplatPath:!1},f)}),[p,f,d,m]);typeof i=="string"&&(i=Wa(i));let{pathname:g="/",search:v="",hash:k="",state:P=null,key:T="default"}=i,N=u.useMemo(()=>{let b=Su(g,p);return b==null?null:{location:{pathname:b,search:v,hash:k,state:P,key:T},navigationType:c}},[p,g,v,k,P,T,c]);return N==null?null:u.createElement(yn.Provider,{value:y},u.createElement(Ro.Provider,{children:l,value:N}))}function Ej(r){let{children:a,location:l}=r;return uj(Jd(a),l)}new Promise(()=>{});function Jd(r,a){a===void 0&&(a=[]);let l=[];return u.Children.forEach(r,(i,c)=>{if(!u.isValidElement(i))return;let d=[...a,c];if(i.type===u.Fragment){l.push.apply(l,Jd(i.props.children,d));return}i.type!==gt&&Dt(!1),!i.props.index||!i.props.children||Dt(!1);let m={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(m.children=Jd(i.props.children,d)),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 Zd(){return Zd=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function Tj(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Rj(r,a){return r.button===0&&(!a||a==="_self")&&!Tj(r)}function eu(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 i=r[l];return a.concat(Array.isArray(i)?i.map(c=>[l,c]):[[l,i]])},[]))}function Ij(r,a){let l=eu(r);return a&&a.forEach((i,c)=>{l.has(c)||a.getAll(c).forEach(d=>{l.append(c,d)})}),l}const _j=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Mj="6";try{window.__reactRouterVersion=Mj}catch{}const Aj="startTransition",$f=To[Aj];function Dj(r){let{basename:a,children:l,future:i,window:c}=r,d=u.useRef();d.current==null&&(d.current=Mv({window:c,v5Compat:!0}));let m=d.current,[f,p]=u.useState({action:m.action,location:m.location}),{v7_startTransition:y}=i||{},g=u.useCallback(v=>{y&&$f?$f(()=>p(v)):p(v)},[p,y]);return u.useLayoutEffect(()=>m.listen(g),[m,g]),u.useEffect(()=>Sj(i),[i]),u.createElement(kj,{basename:a,children:l,location:f.location,navigationType:f.action,navigator:m,future:i})}const Lj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Oj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tu=u.forwardRef(function(a,l){let{onClick:i,relative:c,reloadDocument:d,replace:m,state:f,target:p,to:y,preventScrollReset:g,viewTransition:v}=a,k=Pj(a,_j),{basename:P}=u.useContext(yn),T,N=!1;if(typeof y=="string"&&Oj.test(y)&&(T=y,Lj))try{let j=new URL(window.location.href),R=y.startsWith("//")?new URL(j.protocol+y):new URL(y),G=Su(R.pathname,P);R.origin===j.origin&&G!=null?y=G+R.search+R.hash:N=!0}catch{}let b=ij(y,{relative:c}),C=Fj(y,{replace:m,state:f,target:p,preventScrollReset:g,relative:c,viewTransition:v});function E(j){i&&i(j),j.defaultPrevented||C(j)}return u.createElement("a",Zd({},k,{href:T||b,onClick:N||d?i:E,ref:l,target:p}))});var Bf;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Bf||(Bf={}));var Uf;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(Uf||(Uf={}));function Fj(r,a){let{target:l,replace:i,state:c,preventScrollReset:d,relative:m,viewTransition:f}=a===void 0?{}:a,p=jn(),y=vn(),g=Gx(r,{relative:m});return u.useCallback(v=>{if(Rj(v,l)){v.preventDefault();let k=i!==void 0?i:po(y)===po(g);p(r,{replace:k,state:c,preventScrollReset:d,relative:m,viewTransition:f})}},[y,p,g,i,c,l,r,d,m,f])}function Xx(r){let a=u.useRef(eu(r)),l=u.useRef(!1),i=vn(),c=u.useMemo(()=>Ij(i.search,l.current?null:a.current),[i.search]),d=jn(),m=u.useCallback((f,p)=>{const y=eu(typeof f=="function"?f(c):f);l.current=!0,d("?"+y,p)},[d,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 zj=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$j=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,i)=>i?i.toUpperCase():l.toLowerCase()),Vf=r=>{const a=$j(r);return a.charAt(0).toUpperCase()+a.slice(1)},Jx=(...r)=>r.filter((a,l,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===l).join(" ").trim(),Bj=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 Uj={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 Vj=u.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:m,...f},p)=>u.createElement("svg",{ref:p,...Uj,width:a,height:a,stroke:r,strokeWidth:i?Number(l)*24/Number(a):l,className:Jx("lucide",c),...!d&&!Bj(f)&&{"aria-hidden":"true"},...f},[...m.map(([y,g])=>u.createElement(y,g)),...Array.isArray(d)?d:[d]]));/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ee=(r,a)=>{const l=u.forwardRef(({className:i,...c},d)=>u.createElement(Vj,{ref:d,iconNode:a,className:Jx(`lucide-${zj(Vf(r))}`,`lucide-${r}`,i),...c}));return l.displayName=Vf(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 Wj=[["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"}]],Hj=Ee("arrow-up-down",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 Kj=[["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"}]],Wf=Ee("bitcoin",Kj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gj=[["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"}]],Fs=Ee("book-open",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:"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"}]],go=Ee("calendar",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:"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"}]],qj=Ee("chart-column",Qj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Io=Ee("check",Xj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ul=Ee("chevron-down",Jj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zj=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],eb=Ee("chevron-left",Zj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],wr=Ee("chevron-right",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=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Zx=Ee("chevron-up",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"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],nb=Ee("circle-alert",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 ab=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Hf=Ee("circle-check-big",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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],su=Ee("circle-check",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=[["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"}]],ep=Ee("circle-question-mark",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=[["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"}]],Md=Ee("circle-user",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=[["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"}]],tp=Ee("circle-x",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 db=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ru=Ee("clock",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 ub=[["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"}]],sp=Ee("copy",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=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Kf=Ee("credit-card",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:"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"}]],on=Ee("crown",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 fb=[["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"}]],yo=Ee("dollar-sign",fb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xb=[["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"}]],pb=Ee("download",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 gb=[["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"}]],fn=Ee("external-link",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=[["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",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 vb=[["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"}]],jb=Ee("file-text",vb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bb=[["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"}]],rp=Ee("funnel",bb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nb=[["rect",{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"}]],wb=Ee("gift",Nb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sb=[["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"}]],Cb=Ee("git-merge",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=[["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"}]],nu=Ee("globe",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 Eb=[["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"}]],Pb=Ee("graduation-cap",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:"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"}]],br=Ee("grip-vertical",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:"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"}]],Ib=Ee("handshake",Rb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _b=[["path",{d:"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"}]],Mb=Ee("house",_b);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ab=[["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"}]],np=Ee("image",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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],eo=Ee("info",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 Lb=[["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"}]],Gf=Ee("key",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 Ob=[["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"}]],Fb=Ee("layout-dashboard",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:"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"}]],kr=Ee("link-2",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:"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"}]],Yf=Ee("link",$b);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bb=[["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"}]],Ub=Ee("lock",Bb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vb=[["path",{d:"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"}]],Wb=Ee("log-out",Vb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hb=[["path",{d:"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"}]],ap=Ee("map-pin",Hb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kb=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Gb=Ee("menu",Kb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yb=[["path",{d:"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"}]],Qb=Ee("message-circle",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=[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]],La=Ee("navigation",qb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xb=[["path",{d:"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"}]],Jb=Ee("palette",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 Zb=[["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",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=[["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"}]],tN=Ee("percent",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 sN=[["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"}]],rN=Ee("phone",sN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nN=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],aN=Ee("pin",nN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rt=Ee("plus",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=[["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"}]],Qf=Ee("qr-code",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:"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"}]],Be=Ee("refresh-cw",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=[["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"}]],It=Ee("save",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:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hn=Ee("search",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:"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"}]],hN=Ee("send",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 mN=[["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"}]],qn=Ee("settings",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:"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"}]],Ad=Ee("settings-2",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:"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",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 pN=[["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"}]],au=Ee("shopping-bag",pN);/** + * @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=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Vl=Ee("smartphone",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:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],vN=Ee("star",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 jN=[["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"}]],Dd=Ee("tag",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:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Gt=Ee("trash-2",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:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Oa=Ee("trending-up",NN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wN=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],qf=Ee("trophy",wN);/** + * @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:"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"}]],lp=Ee("undo-2",SN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CN=[["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"}]],vo=Ee("upload",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 kN=[["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"}]],lu=Ee("user-plus",kN);/** + * @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:"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"}]],Fa=Ee("user",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 PN=[["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"}]],Yt=Ee("users",PN);/** + * @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:"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"}]],Ba=Ee("wallet",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 RN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xs=Ee("x",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 IN=[["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"}]],dn=Ee("zap",IN),Tu="admin_token";function Ru(){try{return localStorage.getItem(Tu)}catch{return null}}function _N(r){try{localStorage.setItem(Tu,r)}catch{}}function MN(){try{localStorage.removeItem(Tu)}catch{}}const AN="https://soulapi.quwanzhi.com",DN=15e3,LN=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):AN};function Ua(r){const a=LN(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function _o(r,a={}){const{data:l,...i}=a,c=Ua(r),d=new Headers(i.headers),m=Ru();m&&d.set("Authorization",`Bearer ${m}`),l!=null&&!d.has("Content-Type")&&d.set("Content-Type","application/json");const f=l!=null?JSON.stringify(l):i.body,p=new AbortController,y=setTimeout(()=>p.abort(),DN),g=await fetch(c,{...i,headers:d,body:f,credentials:"include",signal:p.signal}).finally(()=>clearTimeout(y)),k=(g.headers.get("Content-Type")||"").includes("application/json")?await g.json():g;if(!g.ok){const P=new Error((k==null?void 0:k.error)||`HTTP ${g.status}`);throw P.status=g.status,P.data=k,P}return k}function Le(r,a){return _o(r,{...a,method:"GET"})}function ut(r,a,l){return _o(r,{...l,method:"POST",data:a})}function yt(r,a,l){return _o(r,{...l,method:"PUT",data:a})}function Er(r,a){return _o(r,{...a,method:"DELETE"})}const ON=[{icon:Fb,label:"数据概览",href:"/dashboard"},{icon:Fs,label:"内容管理",href:"/content"},{icon:Yt,label:"用户管理",href:"/users"},{icon:Cb,label:"找伙伴",href:"/find-partner"},{icon:Ba,label:"推广中心",href:"/distribution"}];function FN(){const r=vn(),a=jn(),[l,i]=u.useState(!1),[c,d]=u.useState(!1);u.useEffect(()=>{i(!0)},[]),u.useEffect(()=>{if(!l)return;d(!1);let f=!1;return Le("/api/admin").then(p=>{f||(p&&p.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{f||a("/login",{replace:!0})}),()=>{f=!0}},[l,a]);const m=async()=>{MN();try{await ut("/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:[ON.map(f=>{const p=r.pathname===f.href;return e.jsxs(tu,{to:f.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${p?"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(tu,{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(qn,{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(Wb,{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(Cj,{})})})]})}function Xf(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function Iu(...r){return a=>{let l=!1;const i=r.map(c=>{const d=Xf(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c{let{children:d,...m}=i;ip(d)&&typeof jo=="function"&&(d=jo(d._payload));const f=u.Children.toArray(d),p=f.find(VN);if(p){const y=p.props.children,g=f.map(v=>v===p?u.Children.count(y)>1?u.Children.only(null):u.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...m,ref:c,children:u.isValidElement(y)?u.cloneElement(y,void 0,g):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}var cp=op("Slot");function BN(r){const a=u.forwardRef((l,i)=>{let{children:c,...d}=l;if(ip(c)&&typeof jo=="function"&&(c=jo(c._payload)),u.isValidElement(c)){const m=HN(c),f=WN(d,c.props);return c.type!==u.Fragment&&(f.ref=i?Iu(i,m):m),u.cloneElement(c,f)}return u.Children.count(c)>1?u.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var UN=Symbol("radix.slottable");function VN(r){return u.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===UN}function WN(r,a){const l={...a};for(const i in a){const c=r[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...f)=>{const p=d(...f);return c(...f),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function HN(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.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 dp(r){var a,l,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;atypeof r=="boolean"?`${r}`:r===0?"0":r,Zf=up,hp=(r,a)=>l=>{var i;if((a==null?void 0:a.variants)==null)return Zf(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,m=Object.keys(c).map(y=>{const g=l==null?void 0:l[y],v=d==null?void 0:d[y];if(g===null)return null;const k=Jf(g)||Jf(v);return c[y][k]}),f=l&&Object.entries(l).reduce((y,g)=>{let[v,k]=g;return k===void 0||(y[v]=k),y},{}),p=a==null||(i=a.compoundVariants)===null||i===void 0?void 0:i.reduce((y,g)=>{let{class:v,className:k,...P}=g;return Object.entries(P).every(T=>{let[N,b]=T;return Array.isArray(b)?b.includes({...d,...f}[N]):{...d,...f}[N]===b})?[...y,v,k]:y},[]);return Zf(r,m,p,l==null?void 0:l.class,l==null?void 0:l.className)},KN=(r,a)=>{const l=new Array(r.length+a.length);for(let i=0;i({classGroupId:r,validator:a}),mp=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),bo="-",ex=[],YN="arbitrary..",QN=r=>{const a=XN(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=r;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return qN(m);const f=m.split(bo),p=f[0]===""&&f.length>1?1:0;return fp(f,p,a)},getConflictingClassGroupIds:(m,f)=>{if(f){const p=i[m],y=l[m];return p?y?KN(y,p):p:y||ex}return l[m]||ex}}},fp=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],d=l.nextPart.get(c);if(d){const y=fp(r,a+1,d);if(y)return y}const m=l.validators;if(m===null)return;const f=a===0?r.join(bo):r.slice(a).join(bo),p=m.length;for(let y=0;yr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),i=a.slice(0,l);return i?YN+i:void 0})(),XN=r=>{const{theme:a,classGroups:l}=r;return JN(l,a)},JN=(r,a)=>{const l=mp();for(const i in r){const c=r[i];_u(c,l,i,a)}return l},_u=(r,a,l,i)=>{const c=r.length;for(let d=0;d{if(typeof r=="string"){e1(r,a,l);return}if(typeof r=="function"){t1(r,a,l,i);return}s1(r,a,l,i)},e1=(r,a,l)=>{const i=r===""?a:xp(a,r);i.classGroupId=l},t1=(r,a,l,i)=>{if(r1(r)){_u(r(i),a,l,i);return}a.validators===null&&(a.validators=[]),a.validators.push(GN(l,r))},s1=(r,a,l,i)=>{const c=Object.entries(r),d=c.length;for(let m=0;m{let l=r;const i=a.split(bo),c=i.length;for(let d=0;d"isThemeGetter"in r&&r.isThemeGetter===!0,n1=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),i=Object.create(null);const c=(d,m)=>{l[d]=m,a++,a>r&&(a=0,i=l,l=Object.create(null))};return{get(d){let m=l[d];if(m!==void 0)return m;if((m=i[d])!==void 0)return c(d,m),m},set(d,m){d in l?l[d]=m:c(d,m)}}},iu="!",tx=":",a1=[],sx=(r,a,l,i,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:i,isExternal:c}),l1=r=>{const{prefix:a,experimentalParseClassName:l}=r;let i=c=>{const d=[];let m=0,f=0,p=0,y;const g=c.length;for(let N=0;Np?y-p:void 0;return sx(d,P,k,T)};if(a){const c=a+tx,d=i;i=m=>m.startsWith(c)?d(m.slice(c.length)):sx(a1,!1,m,void 0,!0)}if(l){const c=i;i=d=>l({className:d,parseClassName:c})}return i},i1=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,i)=>{a.set(l,1e6+i)}),l=>{const i=[];let c=[];for(let d=0;d0&&(c.sort(),i.push(...c),c=[]),i.push(m)):c.push(m)}return c.length>0&&(c.sort(),i.push(...c)),i}},o1=r=>({cache:n1(r.cacheSize),parseClassName:l1(r),sortModifiers:i1(r),...QN(r)}),c1=/\s+/,d1=(r,a)=>{const{parseClassName:l,getClassGroupId:i,getConflictingClassGroupIds:c,sortModifiers:d}=a,m=[],f=r.trim().split(c1);let p="";for(let y=f.length-1;y>=0;y-=1){const g=f[y],{isExternal:v,modifiers:k,hasImportantModifier:P,baseClassName:T,maybePostfixModifierPosition:N}=l(g);if(v){p=g+(p.length>0?" "+p:p);continue}let b=!!N,C=i(b?T.substring(0,N):T);if(!C){if(!b){p=g+(p.length>0?" "+p:p);continue}if(C=i(T),!C){p=g+(p.length>0?" "+p:p);continue}b=!1}const E=k.length===0?"":k.length===1?k[0]:d(k).join(":"),j=P?E+iu:E,R=j+C;if(m.indexOf(R)>-1)continue;m.push(R);const G=c(C,b);for(let J=0;J0?" "+p:p)}return p},u1=(...r)=>{let a=0,l,i,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let i=0;i{let l,i,c,d;const m=p=>{const y=a.reduce((g,v)=>v(g),r());return l=o1(y),i=l.cache.get,c=l.cache.set,d=f,f(p)},f=p=>{const y=i(p);if(y)return y;const g=d1(p,l);return c(p,g),g};return d=m,(...p)=>d(u1(...p))},m1=[],Ut=r=>{const a=l=>l[r]||m1;return a.isThemeGetter=!0,a},gp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,f1=/^\d+\/\d+$/,x1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p1=/\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$/,g1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,y1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_a=r=>f1.test(r),Xe=r=>!!r&&!Number.isNaN(Number(r)),nn=r=>!!r&&Number.isInteger(Number(r)),Ld=r=>r.endsWith("%")&&Xe(r.slice(0,-1)),Nr=r=>x1.test(r),j1=()=>!0,b1=r=>p1.test(r)&&!g1.test(r),vp=()=>!1,N1=r=>y1.test(r),w1=r=>v1.test(r),S1=r=>!_e(r)&&!Me(r),C1=r=>Ka(r,Np,vp),_e=r=>gp.test(r),Yn=r=>Ka(r,wp,b1),Od=r=>Ka(r,R1,Xe),rx=r=>Ka(r,jp,vp),k1=r=>Ka(r,bp,w1),to=r=>Ka(r,Sp,N1),Me=r=>yp.test(r),Dl=r=>Ga(r,wp),E1=r=>Ga(r,I1),nx=r=>Ga(r,jp),P1=r=>Ga(r,Np),T1=r=>Ga(r,bp),so=r=>Ga(r,Sp,!0),Ka=(r,a,l)=>{const i=gp.exec(r);return i?i[1]?a(i[1]):l(i[2]):!1},Ga=(r,a,l=!1)=>{const i=yp.exec(r);return i?i[1]?a(i[1]):l:!1},jp=r=>r==="position"||r==="percentage",bp=r=>r==="image"||r==="url",Np=r=>r==="length"||r==="size"||r==="bg-size",wp=r=>r==="length",R1=r=>r==="number",I1=r=>r==="family-name",Sp=r=>r==="shadow",_1=()=>{const r=Ut("color"),a=Ut("font"),l=Ut("text"),i=Ut("font-weight"),c=Ut("tracking"),d=Ut("leading"),m=Ut("breakpoint"),f=Ut("container"),p=Ut("spacing"),y=Ut("radius"),g=Ut("shadow"),v=Ut("inset-shadow"),k=Ut("text-shadow"),P=Ut("drop-shadow"),T=Ut("blur"),N=Ut("perspective"),b=Ut("aspect"),C=Ut("ease"),E=Ut("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...R(),Me,_e],J=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],I=()=>[Me,_e,p],w=()=>[_a,"full","auto",...I()],V=()=>[nn,"none","subgrid",Me,_e],te=()=>["auto",{span:["full",nn,Me,_e]},nn,Me,_e],ie=()=>[nn,"auto",Me,_e],Y=()=>["auto","min","max","fr",Me,_e],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],_=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...I()],ue=()=>[_a,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],O=()=>[r,Me,_e],re=()=>[...R(),nx,rx,{position:[Me,_e]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",P1,C1,{size:[Me,_e]}],$=()=>[Ld,Dl,Yn],F=()=>["","none","full",y,Me,_e],ee=()=>["",Xe,Dl,Yn],K=()=>["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"],X=()=>[Xe,Ld,nx,rx],ye=()=>["","none",T,Me,_e],Ce=()=>["none",Xe,Me,_e],z=()=>["none",Xe,Me,_e],xe=()=>[Xe,Me,_e],Pe=()=>[_a,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Nr],breakpoint:[Nr],color:[j1],container:[Nr],"drop-shadow":[Nr],ease:["in","out","in-out"],font:[S1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Nr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Nr],shadow:[Nr],spacing:["px",Xe],text:[Nr],"text-shadow":[Nr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",_a,_e,Me,b]}],container:["container"],columns:[{columns:[Xe,_e,Me,f]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[nn,"auto",Me,_e]}],basis:[{basis:[_a,"full","auto",f,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,_a,"auto","initial","none",_e]}],grow:[{grow:["",Xe,Me,_e]}],shrink:[{shrink:["",Xe,Me,_e]}],order:[{order:[nn,"first","last","none",Me,_e]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:te()}],"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":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[..._(),"normal"]}],"justify-self":[{"justify-self":["auto",..._()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[..._(),{baseline:["","last"]}]}],"align-self":[{self:["auto",..._(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[..._(),"baseline"]}],"place-self":[{"place-self":["auto",..._()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:ue()}],w:[{w:[f,"screen",...ue()]}],"min-w":[{"min-w":[f,"screen","none",...ue()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[m]},...ue()]}],h:[{h:["screen","lh",...ue()]}],"min-h":[{"min-h":["screen","lh","none",...ue()]}],"max-h":[{"max-h":["screen","lh",...ue()]}],"font-size":[{text:["base",l,Dl,Yn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Me,Od]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ld,_e]}],"font-family":[{font:[E1,_e,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,Me,_e]}],"line-clamp":[{"line-clamp":[Xe,"none",Me,Od]}],leading:[{leading:[d,...I()]}],"list-image":[{"list-image":["none",Me,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,_e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",Me,Yn]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[Xe,"auto",Me,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,_e]}],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",Me,_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},nn,Me,_e],radial:["",Me,_e],conic:[nn,Me,_e]},T1,k1]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,Me,_e]}],"outline-w":[{outline:["",Xe,Dl,Yn]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",g,so,to]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",v,so,to]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[Xe,Yn]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",k,so,to]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[Xe,Me,_e]}],"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":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[Me,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,_e]}],filter:[{filter:["","none",Me,_e]}],blur:[{blur:ye()}],brightness:[{brightness:[Xe,Me,_e]}],contrast:[{contrast:[Xe,Me,_e]}],"drop-shadow":[{"drop-shadow":["","none",P,so,to]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",Xe,Me,_e]}],"hue-rotate":[{"hue-rotate":[Xe,Me,_e]}],invert:[{invert:["",Xe,Me,_e]}],saturate:[{saturate:[Xe,Me,_e]}],sepia:[{sepia:["",Xe,Me,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,_e]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,Me,_e]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,Me,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,Me,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,Me,_e]}],"backdrop-invert":[{"backdrop-invert":["",Xe,Me,_e]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,Me,_e]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,Me,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,Me,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",Me,_e]}],ease:[{ease:["linear","initial",C,Me,_e]}],delay:[{delay:[Xe,Me,_e]}],animate:[{animate:["none",E,Me,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,Me,_e]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:z()}],"scale-x":[{"scale-x":z()}],"scale-y":[{"scale-y":z()}],"scale-z":[{"scale-z":z()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Me,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Pe()}],"translate-x":[{"translate-x":Pe()}],"translate-y":[{"translate-y":Pe()}],"translate-z":[{"translate-z":Pe()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"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",Me,_e]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Me,_e]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[Xe,Dl,Yn,Od]}],stroke:[{stroke:["none",...O()]}],"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"]}},M1=h1(_1);function ot(...r){return M1(up(r))}const A1=hp("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:i=!1,...c}){const d=i?cp:"button";return e.jsx(d,{"data-slot":"button",className:ot(A1({variant:a,size:l,className:r})),...c})}function ce({className:r,type:a,...l}){return e.jsx("input",{type:a,"data-slot":"input",className:ot("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 D1(){const r=jn(),[a,l]=u.useState(""),[i,c]=u.useState(""),[d,m]=u.useState(""),[f,p]=u.useState(!1),y=async()=>{m(""),p(!0);try{const g=await ut("/api/admin",{username:a.trim(),password:i});if((g==null?void 0:g.success)!==!1&&(g!=null&&g.token)){_N(g.token),r("/dashboard",{replace:!0});return}m(g.error||"用户名或密码错误")}catch(g){const v=g;m(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{p(!1)}};return e.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"w-full max-w-md relative z-10",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-[#38bdac]/20 rounded-2xl flex items-center justify-center mx-auto mb-4 border border-[#38bdac]/30",children:e.jsx(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(Fa,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(ce,{type:"text",value:a,onChange:g=>l(g.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ub,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(ce,{type:"password",value:i,onChange:g=>c(g.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:g=>g.key==="Enter"&&y()})]})]}),d&&e.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:d}),e.jsx(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=u.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:ot("rounded-xl border bg-card text-card-foreground shadow",r),...a}));we.displayName="Card";const Qe=u.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:ot("flex flex-col space-y-1.5 p-6",r),...a}));Qe.displayName="CardHeader";const qe=u.forwardRef(({className:r,...a},l)=>e.jsx("h3",{ref:l,className:ot("font-semibold leading-none tracking-tight",r),...a}));qe.displayName="CardTitle";const vt=u.forwardRef(({className:r,...a},l)=>e.jsx("p",{ref:l,className:ot("text-sm text-muted-foreground",r),...a}));vt.displayName="CardDescription";const Se=u.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:ot("p-6 pt-0",r),...a}));Se.displayName="CardContent";const L1=u.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:ot("flex items-center p-6 pt-0",r),...a}));L1.displayName="CardFooter";function O1(){const r=jn(),[a,l]=u.useState(!0),[i,c]=u.useState([]),[d,m]=u.useState([]),[f,p]=u.useState(0),[y,g]=u.useState(0),[v,k]=u.useState(0),[P,T]=u.useState(0),[N,b]=u.useState(0),[C,E]=u.useState(0),[j,R]=u.useState(null);async function G(){var w;l(!0),R(null);try{try{const re=await Le("/api/admin/dashboard/overview");if(re!=null&&re.success){p(re.totalUsers??0),g(re.paidOrderCount??0),k(re.totalRevenue??0),T(re.conversionRate??0),b(re.totalMatches??0),E(re.matchRevenue??0),m(re.recentOrders??[]),c(re.newUsers??[]);return}}catch(re){console.error("数据概览接口失败,尝试降级拉取",re)}const[V,te]=await Promise.all([Le("/api/db/users?page=1&pageSize=10"),Le("/api/orders?page=1&pageSize=20&status=paid")]),ie=typeof(V==null?void 0:V.total)=="number"?V.total:((w=V==null?void 0:V.users)==null?void 0:w.length)??0,Y=(te==null?void 0:te.orders)??[],ne=typeof(te==null?void 0:te.total)=="number"?te.total:Y.length,_=Y.filter(re=>re.status==="paid"||re.status==="completed"||re.status==="success"),Q=_.reduce((re,H)=>re+Number(H.amount||0),0),ue=new Set(_.map(re=>re.userId).filter(Boolean)),O=ie>0&&ue.size>0?ue.size/ie*100:0;p(ie),g(ne),k(Q),T(O),m(Y.slice(0,5)),c((V==null?void 0:V.users)??[])}catch(V){console.error("降级拉取失败",V);const te=V;(te==null?void 0:te.status)===401?R("登录已过期,请重新登录"):(te==null?void 0:te.name)==="AbortError"?R("请求超时,请检查网络后点击重试"):R("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(u.useEffect(()=>{G();const w=setInterval(G,3e4);return()=>clearInterval(w)},[]),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(Be,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),e.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const J=f,L=w=>{const V=w.productType||"",te=w.description||"";if(te){if(V==="section"&&te.includes("章节")){if(te.includes("-")){const ie=te.split("-");if(ie.length>=3)return{title:`第${ie[1]}章 第${ie[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:te,subtitle:"章节购买"}}return V==="fullbook"||te.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:V==="match"||te.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:te,subtitle:V==="section"?"单章":V==="fullbook"?"全书":"其他"}}return V==="section"?{title:`章节 ${w.productId||""}`,subtitle:"单章购买"}:V==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:V==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:V||"其他"}},I=[{title:"总用户数",value:J,icon:Yt,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${(v??0).toFixed(2)}`,icon:Oa,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:au,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${typeof P=="number"?P.toFixed(1):0}%`,icon:Fs,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"},{title:"匹配次数",value:String(N),icon:Yt,color:"text-cyan-400",bg:"bg-cyan-500/20",link:"/find-partner"},{title:"匹配收益",value:`¥${(C??0).toFixed(2)}`,icon:Oa,color:"text-pink-400",bg:"bg-pink-500/20",link:"/find-partner"}];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),j&&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:j}),e.jsx("button",{type:"button",onClick:()=>G(),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:I.map((w,V)=>e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>w.link&&r(w.link),children:[e.jsxs(Qe,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(qe,{className:"text-sm font-medium text-gray-400",children:w.title}),e.jsx("div",{className:`p-2 rounded-lg ${w.bg}`,children:e.jsx(w.icon,{className:`w-4 h-4 ${w.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:w.value}),e.jsx(wr,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},V))}),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(Qe,{className:"flex flex-row items-center justify-between",children:[e.jsx(qe,{className:"text-white",children:"最近订单"}),e.jsxs("button",{type:"button",onClick:()=>G(),className:"text-xs text-gray-400 hover:text-[#38bdac] flex items-center gap-1",title:"刷新",children:[e.jsx(Be,{className:"w-3.5 h-3.5"}),"刷新(每 30 秒自动更新)"]})]}),e.jsx(Se,{children:e.jsxs("div",{className:"space-y-3",children:[d.slice(0,5).map(w=>{var ne;const V=w.referrerId?i.find(_=>_.id===w.referrerId):void 0,te=w.referralCode||(V==null?void 0:V.referralCode)||(V==null?void 0:V.nickname)||(w.referrerId?String(w.referrerId).slice(0,8):""),ie=L(w),Y=w.userNickname||((ne=i.find(_=>_.id===w.userId))==null?void 0:ne.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:[w.userAvatar?e.jsx("img",{src:w.userAvatar,alt:Y,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:_=>{_.currentTarget.style.display="none";const Q=_.currentTarget.nextElementSibling;Q&&Q.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 ${w.userAvatar?"hidden":""}`,children:Y.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:Y}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:ie.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:ie.subtitle}),e.jsx("span",{children:new Date(w.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),te&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",te]})]})]}),e.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(w.amount).toFixed(2)]}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:w.paymentMethod||"微信"})]})]},w.id)}),d.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(au,{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(Qe,{children:e.jsx(qe,{className:"text-white",children:"新注册用户"})}),e.jsx(Se,{children:e.jsxs("div",{className:"space-y-3",children:[i.slice(0,5).map(w=>{var V;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:((V=w.nickname)==null?void 0:V.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-white",children:w.nickname||"匿名用户"}),e.jsx("p",{className:"text-xs text-gray-500",children:w.phone||"-"})]})]}),e.jsx("p",{className:"text-xs text-gray-400",children:w.createdAt?new Date(w.createdAt).toLocaleDateString():"-"})]},w.id)}),i.length===0&&e.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const ps=u.forwardRef(({className:r,...a},l)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:l,className:ot("w-full caption-bottom text-sm",r),...a})}));ps.displayName="Table";const gs=u.forwardRef(({className:r,...a},l)=>e.jsx("thead",{ref:l,className:ot("[&_tr]:border-b",r),...a}));gs.displayName="TableHeader";const ys=u.forwardRef(({className:r,...a},l)=>e.jsx("tbody",{ref:l,className:ot("[&_tr:last-child]:border-0",r),...a}));ys.displayName="TableBody";const et=u.forwardRef(({className:r,...a},l)=>e.jsx("tr",{ref:l,className:ot("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));et.displayName="TableRow";const be=u.forwardRef(({className:r,...a},l)=>e.jsx("th",{ref:l,className:ot("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));be.displayName="TableHead";const ge=u.forwardRef(({className:r,...a},l)=>e.jsx("td",{ref:l,className:ot("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));ge.displayName="TableCell";const F1=hp("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,...i}){const c=l?cp:"span";return e.jsx(c,{className:ot(F1({variant:a}),r),...i})}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 z1(r,a){const l=u.createContext(a),i=d=>{const{children:m,...f}=d,p=u.useMemo(()=>f,Object.values(f));return e.jsx(l.Provider,{value:p,children:m})};i.displayName=r+"Provider";function c(d){const m=u.useContext(l);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${r}\``)}return[i,c]}function bn(r,a=[]){let l=[];function i(d,m){const f=u.createContext(m),p=l.length;l=[...l,m];const y=v=>{var C;const{scope:k,children:P,...T}=v,N=((C=k==null?void 0:k[r])==null?void 0:C[p])||f,b=u.useMemo(()=>T,Object.values(T));return e.jsx(N.Provider,{value:b,children:P})};y.displayName=d+"Provider";function g(v,k){var N;const P=((N=k==null?void 0:k[r])==null?void 0:N[p])||f,T=u.useContext(P);if(T)return T;if(m!==void 0)return m;throw new Error(`\`${v}\` must be used within \`${d}\``)}return[y,g]}const c=()=>{const d=l.map(m=>u.createContext(m));return function(f){const p=(f==null?void 0:f[r])||d;return u.useMemo(()=>({[`__scope${r}`]:{...f,[r]:p}}),[f,p])}};return c.scopeName=r,[i,$1(c,...a)]}function $1(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const i=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const m=i.reduce((f,{useScope:p,scopeName:y})=>{const v=p(d)[`__scope${y}`];return{...f,...v}},{});return u.useMemo(()=>({[`__scope${a.scopeName}`]:m}),[m])}};return l.scopeName=a.scopeName,l}var ts=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},B1=To[" useId ".trim().toString()]||(()=>{}),U1=0;function mn(r){const[a,l]=u.useState(B1());return ts(()=>{l(i=>i??String(U1++))},[r]),a?`radix-${a}`:""}var V1=To[" useInsertionEffect ".trim().toString()]||ts;function Xn({prop:r,defaultProp:a,onChange:l=()=>{},caller:i}){const[c,d,m]=W1({defaultProp:a,onChange:l}),f=r!==void 0,p=f?r:c;{const g=u.useRef(r!==void 0);u.useEffect(()=>{const v=g.current;v!==f&&console.warn(`${i} 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.`),g.current=f},[f,i])}const y=u.useCallback(g=>{var v;if(f){const k=H1(g)?g(r):g;k!==r&&((v=m.current)==null||v.call(m,k))}else d(g)},[f,r,d,m]);return[p,y]}function W1({defaultProp:r,onChange:a}){const[l,i]=u.useState(r),c=u.useRef(l),d=u.useRef(a);return V1(()=>{d.current=a},[a]),u.useEffect(()=>{var m;c.current!==l&&((m=d.current)==null||m.call(d,l),c.current=l)},[l,c]),[l,i,d]}function H1(r){return typeof r=="function"}function Wl(r){const a=K1(r),l=u.forwardRef((i,c)=>{const{children:d,...m}=i,f=u.Children.toArray(d),p=f.find(Y1);if(p){const y=p.props.children,g=f.map(v=>v===p?u.Children.count(y)>1?u.Children.only(null):u.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...m,ref:c,children:u.isValidElement(y)?u.cloneElement(y,void 0,g):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}function K1(r){const a=u.forwardRef((l,i)=>{const{children:c,...d}=l;if(u.isValidElement(c)){const m=q1(c),f=Q1(d,c.props);return c.type!==u.Fragment&&(f.ref=i?Iu(i,m):m),u.cloneElement(c,f)}return u.Children.count(c)>1?u.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var G1=Symbol("radix.slottable");function Y1(r){return u.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===G1}function Q1(r,a){const l={...a};for(const i in a){const c=r[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...f)=>{const p=d(...f);return c(...f),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function q1(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.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 X1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=X1.reduce((r,a)=>{const l=Wl(`Primitive.${a}`),i=u.forwardRef((c,d)=>{const{asChild:m,...f}=c,p=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...f,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{});function J1(r,a){r&&Kl.flushSync(()=>r.dispatchEvent(a))}function xn(r){const a=u.useRef(r);return u.useEffect(()=>{a.current=r}),u.useMemo(()=>(...l)=>{var i;return(i=a.current)==null?void 0:i.call(a,...l)},[])}function Z1(r,a=globalThis==null?void 0:globalThis.document){const l=xn(r);u.useEffect(()=>{const i=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",i,{capture:!0}),()=>a.removeEventListener("keydown",i,{capture:!0})},[l,a])}var ew="DismissableLayer",ou="dismissableLayer.update",tw="dismissableLayer.pointerDownOutside",sw="dismissableLayer.focusOutside",ax,Cp=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mu=u.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:m,onDismiss:f,...p}=r,y=u.useContext(Cp),[g,v]=u.useState(null),k=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=u.useState({}),T=it(a,L=>v(L)),N=Array.from(y.layers),[b]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),C=N.indexOf(b),E=g?N.indexOf(g):-1,j=y.layersWithOutsidePointerEventsDisabled.size>0,R=E>=C,G=aw(L=>{const I=L.target,w=[...y.branches].some(V=>V.contains(I));!R||w||(c==null||c(L),m==null||m(L),L.defaultPrevented||f==null||f())},k),J=lw(L=>{const I=L.target;[...y.branches].some(V=>V.contains(I))||(d==null||d(L),m==null||m(L),L.defaultPrevented||f==null||f())},k);return Z1(L=>{E===y.layers.size-1&&(i==null||i(L),!L.defaultPrevented&&f&&(L.preventDefault(),f()))},k),u.useEffect(()=>{if(g)return l&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(ax=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(g)),y.layers.add(g),lx(),()=>{l&&y.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=ax)}},[g,k,l,y]),u.useEffect(()=>()=>{g&&(y.layers.delete(g),y.layersWithOutsidePointerEventsDisabled.delete(g),lx())},[g,y]),u.useEffect(()=>{const L=()=>P({});return document.addEventListener(ou,L),()=>document.removeEventListener(ou,L)},[]),e.jsx(Je.div,{...p,ref:T,style:{pointerEvents:j?R?"auto":"none":void 0,...r.style},onFocusCapture:Ye(r.onFocusCapture,J.onFocusCapture),onBlurCapture:Ye(r.onBlurCapture,J.onBlurCapture),onPointerDownCapture:Ye(r.onPointerDownCapture,G.onPointerDownCapture)})});Mu.displayName=ew;var rw="DismissableLayerBranch",nw=u.forwardRef((r,a)=>{const l=u.useContext(Cp),i=u.useRef(null),c=it(a,i);return u.useEffect(()=>{const d=i.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),e.jsx(Je.div,{...r,ref:c})});nw.displayName=rw;function aw(r,a=globalThis==null?void 0:globalThis.document){const l=xn(r),i=u.useRef(!1),c=u.useRef(()=>{});return u.useEffect(()=>{const d=f=>{if(f.target&&!i.current){let p=function(){kp(tw,l,y,{discrete:!0})};const y={originalEvent:f};f.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=p,a.addEventListener("click",c.current,{once:!0})):p()}else a.removeEventListener("click",c.current);i.current=!1},m=window.setTimeout(()=>{a.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(m),a.removeEventListener("pointerdown",d),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>i.current=!0}}function lw(r,a=globalThis==null?void 0:globalThis.document){const l=xn(r),i=u.useRef(!1);return u.useEffect(()=>{const c=d=>{d.target&&!i.current&&kp(sw,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function lx(){const r=new CustomEvent(ou);document.dispatchEvent(r)}function kp(r,a,l,{discrete:i}){const c=l.originalEvent.target,d=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),i?J1(c,d):c.dispatchEvent(d)}var Fd="focusScope.autoFocusOnMount",zd="focusScope.autoFocusOnUnmount",ix={bubbles:!1,cancelable:!0},iw="FocusScope",Au=u.forwardRef((r,a)=>{const{loop:l=!1,trapped:i=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...m}=r,[f,p]=u.useState(null),y=xn(c),g=xn(d),v=u.useRef(null),k=it(a,N=>p(N)),P=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(i){let N=function(j){if(P.paused||!f)return;const R=j.target;f.contains(R)?v.current=R:ln(v.current,{select:!0})},b=function(j){if(P.paused||!f)return;const R=j.relatedTarget;R!==null&&(f.contains(R)||ln(v.current,{select:!0}))},C=function(j){if(document.activeElement===document.body)for(const G of j)G.removedNodes.length>0&&ln(f)};document.addEventListener("focusin",N),document.addEventListener("focusout",b);const E=new MutationObserver(C);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",b),E.disconnect()}}},[i,f,P.paused]),u.useEffect(()=>{if(f){cx.add(P);const N=document.activeElement;if(!f.contains(N)){const C=new CustomEvent(Fd,ix);f.addEventListener(Fd,y),f.dispatchEvent(C),C.defaultPrevented||(ow(mw(Ep(f)),{select:!0}),document.activeElement===N&&ln(f))}return()=>{f.removeEventListener(Fd,y),setTimeout(()=>{const C=new CustomEvent(zd,ix);f.addEventListener(zd,g),f.dispatchEvent(C),C.defaultPrevented||ln(N??document.body,{select:!0}),f.removeEventListener(zd,g),cx.remove(P)},0)}}},[f,y,g,P]);const T=u.useCallback(N=>{if(!l&&!i||P.paused)return;const b=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,C=document.activeElement;if(b&&C){const E=N.currentTarget,[j,R]=cw(E);j&&R?!N.shiftKey&&C===R?(N.preventDefault(),l&&ln(j,{select:!0})):N.shiftKey&&C===j&&(N.preventDefault(),l&&ln(R,{select:!0})):C===E&&N.preventDefault()}},[l,i,P.paused]);return e.jsx(Je.div,{tabIndex:-1,...m,ref:k,onKeyDown:T})});Au.displayName=iw;function ow(r,{select:a=!1}={}){const l=document.activeElement;for(const i of r)if(ln(i,{select:a}),document.activeElement!==l)return}function cw(r){const a=Ep(r),l=ox(a,r),i=ox(a.reverse(),r);return[l,i]}function Ep(r){const a=[],l=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const c=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||c?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function ox(r,a){for(const l of r)if(!dw(l,{upTo:a}))return l}function dw(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 uw(r){return r instanceof HTMLInputElement&&"select"in r}function ln(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&uw(r)&&a&&r.select()}}var cx=hw();function hw(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=dx(r,a),r.unshift(a)},remove(a){var l;r=dx(r,a),(l=r[0])==null||l.resume()}}}function dx(r,a){const l=[...r],i=l.indexOf(a);return i!==-1&&l.splice(i,1),l}function mw(r){return r.filter(a=>a.tagName!=="A")}var fw="Portal",Du=u.forwardRef((r,a)=>{var f;const{container:l,...i}=r,[c,d]=u.useState(!1);ts(()=>d(!0),[]);const m=l||c&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return m?_v.createPortal(e.jsx(Je.div,{...i,ref:a}),m):null});Du.displayName=fw;function xw(r,a){return u.useReducer((l,i)=>a[l][i]??l,r)}var Gl=r=>{const{present:a,children:l}=r,i=pw(a),c=typeof l=="function"?l({present:i.isPresent}):u.Children.only(l),d=it(i.ref,gw(c));return typeof l=="function"||i.isPresent?u.cloneElement(c,{ref:d}):null};Gl.displayName="Presence";function pw(r){const[a,l]=u.useState(),i=u.useRef(null),c=u.useRef(r),d=u.useRef("none"),m=r?"mounted":"unmounted",[f,p]=xw(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const y=ro(i.current);d.current=f==="mounted"?y:"none"},[f]),ts(()=>{const y=i.current,g=c.current;if(g!==r){const k=d.current,P=ro(y);r?p("MOUNT"):P==="none"||(y==null?void 0:y.display)==="none"?p("UNMOUNT"):p(g&&k!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,p]),ts(()=>{if(a){let y;const g=a.ownerDocument.defaultView??window,v=P=>{const N=ro(i.current).includes(CSS.escape(P.animationName));if(P.target===a&&N&&(p("ANIMATION_END"),!c.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",y=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},k=P=>{P.target===a&&(d.current=ro(i.current))};return a.addEventListener("animationstart",k),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{g.clearTimeout(y),a.removeEventListener("animationstart",k),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:u.useCallback(y=>{i.current=y?getComputedStyle(y):null,l(y)},[])}}function ro(r){return(r==null?void 0:r.animationName)||"none"}function gw(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.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 $d=0;function Pp(){u.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??ux()),document.body.insertAdjacentElement("beforeend",r[1]??ux()),$d++,()=>{$d===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),$d--}},[])}function ux(){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 lr=function(){return lr=Object.assign||function(a){for(var l,i=1,c=arguments.length;i"u")return Aw;var a=Dw(r),l=document.documentElement.clientWidth,i=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,i-l+a[2]-a[0])}},Ow=_p(),za="data-scroll-locked",Fw=function(r,a,l,i){var c=r.left,d=r.top,m=r.right,f=r.gap;return l===void 0&&(l="margin"),` + .`.concat(vw,` { + overflow: hidden `).concat(i,`; + padding-right: `).concat(f,"px ").concat(i,`; + } + body[`).concat(za,`] { + overflow: hidden `).concat(i,`; + overscroll-behavior: contain; + `).concat([a&&"position: relative ".concat(i,";"),l==="margin"&&` + padding-left: `.concat(c,`px; + padding-top: `).concat(d,`px; + padding-right: `).concat(m,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(f,"px ").concat(i,`; + `),l==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),` + } + + .`).concat(mo,` { + right: `).concat(f,"px ").concat(i,`; + } + + .`).concat(fo,` { + margin-right: `).concat(f,"px ").concat(i,`; + } + + .`).concat(mo," .").concat(mo,` { + right: 0 `).concat(i,`; + } + + .`).concat(fo," .").concat(fo,` { + margin-right: 0 `).concat(i,`; + } + + body[`).concat(za,`] { + `).concat(jw,": ").concat(f,`px; + } +`)},mx=function(){var r=parseInt(document.body.getAttribute(za)||"0",10);return isFinite(r)?r:0},zw=function(){u.useEffect(function(){return document.body.setAttribute(za,(mx()+1).toString()),function(){var r=mx()-1;r<=0?document.body.removeAttribute(za):document.body.setAttribute(za,r.toString())}},[])},$w=function(r){var a=r.noRelative,l=r.noImportant,i=r.gapMode,c=i===void 0?"margin":i;zw();var d=u.useMemo(function(){return Lw(c)},[c]);return u.createElement(Ow,{styles:Fw(d,!a,c,l?"":"!important")})},cu=!1;if(typeof window<"u")try{var no=Object.defineProperty({},"passive",{get:function(){return cu=!0,!0}});window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{cu=!1}var Ma=cu?{passive:!1}:!1,Bw=function(r){return r.tagName==="TEXTAREA"},Mp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!Bw(r)&&l[a]==="visible")},Uw=function(r){return Mp(r,"overflowY")},Vw=function(r){return Mp(r,"overflowX")},fx=function(r,a){var l=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var c=Ap(r,i);if(c){var d=Dp(r,i),m=d[1],f=d[2];if(m>f)return!0}i=i.parentNode}while(i&&i!==l.body);return!1},Ww=function(r){var a=r.scrollTop,l=r.scrollHeight,i=r.clientHeight;return[a,l,i]},Hw=function(r){var a=r.scrollLeft,l=r.scrollWidth,i=r.clientWidth;return[a,l,i]},Ap=function(r,a){return r==="v"?Uw(a):Vw(a)},Dp=function(r,a){return r==="v"?Ww(a):Hw(a)},Kw=function(r,a){return r==="h"&&a==="rtl"?-1:1},Gw=function(r,a,l,i,c){var d=Kw(r,window.getComputedStyle(a).direction),m=d*i,f=l.target,p=a.contains(f),y=!1,g=m>0,v=0,k=0;do{if(!f)break;var P=Dp(r,f),T=P[0],N=P[1],b=P[2],C=N-b-d*T;(T||C)&&Ap(r,f)&&(v+=C,k+=T);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&f!==document.body||p&&(a.contains(f)||a===f));return(g&&Math.abs(v)<1||!g&&Math.abs(k)<1)&&(y=!0),y},ao=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},xx=function(r){return[r.deltaX,r.deltaY]},px=function(r){return r&&"current"in r?r.current:r},Yw=function(r,a){return r[0]===a[0]&&r[1]===a[1]},Qw=function(r){return` + .block-interactivity-`.concat(r,` {pointer-events: none;} + .allow-interactivity-`).concat(r,` {pointer-events: all;} +`)},qw=0,Aa=[];function Xw(r){var a=u.useRef([]),l=u.useRef([0,0]),i=u.useRef(),c=u.useState(qw++)[0],d=u.useState(_p)[0],m=u.useRef(r);u.useEffect(function(){m.current=r},[r]),u.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var N=yw([r.lockRef.current],(r.shards||[]).map(px),!0).filter(Boolean);return N.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),N.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var f=u.useCallback(function(N,b){if("touches"in N&&N.touches.length===2||N.type==="wheel"&&N.ctrlKey)return!m.current.allowPinchZoom;var C=ao(N),E=l.current,j="deltaX"in N?N.deltaX:E[0]-C[0],R="deltaY"in N?N.deltaY:E[1]-C[1],G,J=N.target,L=Math.abs(j)>Math.abs(R)?"h":"v";if("touches"in N&&L==="h"&&J.type==="range")return!1;var I=window.getSelection(),w=I&&I.anchorNode,V=w?w===J||w.contains(J):!1;if(V)return!1;var te=fx(L,J);if(!te)return!0;if(te?G=L:(G=L==="v"?"h":"v",te=fx(L,J)),!te)return!1;if(!i.current&&"changedTouches"in N&&(j||R)&&(i.current=G),!G)return!0;var ie=i.current||G;return Gw(ie,b,N,ie==="h"?j:R)},[]),p=u.useCallback(function(N){var b=N;if(!(!Aa.length||Aa[Aa.length-1]!==d)){var C="deltaY"in b?xx(b):ao(b),E=a.current.filter(function(G){return G.name===b.type&&(G.target===b.target||b.target===G.shadowParent)&&Yw(G.delta,C)})[0];if(E&&E.should){b.cancelable&&b.preventDefault();return}if(!E){var j=(m.current.shards||[]).map(px).filter(Boolean).filter(function(G){return G.contains(b.target)}),R=j.length>0?f(b,j[0]):!m.current.noIsolation;R&&b.cancelable&&b.preventDefault()}}},[]),y=u.useCallback(function(N,b,C,E){var j={name:N,delta:b,target:C,should:E,shadowParent:Jw(C)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(R){return R!==j})},1)},[]),g=u.useCallback(function(N){l.current=ao(N),i.current=void 0},[]),v=u.useCallback(function(N){y(N.type,xx(N),N.target,f(N,r.lockRef.current))},[]),k=u.useCallback(function(N){y(N.type,ao(N),N.target,f(N,r.lockRef.current))},[]);u.useEffect(function(){return Aa.push(d),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:k}),document.addEventListener("wheel",p,Ma),document.addEventListener("touchmove",p,Ma),document.addEventListener("touchstart",g,Ma),function(){Aa=Aa.filter(function(N){return N!==d}),document.removeEventListener("wheel",p,Ma),document.removeEventListener("touchmove",p,Ma),document.removeEventListener("touchstart",g,Ma)}},[]);var P=r.removeScrollBar,T=r.inert;return u.createElement(u.Fragment,null,T?u.createElement(d,{styles:Qw(c)}):null,P?u.createElement($w,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function Jw(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const Zw=Ew(Ip,Xw);var Lu=u.forwardRef(function(r,a){return u.createElement(Mo,lr({},r,{ref:a,sideCar:Zw}))});Lu.classNames=Mo.classNames;var e2=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},Da=new WeakMap,lo=new WeakMap,io={},Wd=0,Lp=function(r){return r&&(r.host||Lp(r.parentNode))},t2=function(r,a){return a.map(function(l){if(r.contains(l))return l;var i=Lp(l);return i&&r.contains(i)?i:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},s2=function(r,a,l,i){var c=t2(a,Array.isArray(r)?r:[r]);io[l]||(io[l]=new WeakMap);var d=io[l],m=[],f=new Set,p=new Set(c),y=function(v){!v||f.has(v)||(f.add(v),y(v.parentNode))};c.forEach(y);var g=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(k){if(f.has(k))g(k);else try{var P=k.getAttribute(i),T=P!==null&&P!=="false",N=(Da.get(k)||0)+1,b=(d.get(k)||0)+1;Da.set(k,N),d.set(k,b),m.push(k),N===1&&T&&lo.set(k,!0),b===1&&k.setAttribute(l,"true"),T||k.setAttribute(i,"true")}catch(C){console.error("aria-hidden: cannot operate on ",k,C)}})};return g(a),f.clear(),Wd++,function(){m.forEach(function(v){var k=Da.get(v)-1,P=d.get(v)-1;Da.set(v,k),d.set(v,P),k||(lo.has(v)||v.removeAttribute(i),lo.delete(v)),P||v.removeAttribute(l)}),Wd--,Wd||(Da=new WeakMap,Da=new WeakMap,lo=new WeakMap,io={})}},Op=function(r,a,l){l===void 0&&(l="data-aria-hidden");var i=Array.from(Array.isArray(r)?r:[r]),c=e2(r);return c?(i.push.apply(i,Array.from(c.querySelectorAll("[aria-live], script"))),s2(i,c,l,"aria-hidden")):function(){return null}},Ao="Dialog",[Fp]=bn(Ao),[r2,qs]=Fp(Ao),zp=r=>{const{__scopeDialog:a,children:l,open:i,defaultOpen:c,onOpenChange:d,modal:m=!0}=r,f=u.useRef(null),p=u.useRef(null),[y,g]=Xn({prop:i,defaultProp:c??!1,onChange:d,caller:Ao});return e.jsx(r2,{scope:a,triggerRef:f,contentRef:p,contentId:mn(),titleId:mn(),descriptionId:mn(),open:y,onOpenChange:g,onOpenToggle:u.useCallback(()=>g(v=>!v),[g]),modal:m,children:l})};zp.displayName=Ao;var $p="DialogTrigger",n2=u.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=qs($p,l),d=it(a,c.triggerRef);return e.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":zu(c.open),...i,ref:d,onClick:Ye(r.onClick,c.onOpenToggle)})});n2.displayName=$p;var Ou="DialogPortal",[a2,Bp]=Fp(Ou,{forceMount:void 0}),Up=r=>{const{__scopeDialog:a,forceMount:l,children:i,container:c}=r,d=qs(Ou,a);return e.jsx(a2,{scope:a,forceMount:l,children:u.Children.map(i,m=>e.jsx(Gl,{present:l||d.open,children:e.jsx(Du,{asChild:!0,container:c,children:m})}))})};Up.displayName=Ou;var No="DialogOverlay",Vp=u.forwardRef((r,a)=>{const l=Bp(No,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=qs(No,r.__scopeDialog);return d.modal?e.jsx(Gl,{present:i||d.open,children:e.jsx(i2,{...c,ref:a})}):null});Vp.displayName=No;var l2=Wl("DialogOverlay.RemoveScroll"),i2=u.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=qs(No,l);return e.jsx(Lu,{as:l2,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(Je.div,{"data-state":zu(c.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Jn="DialogContent",Wp=u.forwardRef((r,a)=>{const l=Bp(Jn,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=qs(Jn,r.__scopeDialog);return e.jsx(Gl,{present:i||d.open,children:d.modal?e.jsx(o2,{...c,ref:a}):e.jsx(c2,{...c,ref:a})})});Wp.displayName=Jn;var o2=u.forwardRef((r,a)=>{const l=qs(Jn,r.__scopeDialog),i=u.useRef(null),c=it(a,l.contentRef,i);return u.useEffect(()=>{const d=i.current;if(d)return Op(d)},[]),e.jsx(Hp,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ye(r.onCloseAutoFocus,d=>{var m;d.preventDefault(),(m=l.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Ye(r.onPointerDownOutside,d=>{const m=d.detail.originalEvent,f=m.button===0&&m.ctrlKey===!0;(m.button===2||f)&&d.preventDefault()}),onFocusOutside:Ye(r.onFocusOutside,d=>d.preventDefault())})}),c2=u.forwardRef((r,a)=>{const l=qs(Jn,r.__scopeDialog),i=u.useRef(!1),c=u.useRef(!1);return e.jsx(Hp,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var m,f;(m=r.onCloseAutoFocus)==null||m.call(r,d),d.defaultPrevented||(i.current||(f=l.triggerRef.current)==null||f.focus(),d.preventDefault()),i.current=!1,c.current=!1},onInteractOutside:d=>{var p,y;(p=r.onInteractOutside)==null||p.call(r,d),d.defaultPrevented||(i.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const m=d.target;((y=l.triggerRef.current)==null?void 0:y.contains(m))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),Hp=u.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:d,...m}=r,f=qs(Jn,l),p=u.useRef(null),y=it(a,p);return Pp(),e.jsxs(e.Fragment,{children:[e.jsx(Au,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:c,onUnmountAutoFocus:d,children:e.jsx(Mu,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":zu(f.open),...m,ref:y,onDismiss:()=>f.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(d2,{titleId:f.titleId}),e.jsx(h2,{contentRef:p,descriptionId:f.descriptionId})]})]})}),Fu="DialogTitle",Kp=u.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=qs(Fu,l);return e.jsx(Je.h2,{id:c.titleId,...i,ref:a})});Kp.displayName=Fu;var Gp="DialogDescription",Yp=u.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=qs(Gp,l);return e.jsx(Je.p,{id:c.descriptionId,...i,ref:a})});Yp.displayName=Gp;var Qp="DialogClose",qp=u.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=qs(Qp,l);return e.jsx(Je.button,{type:"button",...i,ref:a,onClick:Ye(r.onClick,()=>c.onOpenChange(!1))})});qp.displayName=Qp;function zu(r){return r?"open":"closed"}var Xp="DialogTitleWarning",[iC,Jp]=z1(Xp,{contentName:Jn,titleName:Fu,docsSlug:"dialog"}),d2=({titleId:r})=>{const a=Jp(Xp),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 u.useEffect(()=>{r&&(document.getElementById(r)||console.error(l))},[l,r]),null},u2="DialogDescriptionWarning",h2=({contentRef:r,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Jp(u2).contentName}}.`;return u.useEffect(()=>{var d;const c=(d=r.current)==null?void 0:d.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(i))},[i,r,a]),null},m2=zp,f2=Up,x2=Vp,p2=Wp,g2=Kp,y2=Yp,v2=qp;function Ct(r){return e.jsx(m2,{"data-slot":"dialog",...r})}function j2(r){return e.jsx(f2,{...r})}const Zp=u.forwardRef(({className:r,...a},l)=>e.jsx(x2,{ref:l,className:ot("fixed inset-0 z-50 bg-black/50",r),...a}));Zp.displayName="DialogOverlay";const bt=u.forwardRef(({className:r,children:a,showCloseButton:l=!0,...i},c)=>e.jsxs(j2,{children:[e.jsx(Zp,{}),e.jsxs(p2,{ref:c,"aria-describedby":void 0,className:ot("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),...i,children:[a,l&&e.jsxs(v2,{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(xs,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bt.displayName="DialogContent";function kt({className:r,...a}){return e.jsx("div",{className:ot("flex flex-col gap-2 text-center sm:text-left",r),...a})}function Ot({className:r,...a}){return e.jsx("div",{className:ot("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function Et(r){return e.jsx(g2,{className:"text-lg font-semibold leading-none",...r})}function b2(r){return e.jsx(y2,{className:"text-sm text-muted-foreground",...r})}function $u(r,a){const[l,i]=u.useState(r);return u.useEffect(()=>{const c=setTimeout(()=>i(r),a);return()=>clearTimeout(c)},[r,a]),l}function Gs({page:r,totalPages:a,total:l,pageSize:i,onPageChange:c,onPageSizeChange:d,pageSizeOptions:m=[10,20,50,100]}){return a<=1&&!d?null:e.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[e.jsxs("span",{children:["共 ",l," 条"]}),d&&e.jsx("select",{value:i,onChange:f=>d(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 N2(){const[r,a]=u.useState([]),[l,i]=u.useState([]),[c,d]=u.useState(0),[m,f]=u.useState(0),[p,y]=u.useState(0),[g,v]=u.useState(1),[k,P]=u.useState(10),[T,N]=u.useState(""),b=$u(T,300),[C,E]=u.useState("all"),[j,R]=u.useState(!0),[G,J]=u.useState(null),[L,I]=u.useState(null),[w,V]=u.useState(""),[te,ie]=u.useState(!1);async function Y(){R(!0),J(null);try{const H=C==="all"?"":C==="completed"?"completed":C,A=new URLSearchParams({page:String(g),pageSize:String(k),...H&&{status:H},...b&&{search:b}}),[$,F]=await Promise.all([Le(`/api/orders?${A}`),Le("/api/db/users?page=1&pageSize=500")]);$!=null&&$.success&&(a($.orders||[]),d($.total??0),f($.totalRevenue??0),y($.todayRevenue??0)),F!=null&&F.success&&F.users&&i(F.users)}catch(H){console.error("加载订单失败",H),J("加载订单失败,请检查网络后重试")}finally{R(!1)}}u.useEffect(()=>{v(1)},[b,C]),u.useEffect(()=>{Y()},[g,k,b,C]);const ne=H=>{var A;return H.userNickname||((A=l.find($=>$.id===H.userId))==null?void 0:A.nickname)||"匿名用户"},_=H=>{var A;return((A=l.find($=>$.id===H))==null?void 0:A.phone)||"-"},Q=H=>{const A=H.productType||H.type||"",$=H.description||"";if($){if(A==="section"&&$.includes("章节")){if($.includes("-")){const F=$.split("-");if(F.length>=3)return{name:`第${F[1]}章 第${F[2]}节`,type:"《一场Soul的创业实验》"}}return{name:$,type:"章节购买"}}return A==="fullbook"||$.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:A==="vip"||$.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:A==="match"||$.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:$,type:"其他"}}return A==="section"?{name:`章节 ${H.productId||H.sectionId||""}`,type:"单章"}:A==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:A==="vip"?{name:"VIP年度会员",type:"VIP"}:A==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:A||"其他"}},ue=Math.ceil(c/k)||1;async function O(){var H;if(!(!(L!=null&&L.orderSn)&&!(L!=null&&L.id))){ie(!0),J(null);try{const A=await yt("/api/admin/orders/refund",{orderSn:L.orderSn||L.id,reason:w||void 0});A!=null&&A.success?(I(null),V(""),Y()):J((A==null?void 0:A.error)||"退款失败")}catch(A){const $=A;J(((H=$==null?void 0:$.data)==null?void 0:H.error)||"退款失败,请检查网络后重试")}finally{ie(!1)}}}function re(){if(r.length===0){alert("暂无数据可导出");return}const H=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],A=r.map(de=>{const X=Q(de);return[de.orderSn||de.id||"",ne(de),_(de.userId),X.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(",")}),$="\uFEFF"+[H.join(","),...A].join(` +`),F=new Blob([$],{type:"text/csv;charset=utf-8"}),ee=URL.createObjectURL(F),K=document.createElement("a");K.href=ee,K.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,K.click(),URL.revokeObjectURL(ee)}return e.jsxs("div",{className:"p-8 w-full",children:[G&&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:G}),e.jsx("button",{type:"button",onClick:()=>J(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:Y,disabled:j,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${j?"animate-spin":""}`}),"刷新"]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-gray-400",children:"总收入:"}),e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",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:["¥",p.toFixed(2)]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(hn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(ce,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:T,onChange:H=>N(H.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(rp,{className:"w-4 h-4 text-gray-400"}),e.jsxs("select",{value:C,onChange:H=>E(H.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:re,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(pb,{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:j?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{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(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:[r.map(H=>{const A=Q(H);return e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(ge,{className:"font-mono text-xs text-gray-400",children:[(H.orderSn||H.id||"").slice(0,12),"..."]}),e.jsx(ge,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:ne(H)}),e.jsx("p",{className:"text-gray-500 text-xs",children:_(H.userId)})]})}),e.jsx(ge,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[A.name,(H.productType||H.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(ge,{className:"text-[#38bdac] font-bold",children:["¥",Number(H.amount||0).toFixed(2)]}),e.jsx(ge,{className:"text-gray-300",children:H.paymentMethod==="wechat"?"微信支付":H.paymentMethod==="alipay"?"支付宝":H.paymentMethod||"微信支付"}),e.jsx(ge,{children:H.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):H.status==="paid"||H.status==="completed"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):H.status==="pending"||H.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(ge,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:H.refundReason,children:H.status==="refunded"&&H.refundReason?H.refundReason:"-"}),e.jsx(ge,{className:"text-[#FFD700]",children:H.referrerEarnings?`¥${Number(H.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(ge,{className:"text-gray-400 text-sm",children:new Date(H.createdAt).toLocaleString("zh-CN")}),e.jsx(ge,{children:(H.status==="paid"||H.status==="completed")&&e.jsxs(q,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{I(H),V("")},children:[e.jsx(lp,{className:"w-3 h-3 mr-1"}),"退款"]})})]},H.id)}),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Gs,{page:g,totalPages:ue,total:c,pageSize:k,onPageChange:v,onPageSizeChange:H=>{P(H),v(1)}})]})})}),e.jsx(Ct,{open:!!L,onOpenChange:H=>!H&&I(null),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsx(Et,{className:"text-white",children:"订单退款"})}),L&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",L.orderSn||L.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(L.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(ce,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:w,onChange:H=>V(H.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Ot,{children:[e.jsx(q,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>I(null),disabled:te,children:"取消"}),e.jsx(q,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:O,disabled:te,children:te?"退款中...":"确认退款"})]})]})})]})}var w2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],S2=w2.reduce((r,a)=>{const l=op(`Primitive.${a}`),i=u.forwardRef((c,d)=>{const{asChild:m,...f}=c,p=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...f,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{}),C2="Label",e0=u.forwardRef((r,a)=>e.jsx(S2.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())}}));e0.displayName=C2;var t0=e0;const se=u.forwardRef(({className:r,...a},l)=>e.jsx(t0,{ref:l,className:ot("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));se.displayName=t0.displayName;function Bu(r){const a=r+"CollectionProvider",[l,i]=bn(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),m=N=>{const{scope:b,children:C}=N,E=an.useRef(null),j=an.useRef(new Map).current;return e.jsx(c,{scope:b,itemMap:j,collectionRef:E,children:C})};m.displayName=a;const f=r+"CollectionSlot",p=Wl(f),y=an.forwardRef((N,b)=>{const{scope:C,children:E}=N,j=d(f,C),R=it(b,j.collectionRef);return e.jsx(p,{ref:R,children:E})});y.displayName=f;const g=r+"CollectionItemSlot",v="data-radix-collection-item",k=Wl(g),P=an.forwardRef((N,b)=>{const{scope:C,children:E,...j}=N,R=an.useRef(null),G=it(b,R),J=d(g,C);return an.useEffect(()=>(J.itemMap.set(R,{ref:R,...j}),()=>void J.itemMap.delete(R))),e.jsx(k,{[v]:"",ref:G,children:E})});P.displayName=g;function T(N){const b=d(r+"CollectionConsumer",N);return an.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${v}]`));return Array.from(b.itemMap.values()).sort((J,L)=>j.indexOf(J.ref.current)-j.indexOf(L.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:m,Slot:y,ItemSlot:P},T,i]}var k2=u.createContext(void 0);function Do(r){const a=u.useContext(k2);return r||a||"ltr"}var Hd="rovingFocusGroup.onEntryFocus",E2={bubbles:!1,cancelable:!0},Yl="RovingFocusGroup",[du,s0,P2]=Bu(Yl),[T2,r0]=bn(Yl,[P2]),[R2,I2]=T2(Yl),n0=u.forwardRef((r,a)=>e.jsx(du.Provider,{scope:r.__scopeRovingFocusGroup,children:e.jsx(du.Slot,{scope:r.__scopeRovingFocusGroup,children:e.jsx(_2,{...r,ref:a})})}));n0.displayName=Yl;var _2=u.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:i,loop:c=!1,dir:d,currentTabStopId:m,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:p,onEntryFocus:y,preventScrollOnEntryFocus:g=!1,...v}=r,k=u.useRef(null),P=it(a,k),T=Do(d),[N,b]=Xn({prop:m,defaultProp:f??null,onChange:p,caller:Yl}),[C,E]=u.useState(!1),j=xn(y),R=s0(l),G=u.useRef(!1),[J,L]=u.useState(0);return u.useEffect(()=>{const I=k.current;if(I)return I.addEventListener(Hd,j),()=>I.removeEventListener(Hd,j)},[j]),e.jsx(R2,{scope:l,orientation:i,dir:T,loop:c,currentTabStopId:N,onItemFocus:u.useCallback(I=>b(I),[b]),onItemShiftTab:u.useCallback(()=>E(!0),[]),onFocusableItemAdd:u.useCallback(()=>L(I=>I+1),[]),onFocusableItemRemove:u.useCallback(()=>L(I=>I-1),[]),children:e.jsx(Je.div,{tabIndex:C||J===0?-1:0,"data-orientation":i,...v,ref:P,style:{outline:"none",...r.style},onMouseDown:Ye(r.onMouseDown,()=>{G.current=!0}),onFocus:Ye(r.onFocus,I=>{const w=!G.current;if(I.target===I.currentTarget&&w&&!C){const V=new CustomEvent(Hd,E2);if(I.currentTarget.dispatchEvent(V),!V.defaultPrevented){const te=R().filter(Q=>Q.focusable),ie=te.find(Q=>Q.active),Y=te.find(Q=>Q.id===N),_=[ie,Y,...te].filter(Boolean).map(Q=>Q.ref.current);i0(_,g)}}G.current=!1}),onBlur:Ye(r.onBlur,()=>E(!1))})})}),a0="RovingFocusGroupItem",l0=u.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:i=!0,active:c=!1,tabStopId:d,children:m,...f}=r,p=mn(),y=d||p,g=I2(a0,l),v=g.currentTabStopId===y,k=s0(l),{onFocusableItemAdd:P,onFocusableItemRemove:T,currentTabStopId:N}=g;return u.useEffect(()=>{if(i)return P(),()=>T()},[i,P,T]),e.jsx(du.ItemSlot,{scope:l,id:y,focusable:i,active:c,children:e.jsx(Je.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:a,onMouseDown:Ye(r.onMouseDown,b=>{i?g.onItemFocus(y):b.preventDefault()}),onFocus:Ye(r.onFocus,()=>g.onItemFocus(y)),onKeyDown:Ye(r.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){g.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const C=D2(b,g.orientation,g.dir);if(C!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let j=k().filter(R=>R.focusable).map(R=>R.ref.current);if(C==="last")j.reverse();else if(C==="prev"||C==="next"){C==="prev"&&j.reverse();const R=j.indexOf(b.currentTarget);j=g.loop?L2(j,R+1):j.slice(R+1)}setTimeout(()=>i0(j))}}),children:typeof m=="function"?m({isCurrentTabStop:v,hasTabStop:N!=null}):m})})});l0.displayName=a0;var M2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function A2(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function D2(r,a,l){const i=A2(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return M2[i]}function i0(r,a=!1){const l=document.activeElement;for(const i of r)if(i===l||(i.focus({preventScroll:a}),document.activeElement!==l))return}function L2(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var O2=n0,F2=l0,Lo="Tabs",[z2]=bn(Lo,[r0]),o0=r0(),[$2,Uu]=z2(Lo),c0=u.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,onValueChange:c,defaultValue:d,orientation:m="horizontal",dir:f,activationMode:p="automatic",...y}=r,g=Do(f),[v,k]=Xn({prop:i,onChange:c,defaultProp:d??"",caller:Lo});return e.jsx($2,{scope:l,baseId:mn(),value:v,onValueChange:k,orientation:m,dir:g,activationMode:p,children:e.jsx(Je.div,{dir:g,"data-orientation":m,...y,ref:a})})});c0.displayName=Lo;var d0="TabsList",u0=u.forwardRef((r,a)=>{const{__scopeTabs:l,loop:i=!0,...c}=r,d=Uu(d0,l),m=o0(l);return e.jsx(O2,{asChild:!0,...m,orientation:d.orientation,dir:d.dir,loop:i,children:e.jsx(Je.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});u0.displayName=d0;var h0="TabsTrigger",m0=u.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,disabled:c=!1,...d}=r,m=Uu(h0,l),f=o0(l),p=p0(m.baseId,i),y=g0(m.baseId,i),g=i===m.value;return e.jsx(F2,{asChild:!0,...f,focusable:!c,active:g,children:e.jsx(Je.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":y,"data-state":g?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:p,...d,ref:a,onMouseDown:Ye(r.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?m.onValueChange(i):v.preventDefault()}),onKeyDown:Ye(r.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&m.onValueChange(i)}),onFocus:Ye(r.onFocus,()=>{const v=m.activationMode!=="manual";!g&&!c&&v&&m.onValueChange(i)})})})});m0.displayName=h0;var f0="TabsContent",x0=u.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,forceMount:c,children:d,...m}=r,f=Uu(f0,l),p=p0(f.baseId,i),y=g0(f.baseId,i),g=i===f.value,v=u.useRef(g);return u.useEffect(()=>{const k=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(k)},[]),e.jsx(Gl,{present:c||g,children:({present:k})=>e.jsx(Je.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":p,hidden:!k,id:y,tabIndex:0,...m,ref:a,style:{...r.style,animationDuration:v.current?"0s":void 0},children:k&&d})})});x0.displayName=f0;function p0(r,a){return`${r}-trigger-${a}`}function g0(r,a){return`${r}-content-${a}`}var B2=c0,y0=u0,v0=m0,j0=x0;const Ql=B2,Ya=u.forwardRef(({className:r,...a},l)=>e.jsx(y0,{ref:l,className:ot("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));Ya.displayName=y0.displayName;const Ft=u.forwardRef(({className:r,...a},l)=>e.jsx(v0,{ref:l,className:ot("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}));Ft.displayName=v0.displayName;const zt=u.forwardRef(({className:r,...a},l)=>e.jsx(j0,{ref:l,className:ot("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...a}));zt.displayName=j0.displayName;function Vu(r){const a=u.useRef({value:r,previous:r});return u.useMemo(()=>(a.current.value!==r&&(a.current.previous=a.current.value,a.current.value=r),a.current.previous),[r])}function Wu(r){const[a,l]=u.useState(void 0);return ts(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const i=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let m,f;if("borderBoxSize"in d){const p=d.borderBoxSize,y=Array.isArray(p)?p[0]:p;m=y.inlineSize,f=y.blockSize}else m=r.offsetWidth,f=r.offsetHeight;l({width:m,height:f})});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else l(void 0)},[r]),a}var Oo="Switch",[U2]=bn(Oo),[V2,W2]=U2(Oo),b0=u.forwardRef((r,a)=>{const{__scopeSwitch:l,name:i,checked:c,defaultChecked:d,required:m,disabled:f,value:p="on",onCheckedChange:y,form:g,...v}=r,[k,P]=u.useState(null),T=it(a,j=>P(j)),N=u.useRef(!1),b=k?g||!!k.closest("form"):!0,[C,E]=Xn({prop:c,defaultProp:d??!1,onChange:y,caller:Oo});return e.jsxs(V2,{scope:l,checked:C,disabled:f,children:[e.jsx(Je.button,{type:"button",role:"switch","aria-checked":C,"aria-required":m,"data-state":C0(C),"data-disabled":f?"":void 0,disabled:f,value:p,...v,ref:T,onClick:Ye(r.onClick,j=>{E(R=>!R),b&&(N.current=j.isPropagationStopped(),N.current||j.stopPropagation())})}),b&&e.jsx(S0,{control:k,bubbles:!N.current,name:i,value:p,checked:C,required:m,disabled:f,form:g,style:{transform:"translateX(-100%)"}})]})});b0.displayName=Oo;var N0="SwitchThumb",w0=u.forwardRef((r,a)=>{const{__scopeSwitch:l,...i}=r,c=W2(N0,l);return e.jsx(Je.span,{"data-state":C0(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})});w0.displayName=N0;var H2="SwitchBubbleInput",S0=u.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:i=!0,...c},d)=>{const m=u.useRef(null),f=it(m,d),p=Vu(l),y=Wu(a);return u.useEffect(()=>{const g=m.current;if(!g)return;const v=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(v,"checked").set;if(p!==l&&P){const T=new Event("click",{bubbles:i});P.call(g,l),g.dispatchEvent(T)}},[p,l,i]),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}})});S0.displayName=H2;function C0(r){return r?"checked":"unchecked"}var k0=b0,K2=w0;const dt=u.forwardRef(({className:r,...a},l)=>e.jsx(k0,{className:ot("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(K2,{className:ot("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=k0.displayName;const Zn=u.forwardRef(({className:r,...a},l)=>e.jsx("textarea",{className:ot("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}));Zn.displayName="Textarea";function E0({open:r,onClose:a,userId:l,onUserUpdated:i}){var $e;const[c,d]=u.useState(null),[m,f]=u.useState([]),[p,y]=u.useState([]),[g,v]=u.useState(!1),[k,P]=u.useState(!1),[T,N]=u.useState(!1),[b,C]=u.useState("info"),[E,j]=u.useState(""),[R,G]=u.useState(""),[J,L]=u.useState([]),[I,w]=u.useState(""),[V,te]=u.useState(!1),[ie,Y]=u.useState(null),[ne,_]=u.useState(null),[Q,ue]=u.useState(""),[O,re]=u.useState(""),[H,A]=u.useState(""),[$,F]=u.useState(!1),[ee,K]=u.useState(null),[de,X]=u.useState("");u.useEffect(()=>{r&&l&&(C("info"),Y(null),_(null),K(null),X(""),ye())},[r,l]);async function ye(){if(l){v(!0);try{const me=await Le(`/api/db/users?id=${encodeURIComponent(l)}`);if(me!=null&&me.success&&me.user){const pe=me.user;d(pe),j(pe.phone||""),G(pe.nickname||""),ue(pe.phone||""),re(pe.wechatId||""),A(pe.openId||"");try{L(typeof pe.tags=="string"?JSON.parse(pe.tags||"[]"):[])}catch{L([])}}try{const pe=await Le(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);pe!=null&&pe.success&&pe.tracks&&f(pe.tracks)}catch{f([])}try{const pe=await Le(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);pe!=null&&pe.success&&pe.referrals&&y(pe.referrals)}catch{y([])}}catch(me){console.error("Load user detail error:",me)}finally{v(!1)}}}async function Ce(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}P(!0);try{const me=await ut("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});me!=null&&me.success?(alert("同步成功"),ye()):alert("同步失败: "+(me==null?void 0:me.error))}catch(me){console.error("Sync CKB error:",me),alert("同步失败")}finally{P(!1)}}async function z(){if(c){N(!0);try{const me={id:c.id,phone:E||void 0,nickname:R||void 0,tags:JSON.stringify(J)},pe=await yt("/api/db/users",me);pe!=null&&pe.success?(alert("保存成功"),ye(),i==null||i()):alert("保存失败: "+(pe==null?void 0:pe.error))}catch(me){console.error("Save user error:",me),alert("保存失败")}finally{N(!1)}}}const xe=()=>{I&&!J.includes(I)&&(L([...J,I]),w(""))},Pe=me=>L(J.filter(pe=>pe!==me));async function Ve(){if(!Q&&!H&&!O){_("请至少输入手机号、微信号或 OpenID 中的一项");return}te(!0),_(null),Y(null);try{const me=new URLSearchParams;Q&&me.set("phone",Q),H&&me.set("openId",H),O&&me.set("wechatId",O);const pe=await Le(`/api/admin/shensheshou/query?${me}`);pe!=null&&pe.success&&pe.data?(Y(pe.data),c&&await He(pe.data)):_((pe==null?void 0:pe.error)||"未查询到数据,该用户可能未在神射手收录")}catch(me){console.error("SSS query error:",me),_("请求失败,请检查神射手接口配置")}finally{te(!1)}}async function He(me){if(c)try{await ut("/api/admin/shensheshou/enrich",{userId:c.id,phone:Q||c.phone||"",openId:H||c.openId||"",wechatId:O||c.wechatId||""}),ye()}catch(pe){console.error("SSS enrich error:",pe)}}async function Ke(){if(c){F(!0),K(null);try{const me={users:[{phone:c.phone||"",name:c.nickname||"",openId:c.openId||"",tags:J}]},pe=await ut("/api/admin/shensheshou/ingest",me);pe!=null&&pe.success&&pe.data?K(pe.data):K({error:(pe==null?void 0:pe.error)||"推送失败"})}catch(me){console.error("SSS ingest error:",me),K({error:"请求失败"})}finally{F(!1)}}}const tt=me=>{const ft={view_chapter:Fs,purchase:au,match:Yt,login:Fa,register:Fa,share:kr,bind_phone:rN,bind_wechat:Qb,fill_profile:Dd,visit_page:La}[me]||ru;return e.jsx(ft,{className:"w-4 h-4"})};return r?e.jsx(Ct,{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(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Fa,{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"})]})}),g?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx(Be,{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:""}):(($e=c.nickname)==null?void 0:$e.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(Ql,{value:b,onValueChange:C,className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(Ya,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-3 flex-wrap h-auto gap-1",children:[e.jsx(Ft,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"基础信息"}),e.jsx(Ft,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"标签体系"}),e.jsxs(Ft,{value:"journey",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:[e.jsx(La,{className:"w-3 h-3 mr-1"}),"用户旅程"]}),e.jsx(Ft,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"关系链路"}),e.jsxs(Ft,{value:"shensheshou",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:[e.jsx(dn,{className:"w-3 h-3 mr-1"}),"用户资料完善"]})]}),e.jsxs(zt,{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(se,{className:"text-gray-300",children:"手机号"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:E,onChange:me=>j(me.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"昵称"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:R,onChange:me=>G(me.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(ap,{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(on,{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(Vl,{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(ce,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"输入归属微信号(如 wxid_xxxx)",value:de,onChange:me=>X(me.target.value)}),e.jsxs(q,{size:"sm",onClick:async()=>{if(!(!de||!c))try{await yt("/api/db/users",{id:c.id,wechatId:de}),alert("已保存微信归属"),ye()}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(It,{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(kr,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),e.jsx(q,{size:"sm",onClick:Ce,disabled:k||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:k?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Be,{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(zt,{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(Dd,{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(su,{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(me=>e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1.5",children:me.category}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:me.tags.map(pe=>e.jsxs("button",{type:"button",onClick:()=>{J.includes(pe)?Pe(pe):L([...J,pe])},className:`px-2 py-0.5 rounded text-xs border transition-all ${J.includes(pe)?"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:[J.includes(pe)?"✓ ":"",pe]},pe))})]},me.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:[J.map((me,pe)=>e.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[me,e.jsx("button",{type:"button",onClick:()=>Pe(me),className:"ml-1 hover:text-red-400",children:e.jsx(xs,{className:"w-3 h-3"})})]},pe)),J.length===0&&e.jsx("span",{className:"text-gray-600 text-sm",children:"暂未选择标签"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"自定义标签(回车添加)",value:I,onChange:me=>w(me.target.value),onKeyDown:me=>me.key==="Enter"&&xe()}),e.jsx(q,{onClick:xe,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(Dd,{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((me,pe)=>e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:me.trim()},pe))})]})]}),e.jsxs(zt,{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(La,{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((me,pe)=>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:tt(me.action)}),pe0?p.map((me,pe)=>{var ss;const ft=me;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=ft.nickname)==null?void 0:ss.charAt(0))||"?"}),e.jsx("span",{className:"text-white text-sm",children:ft.nickname})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[ft.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:ft.createdAt?new Date(ft.createdAt).toLocaleDateString():""})]})]},ft.id||pe)}):e.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})}),e.jsxs(zt,{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(dn,{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(se,{className:"text-gray-500 text-xs mb-1 block",children:"手机号"}),e.jsx(ce,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"11位手机号",value:Q,onChange:me=>ue(me.target.value)})]}),e.jsxs("div",{children:[e.jsx(se,{className:"text-gray-500 text-xs mb-1 block",children:"微信号"}),e.jsx(ce,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"微信 ID",value:O,onChange:me=>re(me.target.value)})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx(se,{className:"text-gray-500 text-xs mb-1 block",children:"微信 OpenID"}),e.jsx(ce,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"openid_xxxx(自动填入)",value:H,onChange:me=>A(me.target.value)})]})]}),e.jsx(q,{onClick:Ve,disabled:V,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:V?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 查询并自动回填中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(hn,{className:"w-4 h-4 mr-1"})," 查询并自动完善用户资料"]})}),e.jsx("p",{className:"text-gray-600 text-xs mt-2",children:"查询成功后,神射手返回的标签将自动同步到该用户"}),ne&&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:ne}),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((me,pe)=>e.jsx(Oe,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/20",children:me},pe))})]}),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(dn,{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:Ke,disabled:$||!c.phone,variant:"outline",className:"border-purple-500/40 text-purple-400 hover:bg-purple-500/10 bg-transparent shrink-0 ml-4",children:$?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 推送中"]}):e.jsxs(e.Fragment,{children:[e.jsx(dn,{className:"w-4 h-4 mr-1"})," 推送"]})})]}),!c.phone&&e.jsx("p",{className:"text-yellow-500/70 text-xs",children:"⚠ 用户未绑定手机号,无法推送"}),ee&&e.jsx("div",{className:"mt-3 p-3 bg-[#162840] rounded-lg text-sm",children:ee.error?e.jsx("p",{className:"text-red-400",children:String(ee.error)}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-green-400 flex items-center gap-1",children:[e.jsx(su,{className:"w-4 h-4"})," 推送成功"]}),ee.enriched!==void 0&&e.jsxs("p",{className:"text-gray-400",children:["自动补全标签数:",String(ee.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(xs,{className:"w-4 h-4 mr-2"}),"关闭"]}),e.jsxs(q,{onClick:z,disabled:T,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),T?"保存中...":"保存修改"]})]})]}):e.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Kd={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function G2({open:r,onClose:a,userId:l,userNickname:i="",onSaved:c}){const[d,m]=u.useState(Kd),[f,p]=u.useState([]),[y,g]=u.useState(!1),[v,k]=u.useState(!1);u.useEffect(()=>{if(!r){m(Kd);return}let T=!1;return g(!0),Promise.all([Le("/api/db/vip-roles"),l?Le(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([N,b])=>{if(T)return;const C=N!=null&&N.success&&N.data?N.data:[];p(C);const E=b&&b.user?b.user:null;if(E){const j=String(E.vipRole??""),R=C.some(G=>G.name===j);m({isVip:!!(E.isVip??!1),vipExpireDate:E.vipExpireDate?String(E.vipExpireDate).slice(0,10):"",vipSort:typeof E.vipSort=="number"?E.vipSort:"",vipRole:R?j:j?"__custom__":"",vipRoleCustom:R?"":j,vipName:String(E.vipName??""),vipProject:String(E.vipProject??""),vipContact:String(E.vipContact??""),vipBio:String(E.vipBio??"")})}else m(Kd)}).catch(N=>{T||console.error("Load error:",N)}).finally(()=>{T||g(!1)}),()=>{T=!0}},[r,l]);async function P(){if(l){if(d.isVip&&!d.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(d.isVip&&d.vipExpireDate.trim()){const T=new Date(d.vipExpireDate);if(isNaN(T.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}k(!0);try{const T=d.vipRole==="__custom__"?d.vipRoleCustom.trim():d.vipRole,N={id:l,isVip:d.isVip,vipExpireDate:d.isVip?d.vipExpireDate:void 0,vipSort:d.vipSort===""?void 0:d.vipSort,vipRole:T||void 0,vipName:d.vipName||void 0,vipProject:d.vipProject||void 0,vipContact:d.vipContact||void 0,vipBio:d.vipBio||void 0},b=await yt("/api/db/users",N);b!=null&&b.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(b==null?void 0:b.error))}catch(T){console.error("Save VIP error:",T),alert("保存失败")}finally{k(!1)}}}return r?e.jsx(Ct,{open:r,onOpenChange:()=>a(),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(on,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",i||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(se,{className:"text-gray-300",children:"VIP 会员"}),e.jsx(dt,{checked:d.isVip,onCheckedChange:T=>m(N=>({...N,isVip:T}))})]}),d.isVip&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(se,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",e.jsx("span",{className:"text-amber-400",children:"*"})]}),e.jsx(ce,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:d.vipExpireDate,onChange:T=>m(N=>({...N,vipExpireDate:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"排序"}),e.jsx(ce,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:d.vipSort===""?"":d.vipSort,onChange:T=>{const N=T.target.value;m(b=>({...b,vipSort:N===""?"":parseInt(N,10)||0}))}})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:d.vipRole,onChange:T=>m(N=>({...N,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:"其他(手动填写)"})]}),d.vipRole==="__custom__"&&e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:d.vipRoleCustom,onChange:T=>m(N=>({...N,vipRoleCustom:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:d.vipName,onChange:T=>m(N=>({...N,vipName:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"项目/公司"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:d.vipProject,onChange:T=>m(N=>({...N,vipProject:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"联系方式"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:d.vipContact,onChange:T=>m(N=>({...N,vipContact:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"一句话简介"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:d.vipBio,onChange:T=>m(N=>({...N,vipBio:T.target.value}))})]})]}),e.jsxs(Ot,{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(xs,{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(It,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})}):null}const oo=[{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 Y2(){var In,_n,oa,Mn,An;const[r,a]=Xx(),l=r.get("pool"),[i,c]=u.useState([]),[d,m]=u.useState(0),[f,p]=u.useState(1),[y,g]=u.useState(10),[v,k]=u.useState(""),P=$u(v,300),T=l==="vip"?"vip":l==="complete"?"complete":"all",[N,b]=u.useState(T),[C,E]=u.useState(!0),[j,R]=u.useState(null),[G,J]=u.useState(!1),[L,I]=u.useState("desc");u.useEffect(()=>{l==="vip"?b("vip"):l==="complete"?b("complete"):l==="all"&&b("all")},[l]);const[w,V]=u.useState(!1),[te,ie]=u.useState(!1),[Y,ne]=u.useState(null),[_,Q]=u.useState(""),[ue,O]=u.useState(""),[re,H]=u.useState(!1),[A,$]=u.useState(!1),[F,ee]=u.useState({referrals:[],stats:{}}),[K,de]=u.useState(!1),[X,ye]=u.useState(null),[Ce,z]=u.useState(!1),[xe,Pe]=u.useState(null),[Ve,He]=u.useState(!1),[Ke,tt]=u.useState(null),[$e,me]=u.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),[pe,ft]=u.useState([]),[ss,ur]=u.useState(!1),[Sn,zs]=u.useState(!1),[vs,Ir]=u.useState(null),[_t,rs]=u.useState({title:"",description:"",trigger:"",sort:0,enabled:!0}),[Cn,Xs]=u.useState([]),[ns,kn]=u.useState(!1),[ra,Es]=u.useState(!1),[_r,Js]=u.useState(null),[Nt,Ps]=u.useState({name:"",sort:0}),[js,Zs]=u.useState({}),[os,Ts]=u.useState(!1);async function Pt(){var U;E(!0),R(null);try{if(G){const We=new URLSearchParams({search:P,limit:String(y*5)}),Ge=await Le(`/api/db/users/rfm?${We}`);if(Ge!=null&&Ge.success){let Vt=Ge.users||[];L==="asc"&&(Vt=[...Vt].reverse());const lt=(f-1)*y;c(Vt.slice(lt,lt+y)),m(((U=Ge.users)==null?void 0:U.length)??0),Vt.length===0&&(J(!1),R("暂无订单数据,RFM 排序需要用户有购买记录后才能生效"))}else J(!1),R((Ge==null?void 0:Ge.error)||"RFM 加载失败,已切回普通模式")}else{const We=new URLSearchParams({page:String(f),pageSize:String(y),search:P,...N==="vip"&&{vip:"true"},...N==="complete"&&{pool:"complete"}}),Ge=await Le(`/api/db/users?${We}`);Ge!=null&&Ge.success?(c(Ge.users||[]),m(Ge.total??0)):R((Ge==null?void 0:Ge.error)||"加载失败")}}catch(We){console.error("Load users error:",We),R("网络错误")}finally{E(!1)}}u.useEffect(()=>{p(1)},[P,N,G]),u.useEffect(()=>{Pt()},[f,y,P,N,G,L]);const na=Math.ceil(d/y)||1,aa=()=>{G?L==="desc"?I("asc"):(J(!1),I("desc")):(J(!0),I("desc"))},la=U=>({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"})[U||""]||"bg-gray-500/20 text-gray-400";async function En(U){if(confirm("确定要删除这个用户吗?"))try{const We=await Er(`/api/db/users?id=${encodeURIComponent(U)}`);We!=null&&We.success?Pt():alert("删除失败: "+((We==null?void 0:We.error)||""))}catch{alert("删除失败")}}const Pn=U=>{ne(U),me({phone:U.phone||"",nickname:U.nickname||"",password:"",isAdmin:!!(U.isAdmin??!1),hasFullBook:!!(U.hasFullBook??!1)}),V(!0)},Tn=()=>{ne(null),me({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),V(!0)};async function hr(){if(!$e.phone||!$e.nickname){alert("请填写手机号和昵称");return}H(!0);try{if(Y){const U=await yt("/api/db/users",{id:Y.id,nickname:$e.nickname,isAdmin:$e.isAdmin,hasFullBook:$e.hasFullBook,...$e.password&&{password:$e.password}});if(!(U!=null&&U.success)){alert("更新失败: "+((U==null?void 0:U.error)||""));return}}else{const U=await ut("/api/db/users",{phone:$e.phone,nickname:$e.nickname,password:$e.password,isAdmin:$e.isAdmin});if(!(U!=null&&U.success)){alert("创建失败: "+((U==null?void 0:U.error)||""));return}}V(!1),Pt()}catch{alert("保存失败")}finally{H(!1)}}const Mr=U=>{ne(U),Q(""),O(""),ie(!0)};async function er(U){ye(U),$(!0),de(!0);try{const We=await Le(`/api/db/users/referrals?userId=${encodeURIComponent(U.id)}`);We!=null&&We.success?ee({referrals:We.referrals||[],stats:We.stats||{}}):ee({referrals:[],stats:{}})}catch{ee({referrals:[],stats:{}})}finally{de(!1)}}async function ia(){if(!_){alert("请输入新密码");return}if(_!==ue){alert("两次密码不一致");return}if(_.length<6){alert("密码至少6位");return}H(!0);try{const U=await yt("/api/db/users",{id:Y==null?void 0:Y.id,password:_});U!=null&&U.success?(alert("修改成功"),ie(!1)):alert("修改失败: "+((U==null?void 0:U.error)||""))}catch{alert("修改失败")}finally{H(!1)}}const as=u.useCallback(async()=>{ur(!0);try{const U=await Le("/api/db/user-rules");U!=null&&U.success&&ft(U.rules||[])}catch{}finally{ur(!1)}},[]);async function Ar(){if(!_t.title){alert("请填写规则标题");return}H(!0);try{if(vs){const U=await yt("/api/db/user-rules",{id:vs.id,..._t});if(!(U!=null&&U.success)){alert("更新失败: "+((U==null?void 0:U.error)||""));return}}else{const U=await ut("/api/db/user-rules",_t);if(!(U!=null&&U.success)){alert("创建失败: "+((U==null?void 0:U.error)||""));return}}zs(!1),as()}catch{alert("保存失败")}finally{H(!1)}}async function Dr(U){if(confirm("确定删除?"))try{const We=await Er(`/api/db/user-rules?id=${U}`);We!=null&&We.success&&as()}catch{}}async function Rn(U){try{await yt("/api/db/user-rules",{id:U.id,enabled:!U.enabled}),as()}catch{}}const Lr=u.useCallback(async()=>{kn(!0);try{const U=await Le("/api/db/vip-roles");U!=null&&U.success&&Xs(U.roles||[])}catch{}finally{kn(!1)}},[]);async function Za(){if(!Nt.name){alert("请填写角色名称");return}H(!0);try{if(_r){const U=await yt("/api/db/vip-roles",{id:_r.id,...Nt});if(!(U!=null&&U.success)){alert("更新失败");return}}else{const U=await ut("/api/db/vip-roles",Nt);if(!(U!=null&&U.success)){alert("创建失败");return}}Es(!1),Lr()}catch{alert("保存失败")}finally{H(!1)}}async function el(U){if(confirm("确定删除?"))try{const We=await Er(`/api/db/vip-roles?id=${U}`);We!=null&&We.success&&Lr()}catch{}}const Rs=u.useCallback(async()=>{Ts(!0);try{const U=await Le("/api/db/users/journey-stats");U!=null&&U.success&&U.stats&&Zs(U.stats)}catch{}finally{Ts(!1)}},[]);return e.jsxs("div",{className:"p-8 w-full",children:[j&&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:j}),e.jsx("button",{type:"button",onClick:()=>R(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:["共 ",d," 位注册用户",G&&" · RFM 排序中"]})]})}),e.jsxs(Ql,{defaultValue:"users",className:"w-full",children:[e.jsxs(Ya,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-6 flex-wrap h-auto gap-1",children:[e.jsxs(Ft,{value:"users",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",children:[e.jsx(Yt,{className:"w-4 h-4"})," 用户列表"]}),e.jsxs(Ft,{value:"journey",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:Rs,children:[e.jsx(La,{className:"w-4 h-4"})," 用户旅程总览"]}),e.jsxs(Ft,{value:"rules",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:as,children:[e.jsx(qn,{className:"w-4 h-4"})," 规则配置"]}),e.jsxs(Ft,{value:"vip-roles",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-1.5",onClick:Lr,children:[e.jsx(on,{className:"w-4 h-4"})," VIP 角色"]})]}),e.jsxs(zt,{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:Pt,disabled:C,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${C?"animate-spin":""}`})," 刷新"]}),e.jsxs("select",{value:N,onChange:U=>{const We=U.target.value;b(We),p(1),l&&(r.delete("pool"),a(r))},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",disabled:G,children:[e.jsx("option",{value:"all",children:"全部用户"}),e.jsx("option",{value:"vip",children:"VIP会员(超级个体)"}),e.jsx("option",{value:"complete",children:"完善资料用户"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(hn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(ce,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-56",value:v,onChange:U=>k(U.target.value)})]}),e.jsxs(q,{onClick:Tn,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(lu,{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:C?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{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(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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:aa,children:[e.jsxs("div",{className:"flex items-center gap-1 group",children:[e.jsx(Oa,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"RFM分值"}),G?L==="desc"?e.jsx(Ul,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Zx,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Hj,{className:"w-3.5 h-3.5 text-gray-600 group-hover:text-gray-400"})]}),G&&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(ys,{children:[i.map(U=>{var We,Ge,Vt;return e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{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.avatar?e.jsx("img",{src:U.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((We=U.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:U.nickname}),U.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),U.openId&&!((Ge=U.id)!=null&&Ge.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:U.openId?U.openId.slice(0,12)+"...":(Vt=U.id)==null?void 0:Vt.slice(0,12)})]})]})}),e.jsx(ge,{children:e.jsxs("div",{className:"space-y-1",children:[U.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:U.phone})]}),U.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:U.wechatId})]}),U.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:U.openId,children:[U.openId.slice(0,12),"..."]})]}),!U.phone&&!U.wechatId&&!U.openId&&e.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),e.jsx(ge,{children:U.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(ge,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(U.earnings||0)).toFixed(2)]}),parseFloat(String(U.pendingEarnings||0))>0&&e.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(U.pendingEarnings||0)).toFixed(2)]}),e.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>er(U),role:"button",tabIndex:0,onKeyDown:lt=>lt.key==="Enter"&&er(U),children:[e.jsx(Yt,{className:"w-3 h-3"})," 绑定",U.referralCount||0,"人"]})]})}),e.jsx(ge,{children:U.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:U.rfmScore}),e.jsx(Oe,{className:`border-0 text-xs ${la(U.rfmLevel)}`,children:U.rfmLevel})]})}):e.jsxs("span",{className:"text-gray-600 text-sm",children:["— ",e.jsx("span",{className:"text-xs text-gray-700",children:"点列头排序"})]})}),e.jsx(ge,{className:"text-gray-400",children:U.createdAt?new Date(U.createdAt).toLocaleDateString():"-"}),e.jsx(ge,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{tt(U),He(!0)},className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:e.jsx(on,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{Pe(U.id),z(!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:()=>Pn(U),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:()=>Mr(U),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx(Gf,{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:()=>En(U.id),title:"删除",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},U.id)}),i.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Gs,{page:f,totalPages:na,total:d,pageSize:y,onPageChange:p,onPageSizeChange:U=>{g(U),p(1)}})]})})})]}),e.jsxs(zt,{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:Rs,disabled:os,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${os?"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:oo.map((U,We)=>e.jsxs("div",{className:"relative flex flex-col items-center",children:[e.jsxs("div",{className:`relative w-full p-3 rounded-xl border ${U.color} text-center cursor-default`,children:[e.jsx("div",{className:"text-2xl mb-1",children:U.icon}),e.jsx("div",{className:`text-xs font-medium ${U.color.split(" ").find(Ge=>Ge.startsWith("text-"))}`,children:U.label}),js[U.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:js[U.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})]}),Wee.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:U.step}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-300",children:U.action}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["→ ",U.next]})]})]},U.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(Fs,{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:"实时更新"})]}),os?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Be,{className:"w-5 h-5 text-[#38bdac] animate-spin"})}):Object.keys(js).length>0?e.jsx("div",{className:"space-y-2",children:oo.map(U=>{const We=js[U.id]||0,Ge=Math.max(...oo.map(lt=>js[lt.id]||0),1),Vt=Math.round(We/Ge*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:[U.icon," ",U.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:`${Vt}%`}})}),e.jsx("span",{className:"text-gray-400 text-xs w-10 text-right",children:We})]},U.id)})}):e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-gray-500 text-sm",children:"点击「刷新数据」加载统计"})})]})]})]}),e.jsxs(zt,{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:as,disabled:ss,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${ss?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:()=>{Ir(null),rs({title:"",description:"",trigger:"",sort:0,enabled:!0}),zs(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"})," 添加规则"]})]})]}),ss?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):pe.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(Fs,{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:as,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Be,{className:"w-4 h-4 mr-2"})," 重新加载"]})]}):e.jsx("div",{className:"space-y-2",children:pe.map(U=>e.jsx("div",{className:`p-4 rounded-lg border transition-all ${U.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:U.title}),U.trigger&&e.jsxs(Oe,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/30 text-xs",children:["触发:",U.trigger]}),e.jsx(Oe,{className:`text-xs border-0 ${U.enabled?"bg-green-500/20 text-green-400":"bg-gray-500/20 text-gray-400"}`,children:U.enabled?"启用":"禁用"})]}),U.description&&e.jsx("p",{className:"text-gray-400 text-sm ml-6",children:U.description})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4 shrink-0",children:[e.jsx(dt,{checked:U.enabled,onCheckedChange:()=>Rn(U)}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{Ir(U),rs({title:U.title,description:U.description,trigger:U.trigger,sort:U.sort,enabled:U.enabled}),zs(!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:()=>Dr(U.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]})},U.id))})]}),e.jsxs(zt,{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:Lr,disabled:ns,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${ns?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:()=>{Js(null),Ps({name:"",sort:0}),Es(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"})," 添加角色"]})]})]}),ns?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):Cn.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(on,{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:()=>{Js(null),Ps({name:"",sort:0}),Es(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{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:Cn.map(U=>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(on,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{className:"text-white font-medium",children:U.name})]}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{type:"button",onClick:()=>{Js(U),Ps({name:U.name,sort:U.sort}),Es(!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:()=>el(U.id),className:"text-gray-500 hover:text-red-400",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["排序: ",U.sort]})]},U.id))})]})]}),e.jsx(Ct,{open:w,onOpenChange:V,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[Y?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(lu,{className:"w-5 h-5 text-[#38bdac]"}),Y?"编辑用户":"添加用户"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"手机号"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:$e.phone,onChange:U=>me({...$e,phone:U.target.value}),disabled:!!Y})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"昵称"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:$e.nickname,onChange:U=>me({...$e,nickname:U.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:Y?"新密码 (留空则不修改)":"密码"}),e.jsx(ce,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:Y?"留空则不修改":"请输入密码",value:$e.password,onChange:U=>me({...$e,password:U.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(se,{className:"text-gray-300",children:"管理员权限"}),e.jsx(dt,{checked:$e.isAdmin,onCheckedChange:U=>me({...$e,isAdmin:U})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(se,{className:"text-gray-300",children:"已购全书"}),e.jsx(dt,{checked:$e.hasFullBook,onCheckedChange:U=>me({...$e,hasFullBook:U})})]})]}),e.jsxs(Ot,{children:[e.jsxs(q,{variant:"outline",onClick:()=>V(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(xs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:hr,disabled:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),re?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:te,onOpenChange:ie,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Gf,{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:["用户:",Y==null?void 0:Y.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",Y==null?void 0:Y.phone]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"新密码"}),e.jsx(ce,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:_,onChange:U=>Q(U.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"确认密码"}),e.jsx(ce,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入",value:ue,onChange:U=>O(U.target.value)})]})]}),e.jsxs(Ot,{children:[e.jsx(q,{variant:"outline",onClick:()=>ie(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:ia,disabled:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:re?"保存中...":"确认修改"})]})]})}),e.jsx(Ct,{open:Sn,onOpenChange:zs,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),vs?"编辑规则":"添加规则"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"规则标题 *"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:匹配后填写头像、付款1980需填写信息",value:_t.title,onChange:U=>rs({..._t,title:U.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"规则描述"}),e.jsx(Zn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[80px] resize-none",placeholder:"详细说明规则内容...",value:_t.description,onChange:U=>rs({..._t,description:U.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"触发条件"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:完成匹配、付款后、注册时",value:_t.trigger,onChange:U=>rs({..._t,trigger:U.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx(se,{className:"text-gray-300",children:"启用状态"})}),e.jsx(dt,{checked:_t.enabled,onCheckedChange:U=>rs({..._t,enabled:U})})]})]}),e.jsxs(Ot,{children:[e.jsxs(q,{variant:"outline",onClick:()=>zs(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(xs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:Ar,disabled:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),re?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:ra,onOpenChange:Es,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(on,{className:"w-5 h-5 text-amber-400"}),_r?"编辑 VIP 角色":"添加 VIP 角色"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"角色名称 *"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:创业者、资源整合者、技术咖",value:Nt.name,onChange:U=>Ps({...Nt,name:U.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"排序(越小越前)"}),e.jsx(ce,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Nt.sort,onChange:U=>Ps({...Nt,sort:parseInt(U.target.value)||0})})]})]}),e.jsxs(Ot,{children:[e.jsxs(q,{variant:"outline",onClick:()=>Es(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(xs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:Za,disabled:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),re?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:A,onOpenChange:$,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Yt,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系 - ",X==null?void 0:X.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:((In=F.stats)==null?void 0:In.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:((_n=F.stats)==null?void 0:_n.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:["¥",(((oa=F.stats)==null?void 0:oa.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:["¥",(((Mn=F.stats)==null?void 0:Mn.pendingEarnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),K?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Be,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((An=F.referrals)==null?void 0:An.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(F.referrals??[]).map((U,We)=>{var Vt;const Ge=U;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:((Vt=Ge.nickname)==null?void 0:Vt.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white text-sm",children:Ge.nickname}),e.jsx("div",{className:"text-xs text-gray-500",children:Ge.phone||(Ge.hasOpenId?"微信用户":"未绑定")})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Ge.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),Ge.status==="paid"&&e.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",Ge.purchasedSections,"章"]}),Ge.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:Ge.createdAt?new Date(Ge.createdAt).toLocaleDateString():""})]})]},Ge.id||We)})}):e.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),e.jsx(Ot,{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(E0,{open:Ce,onClose:()=>z(!1),userId:xe,onUserUpdated:Pt}),e.jsx(G2,{open:Ve,onClose:()=>{He(!1),tt(null)},userId:(Ke==null?void 0:Ke.id)??null,userNickname:Ke==null?void 0:Ke.nickname,onSaved:Pt})]})}function wo(r,[a,l]){return Math.min(l,Math.max(a,r))}var P0=["PageUp","PageDown"],T0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],R0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Qa="Slider",[uu,Q2,q2]=Bu(Qa),[I0]=bn(Qa,[q2]),[X2,Fo]=I0(Qa),_0=u.forwardRef((r,a)=>{const{name:l,min:i=0,max:c=100,step:d=1,orientation:m="horizontal",disabled:f=!1,minStepsBetweenThumbs:p=0,defaultValue:y=[i],value:g,onValueChange:v=()=>{},onValueCommit:k=()=>{},inverted:P=!1,form:T,...N}=r,b=u.useRef(new Set),C=u.useRef(0),j=m==="horizontal"?J2:Z2,[R=[],G]=Xn({prop:g,defaultProp:y,onChange:te=>{var Y;(Y=[...b.current][C.current])==null||Y.focus(),v(te)}}),J=u.useRef(R);function L(te){const ie=n4(R,te);V(te,ie)}function I(te){V(te,C.current)}function w(){const te=J.current[C.current];R[C.current]!==te&&k(R)}function V(te,ie,{commit:Y}={commit:!1}){const ne=o4(d),_=c4(Math.round((te-i)/d)*d+i,ne),Q=wo(_,[i,c]);G((ue=[])=>{const O=s4(ue,Q,ie);if(i4(O,p*d)){C.current=O.indexOf(Q);const re=String(O)!==String(ue);return re&&Y&&k(O),re?O:ue}else return ue})}return e.jsx(X2,{scope:r.__scopeSlider,name:l,disabled:f,min:i,max:c,valueIndexToChangeRef:C,thumbs:b.current,values:R,orientation:m,form:T,children:e.jsx(uu.Provider,{scope:r.__scopeSlider,children:e.jsx(uu.Slot,{scope:r.__scopeSlider,children:e.jsx(j,{"aria-disabled":f,"data-disabled":f?"":void 0,...N,ref:a,onPointerDown:Ye(N.onPointerDown,()=>{f||(J.current=R)}),min:i,max:c,inverted:P,onSlideStart:f?void 0:L,onSlideMove:f?void 0:I,onSlideEnd:f?void 0:w,onHomeKeyDown:()=>!f&&V(i,0,{commit:!0}),onEndKeyDown:()=>!f&&V(c,R.length-1,{commit:!0}),onStepKeyDown:({event:te,direction:ie})=>{if(!f){const _=P0.includes(te.key)||te.shiftKey&&T0.includes(te.key)?10:1,Q=C.current,ue=R[Q],O=d*_*ie;V(ue+O,Q,{commit:!0})}}})})})})});_0.displayName=Qa;var[M0,A0]=I0(Qa,{startEdge:"left",endEdge:"right",size:"width",direction:1}),J2=u.forwardRef((r,a)=>{const{min:l,max:i,dir:c,inverted:d,onSlideStart:m,onSlideMove:f,onSlideEnd:p,onStepKeyDown:y,...g}=r,[v,k]=u.useState(null),P=it(a,j=>k(j)),T=u.useRef(void 0),N=Do(c),b=N==="ltr",C=b&&!d||!b&&d;function E(j){const R=T.current||v.getBoundingClientRect(),G=[0,R.width],L=Hu(G,C?[l,i]:[i,l]);return T.current=R,L(j-R.left)}return e.jsx(M0,{scope:r.__scopeSlider,startEdge:C?"left":"right",endEdge:C?"right":"left",direction:C?1:-1,size:"width",children:e.jsx(D0,{dir:N,"data-orientation":"horizontal",...g,ref:P,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const R=E(j.clientX);m==null||m(R)},onSlideMove:j=>{const R=E(j.clientX);f==null||f(R)},onSlideEnd:()=>{T.current=void 0,p==null||p()},onStepKeyDown:j=>{const G=R0[C?"from-left":"from-right"].includes(j.key);y==null||y({event:j,direction:G?-1:1})}})})}),Z2=u.forwardRef((r,a)=>{const{min:l,max:i,inverted:c,onSlideStart:d,onSlideMove:m,onSlideEnd:f,onStepKeyDown:p,...y}=r,g=u.useRef(null),v=it(a,g),k=u.useRef(void 0),P=!c;function T(N){const b=k.current||g.current.getBoundingClientRect(),C=[0,b.height],j=Hu(C,P?[i,l]:[l,i]);return k.current=b,j(N-b.top)}return e.jsx(M0,{scope:r.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:e.jsx(D0,{"data-orientation":"vertical",...y,ref:v,style:{...y.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:N=>{const b=T(N.clientY);d==null||d(b)},onSlideMove:N=>{const b=T(N.clientY);m==null||m(b)},onSlideEnd:()=>{k.current=void 0,f==null||f()},onStepKeyDown:N=>{const C=R0[P?"from-bottom":"from-top"].includes(N.key);p==null||p({event:N,direction:C?-1:1})}})})}),D0=u.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:m,onEndKeyDown:f,onStepKeyDown:p,...y}=r,g=Fo(Qa,l);return e.jsx(Je.span,{...y,ref:a,onKeyDown:Ye(r.onKeyDown,v=>{v.key==="Home"?(m(v),v.preventDefault()):v.key==="End"?(f(v),v.preventDefault()):P0.concat(T0).includes(v.key)&&(p(v),v.preventDefault())}),onPointerDown:Ye(r.onPointerDown,v=>{const k=v.target;k.setPointerCapture(v.pointerId),v.preventDefault(),g.thumbs.has(k)?k.focus():i(v)}),onPointerMove:Ye(r.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:Ye(r.onPointerUp,v=>{const k=v.target;k.hasPointerCapture(v.pointerId)&&(k.releasePointerCapture(v.pointerId),d(v))})})}),L0="SliderTrack",O0=u.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=Fo(L0,l);return e.jsx(Je.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...i,ref:a})});O0.displayName=L0;var hu="SliderRange",F0=u.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=Fo(hu,l),d=A0(hu,l),m=u.useRef(null),f=it(a,m),p=c.values.length,y=c.values.map(k=>B0(k,c.min,c.max)),g=p>1?Math.min(...y):0,v=100-Math.max(...y);return e.jsx(Je.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...i,ref:f,style:{...r.style,[d.startEdge]:g+"%",[d.endEdge]:v+"%"}})});F0.displayName=hu;var mu="SliderThumb",z0=u.forwardRef((r,a)=>{const l=Q2(r.__scopeSlider),[i,c]=u.useState(null),d=it(a,f=>c(f)),m=u.useMemo(()=>i?l().findIndex(f=>f.ref.current===i):-1,[l,i]);return e.jsx(e4,{...r,ref:d,index:m})}),e4=u.forwardRef((r,a)=>{const{__scopeSlider:l,index:i,name:c,...d}=r,m=Fo(mu,l),f=A0(mu,l),[p,y]=u.useState(null),g=it(a,E=>y(E)),v=p?m.form||!!p.closest("form"):!0,k=Wu(p),P=m.values[i],T=P===void 0?0:B0(P,m.min,m.max),N=r4(i,m.values.length),b=k==null?void 0:k[f.size],C=b?a4(b,T,f.direction):0;return u.useEffect(()=>{if(p)return m.thumbs.add(p),()=>{m.thumbs.delete(p)}},[p,m.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${T}% + ${C}px)`},children:[e.jsx(uu.ItemSlot,{scope:r.__scopeSlider,children:e.jsx(Je.span,{role:"slider","aria-label":r["aria-label"]||N,"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,...d,ref:g,style:P===void 0?{display:"none"}:r.style,onFocus:Ye(r.onFocus,()=>{m.valueIndexToChangeRef.current=i})})}),v&&e.jsx($0,{name:c??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:P},i)]})});z0.displayName=mu;var t4="RadioBubbleInput",$0=u.forwardRef(({__scopeSlider:r,value:a,...l},i)=>{const c=u.useRef(null),d=it(c,i),m=Vu(a);return u.useEffect(()=>{const f=c.current;if(!f)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(m!==a&&g){const v=new Event("input",{bubbles:!0});g.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(Je.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});$0.displayName=t4;function s4(r=[],a,l){const i=[...r];return i[l]=a,i.sort((c,d)=>c-d)}function B0(r,a,l){const d=100/(l-a)*(r-a);return wo(d,[0,100])}function r4(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function n4(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),i=Math.min(...l);return l.indexOf(i)}function a4(r,a,l){const i=r/2,d=Hu([0,50],[0,i]);return(i-d(a)*l)*l}function l4(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function i4(r,a){if(a>0){const l=l4(r);return Math.min(...l)>=a}return!0}function Hu(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const i=(a[1]-a[0])/(r[1]-r[0]);return a[0]+i*(l-r[0])}}function o4(r){return(String(r).split(".")[1]||"").length}function c4(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var d4=_0,u4=O0,h4=F0,m4=z0;function f4({className:r,defaultValue:a,value:l,min:i=0,max:c=100,...d}){const m=u.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[i,c],[l,a,i,c]);return e.jsxs(d4,{defaultValue:a,value:l,min:i,max:c,className:ot("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...d,children:[e.jsx(u4,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:e.jsx(h4,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:m.length},(f,p)=>e.jsx(m4,{className:"block size-4 shrink-0 rounded-full border-2 border-[#38bdac] bg-white shadow-sm focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},p))]})}const x4={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function U0({embedded:r=!1}){const[a,l]=u.useState(x4),[i,c]=u.useState(!0),[d,m]=u.useState(!1);u.useEffect(()=>{Le("/api/admin/referral-settings").then(y=>{const g=y==null?void 0:y.data;g&&typeof g=="object"&&l({distributorShare:g.distributorShare??90,minWithdrawAmount:g.minWithdrawAmount??10,bindingDays:g.bindingDays??30,userDiscount:g.userDiscount??5,enableAutoWithdraw:g.enableAutoWithdraw??!1,vipOrderShareVip:g.vipOrderShareVip??20,vipOrderShareNonVip:g.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},g=await ut("/api/admin/referral-settings",y);if(!g||g.success===!1){alert("保存失败: "+(g&&typeof g=="object"&&"error"in g?g.error:""));return}alert(`✅ 分销配置已保存成功! + +• 小程序与网站的推广规则会一起生效 +• 绑定关系会使用新的天数配置 +• 佣金比例会立即应用到新订单 + +如有缓存,请刷新前台/小程序页面。`)}catch(y){console.error(y),alert("保存失败: "+(y instanceof Error?y.message:String(y)))}finally{m(!1)}},p=y=>g=>{const v=parseFloat(g.target.value||"0");l(k=>({...k,[y]:isNaN(v)?0:v}))};return i?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(Ba,{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:d||i,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),d?"保存中...":"保存配置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{children:[e.jsxs(qe,{className:"flex items-center gap-2 text-white",children:[e.jsx(tN,{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(se,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(eo,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),e.jsx(ce,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.userDiscount,onChange:p("userDiscount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(se,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Yt,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(f4,{className:"flex-1",min:10,max:100,step:1,value:[a.distributorShare],onValueChange:([y])=>l(g=>({...g,distributorShare:y}))}),e.jsx(ce,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:a.distributorShare,onChange:p("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(se,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(eo,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),e.jsx(ce,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.vipOrderShareVip,onChange:p("vipOrderShareVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(se,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(eo,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),e.jsx(ce,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.vipOrderShareNonVip,onChange:p("vipOrderShareNonVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(se,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Yt,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),e.jsx(ce,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:a.bindingDays,onChange:p("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(Qe,{children:[e.jsxs(qe,{className:"flex items-center gap-2 text-white",children:[e.jsx(Ba,{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(se,{className:"text-gray-300",children:"最低提现金额(元)"}),e.jsx(ce,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:a.minWithdrawAmount,onChange:p("minWithdrawAmount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(se,{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(g=>({...g,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(Qe,{children:e.jsxs(qe,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[e.jsx(eo,{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 p4(){var Ce;const[r,a]=u.useState("overview"),[l,i]=u.useState([]),[c,d]=u.useState(null),[m,f]=u.useState([]),[p,y]=u.useState([]),[g,v]=u.useState([]),[k,P]=u.useState(!0),[T,N]=u.useState(null),[b,C]=u.useState(""),[E,j]=u.useState("all"),[R,G]=u.useState(1),[J,L]=u.useState(10),[I,w]=u.useState(0),[V,te]=u.useState(new Set),[ie,Y]=u.useState(null),[ne,_]=u.useState(""),[Q,ue]=u.useState(!1);u.useEffect(()=>{O()},[]),u.useEffect(()=>{G(1)},[r,E]),u.useEffect(()=>{re(r)},[r]),u.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&re(r,!0)},[R,J,E,b]);async function O(){N(null);try{const z=await Le("/api/admin/distribution/overview");z!=null&&z.success&&z.overview&&d(z.overview)}catch(z){console.error("[Admin] 概览接口异常:",z),N("加载概览失败")}try{const z=await Le("/api/db/users");v((z==null?void 0:z.users)||[])}catch(z){console.error("[Admin] 用户数据加载失败:",z)}}async function re(z,xe=!1){var Pe;if(!(!xe&&V.has(z))){P(!0);try{const Ve=g;switch(z){case"overview":break;case"orders":{try{const He=new URLSearchParams({page:String(R),pageSize:String(J),...E!=="all"&&{status:E},...b&&{search:b}}),Ke=await Le(`/api/orders?${He}`);if(Ke!=null&&Ke.success&&Ke.orders){const tt=Ke.orders.map($e=>{const me=Ve.find(ft=>ft.id===$e.userId),pe=$e.referrerId?Ve.find(ft=>ft.id===$e.referrerId):null;return{...$e,amount:parseFloat(String($e.amount))||0,userNickname:(me==null?void 0:me.nickname)||$e.userNickname||"未知用户",userPhone:(me==null?void 0:me.phone)||$e.userPhone||"-",referrerNickname:(pe==null?void 0:pe.nickname)||null,referrerCode:(pe==null?void 0:pe.referralCode)??null,type:$e.productType||$e.type}});i(tt),w(Ke.total??tt.length)}else i([]),w(0)}catch(He){console.error(He),N("加载订单失败"),i([])}break}case"bindings":{try{const He=new URLSearchParams({page:String(R),pageSize:String(J),...E!=="all"&&{status:E}}),Ke=await Le(`/api/db/distribution?${He}`);f((Ke==null?void 0:Ke.bindings)||[]),w((Ke==null?void 0:Ke.total)??((Pe=Ke==null?void 0:Ke.bindings)==null?void 0:Pe.length)??0)}catch(He){console.error(He),N("加载绑定数据失败"),f([])}break}case"withdrawals":{try{const He=E==="completed"?"success":E==="rejected"?"failed":E,Ke=new URLSearchParams({...He&&He!=="all"&&{status:He},page:String(R),pageSize:String(J)}),tt=await Le(`/api/admin/withdrawals?${Ke}`);if(tt!=null&&tt.success&&tt.withdrawals){const $e=tt.withdrawals.map(me=>({...me,account:me.account??"未绑定微信号",status:me.status==="success"?"completed":me.status==="failed"?"rejected":me.status}));y($e),w((tt==null?void 0:tt.total)??$e.length)}else tt!=null&&tt.success||N(`获取提现记录失败: ${(tt==null?void 0:tt.error)||"未知错误"}`),y([])}catch(He){console.error(He),N("加载提现数据失败"),y([])}break}}te(He=>new Set(He).add(z))}catch(Ve){console.error(Ve)}finally{P(!1)}}}async function H(){N(null),te(z=>{const xe=new Set(z);return xe.delete(r),xe}),r==="overview"&&O(),await re(r,!0)}async function A(z){if(confirm("确认审核通过并打款?"))try{const xe=await yt("/api/admin/withdrawals",{id:z,action:"approve"});if(!(xe!=null&&xe.success)){const Pe=(xe==null?void 0:xe.message)||(xe==null?void 0:xe.error)||"操作失败";alert(Pe);return}await H()}catch(xe){console.error(xe),alert("操作失败")}}async function $(z){const xe=prompt("请输入拒绝原因:");if(xe)try{const Pe=await yt("/api/admin/withdrawals",{id:z,action:"reject",errorMessage:xe});if(!(Pe!=null&&Pe.success)){alert((Pe==null?void 0:Pe.error)||"操作失败");return}await H()}catch(Pe){console.error(Pe),alert("操作失败")}}async function F(){var z;if(!(!(ie!=null&&ie.orderSn)&&!(ie!=null&&ie.id))){ue(!0),N(null);try{const xe=await yt("/api/admin/orders/refund",{orderSn:ie.orderSn||ie.id,reason:ne||void 0});xe!=null&&xe.success?(Y(null),_(""),await re("orders",!0)):N((xe==null?void 0:xe.error)||"退款失败")}catch(xe){const Pe=xe;N(((z=Pe==null?void 0:Pe.data)==null?void 0:z.error)||"退款失败,请检查网络后重试")}finally{ue(!1)}}}function ee(z){const xe={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"},Pe={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return e.jsx(Oe,{className:`${xe[z]||"bg-gray-500/20 text-gray-400"} border-0`,children:Pe[z]||z})}const K=Math.ceil(I/J)||1,de=l,X=m.filter(z=>{var Pe,Ve,He,Ke;if(!b)return!0;const xe=b.toLowerCase();return((Pe=z.refereeNickname)==null?void 0:Pe.toLowerCase().includes(xe))||((Ve=z.refereePhone)==null?void 0:Ve.includes(xe))||((He=z.referrerName)==null?void 0:He.toLowerCase().includes(xe))||((Ke=z.referrerCode)==null?void 0:Ke.toLowerCase().includes(xe))}),ye=p.filter(z=>{var Pe;if(!b)return!0;const xe=b.toLowerCase();return((Pe=z.userName)==null?void 0:Pe.toLowerCase().includes(xe))||z.account&&z.account.toLowerCase().includes(xe)});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:()=>N(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:H,disabled:k,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${k?"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:Oa},{key:"orders",label:"订单管理",icon:yo},{key:"bindings",label:"绑定管理",icon:kr},{key:"withdrawals",label:"提现审核",icon:Ba},{key:"settings",label:"推广设置",icon:qn}].map(z=>e.jsxs("button",{type:"button",onClick:()=>{a(z.key),j("all"),C("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===z.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[e.jsx(z.icon,{className:"w-4 h-4"}),z.label]},z.key))}),k?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx(Be,{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(Yt,{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(Oa,{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(kr,{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(Hf,{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(yo,{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(Qe,{children:[e.jsxs(qe,{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((z,xe)=>xe.clicks-z.clicks).map((z,xe)=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-4 text-white font-mono",children:z.page||"(未区分)"}),e.jsx("td",{className:"py-2 pr-4 text-right text-white",children:z.clicks}),e.jsxs("td",{className:"py-2 text-right text-gray-400",children:[c.todayClicks>0?(z.clicks/c.todayClicks*100).toFixed(1):0,"%"]})]},xe))})]})})})]}),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(ru,{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(Ba,{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(Qe,{children:e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(go,{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(Qe,{children:e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Oa,{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(Qe,{children:e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Yt,{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(hn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ce,{value:b,onChange:z=>C(z.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:z=>j(z.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(z=>{var xe,Pe;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:[(xe=z.id)==null?void 0:xe.slice(0,12),"..."]}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:z.userNickname}),e.jsx("p",{className:"text-gray-500 text-xs",children:z.userPhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:(()=>{const Ve=z.productType||z.type;return Ve==="fullbook"?`${z.bookName||"《底层逻辑》"} - 全本`:Ve==="match"?"匹配次数购买":`${z.bookName||"《底层逻辑》"} - ${z.sectionTitle||z.chapterTitle||`章节${z.productId||z.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const Ve=z.productType||z.type;return Ve==="fullbook"?"全书解锁":Ve==="match"?"功能权益":z.chapterTitle||"单章购买"})()})]})}),e.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof z.amount=="number"?z.amount.toFixed(2):parseFloat(String(z.amount||"0")).toFixed(2)]}),e.jsx("td",{className:"p-4 text-gray-300",children:z.paymentMethod==="wechat"?"微信支付":z.paymentMethod==="alipay"?"支付宝":z.paymentMethod||"微信支付"}),e.jsx("td",{className:"p-4",children:z.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):z.status==="completed"||z.status==="paid"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):z.status==="pending"||z.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:z.refundReason,children:z.status==="refunded"&&z.refundReason?z.refundReason:"-"}),e.jsx("td",{className:"p-4 text-gray-300 text-sm",children:z.referrerId||z.referralCode?e.jsxs("span",{title:z.referralCode||z.referrerCode||z.referrerId||"",children:[z.referrerNickname||z.referralCode||z.referrerCode||((Pe=z.referrerId)==null?void 0:Pe.slice(0,8)),(z.referralCode||z.referrerCode)&&` (${z.referralCode||z.referrerCode})`]}):"-"}),e.jsx("td",{className:"p-4 text-[#FFD700]",children:z.referrerEarnings?`¥${(typeof z.referrerEarnings=="number"?z.referrerEarnings:parseFloat(String(z.referrerEarnings))).toFixed(2)}`:"-"}),e.jsx("td",{className:"p-4 text-gray-400 text-sm",children:z.createdAt?new Date(z.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:(z.status==="paid"||z.status==="completed")&&e.jsxs(q,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{Y(z),_("")},children:[e.jsx(lp,{className:"w-3 h-3 mr-1"}),"退款"]})})]},z.id)})})]})}),r==="orders"&&e.jsx(Gs,{page:R,totalPages:K,total:I,pageSize:J,onPageChange:G,onPageSizeChange:z=>{L(z),G(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(hn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ce,{value:b,onChange:z=>C(z.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:z=>j(z.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:[X.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:X.map(z=>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:z.refereeNickname||"匿名用户"}),e.jsx("p",{className:"text-gray-500 text-xs",children:z.refereePhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white",children:z.referrerName||"-"}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:z.referrerCode})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:z.boundAt?new Date(z.boundAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:z.expiresAt?new Date(z.expiresAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:ee(z.status)}),e.jsx("td",{className:"p-4",children:z.commission?e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",z.commission.toFixed(2)]}):e.jsx("span",{className:"text-gray-500",children:"-"})})]},z.id))})]})}),r==="bindings"&&e.jsx(Gs,{page:R,totalPages:K,total:I,pageSize:J,onPageChange:G,onPageSizeChange:z=>{L(z),G(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(hn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ce,{value:b,onChange:z=>C(z.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:z=>j(z.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:[ye.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:ye.map(z=>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:[z.userAvatar?e.jsx("img",{src:z.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:(z.userName||z.name||"?").slice(0,1)}),e.jsx("p",{className:"text-white font-medium",children:z.userName||z.name})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",z.amount.toFixed(2)]})}),e.jsx("td",{className:"p-4",children:e.jsx(Oe,{className:z.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:z.method==="wechat"?"微信":"支付宝"})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-mono text-xs",children:z.account}),e.jsx("p",{className:"text-gray-500 text-xs",children:z.name})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:z.createdAt?new Date(z.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:ee(z.status)}),e.jsx("td",{className:"p-4 text-right",children:z.status==="pending"&&e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsxs(q,{size:"sm",onClick:()=>A(z.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Hf,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(q,{size:"sm",variant:"outline",onClick:()=>$(z.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx(tp,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},z.id))})]})}),r==="withdrawals"&&e.jsx(Gs,{page:R,totalPages:K,total:I,pageSize:J,onPageChange:G,onPageSizeChange:z=>{L(z),G(1)}})]})})]})]}),e.jsx(Ct,{open:!!ie,onOpenChange:z=>!z&&Y(null),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsx(Et,{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(ce,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:ne,onChange:z=>_(z.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Ot,{children:[e.jsx(q,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>Y(null),disabled:Q,children:"取消"}),e.jsx(q,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:F,disabled:Q,children:Q?"退款中...":"确认退款"})]})]})}),r==="settings"&&e.jsx("div",{className:"-mx-8 -mt-6",children:e.jsx(U0,{embedded:!0})})]})}function g4(){const[r,a]=u.useState([]),[l,i]=u.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=u.useState(!0),[m,f]=u.useState(null),[p,y]=u.useState("all"),[g,v]=u.useState(1),[k,P]=u.useState(10),[T,N]=u.useState(0),[b,C]=u.useState(null);async function E(){var L,I,w,V,te,ie,Y;d(!0),f(null);try{const ne=new URLSearchParams({status:p,page:String(g),pageSize:String(k)}),_=await Le(`/api/admin/withdrawals?${ne}`);if(_!=null&&_.success){const Q=_.withdrawals||[];a(Q),N(_.total??((L=_.stats)==null?void 0:L.total)??Q.length),i({total:((I=_.stats)==null?void 0:I.total)??_.total??Q.length,pendingCount:((w=_.stats)==null?void 0:w.pendingCount)??0,pendingAmount:((V=_.stats)==null?void 0:V.pendingAmount)??0,successCount:((te=_.stats)==null?void 0:te.successCount)??0,successAmount:((ie=_.stats)==null?void 0:ie.successAmount)??0,failedCount:((Y=_.stats)==null?void 0:Y.failedCount)??0})}else f("加载提现记录失败")}catch(ne){console.error("Load withdrawals error:",ne),f("加载失败,请检查网络后重试")}finally{d(!1)}}u.useEffect(()=>{v(1)},[p]),u.useEffect(()=>{E()},[p,g,k]);const j=Math.ceil(T/k)||1;async function R(L){const I=r.find(w=>w.id===L);if(I!=null&&I.userCommissionInfo&&I.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${I.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 + +确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;C(L);try{const w=await yt("/api/admin/withdrawals",{id:L,action:"approve"});w!=null&&w.success?E():alert("操作失败: "+((w==null?void 0:w.error)??""))}catch{alert("操作失败")}finally{C(null)}}async function G(L){const I=prompt("请输入拒绝原因(将返还用户余额):");if(I){C(L);try{const w=await yt("/api/admin/withdrawals",{id:L,action:"reject",errorMessage:I});w!=null&&w.success?E():alert("操作失败: "+((w==null?void 0:w.error)??""))}catch{alert("操作失败")}finally{C(null)}}}function J(L){switch(L){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:L})}}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:E,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{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(yo,{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(L=>e.jsx(q,{variant:p===L?"default":"outline",size:"sm",onClick:()=>y(L),className:p===L?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:L==="all"?"全部":L==="pending"?"待处理":L==="success"?"已完成":"已拒绝"},L))}),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(Be,{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(Ba,{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(L=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4 text-gray-400",children:new Date(L.createdAt??"").toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[L.userAvatar?e.jsx("img",{src:L.userAvatar,alt:L.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:(L.userName??"?").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-white",children:L.userName??"未知"}),e.jsx("p",{className:"text-xs text-gray-500",children:L.userPhone??L.referralCode??(L.userId??"").slice(0,10)})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(L.amount).toFixed(2)]})}),e.jsx("td",{className:"p-4",children:L.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:["¥",L.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:["¥",L.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:["¥",L.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:L.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",L.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):e.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),e.jsxs("td",{className:"p-4",children:[J(L.status),L.errorMessage&&e.jsx("p",{className:"text-xs text-red-400 mt-1",children:L.errorMessage})]}),e.jsx("td",{className:"p-4 text-gray-400",children:L.processedAt?new Date(L.processedAt).toLocaleString():"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:L.userConfirmedAt?e.jsxs("span",{className:"text-green-400",title:L.userConfirmedAt,children:["已确认 ",new Date(L.userConfirmedAt).toLocaleString()]}):"-"}),e.jsxs("td",{className:"p-4 text-right",children:[(L.status==="pending"||L.status==="pending_confirm")&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(q,{size:"sm",onClick:()=>R(L.id),disabled:b===L.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(Io,{className:"w-4 h-4 mr-1"}),"批准"]}),e.jsxs(q,{size:"sm",variant:"outline",onClick:()=>G(L.id),disabled:b===L.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[e.jsx(xs,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(L.status==="success"||L.status==="completed")&&L.transactionId&&e.jsx("span",{className:"text-xs text-gray-500 font-mono",children:L.transactionId})]})]},L.id))})]})}),e.jsx(Gs,{page:g,totalPages:j,total:T,pageSize:k,onPageChange:v,onPageSizeChange:L=>{P(L),v(1)}})]})})})]})}const y4=["top","right","bottom","left"],pn=Math.min,Cs=Math.max,So=Math.round,co=Math.floor,or=r=>({x:r,y:r}),v4={left:"right",right:"left",bottom:"top",top:"bottom"},j4={start:"end",end:"start"};function fu(r,a,l){return Cs(r,pn(a,l))}function Pr(r,a){return typeof r=="function"?r(a):r}function Tr(r){return r.split("-")[0]}function qa(r){return r.split("-")[1]}function Ku(r){return r==="x"?"y":"x"}function Gu(r){return r==="y"?"height":"width"}const b4=new Set(["top","bottom"]);function ir(r){return b4.has(Tr(r))?"y":"x"}function Yu(r){return Ku(ir(r))}function N4(r,a,l){l===void 0&&(l=!1);const i=qa(r),c=Yu(r),d=Gu(c);let m=c==="x"?i===(l?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(m=Co(m)),[m,Co(m)]}function w4(r){const a=Co(r);return[xu(r),a,xu(a)]}function xu(r){return r.replace(/start|end/g,a=>j4[a])}const gx=["left","right"],yx=["right","left"],S4=["top","bottom"],C4=["bottom","top"];function k4(r,a,l){switch(r){case"top":case"bottom":return l?a?yx:gx:a?gx:yx;case"left":case"right":return a?S4:C4;default:return[]}}function E4(r,a,l,i){const c=qa(r);let d=k4(Tr(r),l==="start",i);return c&&(d=d.map(m=>m+"-"+c),a&&(d=d.concat(d.map(xu)))),d}function Co(r){return r.replace(/left|right|bottom|top/g,a=>v4[a])}function P4(r){return{top:0,right:0,bottom:0,left:0,...r}}function V0(r){return typeof r!="number"?P4(r):{top:r,right:r,bottom:r,left:r}}function ko(r){const{x:a,y:l,width:i,height:c}=r;return{width:i,height:c,top:l,left:a,right:a+i,bottom:l+c,x:a,y:l}}function vx(r,a,l){let{reference:i,floating:c}=r;const d=ir(a),m=Yu(a),f=Gu(m),p=Tr(a),y=d==="y",g=i.x+i.width/2-c.width/2,v=i.y+i.height/2-c.height/2,k=i[f]/2-c[f]/2;let P;switch(p){case"top":P={x:g,y:i.y-c.height};break;case"bottom":P={x:g,y:i.y+i.height};break;case"right":P={x:i.x+i.width,y:v};break;case"left":P={x:i.x-c.width,y:v};break;default:P={x:i.x,y:i.y}}switch(qa(a)){case"start":P[m]-=k*(l&&y?-1:1);break;case"end":P[m]+=k*(l&&y?-1:1);break}return P}async function T4(r,a){var l;a===void 0&&(a={});const{x:i,y:c,platform:d,rects:m,elements:f,strategy:p}=r,{boundary:y="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:k=!1,padding:P=0}=Pr(a,r),T=V0(P),b=f[k?v==="floating"?"reference":"floating":v],C=ko(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(b)))==null||l?b:b.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(f.floating)),boundary:y,rootBoundary:g,strategy:p})),E=v==="floating"?{x:i,y:c,width:m.floating.width,height:m.floating.height}:m.reference,j=await(d.getOffsetParent==null?void 0:d.getOffsetParent(f.floating)),R=await(d.isElement==null?void 0:d.isElement(j))?await(d.getScale==null?void 0:d.getScale(j))||{x:1,y:1}:{x:1,y:1},G=ko(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:E,offsetParent:j,strategy:p}):E);return{top:(C.top-G.top+T.top)/R.y,bottom:(G.bottom-C.bottom+T.bottom)/R.y,left:(C.left-G.left+T.left)/R.x,right:(G.right-C.right+T.right)/R.x}}const R4=async(r,a,l)=>{const{placement:i="bottom",strategy:c="absolute",middleware:d=[],platform:m}=l,f=d.filter(Boolean),p=await(m.isRTL==null?void 0:m.isRTL(a));let y=await m.getElementRects({reference:r,floating:a,strategy:c}),{x:g,y:v}=vx(y,i,p),k=i,P={},T=0;for(let b=0;b({name:"arrow",options:r,async fn(a){const{x:l,y:i,placement:c,rects:d,platform:m,elements:f,middlewareData:p}=a,{element:y,padding:g=0}=Pr(r,a)||{};if(y==null)return{};const v=V0(g),k={x:l,y:i},P=Yu(c),T=Gu(P),N=await m.getDimensions(y),b=P==="y",C=b?"top":"left",E=b?"bottom":"right",j=b?"clientHeight":"clientWidth",R=d.reference[T]+d.reference[P]-k[P]-d.floating[T],G=k[P]-d.reference[P],J=await(m.getOffsetParent==null?void 0:m.getOffsetParent(y));let L=J?J[j]:0;(!L||!await(m.isElement==null?void 0:m.isElement(J)))&&(L=f.floating[j]||d.floating[T]);const I=R/2-G/2,w=L/2-N[T]/2-1,V=pn(v[C],w),te=pn(v[E],w),ie=V,Y=L-N[T]-te,ne=L/2-N[T]/2+I,_=fu(ie,ne,Y),Q=!p.arrow&&qa(c)!=null&&ne!==_&&d.reference[T]/2-(nene<=0)){var te,ie;const ne=(((te=d.flip)==null?void 0:te.index)||0)+1,_=L[ne];if(_&&(!(v==="alignment"?E!==ir(_):!1)||V.every(O=>ir(O.placement)===E?O.overflows[0]>0:!0)))return{data:{index:ne,overflows:V},reset:{placement:_}};let Q=(ie=V.filter(ue=>ue.overflows[0]<=0).sort((ue,O)=>ue.overflows[1]-O.overflows[1])[0])==null?void 0:ie.placement;if(!Q)switch(P){case"bestFit":{var Y;const ue=(Y=V.filter(O=>{if(J){const re=ir(O.placement);return re===E||re==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(re=>re>0).reduce((re,H)=>re+H,0)]).sort((O,re)=>O[1]-re[1])[0])==null?void 0:Y[0];ue&&(Q=ue);break}case"initialPlacement":Q=f;break}if(c!==Q)return{reset:{placement:Q}}}return{}}}};function jx(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function bx(r){return y4.some(a=>r[a]>=0)}const M4=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:i}=a,{strategy:c="referenceHidden",...d}=Pr(r,a);switch(c){case"referenceHidden":{const m=await i.detectOverflow(a,{...d,elementContext:"reference"}),f=jx(m,l.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:bx(f)}}}case"escaped":{const m=await i.detectOverflow(a,{...d,altBoundary:!0}),f=jx(m,l.floating);return{data:{escapedOffsets:f,escaped:bx(f)}}}default:return{}}}}},W0=new Set(["left","top"]);async function A4(r,a){const{placement:l,platform:i,elements:c}=r,d=await(i.isRTL==null?void 0:i.isRTL(c.floating)),m=Tr(l),f=qa(l),p=ir(l)==="y",y=W0.has(m)?-1:1,g=d&&p?-1:1,v=Pr(a,r);let{mainAxis:k,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),p?{x:P*g,y:k*y}:{x:k*y,y:P*g}}const D4=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,i;const{x:c,y:d,placement:m,middlewareData:f}=a,p=await A4(a,r);return m===((l=f.offset)==null?void 0:l.placement)&&(i=f.arrow)!=null&&i.alignmentOffset?{}:{x:c+p.x,y:d+p.y,data:{...p,placement:m}}}}},L4=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:i,placement:c,platform:d}=a,{mainAxis:m=!0,crossAxis:f=!1,limiter:p={fn:C=>{let{x:E,y:j}=C;return{x:E,y:j}}},...y}=Pr(r,a),g={x:l,y:i},v=await d.detectOverflow(a,y),k=ir(Tr(c)),P=Ku(k);let T=g[P],N=g[k];if(m){const C=P==="y"?"top":"left",E=P==="y"?"bottom":"right",j=T+v[C],R=T-v[E];T=fu(j,T,R)}if(f){const C=k==="y"?"top":"left",E=k==="y"?"bottom":"right",j=N+v[C],R=N-v[E];N=fu(j,N,R)}const b=p.fn({...a,[P]:T,[k]:N});return{...b,data:{x:b.x-l,y:b.y-i,enabled:{[P]:m,[k]:f}}}}}},O4=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:i,placement:c,rects:d,middlewareData:m}=a,{offset:f=0,mainAxis:p=!0,crossAxis:y=!0}=Pr(r,a),g={x:l,y:i},v=ir(c),k=Ku(v);let P=g[k],T=g[v];const N=Pr(f,a),b=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:0,crossAxis:0,...N};if(p){const j=k==="y"?"height":"width",R=d.reference[k]-d.floating[j]+b.mainAxis,G=d.reference[k]+d.reference[j]-b.mainAxis;PG&&(P=G)}if(y){var C,E;const j=k==="y"?"width":"height",R=W0.has(Tr(c)),G=d.reference[v]-d.floating[j]+(R&&((C=m.offset)==null?void 0:C[v])||0)+(R?0:b.crossAxis),J=d.reference[v]+d.reference[j]+(R?0:((E=m.offset)==null?void 0:E[v])||0)-(R?b.crossAxis:0);TJ&&(T=J)}return{[k]:P,[v]:T}}}},F4=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,i;const{placement:c,rects:d,platform:m,elements:f}=a,{apply:p=()=>{},...y}=Pr(r,a),g=await m.detectOverflow(a,y),v=Tr(c),k=qa(c),P=ir(c)==="y",{width:T,height:N}=d.floating;let b,C;v==="top"||v==="bottom"?(b=v,C=k===(await(m.isRTL==null?void 0:m.isRTL(f.floating))?"start":"end")?"left":"right"):(C=v,b=k==="end"?"top":"bottom");const E=N-g.top-g.bottom,j=T-g.left-g.right,R=pn(N-g[b],E),G=pn(T-g[C],j),J=!a.middlewareData.shift;let L=R,I=G;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(I=j),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(L=E),J&&!k){const V=Cs(g.left,0),te=Cs(g.right,0),ie=Cs(g.top,0),Y=Cs(g.bottom,0);P?I=T-2*(V!==0||te!==0?V+te:Cs(g.left,g.right)):L=N-2*(ie!==0||Y!==0?ie+Y:Cs(g.top,g.bottom))}await p({...a,availableWidth:I,availableHeight:L});const w=await m.getDimensions(f.floating);return T!==w.width||N!==w.height?{reset:{rects:!0}}:{}}}};function zo(){return typeof window<"u"}function Xa(r){return H0(r)?(r.nodeName||"").toLowerCase():"#document"}function ks(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function dr(r){var a;return(a=(H0(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function H0(r){return zo()?r instanceof Node||r instanceof ks(r).Node:!1}function Ys(r){return zo()?r instanceof Element||r instanceof ks(r).Element:!1}function cr(r){return zo()?r instanceof HTMLElement||r instanceof ks(r).HTMLElement:!1}function Nx(r){return!zo()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof ks(r).ShadowRoot}const z4=new Set(["inline","contents"]);function ql(r){const{overflow:a,overflowX:l,overflowY:i,display:c}=Qs(r);return/auto|scroll|overlay|hidden|clip/.test(a+i+l)&&!z4.has(c)}const $4=new Set(["table","td","th"]);function B4(r){return $4.has(Xa(r))}const U4=[":popover-open",":modal"];function $o(r){return U4.some(a=>{try{return r.matches(a)}catch{return!1}})}const V4=["transform","translate","scale","rotate","perspective"],W4=["transform","translate","scale","rotate","perspective","filter"],H4=["paint","layout","strict","content"];function Qu(r){const a=qu(),l=Ys(r)?Qs(r):r;return V4.some(i=>l[i]?l[i]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||W4.some(i=>(l.willChange||"").includes(i))||H4.some(i=>(l.contain||"").includes(i))}function K4(r){let a=gn(r);for(;cr(a)&&!Va(a);){if(Qu(a))return a;if($o(a))return null;a=gn(a)}return null}function qu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const G4=new Set(["html","body","#document"]);function Va(r){return G4.has(Xa(r))}function Qs(r){return ks(r).getComputedStyle(r)}function Bo(r){return Ys(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function gn(r){if(Xa(r)==="html")return r;const a=r.assignedSlot||r.parentNode||Nx(r)&&r.host||dr(r);return Nx(a)?a.host:a}function K0(r){const a=gn(r);return Va(a)?r.ownerDocument?r.ownerDocument.body:r.body:cr(a)&&ql(a)?a:K0(a)}function Hl(r,a,l){var i;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=K0(r),d=c===((i=r.ownerDocument)==null?void 0:i.body),m=ks(c);if(d){const f=pu(m);return a.concat(m,m.visualViewport||[],ql(c)?c:[],f&&l?Hl(f):[])}return a.concat(c,Hl(c,[],l))}function pu(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function G0(r){const a=Qs(r);let l=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const c=cr(r),d=c?r.offsetWidth:l,m=c?r.offsetHeight:i,f=So(l)!==d||So(i)!==m;return f&&(l=d,i=m),{width:l,height:i,$:f}}function Xu(r){return Ys(r)?r:r.contextElement}function $a(r){const a=Xu(r);if(!cr(a))return or(1);const l=a.getBoundingClientRect(),{width:i,height:c,$:d}=G0(a);let m=(d?So(l.width):l.width)/i,f=(d?So(l.height):l.height)/c;return(!m||!Number.isFinite(m))&&(m=1),(!f||!Number.isFinite(f))&&(f=1),{x:m,y:f}}const Y4=or(0);function Y0(r){const a=ks(r);return!qu()||!a.visualViewport?Y4:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function Q4(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==ks(r)?!1:a}function ea(r,a,l,i){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),d=Xu(r);let m=or(1);a&&(i?Ys(i)&&(m=$a(i)):m=$a(r));const f=Q4(d,l,i)?Y0(d):or(0);let p=(c.left+f.x)/m.x,y=(c.top+f.y)/m.y,g=c.width/m.x,v=c.height/m.y;if(d){const k=ks(d),P=i&&Ys(i)?ks(i):i;let T=k,N=pu(T);for(;N&&i&&P!==T;){const b=$a(N),C=N.getBoundingClientRect(),E=Qs(N),j=C.left+(N.clientLeft+parseFloat(E.paddingLeft))*b.x,R=C.top+(N.clientTop+parseFloat(E.paddingTop))*b.y;p*=b.x,y*=b.y,g*=b.x,v*=b.y,p+=j,y+=R,T=ks(N),N=pu(T)}}return ko({width:g,height:v,x:p,y})}function Uo(r,a){const l=Bo(r).scrollLeft;return a?a.left+l:ea(dr(r)).left+l}function Q0(r,a){const l=r.getBoundingClientRect(),i=l.left+a.scrollLeft-Uo(r,l),c=l.top+a.scrollTop;return{x:i,y:c}}function q4(r){let{elements:a,rect:l,offsetParent:i,strategy:c}=r;const d=c==="fixed",m=dr(i),f=a?$o(a.floating):!1;if(i===m||f&&d)return l;let p={scrollLeft:0,scrollTop:0},y=or(1);const g=or(0),v=cr(i);if((v||!v&&!d)&&((Xa(i)!=="body"||ql(m))&&(p=Bo(i)),cr(i))){const P=ea(i);y=$a(i),g.x=P.x+i.clientLeft,g.y=P.y+i.clientTop}const k=m&&!v&&!d?Q0(m,p):or(0);return{width:l.width*y.x,height:l.height*y.y,x:l.x*y.x-p.scrollLeft*y.x+g.x+k.x,y:l.y*y.y-p.scrollTop*y.y+g.y+k.y}}function X4(r){return Array.from(r.getClientRects())}function J4(r){const a=dr(r),l=Bo(r),i=r.ownerDocument.body,c=Cs(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),d=Cs(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let m=-l.scrollLeft+Uo(r);const f=-l.scrollTop;return Qs(i).direction==="rtl"&&(m+=Cs(a.clientWidth,i.clientWidth)-c),{width:c,height:d,x:m,y:f}}const wx=25;function Z4(r,a){const l=ks(r),i=dr(r),c=l.visualViewport;let d=i.clientWidth,m=i.clientHeight,f=0,p=0;if(c){d=c.width,m=c.height;const g=qu();(!g||g&&a==="fixed")&&(f=c.offsetLeft,p=c.offsetTop)}const y=Uo(i);if(y<=0){const g=i.ownerDocument,v=g.body,k=getComputedStyle(v),P=g.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,T=Math.abs(i.clientWidth-v.clientWidth-P);T<=wx&&(d-=T)}else y<=wx&&(d+=y);return{width:d,height:m,x:f,y:p}}const eS=new Set(["absolute","fixed"]);function tS(r,a){const l=ea(r,!0,a==="fixed"),i=l.top+r.clientTop,c=l.left+r.clientLeft,d=cr(r)?$a(r):or(1),m=r.clientWidth*d.x,f=r.clientHeight*d.y,p=c*d.x,y=i*d.y;return{width:m,height:f,x:p,y}}function Sx(r,a,l){let i;if(a==="viewport")i=Z4(r,l);else if(a==="document")i=J4(dr(r));else if(Ys(a))i=tS(a,l);else{const c=Y0(r);i={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return ko(i)}function q0(r,a){const l=gn(r);return l===a||!Ys(l)||Va(l)?!1:Qs(l).position==="fixed"||q0(l,a)}function sS(r,a){const l=a.get(r);if(l)return l;let i=Hl(r,[],!1).filter(f=>Ys(f)&&Xa(f)!=="body"),c=null;const d=Qs(r).position==="fixed";let m=d?gn(r):r;for(;Ys(m)&&!Va(m);){const f=Qs(m),p=Qu(m);!p&&f.position==="fixed"&&(c=null),(d?!p&&!c:!p&&f.position==="static"&&!!c&&eS.has(c.position)||ql(m)&&!p&&q0(r,m))?i=i.filter(g=>g!==m):c=f,m=gn(m)}return a.set(r,i),i}function rS(r){let{element:a,boundary:l,rootBoundary:i,strategy:c}=r;const m=[...l==="clippingAncestors"?$o(a)?[]:sS(a,this._c):[].concat(l),i],f=m[0],p=m.reduce((y,g)=>{const v=Sx(a,g,c);return y.top=Cs(v.top,y.top),y.right=pn(v.right,y.right),y.bottom=pn(v.bottom,y.bottom),y.left=Cs(v.left,y.left),y},Sx(a,f,c));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function nS(r){const{width:a,height:l}=G0(r);return{width:a,height:l}}function aS(r,a,l){const i=cr(a),c=dr(a),d=l==="fixed",m=ea(r,!0,d,a);let f={scrollLeft:0,scrollTop:0};const p=or(0);function y(){p.x=Uo(c)}if(i||!i&&!d)if((Xa(a)!=="body"||ql(c))&&(f=Bo(a)),i){const P=ea(a,!0,d,a);p.x=P.x+a.clientLeft,p.y=P.y+a.clientTop}else c&&y();d&&!i&&c&&y();const g=c&&!i&&!d?Q0(c,f):or(0),v=m.left+f.scrollLeft-p.x-g.x,k=m.top+f.scrollTop-p.y-g.y;return{x:v,y:k,width:m.width,height:m.height}}function Gd(r){return Qs(r).position==="static"}function Cx(r,a){if(!cr(r)||Qs(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return dr(r)===l&&(l=l.ownerDocument.body),l}function X0(r,a){const l=ks(r);if($o(r))return l;if(!cr(r)){let c=gn(r);for(;c&&!Va(c);){if(Ys(c)&&!Gd(c))return c;c=gn(c)}return l}let i=Cx(r,a);for(;i&&B4(i)&&Gd(i);)i=Cx(i,a);return i&&Va(i)&&Gd(i)&&!Qu(i)?l:i||K4(r)||l}const lS=async function(r){const a=this.getOffsetParent||X0,l=this.getDimensions,i=await l(r.floating);return{reference:aS(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function iS(r){return Qs(r).direction==="rtl"}const oS={convertOffsetParentRelativeRectToViewportRelativeRect:q4,getDocumentElement:dr,getClippingRect:rS,getOffsetParent:X0,getElementRects:lS,getClientRects:X4,getDimensions:nS,getScale:$a,isElement:Ys,isRTL:iS};function J0(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function cS(r,a){let l=null,i;const c=dr(r);function d(){var f;clearTimeout(i),(f=l)==null||f.disconnect(),l=null}function m(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),d();const y=r.getBoundingClientRect(),{left:g,top:v,width:k,height:P}=y;if(f||a(),!k||!P)return;const T=co(v),N=co(c.clientWidth-(g+k)),b=co(c.clientHeight-(v+P)),C=co(g),j={rootMargin:-T+"px "+-N+"px "+-b+"px "+-C+"px",threshold:Cs(0,pn(1,p))||1};let R=!0;function G(J){const L=J[0].intersectionRatio;if(L!==p){if(!R)return m();L?m(!1,L):i=setTimeout(()=>{m(!1,1e-7)},1e3)}L===1&&!J0(y,r.getBoundingClientRect())&&m(),R=!1}try{l=new IntersectionObserver(G,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(G,j)}l.observe(r)}return m(!0),d}function dS(r,a,l,i){i===void 0&&(i={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:p=!1}=i,y=Xu(r),g=c||d?[...y?Hl(y):[],...Hl(a)]:[];g.forEach(C=>{c&&C.addEventListener("scroll",l,{passive:!0}),d&&C.addEventListener("resize",l)});const v=y&&f?cS(y,l):null;let k=-1,P=null;m&&(P=new ResizeObserver(C=>{let[E]=C;E&&E.target===y&&P&&(P.unobserve(a),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var j;(j=P)==null||j.observe(a)})),l()}),y&&!p&&P.observe(y),P.observe(a));let T,N=p?ea(r):null;p&&b();function b(){const C=ea(r);N&&!J0(N,C)&&l(),N=C,T=requestAnimationFrame(b)}return l(),()=>{var C;g.forEach(E=>{c&&E.removeEventListener("scroll",l),d&&E.removeEventListener("resize",l)}),v==null||v(),(C=P)==null||C.disconnect(),P=null,p&&cancelAnimationFrame(T)}}const uS=D4,hS=L4,mS=_4,fS=F4,xS=M4,kx=I4,pS=O4,gS=(r,a,l)=>{const i=new Map,c={platform:oS,...l},d={...c.platform,_c:i};return R4(r,a,{...c,platform:d})};var yS=typeof document<"u",vS=function(){},xo=yS?u.useLayoutEffect:vS;function Eo(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,i,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(i=l;i--!==0;)if(!Eo(r[i],a[i]))return!1;return!0}if(c=Object.keys(r),l=c.length,l!==Object.keys(a).length)return!1;for(i=l;i--!==0;)if(!{}.hasOwnProperty.call(a,c[i]))return!1;for(i=l;i--!==0;){const d=c[i];if(!(d==="_owner"&&r.$$typeof)&&!Eo(r[d],a[d]))return!1}return!0}return r!==r&&a!==a}function Z0(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function Ex(r,a){const l=Z0(r);return Math.round(a*l)/l}function Yd(r){const a=u.useRef(r);return xo(()=>{a.current=r}),a}function jS(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:i=[],platform:c,elements:{reference:d,floating:m}={},transform:f=!0,whileElementsMounted:p,open:y}=r,[g,v]=u.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[k,P]=u.useState(i);Eo(k,i)||P(i);const[T,N]=u.useState(null),[b,C]=u.useState(null),E=u.useCallback(O=>{O!==J.current&&(J.current=O,N(O))},[]),j=u.useCallback(O=>{O!==L.current&&(L.current=O,C(O))},[]),R=d||T,G=m||b,J=u.useRef(null),L=u.useRef(null),I=u.useRef(g),w=p!=null,V=Yd(p),te=Yd(c),ie=Yd(y),Y=u.useCallback(()=>{if(!J.current||!L.current)return;const O={placement:a,strategy:l,middleware:k};te.current&&(O.platform=te.current),gS(J.current,L.current,O).then(re=>{const H={...re,isPositioned:ie.current!==!1};ne.current&&!Eo(I.current,H)&&(I.current=H,Kl.flushSync(()=>{v(H)}))})},[k,a,l,te,ie]);xo(()=>{y===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,v(O=>({...O,isPositioned:!1})))},[y]);const ne=u.useRef(!1);xo(()=>(ne.current=!0,()=>{ne.current=!1}),[]),xo(()=>{if(R&&(J.current=R),G&&(L.current=G),R&&G){if(V.current)return V.current(R,G,Y);Y()}},[R,G,Y,V,w]);const _=u.useMemo(()=>({reference:J,floating:L,setReference:E,setFloating:j}),[E,j]),Q=u.useMemo(()=>({reference:R,floating:G}),[R,G]),ue=u.useMemo(()=>{const O={position:l,left:0,top:0};if(!Q.floating)return O;const re=Ex(Q.floating,g.x),H=Ex(Q.floating,g.y);return f?{...O,transform:"translate("+re+"px, "+H+"px)",...Z0(Q.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:re,top:H}},[l,f,Q.floating,g.x,g.y]);return u.useMemo(()=>({...g,update:Y,refs:_,elements:Q,floatingStyles:ue}),[g,Y,_,Q,ue])}const bS=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:i,padding:c}=typeof r=="function"?r(l):r;return i&&a(i)?i.current!=null?kx({element:i.current,padding:c}).fn(l):{}:i?kx({element:i,padding:c}).fn(l):{}}}},NS=(r,a)=>({...uS(r),options:[r,a]}),wS=(r,a)=>({...hS(r),options:[r,a]}),SS=(r,a)=>({...pS(r),options:[r,a]}),CS=(r,a)=>({...mS(r),options:[r,a]}),kS=(r,a)=>({...fS(r),options:[r,a]}),ES=(r,a)=>({...xS(r),options:[r,a]}),PS=(r,a)=>({...bS(r),options:[r,a]});var TS="Arrow",eg=u.forwardRef((r,a)=>{const{children:l,width:i=10,height:c=5,...d}=r;return e.jsx(Je.svg,{...d,ref:a,width:i,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});eg.displayName=TS;var RS=eg,Ju="Popper",[tg,sg]=bn(Ju),[IS,rg]=tg(Ju),ng=r=>{const{__scopePopper:a,children:l}=r,[i,c]=u.useState(null);return e.jsx(IS,{scope:a,anchor:i,onAnchorChange:c,children:l})};ng.displayName=Ju;var ag="PopperAnchor",lg=u.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:i,...c}=r,d=rg(ag,l),m=u.useRef(null),f=it(a,m),p=u.useRef(null);return u.useEffect(()=>{const y=p.current;p.current=(i==null?void 0:i.current)||m.current,y!==p.current&&d.onAnchorChange(p.current)}),i?null:e.jsx(Je.div,{...c,ref:f})});lg.displayName=ag;var Zu="PopperContent",[_S,MS]=tg(Zu),ig=u.forwardRef((r,a)=>{var X,ye,Ce,z,xe,Pe;const{__scopePopper:l,side:i="bottom",sideOffset:c=0,align:d="center",alignOffset:m=0,arrowPadding:f=0,avoidCollisions:p=!0,collisionBoundary:y=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:k=!1,updatePositionStrategy:P="optimized",onPlaced:T,...N}=r,b=rg(Zu,l),[C,E]=u.useState(null),j=it(a,Ve=>E(Ve)),[R,G]=u.useState(null),J=Wu(R),L=(J==null?void 0:J.width)??0,I=(J==null?void 0:J.height)??0,w=i+(d!=="center"?"-"+d:""),V=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},te=Array.isArray(y)?y:[y],ie=te.length>0,Y={padding:V,boundary:te.filter(DS),altBoundary:ie},{refs:ne,floatingStyles:_,placement:Q,isPositioned:ue,middlewareData:O}=jS({strategy:"fixed",placement:w,whileElementsMounted:(...Ve)=>dS(...Ve,{animationFrame:P==="always"}),elements:{reference:b.anchor},middleware:[NS({mainAxis:c+I,alignmentAxis:m}),p&&wS({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?SS():void 0,...Y}),p&&CS({...Y}),kS({...Y,apply:({elements:Ve,rects:He,availableWidth:Ke,availableHeight:tt})=>{const{width:$e,height:me}=He.reference,pe=Ve.floating.style;pe.setProperty("--radix-popper-available-width",`${Ke}px`),pe.setProperty("--radix-popper-available-height",`${tt}px`),pe.setProperty("--radix-popper-anchor-width",`${$e}px`),pe.setProperty("--radix-popper-anchor-height",`${me}px`)}}),R&&PS({element:R,padding:f}),LS({arrowWidth:L,arrowHeight:I}),k&&ES({strategy:"referenceHidden",...Y})]}),[re,H]=dg(Q),A=xn(T);ts(()=>{ue&&(A==null||A())},[ue,A]);const $=(X=O.arrow)==null?void 0:X.x,F=(ye=O.arrow)==null?void 0:ye.y,ee=((Ce=O.arrow)==null?void 0:Ce.centerOffset)!==0,[K,de]=u.useState();return ts(()=>{C&&de(window.getComputedStyle(C).zIndex)},[C]),e.jsx("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:ue?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(z=O.transformOrigin)==null?void 0:z.x,(xe=O.transformOrigin)==null?void 0:xe.y].join(" "),...((Pe=O.hide)==null?void 0:Pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:e.jsx(_S,{scope:l,placedSide:re,onArrowChange:G,arrowX:$,arrowY:F,shouldHideArrow:ee,children:e.jsx(Je.div,{"data-side":re,"data-align":H,...N,ref:j,style:{...N.style,animation:ue?void 0:"none"}})})})});ig.displayName=Zu;var og="PopperArrow",AS={top:"bottom",right:"left",bottom:"top",left:"right"},cg=u.forwardRef(function(a,l){const{__scopePopper:i,...c}=a,d=MS(og,i),m=AS[d.placedSide];return e.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:e.jsx(RS,{...c,ref:l,style:{...c.style,display:"block"}})})});cg.displayName=og;function DS(r){return r!==null}var LS=r=>({name:"transformOrigin",options:r,fn(a){var b,C,E;const{placement:l,rects:i,middlewareData:c}=a,m=((b=c.arrow)==null?void 0:b.centerOffset)!==0,f=m?0:r.arrowWidth,p=m?0:r.arrowHeight,[y,g]=dg(l),v={start:"0%",center:"50%",end:"100%"}[g],k=(((C=c.arrow)==null?void 0:C.x)??0)+f/2,P=(((E=c.arrow)==null?void 0:E.y)??0)+p/2;let T="",N="";return y==="bottom"?(T=m?v:`${k}px`,N=`${-p}px`):y==="top"?(T=m?v:`${k}px`,N=`${i.floating.height+p}px`):y==="right"?(T=`${-p}px`,N=m?v:`${P}px`):y==="left"&&(T=`${i.floating.width+p}px`,N=m?v:`${P}px`),{data:{x:T,y:N}}}});function dg(r){const[a,l="center"]=r.split("-");return[a,l]}var OS=ng,FS=lg,zS=ig,$S=cg,ug=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"}),BS="VisuallyHidden",US=u.forwardRef((r,a)=>e.jsx(Je.span,{...r,ref:a,style:{...ug,...r.style}}));US.displayName=BS;var VS=[" ","Enter","ArrowUp","ArrowDown"],WS=[" ","Enter"],ta="Select",[Vo,Wo,HS]=Bu(ta),[Ja]=bn(ta,[HS,sg]),Ho=sg(),[KS,Nn]=Ja(ta),[GS,YS]=Ja(ta),hg=r=>{const{__scopeSelect:a,children:l,open:i,defaultOpen:c,onOpenChange:d,value:m,defaultValue:f,onValueChange:p,dir:y,name:g,autoComplete:v,disabled:k,required:P,form:T}=r,N=Ho(a),[b,C]=u.useState(null),[E,j]=u.useState(null),[R,G]=u.useState(!1),J=Do(y),[L,I]=Xn({prop:i,defaultProp:c??!1,onChange:d,caller:ta}),[w,V]=Xn({prop:m,defaultProp:f,onChange:p,caller:ta}),te=u.useRef(null),ie=b?T||!!b.closest("form"):!0,[Y,ne]=u.useState(new Set),_=Array.from(Y).map(Q=>Q.props.value).join(";");return e.jsx(OS,{...N,children:e.jsxs(KS,{required:P,scope:a,trigger:b,onTriggerChange:C,valueNode:E,onValueNodeChange:j,valueNodeHasChildren:R,onValueNodeHasChildrenChange:G,contentId:mn(),value:w,onValueChange:V,open:L,onOpenChange:I,dir:J,triggerPointerDownPosRef:te,disabled:k,children:[e.jsx(Vo.Provider,{scope:a,children:e.jsx(GS,{scope:r.__scopeSelect,onNativeOptionAdd:u.useCallback(Q=>{ne(ue=>new Set(ue).add(Q))},[]),onNativeOptionRemove:u.useCallback(Q=>{ne(ue=>{const O=new Set(ue);return O.delete(Q),O})},[]),children:l})}),ie?e.jsxs(Ag,{"aria-hidden":!0,required:P,tabIndex:-1,name:g,autoComplete:v,value:w,onChange:Q=>V(Q.target.value),disabled:k,form:T,children:[w===void 0?e.jsx("option",{value:""}):null,Array.from(Y)]},_):null]})})};hg.displayName=ta;var mg="SelectTrigger",fg=u.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:i=!1,...c}=r,d=Ho(l),m=Nn(mg,l),f=m.disabled||i,p=it(a,m.onTriggerChange),y=Wo(l),g=u.useRef("touch"),[v,k,P]=Lg(N=>{const b=y().filter(j=>!j.disabled),C=b.find(j=>j.value===m.value),E=Og(b,N,C);E!==void 0&&m.onValueChange(E.value)}),T=N=>{f||(m.onOpenChange(!0),P()),N&&(m.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})};return e.jsx(FS,{asChild:!0,...d,children:e.jsx(Je.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":Dg(m.value)?"":void 0,...c,ref:p,onClick:Ye(c.onClick,N=>{N.currentTarget.focus(),g.current!=="mouse"&&T(N)}),onPointerDown:Ye(c.onPointerDown,N=>{g.current=N.pointerType;const b=N.target;b.hasPointerCapture(N.pointerId)&&b.releasePointerCapture(N.pointerId),N.button===0&&N.ctrlKey===!1&&N.pointerType==="mouse"&&(T(N),N.preventDefault())}),onKeyDown:Ye(c.onKeyDown,N=>{const b=v.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&k(N.key),!(b&&N.key===" ")&&VS.includes(N.key)&&(T(),N.preventDefault())})})})});fg.displayName=mg;var xg="SelectValue",pg=u.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,children:d,placeholder:m="",...f}=r,p=Nn(xg,l),{onValueNodeHasChildrenChange:y}=p,g=d!==void 0,v=it(a,p.onValueNodeChange);return ts(()=>{y(g)},[y,g]),e.jsx(Je.span,{...f,ref:v,style:{pointerEvents:"none"},children:Dg(p.value)?e.jsx(e.Fragment,{children:m}):d})});pg.displayName=xg;var QS="SelectIcon",gg=u.forwardRef((r,a)=>{const{__scopeSelect:l,children:i,...c}=r;return e.jsx(Je.span,{"aria-hidden":!0,...c,ref:a,children:i||"▼"})});gg.displayName=QS;var qS="SelectPortal",yg=r=>e.jsx(Du,{asChild:!0,...r});yg.displayName=qS;var sa="SelectContent",vg=u.forwardRef((r,a)=>{const l=Nn(sa,r.__scopeSelect),[i,c]=u.useState();if(ts(()=>{c(new DocumentFragment)},[]),!l.open){const d=i;return d?Kl.createPortal(e.jsx(jg,{scope:r.__scopeSelect,children:e.jsx(Vo.Slot,{scope:r.__scopeSelect,children:e.jsx("div",{children:r.children})})}),d):null}return e.jsx(bg,{...r,ref:a})});vg.displayName=sa;var Ks=10,[jg,wn]=Ja(sa),XS="SelectContentImpl",JS=Wl("SelectContent.RemoveScroll"),bg=u.forwardRef((r,a)=>{const{__scopeSelect:l,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:m,side:f,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:k,collisionPadding:P,sticky:T,hideWhenDetached:N,avoidCollisions:b,...C}=r,E=Nn(sa,l),[j,R]=u.useState(null),[G,J]=u.useState(null),L=it(a,X=>R(X)),[I,w]=u.useState(null),[V,te]=u.useState(null),ie=Wo(l),[Y,ne]=u.useState(!1),_=u.useRef(!1);u.useEffect(()=>{if(j)return Op(j)},[j]),Pp();const Q=u.useCallback(X=>{const[ye,...Ce]=ie().map(Pe=>Pe.ref.current),[z]=Ce.slice(-1),xe=document.activeElement;for(const Pe of X)if(Pe===xe||(Pe==null||Pe.scrollIntoView({block:"nearest"}),Pe===ye&&G&&(G.scrollTop=0),Pe===z&&G&&(G.scrollTop=G.scrollHeight),Pe==null||Pe.focus(),document.activeElement!==xe))return},[ie,G]),ue=u.useCallback(()=>Q([I,j]),[Q,I,j]);u.useEffect(()=>{Y&&ue()},[Y,ue]);const{onOpenChange:O,triggerPointerDownPosRef:re}=E;u.useEffect(()=>{if(j){let X={x:0,y:0};const ye=z=>{var xe,Pe;X={x:Math.abs(Math.round(z.pageX)-(((xe=re.current)==null?void 0:xe.x)??0)),y:Math.abs(Math.round(z.pageY)-(((Pe=re.current)==null?void 0:Pe.y)??0))}},Ce=z=>{X.x<=10&&X.y<=10?z.preventDefault():j.contains(z.target)||O(!1),document.removeEventListener("pointermove",ye),re.current=null};return re.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[j,O,re]),u.useEffect(()=>{const X=()=>O(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[O]);const[H,A]=Lg(X=>{const ye=ie().filter(xe=>!xe.disabled),Ce=ye.find(xe=>xe.ref.current===document.activeElement),z=Og(ye,X,Ce);z&&setTimeout(()=>z.ref.current.focus())}),$=u.useCallback((X,ye,Ce)=>{const z=!_.current&&!Ce;(E.value!==void 0&&E.value===ye||z)&&(w(X),z&&(_.current=!0))},[E.value]),F=u.useCallback(()=>j==null?void 0:j.focus(),[j]),ee=u.useCallback((X,ye,Ce)=>{const z=!_.current&&!Ce;(E.value!==void 0&&E.value===ye||z)&&te(X)},[E.value]),K=i==="popper"?gu:Ng,de=K===gu?{side:f,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:k,collisionPadding:P,sticky:T,hideWhenDetached:N,avoidCollisions:b}:{};return e.jsx(jg,{scope:l,content:j,viewport:G,onViewportChange:J,itemRefCallback:$,selectedItem:I,onItemLeave:F,itemTextRefCallback:ee,focusSelectedItem:ue,selectedItemText:V,position:i,isPositioned:Y,searchRef:H,children:e.jsx(Lu,{as:JS,allowPinchZoom:!0,children:e.jsx(Au,{asChild:!0,trapped:E.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:Ye(c,X=>{var ye;(ye=E.trigger)==null||ye.focus({preventScroll:!0}),X.preventDefault()}),children:e.jsx(Mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:e.jsx(K,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:X=>X.preventDefault(),...C,...de,onPlaced:()=>ne(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:Ye(C.onKeyDown,X=>{const ye=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!ye&&X.key.length===1&&A(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let z=ie().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(X.key)&&(z=z.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const xe=X.target,Pe=z.indexOf(xe);z=z.slice(Pe+1)}setTimeout(()=>Q(z)),X.preventDefault()}})})})})})})});bg.displayName=XS;var ZS="SelectItemAlignedPosition",Ng=u.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:i,...c}=r,d=Nn(sa,l),m=wn(sa,l),[f,p]=u.useState(null),[y,g]=u.useState(null),v=it(a,L=>g(L)),k=Wo(l),P=u.useRef(!1),T=u.useRef(!0),{viewport:N,selectedItem:b,selectedItemText:C,focusSelectedItem:E}=m,j=u.useCallback(()=>{if(d.trigger&&d.valueNode&&f&&y&&N&&b&&C){const L=d.trigger.getBoundingClientRect(),I=y.getBoundingClientRect(),w=d.valueNode.getBoundingClientRect(),V=C.getBoundingClientRect();if(d.dir!=="rtl"){const xe=V.left-I.left,Pe=w.left-xe,Ve=L.left-Pe,He=L.width+Ve,Ke=Math.max(He,I.width),tt=window.innerWidth-Ks,$e=wo(Pe,[Ks,Math.max(Ks,tt-Ke)]);f.style.minWidth=He+"px",f.style.left=$e+"px"}else{const xe=I.right-V.right,Pe=window.innerWidth-w.right-xe,Ve=window.innerWidth-L.right-Pe,He=L.width+Ve,Ke=Math.max(He,I.width),tt=window.innerWidth-Ks,$e=wo(Pe,[Ks,Math.max(Ks,tt-Ke)]);f.style.minWidth=He+"px",f.style.right=$e+"px"}const te=k(),ie=window.innerHeight-Ks*2,Y=N.scrollHeight,ne=window.getComputedStyle(y),_=parseInt(ne.borderTopWidth,10),Q=parseInt(ne.paddingTop,10),ue=parseInt(ne.borderBottomWidth,10),O=parseInt(ne.paddingBottom,10),re=_+Q+Y+O+ue,H=Math.min(b.offsetHeight*5,re),A=window.getComputedStyle(N),$=parseInt(A.paddingTop,10),F=parseInt(A.paddingBottom,10),ee=L.top+L.height/2-Ks,K=ie-ee,de=b.offsetHeight/2,X=b.offsetTop+de,ye=_+Q+X,Ce=re-ye;if(ye<=ee){const xe=te.length>0&&b===te[te.length-1].ref.current;f.style.bottom="0px";const Pe=y.clientHeight-N.offsetTop-N.offsetHeight,Ve=Math.max(K,de+(xe?F:0)+Pe+ue),He=ye+Ve;f.style.height=He+"px"}else{const xe=te.length>0&&b===te[0].ref.current;f.style.top="0px";const Ve=Math.max(ee,_+N.offsetTop+(xe?$:0)+de)+Ce;f.style.height=Ve+"px",N.scrollTop=ye-ee+N.offsetTop}f.style.margin=`${Ks}px 0`,f.style.minHeight=H+"px",f.style.maxHeight=ie+"px",i==null||i(),requestAnimationFrame(()=>P.current=!0)}},[k,d.trigger,d.valueNode,f,y,N,b,C,d.dir,i]);ts(()=>j(),[j]);const[R,G]=u.useState();ts(()=>{y&&G(window.getComputedStyle(y).zIndex)},[y]);const J=u.useCallback(L=>{L&&T.current===!0&&(j(),E==null||E(),T.current=!1)},[j,E]);return e.jsx(t3,{scope:l,contentWrapper:f,shouldExpandOnScrollRef:P,onScrollButtonChange:J,children:e.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:e.jsx(Je.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});Ng.displayName=ZS;var e3="SelectPopperPosition",gu=u.forwardRef((r,a)=>{const{__scopeSelect:l,align:i="start",collisionPadding:c=Ks,...d}=r,m=Ho(l);return e.jsx(zS,{...m,...d,ref:a,align:i,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});gu.displayName=e3;var[t3,eh]=Ja(sa,{}),yu="SelectViewport",wg=u.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:i,...c}=r,d=wn(yu,l),m=eh(yu,l),f=it(a,d.onViewportChange),p=u.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:i}),e.jsx(Vo.Slot,{scope:l,children:e.jsx(Je.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 g=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:k}=m;if(k!=null&&k.current&&v){const P=Math.abs(p.current-g.scrollTop);if(P>0){const T=window.innerHeight-Ks*2,N=parseFloat(v.style.minHeight),b=parseFloat(v.style.height),C=Math.max(N,b);if(C0?R:0,v.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})});wg.displayName=yu;var Sg="SelectGroup",[s3,r3]=Ja(Sg),n3=u.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=mn();return e.jsx(s3,{scope:l,id:c,children:e.jsx(Je.div,{role:"group","aria-labelledby":c,...i,ref:a})})});n3.displayName=Sg;var Cg="SelectLabel",a3=u.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=r3(Cg,l);return e.jsx(Je.div,{id:c.id,...i,ref:a})});a3.displayName=Cg;var Po="SelectItem",[l3,kg]=Ja(Po),Eg=u.forwardRef((r,a)=>{const{__scopeSelect:l,value:i,disabled:c=!1,textValue:d,...m}=r,f=Nn(Po,l),p=wn(Po,l),y=f.value===i,[g,v]=u.useState(d??""),[k,P]=u.useState(!1),T=it(a,E=>{var j;return(j=p.itemRefCallback)==null?void 0:j.call(p,E,i,c)}),N=mn(),b=u.useRef("touch"),C=()=>{c||(f.onValueChange(i),f.onOpenChange(!1))};if(i==="")throw new Error("A 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(l3,{scope:l,value:i,disabled:c,textId:N,isSelected:y,onItemTextChange:u.useCallback(E=>{v(j=>j||((E==null?void 0:E.textContent)??"").trim())},[]),children:e.jsx(Vo.ItemSlot,{scope:l,value:i,disabled:c,textValue:g,children:e.jsx(Je.div,{role:"option","aria-labelledby":N,"data-highlighted":k?"":void 0,"aria-selected":y&&k,"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,()=>{b.current!=="mouse"&&C()}),onPointerUp:Ye(m.onPointerUp,()=>{b.current==="mouse"&&C()}),onPointerDown:Ye(m.onPointerDown,E=>{b.current=E.pointerType}),onPointerMove:Ye(m.onPointerMove,E=>{var j;b.current=E.pointerType,c?(j=p.onItemLeave)==null||j.call(p):b.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ye(m.onPointerLeave,E=>{var j;E.currentTarget===document.activeElement&&((j=p.onItemLeave)==null||j.call(p))}),onKeyDown:Ye(m.onKeyDown,E=>{var R;((R=p.searchRef)==null?void 0:R.current)!==""&&E.key===" "||(WS.includes(E.key)&&C(),E.key===" "&&E.preventDefault())})})})})});Eg.displayName=Po;var Ll="SelectItemText",Pg=u.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,...d}=r,m=Nn(Ll,l),f=wn(Ll,l),p=kg(Ll,l),y=YS(Ll,l),[g,v]=u.useState(null),k=it(a,C=>v(C),p.onItemTextChange,C=>{var E;return(E=f.itemTextRefCallback)==null?void 0:E.call(f,C,p.value,p.disabled)}),P=g==null?void 0:g.textContent,T=u.useMemo(()=>e.jsx("option",{value:p.value,disabled:p.disabled,children:P},p.value),[p.disabled,p.value,P]),{onNativeOptionAdd:N,onNativeOptionRemove:b}=y;return ts(()=>(N(T),()=>b(T)),[N,b,T]),e.jsxs(e.Fragment,{children:[e.jsx(Je.span,{id:p.textId,...d,ref:k}),p.isSelected&&m.valueNode&&!m.valueNodeHasChildren?Kl.createPortal(d.children,m.valueNode):null]})});Pg.displayName=Ll;var Tg="SelectItemIndicator",Rg=u.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return kg(Tg,l).isSelected?e.jsx(Je.span,{"aria-hidden":!0,...i,ref:a}):null});Rg.displayName=Tg;var vu="SelectScrollUpButton",Ig=u.forwardRef((r,a)=>{const l=wn(vu,r.__scopeSelect),i=eh(vu,r.__scopeSelect),[c,d]=u.useState(!1),m=it(a,i.onScrollButtonChange);return ts(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=p.scrollTop>0;d(y)};const p=l.viewport;return f(),p.addEventListener("scroll",f),()=>p.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(Mg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:p}=l;f&&p&&(f.scrollTop=f.scrollTop-p.offsetHeight)}}):null});Ig.displayName=vu;var ju="SelectScrollDownButton",_g=u.forwardRef((r,a)=>{const l=wn(ju,r.__scopeSelect),i=eh(ju,r.__scopeSelect),[c,d]=u.useState(!1),m=it(a,i.onScrollButtonChange);return ts(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)p.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(Mg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:p}=l;f&&p&&(f.scrollTop=f.scrollTop+p.offsetHeight)}}):null});_g.displayName=ju;var Mg=u.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:i,...c}=r,d=wn("SelectScrollButton",l),m=u.useRef(null),f=Wo(l),p=u.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return u.useEffect(()=>()=>p(),[p]),ts(()=>{var g;const y=f().find(v=>v.ref.current===document.activeElement);(g=y==null?void 0:y.ref.current)==null||g.scrollIntoView({block:"nearest"})},[f]),e.jsx(Je.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Ye(c.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(i,50))}),onPointerMove:Ye(c.onPointerMove,()=>{var y;(y=d.onItemLeave)==null||y.call(d),m.current===null&&(m.current=window.setInterval(i,50))}),onPointerLeave:Ye(c.onPointerLeave,()=>{p()})})}),i3="SelectSeparator",o3=u.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return e.jsx(Je.div,{"aria-hidden":!0,...i,ref:a})});o3.displayName=i3;var bu="SelectArrow",c3=u.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=Ho(l),d=Nn(bu,l),m=wn(bu,l);return d.open&&m.position==="popper"?e.jsx($S,{...c,...i,ref:a}):null});c3.displayName=bu;var d3="SelectBubbleInput",Ag=u.forwardRef(({__scopeSelect:r,value:a,...l},i)=>{const c=u.useRef(null),d=it(i,c),m=Vu(a);return u.useEffect(()=>{const f=c.current;if(!f)return;const p=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(m!==a&&g){const v=new Event("change",{bubbles:!0});g.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(Je.select,{...l,style:{...ug,...l.style},ref:d,defaultValue:a})});Ag.displayName=d3;function Dg(r){return r===""||r===void 0}function Lg(r){const a=xn(r),l=u.useRef(""),i=u.useRef(0),c=u.useCallback(m=>{const f=l.current+m;a(f),(function p(y){l.current=y,window.clearTimeout(i.current),y!==""&&(i.current=window.setTimeout(()=>p(""),1e3))})(f)},[a]),d=u.useCallback(()=>{l.current="",window.clearTimeout(i.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(i.current),[]),[l,c,d]}function Og(r,a,l){const c=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a,d=l?r.indexOf(l):-1;let m=u3(r,Math.max(d,0));c.length===1&&(m=m.filter(y=>y!==l));const p=m.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return p!==l?p:void 0}function u3(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var h3=hg,Fg=fg,m3=pg,f3=gg,x3=yg,zg=vg,p3=wg,$g=Eg,g3=Pg,y3=Rg,v3=Ig,j3=_g;const uo=h3,ho=m3,Ol=u.forwardRef(({className:r,children:a,...l},i)=>e.jsxs(Fg,{ref:i,className:ot("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(f3,{asChild:!0,children:e.jsx(Ul,{className:"h-4 w-4 opacity-50"})})]}));Ol.displayName=Fg.displayName;const Fl=u.forwardRef(({className:r,children:a,position:l="popper",...i},c)=>e.jsx(x3,{children:e.jsxs(zg,{ref:c,className:ot("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,...i,children:[e.jsx(v3,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Zx,{className:"h-4 w-4"})}),e.jsx(p3,{className:"p-1",children:a}),e.jsx(j3,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Ul,{className:"h-4 w-4"})})]})}));Fl.displayName=zg.displayName;const Qn=u.forwardRef(({className:r,children:a,...l},i)=>e.jsxs($g,{ref:i,className:ot("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(y3,{children:e.jsx(Io,{className:"h-4 w-4"})})}),e.jsx(g3,{children:a})]}));Qn.displayName=$g.displayName;const b3=["一","二","三","四","五","六","七","八","九","十"];function Qd(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 N3({parts:r,expandedParts:a,onTogglePart:l,onReorder:i,onReadSection:c,onDeleteSection:d,onAddSectionInPart:m,onAddChapterInPart:f,onDeleteChapter:p,onEditPart:y,onDeletePart:g,onEditChapter:v,selectedSectionIds:k=[],onToggleSectionSelect:P,onShowSectionOrders:T}){const[N,b]=u.useState(null),[C,E]=u.useState(null),j=(w,V)=>(N==null?void 0:N.type)===w&&(N==null?void 0:N.id)===V,R=(w,V)=>(C==null?void 0:C.type)===w&&(C==null?void 0:C.id)===V,G=u.useCallback(()=>{const w=[];for(const V of r)for(const te of V.chapters)for(const ie of te.sections)w.push({id:ie.id,partId:V.id,partTitle:V.title,chapterId:te.id,chapterTitle:te.title});return w},[r]),J=u.useCallback(async(w,V,te,ie)=>{var ue;w.preventDefault(),w.stopPropagation();const Y=w.dataTransfer.getData("text/plain"),ne=Qd(Y);if(!ne||ne.type===V&&ne.id===te)return;const _=G(),Q=new Map(_.map(O=>[O.id,O]));if(ne.type==="part"&&V==="part"){const O=r.map(F=>F.id),re=O.indexOf(ne.id),H=O.indexOf(te);if(re===-1||H===-1)return;const A=[...O];A.splice(re,1),A.splice(reK.id===F);if(ee)for(const K of ee.chapters)for(const de of K.sections){const X=Q.get(de.id);X&&$.push(X)}}await i($);return}if(ne.type==="chapter"&&(V==="chapter"||V==="section"||V==="part")){const O=r.find(X=>X.chapters.some(ye=>ye.id===ne.id)),re=O==null?void 0:O.chapters.find(X=>X.id===ne.id);if(!O||!re)return;let H,A,$=null;if(V==="section"){const X=Q.get(te);if(!X)return;H=X.partId,A=X.partTitle,$=te}else if(V==="chapter"){const X=r.find(z=>z.chapters.some(xe=>xe.id===te)),ye=X==null?void 0:X.chapters.find(z=>z.id===te);if(!X||!ye)return;H=X.id,A=X.title;const Ce=_.filter(z=>z.chapterId===te).pop();$=(Ce==null?void 0:Ce.id)??null}else{const X=r.find(Ce=>Ce.id===te);if(!X||!X.chapters[0])return;H=X.id,A=X.title;const ye=_.filter(Ce=>Ce.partId===X.id&&Ce.chapterId===X.chapters[0].id);$=((ue=ye[ye.length-1])==null?void 0:ue.id)??null}const F=re.sections.map(X=>X.id),ee=_.filter(X=>!F.includes(X.id));let K=ee.length;if($){const X=ee.findIndex(ye=>ye.id===$);X>=0&&(K=X+1)}const de=F.map(X=>({...Q.get(X),partId:H,partTitle:A,chapterId:re.id,chapterTitle:re.title}));await i([...ee.slice(0,K),...de,...ee.slice(K)]);return}if(ne.type==="section"&&(V==="section"||V==="chapter"||V==="part")){if(!ie)return;const{partId:O,partTitle:re,chapterId:H,chapterTitle:A}=ie;let $;if(V==="section")$=_.findIndex(ye=>ye.id===te);else if(V==="chapter"){const ye=_.filter(Ce=>Ce.chapterId===te).pop();$=ye?_.findIndex(Ce=>Ce.id===ye.id)+1:_.length}else{const ye=r.find(xe=>xe.id===te);if(!(ye!=null&&ye.chapters[0]))return;const Ce=_.filter(xe=>xe.partId===ye.id&&xe.chapterId===ye.chapters[0].id),z=Ce[Ce.length-1];$=z?_.findIndex(xe=>xe.id===z.id)+1:0}const F=_.findIndex(ye=>ye.id===ne.id);if(F===-1)return;const ee=_.filter(ye=>ye.id!==ne.id),K=F<$?$-1:$,X={..._[F],partId:O,partTitle:re,chapterId:H,chapterTitle:A};ee.splice(K,0,X),await i(ee)}},[r,G,i]),L=(w,V,te)=>({onDragEnter:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",E({type:w,id:V})},onDragOver:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",E({type:w,id:V})},onDragLeave:()=>E(null),onDrop:ie=>{E(null);const Y=Qd(ie.dataTransfer.getData("text/plain"));if(Y&&!(w==="section"&&Y.type==="section"&&Y.id===V))if(w==="part")if(Y.type==="part")J(ie,"part",V);else{const ne=r.find(Q=>Q.id===V);(ne==null?void 0:ne.chapters[0])&&te&&J(ie,"part",V,te)}else w==="chapter"&&te?(Y.type==="section"||Y.type==="chapter")&&J(ie,"chapter",V,te):w==="section"&&te&&J(ie,"section",V,te)}}),I=w=>b3[w]??String(w+1);return e.jsx("div",{className:"space-y-3",children:r.map((w,V)=>{var re,H,A,$;const te=w.title==="序言"||w.title.includes("序言"),ie=w.title==="尾声"||w.title.includes("尾声"),Y=w.title==="附录"||w.title.includes("附录"),ne=R("part",w.id),_=a.includes(w.id),Q=w.chapters.length,ue=w.chapters.reduce((F,ee)=>F+ee.sections.length,0);if(te&&w.chapters.length===1&&w.chapters[0].sections.length===1){const F=w.chapters[0].sections[0],ee=R("section",F.id),K={partId:w.id,partTitle:w.title,chapterId:w.chapters[0].id,chapterTitle:w.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+F.id),de.dataTransfer.effectAllowed="move",b({type:"section",id:F.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${ee?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...L("section",F.id,K),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(br,{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:k.includes(F.id),onChange:()=>P(F.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(Fs,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[w.chapters[0].title," | ",F.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[F.price===0||F.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",F.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",F.clickCount??0," · 付款 ",F.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(F.hotScore??0).toFixed(1)," · 第",F.hotRank&&F.hotRank>0?F.hotRank:"-","名"]}),T&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(F),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),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(F),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:()=>d(F),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(wr,{className:"w-4 h-4 text-gray-500"})]})]},w.id)}if(w.title==="2026每日派对干货"||w.title.includes("2026每日派对干货")){const F=R("part",w.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${F?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,...L("part",w.id,{partId:w.id,partTitle:w.title,chapterId:((re=w.chapters[0])==null?void 0:re.id)??"",chapterTitle:((H=w.chapters[0])==null?void 0:H.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:ee=>{ee.stopPropagation(),ee.dataTransfer.setData("text/plain","part:"+w.id),ee.dataTransfer.effectAllowed="move",b({type:"part",id:w.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",w.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/50"}`,onClick:()=>l(w.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(br,{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:w.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ue," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:[m&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(w),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[Q,"章"]}),_?e.jsx(Ul,{className:"w-5 h-5 text-gray-500"}):e.jsx(wr,{className:"w-5 h-5 text-gray-500"})]})]}),_&&w.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:w.chapters.map(ee=>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:ee.title}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:K=>K.stopPropagation(),children:[v&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>v(w,ee),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(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>p(w,ee),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:ee.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","section:"+K.id),X.dataTransfer.effectAllowed="move",b({type:"section",id:K.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg min-h-[40px] cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...L("section",K.id,{partId:w.id,partTitle:w.title,chapterId:ee.id,chapterTitle:ee.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(br,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:X=>X.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:k.includes(K.id),onChange:()=>P(K.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:[K.id," ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),T&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(K),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(K),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(K),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:()=>d(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]},K.id)})})]},ee.id))})]},w.id)}if(Y)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:w.chapters.map((F,ee)=>F.sections.length>0?F.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","section:"+K.id),X.dataTransfer.effectAllowed="move",b({type:"section",id:K.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 group cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...L("section",K.id,{partId:w.id,partTitle:w.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(br,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:X=>X.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:k.includes(K.id),onChange:()=>P(K.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:["附录",ee+1," | ",F.title," | ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),T&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(K),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(K),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(K),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:()=>d(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(wr,{className:"w-4 h-4 text-gray-500 shrink-0"})]},K.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:["附录",ee+1," | ",F.title,"(空)"]}),e.jsx(wr,{className:"w-4 h-4 text-gray-500 shrink-0"})]},F.id))})]},w.id);if(ie&&w.chapters.length===1&&w.chapters[0].sections.length===1){const F=w.chapters[0].sections[0],ee=R("section",F.id),K={partId:w.id,partTitle:w.title,chapterId:w.chapters[0].id,chapterTitle:w.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+F.id),de.dataTransfer.effectAllowed="move",b({type:"section",id:F.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${ee?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...L("section",F.id,K),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(br,{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:k.includes(F.id),onChange:()=>P(F.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(Fs,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[w.chapters[0].title," | ",F.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[F.price===0||F.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",F.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",F.clickCount??0," · 付款 ",F.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(F.hotScore??0).toFixed(1)," · 第",F.hotRank&&F.hotRank>0?F.hotRank:"-","名"]}),T&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(F),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),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(F),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:()=>d(F),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(wr,{className:"w-4 h-4 text-gray-500"})]})]},w.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:w.chapters.map(F=>F.sections.map(ee=>{const K=R("section",ee.id);return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+ee.id),de.dataTransfer.effectAllowed="move",b({type:"section",id:ee.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${K?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",ee.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...L("section",ee.id,{partId:w.id,partTitle:w.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(br,{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:k.includes(ee.id),onChange:()=>P(ee.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300",children:[F.title," | ",ee.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",ee.clickCount??0," · 付款 ",ee.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(ee.hotScore??0).toFixed(1)," · 第",ee.hotRank&&ee.hotRank>0?ee.hotRank:"-","名"]}),T&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(ee),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(ee),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(ee),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:()=>d(ee),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]})]},ee.id)}))})]},w.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${ne?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...L("part",w.id,{partId:w.id,partTitle:w.title,chapterId:((A=w.chapters[0])==null?void 0:A.id)??"",chapterTitle:(($=w.chapters[0])==null?void 0:$.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:F=>{F.stopPropagation(),F.dataTransfer.setData("text/plain","part:"+w.id),F.dataTransfer.effectAllowed="move",b({type:"part",id:w.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",w.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(w.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(br,{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:I(V)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:w.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ue," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:F=>F.stopPropagation(),onClick:F=>F.stopPropagation(),children:[m&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(q,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(w),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[Q,"章"]}),_?e.jsx(Ul,{className:"w-5 h-5 text-gray-500"}):e.jsx(wr,{className:"w-5 h-5 text-gray-500"})]})]}),_&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:w.chapters.map(F=>{const ee=R("chapter",F.id);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","chapter:"+F.id),K.dataTransfer.effectAllowed="move",b({type:"chapter",id:F.id})},onDragEnd:()=>{b(null),E(null)},onDragEnter:K=>{K.preventDefault(),K.stopPropagation(),K.dataTransfer.dropEffect="move",E({type:"chapter",id:F.id})},onDragOver:K=>{K.preventDefault(),K.stopPropagation(),K.dataTransfer.dropEffect="move",E({type:"chapter",id:F.id})},onDragLeave:()=>E(null),onDrop:K=>{E(null);const de=Qd(K.dataTransfer.getData("text/plain"));if(!de)return;const X={partId:w.id,partTitle:w.title,chapterId:F.id,chapterTitle:F.title};(de.type==="section"||de.type==="chapter")&&J(K,"chapter",F.id,X)},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 ${ee?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[e.jsx(br,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:F.title})]}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:K=>K.stopPropagation(),children:[v&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>v(w,F),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(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>p(w,F),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:F.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","section:"+K.id),X.dataTransfer.effectAllowed="move",b({type:"section",id:K.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg group cursor-grab active:cursor-grabbing select-none min-h-[40px] transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...L("section",K.id,{partId:w.id,partTitle:w.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:X=>X.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:k.includes(K.id),onChange:()=>P(K.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx(br,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${K.price===0||K.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[K.id," ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:X=>X.stopPropagation(),onClick:X=>X.stopPropagation(),children:[K.isNew&&e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),K.price===0||K.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:["¥",K.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",title:"点击次数 · 付款笔数",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),T&&e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T(K),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(K),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(K),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:()=>d(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(wr,{className:"w-4 h-4 text-gray-500"})]})]},K.id)})})]},F.id)})})]},w.id)})})}function w3(r){const a=new Map;for(const f of r){const p=f.partId||"part-1",y=f.partTitle||"未分类",g=f.chapterId||"chapter-1",v=f.chapterTitle||"未分类";a.has(p)||a.set(p,{id:p,title:y,chapters:new Map});const k=a.get(p);k.chapters.has(g)||k.chapters.set(g,{id:g,title:v,sections:[]}),k.chapters.get(g).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",i="2026每日派对干货";Array.from(a.values()).some(f=>f.title===i||f.title.includes(i))||a.set(l,{id:l,title:i,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:i,sections:[]}]])});const d=Array.from(a.values()).map(f=>({...f,chapters:Array.from(f.chapters.values())})),m=f=>f.includes("序言")?0:f.includes(i)?1.5:f.includes("附录")?2:f.includes("尾声")?3:1;return d.sort((f,p)=>{const y=m(f.title),g=m(p.title);return y!==g?y-g:0})}function S3(){var Xl,ca,tl;const[r,a]=u.useState([]),[l,i]=u.useState(!0),[c,d]=u.useState([]),[m,f]=u.useState(null),[p,y]=u.useState(!1),[g,v]=u.useState(!1),[k,P]=u.useState(!1),[T,N]=u.useState(""),[b,C]=u.useState([]),[E,j]=u.useState(!1),[R,G]=u.useState(!1),J=u.useRef(null),[L,I]=u.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[w,V]=u.useState(null),[te,ie]=u.useState(!1),[Y,ne]=u.useState(!1),[_,Q]=u.useState(null),[ue,O]=u.useState(!1),[re,H]=u.useState([]),[A,$]=u.useState(!1),[F,ee]=u.useState(""),[K,de]=u.useState(""),[X,ye]=u.useState(!1),[Ce,z]=u.useState(""),[xe,Pe]=u.useState(!1),[Ve,He]=u.useState(null),[Ke,tt]=u.useState(!1),[$e,me]=u.useState(!1),[pe,ft]=u.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[ss,ur]=u.useState(!1),[Sn,zs]=u.useState(!1),[vs,Ir]=u.useState(1),[_t,rs]=u.useState([]),[Cn,Xs]=u.useState(!1),[ns,kn]=u.useState(20),[ra,Es]=u.useState(!1),[_r,Js]=u.useState(!1),Nt=w3(r),Ps=r.length,js=[...r].sort((D,oe)=>(oe.hotScore??0)-(D.hotScore??0)),Zs=10,os=Math.max(1,Math.ceil(js.length/Zs)),Ts=js.slice((vs-1)*Zs,vs*Zs),Pt=async()=>{i(!0);try{const D=await Le("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray(D==null?void 0:D.sections)?D.sections:[])}catch(D){console.error(D),a([])}finally{i(!1)}};u.useEffect(()=>{Pt()},[]);const na=D=>{d(oe=>oe.includes(D)?oe.filter(Ne=>Ne!==D):[...oe,D])},aa=u.useCallback(D=>{const oe=r,Ne=D.flatMap(ke=>{const rt=oe.find(Is=>Is.id===ke.id);return rt?[{...rt,partId:ke.partId,partTitle:ke.partTitle,chapterId:ke.chapterId,chapterTitle:ke.chapterTitle}]:[]});return a(Ne),yt("/api/db/book",{action:"reorder",items:D}).then(ke=>{ke&&ke.success===!1&&(a(oe),alert("排序失败: "+(ke&&typeof ke=="object"&&"error"in ke?ke.error:"未知错误")))}).catch(ke=>{a(oe),console.error("排序失败:",ke),alert("排序失败: "+(ke instanceof Error?ke.message:"网络或服务异常"))}),Promise.resolve()},[r]),la=async D=>{if(confirm(`确定要删除章节「${D.title}」吗?此操作不可恢复。`))try{const oe=await Er(`/api/db/book?id=${encodeURIComponent(D.id)}`);oe&&oe.success!==!1?(alert("已删除"),Pt()):alert("删除失败: "+(oe&&typeof oe=="object"&&"error"in oe?oe.error:"未知错误"))}catch(oe){console.error(oe),alert("删除失败")}},En=u.useCallback(async()=>{ur(!0);try{const D=await Le("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),oe=D&&D.data;oe&&typeof oe.readWeight=="number"&&typeof oe.recencyWeight=="number"&&typeof oe.payWeight=="number"&&ft({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{ur(!1)}},[]);u.useEffect(()=>{$e&&En()},[$e,En]);const Pn=async()=>{const{readWeight:D,recencyWeight:oe,payWeight:Ne}=pe,ke=D+oe+Ne;if(Math.abs(ke-1)>.001){alert("三个权重之和必须等于 1");return}zs(!0);try{const rt=await ut("/api/db/config",{key:"article_ranking_weights",value:{readWeight:D,recencyWeight:oe,payWeight:Ne},description:"文章排名算法权重"});rt&&rt.success!==!1?(alert("已保存"),Pt()):alert("保存失败: "+(rt&&typeof rt=="object"&&"error"in rt?rt.error:""))}catch(rt){console.error(rt),alert("保存失败")}finally{zs(!1)}},Tn=u.useCallback(async()=>{Xs(!0);try{const D=await Le("/api/db/config/full?key=pinned_section_ids",{cache:"no-store"}),oe=D&&D.data;Array.isArray(oe)&&rs(oe)}catch{}finally{Xs(!1)}},[]),hr=async D=>{const oe=_t.includes(D)?_t.filter(Ne=>Ne!==D):[..._t,D];rs(oe);try{await ut("/api/db/config",{key:"pinned_section_ids",value:oe,description:"强制置顶章节ID列表(精选推荐/首页最新更新)"})}catch{rs(_t)}},Mr=u.useCallback(async()=>{Es(!0);try{const D=await Le("/api/db/config/full?key=unpaid_preview_percent",{cache:"no-store"}),oe=D&&D.data;typeof oe=="number"&&oe>0&&oe<=100&&kn(oe)}catch{}finally{Es(!1)}},[]),er=async()=>{if(ns<1||ns>100){alert("预览比例需在 1~100 之间");return}Js(!0);try{const D=await ut("/api/db/config",{key:"unpaid_preview_percent",value:ns,description:"小程序未付费内容默认预览比例(%)"});D&&D.success!==!1?alert("已保存"):alert("保存失败: "+(D.error||""))}catch{alert("保存失败")}finally{Js(!1)}};u.useEffect(()=>{Tn(),Mr()},[Tn,Mr]);const ia=async D=>{He({section:D,orders:[]}),tt(!0);try{const oe=await Le(`/api/db/book?action=section-orders&id=${encodeURIComponent(D.id)}`),Ne=oe!=null&&oe.success&&Array.isArray(oe.orders)?oe.orders:[];He(ke=>ke?{...ke,orders:Ne}:null)}catch(oe){console.error(oe),He(Ne=>Ne?{...Ne,orders:[]}:null)}finally{tt(!1)}},as=async D=>{v(!0);try{const oe=await Le(`/api/db/book?action=read&id=${encodeURIComponent(D.id)}`);if(oe!=null&&oe.success&&oe.section){const Ne=oe.section;f({id:D.id,title:oe.section.title??D.title,price:oe.section.price??D.price,content:oe.section.content??"",filePath:D.filePath,isFree:D.isFree||D.price===0,isNew:Ne.isNew??D.isNew})}else f({id:D.id,title:D.title,price:D.price,content:"",filePath:D.filePath,isFree:D.isFree,isNew:D.isNew}),oe&&!oe.success&&alert("无法读取文件内容: "+(oe.error||"未知错误"))}catch(oe){console.error(oe),f({id:D.id,title:D.title,price:D.price,content:"",filePath:D.filePath,isFree:D.isFree})}finally{v(!1)}},Ar=async()=>{var D;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+.*${(D=m.title)==null?void 0:D.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const rt of Ne)oe=oe.replace(rt,"");oe=oe.replace(/^\s*\n+/,"").trim();const ke=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});ke&&ke.success!==!1?(alert(`已保存章节: ${m.title}`),f(null),Pt()):alert("保存失败: "+(ke&&typeof ke=="object"&&"error"in ke?ke.error:"未知错误"))}catch(oe){console.error(oe),alert("保存失败")}finally{P(!1)}}},Dr=async()=>{if(!L.id||!L.title){alert("请填写章节ID和标题");return}P(!0);try{const D=await yt("/api/db/book",{id:L.id,title:L.title,price:L.price,content:L.content,partId:L.partId,chapterId:L.chapterId,saveToFile:!1});D&&D.success!==!1?(alert(`章节创建成功: ${L.title}`),y(!1),I({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),Pt()):alert("创建失败: "+(D&&typeof D=="object"&&"error"in D?D.error:"未知错误"))}catch(D){console.error(D),alert("创建失败")}finally{P(!1)}},Rn=D=>{I(oe=>{var Ne;return{...oe,partId:D.id,chapterId:((Ne=D.chapters[0])==null?void 0:Ne.id)??"chapter-1"}}),y(!0)},Lr=D=>{V({id:D.id,title:D.title})},Za=async()=>{var D;if((D=w==null?void 0:w.title)!=null&&D.trim()){ie(!0);try{const oe=r.map(ke=>({id:ke.id,partId:ke.partId||"part-1",partTitle:ke.partId===w.id?w.title.trim():ke.partTitle||"",chapterId:ke.chapterId||"chapter-1",chapterTitle:ke.chapterTitle||""})),Ne=await yt("/api/db/book",{action:"reorder",items:oe});Ne&&Ne.success!==!1?(V(null),Pt()):alert("更新篇名失败: "+(Ne&&typeof Ne=="object"&&"error"in Ne?Ne.error:"未知错误"))}catch(oe){console.error(oe),alert("更新篇名失败")}finally{ie(!1)}}},el=D=>{const oe=D.chapters.length+1,Ne=`chapter-${D.id}-${oe}-${Date.now()}`;I({id:`${oe}.1`,title:"新章节",price:1,partId:D.id,chapterId:Ne,content:""}),y(!0)},Rs=(D,oe)=>{Q({part:D,chapter:oe,title:oe.title})},In=async()=>{var D;if((D=_==null?void 0:_.title)!=null&&D.trim()){O(!0);try{const oe=r.map(ke=>({id:ke.id,partId:ke.partId||_.part.id,partTitle:ke.partId===_.part.id?_.part.title:ke.partTitle||"",chapterId:ke.chapterId||_.chapter.id,chapterTitle:ke.partId===_.part.id&&ke.chapterId===_.chapter.id?_.title.trim():ke.chapterTitle||""})),Ne=await yt("/api/db/book",{action:"reorder",items:oe});Ne&&Ne.success!==!1?(Q(null),Pt()):alert("保存失败: "+(Ne&&typeof Ne=="object"&&"error"in Ne?Ne.error:"未知错误"))}catch(oe){console.error(oe),alert("保存失败")}finally{O(!1)}}},_n=async(D,oe)=>{const Ne=oe.sections.map(ke=>ke.id);if(Ne.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${D.chapters.indexOf(oe)+1}章 | ${oe.title}」吗?将删除共 ${Ne.length} 节,此操作不可恢复。`))try{for(const ke of Ne)await Er(`/api/db/book?id=${encodeURIComponent(ke)}`);Pt()}catch(ke){console.error(ke),alert("删除失败")}},oa=async()=>{if(!Ce.trim()){alert("请输入篇名");return}Pe(!0);try{const D=`part-new-${Date.now()}`,oe="chapter-1",Ne=`part-placeholder-${Date.now()}`,ke=await yt("/api/db/book",{id:Ne,title:"占位节(可编辑)",price:0,content:"",partId:D,partTitle:Ce.trim(),chapterId:oe,chapterTitle:"第1章 | 待编辑",saveToFile:!1});ke&&ke.success!==!1?(alert(`篇「${Ce}」创建成功,请编辑占位节`),ne(!1),z(""),Pt()):alert("创建失败: "+(ke&&typeof ke=="object"&&"error"in ke?ke.error:"未知错误"))}catch(D){console.error(D),alert("创建失败")}finally{Pe(!1)}},Mn=async()=>{if(re.length===0){alert("请先勾选要移动的章节");return}const D=Nt.find(Ne=>Ne.id===F),oe=D==null?void 0:D.chapters.find(Ne=>Ne.id===K);if(!D||!oe||!F||!K){alert("请选择目标篇和章");return}ye(!0);try{const Ne=()=>{const nt=new Set(re),tr=r.map(Mt=>({id:Mt.id,partId:Mt.partId||"",partTitle:Mt.partTitle||"",chapterId:Mt.chapterId||"",chapterTitle:Mt.chapterTitle||""})),Ko=tr.filter(Mt=>nt.has(Mt.id)).map(Mt=>({...Mt,partId:F,partTitle:D.title||F,chapterId:K,chapterTitle:oe.title||K})),Dn=tr.filter(Mt=>!nt.has(Mt.id));let Or=Dn.length;for(let Mt=Dn.length-1;Mt>=0;Mt-=1){const Fr=Dn[Mt];if(Fr.partId===F&&Fr.chapterId===K){Or=Mt+1;break}}return[...Dn.slice(0,Or),...Ko,...Dn.slice(Or)]},ke=async()=>{const nt=Ne(),tr=await yt("/api/db/book",{action:"reorder",items:nt});return tr&&tr.success!==!1?(alert(`已移动 ${re.length} 节到「${D.title}」-「${oe.title}」`),$(!1),H([]),await Pt(),!0):!1},rt={action:"move-sections",sectionIds:re,targetPartId:F,targetChapterId:K,targetPartTitle:D.title||F,targetChapterTitle:oe.title||K},Is=await yt("/api/db/book",rt);if(Is&&Is.success!==!1)alert(`已移动 ${Is.count??re.length} 节到「${D.title}」-「${oe.title}」`),$(!1),H([]),await Pt();else{const nt=Is&&typeof Is=="object"&&"error"in Is?Is.error||"":"未知错误";if((nt.includes("缺少 id")||nt.includes("无效的 action"))&&await ke())return;alert("移动失败: "+nt)}}catch(Ne){console.error(Ne),alert("移动失败: "+(Ne instanceof Error?Ne.message:"网络或服务异常"))}finally{ye(!1)}},An=D=>{H(oe=>oe.includes(D)?oe.filter(Ne=>Ne!==D):[...oe,D])},U=async D=>{const oe=r.filter(Ne=>Ne.partId===D.id).map(Ne=>Ne.id);if(oe.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${D.title}」整篇吗?将删除共 ${oe.length} 节内容,此操作不可恢复。`))try{for(const Ne of oe)await Er(`/api/db/book?id=${encodeURIComponent(Ne)}`);Pt()}catch(Ne){console.error(Ne),alert("删除失败")}},We=async D=>{var Ne,ke;const oe=(Ne=D.target.files)==null?void 0:Ne[0];if(oe){G(!0);try{const rt=new FormData;rt.append("file",oe),rt.append("folder","book-images");const nt=await(await fetch(Ua("/api/upload"),{method:"POST",body:rt,credentials:"include"})).json();if(nt!=null&&nt.success&&((ke=nt==null?void 0:nt.data)!=null&&ke.url)){const tr=`![${oe.name}](${nt.data.url})`;m&&f({...m,content:(m.content||"")+` + +`+tr}),alert(`图片上传成功: ${nt.data.url}`)}else alert("上传失败: "+((nt==null?void 0:nt.error)||"未知错误"))}catch(rt){console.error(rt),alert("上传失败")}finally{G(!1),J.current&&(J.current.value="")}}},Ge=async()=>{var D;if(T.trim()){j(!0);try{const oe=await Le(`/api/search?q=${encodeURIComponent(T)}`);oe!=null&&oe.success&&((D=oe.data)!=null&&D.results)?C(oe.data.results):(C([]),oe&&!oe.success&&alert("搜索失败: "+oe.error))}catch(oe){console.error(oe),C([]),alert("搜索失败")}finally{j(!1)}}},Vt=Nt.find(D=>D.id===L.partId),lt=(Vt==null?void 0:Vt.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:["共 ",Nt.length," 篇 · ",Ps," 节内容"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(q,{onClick:()=>me(!0),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10 bg-transparent",children:[e.jsx(Ad,{className:"w-4 h-4 mr-2"}),"排名算法"]}),e.jsxs(q,{onClick:()=>{const D=typeof window<"u"?`${window.location.origin}/api-doc`:"";D&&window.open(D,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(kr,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(Ct,{open:p,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(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Rt,{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(se,{className:"text-gray-300",children:"章节ID *"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:L.id,onChange:D=>I({...L,id:D.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(ce,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:L.price,onChange:D=>I({...L,price:Number(D.target.value)})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"章节标题 *"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:L.title,onChange:D=>I({...L,title:D.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"所属篇"}),e.jsxs(uo,{value:L.partId,onValueChange:D=>I({...L,partId:D,chapterId:"chapter-1"}),children:[e.jsx(Ol,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ho,{})}),e.jsxs(Fl,{className:"bg-[#0f2137] border-gray-700",children:[Nt.map(D=>e.jsx(Qn,{value:D.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:D.title},D.id)),Nt.length===0&&e.jsx(Qn,{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(se,{className:"text-gray-300",children:"所属章"}),e.jsxs(uo,{value:L.chapterId,onValueChange:D=>I({...L,chapterId:D}),children:[e.jsx(Ol,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ho,{})}),e.jsxs(Fl,{className:"bg-[#0f2137] border-gray-700",children:[lt.map(D=>e.jsx(Qn,{value:D.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:D.title},D.id)),lt.length===0&&e.jsx(Qn,{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(se,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsx(Zn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:L.content,onChange:D=>I({...L,content:D.target.value})})]})]}),e.jsxs(Ot,{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:Dr,disabled:k||!L.id||!L.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:k?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),e.jsx(Ct,{open:!!w,onOpenChange:D=>!D&&V(null),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),w&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"篇名"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:w.title,onChange:D=>V({...w,title:D.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(Ot,{children:[e.jsx(q,{variant:"outline",onClick:()=>V(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:Za,disabled:te||!((Xl=w==null?void 0:w.title)!=null&&Xl.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:te?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(Ct,{open:!!_,onOpenChange:D=>!D&&Q(null),children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),_&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"章节名称(如:第8章|底层结构)"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:_.title,onChange:D=>Q({..._,title:D.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(Ot,{children:[e.jsx(q,{variant:"outline",onClick:()=>Q(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:In,disabled:ue||!((ca=_==null?void 0:_.title)!=null&&ca.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ue?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(Ct,{open:A,onOpenChange:D=>{var oe;if($(D),D&&Nt.length>0){const Ne=Nt[0];ee(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(kt,{children:e.jsx(Et,{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:re.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"目标篇"}),e.jsxs(uo,{value:F,onValueChange:D=>{var Ne;ee(D);const oe=Nt.find(ke=>ke.id===D);de(((Ne=oe==null?void 0:oe.chapters[0])==null?void 0:Ne.id)??"")},children:[e.jsx(Ol,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ho,{placeholder:"选择篇"})}),e.jsx(Fl,{className:"bg-[#0f2137] border-gray-700",children:Nt.map(D=>e.jsx(Qn,{value:D.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:D.title},D.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"目标章"}),e.jsxs(uo,{value:K,onValueChange:de,children:[e.jsx(Ol,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ho,{placeholder:"选择章"})}),e.jsx(Fl,{className:"bg-[#0f2137] border-gray-700",children:(((tl=Nt.find(D=>D.id===F))==null?void 0:tl.chapters)??[]).map(D=>e.jsx(Qn,{value:D.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:D.title},D.id))})]})]})]}),e.jsxs(Ot,{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(q,{onClick:Mn,disabled:X||re.length===0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:X?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"移动中..."]}):"确认移动"})]})]})}),e.jsx(Ct,{open:!!Ve,onOpenChange:D=>!D&&He(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(kt,{children:e.jsxs(Et,{className:"text-white",children:["付款记录 — ",(Ve==null?void 0:Ve.section.title)??""]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:Ke?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):Ve&&Ve.orders.length===0?e.jsx("p",{className:"text-gray-500 text-center py-6",children:"暂无付款记录"}):Ve?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:Ve.orders.map(D=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:D.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:D.userId??D.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",D.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:D.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:D.payTime??D.createdAt??"-"})]},D.id??D.orderSn??""))})]}):null})]})}),e.jsx(Ct,{open:$e,onOpenChange:me,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Ad,{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(se,{className:"text-gray-400 text-xs",children:"阅读权重"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:pe.readWeight,onChange:D=>ft(oe=>({...oe,readWeight:Math.max(0,Math.min(1,parseFloat(D.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(se,{className:"text-gray-400 text-xs",children:"新度权重"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:pe.recencyWeight,onChange:D=>ft(oe=>({...oe,recencyWeight:Math.max(0,Math.min(1,parseFloat(D.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(se,{className:"text-gray-400 text-xs",children:"付款权重"}),e.jsx(ce,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:pe.payWeight,onChange:D=>ft(oe=>({...oe,payWeight:Math.max(0,Math.min(1,parseFloat(D.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(pe.readWeight+pe.recencyWeight+pe.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:Pn,disabled:Sn||Math.abs(pe.readWeight+pe.recencyWeight+pe.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:Sn?"保存中...":"保存权重"})]})]})]})}),e.jsx(Ct,{open:Y,onOpenChange:ne,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Rt,{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(se,{className:"text-gray-300",children:"篇名(如:第六篇|真实的社会)"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:Ce,onChange:D=>z(D.target.value),placeholder:"输入篇名"})]})}),e.jsxs(Ot,{children:[e.jsx(q,{variant:"outline",onClick:()=>{ne(!1),z("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(q,{onClick:oa,disabled:xe||!Ce.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:xe?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),e.jsx(Ct,{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(kt,{className:"shrink-0 px-6 pt-6 pb-2",children:e.jsxs(Et,{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(se,{className:"text-gray-300",children:"章节ID"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.id,onChange:D=>f({...m,id:D.target.value}),placeholder:"如: 9.15"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(ce,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:m.isFree?0:m.price,onChange:D=>f({...m,price:Number(D.target.value),isFree:Number(D.target.value)===0}),disabled:m.isFree})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{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.isFree||m.price===0,onChange:D=>f({...m,isFree:D.target.checked,price:D.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(se,{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:D=>f({...m,isNew:D.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(se,{className:"text-gray-300",children:"章节标题"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.title,onChange:D=>f({...m,title:D.target.value})})]}),m.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"文件路径"}),e.jsx(ce,{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(se,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:J,type:"file",accept:"image/*",onChange:We,className:"hidden"}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>{var D;return(D=J.current)==null?void 0:D.click()},disabled:R,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[R?e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(np,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),g?e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(Zn,{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:D=>f({...m,content:D.target.value})})]})]}),e.jsxs(Ot,{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(xs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsx(q,{onClick:Ar,disabled:k,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:k?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),e.jsxs(Ql,{defaultValue:"chapters",className:"space-y-6",children:[e.jsxs(Ya,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Ft,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(Fs,{className:"w-4 h-4 mr-2"}),"章节管理"]}),e.jsxs(Ft,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(hn,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),e.jsxs(Ft,{value:"ranking",className:"data-[state=active]:bg-amber-500/20 data-[state=active]:text-amber-400 text-gray-400",children:[e.jsx(qf,{className:"w-4 h-4 mr-2"}),"内容排行榜"]})]}),e.jsxs(zt,{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(Fs,{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:Ps}),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(Rt,{className:"w-4 h-4 mr-2"}),"新建章节"]}),e.jsxs(q,{onClick:()=>ne(!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(Rt,{className:"w-4 h-4 mr-2"}),"新建篇"]}),e.jsxs(q,{variant:"outline",onClick:()=>$(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",re.length," 节)"]})]}),l?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(N3,{parts:Nt,expandedParts:c,onTogglePart:na,onReorder:aa,onReadSection:as,onDeleteSection:la,onAddSectionInPart:Rn,onAddChapterInPart:el,onDeleteChapter:_n,onEditPart:Lr,onDeletePart:U,onEditChapter:Rs,selectedSectionIds:re,onToggleSectionSelect:An,onShowSectionOrders:ia})]}),e.jsx(zt,{value:"search",className:"space-y-4",children:e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Qe,{children:e.jsx(qe,{className:"text-white",children:"内容搜索"})}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:T,onChange:D=>N(D.target.value),onKeyDown:D=>D.key==="Enter"&&Ge()}),e.jsx(q,{onClick:Ge,disabled:E||!T.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?e.jsx(Be,{className:"w-4 h-4 animate-spin"}):e.jsx(hn,{className:"w-4 h-4"})})]}),b.length>0&&e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",b.length," 个结果"]}),b.map(D=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>as({id:D.id,title:D.title,price:D.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:D.id}),e.jsx("span",{className:"text-white",children:D.title})]}),e.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:D.matchType==="title"?"标题匹配":"内容匹配"})]}),D.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:D.snippet}),(D.partTitle||D.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[D.partTitle," · ",D.chapterTitle]})]},D.id))]})]})]})}),e.jsxs(zt,{value:"ranking",className:"space-y-4",children:[e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Qe,{className:"pb-3",children:e.jsxs(qe,{className:"text-white text-base flex items-center gap-2",children:[e.jsx(Ad,{className:"w-4 h-4 text-[#38bdac]"}),"内容显示规则"]})}),e.jsx(Se,{children:e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se,{className:"text-gray-400 text-sm whitespace-nowrap",children:"未付费预览比例"}),e.jsx(ce,{type:"number",min:"1",max:"100",className:"bg-[#0a1628] border-gray-700 text-white w-20",value:ns,onChange:D=>kn(Math.max(1,Math.min(100,Number(D.target.value)||20))),disabled:ra}),e.jsx("span",{className:"text-gray-500 text-sm",children:"%"})]}),e.jsx(q,{size:"sm",onClick:er,disabled:_r,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:_r?"保存中...":"保存"}),e.jsxs("span",{className:"text-xs text-gray-500",children:["小程序未付费用户默认显示文章前 ",ns,"% 内容"]})]})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Qe,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(qe,{className:"text-white text-base flex items-center gap-2",children:[e.jsx(qf,{className:"w-4 h-4 text-amber-400"}),"内容排行榜",e.jsxs("span",{className:"text-xs text-gray-500 font-normal ml-2",children:["按热度排行 · 共 ",js.length," 节"]})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsx(q,{variant:"ghost",size:"sm",disabled:vs<=1,onClick:()=>Ir(D=>Math.max(1,D-1)),className:"text-gray-400 hover:text-white h-7 w-7 p-0",children:e.jsx(eb,{className:"w-4 h-4"})}),e.jsxs("span",{className:"text-gray-400 min-w-[60px] text-center",children:[vs," / ",os]}),e.jsx(q,{variant:"ghost",size:"sm",disabled:vs>=os,onClick:()=>Ir(D=>Math.min(os,D+1)),className:"text-gray-400 hover:text-white h-7 w-7 p-0",children:e.jsx(wr,{className:"w-4 h-4"})})]})]})}),e.jsx(Se,{children:e.jsxs("div",{className:"space-y-0",children:[e.jsxs("div",{className:"grid grid-cols-[40px_40px_1fr_80px_80px_80px_60px] gap-2 px-3 py-2 text-xs text-gray-500 border-b border-gray-700/50",children:[e.jsx("span",{children:"排名"}),e.jsx("span",{children:"置顶"}),e.jsx("span",{children:"标题"}),e.jsx("span",{className:"text-right",children:"点击量"}),e.jsx("span",{className:"text-right",children:"付款数"}),e.jsx("span",{className:"text-right",children:"热度"}),e.jsx("span",{className:"text-right",children:"操作"})]}),Ts.map((D,oe)=>{const Ne=(vs-1)*Zs+oe+1,ke=_t.includes(D.id);return e.jsxs("div",{className:`grid grid-cols-[40px_40px_1fr_80px_80px_80px_60px] gap-2 px-3 py-2.5 items-center border-b border-gray-700/30 hover:bg-[#162840] transition-colors ${ke?"bg-amber-500/5":""}`,children:[e.jsx("span",{className:`text-sm font-bold ${Ne<=3?"text-amber-400":"text-gray-500"}`,children:Ne<=3?["🥇","🥈","🥉"][Ne-1]:`#${Ne}`}),e.jsx(q,{variant:"ghost",size:"sm",className:`h-6 w-6 p-0 ${ke?"text-amber-400":"text-gray-600 hover:text-amber-400"}`,onClick:()=>hr(D.id),disabled:Cn,title:ke?"取消置顶":"强制置顶(精选推荐/首页最新更新)",children:ke?e.jsx(vN,{className:"w-3.5 h-3.5 fill-current"}):e.jsx(aN,{className:"w-3.5 h-3.5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"text-white text-sm truncate block",children:D.title}),e.jsxs("span",{className:"text-gray-600 text-xs",children:[D.partTitle," · ",D.chapterTitle]})]}),e.jsx("span",{className:"text-right text-sm text-blue-400 font-mono",children:D.clickCount??0}),e.jsx("span",{className:"text-right text-sm text-green-400 font-mono",children:D.payCount??0}),e.jsx("span",{className:"text-right text-sm text-amber-400 font-mono",children:(D.hotScore??0).toFixed(1)}),e.jsx("div",{className:"text-right",children:e.jsx(q,{variant:"ghost",size:"sm",className:"text-gray-500 hover:text-[#38bdac] h-6 px-1",onClick:()=>ia({id:D.id,title:D.title,price:D.price}),title:"付款记录",children:e.jsx(Fs,{className:"w-3 h-3"})})})]},D.id)}),Ts.length===0&&e.jsx("div",{className:"py-8 text-center text-gray-500",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 Px(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 Tx(r){return Array.isArray(r)?r.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):Sr.highlights}function C3(){const[r,a]=u.useState(Sr),[l,i]=u.useState(!0),[c,d]=u.useState(!1),[m,f]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{Le("/api/admin/author-settings").then(C=>{const E=C==null?void 0:C.data;E&&typeof E=="object"&&a({name:String(E.name??Sr.name),avatar:String(E.avatar??Sr.avatar),avatarImg:String(E.avatarImg??""),title:String(E.title??Sr.title),bio:String(E.bio??Sr.bio),stats:Px(E.stats).length?Px(E.stats):Sr.stats,highlights:Tx(E.highlights).length?Tx(E.highlights):Sr.highlights})}).catch(console.error).finally(()=>i(!1))},[]);const y=async()=>{d(!0);try{const C={name:r.name,avatar:r.avatar||"K",avatarImg:r.avatarImg,title:r.title,bio:r.bio,stats:r.stats.filter(R=>R.label||R.value),highlights:r.highlights.filter(Boolean)},E=await ut("/api/admin/author-settings",C);if(!E||E.success===!1){alert("保存失败: "+(E&&typeof E=="object"&&"error"in E?E.error:""));return}d(!1);const j=document.createElement("div");j.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",j.textContent="作者设置已保存",document.body.appendChild(j),setTimeout(()=>j.remove(),2e3)}catch(C){console.error(C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}finally{d(!1)}},g=async C=>{var j;const E=(j=C.target.files)==null?void 0:j[0];if(E){f(!0);try{const R=new FormData;R.append("file",E),R.append("folder","avatars");const G=Ru(),J={};G&&(J.Authorization=`Bearer ${G}`);const I=await(await fetch(Ua("/api/upload"),{method:"POST",body:R,credentials:"include",headers:J})).json();I!=null&&I.success&&(I!=null&&I.url)?a(w=>({...w,avatarImg:I.url})):alert("上传失败: "+((I==null?void 0:I.error)||"未知错误"))}catch(R){console.error(R),alert("上传失败")}finally{f(!1),p.current&&(p.current.value="")}}},v=()=>a(C=>({...C,stats:[...C.stats,{label:"",value:""}]})),k=C=>a(E=>({...E,stats:E.stats.filter((j,R)=>R!==C)})),P=(C,E,j)=>a(R=>({...R,stats:R.stats.map((G,J)=>J===C?{...G,[E]:j}:G)})),T=()=>a(C=>({...C,highlights:[...C.highlights,""]})),N=C=>a(E=>({...E,highlights:E.highlights.filter((j,R)=>R!==C)})),b=(C,E)=>a(j=>({...j,highlights:j.highlights.map((R,G)=>G===C?E:R)}));return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Fa,{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(It,{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(Qe,{children:[e.jsxs(qe,{className:"flex items-center gap-2 text-white",children:[e.jsx(Fa,{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(se,{className:"text-gray-300",children:"姓名"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.name,onChange:C=>a(E=>({...E,name:C.target.value})),placeholder:"卡若"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:r.avatar,onChange:C=>a(E=>({...E,avatar:C.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(se,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(np,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ce,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:r.avatarImg,onChange:C=>a(E=>({...E,avatarImg:C.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),e.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:g}),e.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:m,onClick:()=>{var C;return(C=p.current)==null?void 0:C.click()},children:[e.jsx(vo,{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:Ua(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(se,{className:"text-gray-300",children:"头衔"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.title,onChange:C=>a(E=>({...E,title:C.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"个人简介"}),e.jsx(Zn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:r.bio,onChange:C=>a(E=>({...E,bio:C.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{children:[e.jsx(qe,{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((C,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ce,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:C.label,onChange:j=>P(E,"label",j.target.value),placeholder:"标签"}),e.jsx(ce,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:C.value,onChange:j=>P(E,"value",j.target.value),placeholder:"数值"}),e.jsx(q,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>k(E),children:e.jsx(xs,{className:"w-4 h-4"})})]},E)),e.jsxs(q,{variant:"outline",size:"sm",onClick:v,className:"border-gray-600 text-gray-400",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{children:[e.jsx(qe,{className:"text-white",children:"亮点标签"}),e.jsx(vt,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),e.jsxs(Se,{className:"space-y-3",children:[r.highlights.map((C,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ce,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:C,onChange:j=>b(E,j.target.value),placeholder:"5年私域运营经验"}),e.jsx(q,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>N(E),children:e.jsx(xs,{className:"w-4 h-4"})})]},E)),e.jsxs(q,{variant:"outline",size:"sm",onClick:T,className:"border-gray-600 text-gray-400",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}function k3(){const[r,a]=u.useState([]),[l,i]=u.useState(0),[c,d]=u.useState(1),[m]=u.useState(10),[f,p]=u.useState(0),[y,g]=u.useState(""),v=$u(y,300),[k,P]=u.useState(!0),[T,N]=u.useState(null),[b,C]=u.useState(!1),[E,j]=u.useState(null),[R,G]=u.useState(""),[J,L]=u.useState(""),[I,w]=u.useState(""),[V,te]=u.useState("admin"),[ie,Y]=u.useState("active"),[ne,_]=u.useState(!1);async function Q(){var $;P(!0),N(null);try{const F=new URLSearchParams({page:String(c),pageSize:String(m)});v.trim()&&F.set("search",v.trim());const ee=await Le(`/api/admin/users?${F}`);ee!=null&&ee.success?(a(ee.records||[]),i(ee.total??0),p(ee.totalPages??0)):N(ee.error||"加载失败")}catch(F){const ee=F;N(ee.status===403?"无权限访问":(($=ee==null?void 0:ee.data)==null?void 0:$.error)||"加载失败"),a([])}finally{P(!1)}}u.useEffect(()=>{Q()},[c,m,v]);const ue=()=>{j(null),G(""),L(""),w(""),te("admin"),Y("active"),C(!0)},O=$=>{j($),G($.username),L(""),w($.name||""),te($.role==="super_admin"?"super_admin":"admin"),Y($.status==="disabled"?"disabled":"active"),C(!0)},re=async()=>{var $;if(!R.trim()){N("用户名不能为空");return}if(!E&&!J){N("新建时密码必填,至少 6 位");return}if(J&&J.length<6){N("密码至少 6 位");return}N(null),_(!0);try{if(E){const F=await yt("/api/admin/users",{id:E.id,password:J||void 0,name:I.trim(),role:V,status:ie});F!=null&&F.success?(C(!1),Q()):N((F==null?void 0:F.error)||"保存失败")}else{const F=await ut("/api/admin/users",{username:R.trim(),password:J,name:I.trim(),role:V});F!=null&&F.success?(C(!1),Q()):N((F==null?void 0:F.error)||"保存失败")}}catch(F){const ee=F;N((($=ee==null?void 0:ee.data)==null?void 0:$.error)||"保存失败")}finally{_(!1)}},H=async $=>{var F;if(confirm("确定删除该管理员?"))try{const ee=await Er(`/api/admin/users?id=${$}`);ee!=null&&ee.success?Q():N((ee==null?void 0:ee.error)||"删除失败")}catch(ee){const K=ee;N(((F=K==null?void 0:K.data)==null?void 0:F.error)||"删除失败")}},A=$=>{if(!$)return"-";try{const F=new Date($);return isNaN(F.getTime())?$:F.toLocaleString("zh-CN")}catch{return $}};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(ce,{placeholder:"搜索用户名/昵称",value:y,onChange:$=>g($.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(q,{variant:"outline",size:"sm",onClick:Q,disabled:k,className:"border-gray-600 text-gray-300",children:e.jsx(Be,{className:`w-4 h-4 ${k?"animate-spin":""}`})}),e.jsxs(q,{onClick:ue,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{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:()=>N(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:k?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:[r.map($=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(ge,{className:"text-gray-300",children:$.id}),e.jsx(ge,{className:"text-white font-medium",children:$.username}),e.jsx(ge,{className:"text-gray-400",children:$.name||"-"}),e.jsx(ge,{children:e.jsx(Oe,{variant:"outline",className:$.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:$.role==="super_admin"?"超级管理员":"管理员"})}),e.jsx(ge,{children:e.jsx(Oe,{variant:"outline",className:$.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:$.status==="active"?"正常":"已禁用"})}),e.jsx(ge,{className:"text-gray-500 text-sm",children:A($.createdAt)}),e.jsxs(ge,{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:()=>H($.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},$.id)),r.length===0&&!k&&e.jsx(et,{children:e.jsx(ge,{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(Gs,{page:c,pageSize:m,total:l,totalPages:f,onPageChange:d})})]})})}),e.jsx(Ct,{open:b,onOpenChange:C,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(kt,{children:e.jsx(Et,{className:"text-white",children:E?"编辑管理员":"新增管理员"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"用户名"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:R,onChange:$=>G($.target.value),disabled:!!E}),E&&e.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:E?"新密码(留空不改)":"密码"}),e.jsx(ce,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:E?"留空表示不修改":"至少 6 位",value:J,onChange:$=>L($.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"昵称"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:I,onChange:$=>w($.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:V,onChange:$=>te($.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"admin",children:"管理员"}),e.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),E&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"状态"}),e.jsxs("select",{value:ie,onChange:$=>Y($.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(Ot,{children:[e.jsxs(q,{variant:"outline",onClick:()=>C(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(xs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:re,disabled:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),ne?"保存中...":"保存"]})]})]})})]})}const E3={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},P3={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},T3={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...P3}},R3={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},I3=["system","author","admin"];function _3(){const[r,a]=Xx(),l=r.get("tab")??"system",i=I3.includes(l)?l:"system",[c,d]=u.useState(T3),[m,f]=u.useState(R3),[p,y]=u.useState(E3),[g,v]=u.useState(!1),[k,P]=u.useState(!0),[T,N]=u.useState(!1),[b,C]=u.useState(""),[E,j]=u.useState(""),[R,G]=u.useState(!1),[J,L]=u.useState(!1),I=(Y,ne,_=!1)=>{C(Y),j(ne),G(_),N(!0)};u.useEffect(()=>{(async()=>{try{const ne=await Le("/api/admin/settings");if(!ne||ne.success===!1)return;if(ne.featureConfig&&Object.keys(ne.featureConfig).length&&f(_=>({..._,...ne.featureConfig})),ne.mpConfig&&typeof ne.mpConfig=="object"&&y(_=>({..._,...ne.mpConfig})),ne.siteSettings&&typeof ne.siteSettings=="object"){const _=ne.siteSettings;d(Q=>({...Q,...typeof _.sectionPrice=="number"&&{sectionPrice:_.sectionPrice},...typeof _.baseBookPrice=="number"&&{baseBookPrice:_.baseBookPrice},...typeof _.distributorShare=="number"&&{distributorShare:_.distributorShare},..._.authorInfo&&typeof _.authorInfo=="object"&&{authorInfo:{...Q.authorInfo,..._.authorInfo}}}))}}catch(ne){console.error("Load settings error:",ne)}finally{P(!1)}})()},[]);const w=async(Y,ne)=>{L(!0);try{const _=await ut("/api/admin/settings",{featureConfig:Y});if(!_||_.success===!1){ne(),I("保存失败",(_==null?void 0:_.error)??"未知错误",!0);return}I("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(_){console.error("Save feature config error:",_),ne(),I("保存失败",_ instanceof Error?_.message:String(_),!0)}finally{L(!1)}},V=(Y,ne)=>{const _=m,Q={..._,[Y]:ne};f(Q),w(Q,()=>f(_))},te=async()=>{v(!0);try{const Y=await ut("/api/admin/settings",{featureConfig:m,siteSettings:{sectionPrice:c.sectionPrice,baseBookPrice:c.baseBookPrice,distributorShare:c.distributorShare,authorInfo:c.authorInfo},mpConfig:{...p,appId:p.appId||"",withdrawSubscribeTmplId:p.withdrawSubscribeTmplId||"",mchId:p.mchId||"",minWithdraw:typeof p.minWithdraw=="number"?p.minWithdraw:10}});if(!Y||Y.success===!1){I("保存失败",(Y==null?void 0:Y.error)??"未知错误",!0);return}I("已保存","设置已保存成功。")}catch(Y){console.error("Save settings error:",Y),I("保存失败",Y instanceof Error?Y.message:String(Y),!0)}finally{v(!1)}},ie=Y=>{a(Y==="system"?{}:{tab:Y})};return k?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:"配置全站基础参数与开关"})]}),i==="system"&&e.jsxs(q,{onClick:te,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存设置"]})]}),e.jsxs(Ql,{value:i,onValueChange:ie,className:"w-full",children:[e.jsxs(Ya,{className:"mb-6 bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Ft,{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(qn,{className:"w-4 h-4 mr-2"}),"系统设置"]}),e.jsxs(Ft,{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(Md,{className:"w-4 h-4 mr-2"}),"作者详情"]}),e.jsxs(Ft,{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(zt,{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(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Md,{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(se,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Md,{className:"w-3 h-3"}),"主理人名称"]}),e.jsx(ce,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.name??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,name:Y.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(se,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(go,{className:"w-3 h-3"}),"开播日期"]}),e.jsx(ce,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:c.authorInfo.startDate??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,startDate:Y.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(se,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(go,{className:"w-3 h-3"}),"直播时间"]}),e.jsx(ce,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:c.authorInfo.liveTime??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,liveTime:Y.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(se,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(ap,{className:"w-3 h-3"}),"直播平台"]}),e.jsx(ce,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:c.authorInfo.platform??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,platform:Y.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(se,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Fs,{className:"w-3 h-3"}),"简介描述"]}),e.jsx(ce,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.description??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,description:Y.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),e.jsx(Zn,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:c.authorInfo.bio??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,bio:Y.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(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(yo,{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(se,{className:"text-gray-300",children:"单节价格 (元)"}),e.jsx(ce,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.sectionPrice,onChange:Y=>d(ne=>({...ne,sectionPrice:Number.parseFloat(Y.target.value)||1}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"整本价格 (元)"}),e.jsx(ce,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.baseBookPrice,onChange:Y=>d(ne=>({...ne,baseBookPrice:Number.parseFloat(Y.target.value)||9.9}))})]})]})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Vl,{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(se,{className:"text-gray-300",children:"小程序 AppID"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:p.appId??"",onChange:Y=>y(ne=>({...ne,appId:Y.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"提现订阅模板 ID"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:p.withdrawSubscribeTmplId??"",onChange:Y=>y(ne=>({...ne,withdrawSubscribeTmplId:Y.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"微信支付商户号"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:p.mchId??"",onChange:Y=>y(ne=>({...ne,mchId:Y.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"最低提现金额 (元)"}),e.jsx(ce,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.minWithdraw??10,onChange:Y=>y(ne=>({...ne,minWithdraw:Number.parseFloat(Y.target.value)||10}))})]})]})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(qn,{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(Yt,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(se,{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:J,onCheckedChange:Y=>V("matchEnabled",Y)})]}),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(wb,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(se,{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:J,onCheckedChange:Y=>V("referralEnabled",Y)})]}),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(Fs,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(se,{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:J,onCheckedChange:Y=>V("searchEnabled",Y)})]}),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(qn,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(se,{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:J,onCheckedChange:Y=>V("aboutEnabled",Y)})]})]}),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(zt,{value:"author",className:"mt-0",children:e.jsx(C3,{})}),e.jsx(zt,{value:"admin",className:"mt-0",children:e.jsx(k3,{})})]}),e.jsx(Ct,{open:T,onOpenChange:N,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[e.jsxs(kt,{children:[e.jsx(Et,{className:R?"text-red-400":"text-[#38bdac]",children:b}),e.jsx(b2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:E})]}),e.jsx(Ot,{className:"mt-4",children:e.jsx(q,{onClick:()=>N(!1),className:R?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const Rx={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 M3(){const[r,a]=u.useState(!1),[l,i]=u.useState(Rx),[c,d]=u.useState(""),m=async()=>{a(!0);try{const C=await Le("/api/config");C!=null&&C.paymentMethods&&i({...Rx,...C.paymentMethods})}catch(C){console.error(C)}finally{a(!1)}};u.useEffect(()=>{m()},[]);const f=async()=>{a(!0);try{await ut("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(C){console.error("保存失败:",C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}finally{a(!1)}},p=(C,E)=>{navigator.clipboard.writeText(C),d(E),setTimeout(()=>d(""),2e3)},y=(C,E)=>{i(j=>({...j,wechat:{...j.wechat,[C]:E}}))},g=(C,E)=>{i(j=>({...j,alipay:{...j.alipay,[C]:E}}))},v=(C,E)=>{i(j=>({...j,usdt:{...j.usdt,[C]:E}}))},k=(C,E)=>{i(j=>({...j,paypal:{...j.paypal,[C]:E}}))},P=l.wechat,T=l.alipay,N=l.usdt,b=l.paypal;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),e.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(q,{variant:"outline",onClick:m,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{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(It,{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(ep,{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(Ql,{defaultValue:"wechat",className:"space-y-6",children:[e.jsxs(Ya,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[e.jsxs(Ft,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[e.jsx(Vl,{className:"w-4 h-4 mr-2"}),"微信"]}),e.jsxs(Ft,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[e.jsx(Kf,{className:"w-4 h-4 mr-2"}),"支付宝"]}),e.jsxs(Ft,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[e.jsx(Wf,{className:"w-4 h-4 mr-2"}),"USDT"]}),e.jsxs(Ft,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[e.jsx(nu,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),e.jsx(zt,{value:"wechat",className:"space-y-4",children:e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(qe,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Vl,{className:"w-5 h-5"}),"微信支付配置"]}),e.jsx(vt,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(dt,{checked:!!P.enabled,onCheckedChange:C=>y("enabled",C)})]}),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(se,{className:"text-gray-300",children:"网站AppID"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:C=>y("websiteAppId",C.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"商户号"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.merchantId??""),onChange:C=>y("merchantId",C.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(fn,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"微信收款码/支付链接"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(P.qrCode??""),onChange:C=>y("qrCode",C.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(se,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),e.jsx(ce,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(P.groupQrCode??""),onChange:C=>y("groupQrCode",C.target.value)}),e.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),e.jsx(zt,{value:"alipay",className:"space-y-4",children:e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(qe,{className:"text-[#1677FF] flex items-center gap-2",children:[e.jsx(Kf,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(vt,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(dt,{checked:!!T.enabled,onCheckedChange:C=>g("enabled",C)})]}),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(se,{className:"text-gray-300",children:"合作者身份 (PID)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.partnerId??""),onChange:C=>g("partnerId",C.target.value)}),e.jsx(q,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>p(String(T.partnerId??""),"pid"),children:c==="pid"?e.jsx(Io,{className:"w-4 h-4 text-green-500"}):e.jsx(sp,{className:"w-4 h-4 text-gray-400"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"安全校验码 (Key)"}),e.jsx(ce,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.securityKey??""),onChange:C=>g("securityKey",C.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(fn,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(T.qrCode??""),onChange:C=>g("qrCode",C.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),e.jsx(zt,{value:"usdt",className:"space-y-4",children:e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(qe,{className:"text-[#26A17B] flex items-center gap-2",children:[e.jsx(Wf,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(vt,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(dt,{checked:!!N.enabled,onCheckedChange:C=>v("enabled",C)})]}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{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(N.network??"TRC20"),onChange:C=>v("network",C.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(se,{className:"text-gray-300",children:"收款地址"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(N.address??""),onChange:C=>v("address",C.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(ce,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(N.exchangeRate)??7.2,onChange:C=>v("exchangeRate",Number.parseFloat(C.target.value)||7.2)})]})]})]})}),e.jsx(zt,{value:"paypal",className:"space-y-4",children:e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(qe,{className:"text-[#169BD7] flex items-center gap-2",children:[e.jsx(nu,{className:"w-5 h-5"}),"PayPal配置"]}),e.jsx(vt,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(dt,{checked:!!b.enabled,onCheckedChange:C=>k("enabled",C)})]}),e.jsxs(Se,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"PayPal邮箱"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(b.email??""),onChange:C=>k("email",C.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(ce,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:C=>k("exchangeRate",Number(C.target.value)||7.2)})]})]})]})})]})]})}const A3={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},D3={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},L3={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function O3(){const[r,a]=u.useState({siteConfig:{...A3},menuConfig:{...D3},pageConfig:{...L3}}),[l,i]=u.useState(!1),[c,d]=u.useState(!1);u.useEffect(()=>{Le("/api/config").then(g=>{g!=null&&g.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...g.siteConfig}})),g!=null&&g.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...g.menuConfig}})),g!=null&&g.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...g.pageConfig}}))}).catch(console.error)},[]);const m=async()=>{d(!0);try{await ut("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await ut("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await ut("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),i(!0),setTimeout(()=>i(!1),2e3),alert("配置已保存")}catch(g){console.error(g),alert("保存失败: "+(g instanceof Error?g.message:String(g)))}finally{d(!1)}},f=r.siteConfig,p=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(It,{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(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(nu,{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(se,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),e.jsx(ce,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteName??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),e.jsx(ce,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteTitle??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),e.jsx(ce,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteDescription??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:g.target.value}}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),e.jsx(ce,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:f.logo??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),e.jsx(ce,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:f.favicon??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:g.target.value}}))})]})]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Jb,{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(se,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ce,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:f.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:f.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))})]})]}),e.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:f.primaryColor??"#00CED1"},children:"预览"})]})})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Gb,{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(p).map(([g,v])=>e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx(dt,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:k=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,enabled:k}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:g}),e.jsx(ce,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:k=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,label:k.target.value}}}))})]}),e.jsx("span",{className:`text-sm ${v!=null&&v.enabled?"text-green-400":"text-gray-500"}`,children:v!=null&&v.enabled?"显示":"隐藏"})]},g))})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(jb,{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(se,{className:"text-gray-300",children:"首页标题"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"首页副标题"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeSubtitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"目录页标题"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.chaptersTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"匹配页标题"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.matchTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"我的页标题"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.myTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"关于作者标题"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.aboutTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:g.target.value}}))})]})]})]})]})]})]})}function F3(){const[r,a]=u.useState(""),[l,i]=u.useState(""),[c,d]=u.useState(""),[m,f]=u.useState({}),p=async()=>{var P,T,N,b;try{const C=await Le("/api/config"),E=(T=(P=C==null?void 0:C.liveQRCodes)==null?void 0:P[0])==null?void 0:T.urls;Array.isArray(E)&&a(E.join(` +`));const j=(b=(N=C==null?void 0:C.paymentMethods)==null?void 0:N.wechat)==null?void 0:b.groupQrCode;j&&i(j),f({paymentMethods:C==null?void 0:C.paymentMethods,liveQRCodes:C==null?void 0:C.liveQRCodes})}catch(C){console.error(C)}};u.useEffect(()=>{p()},[]);const y=(P,T)=>{navigator.clipboard.writeText(P),d(T),setTimeout(()=>d(""),2e3)},g=async()=>{try{const P=r.split(` +`).map(N=>N.trim()).filter(Boolean),T=[...m.liveQRCodes||[]];T[0]?T[0].urls=P:T.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await ut("/api/db/config",{key:"live_qr_codes",value:T,description:"群活码配置"}),alert("群活码配置已保存!"),await p()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},v=async()=>{var P;try{await ut("/api/db/config",{key:"payment_methods",value:{...m.paymentMethods||{},wechat:{...((P=m.paymentMethods)==null?void 0:P.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await p()}catch(T){console.error(T),alert("保存失败: "+(T instanceof Error?T.message:String(T)))}},k=()=>{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(ep,{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(Qe,{children:[e.jsxs(qe,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Qf,{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(se,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Yf,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{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=>i(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(Io,{className:"w-4 h-4 text-green-500"}):e.jsx(sp,{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(fn,{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(vo,{className:"w-4 h-4 mr-2"}),"保存配置"]}),e.jsxs(q,{onClick:k,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[e.jsx(fn,{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(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Qf,{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(se,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Yf,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),e.jsx(Zn,{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:g,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(vo,{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 Ix={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}},z3=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function $3(){const[r,a]=u.useState(Ix),[l,i]=u.useState(!0),[c,d]=u.useState(!1),[m,f]=u.useState(!1),[p,y]=u.useState(null),[g,v]=u.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),k=async()=>{i(!0);try{const j=await Le("/api/db/config/full?key=match_config"),R=(j==null?void 0:j.data)??(j==null?void 0:j.config);R&&a({...Ix,...R})}catch(j){console.error("加载匹配配置失败:",j)}finally{i(!1)}};u.useEffect(()=>{k()},[]);const P=async()=>{d(!0);try{const j=await ut("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});j&&j.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(j&&typeof j=="object"&&"error"in j?j.error:"未知错误"))}catch(j){console.error("保存配置失败:",j),alert("保存失败")}finally{d(!1)}},T=j=>{y(j),v({id:j.id,label:j.label,matchLabel:j.matchLabel,icon:j.icon,matchFromDB:j.matchFromDB,showJoinAfterMatch:j.showJoinAfterMatch,price:j.price,enabled:j.enabled}),f(!0)},N=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(p){const R=j.findIndex(G=>G.id===p.id);R!==-1&&(j[R]={...g})}else{if(j.some(R=>R.id===g.id)){alert("类型ID已存在");return}j.push({...g})}a({...r,matchTypes:j}),f(!1)},C=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(R=>R.id!==j)})},E=j=>{a({...r,matchTypes:r.matchTypes.map(R=>R.id===j?{...R,enabled:!R.enabled}:R)})};return e.jsxs("div",{className:"p-8 w-full space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(qn,{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:k,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{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(It,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(dn,{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(se,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(ce,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:j=>a({...r,freeMatchLimit:parseInt(j.target.value,10)||0})}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(ce,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:j=>a({...r,matchPrice:parseFloat(j.target.value)||1})}),e.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(ce,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:j=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})}),e.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enableFreeMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enableFreeMatches:j}})}),e.jsx(se,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:r.settings.enablePaidMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),e.jsx(se,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Qe,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Yt,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),e.jsx(vt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(q,{onClick:N,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),e.jsx(Se,{children:e.jsxs(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:r.matchTypes.map(j=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(ge,{className:"font-mono text-gray-300",children:j.id}),e.jsx(ge,{className:"text-white font-medium",children:j.label}),e.jsx(ge,{className:"text-gray-300",children:j.matchLabel}),e.jsx(ge,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(ge,{children:j.matchFromDB?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(ge,{children:e.jsx(dt,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(ge,{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(j),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:()=>C(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(Ct,{open:m,onOpenChange:f,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[p?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Rt,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:j=>v({...g,id:j.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:z3.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"显示名称"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:g.label,onChange:j=>v({...g,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"匹配标签"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:g.matchLabel,onChange:j=>v({...g,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(ce,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:j=>v({...g,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:g.matchFromDB,onCheckedChange:j=>v({...g,matchFromDB:j})}),e.jsx(se,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:g.showJoinAfterMatch,onCheckedChange:j=>v({...g,showJoinAfterMatch:j})}),e.jsx(se,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:g.enabled,onCheckedChange:j=>v({...g,enabled:j})}),e.jsx(se,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Ot,{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:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const _x={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function B3(){const[r,a]=u.useState([]),[l,i]=u.useState(0),[c,d]=u.useState(1),[m,f]=u.useState(10),[p,y]=u.useState(""),[g,v]=u.useState(!0),[k,P]=u.useState(null);async function T(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(m)});p&&b.set("matchType",p);const C=await Le(`/api/db/match-records?${b}`);C!=null&&C.success?(a(C.records||[]),i(C.total??0)):P("加载匹配记录失败")}catch(b){console.error("加载匹配记录失败",b),P("加载失败,请检查网络后重试")}finally{v(!1)}}u.useEffect(()=>{T()},[c,p]);const N=Math.ceil(l/m)||1;return e.jsxs("div",{className:"p-8 w-full",children:[k&&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:k}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(_x).map(([b,C])=>e.jsx("option",{value:b,children:C},b))]}),e.jsxs("button",{type:"button",onClick:T,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx(Be,{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(Be,{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(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:[r.map(b=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.userAvatar?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:C=>{C.currentTarget.style.display="none";const E=C.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(ge,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.matchedUserAvatar?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:C=>{C.currentTarget.style.display="none";const E=C.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(ge,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:_x[b.matchType]||b.matchType})}),e.jsxs(ge,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(ge,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Gs,{page:c,totalPages:N,total:l,pageSize:m,onPageChange:d,onPageSizeChange:b=>{f(b),d(1)}})]})})})]})}function U3(){const[r,a]=u.useState([]),[l,i]=u.useState(!0),[c,d]=u.useState(!1),[m,f]=u.useState(null),[p,y]=u.useState(""),[g,v]=u.useState(0),[k,P]=u.useState(!1);async function T(){i(!0);try{const j=await Le("/api/db/vip-roles");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load roles error:",j)}finally{i(!1)}}u.useEffect(()=>{T()},[]);const N=()=>{f(null),y(""),v(r.length>0?Math.max(...r.map(j=>j.sort))+1:0),d(!0)},b=j=>{f(j),y(j.name),v(j.sort),d(!0)},C=async()=>{if(!p.trim()){alert("角色名称不能为空");return}P(!0);try{if(m){const j=await yt("/api/db/vip-roles",{id:m.id,name:p.trim(),sort:g});j!=null&&j.success?(d(!1),T()):alert("更新失败: "+(j==null?void 0:j.error))}else{const j=await ut("/api/db/vip-roles",{name:p.trim(),sort:g});j!=null&&j.success?(d(!1),T()):alert("新增失败: "+(j==null?void 0:j.error))}}catch(j){console.error("Save error:",j),alert("保存失败")}finally{P(!1)}},E=async j=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const R=await Er(`/api/db/vip-roles?id=${j}`);R!=null&&R.success?T():alert("删除失败: "+(R==null?void 0:R.error))}catch(R){console.error("Delete error:",R),alert("删除失败")}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(on,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),e.jsxs(q,{onClick:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{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(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:[r.map(j=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(ge,{className:"text-gray-300",children:j.id}),e.jsx(ge,{className:"text-white",children:j.name}),e.jsx(ge,{className:"text-gray-400",children:j.sort}),e.jsxs(ge,{className:"text-right",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>b(j),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>E(j.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},j.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),e.jsx(Ct,{open:c,onOpenChange:d,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(kt,{children:e.jsx(Et,{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(se,{className:"text-gray-300",children:"角色名称"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:p,onChange:j=>y(j.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),e.jsx(ce,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:g,onChange:j=>v(parseInt(j.target.value,10)||0)})]})]}),e.jsxs(Ot,{children:[e.jsxs(q,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(xs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:C,disabled:k,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),k?"保存中...":"保存"]})]})]})})]})}function Bg({embedded:r=!1}){const[a,l]=u.useState([]),[i,c]=u.useState(!0),[d,m]=u.useState(!1),[f,p]=u.useState(null),[y,g]=u.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[v,k]=u.useState(!1),[P,T]=u.useState(!1),N=u.useRef(null),b=async I=>{var V;const w=(V=I.target.files)==null?void 0:V[0];if(w){T(!0);try{const te=new FormData;te.append("file",w),te.append("folder","mentors");const ie=Ru(),Y={};ie&&(Y.Authorization=`Bearer ${ie}`);const _=await(await fetch(Ua("/api/upload"),{method:"POST",body:te,credentials:"include",headers:Y})).json();_!=null&&_.success&&(_!=null&&_.url)?g(Q=>({...Q,avatar:_.url})):alert("上传失败: "+((_==null?void 0:_.error)||"未知错误"))}catch(te){console.error(te),alert("上传失败")}finally{T(!1),N.current&&(N.current.value="")}}};async function C(){c(!0);try{const I=await Le("/api/db/mentors");I!=null&&I.success&&I.data&&l(I.data)}catch(I){console.error("Load mentors error:",I)}finally{c(!1)}}u.useEffect(()=>{C()},[]);const E=()=>{g({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:a.length>0?Math.max(...a.map(I=>I.sort))+1:0,enabled:!0})},j=()=>{p(null),E(),m(!0)},R=I=>{p(I),g({name:I.name,avatar:I.avatar||"",intro:I.intro||"",tags:I.tags||"",priceSingle:I.priceSingle!=null?String(I.priceSingle):"",priceHalfYear:I.priceHalfYear!=null?String(I.priceHalfYear):"",priceYear:I.priceYear!=null?String(I.priceYear):"",quote:I.quote||"",whyFind:I.whyFind||"",offering:I.offering||"",judgmentStyle:I.judgmentStyle||"",sort:I.sort,enabled:I.enabled??!0}),m(!0)},G=async()=>{if(!y.name.trim()){alert("导师姓名不能为空");return}k(!0);try{const I=V=>V===""?void 0:parseFloat(V),w={name:y.name.trim(),avatar:y.avatar.trim()||void 0,intro:y.intro.trim()||void 0,tags:y.tags.trim()||void 0,priceSingle:I(y.priceSingle),priceHalfYear:I(y.priceHalfYear),priceYear:I(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 V=await yt("/api/db/mentors",{id:f.id,...w});V!=null&&V.success?(m(!1),C()):alert("更新失败: "+(V==null?void 0:V.error))}else{const V=await ut("/api/db/mentors",w);V!=null&&V.success?(m(!1),C()):alert("新增失败: "+(V==null?void 0:V.error))}}catch(I){console.error("Save error:",I),alert("保存失败")}finally{k(!1)}},J=async I=>{if(confirm("确定删除该导师?"))try{const w=await Er(`/api/db/mentors?id=${I}`);w!=null&&w.success?C():alert("删除失败: "+(w==null?void 0:w.error))}catch(w){console.error("Delete error:",w),alert("删除失败")}},L=I=>I!=null?`¥${I}`:"-";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(Yt,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),e.jsxs(q,{onClick:j,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{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:i?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:[a.map(I=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(ge,{className:"text-gray-300",children:I.id}),e.jsx(ge,{className:"text-white",children:I.name}),e.jsx(ge,{className:"text-gray-400 max-w-[200px] truncate",children:I.intro||"-"}),e.jsx(ge,{className:"text-gray-400",children:L(I.priceSingle)}),e.jsx(ge,{className:"text-gray-400",children:L(I.priceHalfYear)}),e.jsx(ge,{className:"text-gray-400",children:L(I.priceYear)}),e.jsx(ge,{className:"text-gray-400",children:I.sort}),e.jsxs(ge,{className:"text-right",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>R(I),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>J(I.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},I.id)),a.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),e.jsx(Ct,{open:d,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(kt,{children:e.jsx(Et,{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(se,{className:"text-gray-300",children:"姓名 *"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:y.name,onChange:I=>g(w=>({...w,name:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"排序"}),e.jsx(ce,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:y.sort,onChange:I=>g(w=>({...w,sort:parseInt(I.target.value,10)||0}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"头像"}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ce,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:y.avatar,onChange:I=>g(w=>({...w,avatar:I.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:N,type:"file",accept:"image/*",className:"hidden",onChange:b}),e.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:P,onClick:()=>{var I;return(I=N.current)==null?void 0:I.click()},children:[e.jsx(vo,{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:Ua(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(se,{className:"text-gray-300",children:"简介"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:y.intro,onChange:I=>g(w=>({...w,intro:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:y.tags,onChange:I=>g(w=>({...w,tags:I.target.value}))})]}),e.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[e.jsx(se,{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(se,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),e.jsx(ce,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:y.priceSingle,onChange:I=>g(w=>({...w,priceSingle:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),e.jsx(ce,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:y.priceHalfYear,onChange:I=>g(w=>({...w,priceHalfYear:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),e.jsx(ce,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:y.priceYear,onChange:I=>g(w=>({...w,priceYear:I.target.value}))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"引言"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:y.quote,onChange:I=>g(w=>({...w,quote:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"为什么找(文本)"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:y.whyFind,onChange:I=>g(w=>({...w,whyFind:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"提供什么(文本)"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:y.offering,onChange:I=>g(w=>({...w,offering:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:y.judgmentStyle,onChange:I=>g(w=>({...w,judgmentStyle:I.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:y.enabled,onChange:I=>g(w=>({...w,enabled:I.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),e.jsx(se,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),e.jsxs(Ot,{children:[e.jsxs(q,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(xs,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(q,{onClick:G,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})})]})}function V3(){const[r,a]=u.useState([]),[l,i]=u.useState(!0),[c,d]=u.useState("");async function m(){i(!0);try{const y=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",g=await Le(y);g!=null&&g.success&&g.data&&a(g.data)}catch(y){console.error("Load consultations error:",y)}finally{i(!1)}}u.useEffect(()=>{m()},[c]);const f={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},p={single:"单次",half_year:"半年",year:"年度"};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(go,{className:"w-5 h-5 text-[#38bdac]"}),"导师预约列表"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师咨询预约记录"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:y=>d(y.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(f).map(([y,g])=>e.jsx("option",{value:y,children:g},y))]}),e.jsxs(q,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[e.jsx(Be,{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(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:[r.map(y=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(ge,{className:"text-gray-300",children:y.id}),e.jsx(ge,{className:"text-gray-400",children:y.userId}),e.jsx(ge,{className:"text-gray-400",children:y.mentorId}),e.jsx(ge,{className:"text-gray-400",children:p[y.consultationType]||y.consultationType}),e.jsxs(ge,{className:"text-white",children:["¥",y.amount]}),e.jsx(ge,{className:"text-gray-400",children:f[y.status]||y.status}),e.jsx(ge,{className:"text-gray-500 text-sm",children:y.createdAt})]},y.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const zl={poolSource:["vip"],requirePhone:!0,requireNickname:!0,requireAvatar:!1,requireBusiness:!1},Mx={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:zl},W3=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function H3(){const r=jn(),[a,l]=u.useState(Mx),[i,c]=u.useState(!0),[d,m]=u.useState(!1),[f,p]=u.useState(!1),[y,g]=u.useState(null),[v,k]=u.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),[P,T]=u.useState(null),[N,b]=u.useState(!1),C=async()=>{b(!0);try{const w=await Le("/api/db/match-pool-counts");w!=null&&w.success&&w.data&&T(w.data)}catch(w){console.error("加载池子人数失败:",w)}finally{b(!1)}},E=async()=>{c(!0);try{const w=await Le("/api/db/config/full?key=match_config"),V=(w==null?void 0:w.data)??(w==null?void 0:w.config);if(V){let te=V.poolSettings??zl;te.poolSource&&!Array.isArray(te.poolSource)&&(te={...te,poolSource:[te.poolSource]}),l({...Mx,...V,poolSettings:te})}}catch(w){console.error("加载匹配配置失败:",w)}finally{c(!1)}};u.useEffect(()=>{E(),C()},[]);const j=async()=>{m(!0);try{const w=await ut("/api/db/config",{key:"match_config",value:a,description:"匹配功能配置"});alert((w==null?void 0:w.success)!==!1?"配置保存成功!":"保存失败: "+((w==null?void 0:w.error)||"未知错误"))}catch(w){console.error(w),alert("保存失败")}finally{m(!1)}},R=w=>{g(w),k({...w}),p(!0)},G=()=>{g(null),k({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),p(!0)},J=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const w=[...a.matchTypes];if(y){const V=w.findIndex(te=>te.id===y.id);V!==-1&&(w[V]={...v})}else{if(w.some(V=>V.id===v.id)){alert("类型ID已存在");return}w.push({...v})}l({...a,matchTypes:w}),p(!1)},L=w=>{confirm("确定要删除这个匹配类型吗?")&&l({...a,matchTypes:a.matchTypes.filter(V=>V.id!==w)})},I=w=>{l({...a,matchTypes:a.matchTypes.map(V=>V.id===w?{...V,enabled:!V.enabled}:V)})};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:E,disabled:i,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${i?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:j,disabled:d,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"})," ",d?"保存中...":"保存配置"]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(rp,{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(se,{className:"text-gray-300",children:"匹配来源池"}),e.jsx("p",{className:"text-gray-500 text-xs",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(w=>{const V=a.poolSettings??zl,ie=(Array.isArray(V.poolSource)?V.poolSource:[V.poolSource]).includes(w.value),Y=P==null?void 0:P[w.countKey],ne=()=>{const _=Array.isArray(V.poolSource)?[...V.poolSource]:[V.poolSource],Q=ie?_.filter(ue=>ue!==w.value):[..._,w.value];Q.length===0&&Q.push(w.value),l({...a,poolSettings:{...V,poolSource:Q}})};return e.jsxs("button",{type:"button",onClick:ne,className:`p-4 rounded-lg border text-left transition-all ${ie?"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("div",{className:`w-5 h-5 rounded border-2 flex items-center justify-center text-xs ${ie?"border-[#38bdac] bg-[#38bdac] text-white":"border-gray-600"}`,children:ie&&"✓"}),e.jsx("span",{className:"text-xl",children:w.icon}),e.jsx("span",{className:`text-sm font-medium ${ie?"text-[#38bdac]":"text-gray-300"}`,children:w.label})]}),e.jsxs("span",{className:"text-lg font-bold text-white",children:[N?"...":Y??"-",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:w.desc}),e.jsx("span",{role:"link",tabIndex:0,onClick:_=>{_.stopPropagation(),r(`/users?pool=${w.value}`)},onKeyDown:_=>{_.key==="Enter"&&(_.stopPropagation(),r(`/users?pool=${w.value}`))},className:"text-[#38bdac] text-xs mt-2 inline-block hover:underline cursor-pointer",children:"查看用户列表 →"})]},w.value)})})]}),e.jsxs("div",{className:"space-y-3 pt-4 border-t border-gray-700/50",children:[e.jsx(se,{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(w=>{const te=(a.poolSettings??zl)[w.key];return e.jsxs("div",{className:"flex items-center gap-3 bg-[#0a1628] rounded-lg p-3",children:[e.jsx(dt,{checked:te,onCheckedChange:ie=>l({...a,poolSettings:{...a.poolSettings??zl,[w.key]:ie}})}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{children:w.icon}),e.jsx(se,{className:"text-gray-300 text-sm",children:w.label})]})]},w.key)})})]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Qe,{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(dn,{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(se,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(ce,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.freeMatchLimit,onChange:w=>l({...a,freeMatchLimit:parseInt(w.target.value,10)||0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(ce,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:a.matchPrice,onChange:w=>l({...a,matchPrice:parseFloat(w.target.value)||1})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(ce,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.settings.maxMatchesPerDay,onChange:w=>l({...a,settings:{...a.settings,maxMatchesPerDay:parseInt(w.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:a.settings.enableFreeMatches,onCheckedChange:w=>l({...a,settings:{...a.settings,enableFreeMatches:w}})}),e.jsx(se,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:a.settings.enablePaidMatches,onCheckedChange:w=>l({...a,settings:{...a.settings,enablePaidMatches:w}})}),e.jsx(se,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(we,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Qe,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Yt,{className:"w-5 h-5 text-[#38bdac]"})," 匹配类型管理"]}),e.jsx(vt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(q,{onClick:G,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-1"})," 添加类型"]})]}),e.jsx(Se,{children:e.jsxs(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:a.matchTypes.map(w=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{children:e.jsx("span",{className:"text-2xl",children:w.icon})}),e.jsx(ge,{className:"font-mono text-gray-300",children:w.id}),e.jsx(ge,{className:"text-white font-medium",children:w.label}),e.jsx(ge,{className:"text-gray-300",children:w.matchLabel}),e.jsx(ge,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",w.price]})}),e.jsx(ge,{children:w.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(ge,{children:e.jsx(dt,{checked:w.enabled,onCheckedChange:()=>I(w.id)})}),e.jsx(ge,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>R(w),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:()=>L(w.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},w.id))})]})})]}),e.jsx(Ct,{open:f,onOpenChange:p,children:e.jsxs(bt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[y?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Rt,{className:"w-5 h-5 text-[#38bdac]"}),y?"编辑匹配类型":"添加匹配类型"]})}),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(se,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:v.id,onChange:w=>k({...v,id:w.target.value}),disabled:!!y})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:W3.map(w=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${v.icon===w?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>k({...v,icon:w}),children:w},w))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"显示名称"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:v.label,onChange:w=>k({...v,label:w.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"匹配标签"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:v.matchLabel,onChange:w=>k({...v,matchLabel:w.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(ce,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:v.price,onChange:w=>k({...v,price:parseFloat(w.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:v.matchFromDB,onCheckedChange:w=>k({...v,matchFromDB:w})}),e.jsx(se,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:v.showJoinAfterMatch,onCheckedChange:w=>k({...v,showJoinAfterMatch:w})}),e.jsx(se,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(dt,{checked:v.enabled,onCheckedChange:w=>k({...v,enabled:w})}),e.jsx(se,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Ot,{children:[e.jsx(q,{variant:"outline",onClick:()=>p(!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(It,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const Ax={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function K3(){const[r,a]=u.useState([]),[l,i]=u.useState(0),[c,d]=u.useState(1),[m,f]=u.useState(10),[p,y]=u.useState(""),[g,v]=u.useState(!0),[k,P]=u.useState(null),[T,N]=u.useState(null);async function b(){v(!0),P(null);try{const j=new URLSearchParams({page:String(c),pageSize:String(m)});p&&j.set("matchType",p);const R=await Le(`/api/db/match-records?${j}`);R!=null&&R.success?(a(R.records||[]),i(R.total??0)):P("加载匹配记录失败")}catch{P("加载失败,请检查网络后重试")}finally{v(!1)}}u.useEffect(()=>{b()},[c,p]);const C=Math.ceil(l/m)||1,E=({userId:j,nickname:R,avatar:G})=>e.jsxs("div",{className:"flex items-center gap-3 cursor-pointer group",onClick:()=>N(j),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:[G?e.jsx("img",{src:G,alt:"",className:"w-full h-full object-cover",onError:J=>{J.currentTarget.style.display="none"}}):null,e.jsx("span",{className:G?"hidden":"",children:(R||j||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white group-hover:text-[#38bdac] transition-colors",children:R||j}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[j==null?void 0:j.slice(0,16),(j==null?void 0:j.length)>16?"...":""]})]})]});return e.jsxs("div",{children:[k&&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:k}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("p",{className:"text-gray-400",children:["共 ",l," 条匹配记录 · 点击用户名查看详情"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:j=>{y(j.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(Ax).map(([j,R])=>e.jsx("option",{value:j,children:R},j))]}),e.jsxs("button",{type:"button",onClick:b,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(Be,{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(Be,{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(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:[r.map(j=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{children:e.jsx(E,{userId:j.userId,nickname:j.userNickname,avatar:j.userAvatar})}),e.jsx(ge,{children:j.matchedUserId?e.jsx(E,{userId:j.matchedUserId,nickname:j.matchedNickname,avatar:j.matchedUserAvatar}):e.jsx("span",{className:"text-gray-500",children:"—"})}),e.jsx(ge,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Ax[j.matchType]||j.matchType})}),e.jsxs(ge,{className:"text-sm",children:[j.phone&&e.jsxs("div",{className:"text-green-400",children:["📱 ",j.phone]}),j.wechatId&&e.jsxs("div",{className:"text-blue-400",children:["💬 ",j.wechatId]}),!j.phone&&!j.wechatId&&e.jsx("span",{className:"text-gray-600",children:"-"})]}),e.jsx(ge,{className:"text-gray-400",children:j.createdAt?new Date(j.createdAt).toLocaleString():"-"})]},j.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Gs,{page:c,totalPages:C,total:l,pageSize:m,onPageChange:d,onPageSizeChange:j=>{f(j),d(1)}})]})})}),e.jsx(E0,{open:!!T,onClose:()=>N(null),userId:T,onUserUpdated:b})]})}function G3(){const[r,a]=u.useState("records");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",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:"匹配记录"}),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:"匹配池设置"})]}),r==="records"&&e.jsx(K3,{}),r==="pool"&&e.jsx(H3,{})]})}const Dx={investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function Y3(){const[r,a]=u.useState([]),[l,i]=u.useState(0),[c,d]=u.useState(1),[m,f]=u.useState(10),[p,y]=u.useState(!0),[g,v]=u.useState("investor"),[k,P]=u.useState(null);async function T(){y(!0);try{const E=new URLSearchParams({page:String(c),pageSize:String(m),matchType:g}),j=await Le(`/api/db/match-records?${E}`);j!=null&&j.success&&(a(j.records||[]),i(j.total??0))}catch(E){console.error(E)}finally{y(!1)}}u.useEffect(()=>{T()},[c,g]);const N=async E=>{if(!E.phone&&!E.wechatId){alert("该记录无联系方式,无法推送到存客宝");return}P(E.id);try{const j=await ut("/api/ckb/join",{type:E.matchType||"investor",phone:E.phone||"",wechat:E.wechatId||"",userId:E.userId,name:E.userNickname||""});alert((j==null?void 0:j.message)||(j!=null&&j.success?"推送成功":"推送失败"))}catch(j){alert("推送失败: "+(j instanceof Error?j.message:"网络错误"))}finally{P(null)}},b=Math.ceil(l/m)||1,C=E=>!!(E.phone||E.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:g,onChange:E=>{v(E.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:Object.entries(Dx).map(([E,j])=>e.jsx("option",{value:E,children:j},E))}),e.jsxs(q,{onClick:T,disabled:p,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${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(Be,{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(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:[r.map(E=>{var j,R;return e.jsxs(et,{className:`border-gray-700/50 ${C(E)?"hover:bg-[#0a1628]":"opacity-60"}`,children:[e.jsx(ge,{className:"text-white",children:E.userNickname||((j=E.userId)==null?void 0:j.slice(0,12))}),e.jsx(ge,{className:"text-white",children:E.matchedNickname||((R=E.matchedUserId)==null?void 0:R.slice(0,12))}),e.jsx(ge,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Dx[E.matchType]||E.matchType})}),e.jsxs(ge,{className:"text-sm",children:[E.phone&&e.jsxs("div",{className:"text-green-400",children:["📱 ",E.phone]}),E.wechatId&&e.jsxs("div",{className:"text-blue-400",children:["💬 ",E.wechatId]}),!E.phone&&!E.wechatId&&e.jsx("span",{className:"text-gray-600",children:"无联系方式"})]}),e.jsx(ge,{className:"text-gray-400 text-sm",children:E.createdAt?new Date(E.createdAt).toLocaleString():"-"}),e.jsx(ge,{className:"text-right",children:C(E)?e.jsxs(q,{size:"sm",onClick:()=>N(E),disabled:k===E.id,className:"bg-[#38bdac] hover:bg-[#2da396] text-white text-xs h-7 px-3",children:[e.jsx(hN,{className:"w-3 h-3 mr-1"}),k===E.id?"推送中...":"推送CKB"]}):e.jsx("span",{className:"text-gray-600 text-xs",children:"—"})})]},E.id)}),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:6,className:"text-center py-12 text-gray-500",children:"暂无记录"})})]})]}),e.jsx(Gs,{page:c,totalPages:b,total:l,pageSize:m,onPageChange:d,onPageSizeChange:E=>{f(E),d(1)}})]})})})]})}const Lx={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},Q3={single:"单次",half_year:"半年",year:"年度"};function q3(){const[r,a]=u.useState([]),[l,i]=u.useState(!0),[c,d]=u.useState("");async function m(){i(!0);try{const f=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",p=await Le(f);p!=null&&p.success&&p.data&&a(p.data)}catch(f){console.error(f)}finally{i(!1)}}return u.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=>d(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(Lx).map(([f,p])=>e.jsx("option",{value:f,children:p},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(Be,{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(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:[r.map(f=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(ge,{className:"text-gray-300",children:f.id}),e.jsx(ge,{className:"text-gray-400",children:f.userId}),e.jsx(ge,{className:"text-gray-400",children:f.mentorId}),e.jsx(ge,{className:"text-gray-400",children:Q3[f.consultationType]||f.consultationType}),e.jsxs(ge,{className:"text-white",children:["¥",f.amount]}),e.jsx(ge,{className:"text-gray-400",children:Lx[f.status]||f.status}),e.jsx(ge,{className:"text-gray-500 text-sm",children:f.createdAt?new Date(f.createdAt).toLocaleString():"-"})]},f.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function X3(){const[r,a]=u.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(q3,{}),r==="manage"&&e.jsx("div",{className:"-mx-8",children:e.jsx(Bg,{embedded:!0})})]})}function J3(){const[r,a]=u.useState([]),[l,i]=u.useState(0),[c,d]=u.useState(1),[m,f]=u.useState(10),[p,y]=u.useState(!0);async function g(){y(!0);try{const k=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"team"}),P=await Le(`/api/db/match-records?${k}`);P!=null&&P.success&&(a(P.records||[]),i(P.total??0))}catch(k){console.error(k)}finally{y(!1)}}u.useEffect(()=>{g()},[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:g,disabled:p,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx(Be,{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(Be,{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(ps,{children:[e.jsx(gs,{children:e.jsxs(et,{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(ys,{children:[r.map(k=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{className:"text-white",children:k.userNickname||k.userId}),e.jsx(ge,{className:"text-white",children:k.matchedNickname||k.matchedUserId}),e.jsxs(ge,{className:"text-gray-400 text-sm",children:[k.phone&&e.jsxs("div",{children:["📱 ",k.phone]}),k.wechatId&&e.jsxs("div",{children:["💬 ",k.wechatId]}),!k.phone&&!k.wechatId&&"-"]}),e.jsx(ge,{className:"text-gray-400",children:k.createdAt?new Date(k.createdAt).toLocaleString():"-"})]},k.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无团队招募记录"})})]})]}),e.jsx(Gs,{page:c,totalPages:v,total:l,pageSize:m,onPageChange:d,onPageSizeChange:k=>{f(k),d(1)}})]})})})]})}const Ox={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},Fx={partner:"⭐",investor:"👥",mentor:"❤️",team:"🎮"};function Z3({onSwitchTab:r,onOpenCKB:a}={}){const l=jn(),[i,c]=u.useState(null),[d,m]=u.useState(null),[f,p]=u.useState(!0),y=u.useCallback(async()=>{var v,k;p(!0);try{const[P,T]=await Promise.allSettled([Le("/api/db/match-records?stats=true"),Le("/api/db/ckb-plan-stats")]);if(P.status==="fulfilled"&&((v=P.value)!=null&&v.success)&&P.value.data){let N=P.value.data;if(N.totalMatches>0&&(!N.uniqueUsers||N.uniqueUsers===0))try{const b=await Le("/api/db/match-records?page=1&pageSize=200");if(b!=null&&b.success&&b.records){const C=new Set(b.records.map(E=>E.userId).filter(Boolean));N={...N,uniqueUsers:C.size}}}catch{}c(N)}T.status==="fulfilled"&&((k=T.value)!=null&&k.success)&&T.value.data&&m(T.value.data)}catch(P){console.error("加载统计失败:",P)}finally{p(!1)}},[]);u.useEffect(()=>{y()},[y]);const g=v=>f?"—":String(v??0);return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(Yt,{className:"w-5 h-5 text-[#38bdac]"})," 找伙伴数据"]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-5",children:[e.jsx(we,{className:"bg-gradient-to-br from-[#0f2137] to-[#162d4a] border-gray-700/40 cursor-pointer hover:border-[#38bdac]/60 transition-all",onClick:()=>r==null?void 0:r("partner"),children:e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"总匹配次数"}),e.jsx("p",{className:"text-4xl font-bold text-white",children:g(i==null?void 0:i.totalMatches)}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-3 flex items-center gap-1",children:[e.jsx(fn,{className:"w-3 h-3"})," 查看匹配记录"]})]})}),e.jsx(we,{className:"bg-gradient-to-br from-[#0f2137] to-[#162d4a] border-gray-700/40 cursor-pointer hover:border-yellow-500/60 transition-all",onClick:()=>r==null?void 0:r("partner"),children:e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"今日匹配"}),e.jsx("p",{className:"text-4xl font-bold text-white",children:g(i==null?void 0:i.todayMatches)}),e.jsxs("p",{className:"text-yellow-400/60 text-xs mt-3 flex items-center gap-1",children:[e.jsx(dn,{className:"w-3 h-3"})," 今日实时"]})]})}),e.jsx(we,{className:"bg-gradient-to-br from-[#0f2137] to-[#162d4a] border-gray-700/40 cursor-pointer hover:border-blue-500/60 transition-all",onClick:()=>l("/users"),children:e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"匹配用户数"}),e.jsx("p",{className:"text-4xl font-bold text-white",children:g(i==null?void 0:i.uniqueUsers)}),e.jsxs("p",{className:"text-blue-400/60 text-xs mt-3 flex items-center gap-1",children:[e.jsx(fn,{className:"w-3 h-3"})," 查看用户管理"]})]})}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/40",children:e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"人均匹配"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:f?"—":i!=null&&i.uniqueUsers?(i.totalMatches/i.uniqueUsers).toFixed(1):"0"})]})}),e.jsx(we,{className:"bg-[#0f2137] border-gray-700/40",children:e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"付费匹配次数"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:g(i==null?void 0:i.paidMatchCount)})]})})]})]}),(i==null?void 0:i.byType)&&i.byType.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"各类型匹配分布"}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:i.byType.map(v=>{const k=i.totalMatches>0?v.count/i.totalMatches*100:0;return e.jsxs("div",{className:"bg-[#0f2137] border border-gray-700/40 rounded-xl p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"text-2xl",children:Fx[v.matchType]||"📊"}),e.jsx("span",{className:"text-gray-300 font-medium",children:Ox[v.matchType]||v.matchType})]}),e.jsx("p",{className:"text-3xl font-bold text-white mb-2",children:v.count}),e.jsx("div",{className:"w-full h-2 bg-gray-700/50 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#38bdac] rounded-full transition-all",style:{width:`${Math.min(k,100)}%`}})}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1.5",children:[k.toFixed(1),"%"]})]},v.matchType)})})]}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(kr,{className:"w-5 h-5 text-orange-400"})," AI 获客数据"]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-5 mb-6",children:[e.jsx(we,{className:"bg-[#0f2137] border-orange-500/20 cursor-pointer hover:border-orange-500/50 transition-colors",onClick:()=>a==null?void 0:a("submitted"),children:e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"已提交线索"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:f?"—":(d==null?void 0:d.ckbTotal)??0}),e.jsx("p",{className:"text-orange-400/60 text-xs mt-2",children:"点击查看明细 →"})]})}),e.jsx(we,{className:"bg-[#0f2137] border-orange-500/20 cursor-pointer hover:border-orange-500/50 transition-colors",onClick:()=>a==null?void 0:a("contact"),children:e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"有联系方式"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:f?"—":(d==null?void 0:d.withContact)??0}),e.jsx("p",{className:"text-orange-400/60 text-xs mt-2",children:"点击查看明细 →"})]})}),e.jsx(we,{className:"bg-[#0f2137] border-orange-500/20 cursor-pointer hover:border-orange-500/50 transition-colors",onClick:()=>a==null?void 0:a("test"),children:e.jsxs(Se,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"AI 添加进度"}),e.jsx("p",{className:"text-xl font-bold text-orange-400",children:"查看详情 →"}),e.jsx("p",{className:"text-gray-500 text-xs mt-2",children:"添加成功率 · 回复率 · API 文档"})]})})]}),(d==null?void 0:d.byType)&&d.byType.length>0&&e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-6",children:d.byType.map(v=>e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-lg p-4 flex items-center gap-3",children:[e.jsx("span",{className:"text-xl",children:Fx[v.matchType]||"📋"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:Ox[v.matchType]||v.matchType}),e.jsx("p",{className:"text-xl font-bold text-white",children:v.total})]})]},v.matchType))})]})]})}const eC=["partner","investor","mentor","team"],qd=[{key:"join_partner",label:"找伙伴场景"},{key:"join_investor",label:"资源对接场景"},{key:"join_mentor",label:"导师顾问场景"},{key:"join_team",label:"团队招募场景"},{key:"match",label:"匹配上报"},{key:"lead",label:"链接卡若"}],zx=`# 场景获客接口摘要 +- 地址:POST /v1/api/scenarios +- 必填:apiKey、sign、timestamp +- 主标识:phone 或 wechatId 至少一项 +- 可选:name、source、remark、tags、siteTags、portrait +- 签名:排除 sign/apiKey/portrait,键名升序拼接值后双重 MD5 +- 成功:code=200,message=新增成功 或 已存在`;function tC({initialTab:r="overview"}){const[a,l]=u.useState(r),[i,c]=u.useState("13800000000"),[d,m]=u.useState(""),[f,p]=u.useState(""),[y,g]=u.useState(zx),[v,k]=u.useState(!1),[P,T]=u.useState(!1),[N,b]=u.useState([]),[C,E]=u.useState([]),[j,R]=u.useState({}),[G,J]=u.useState([{endpoint:"/api/ckb/join",label:"找伙伴",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"资源对接",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"导师顾问",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"团队招募",method:"POST",status:"idle"},{endpoint:"/api/ckb/match",label:"匹配上报",method:"POST",status:"idle"},{endpoint:"/api/miniprogram/ckb/lead",label:"链接卡若",method:"POST",status:"idle"},{endpoint:"/api/match/config",label:"匹配配置",method:"GET",status:"idle"}]),L=u.useMemo(()=>{const _={};return qd.forEach(Q=>{_[Q.key]=j[Q.key]||{apiUrl:"https://ckbapi.quwanzhi.com/v1/api/scenarios",apiKey:"fyngh-ecy9h-qkdae-epwd5-rz6kd",source:"",tags:"",siteTags:"创业实验APP",notes:""}}),_},[j]),I=_=>{const Q=i.trim(),ue=d.trim();return _<=3?{type:eC[_],phone:Q||void 0,wechat:ue||void 0,userId:"admin_test",name:"后台测试"}:_===4?{matchType:"partner",phone:Q||void 0,wechat:ue||void 0,userId:"admin_test",nickname:"后台测试",matchedUser:{id:"test",nickname:"测试",matchScore:88}}:_===5?{phone:Q||void 0,wechatId:ue||void 0,userId:"admin_test",name:"后台测试"}:{}};async function w(){T(!0);try{const[_,Q,ue]=await Promise.all([Le("/api/db/config/full?key=ckb_config"),Le("/api/db/ckb-leads?mode=submitted&page=1&pageSize=50"),Le("/api/db/ckb-leads?mode=contact&page=1&pageSize=50")]),O=_==null?void 0:_.data;O!=null&&O.routes&&R(O.routes),O!=null&&O.docNotes&&p(O.docNotes),O!=null&&O.docContent&&g(O.docContent),Q!=null&&Q.success&&b(Q.records||[]),ue!=null&&ue.success&&E(ue.records||[])}finally{T(!1)}}u.useEffect(()=>{l(r)},[r]),u.useEffect(()=>{w()},[]);async function V(){k(!0);try{const _=await ut("/api/db/config",{key:"ckb_config",value:{routes:L,docNotes:f,docContent:y},description:"存客宝接口配置"});alert((_==null?void 0:_.success)!==!1?"存客宝配置已保存":`保存失败: ${(_==null?void 0:_.error)||"未知错误"}`)}catch(_){alert(`保存失败: ${_ instanceof Error?_.message:"网络错误"}`)}finally{k(!1)}}const te=(_,Q)=>{R(ue=>({...ue,[_]:{...L[_],...Q}}))},ie=async _=>{const Q=G[_];if(Q.method==="POST"&&!i.trim()&&!d.trim()){alert("请填写测试手机号");return}const ue=[...G];ue[_]={...Q,status:"testing",message:void 0,responseTime:void 0},J(ue);const O=performance.now();try{const re=Q.method==="GET"?await Le(Q.endpoint):await ut(Q.endpoint,I(_)),H=Math.round(performance.now()-O),A=(re==null?void 0:re.message)||"",$=(re==null?void 0:re.success)===!0||A.includes("已存在")||A.includes("已加入")||A.includes("已提交"),F=[...G];F[_]={...Q,status:$?"success":"error",message:A||($?"正常":"异常"),responseTime:H},J(F),await w()}catch(re){const H=Math.round(performance.now()-O),A=[...G];A[_]={...Q,status:"error",message:re instanceof Error?re.message:"失败",responseTime:H},J(A)}},Y=async()=>{if(!i.trim()&&!d.trim()){alert("请填写测试手机号");return}for(let _=0;_e.jsx("div",{className:"overflow-auto rounded-lg border border-gray-700/30",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-[#0a1628] text-gray-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-3",children:"发起人"}),e.jsx("th",{className:"text-left px-4 py-3",children:"类型"}),e.jsx("th",{className:"text-left px-4 py-3",children:"手机号"}),e.jsx("th",{className:"text-left px-4 py-3",children:"微信号"}),e.jsx("th",{className:"text-left px-4 py-3",children:"时间"})]})}),e.jsx("tbody",{children:_.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"text-center py-10 text-gray-500",children:Q})}):_.map(ue=>e.jsxs("tr",{className:"border-t border-gray-700/30",children:[e.jsx("td",{className:"px-4 py-3 text-white",children:ue.userNickname||ue.userId}),e.jsx("td",{className:"px-4 py-3 text-gray-300",children:ue.matchType}),e.jsx("td",{className:"px-4 py-3 text-green-400",children:ue.phone||"—"}),e.jsx("td",{className:"px-4 py-3 text-blue-400",children:ue.wechatId||"—"}),e.jsx("td",{className:"px-4 py-3 text-gray-400",children:ue.createdAt?new Date(ue.createdAt).toLocaleString():"—"})]},ue.id))})]})});return e.jsx(we,{className:"bg-[#0f2137] border-orange-500/30 mb-6",children:e.jsxs(Se,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h3",{className:"text-white font-semibold",children:"存客宝工作台"}),e.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 border-0 text-xs",children:"CKB"}),e.jsxs("button",{type:"button",onClick:()=>l("doc"),className:"text-orange-400/60 text-xs hover:text-orange-400 flex items-center gap-1",children:[e.jsx(fn,{className:"w-3 h-3"})," API 文档"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(q,{onClick:()=>w(),variant:"outline",size:"sm",className:"border-gray-700 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-3.5 h-3.5 mr-1 ${P?"animate-spin":""}`})," 刷新"]}),e.jsxs(q,{onClick:V,disabled:v,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-3.5 h-3.5 mr-1"})," ",v?"保存中...":"保存配置"]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-5",children:[["overview","概览"],["submitted","已提交线索"],["contact","有联系方式"],["config","场景配置"],["test","接口测试"],["doc","API 文档"]].map(([_,Q])=>e.jsx("button",{type:"button",onClick:()=>l(_),className:`px-4 py-2 rounded-lg text-sm transition-colors ${a===_?"bg-orange-500 text-white":"bg-[#0a1628] text-gray-400 hover:text-white"}`,children:Q},_))}),a==="overview"&&e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-xl p-5",children:[e.jsx("p",{className:"text-gray-400 text-xs mb-2",children:"已提交线索"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:N.length})]}),e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-xl p-5",children:[e.jsx("p",{className:"text-gray-400 text-xs mb-2",children:"有联系方式"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:C.length})]}),e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-xl p-5",children:[e.jsx("p",{className:"text-gray-400 text-xs mb-2",children:"场景配置数"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:qd.length})]}),e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-xl p-5",children:[e.jsx("p",{className:"text-gray-400 text-xs mb-2",children:"文档备注"}),e.jsx("p",{className:"text-sm text-gray-300 line-clamp-3",children:f||"未填写"})]})]}),a==="submitted"&&ne(N,"暂无已提交线索"),a==="contact"&&ne(C,"暂无有联系方式线索"),a==="config"&&e.jsx("div",{className:"space-y-4",children:qd.map(_=>e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"text-white font-medium",children:_.label}),e.jsx(Oe,{className:"bg-orange-500/20 text-orange-300 border-0 text-xs",children:_.key})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(se,{className:"text-gray-500 text-xs",children:"API 地址"}),e.jsx(ce,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:L[_.key].apiUrl,onChange:Q=>te(_.key,{apiUrl:Q.target.value})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(se,{className:"text-gray-500 text-xs",children:"API Key"}),e.jsx(ce,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:L[_.key].apiKey,onChange:Q=>te(_.key,{apiKey:Q.target.value})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(se,{className:"text-gray-500 text-xs",children:"Source"}),e.jsx(ce,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:L[_.key].source,onChange:Q=>te(_.key,{source:Q.target.value})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(se,{className:"text-gray-500 text-xs",children:"Tags"}),e.jsx(ce,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:L[_.key].tags,onChange:Q=>te(_.key,{tags:Q.target.value})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(se,{className:"text-gray-500 text-xs",children:"SiteTags"}),e.jsx(ce,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:L[_.key].siteTags,onChange:Q=>te(_.key,{siteTags:Q.target.value})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(se,{className:"text-gray-500 text-xs",children:"说明备注"}),e.jsx(ce,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:L[_.key].notes,onChange:Q=>te(_.key,{notes:Q.target.value})})]})]})]},_.key))}),a==="test"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-3 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx(Vl,{className:"w-4 h-4 text-gray-500 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(se,{className:"text-gray-500 text-xs",children:"测试手机号"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white h-8 text-sm mt-0.5",value:i,onChange:_=>c(_.target.value)})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx("span",{className:"text-gray-500 text-sm shrink-0",children:"💬"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(se,{className:"text-gray-500 text-xs",children:"微信号(可选)"}),e.jsx(ce,{className:"bg-[#0a1628] border-gray-700 text-white h-8 text-sm mt-0.5",value:d,onChange:_=>m(_.target.value)})]})]}),e.jsx("div",{className:"flex items-end",children:e.jsxs(q,{onClick:Y,className:"bg-orange-500 hover:bg-orange-600 text-white",children:[e.jsx(dn,{className:"w-3.5 h-3.5 mr-1"})," 全部测试"]})})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2",children:G.map((_,Q)=>e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg px-3 py-2 border border-gray-700/30",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[_.status==="idle"&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-600 shrink-0"}),_.status==="testing"&&e.jsx(Be,{className:"w-3 h-3 text-yellow-400 animate-spin shrink-0"}),_.status==="success"&&e.jsx(su,{className:"w-3 h-3 text-green-400 shrink-0"}),_.status==="error"&&e.jsx(tp,{className:"w-3 h-3 text-red-400 shrink-0"}),e.jsx("span",{className:"text-white text-xs truncate",children:_.label})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[_.responseTime!==void 0&&e.jsxs("span",{className:"text-gray-600 text-[10px]",children:[_.responseTime,"ms"]}),e.jsx("button",{type:"button",onClick:()=>ie(Q),disabled:_.status==="testing",className:"text-orange-400/60 hover:text-orange-400 text-[10px] disabled:opacity-50",children:"测试"})]})]},`${_.endpoint}-${Q}`))})]}),a==="doc"&&e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg border border-gray-700/30 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"text-white text-sm font-medium",children:"场景获客 API 摘要"}),e.jsxs("a",{href:"https://ckbapi.quwanzhi.com/v1/api/scenarios",target:"_blank",rel:"noreferrer",className:"text-orange-400/70 hover:text-orange-400 text-xs flex items-center gap-1",children:[e.jsx(fn,{className:"w-3 h-3"})," 打开外链"]})]}),e.jsx("pre",{className:"whitespace-pre-wrap text-xs text-gray-400 leading-6",children:y||zx})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg border border-gray-700/30 p-4",children:[e.jsx("h4",{className:"text-white text-sm font-medium mb-3",children:"说明备注(可编辑)"}),e.jsx("textarea",{className:"w-full min-h-[260px] bg-[#0f2137] border border-gray-700 rounded-md text-sm text-gray-300 p-3 outline-none focus:border-orange-500/50 resize-y",value:f,onChange:_=>p(_.target.value),placeholder:"记录 Token、入口差异、回复率统计规则、对接约定等。"})]})]})]})})}const sC=[{id:"stats",label:"数据统计",icon:qj},{id:"partner",label:"找伙伴",icon:Yt},{id:"resource",label:"资源对接",icon:Ib},{id:"mentor",label:"导师预约",icon:Pb},{id:"team",label:"团队招募",icon:lu}];function rC(){const[r,a]=u.useState("stats"),[l,i]=u.useState(!1),[c,d]=u.useState("overview");return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Yt,{className:"w-6 h-6 text-[#38bdac]"}),"找伙伴"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"数据统计、匹配池与记录、资源对接、导师预约、团队招募"})]}),e.jsxs(q,{type:"button",variant:"outline",onClick:()=>i(m=>!m),className:"border-orange-500/40 text-orange-300 hover:bg-orange-500/10 bg-transparent",children:[e.jsx(kr,{className:"w-4 h-4 mr-2"}),"存客宝"]})]}),l&&e.jsx(tC,{initialTab:c}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:sC.map(m=>{const f=r===m.id;return e.jsxs("button",{type:"button",onClick:()=>a(m.id),className:`flex items-center gap-2 px-5 py-2.5 rounded-md text-sm font-medium transition-all ${f?"bg-[#38bdac] text-white shadow-lg":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:[e.jsx(m.icon,{className:"w-4 h-4"}),m.label]},m.id)})}),r==="stats"&&e.jsx(Z3,{onSwitchTab:m=>a(m),onOpenCKB:m=>{d(m||"overview"),i(!0)}}),r==="partner"&&e.jsx(G3,{}),r==="resource"&&e.jsx(Y3,{}),r==="mentor"&&e.jsx(X3,{}),r==="team"&&e.jsx(J3,{})]})}function nC(){return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[e.jsx(kr,{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(Qe,{children:e.jsx(qe,{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(Qe,{children:e.jsx(qe,{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(Qe,{children:e.jsx(qe,{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(Qe,{children:e.jsx(qe,{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(Qe,{children:e.jsx(qe,{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 aC(){const r=vn();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(nb,{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(tu,{to:"/",children:[e.jsx(Mb,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function lC(){return e.jsxs(Ej,{children:[e.jsx(gt,{path:"/login",element:e.jsx(D1,{})}),e.jsxs(gt,{path:"/",element:e.jsx(FN,{}),children:[e.jsx(gt,{index:!0,element:e.jsx(_d,{to:"/dashboard",replace:!0})}),e.jsx(gt,{path:"dashboard",element:e.jsx(O1,{})}),e.jsx(gt,{path:"orders",element:e.jsx(N2,{})}),e.jsx(gt,{path:"users",element:e.jsx(Y2,{})}),e.jsx(gt,{path:"distribution",element:e.jsx(p4,{})}),e.jsx(gt,{path:"withdrawals",element:e.jsx(g4,{})}),e.jsx(gt,{path:"content",element:e.jsx(S3,{})}),e.jsx(gt,{path:"referral-settings",element:e.jsx(U0,{})}),e.jsx(gt,{path:"author-settings",element:e.jsx(_d,{to:"/settings?tab=author",replace:!0})}),e.jsx(gt,{path:"admin-users",element:e.jsx(_d,{to:"/settings?tab=admin",replace:!0})}),e.jsx(gt,{path:"vip-roles",element:e.jsx(U3,{})}),e.jsx(gt,{path:"mentors",element:e.jsx(Bg,{})}),e.jsx(gt,{path:"mentor-consultations",element:e.jsx(V3,{})}),e.jsx(gt,{path:"settings",element:e.jsx(_3,{})}),e.jsx(gt,{path:"payment",element:e.jsx(M3,{})}),e.jsx(gt,{path:"site",element:e.jsx(O3,{})}),e.jsx(gt,{path:"qrcodes",element:e.jsx(F3,{})}),e.jsx(gt,{path:"find-partner",element:e.jsx(rC,{})}),e.jsx(gt,{path:"match",element:e.jsx($3,{})}),e.jsx(gt,{path:"match-records",element:e.jsx(B3,{})}),e.jsx(gt,{path:"api-doc",element:e.jsx(nC,{})})]}),e.jsx(gt,{path:"*",element:e.jsx(aC,{})})]})}Iv.createRoot(document.getElementById("root")).render(e.jsx(u.StrictMode,{children:e.jsx(Dj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(lC,{})})})); diff --git a/soul-admin/dist/assets/index-UTI6lIW2.js b/soul-admin/dist/assets/index-UTI6lIW2.js deleted file mode 100644 index 9f5f9a2b..00000000 --- a/soul-admin/dist/assets/index-UTI6lIW2.js +++ /dev/null @@ -1,501 +0,0 @@ -function Nv(r,a){for(var l=0;li[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"]'))i(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function Mx(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var yd={exports:{}},Cl={},vd={exports:{}},Ze={};/** - * @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 vf;function wv(){if(vf)return Ze;vf=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),m=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function k(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,N={};function j(A,z,O){this.props=A,this.context=z,this.refs=N,this.updater=O||P}j.prototype.isReactComponent={},j.prototype.setState=function(A,z){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,z,"setState")},j.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=j.prototype;function E(A,z,O){this.props=A,this.context=z,this.refs=N,this.updater=O||P}var b=E.prototype=new C;b.constructor=E,T(b,j.prototype),b.isPureReactComponent=!0;var R=Array.isArray,G=Object.prototype.hasOwnProperty,X={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function I(A,z,O){var ee,K={},de=null,q=null;if(z!=null)for(ee in z.ref!==void 0&&(q=z.ref),z.key!==void 0&&(de=""+z.key),z)G.call(z,ee)&&!D.hasOwnProperty(ee)&&(K[ee]=z[ee]);var ye=arguments.length-2;if(ye===1)K.children=O;else if(1>>1,z=L[A];if(0>>1;Ac(K,H))dec(q,K)?(L[A]=q,L[de]=H,A=de):(L[A]=K,L[ee]=H,A=ee);else if(dec(q,H))L[A]=q,L[de]=H,A=de;else break e}}return re}function c(L,re){var H=L.sortIndex-re.sortIndex;return H!==0?H:L.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var m=Date,f=m.now();r.unstable_now=function(){return m.now()-f}}var p=[],y=[],g=1,v=null,k=3,P=!1,T=!1,N=!1,j=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(L){for(var re=l(y);re!==null;){if(re.callback===null)i(y);else if(re.startTime<=L)i(y),re.sortIndex=re.expirationTime,a(p,re);else break;re=l(y)}}function R(L){if(N=!1,b(L),!T)if(l(p)!==null)T=!0,Q(G);else{var re=l(y);re!==null&&ue(R,re.startTime-L)}}function G(L,re){T=!1,N&&(N=!1,C(I),I=-1),P=!0;var H=k;try{for(b(re),v=l(p);v!==null&&(!(v.expirationTime>re)||L&&!se());){var A=v.callback;if(typeof A=="function"){v.callback=null,k=v.priorityLevel;var z=A(v.expirationTime<=re);re=r.unstable_now(),typeof z=="function"?v.callback=z:v===l(p)&&i(p),b(re)}else i(p);v=l(p)}if(v!==null)var O=!0;else{var ee=l(y);ee!==null&&ue(R,ee.startTime-re),O=!1}return O}finally{v=null,k=H,P=!1}}var X=!1,D=null,I=-1,w=5,V=-1;function se(){return!(r.unstable_now()-VL||125A?(L.sortIndex=H,a(y,L),l(p)===null&&L===l(y)&&(N?(C(I),I=-1):N=!0,ue(R,H-A))):(L.sortIndex=z,a(p,L),T||P||(T=!0,Q(G))),L},r.unstable_shouldYield=se,r.unstable_wrapCallback=function(L){var re=k;return function(){var H=k;k=re;try{return L.apply(this,arguments)}finally{k=H}}}})(Nd)),Nd}var Sf;function Ev(){return Sf||(Sf=1,jd.exports=kv()),jd.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 Cf;function Pv(){if(Cf)return hs;Cf=1;var r=fu(),a=Ev();function l(t){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,y=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},v={};function k(t){return p.call(v,t)?!0:p.call(g,t)?!1:y.test(t)?v[t]=!0:(g[t]=!0,!1)}function P(t,s,n,o){if(n!==null&&n.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return o?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function T(t,s,n,o){if(s===null||typeof s>"u"||P(t,s,n,o))return!0;if(o)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 N(t,s,n,o,u,x,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=o,this.attributeNamespace=u,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 N(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 N(s,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){j[t]=new N(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){j[t]=new N(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 N(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){j[t]=new N(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){j[t]=new N(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){j[t]=new N(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){j[t]=new N(t,5,!1,t.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function E(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var s=t.replace(C,E);j[s]=new N(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(C,E);j[s]=new N(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(C,E);j[s]=new N(s,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){j[t]=new N(t,1,!1,t.toLowerCase(),null,!1,!1)}),j.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){j[t]=new N(t,1,!1,t.toLowerCase(),null,!0,!0)});function b(t,s,n,o){var u=j.hasOwnProperty(s)?j[s]:null;(u!==null?u.type!==0:o||!(2M||u[S]!==x[M]){var U=` -`+u[S].replace(" at new "," at ");return t.displayName&&U.includes("")&&(U=U.replace("",t.displayName)),U}while(1<=S&&0<=M);break}}}finally{O=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?z(t):""}function K(t){switch(t.tag){case 5:return z(t.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return t=ee(t.type,!1),t;case 11:return t=ee(t.type.render,!1),t;case 1:return t=ee(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 D:return"Fragment";case X:return"Portal";case w:return"Profiler";case I:return"StrictMode";case Y:return"Suspense";case ne:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case se:return(t.displayName||"Context")+".Consumer";case V: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 _:return s=t.displayName||null,s!==null?s:de(t.type)||"Memo";case Q:s=t._payload,t=t._init;try{return de(t(s))}catch{}}return null}function q(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===I?"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 ye(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Se(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function F(t){var s=Se(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),o=""+t[s];if(!t.hasOwnProperty(s)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var u=n.get,x=n.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return u.call(this)},set:function(S){o=""+S,x.call(this,S)}}),Object.defineProperty(t,s,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function xe(t){t._valueTracker||(t._valueTracker=F(t))}function ke(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var n=s.getValue(),o="";return t&&(o=Se(t)?t.checked?"true":"false":t.value),t=o,t!==n?(s.setValue(t),!0):!1}function Ve(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function We(t,s){var n=s.checked;return H({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Ke(t,s){var n=s.defaultValue==null?"":s.defaultValue,o=s.checked!=null?s.checked:s.defaultChecked;n=ye(s.value!=null?s.value:n),t._wrapperState={initialChecked:o,initialValue:n,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function tt(t,s){s=s.checked,s!=null&&b(t,"checked",s,!1)}function $e(t,s){tt(t,s);var n=ye(s.value),o=s.type;if(n!=null)o==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(o==="submit"||o==="reset"){t.removeAttribute("value");return}s.hasOwnProperty("value")?pe(t,s.type,n):s.hasOwnProperty("defaultValue")&&pe(t,s.type,ye(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(t.defaultChecked=!!s.defaultChecked)}function me(t,s,n){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var o=s.type;if(!(o!=="submit"&&o!=="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 pe(t,s,n){(s!=="number"||Ve(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ft=Array.isArray;function es(t,s,n,o){if(t=t.options,s){s={};for(var u=0;u"+s.valueOf().toString()+"",s=gs.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;s.firstChild;)t.appendChild(s.firstChild)}});function mr(t,s){if(s){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=s;return}}t.textContent=s}var Cs={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},Yn=["Webkit","ms","Moz","O"];Object.keys(Cs).forEach(function(t){Yn.forEach(function(s){s=s+t.charAt(0).toUpperCase()+t.substring(1),Cs[s]=Cs[t]})});function Qn(t,s,n){return s==null||typeof s=="boolean"||s===""?"":n||typeof s!="number"||s===0||Cs.hasOwnProperty(t)&&Cs[t]?(""+s).trim():s+"px"}function ks(t,s){t=t.style;for(var n in s)if(s.hasOwnProperty(n)){var o=n.indexOf("--")===0,u=Qn(n,s[n],o);n==="float"&&(n="cssFloat"),o?t.setProperty(n,u):t[n]=u}}var Sn=H({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 fr(t,s){if(s){if(Sn[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 ys(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 Ds=null;function Ls(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Cn=null,Es=null,Os=null;function Fs(t){if(t=dl(t)){if(typeof Cn!="function")throw Error(l(280));var s=t.stateNode;s&&(s=oi(s),Cn(t.stateNode,t.type,s))}}function qn(t){Es?Os?Os.push(t):Os=[t]:Es=t}function Xn(){if(Es){var t=Es,s=Os;if(Os=Es=null,Fs(t),s)for(t=0;t>>=0,t===0?32:31-(Fg(t)/zg|0)|0}var Wl=64,Hl=4194304;function Ka(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Kl(t,s){var n=t.pendingLanes;if(n===0)return 0;var o=0,u=t.suspendedLanes,x=t.pingedLanes,S=n&268435455;if(S!==0){var M=S&~u;M!==0?o=Ka(M):(x&=S,x!==0&&(o=Ka(x)))}else S=n&~u,S!==0?o=Ka(S):x!==0&&(o=Ka(x));if(o===0)return 0;if(s!==0&&s!==o&&(s&u)===0&&(u=o&-o,x=s&-s,u>=x||u===16&&(x&4194240)!==0))return s;if((o&4)!==0&&(o|=n&16),s=t.entangledLanes,s!==0)for(t=t.entanglements,s&=o;0n;n++)s.push(t);return s}function Ga(t,s,n){t.pendingLanes|=s,s!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,s=31-Bs(s),t[s]=n}function Vg(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 o=t.eventTimes;for(t=t.expirationTimes;0=tl),uh=" ",hh=!1;function mh(t,s){switch(t){case"keyup":return gy.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ra=!1;function vy(t,s){switch(t){case"compositionend":return fh(s);case"keypress":return s.which!==32?null:(hh=!0,uh);case"textInput":return t=s.data,t===uh&&hh?null:t;default:return null}}function by(t,s){if(ra)return t==="compositionend"||!Jo&&mh(t,s)?(t=ah(),Xl=Ko=zr=null,ra=!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)return{node:n,offset:s-t};t=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=jh(n)}}function wh(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?wh(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function Sh(){for(var t=window,s=Ve();s instanceof t.HTMLIFrameElement;){try{var n=typeof s.contentWindow.location.href=="string"}catch{n=!1}if(n)t=s.contentWindow;else break;s=Ve(t.document)}return s}function tc(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 Ty(t){var s=Sh(),n=t.focusedElem,o=t.selectionRange;if(s!==n&&n&&n.ownerDocument&&wh(n.ownerDocument.documentElement,n)){if(o!==null&&tc(n)){if(s=o.start,t=o.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 u=n.textContent.length,x=Math.min(o.start,u);o=o.end===void 0?x:Math.min(o.end,u),!t.extend&&x>o&&(u=o,o=x,x=u),u=Nh(n,x);var S=Nh(n,o);u&&S&&(t.rangeCount!==1||t.anchorNode!==u.node||t.anchorOffset!==u.offset||t.focusNode!==S.node||t.focusOffset!==S.offset)&&(s=s.createRange(),s.setStart(u.node,u.offset),t.removeAllRanges(),x>o?(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=document.documentMode,na=null,sc=null,al=null,rc=!1;function Ch(t,s,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;rc||na==null||na!==Ve(o)||(o=na,"selectionStart"in o&&tc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),al&&nl(al,o)||(al=o,o=ai(sc,"onSelect"),0ca||(t.current=xc[ca],xc[ca]=null,ca--)}function ht(t,s){ca++,xc[ca]=t.current,t.current=s}var Vr={},Qt=Ur(Vr),is=Ur(!1),Rn=Vr;function da(t,s){var n=t.type.contextTypes;if(!n)return Vr;var o=t.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===s)return o.__reactInternalMemoizedMaskedChildContext;var u={},x;for(x in n)u[x]=s[x];return o&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=u),u}function os(t){return t=t.childContextTypes,t!=null}function ci(){gt(is),gt(Qt)}function $h(t,s,n){if(Qt.current!==Vr)throw Error(l(168));ht(Qt,s),ht(is,n)}function Bh(t,s,n){var o=t.stateNode;if(s=s.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var u in o)if(!(u in s))throw Error(l(108,q(t)||"Unknown",u));return H({},n,o)}function di(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Vr,Rn=Qt.current,ht(Qt,t),ht(is,is.current),!0}function Uh(t,s,n){var o=t.stateNode;if(!o)throw Error(l(169));n?(t=Bh(t,s,Rn),o.__reactInternalMemoizedMergedChildContext=t,gt(is),gt(Qt),ht(Qt,t)):gt(is),ht(is,n)}var gr=null,ui=!1,pc=!1;function Vh(t){gr===null?gr=[t]:gr.push(t)}function By(t){ui=!0,Vh(t)}function Wr(){if(!pc&&gr!==null){pc=!0;var t=0,s=it;try{var n=gr;for(it=1;t>=S,u-=S,yr=1<<32-Bs(s)+u|n<Ue?(Wt=ze,ze=null):Wt=ze.sibling;var rt=he(Z,ze,ae[Ue],be);if(rt===null){ze===null&&(ze=Wt);break}t&&ze&&rt.alternate===null&&s(Z,ze),W=x(rt,W,Ue),Fe===null?De=rt:Fe.sibling=rt,Fe=rt,ze=Wt}if(Ue===ae.length)return n(Z,ze),jt&&_n(Z,Ue),De;if(ze===null){for(;UeUe?(Wt=ze,ze=null):Wt=ze.sibling;var Zr=he(Z,ze,rt.value,be);if(Zr===null){ze===null&&(ze=Wt);break}t&&ze&&Zr.alternate===null&&s(Z,ze),W=x(Zr,W,Ue),Fe===null?De=Zr:Fe.sibling=Zr,Fe=Zr,ze=Wt}if(rt.done)return n(Z,ze),jt&&_n(Z,Ue),De;if(ze===null){for(;!rt.done;Ue++,rt=ae.next())rt=ve(Z,rt.value,be),rt!==null&&(W=x(rt,W,Ue),Fe===null?De=rt:Fe.sibling=rt,Fe=rt);return jt&&_n(Z,Ue),De}for(ze=o(Z,ze);!rt.done;Ue++,rt=ae.next())rt=Pe(ze,Z,Ue,rt.value,be),rt!==null&&(t&&rt.alternate!==null&&ze.delete(rt.key===null?Ue:rt.key),W=x(rt,W,Ue),Fe===null?De=rt:Fe.sibling=rt,Fe=rt);return t&&ze.forEach(function(jv){return s(Z,jv)}),jt&&_n(Z,Ue),De}function _t(Z,W,ae,be){if(typeof ae=="object"&&ae!==null&&ae.type===D&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case G:e:{for(var De=ae.key,Fe=W;Fe!==null;){if(Fe.key===De){if(De=ae.type,De===D){if(Fe.tag===7){n(Z,Fe.sibling),W=u(Fe,ae.props.children),W.return=Z,Z=W;break e}}else if(Fe.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Q&&Qh(De)===Fe.type){n(Z,Fe.sibling),W=u(Fe,ae.props),W.ref=ul(Z,Fe,ae),W.return=Z,Z=W;break e}n(Z,Fe);break}else s(Z,Fe);Fe=Fe.sibling}ae.type===D?(W=$n(ae.props.children,Z.mode,be,ae.key),W.return=Z,Z=W):(be=zi(ae.type,ae.key,ae.props,null,Z.mode,be),be.ref=ul(Z,W,ae),be.return=Z,Z=be)}return S(Z);case X:e:{for(Fe=ae.key;W!==null;){if(W.key===Fe)if(W.tag===4&&W.stateNode.containerInfo===ae.containerInfo&&W.stateNode.implementation===ae.implementation){n(Z,W.sibling),W=u(W,ae.children||[]),W.return=Z,Z=W;break e}else{n(Z,W);break}else s(Z,W);W=W.sibling}W=md(ae,Z.mode,be),W.return=Z,Z=W}return S(Z);case Q:return Fe=ae._init,_t(Z,W,Fe(ae._payload),be)}if(ft(ae))return Ie(Z,W,ae,be);if(re(ae))return Ae(Z,W,ae,be);xi(Z,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"?(ae=""+ae,W!==null&&W.tag===6?(n(Z,W.sibling),W=u(W,ae),W.return=Z,Z=W):(n(Z,W),W=hd(ae,Z.mode,be),W.return=Z,Z=W),S(Z)):n(Z,W)}return _t}var fa=qh(!0),Xh=qh(!1),pi=Ur(null),gi=null,xa=null,Nc=null;function wc(){Nc=xa=gi=null}function Sc(t){var s=pi.current;gt(pi),t._currentValue=s}function Cc(t,s,n){for(;t!==null;){var o=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,o!==null&&(o.childLanes|=s)):o!==null&&(o.childLanes&s)!==s&&(o.childLanes|=s),t===n)break;t=t.return}}function pa(t,s){gi=t,Nc=xa=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&s)!==0&&(cs=!0),t.firstContext=null)}function Rs(t){var s=t._currentValue;if(Nc!==t)if(t={context:t,memoizedValue:s,next:null},xa===null){if(gi===null)throw Error(l(308));xa=t,gi.dependencies={lanes:0,firstContext:t}}else xa=xa.next=t;return s}var Mn=null;function kc(t){Mn===null?Mn=[t]:Mn.push(t)}function Jh(t,s,n,o){var u=s.interleaved;return u===null?(n.next=n,kc(s)):(n.next=u.next,u.next=n),s.interleaved=n,br(t,o)}function br(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 Hr=!1;function Ec(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zh(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 jr(t,s){return{eventTime:t,lane:s,tag:0,payload:null,callback:null,next:null}}function Kr(t,s,n){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(st&2)!==0){var u=o.pending;return u===null?s.next=s:(s.next=u.next,u.next=s),o.pending=s,br(t,n)}return u=o.interleaved,u===null?(s.next=s,kc(o)):(s.next=u.next,u.next=s),o.interleaved=s,br(t,n)}function yi(t,s,n){if(s=s.updateQueue,s!==null&&(s=s.shared,(n&4194240)!==0)){var o=s.lanes;o&=t.pendingLanes,n|=o,s.lanes=n,Bo(t,n)}}function em(t,s){var n=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,n===o)){var u=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?u=x=S:x=x.next=S,n=n.next}while(n!==null);x===null?u=x=s:x=x.next=s}else u=x=s;n={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:x,shared:o.shared,effects:o.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=s:t.next=s,n.lastBaseUpdate=s}function vi(t,s,n,o){var u=t.updateQueue;Hr=!1;var x=u.firstBaseUpdate,S=u.lastBaseUpdate,M=u.shared.pending;if(M!==null){u.shared.pending=null;var U=M,le=U.next;U.next=null,S===null?x=le:S.next=le,S=U;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,M=fe.lastBaseUpdate,M!==S&&(M===null?fe.firstBaseUpdate=le:M.next=le,fe.lastBaseUpdate=U))}if(x!==null){var ve=u.baseState;S=0,fe=le=U=null,M=x;do{var he=M.lane,Pe=M.eventTime;if((o&he)===he){fe!==null&&(fe=fe.next={eventTime:Pe,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var Ie=t,Ae=M;switch(he=s,Pe=n,Ae.tag){case 1:if(Ie=Ae.payload,typeof Ie=="function"){ve=Ie.call(Pe,ve,he);break e}ve=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Ae.payload,he=typeof Ie=="function"?Ie.call(Pe,ve,he):Ie,he==null)break e;ve=H({},ve,he);break e;case 2:Hr=!0}}M.callback!==null&&M.lane!==0&&(t.flags|=64,he=u.effects,he===null?u.effects=[M]:he.push(M))}else Pe={eventTime:Pe,lane:he,tag:M.tag,payload:M.payload,callback:M.callback,next:null},fe===null?(le=fe=Pe,U=ve):fe=fe.next=Pe,S|=he;if(M=M.next,M===null){if(M=u.shared.pending,M===null)break;he=M,M=he.next,he.next=null,u.lastBaseUpdate=he,u.shared.pending=null}}while(!0);if(fe===null&&(U=ve),u.baseState=U,u.firstBaseUpdate=le,u.lastBaseUpdate=fe,s=u.shared.interleaved,s!==null){u=s;do S|=u.lane,u=u.next;while(u!==s)}else x===null&&(u.shared.lanes=0);Ln|=S,t.lanes=S,t.memoizedState=ve}}function tm(t,s,n){if(t=s.effects,s.effects=null,t!==null)for(s=0;sn?n:4,t(!0);var o=_c.transition;_c.transition={};try{t(!1),s()}finally{it=n,_c.transition=o}}function bm(){return Is().memoizedState}function Hy(t,s,n){var o=qr(t);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},jm(t))Nm(s,n);else if(n=Jh(t,s,n,o),n!==null){var u=rs();Gs(n,t,o,u),wm(n,s,o)}}function Ky(t,s,n){var o=qr(t),u={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(jm(t))Nm(s,u);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(u.hasEagerState=!0,u.eagerState=M,Us(M,S)){var U=s.interleaved;U===null?(u.next=u,kc(s)):(u.next=U.next,U.next=u),s.interleaved=u;return}}catch{}finally{}n=Jh(t,s,u,o),n!==null&&(u=rs(),Gs(n,t,o,u),wm(n,s,o))}}function jm(t){var s=t.alternate;return t===St||s!==null&&s===St}function Nm(t,s){xl=Ni=!0;var n=t.pending;n===null?s.next=s:(s.next=n.next,n.next=s),t.pending=s}function wm(t,s,n){if((n&4194240)!==0){var o=s.lanes;o&=t.pendingLanes,n|=o,s.lanes=n,Bo(t,n)}}var Ci={readContext:Rs,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useInsertionEffect:qt,useLayoutEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useMutableSource:qt,useSyncExternalStore:qt,useId:qt,unstable_isNewReconciler:!1},Gy={readContext:Rs,useCallback:function(t,s){return nr().memoizedState=[t,s===void 0?null:s],t},useContext:Rs,useEffect:hm,useImperativeHandle:function(t,s,n){return n=n!=null?n.concat([t]):null,wi(4194308,4,xm.bind(null,s,t),n)},useLayoutEffect:function(t,s){return wi(4194308,4,t,s)},useInsertionEffect:function(t,s){return wi(4,2,t,s)},useMemo:function(t,s){var n=nr();return s=s===void 0?null:s,t=t(),n.memoizedState=[t,s],t},useReducer:function(t,s,n){var o=nr();return s=n!==void 0?n(s):s,o.memoizedState=o.baseState=s,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},o.queue=t,t=t.dispatch=Hy.bind(null,St,t),[o.memoizedState,t]},useRef:function(t){var s=nr();return t={current:t},s.memoizedState=t},useState:dm,useDebugValue:zc,useDeferredValue:function(t){return nr().memoizedState=t},useTransition:function(){var t=dm(!1),s=t[0];return t=Wy.bind(null,t[1]),nr().memoizedState=t,[s,t]},useMutableSource:function(){},useSyncExternalStore:function(t,s,n){var o=St,u=nr();if(jt){if(n===void 0)throw Error(l(407));n=n()}else{if(n=s(),Vt===null)throw Error(l(349));(Dn&30)!==0||am(o,s,n)}u.memoizedState=n;var x={value:n,getSnapshot:s};return u.queue=x,hm(im.bind(null,o,x,t),[t]),o.flags|=2048,yl(9,lm.bind(null,o,x,n,s),void 0,null),n},useId:function(){var t=nr(),s=Vt.identifierPrefix;if(jt){var n=vr,o=yr;n=(o&~(1<<32-Bs(o)-1)).toString(32)+n,s=":"+s+"R"+n,n=pl++,0<\/script>",t=t.removeChild(t.firstChild)):typeof o.is=="string"?t=S.createElement(n,{is:o.is}):(t=S.createElement(n),n==="select"&&(S=t,o.multiple?S.multiple=!0:o.size&&(S.size=o.size))):t=S.createElementNS(t,n),t[sr]=s,t[cl]=o,Vm(t,s,!1,!1),s.stateNode=t;e:{switch(S=ys(n,o),n){case"dialog":pt("cancel",t),pt("close",t),u=o;break;case"iframe":case"object":case"embed":pt("load",t),u=o;break;case"video":case"audio":for(u=0;uja&&(s.flags|=128,o=!0,vl(x,!1),s.lanes=4194304)}else{if(!o)if(t=bi(S),t!==null){if(s.flags|=128,o=!0,n=t.updateQueue,n!==null&&(s.updateQueue=n,s.flags|=4),vl(x,!0),x.tail===null&&x.tailMode==="hidden"&&!S.alternate&&!jt)return Xt(s),null}else 2*dt()-x.renderingStartTime>ja&&n!==1073741824&&(s.flags|=128,o=!0,vl(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=dt(),s.sibling=null,n=wt.current,ht(wt,o?n&1|2:n&1),s):(Xt(s),null);case 22:case 23:return cd(),o=s.memoizedState!==null,t!==null&&t.memoizedState!==null!==o&&(s.flags|=8192),o&&(s.mode&1)!==0?(Ns&1073741824)!==0&&(Xt(s),s.subtreeFlags&6&&(s.flags|=8192)):Xt(s),null;case 24:return null;case 25:return null}throw Error(l(156,s.tag))}function tv(t,s){switch(yc(s),s.tag){case 1:return os(s.type)&&ci(),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return ga(),gt(is),gt(Qt),Ic(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 5:return Tc(s),null;case 13:if(gt(wt),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));ma()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return gt(wt),null;case 4:return ga(),null;case 10:return Sc(s.type._context),null;case 22:case 23:return cd(),null;case 24:return null;default:return null}}var Ti=!1,Jt=!1,sv=typeof WeakSet=="function"?WeakSet:Set,Re=null;function va(t,s){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(o){Tt(t,s,o)}else n.current=null}function Xc(t,s,n){try{n()}catch(o){Tt(t,s,o)}}var Km=!1;function rv(t,s){if(cc=Ql,t=Sh(),tc(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var u=o.anchorOffset,x=o.focusNode;o=o.focusOffset;try{n.nodeType,x.nodeType}catch{n=null;break e}var S=0,M=-1,U=-1,le=0,fe=0,ve=t,he=null;t:for(;;){for(var Pe;ve!==n||u!==0&&ve.nodeType!==3||(M=S+u),ve!==x||o!==0&&ve.nodeType!==3||(U=S+o),ve.nodeType===3&&(S+=ve.nodeValue.length),(Pe=ve.firstChild)!==null;)he=ve,ve=Pe;for(;;){if(ve===t)break t;if(he===n&&++le===u&&(M=S),he===x&&++fe===o&&(U=S),(Pe=ve.nextSibling)!==null)break;ve=he,he=ve.parentNode}ve=Pe}n=M===-1||U===-1?null:{start:M,end:U}}else n=null}n=n||{start:0,end:0}}else n=null;for(dc={focusedElem:t,selectionRange:n},Ql=!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 Ie=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Ie!==null){var Ae=Ie.memoizedProps,_t=Ie.memoizedState,Z=s.stateNode,W=Z.getSnapshotBeforeUpdate(s.elementType===s.type?Ae:Ws(s.type,Ae),_t);Z.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var ae=s.stateNode.containerInfo;ae.nodeType===1?ae.textContent="":ae.nodeType===9&&ae.documentElement&&ae.removeChild(ae.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(be){Tt(s,s.return,be)}if(t=s.sibling,t!==null){t.return=s.return,Re=t;break}Re=s.return}return Ie=Km,Km=!1,Ie}function bl(t,s,n){var o=s.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&t)===t){var x=u.destroy;u.destroy=void 0,x!==void 0&&Xc(s,n,x)}u=u.next}while(u!==o)}}function Ri(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 o=n.create;n.destroy=o()}n=n.next}while(n!==s)}}function Jc(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 Gm(t){var s=t.alternate;s!==null&&(t.alternate=null,Gm(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&(delete s[sr],delete s[cl],delete s[fc],delete s[zy],delete s[$y])),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 Ym(t){return t.tag===5||t.tag===3||t.tag===4}function Qm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ym(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 Zc(t,s,n){var o=t.tag;if(o===5||o===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=ii));else if(o!==4&&(t=t.child,t!==null))for(Zc(t,s,n),t=t.sibling;t!==null;)Zc(t,s,n),t=t.sibling}function ed(t,s,n){var o=t.tag;if(o===5||o===6)t=t.stateNode,s?n.insertBefore(t,s):n.appendChild(t);else if(o!==4&&(t=t.child,t!==null))for(ed(t,s,n),t=t.sibling;t!==null;)ed(t,s,n),t=t.sibling}var Gt=null,Hs=!1;function Gr(t,s,n){for(n=n.child;n!==null;)qm(t,s,n),n=n.sibling}function qm(t,s,n){if(tr&&typeof tr.onCommitFiberUnmount=="function")try{tr.onCommitFiberUnmount(Vl,n)}catch{}switch(n.tag){case 5:Jt||va(n,s);case 6:var o=Gt,u=Hs;Gt=null,Gr(t,s,n),Gt=o,Hs=u,Gt!==null&&(Hs?(t=Gt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Gt.removeChild(n.stateNode));break;case 18:Gt!==null&&(Hs?(t=Gt,n=n.stateNode,t.nodeType===8?mc(t.parentNode,n):t.nodeType===1&&mc(t,n),Ja(t)):mc(Gt,n.stateNode));break;case 4:o=Gt,u=Hs,Gt=n.stateNode.containerInfo,Hs=!0,Gr(t,s,n),Gt=o,Hs=u;break;case 0:case 11:case 14:case 15:if(!Jt&&(o=n.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){u=o=o.next;do{var x=u,S=x.destroy;x=x.tag,S!==void 0&&((x&2)!==0||(x&4)!==0)&&Xc(n,s,S),u=u.next}while(u!==o)}Gr(t,s,n);break;case 1:if(!Jt&&(va(n,s),o=n.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=n.memoizedProps,o.state=n.memoizedState,o.componentWillUnmount()}catch(M){Tt(n,s,M)}Gr(t,s,n);break;case 21:Gr(t,s,n);break;case 22:n.mode&1?(Jt=(o=Jt)||n.memoizedState!==null,Gr(t,s,n),Jt=o):Gr(t,s,n);break;default:Gr(t,s,n)}}function Xm(t){var s=t.updateQueue;if(s!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new sv),s.forEach(function(o){var u=hv.bind(null,t,o);n.has(o)||(n.add(o),o.then(u,u))})}}function Ks(t,s){var n=s.deletions;if(n!==null)for(var o=0;ou&&(u=S),o&=~x}if(o=u,o=dt()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*av(o/1960))-o,10t?16:t,Qr===null)var o=!1;else{if(t=Qr,Qr=null,Di=0,(st&6)!==0)throw Error(l(331));var u=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 U=0;Udt()-rd?Fn(t,0):sd|=n),us(t,s)}function uf(t,s){s===0&&((t.mode&1)===0?s=1:(s=Hl,Hl<<=1,(Hl&130023424)===0&&(Hl=4194304)));var n=rs();t=br(t,s),t!==null&&(Ga(t,s,n),us(t,n))}function uv(t){var s=t.memoizedState,n=0;s!==null&&(n=s.retryLane),uf(t,n)}function hv(t,s){var n=0;switch(t.tag){case 13:var o=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:o=t.stateNode;break;default:throw Error(l(314))}o!==null&&o.delete(s),uf(t,n)}var hf;hf=function(t,s,n){if(t!==null)if(t.memoizedProps!==s.pendingProps||is.current)cs=!0;else{if((t.lanes&n)===0&&(s.flags&128)===0)return cs=!1,Zy(t,s,n);cs=(t.flags&131072)!==0}else cs=!1,jt&&(s.flags&1048576)!==0&&Wh(s,mi,s.index);switch(s.lanes=0,s.tag){case 2:var o=s.type;Pi(t,s),t=s.pendingProps;var u=da(s,Qt.current);pa(s,n),u=Ac(null,s,o,t,u,n);var x=Dc();return s.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,os(o)?(x=!0,di(s)):x=!1,s.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Ec(s),u.updater=ki,s.stateNode=u,u._reactInternals=s,Bc(s,o,t,n),s=Hc(null,s,o,!0,x,n)):(s.tag=0,jt&&x&&gc(s),ss(null,s,u,n),s=s.child),s;case 16:o=s.elementType;e:{switch(Pi(t,s),t=s.pendingProps,u=o._init,o=u(o._payload),s.type=o,u=s.tag=fv(o),t=Ws(o,t),u){case 0:s=Wc(null,s,o,t,n);break e;case 1:s=Om(null,s,o,t,n);break e;case 11:s=_m(null,s,o,t,n);break e;case 14:s=Mm(null,s,o,Ws(o.type,t),n);break e}throw Error(l(306,o,""))}return s;case 0:return o=s.type,u=s.pendingProps,u=s.elementType===o?u:Ws(o,u),Wc(t,s,o,u,n);case 1:return o=s.type,u=s.pendingProps,u=s.elementType===o?u:Ws(o,u),Om(t,s,o,u,n);case 3:e:{if(Fm(s),t===null)throw Error(l(387));o=s.pendingProps,x=s.memoizedState,u=x.element,Zh(t,s),vi(s,o,null,n);var S=s.memoizedState;if(o=S.element,x.isDehydrated)if(x={element:o,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){u=ya(Error(l(423)),s),s=zm(t,s,o,n,u);break e}else if(o!==u){u=ya(Error(l(424)),s),s=zm(t,s,o,n,u);break e}else for(js=Br(s.stateNode.containerInfo.firstChild),bs=s,jt=!0,Vs=null,n=Xh(s,null,o,n),s.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ma(),o===u){s=Nr(t,s,n);break e}ss(t,s,o,n)}s=s.child}return s;case 5:return sm(s),t===null&&bc(s),o=s.type,u=s.pendingProps,x=t!==null?t.memoizedProps:null,S=u.children,uc(o,u)?S=null:x!==null&&uc(o,x)&&(s.flags|=32),Lm(t,s),ss(t,s,S,n),s.child;case 6:return t===null&&bc(s),null;case 13:return $m(t,s,n);case 4:return Pc(s,s.stateNode.containerInfo),o=s.pendingProps,t===null?s.child=fa(s,null,o,n):ss(t,s,o,n),s.child;case 11:return o=s.type,u=s.pendingProps,u=s.elementType===o?u:Ws(o,u),_m(t,s,o,u,n);case 7:return ss(t,s,s.pendingProps,n),s.child;case 8:return ss(t,s,s.pendingProps.children,n),s.child;case 12:return ss(t,s,s.pendingProps.children,n),s.child;case 10:e:{if(o=s.type._context,u=s.pendingProps,x=s.memoizedProps,S=u.value,ht(pi,o._currentValue),o._currentValue=S,x!==null)if(Us(x.value,S)){if(x.children===u.children&&!is.current){s=Nr(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 U=M.firstContext;U!==null;){if(U.context===o){if(x.tag===1){U=jr(-1,n&-n),U.tag=2;var le=x.updateQueue;if(le!==null){le=le.shared;var fe=le.pending;fe===null?U.next=U:(U.next=fe.next,fe.next=U),le.pending=U}}x.lanes|=n,U=x.alternate,U!==null&&(U.lanes|=n),Cc(x.return,n,s),M.lanes|=n;break}U=U.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),Cc(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}ss(t,s,u.children,n),s=s.child}return s;case 9:return u=s.type,o=s.pendingProps.children,pa(s,n),u=Rs(u),o=o(u),s.flags|=1,ss(t,s,o,n),s.child;case 14:return o=s.type,u=Ws(o,s.pendingProps),u=Ws(o.type,u),Mm(t,s,o,u,n);case 15:return Am(t,s,s.type,s.pendingProps,n);case 17:return o=s.type,u=s.pendingProps,u=s.elementType===o?u:Ws(o,u),Pi(t,s),s.tag=1,os(o)?(t=!0,di(s)):t=!1,pa(s,n),Cm(s,o,u),Bc(s,o,u,n),Hc(null,s,o,!0,t,n);case 19:return Um(t,s,n);case 22:return Dm(t,s,n)}throw Error(l(156,s.tag))};function mf(t,s){return B(t,s)}function mv(t,s,n,o){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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ms(t,s,n,o){return new mv(t,s,n,o)}function ud(t){return t=t.prototype,!(!t||!t.isReactComponent)}function fv(t){if(typeof t=="function")return ud(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ie)return 11;if(t===_)return 14}return 2}function Jr(t,s){var n=t.alternate;return n===null?(n=Ms(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 zi(t,s,n,o,u,x){var S=2;if(o=t,typeof t=="function")ud(t)&&(S=1);else if(typeof t=="string")S=5;else e:switch(t){case D:return $n(n.children,u,x,s);case I:S=8,u|=8;break;case w:return t=Ms(12,n,s,u|2),t.elementType=w,t.lanes=x,t;case Y:return t=Ms(13,n,s,u),t.elementType=Y,t.lanes=x,t;case ne:return t=Ms(19,n,s,u),t.elementType=ne,t.lanes=x,t;case ue:return $i(n,u,x,s);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case V:S=10;break e;case se:S=9;break e;case ie:S=11;break e;case _:S=14;break e;case Q:S=16,o=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return s=Ms(S,n,s,u),s.elementType=t,s.type=o,s.lanes=x,s}function $n(t,s,n,o){return t=Ms(7,t,o,s),t.lanes=n,t}function $i(t,s,n,o){return t=Ms(22,t,o,s),t.elementType=ue,t.lanes=n,t.stateNode={isHidden:!1},t}function hd(t,s,n){return t=Ms(6,t,null,s),t.lanes=n,t}function md(t,s,n){return s=Ms(4,t.children!==null?t.children:[],t.key,s),s.lanes=n,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}function xv(t,s,n,o,u){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=$o(0),this.expirationTimes=$o(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$o(0),this.identifierPrefix=o,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function fd(t,s,n,o,u,x,S,M,U){return t=new xv(t,s,n,M,U),s===1?(s=1,x===!0&&(s|=8)):s=0,x=Ms(3,null,null,s),t.current=x,x.stateNode=t,x.memoizedState={element:o,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ec(x),t}function pv(t,s,n){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),bd.exports=Pv(),bd.exports}var Ef;function Tv(){if(Ef)return Gi;Ef=1;var r=Ax();return Gi.createRoot=r.createRoot,Gi.hydrateRoot=r.hydrateRoot,Gi}var Rv=Tv(),Ol=Ax();const Iv=Mx(Ol);/** - * @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 Il(){return Il=Object.assign?Object.assign.bind():function(r){for(var a=1;a"u")throw new Error(a)}function xu(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Mv(){return Math.random().toString(36).substr(2,8)}function Tf(r,a){return{usr:r.state,key:r.key,idx:a}}function Vd(r,a,l,i){return l===void 0&&(l=null),Il({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Oa(a):a,{state:l,key:a&&a.key||i||Mv()})}function io(r){let{pathname:a="/",search:l="",hash:i=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),i&&i!=="#"&&(a+=i.charAt(0)==="#"?i:"#"+i),a}function Oa(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let i=r.indexOf("?");i>=0&&(a.search=r.substr(i),r=r.substr(0,i)),r&&(a.pathname=r)}return a}function Av(r,a,l,i){i===void 0&&(i={});let{window:c=document.defaultView,v5Compat:d=!1}=i,m=c.history,f=an.Pop,p=null,y=g();y==null&&(y=0,m.replaceState(Il({},m.state,{idx:y}),""));function g(){return(m.state||{idx:null}).idx}function v(){f=an.Pop;let j=g(),C=j==null?null:j-y;y=j,p&&p({action:f,location:N.location,delta:C})}function k(j,C){f=an.Push;let E=Vd(N.location,j,C);y=g()+1;let b=Tf(E,y),R=N.createHref(E);try{m.pushState(b,"",R)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;c.location.assign(R)}d&&p&&p({action:f,location:N.location,delta:1})}function P(j,C){f=an.Replace;let E=Vd(N.location,j,C);y=g();let b=Tf(E,y),R=N.createHref(E);m.replaceState(b,"",R),d&&p&&p({action:f,location:N.location,delta:0})}function T(j){let C=c.location.origin!=="null"?c.location.origin:c.location.href,E=typeof j=="string"?j:io(j);return E=E.replace(/ $/,"%20"),Mt(C,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,C)}let N={get action(){return f},get location(){return r(c,m)},listen(j){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Pf,v),p=j,()=>{c.removeEventListener(Pf,v),p=null}},createHref(j){return a(c,j)},createURL:T,encodeLocation(j){let C=T(j);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:k,replace:P,go(j){return m.go(j)}};return N}var Rf;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Rf||(Rf={}));function Dv(r,a,l){return l===void 0&&(l="/"),Lv(r,a,l)}function Lv(r,a,l,i){let c=typeof a=="string"?Oa(a):a,d=pu(c.pathname||"/",l);if(d==null)return null;let m=Dx(r);Ov(m);let f=null;for(let p=0;f==null&&p{let p={relativePath:f===void 0?d.path||"":f,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};p.relativePath.startsWith("/")&&(Mt(p.relativePath.startsWith(i),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(i.length));let y=on([i,p.relativePath]),g=l.concat(p);d.children&&d.children.length>0&&(Mt(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Dx(d.children,a,g,y)),!(d.path==null&&!d.index)&&a.push({path:y,score:Wv(y,d.index),routesMeta:g})};return r.forEach((d,m)=>{var f;if(d.path===""||!((f=d.path)!=null&&f.includes("?")))c(d,m);else for(let p of Lx(d.path))c(d,m,p)}),a}function Lx(r){let a=r.split("/");if(a.length===0)return[];let[l,...i]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(i.length===0)return c?[d,""]:[d];let m=Lx(i.join("/")),f=[];return f.push(...m.map(p=>p===""?d:[d,p].join("/"))),c&&f.push(...m),f.map(p=>r.startsWith("/")&&p===""?"/":p)}function Ov(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:Hv(a.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}const Fv=/^:[\w-]+$/,zv=3,$v=2,Bv=1,Uv=10,Vv=-2,If=r=>r==="*";function Wv(r,a){let l=r.split("/"),i=l.length;return l.some(If)&&(i+=Vv),a&&(i+=$v),l.filter(c=>!If(c)).reduce((c,d)=>c+(Fv.test(d)?zv:d===""?Bv:Uv),i)}function Hv(r,a){return r.length===a.length&&r.slice(0,-1).every((i,c)=>i===a[c])?r[r.length-1]-a[a.length-1]:0}function Kv(r,a,l){let{routesMeta:i}=r,c={},d="/",m=[];for(let f=0;f{let{paramName:k,isOptional:P}=g;if(k==="*"){let N=f[v]||"";m=d.slice(0,d.length-N.length).replace(/(.)\/+$/,"$1")}const T=f[v];return P&&!T?y[k]=void 0:y[k]=(T||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:m,pattern:r}}function Yv(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),xu(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 i=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,f,p)=>(i.push({paramName:f,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(i.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),i]}function Qv(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return xu(!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 pu(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,i=r.charAt(l);return i&&i!=="/"?null:r.slice(l)||"/"}const qv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xv=r=>qv.test(r);function Jv(r,a){a===void 0&&(a="/");let{pathname:l,search:i="",hash:c=""}=typeof r=="string"?Oa(r):r,d;if(l)if(Xv(l))d=l;else{if(l.includes("//")){let m=l;l=l.replace(/\/\/+/g,"/"),xu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(m+" -> "+l))}l.startsWith("/")?d=_f(l.substring(1),"/"):d=_f(l,a)}else d=a;return{pathname:d,search:tb(i),hash:sb(c)}}function _f(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 wd(r,a,l,i){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Zv(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function gu(r,a){let l=Zv(r);return a?l.map((i,c)=>c===l.length-1?i.pathname:i.pathnameBase):l.map(i=>i.pathnameBase)}function yu(r,a,l,i){i===void 0&&(i=!1);let c;typeof r=="string"?c=Oa(r):(c=Il({},r),Mt(!c.pathname||!c.pathname.includes("?"),wd("?","pathname","search",c)),Mt(!c.pathname||!c.pathname.includes("#"),wd("#","pathname","hash",c)),Mt(!c.search||!c.search.includes("#"),wd("#","search","hash",c)));let d=r===""||c.pathname==="",m=d?"/":c.pathname,f;if(m==null)f=l;else{let v=a.length-1;if(!i&&m.startsWith("..")){let k=m.split("/");for(;k[0]==="..";)k.shift(),v-=1;c.pathname=k.join("/")}f=v>=0?a[v]:"/"}let p=Jv(c,f),y=m&&m!=="/"&&m.endsWith("/"),g=(d||m===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(y||g)&&(p.pathname+="/"),p}const on=r=>r.join("/").replace(/\/\/+/g,"/"),eb=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),tb=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,sb=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function rb(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Ox=["post","put","patch","delete"];new Set(Ox);const nb=["get",...Ox];new Set(nb);/** - * 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 _l(){return _l=Object.assign?Object.assign.bind():function(r){for(var a=1;a{f.current=!0}),h.useCallback(function(y,g){if(g===void 0&&(g={}),!f.current)return;if(typeof y=="number"){i.go(y);return}let v=yu(y,JSON.parse(m),d,g.relative==="path");r==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:on([a,v.pathname])),(g.replace?i.replace:i.push)(v,g.state,g)},[a,i,m,d,r])}const ob=h.createContext(null);function cb(r){let a=h.useContext(_r).outlet;return a&&h.createElement(ob.Provider,{value:r},a)}function $x(r,a){let{relative:l}=a===void 0?{}:a,{future:i}=h.useContext(pn),{matches:c}=h.useContext(_r),{pathname:d}=gn(),m=JSON.stringify(gu(c,i.v7_relativeSplatPath));return h.useMemo(()=>yu(r,JSON.parse(m),d,l==="path"),[r,m,d,l])}function db(r,a){return ub(r,a)}function ub(r,a,l,i){Fa()||Mt(!1);let{navigator:c}=h.useContext(pn),{matches:d}=h.useContext(_r),m=d[d.length-1],f=m?m.params:{};m&&m.pathname;let p=m?m.pathnameBase:"/";m&&m.route;let y=gn(),g;if(a){var v;let j=typeof a=="string"?Oa(a):a;p==="/"||(v=j.pathname)!=null&&v.startsWith(p)||Mt(!1),g=j}else g=y;let k=g.pathname||"/",P=k;if(p!=="/"){let j=p.replace(/^\//,"").split("/");P="/"+k.replace(/^\//,"").split("/").slice(j.length).join("/")}let T=Dv(r,{pathname:P}),N=pb(T&&T.map(j=>Object.assign({},j,{params:Object.assign({},f,j.params),pathname:on([p,c.encodeLocation?c.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?p:on([p,c.encodeLocation?c.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),d,l,i);return a&&N?h.createElement(No.Provider,{value:{location:_l({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:an.Pop}},N):N}function hb(){let r=bb(),a=rb(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 mb=h.createElement(hb,null);class fb 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(_r.Provider,{value:this.props.routeContext},h.createElement(Fx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function xb(r){let{routeContext:a,match:l,children:i}=r,c=h.useContext(vu);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),h.createElement(_r.Provider,{value:a},i)}function pb(r,a,l,i){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),i===void 0&&(i=null),r==null){var d;if(!l)return null;if(l.errors)r=l.matches;else if((d=i)!=null&&d.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 g=m.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);g>=0||Mt(!1),m=m.slice(0,Math.min(m.length,g+1))}let p=!1,y=-1;if(l&&i&&i.v7_partialHydration)for(let g=0;g=0?m=m.slice(0,y+1):m=[m[0]];break}}}return m.reduceRight((g,v,k)=>{let P,T=!1,N=null,j=null;l&&(P=f&&v.route.id?f[v.route.id]:void 0,N=v.route.errorElement||mb,p&&(y<0&&k===0?(Nb("route-fallback"),T=!0,j=null):y===k&&(T=!0,j=v.route.hydrateFallbackElement||null)));let C=a.concat(m.slice(0,k+1)),E=()=>{let b;return P?b=N:T?b=j:v.route.Component?b=h.createElement(v.route.Component,null):v.route.element?b=v.route.element:b=g,h.createElement(xb,{match:v,routeContext:{outlet:g,matches:C,isDataRoute:l!=null},children:b})};return l&&(v.route.ErrorBoundary||v.route.errorElement||k===0)?h.createElement(fb,{location:l.location,revalidation:l.revalidation,component:N,error:P,children:E(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):E()},null)}var Bx=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(Bx||{}),Ux=(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})(Ux||{});function gb(r){let a=h.useContext(vu);return a||Mt(!1),a}function yb(r){let a=h.useContext(ab);return a||Mt(!1),a}function vb(r){let a=h.useContext(_r);return a||Mt(!1),a}function Vx(r){let a=vb(),l=a.matches[a.matches.length-1];return l.route.id||Mt(!1),l.route.id}function bb(){var r;let a=h.useContext(Fx),l=yb(),i=Vx();return a!==void 0?a:(r=l.errors)==null?void 0:r[i]}function jb(){let{router:r}=gb(Bx.UseNavigateStable),a=Vx(Ux.UseNavigateStable),l=h.useRef(!1);return zx(()=>{l.current=!0}),h.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,_l({fromRouteId:a},d)))},[r,a])}const Mf={};function Nb(r,a,l){Mf[r]||(Mf[r]=!0)}function wb(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Sd(r){let{to:a,replace:l,state:i,relative:c}=r;Fa()||Mt(!1);let{future:d,static:m}=h.useContext(pn),{matches:f}=h.useContext(_r),{pathname:p}=gn(),y=yn(),g=yu(a,gu(f,d.v7_relativeSplatPath),p,c==="path"),v=JSON.stringify(g);return h.useEffect(()=>y(JSON.parse(v),{replace:l,state:i,relative:c}),[y,v,c,l,i]),null}function Sb(r){return cb(r.context)}function yt(r){Mt(!1)}function Cb(r){let{basename:a="/",children:l=null,location:i,navigationType:c=an.Pop,navigator:d,static:m=!1,future:f}=r;Fa()&&Mt(!1);let p=a.replace(/^\/*/,"/"),y=h.useMemo(()=>({basename:p,navigator:d,static:m,future:_l({v7_relativeSplatPath:!1},f)}),[p,f,d,m]);typeof i=="string"&&(i=Oa(i));let{pathname:g="/",search:v="",hash:k="",state:P=null,key:T="default"}=i,N=h.useMemo(()=>{let j=pu(g,p);return j==null?null:{location:{pathname:j,search:v,hash:k,state:P,key:T},navigationType:c}},[p,g,v,k,P,T,c]);return N==null?null:h.createElement(pn.Provider,{value:y},h.createElement(No.Provider,{children:l,value:N}))}function kb(r){let{children:a,location:l}=r;return db(Wd(a),l)}new Promise(()=>{});function Wd(r,a){a===void 0&&(a=[]);let l=[];return h.Children.forEach(r,(i,c)=>{if(!h.isValidElement(i))return;let d=[...a,c];if(i.type===h.Fragment){l.push.apply(l,Wd(i.props.children,d));return}i.type!==yt&&Mt(!1),!i.props.index||!i.props.children||Mt(!1);let m={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(m.children=Wd(i.props.children,d)),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 Hd(){return Hd=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function Pb(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Tb(r,a){return r.button===0&&(!a||a==="_self")&&!Pb(r)}function Kd(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 i=r[l];return a.concat(Array.isArray(i)?i.map(c=>[l,c]):[[l,i]])},[]))}function Rb(r,a){let l=Kd(r);return a&&a.forEach((i,c)=>{l.has(c)||a.getAll(c).forEach(d=>{l.append(c,d)})}),l}const Ib=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_b="6";try{window.__reactRouterVersion=_b}catch{}const Mb="startTransition",Af=jo[Mb];function Ab(r){let{basename:a,children:l,future:i,window:c}=r,d=h.useRef();d.current==null&&(d.current=_v({window:c,v5Compat:!0}));let m=d.current,[f,p]=h.useState({action:m.action,location:m.location}),{v7_startTransition:y}=i||{},g=h.useCallback(v=>{y&&Af?Af(()=>p(v)):p(v)},[p,y]);return h.useLayoutEffect(()=>m.listen(g),[m,g]),h.useEffect(()=>wb(i),[i]),h.createElement(Cb,{basename:a,children:l,location:f.location,navigationType:f.action,navigator:m,future:i})}const Db=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Lb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gd=h.forwardRef(function(a,l){let{onClick:i,relative:c,reloadDocument:d,replace:m,state:f,target:p,to:y,preventScrollReset:g,viewTransition:v}=a,k=Eb(a,Ib),{basename:P}=h.useContext(pn),T,N=!1;if(typeof y=="string"&&Lb.test(y)&&(T=y,Db))try{let b=new URL(window.location.href),R=y.startsWith("//")?new URL(b.protocol+y):new URL(y),G=pu(R.pathname,P);R.origin===b.origin&&G!=null?y=G+R.search+R.hash:N=!0}catch{}let j=lb(y,{relative:c}),C=Ob(y,{replace:m,state:f,target:p,preventScrollReset:g,relative:c,viewTransition:v});function E(b){i&&i(b),b.defaultPrevented||C(b)}return h.createElement("a",Hd({},k,{href:T||j,onClick:N||d?i:E,ref:l,target:p}))});var Df;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Df||(Df={}));var Lf;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(Lf||(Lf={}));function Ob(r,a){let{target:l,replace:i,state:c,preventScrollReset:d,relative:m,viewTransition:f}=a===void 0?{}:a,p=yn(),y=gn(),g=$x(r,{relative:m});return h.useCallback(v=>{if(Tb(v,l)){v.preventDefault();let k=i!==void 0?i:io(y)===io(g);p(r,{replace:k,state:c,preventScrollReset:d,relative:m,viewTransition:f})}},[y,p,g,i,c,l,r,d,m,f])}function Wx(r){let a=h.useRef(Kd(r)),l=h.useRef(!1),i=gn(),c=h.useMemo(()=>Rb(i.search,l.current?null:a.current),[i.search]),d=yn(),m=h.useCallback((f,p)=>{const y=Kd(typeof f=="function"?f(c):f);l.current=!0,d("?"+y,p)},[d,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 Fb=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zb=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,i)=>i?i.toUpperCase():l.toLowerCase()),Of=r=>{const a=zb(r);return a.charAt(0).toUpperCase()+a.slice(1)},Hx=(...r)=>r.filter((a,l,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===l).join(" ").trim(),$b=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 Bb={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 Ub=h.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:m,...f},p)=>h.createElement("svg",{ref:p,...Bb,width:a,height:a,stroke:r,strokeWidth:i?Number(l)*24/Number(a):l,className:Hx("lucide",c),...!d&&!$b(f)&&{"aria-hidden":"true"},...f},[...m.map(([y,g])=>h.createElement(y,g)),...Array.isArray(d)?d:[d]]));/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Te=(r,a)=>{const l=h.forwardRef(({className:i,...c},d)=>h.createElement(Ub,{ref:d,iconNode:a,className:Hx(`lucide-${Fb(Of(r))}`,`lucide-${r}`,i),...c}));return l.displayName=Of(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 Vb=[["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"}]],Wb=Te("arrow-up-down",Vb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hb=[["path",{d:"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"}]],Ff=Te("bitcoin",Hb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Kb=[["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"}]],qs=Te("book-open",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 Gb=[["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"}]],oo=Te("calendar",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=[["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"}]],Qb=Te("chart-column",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:"M20 6 9 17l-5-5",key:"1gmf2c"}]],wo=Te("check",qb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ml=Te("chevron-down",Xb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],sn=Te("chevron-right",Jb);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zb=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Kx=Te("chevron-up",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 ej=[["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"}]],tj=Te("circle-alert",ej);/** - * @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 sj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],zf=Te("circle-check-big",sj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Yd=Te("circle-check",rj);/** - * @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 nj=[["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"}]],Gx=Te("circle-question-mark",nj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const aj=[["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"}]],Cd=Te("circle-user",aj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lj=[["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"}]],Yx=Te("circle-x",lj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ij=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Qd=Te("clock",ij);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oj=[["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"}]],Qx=Te("copy",oj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cj=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],$f=Te("credit-card",cj);/** - * @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 dj=[["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"}]],nn=Te("crown",dj);/** - * @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=[["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"}]],co=Te("dollar-sign",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 hj=[["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"}]],mj=Te("download",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 fj=[["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"}]],hn=Te("external-link",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 xj=[["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"}]],Er=Te("eye",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 pj=[["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"}]],gj=Te("file-text",pj);/** - * @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:"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"}]],qx=Te("funnel",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 vj=[["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"}]],bj=Te("gift",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 jj=[["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"}]],Nj=Te("git-merge",jj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wj=[["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"}]],qd=Te("globe",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 Sj=[["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"}]],Cj=Te("graduation-cap",Sj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kj=[["circle",{cx:"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"}]],Sr=Te("grip-vertical",kj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ej=[["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"}]],Pj=Te("handshake",Ej);/** - * @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 Tj=[["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"}]],Rj=Te("house",Tj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ij=[["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"}]],Xx=Te("image",Ij);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Yi=Te("info",_j);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mj=[["path",{d:"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"}]],Bf=Te("key",Mj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Aj=[["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"}]],Dj=Te("layout-dashboard",Aj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Lj=[["path",{d:"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"}]],Pr=Te("link-2",Lj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Oj=[["path",{d:"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"}]],Uf=Te("link",Oj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fj=[["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"}]],zj=Te("lock",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:"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"}]],Bj=Te("log-out",$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:"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"}]],Jx=Te("map-pin",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:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Wj=Te("menu",Vj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hj=[["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"}]],Kj=Te("message-circle",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=[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]],Ta=Te("navigation",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:"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"}]],Qj=Te("palette",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:"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=Te("pen-line",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=[["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"}]],Jj=Te("percent",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:"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"}]],eN=Te("phone",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 tN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rt=Te("plus",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=[["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"}]],Vf=Te("qr-code",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:"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"}]],Be=Te("refresh-cw",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 nN=[["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"}]],It=Te("save",nN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const aN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],cn=Te("search",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.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"}]],iN=Te("send",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 oN=[["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"}]],Un=Te("settings",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=[["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"}]],kd=Te("settings-2",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:"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"}]],bu=Te("shield-check",dN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uN=[["path",{d:"M16 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"}]],Xd=Te("shopping-bag",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=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Al=Te("smartphone",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:"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"}]],Ed=Te("tag",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:"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"}]],Ht=Te("trash-2",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 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Ra=Te("trending-up",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 pN=[["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"}]],Zx=Te("undo-2",pN);/** - * @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:"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"}]],uo=Te("upload",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:"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"}]],Jd=Te("user-plus",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:"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"}]],Ia=Te("user",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 bN=[["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"}]],Kt=Te("users",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 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"}]],Aa=Te("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 NN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ms=Te("x",NN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wN=[["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"}]],ln=Te("zap",wN),ju="admin_token";function Nu(){try{return localStorage.getItem(ju)}catch{return null}}function SN(r){try{localStorage.setItem(ju,r)}catch{}}function CN(){try{localStorage.removeItem(ju)}catch{}}const kN="https://soulapi.quwanzhi.com",EN=15e3,PN=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):kN};function Da(r){const a=PN(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function So(r,a={}){const{data:l,...i}=a,c=Da(r),d=new Headers(i.headers),m=Nu();m&&d.set("Authorization",`Bearer ${m}`),l!=null&&!d.has("Content-Type")&&d.set("Content-Type","application/json");const f=l!=null?JSON.stringify(l):i.body,p=new AbortController,y=setTimeout(()=>p.abort(),EN),g=await fetch(c,{...i,headers:d,body:f,credentials:"include",signal:p.signal}).finally(()=>clearTimeout(y)),k=(g.headers.get("Content-Type")||"").includes("application/json")?await g.json():g;if(!g.ok){const P=new Error((k==null?void 0:k.error)||`HTTP ${g.status}`);throw P.status=g.status,P.data=k,P}return k}function Oe(r,a){return So(r,{...a,method:"GET"})}function ut(r,a,l){return So(r,{...l,method:"POST",data:a})}function vt(r,a,l){return So(r,{...l,method:"PUT",data:a})}function Tr(r,a){return So(r,{...a,method:"DELETE"})}const TN=[{icon:Dj,label:"数据概览",href:"/dashboard"},{icon:qs,label:"内容管理",href:"/content"},{icon:Kt,label:"用户管理",href:"/users"},{icon:Nj,label:"找伙伴",href:"/find-partner"},{icon:Aa,label:"推广中心",href:"/distribution"}];function RN(){const r=gn(),a=yn(),[l,i]=h.useState(!1),[c,d]=h.useState(!1);h.useEffect(()=>{i(!0)},[]),h.useEffect(()=>{if(!l)return;d(!1);let f=!1;return Oe("/api/admin").then(p=>{f||(p&&p.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{f||a("/login",{replace:!0})}),()=>{f=!0}},[l,a]);const m=async()=>{CN();try{await ut("/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:[TN.map(f=>{const p=r.pathname===f.href;return e.jsxs(Gd,{to:f.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${p?"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(Gd,{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(Un,{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(Bj,{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(Sb,{})})})]})}function Wf(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function wu(...r){return a=>{let l=!1;const i=r.map(c=>{const d=Wf(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c{let{children:d,...m}=i;ep(d)&&typeof ho=="function"&&(d=ho(d._payload));const f=h.Children.toArray(d),p=f.find(DN);if(p){const y=p.props.children,g=f.map(v=>v===p?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,g):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}var sp=tp("Slot");function MN(r){const a=h.forwardRef((l,i)=>{let{children:c,...d}=l;if(ep(c)&&typeof ho=="function"&&(c=ho(c._payload)),h.isValidElement(c)){const m=ON(c),f=LN(d,c.props);return c.type!==h.Fragment&&(f.ref=i?wu(i,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var AN=Symbol("radix.slottable");function DN(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===AN}function LN(r,a){const l={...a};for(const i in a){const c=r[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...f)=>{const p=d(...f);return c(...f),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function ON(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.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 rp(r){var a,l,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;atypeof r=="boolean"?`${r}`:r===0?"0":r,Kf=np,ap=(r,a)=>l=>{var i;if((a==null?void 0:a.variants)==null)return Kf(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,m=Object.keys(c).map(y=>{const g=l==null?void 0:l[y],v=d==null?void 0:d[y];if(g===null)return null;const k=Hf(g)||Hf(v);return c[y][k]}),f=l&&Object.entries(l).reduce((y,g)=>{let[v,k]=g;return k===void 0||(y[v]=k),y},{}),p=a==null||(i=a.compoundVariants)===null||i===void 0?void 0:i.reduce((y,g)=>{let{class:v,className:k,...P}=g;return Object.entries(P).every(T=>{let[N,j]=T;return Array.isArray(j)?j.includes({...d,...f}[N]):{...d,...f}[N]===j})?[...y,v,k]:y},[]);return Kf(r,m,p,l==null?void 0:l.class,l==null?void 0:l.className)},FN=(r,a)=>{const l=new Array(r.length+a.length);for(let i=0;i({classGroupId:r,validator:a}),lp=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),mo="-",Gf=[],$N="arbitrary..",BN=r=>{const a=VN(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=r;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return UN(m);const f=m.split(mo),p=f[0]===""&&f.length>1?1:0;return ip(f,p,a)},getConflictingClassGroupIds:(m,f)=>{if(f){const p=i[m],y=l[m];return p?y?FN(y,p):p:y||Gf}return l[m]||Gf}}},ip=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],d=l.nextPart.get(c);if(d){const y=ip(r,a+1,d);if(y)return y}const m=l.validators;if(m===null)return;const f=a===0?r.join(mo):r.slice(a).join(mo),p=m.length;for(let y=0;yr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),i=a.slice(0,l);return i?$N+i:void 0})(),VN=r=>{const{theme:a,classGroups:l}=r;return WN(l,a)},WN=(r,a)=>{const l=lp();for(const i in r){const c=r[i];Su(c,l,i,a)}return l},Su=(r,a,l,i)=>{const c=r.length;for(let d=0;d{if(typeof r=="string"){KN(r,a,l);return}if(typeof r=="function"){GN(r,a,l,i);return}YN(r,a,l,i)},KN=(r,a,l)=>{const i=r===""?a:op(a,r);i.classGroupId=l},GN=(r,a,l,i)=>{if(QN(r)){Su(r(i),a,l,i);return}a.validators===null&&(a.validators=[]),a.validators.push(zN(l,r))},YN=(r,a,l,i)=>{const c=Object.entries(r),d=c.length;for(let m=0;m{let l=r;const i=a.split(mo),c=i.length;for(let d=0;d"isThemeGetter"in r&&r.isThemeGetter===!0,qN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),i=Object.create(null);const c=(d,m)=>{l[d]=m,a++,a>r&&(a=0,i=l,l=Object.create(null))};return{get(d){let m=l[d];if(m!==void 0)return m;if((m=i[d])!==void 0)return c(d,m),m},set(d,m){d in l?l[d]=m:c(d,m)}}},Zd="!",Yf=":",XN=[],Qf=(r,a,l,i,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:i,isExternal:c}),JN=r=>{const{prefix:a,experimentalParseClassName:l}=r;let i=c=>{const d=[];let m=0,f=0,p=0,y;const g=c.length;for(let N=0;Np?y-p:void 0;return Qf(d,P,k,T)};if(a){const c=a+Yf,d=i;i=m=>m.startsWith(c)?d(m.slice(c.length)):Qf(XN,!1,m,void 0,!0)}if(l){const c=i;i=d=>l({className:d,parseClassName:c})}return i},ZN=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,i)=>{a.set(l,1e6+i)}),l=>{const i=[];let c=[];for(let d=0;d0&&(c.sort(),i.push(...c),c=[]),i.push(m)):c.push(m)}return c.length>0&&(c.sort(),i.push(...c)),i}},ew=r=>({cache:qN(r.cacheSize),parseClassName:JN(r),sortModifiers:ZN(r),...BN(r)}),tw=/\s+/,sw=(r,a)=>{const{parseClassName:l,getClassGroupId:i,getConflictingClassGroupIds:c,sortModifiers:d}=a,m=[],f=r.trim().split(tw);let p="";for(let y=f.length-1;y>=0;y-=1){const g=f[y],{isExternal:v,modifiers:k,hasImportantModifier:P,baseClassName:T,maybePostfixModifierPosition:N}=l(g);if(v){p=g+(p.length>0?" "+p:p);continue}let j=!!N,C=i(j?T.substring(0,N):T);if(!C){if(!j){p=g+(p.length>0?" "+p:p);continue}if(C=i(T),!C){p=g+(p.length>0?" "+p:p);continue}j=!1}const E=k.length===0?"":k.length===1?k[0]:d(k).join(":"),b=P?E+Zd:E,R=b+C;if(m.indexOf(R)>-1)continue;m.push(R);const G=c(C,j);for(let X=0;X0?" "+p:p)}return p},rw=(...r)=>{let a=0,l,i,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let i=0;i{let l,i,c,d;const m=p=>{const y=a.reduce((g,v)=>v(g),r());return l=ew(y),i=l.cache.get,c=l.cache.set,d=f,f(p)},f=p=>{const y=i(p);if(y)return y;const g=sw(p,l);return c(p,g),g};return d=m,(...p)=>d(rw(...p))},aw=[],$t=r=>{const a=l=>l[r]||aw;return a.isThemeGetter=!0,a},dp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,up=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lw=/^\d+\/\d+$/,iw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ow=/\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$/,cw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wa=r=>lw.test(r),qe=r=>!!r&&!Number.isNaN(Number(r)),en=r=>!!r&&Number.isInteger(Number(r)),Pd=r=>r.endsWith("%")&&qe(r.slice(0,-1)),Cr=r=>iw.test(r),hw=()=>!0,mw=r=>ow.test(r)&&!cw.test(r),hp=()=>!1,fw=r=>dw.test(r),xw=r=>uw.test(r),pw=r=>!_e(r)&&!Me(r),gw=r=>za(r,xp,hp),_e=r=>dp.test(r),Bn=r=>za(r,pp,mw),Td=r=>za(r,Nw,qe),qf=r=>za(r,mp,hp),yw=r=>za(r,fp,xw),Qi=r=>za(r,gp,fw),Me=r=>up.test(r),kl=r=>$a(r,pp),vw=r=>$a(r,ww),Xf=r=>$a(r,mp),bw=r=>$a(r,xp),jw=r=>$a(r,fp),qi=r=>$a(r,gp,!0),za=(r,a,l)=>{const i=dp.exec(r);return i?i[1]?a(i[1]):l(i[2]):!1},$a=(r,a,l=!1)=>{const i=up.exec(r);return i?i[1]?a(i[1]):l:!1},mp=r=>r==="position"||r==="percentage",fp=r=>r==="image"||r==="url",xp=r=>r==="length"||r==="size"||r==="bg-size",pp=r=>r==="length",Nw=r=>r==="number",ww=r=>r==="family-name",gp=r=>r==="shadow",Sw=()=>{const r=$t("color"),a=$t("font"),l=$t("text"),i=$t("font-weight"),c=$t("tracking"),d=$t("leading"),m=$t("breakpoint"),f=$t("container"),p=$t("spacing"),y=$t("radius"),g=$t("shadow"),v=$t("inset-shadow"),k=$t("text-shadow"),P=$t("drop-shadow"),T=$t("blur"),N=$t("perspective"),j=$t("aspect"),C=$t("ease"),E=$t("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...R(),Me,_e],X=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],I=()=>[Me,_e,p],w=()=>[wa,"full","auto",...I()],V=()=>[en,"none","subgrid",Me,_e],se=()=>["auto",{span:["full",en,Me,_e]},en,Me,_e],ie=()=>[en,"auto",Me,_e],Y=()=>["auto","min","max","fr",Me,_e],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],_=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...I()],ue=()=>[wa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],L=()=>[r,Me,_e],re=()=>[...R(),Xf,qf,{position:[Me,_e]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",bw,gw,{size:[Me,_e]}],z=()=>[Pd,kl,Bn],O=()=>["","none","full",y,Me,_e],ee=()=>["",qe,kl,Bn],K=()=>["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"],q=()=>[qe,Pd,Xf,qf],ye=()=>["","none",T,Me,_e],Se=()=>["none",qe,Me,_e],F=()=>["none",qe,Me,_e],xe=()=>[qe,Me,_e],ke=()=>[wa,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Cr],breakpoint:[Cr],color:[hw],container:[Cr],"drop-shadow":[Cr],ease:["in","out","in-out"],font:[pw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Cr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Cr],shadow:[Cr],spacing:["px",qe],text:[Cr],"text-shadow":[Cr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wa,_e,Me,j]}],container:["container"],columns:[{columns:[qe,_e,Me,f]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"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:G()}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[en,"auto",Me,_e]}],basis:[{basis:[wa,"full","auto",f,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,wa,"auto","initial","none",_e]}],grow:[{grow:["",qe,Me,_e]}],shrink:[{shrink:["",qe,Me,_e]}],order:[{order:[en,"first","last","none",Me,_e]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:se()}],"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":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[..._(),"normal"]}],"justify-self":[{"justify-self":["auto",..._()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[..._(),{baseline:["","last"]}]}],"align-self":[{self:["auto",..._(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[..._(),"baseline"]}],"place-self":[{"place-self":["auto",..._()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:ue()}],w:[{w:[f,"screen",...ue()]}],"min-w":[{"min-w":[f,"screen","none",...ue()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[m]},...ue()]}],h:[{h:["screen","lh",...ue()]}],"min-h":[{"min-h":["screen","lh","none",...ue()]}],"max-h":[{"max-h":["screen","lh",...ue()]}],"font-size":[{text:["base",l,kl,Bn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Me,Td]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Pd,_e]}],"font-family":[{font:[vw,_e,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,Me,_e]}],"line-clamp":[{"line-clamp":[qe,"none",Me,Td]}],leading:[{leading:[d,...I()]}],"list-image":[{"list-image":["none",Me,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,_e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",Me,Bn]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[qe,"auto",Me,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,_e]}],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",Me,_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},en,Me,_e],radial:["",Me,_e],conic:[en,Me,_e]},jw,yw]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,Me,_e]}],"outline-w":[{outline:["",qe,kl,Bn]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",g,qi,Qi]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",v,qi,Qi]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[qe,Bn]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",k,qi,Qi]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[qe,Me,_e]}],"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":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[Me,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,_e]}],filter:[{filter:["","none",Me,_e]}],blur:[{blur:ye()}],brightness:[{brightness:[qe,Me,_e]}],contrast:[{contrast:[qe,Me,_e]}],"drop-shadow":[{"drop-shadow":["","none",P,qi,Qi]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",qe,Me,_e]}],"hue-rotate":[{"hue-rotate":[qe,Me,_e]}],invert:[{invert:["",qe,Me,_e]}],saturate:[{saturate:[qe,Me,_e]}],sepia:[{sepia:["",qe,Me,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,_e]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[qe,Me,_e]}],"backdrop-contrast":[{"backdrop-contrast":[qe,Me,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,Me,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,Me,_e]}],"backdrop-invert":[{"backdrop-invert":["",qe,Me,_e]}],"backdrop-opacity":[{"backdrop-opacity":[qe,Me,_e]}],"backdrop-saturate":[{"backdrop-saturate":[qe,Me,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,Me,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",Me,_e]}],ease:[{ease:["linear","initial",C,Me,_e]}],delay:[{delay:[qe,Me,_e]}],animate:[{animate:["none",E,Me,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,Me,_e]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Me,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"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:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",Me,_e]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Me,_e]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[qe,kl,Bn,Td]}],stroke:[{stroke:["none",...L()]}],"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"]}},Cw=nw(Sw);function lt(...r){return Cw(np(r))}const kw=ap("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 J({className:r,variant:a,size:l,asChild:i=!1,...c}){const d=i?sp:"button";return e.jsx(d,{"data-slot":"button",className:lt(kw({variant:a,size:l,className:r})),...c})}function oe({className:r,type:a,...l}){return e.jsx("input",{type:a,"data-slot":"input",className:lt("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 Ew(){const r=yn(),[a,l]=h.useState(""),[i,c]=h.useState(""),[d,m]=h.useState(""),[f,p]=h.useState(!1),y=async()=>{m(""),p(!0);try{const g=await ut("/api/admin",{username:a.trim(),password:i});if((g==null?void 0:g.success)!==!1&&(g!=null&&g.token)){SN(g.token),r("/dashboard",{replace:!0});return}m(g.error||"用户名或密码错误")}catch(g){const v=g;m(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{p(!1)}};return e.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"w-full max-w-md relative z-10",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-[#38bdac]/20 rounded-2xl flex items-center justify-center mx-auto mb-4 border border-[#38bdac]/30",children:e.jsx(bu,{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(Ia,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(oe,{type:"text",value:a,onChange:g=>l(g.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(zj,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(oe,{type:"password",value:i,onChange:g=>c(g.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:g=>g.key==="Enter"&&y()})]})]}),d&&e.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:d}),e.jsx(J,{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 Ne=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:lt("rounded-xl border bg-card text-card-foreground shadow",r),...a}));Ne.displayName="Card";const Ye=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:lt("flex flex-col space-y-1.5 p-6",r),...a}));Ye.displayName="CardHeader";const Qe=h.forwardRef(({className:r,...a},l)=>e.jsx("h3",{ref:l,className:lt("font-semibold leading-none tracking-tight",r),...a}));Qe.displayName="CardTitle";const bt=h.forwardRef(({className:r,...a},l)=>e.jsx("p",{ref:l,className:lt("text-sm text-muted-foreground",r),...a}));bt.displayName="CardDescription";const we=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:lt("p-6 pt-0",r),...a}));we.displayName="CardContent";const Pw=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:lt("flex items-center p-6 pt-0",r),...a}));Pw.displayName="CardFooter";function Tw(){const r=yn(),[a,l]=h.useState(!0),[i,c]=h.useState([]),[d,m]=h.useState([]),[f,p]=h.useState(0),[y,g]=h.useState(0),[v,k]=h.useState(0),[P,T]=h.useState(0),[N,j]=h.useState(0),[C,E]=h.useState(0),[b,R]=h.useState(null);async function G(){var w;l(!0),R(null);try{try{const re=await Oe("/api/admin/dashboard/overview");if(re!=null&&re.success){p(re.totalUsers??0),g(re.paidOrderCount??0),k(re.totalRevenue??0),T(re.conversionRate??0),j(re.totalMatches??0),E(re.matchRevenue??0),m(re.recentOrders??[]),c(re.newUsers??[]);return}}catch(re){console.error("数据概览接口失败,尝试降级拉取",re)}const[V,se]=await Promise.all([Oe("/api/db/users?page=1&pageSize=10"),Oe("/api/orders?page=1&pageSize=20&status=paid")]),ie=typeof(V==null?void 0:V.total)=="number"?V.total:((w=V==null?void 0:V.users)==null?void 0:w.length)??0,Y=(se==null?void 0:se.orders)??[],ne=typeof(se==null?void 0:se.total)=="number"?se.total:Y.length,_=Y.filter(re=>re.status==="paid"||re.status==="completed"||re.status==="success"),Q=_.reduce((re,H)=>re+Number(H.amount||0),0),ue=new Set(_.map(re=>re.userId).filter(Boolean)),L=ie>0&&ue.size>0?ue.size/ie*100:0;p(ie),g(ne),k(Q),T(L),m(Y.slice(0,5)),c((V==null?void 0:V.users)??[])}catch(V){console.error("降级拉取失败",V);const se=V;(se==null?void 0:se.status)===401?R("登录已过期,请重新登录"):(se==null?void 0:se.name)==="AbortError"?R("请求超时,请检查网络后点击重试"):R("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(h.useEffect(()=>{G();const w=setInterval(G,3e4);return()=>clearInterval(w)},[]),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(Be,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),e.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const X=f,D=w=>{const V=w.productType||"",se=w.description||"";if(se){if(V==="section"&&se.includes("章节")){if(se.includes("-")){const ie=se.split("-");if(ie.length>=3)return{title:`第${ie[1]}章 第${ie[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:se,subtitle:"章节购买"}}return V==="fullbook"||se.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:V==="match"||se.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:se,subtitle:V==="section"?"单章":V==="fullbook"?"全书":"其他"}}return V==="section"?{title:`章节 ${w.productId||""}`,subtitle:"单章购买"}:V==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:V==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:V||"其他"}},I=[{title:"总用户数",value:X,icon:Kt,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${(v??0).toFixed(2)}`,icon:Ra,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:Xd,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${typeof P=="number"?P.toFixed(1):0}%`,icon:qs,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"},{title:"匹配次数",value:String(N),icon:Kt,color:"text-cyan-400",bg:"bg-cyan-500/20",link:"/find-partner"},{title:"匹配收益",value:`¥${(C??0).toFixed(2)}`,icon:Ra,color:"text-pink-400",bg:"bg-pink-500/20",link:"/find-partner"}];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:()=>G(),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:I.map((w,V)=>e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>w.link&&r(w.link),children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(Qe,{className:"text-sm font-medium text-gray-400",children:w.title}),e.jsx("div",{className:`p-2 rounded-lg ${w.bg}`,children:e.jsx(w.icon,{className:`w-4 h-4 ${w.color}`})})]}),e.jsx(we,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-2xl font-bold text-white",children:w.value}),e.jsx(sn,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},V))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between",children:[e.jsx(Qe,{className:"text-white",children:"最近订单"}),e.jsxs("button",{type:"button",onClick:()=>G(),className:"text-xs text-gray-400 hover:text-[#38bdac] flex items-center gap-1",title:"刷新",children:[e.jsx(Be,{className:"w-3.5 h-3.5"}),"刷新(每 30 秒自动更新)"]})]}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[d.slice(0,5).map(w=>{var ne;const V=w.referrerId?i.find(_=>_.id===w.referrerId):void 0,se=w.referralCode||(V==null?void 0:V.referralCode)||(V==null?void 0:V.nickname)||(w.referrerId?String(w.referrerId).slice(0,8):""),ie=D(w),Y=w.userNickname||((ne=i.find(_=>_.id===w.userId))==null?void 0:ne.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:[w.userAvatar?e.jsx("img",{src:w.userAvatar,alt:Y,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:_=>{_.currentTarget.style.display="none";const Q=_.currentTarget.nextElementSibling;Q&&Q.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 ${w.userAvatar?"hidden":""}`,children:Y.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:Y}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:ie.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:ie.subtitle}),e.jsx("span",{children:new Date(w.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),se&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",se]})]})]}),e.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(w.amount).toFixed(2)]}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:w.paymentMethod||"微信"})]})]},w.id)}),d.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Xd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"新注册用户"})}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[i.slice(0,5).map(w=>{var V;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:((V=w.nickname)==null?void 0:V.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-white",children:w.nickname||"匿名用户"}),e.jsx("p",{className:"text-xs text-gray-500",children:w.phone||"-"})]})]}),e.jsx("p",{className:"text-xs text-gray-400",children:w.createdAt?new Date(w.createdAt).toLocaleDateString():"-"})]},w.id)}),i.length===0&&e.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const fs=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:l,className:lt("w-full caption-bottom text-sm",r),...a})}));fs.displayName="Table";const xs=h.forwardRef(({className:r,...a},l)=>e.jsx("thead",{ref:l,className:lt("[&_tr]:border-b",r),...a}));xs.displayName="TableHeader";const ps=h.forwardRef(({className:r,...a},l)=>e.jsx("tbody",{ref:l,className:lt("[&_tr:last-child]:border-0",r),...a}));ps.displayName="TableBody";const et=h.forwardRef(({className:r,...a},l)=>e.jsx("tr",{ref:l,className:lt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));et.displayName="TableRow";const je=h.forwardRef(({className:r,...a},l)=>e.jsx("th",{ref:l,className:lt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));je.displayName="TableHead";const ge=h.forwardRef(({className:r,...a},l)=>e.jsx("td",{ref:l,className:lt("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));ge.displayName="TableCell";const Rw=ap("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 Le({className:r,variant:a,asChild:l=!1,...i}){const c=l?sp:"span";return e.jsx(c,{className:lt(Rw({variant:a}),r),...i})}function Ge(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 Iw(r,a){const l=h.createContext(a),i=d=>{const{children:m,...f}=d,p=h.useMemo(()=>f,Object.values(f));return e.jsx(l.Provider,{value:p,children:m})};i.displayName=r+"Provider";function c(d){const m=h.useContext(l);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${r}\``)}return[i,c]}function vn(r,a=[]){let l=[];function i(d,m){const f=h.createContext(m),p=l.length;l=[...l,m];const y=v=>{var C;const{scope:k,children:P,...T}=v,N=((C=k==null?void 0:k[r])==null?void 0:C[p])||f,j=h.useMemo(()=>T,Object.values(T));return e.jsx(N.Provider,{value:j,children:P})};y.displayName=d+"Provider";function g(v,k){var N;const P=((N=k==null?void 0:k[r])==null?void 0:N[p])||f,T=h.useContext(P);if(T)return T;if(m!==void 0)return m;throw new Error(`\`${v}\` must be used within \`${d}\``)}return[y,g]}const c=()=>{const d=l.map(m=>h.createContext(m));return function(f){const p=(f==null?void 0:f[r])||d;return h.useMemo(()=>({[`__scope${r}`]:{...f,[r]:p}}),[f,p])}};return c.scopeName=r,[i,_w(c,...a)]}function _w(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const i=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const m=i.reduce((f,{useScope:p,scopeName:y})=>{const v=p(d)[`__scope${y}`];return{...f,...v}},{});return h.useMemo(()=>({[`__scope${a.scopeName}`]:m}),[m])}};return l.scopeName=a.scopeName,l}var Zt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Mw=jo[" useId ".trim().toString()]||(()=>{}),Aw=0;function dn(r){const[a,l]=h.useState(Mw());return Zt(()=>{l(i=>i??String(Aw++))},[r]),a?`radix-${a}`:""}var Dw=jo[" useInsertionEffect ".trim().toString()]||Zt;function Vn({prop:r,defaultProp:a,onChange:l=()=>{},caller:i}){const[c,d,m]=Lw({defaultProp:a,onChange:l}),f=r!==void 0,p=f?r:c;{const g=h.useRef(r!==void 0);h.useEffect(()=>{const v=g.current;v!==f&&console.warn(`${i} 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.`),g.current=f},[f,i])}const y=h.useCallback(g=>{var v;if(f){const k=Ow(g)?g(r):g;k!==r&&((v=m.current)==null||v.call(m,k))}else d(g)},[f,r,d,m]);return[p,y]}function Lw({defaultProp:r,onChange:a}){const[l,i]=h.useState(r),c=h.useRef(l),d=h.useRef(a);return Dw(()=>{d.current=a},[a]),h.useEffect(()=>{var m;c.current!==l&&((m=d.current)==null||m.call(d,l),c.current=l)},[l,c]),[l,i,d]}function Ow(r){return typeof r=="function"}function Dl(r){const a=Fw(r),l=h.forwardRef((i,c)=>{const{children:d,...m}=i,f=h.Children.toArray(d),p=f.find($w);if(p){const y=p.props.children,g=f.map(v=>v===p?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,g):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}function Fw(r){const a=h.forwardRef((l,i)=>{const{children:c,...d}=l;if(h.isValidElement(c)){const m=Uw(c),f=Bw(d,c.props);return c.type!==h.Fragment&&(f.ref=i?wu(i,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var zw=Symbol("radix.slottable");function $w(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===zw}function Bw(r,a){const l={...a};for(const i in a){const c=r[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...f)=>{const p=d(...f);return c(...f),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function Uw(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.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 Vw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=Vw.reduce((r,a)=>{const l=Dl(`Primitive.${a}`),i=h.forwardRef((c,d)=>{const{asChild:m,...f}=c,p=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...f,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{});function Ww(r,a){r&&Ol.flushSync(()=>r.dispatchEvent(a))}function mn(r){const a=h.useRef(r);return h.useEffect(()=>{a.current=r}),h.useMemo(()=>(...l)=>{var i;return(i=a.current)==null?void 0:i.call(a,...l)},[])}function Hw(r,a=globalThis==null?void 0:globalThis.document){const l=mn(r);h.useEffect(()=>{const i=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",i,{capture:!0}),()=>a.removeEventListener("keydown",i,{capture:!0})},[l,a])}var Kw="DismissableLayer",eu="dismissableLayer.update",Gw="dismissableLayer.pointerDownOutside",Yw="dismissableLayer.focusOutside",Jf,yp=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Cu=h.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:m,onDismiss:f,...p}=r,y=h.useContext(yp),[g,v]=h.useState(null),k=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=h.useState({}),T=at(a,D=>v(D)),N=Array.from(y.layers),[j]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),C=N.indexOf(j),E=g?N.indexOf(g):-1,b=y.layersWithOutsidePointerEventsDisabled.size>0,R=E>=C,G=Xw(D=>{const I=D.target,w=[...y.branches].some(V=>V.contains(I));!R||w||(c==null||c(D),m==null||m(D),D.defaultPrevented||f==null||f())},k),X=Jw(D=>{const I=D.target;[...y.branches].some(V=>V.contains(I))||(d==null||d(D),m==null||m(D),D.defaultPrevented||f==null||f())},k);return Hw(D=>{E===y.layers.size-1&&(i==null||i(D),!D.defaultPrevented&&f&&(D.preventDefault(),f()))},k),h.useEffect(()=>{if(g)return l&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Jf=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(g)),y.layers.add(g),Zf(),()=>{l&&y.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=Jf)}},[g,k,l,y]),h.useEffect(()=>()=>{g&&(y.layers.delete(g),y.layersWithOutsidePointerEventsDisabled.delete(g),Zf())},[g,y]),h.useEffect(()=>{const D=()=>P({});return document.addEventListener(eu,D),()=>document.removeEventListener(eu,D)},[]),e.jsx(Xe.div,{...p,ref:T,style:{pointerEvents:b?R?"auto":"none":void 0,...r.style},onFocusCapture:Ge(r.onFocusCapture,X.onFocusCapture),onBlurCapture:Ge(r.onBlurCapture,X.onBlurCapture),onPointerDownCapture:Ge(r.onPointerDownCapture,G.onPointerDownCapture)})});Cu.displayName=Kw;var Qw="DismissableLayerBranch",qw=h.forwardRef((r,a)=>{const l=h.useContext(yp),i=h.useRef(null),c=at(a,i);return h.useEffect(()=>{const d=i.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),e.jsx(Xe.div,{...r,ref:c})});qw.displayName=Qw;function Xw(r,a=globalThis==null?void 0:globalThis.document){const l=mn(r),i=h.useRef(!1),c=h.useRef(()=>{});return h.useEffect(()=>{const d=f=>{if(f.target&&!i.current){let p=function(){vp(Gw,l,y,{discrete:!0})};const y={originalEvent:f};f.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=p,a.addEventListener("click",c.current,{once:!0})):p()}else a.removeEventListener("click",c.current);i.current=!1},m=window.setTimeout(()=>{a.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(m),a.removeEventListener("pointerdown",d),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>i.current=!0}}function Jw(r,a=globalThis==null?void 0:globalThis.document){const l=mn(r),i=h.useRef(!1);return h.useEffect(()=>{const c=d=>{d.target&&!i.current&&vp(Yw,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Zf(){const r=new CustomEvent(eu);document.dispatchEvent(r)}function vp(r,a,l,{discrete:i}){const c=l.originalEvent.target,d=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),i?Ww(c,d):c.dispatchEvent(d)}var Rd="focusScope.autoFocusOnMount",Id="focusScope.autoFocusOnUnmount",ex={bubbles:!1,cancelable:!0},Zw="FocusScope",ku=h.forwardRef((r,a)=>{const{loop:l=!1,trapped:i=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...m}=r,[f,p]=h.useState(null),y=mn(c),g=mn(d),v=h.useRef(null),k=at(a,N=>p(N)),P=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(i){let N=function(b){if(P.paused||!f)return;const R=b.target;f.contains(R)?v.current=R:rn(v.current,{select:!0})},j=function(b){if(P.paused||!f)return;const R=b.relatedTarget;R!==null&&(f.contains(R)||rn(v.current,{select:!0}))},C=function(b){if(document.activeElement===document.body)for(const G of b)G.removedNodes.length>0&&rn(f)};document.addEventListener("focusin",N),document.addEventListener("focusout",j);const E=new MutationObserver(C);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",j),E.disconnect()}}},[i,f,P.paused]),h.useEffect(()=>{if(f){sx.add(P);const N=document.activeElement;if(!f.contains(N)){const C=new CustomEvent(Rd,ex);f.addEventListener(Rd,y),f.dispatchEvent(C),C.defaultPrevented||(e1(a1(bp(f)),{select:!0}),document.activeElement===N&&rn(f))}return()=>{f.removeEventListener(Rd,y),setTimeout(()=>{const C=new CustomEvent(Id,ex);f.addEventListener(Id,g),f.dispatchEvent(C),C.defaultPrevented||rn(N??document.body,{select:!0}),f.removeEventListener(Id,g),sx.remove(P)},0)}}},[f,y,g,P]);const T=h.useCallback(N=>{if(!l&&!i||P.paused)return;const j=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,C=document.activeElement;if(j&&C){const E=N.currentTarget,[b,R]=t1(E);b&&R?!N.shiftKey&&C===R?(N.preventDefault(),l&&rn(b,{select:!0})):N.shiftKey&&C===b&&(N.preventDefault(),l&&rn(R,{select:!0})):C===E&&N.preventDefault()}},[l,i,P.paused]);return e.jsx(Xe.div,{tabIndex:-1,...m,ref:k,onKeyDown:T})});ku.displayName=Zw;function e1(r,{select:a=!1}={}){const l=document.activeElement;for(const i of r)if(rn(i,{select:a}),document.activeElement!==l)return}function t1(r){const a=bp(r),l=tx(a,r),i=tx(a.reverse(),r);return[l,i]}function bp(r){const a=[],l=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const c=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||c?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function tx(r,a){for(const l of r)if(!s1(l,{upTo:a}))return l}function s1(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 r1(r){return r instanceof HTMLInputElement&&"select"in r}function rn(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&r1(r)&&a&&r.select()}}var sx=n1();function n1(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=rx(r,a),r.unshift(a)},remove(a){var l;r=rx(r,a),(l=r[0])==null||l.resume()}}}function rx(r,a){const l=[...r],i=l.indexOf(a);return i!==-1&&l.splice(i,1),l}function a1(r){return r.filter(a=>a.tagName!=="A")}var l1="Portal",Eu=h.forwardRef((r,a)=>{var f;const{container:l,...i}=r,[c,d]=h.useState(!1);Zt(()=>d(!0),[]);const m=l||c&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return m?Iv.createPortal(e.jsx(Xe.div,{...i,ref:a}),m):null});Eu.displayName=l1;function i1(r,a){return h.useReducer((l,i)=>a[l][i]??l,r)}var Fl=r=>{const{present:a,children:l}=r,i=o1(a),c=typeof l=="function"?l({present:i.isPresent}):h.Children.only(l),d=at(i.ref,c1(c));return typeof l=="function"||i.isPresent?h.cloneElement(c,{ref:d}):null};Fl.displayName="Presence";function o1(r){const[a,l]=h.useState(),i=h.useRef(null),c=h.useRef(r),d=h.useRef("none"),m=r?"mounted":"unmounted",[f,p]=i1(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const y=Xi(i.current);d.current=f==="mounted"?y:"none"},[f]),Zt(()=>{const y=i.current,g=c.current;if(g!==r){const k=d.current,P=Xi(y);r?p("MOUNT"):P==="none"||(y==null?void 0:y.display)==="none"?p("UNMOUNT"):p(g&&k!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,p]),Zt(()=>{if(a){let y;const g=a.ownerDocument.defaultView??window,v=P=>{const N=Xi(i.current).includes(CSS.escape(P.animationName));if(P.target===a&&N&&(p("ANIMATION_END"),!c.current)){const j=a.style.animationFillMode;a.style.animationFillMode="forwards",y=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=j)})}},k=P=>{P.target===a&&(d.current=Xi(i.current))};return a.addEventListener("animationstart",k),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{g.clearTimeout(y),a.removeEventListener("animationstart",k),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:h.useCallback(y=>{i.current=y?getComputedStyle(y):null,l(y)},[])}}function Xi(r){return(r==null?void 0:r.animationName)||"none"}function c1(r){var i,c;let a=(i=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:i.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 _d=0;function jp(){h.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??nx()),document.body.insertAdjacentElement("beforeend",r[1]??nx()),_d++,()=>{_d===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),_d--}},[])}function nx(){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 ir=function(){return ir=Object.assign||function(a){for(var l,i=1,c=arguments.length;i"u")return k1;var a=E1(r),l=document.documentElement.clientWidth,i=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,i-l+a[2]-a[0])}},T1=Cp(),_a="data-scroll-locked",R1=function(r,a,l,i){var c=r.left,d=r.top,m=r.right,f=r.gap;return l===void 0&&(l="margin"),` - .`.concat(u1,` { - overflow: hidden `).concat(i,`; - padding-right: `).concat(f,"px ").concat(i,`; - } - body[`).concat(_a,`] { - overflow: hidden `).concat(i,`; - overscroll-behavior: contain; - `).concat([a&&"position: relative ".concat(i,";"),l==="margin"&&` - padding-left: `.concat(c,`px; - padding-top: `).concat(d,`px; - padding-right: `).concat(m,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(f,"px ").concat(i,`; - `),l==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),` - } - - .`).concat(no,` { - right: `).concat(f,"px ").concat(i,`; - } - - .`).concat(ao,` { - margin-right: `).concat(f,"px ").concat(i,`; - } - - .`).concat(no," .").concat(no,` { - right: 0 `).concat(i,`; - } - - .`).concat(ao," .").concat(ao,` { - margin-right: 0 `).concat(i,`; - } - - body[`).concat(_a,`] { - `).concat(h1,": ").concat(f,`px; - } -`)},lx=function(){var r=parseInt(document.body.getAttribute(_a)||"0",10);return isFinite(r)?r:0},I1=function(){h.useEffect(function(){return document.body.setAttribute(_a,(lx()+1).toString()),function(){var r=lx()-1;r<=0?document.body.removeAttribute(_a):document.body.setAttribute(_a,r.toString())}},[])},_1=function(r){var a=r.noRelative,l=r.noImportant,i=r.gapMode,c=i===void 0?"margin":i;I1();var d=h.useMemo(function(){return P1(c)},[c]);return h.createElement(T1,{styles:R1(d,!a,c,l?"":"!important")})},tu=!1;if(typeof window<"u")try{var Ji=Object.defineProperty({},"passive",{get:function(){return tu=!0,!0}});window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{tu=!1}var Sa=tu?{passive:!1}:!1,M1=function(r){return r.tagName==="TEXTAREA"},kp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!M1(r)&&l[a]==="visible")},A1=function(r){return kp(r,"overflowY")},D1=function(r){return kp(r,"overflowX")},ix=function(r,a){var l=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var c=Ep(r,i);if(c){var d=Pp(r,i),m=d[1],f=d[2];if(m>f)return!0}i=i.parentNode}while(i&&i!==l.body);return!1},L1=function(r){var a=r.scrollTop,l=r.scrollHeight,i=r.clientHeight;return[a,l,i]},O1=function(r){var a=r.scrollLeft,l=r.scrollWidth,i=r.clientWidth;return[a,l,i]},Ep=function(r,a){return r==="v"?A1(a):D1(a)},Pp=function(r,a){return r==="v"?L1(a):O1(a)},F1=function(r,a){return r==="h"&&a==="rtl"?-1:1},z1=function(r,a,l,i,c){var d=F1(r,window.getComputedStyle(a).direction),m=d*i,f=l.target,p=a.contains(f),y=!1,g=m>0,v=0,k=0;do{if(!f)break;var P=Pp(r,f),T=P[0],N=P[1],j=P[2],C=N-j-d*T;(T||C)&&Ep(r,f)&&(v+=C,k+=T);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&f!==document.body||p&&(a.contains(f)||a===f));return(g&&Math.abs(v)<1||!g&&Math.abs(k)<1)&&(y=!0),y},Zi=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},ox=function(r){return[r.deltaX,r.deltaY]},cx=function(r){return r&&"current"in r?r.current:r},$1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},B1=function(r){return` - .block-interactivity-`.concat(r,` {pointer-events: none;} - .allow-interactivity-`).concat(r,` {pointer-events: all;} -`)},U1=0,Ca=[];function V1(r){var a=h.useRef([]),l=h.useRef([0,0]),i=h.useRef(),c=h.useState(U1++)[0],d=h.useState(Cp)[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 N=d1([r.lockRef.current],(r.shards||[]).map(cx),!0).filter(Boolean);return N.forEach(function(j){return j.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),N.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var f=h.useCallback(function(N,j){if("touches"in N&&N.touches.length===2||N.type==="wheel"&&N.ctrlKey)return!m.current.allowPinchZoom;var C=Zi(N),E=l.current,b="deltaX"in N?N.deltaX:E[0]-C[0],R="deltaY"in N?N.deltaY:E[1]-C[1],G,X=N.target,D=Math.abs(b)>Math.abs(R)?"h":"v";if("touches"in N&&D==="h"&&X.type==="range")return!1;var I=window.getSelection(),w=I&&I.anchorNode,V=w?w===X||w.contains(X):!1;if(V)return!1;var se=ix(D,X);if(!se)return!0;if(se?G=D:(G=D==="v"?"h":"v",se=ix(D,X)),!se)return!1;if(!i.current&&"changedTouches"in N&&(b||R)&&(i.current=G),!G)return!0;var ie=i.current||G;return z1(ie,j,N,ie==="h"?b:R)},[]),p=h.useCallback(function(N){var j=N;if(!(!Ca.length||Ca[Ca.length-1]!==d)){var C="deltaY"in j?ox(j):Zi(j),E=a.current.filter(function(G){return G.name===j.type&&(G.target===j.target||j.target===G.shadowParent)&&$1(G.delta,C)})[0];if(E&&E.should){j.cancelable&&j.preventDefault();return}if(!E){var b=(m.current.shards||[]).map(cx).filter(Boolean).filter(function(G){return G.contains(j.target)}),R=b.length>0?f(j,b[0]):!m.current.noIsolation;R&&j.cancelable&&j.preventDefault()}}},[]),y=h.useCallback(function(N,j,C,E){var b={name:N,delta:j,target:C,should:E,shadowParent:W1(C)};a.current.push(b),setTimeout(function(){a.current=a.current.filter(function(R){return R!==b})},1)},[]),g=h.useCallback(function(N){l.current=Zi(N),i.current=void 0},[]),v=h.useCallback(function(N){y(N.type,ox(N),N.target,f(N,r.lockRef.current))},[]),k=h.useCallback(function(N){y(N.type,Zi(N),N.target,f(N,r.lockRef.current))},[]);h.useEffect(function(){return Ca.push(d),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:k}),document.addEventListener("wheel",p,Sa),document.addEventListener("touchmove",p,Sa),document.addEventListener("touchstart",g,Sa),function(){Ca=Ca.filter(function(N){return N!==d}),document.removeEventListener("wheel",p,Sa),document.removeEventListener("touchmove",p,Sa),document.removeEventListener("touchstart",g,Sa)}},[]);var P=r.removeScrollBar,T=r.inert;return h.createElement(h.Fragment,null,T?h.createElement(d,{styles:B1(c)}):null,P?h.createElement(_1,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function W1(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const H1=v1(Sp,V1);var Pu=h.forwardRef(function(r,a){return h.createElement(Co,ir({},r,{ref:a,sideCar:H1}))});Pu.classNames=Co.classNames;var K1=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},ka=new WeakMap,eo=new WeakMap,to={},Ld=0,Tp=function(r){return r&&(r.host||Tp(r.parentNode))},G1=function(r,a){return a.map(function(l){if(r.contains(l))return l;var i=Tp(l);return i&&r.contains(i)?i:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},Y1=function(r,a,l,i){var c=G1(a,Array.isArray(r)?r:[r]);to[l]||(to[l]=new WeakMap);var d=to[l],m=[],f=new Set,p=new Set(c),y=function(v){!v||f.has(v)||(f.add(v),y(v.parentNode))};c.forEach(y);var g=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(k){if(f.has(k))g(k);else try{var P=k.getAttribute(i),T=P!==null&&P!=="false",N=(ka.get(k)||0)+1,j=(d.get(k)||0)+1;ka.set(k,N),d.set(k,j),m.push(k),N===1&&T&&eo.set(k,!0),j===1&&k.setAttribute(l,"true"),T||k.setAttribute(i,"true")}catch(C){console.error("aria-hidden: cannot operate on ",k,C)}})};return g(a),f.clear(),Ld++,function(){m.forEach(function(v){var k=ka.get(v)-1,P=d.get(v)-1;ka.set(v,k),d.set(v,P),k||(eo.has(v)||v.removeAttribute(i),eo.delete(v)),P||v.removeAttribute(l)}),Ld--,Ld||(ka=new WeakMap,ka=new WeakMap,eo=new WeakMap,to={})}},Rp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var i=Array.from(Array.isArray(r)?r:[r]),c=K1(r);return c?(i.push.apply(i,Array.from(c.querySelectorAll("[aria-live], script"))),Y1(i,c,l,"aria-hidden")):function(){return null}},ko="Dialog",[Ip]=vn(ko),[Q1,Zs]=Ip(ko),_p=r=>{const{__scopeDialog:a,children:l,open:i,defaultOpen:c,onOpenChange:d,modal:m=!0}=r,f=h.useRef(null),p=h.useRef(null),[y,g]=Vn({prop:i,defaultProp:c??!1,onChange:d,caller:ko});return e.jsx(Q1,{scope:a,triggerRef:f,contentRef:p,contentId:dn(),titleId:dn(),descriptionId:dn(),open:y,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(v=>!v),[g]),modal:m,children:l})};_p.displayName=ko;var Mp="DialogTrigger",q1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=Zs(Mp,l),d=at(a,c.triggerRef);return e.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Iu(c.open),...i,ref:d,onClick:Ge(r.onClick,c.onOpenToggle)})});q1.displayName=Mp;var Tu="DialogPortal",[X1,Ap]=Ip(Tu,{forceMount:void 0}),Dp=r=>{const{__scopeDialog:a,forceMount:l,children:i,container:c}=r,d=Zs(Tu,a);return e.jsx(X1,{scope:a,forceMount:l,children:h.Children.map(i,m=>e.jsx(Fl,{present:l||d.open,children:e.jsx(Eu,{asChild:!0,container:c,children:m})}))})};Dp.displayName=Tu;var fo="DialogOverlay",Lp=h.forwardRef((r,a)=>{const l=Ap(fo,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=Zs(fo,r.__scopeDialog);return d.modal?e.jsx(Fl,{present:i||d.open,children:e.jsx(Z1,{...c,ref:a})}):null});Lp.displayName=fo;var J1=Dl("DialogOverlay.RemoveScroll"),Z1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=Zs(fo,l);return e.jsx(Pu,{as:J1,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(Xe.div,{"data-state":Iu(c.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Wn="DialogContent",Op=h.forwardRef((r,a)=>{const l=Ap(Wn,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=Zs(Wn,r.__scopeDialog);return e.jsx(Fl,{present:i||d.open,children:d.modal?e.jsx(e2,{...c,ref:a}):e.jsx(t2,{...c,ref:a})})});Op.displayName=Wn;var e2=h.forwardRef((r,a)=>{const l=Zs(Wn,r.__scopeDialog),i=h.useRef(null),c=at(a,l.contentRef,i);return h.useEffect(()=>{const d=i.current;if(d)return Rp(d)},[]),e.jsx(Fp,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ge(r.onCloseAutoFocus,d=>{var m;d.preventDefault(),(m=l.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Ge(r.onPointerDownOutside,d=>{const m=d.detail.originalEvent,f=m.button===0&&m.ctrlKey===!0;(m.button===2||f)&&d.preventDefault()}),onFocusOutside:Ge(r.onFocusOutside,d=>d.preventDefault())})}),t2=h.forwardRef((r,a)=>{const l=Zs(Wn,r.__scopeDialog),i=h.useRef(!1),c=h.useRef(!1);return e.jsx(Fp,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var m,f;(m=r.onCloseAutoFocus)==null||m.call(r,d),d.defaultPrevented||(i.current||(f=l.triggerRef.current)==null||f.focus(),d.preventDefault()),i.current=!1,c.current=!1},onInteractOutside:d=>{var p,y;(p=r.onInteractOutside)==null||p.call(r,d),d.defaultPrevented||(i.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const m=d.target;((y=l.triggerRef.current)==null?void 0:y.contains(m))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),Fp=h.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:d,...m}=r,f=Zs(Wn,l),p=h.useRef(null),y=at(a,p);return jp(),e.jsxs(e.Fragment,{children:[e.jsx(ku,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:c,onUnmountAutoFocus:d,children:e.jsx(Cu,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Iu(f.open),...m,ref:y,onDismiss:()=>f.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(s2,{titleId:f.titleId}),e.jsx(n2,{contentRef:p,descriptionId:f.descriptionId})]})]})}),Ru="DialogTitle",zp=h.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=Zs(Ru,l);return e.jsx(Xe.h2,{id:c.titleId,...i,ref:a})});zp.displayName=Ru;var $p="DialogDescription",Bp=h.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=Zs($p,l);return e.jsx(Xe.p,{id:c.descriptionId,...i,ref:a})});Bp.displayName=$p;var Up="DialogClose",Vp=h.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=Zs(Up,l);return e.jsx(Xe.button,{type:"button",...i,ref:a,onClick:Ge(r.onClick,()=>c.onOpenChange(!1))})});Vp.displayName=Up;function Iu(r){return r?"open":"closed"}var Wp="DialogTitleWarning",[Z3,Hp]=Iw(Wp,{contentName:Wn,titleName:Ru,docsSlug:"dialog"}),s2=({titleId:r})=>{const a=Hp(Wp),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},r2="DialogDescriptionWarning",n2=({contentRef:r,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hp(r2).contentName}}.`;return h.useEffect(()=>{var d;const c=(d=r.current)==null?void 0:d.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(i))},[i,r,a]),null},a2=_p,l2=Dp,i2=Lp,o2=Op,c2=zp,d2=Bp,u2=Vp;function Ct(r){return e.jsx(a2,{"data-slot":"dialog",...r})}function h2(r){return e.jsx(l2,{...r})}const Kp=h.forwardRef(({className:r,...a},l)=>e.jsx(i2,{ref:l,className:lt("fixed inset-0 z-50 bg-black/50",r),...a}));Kp.displayName="DialogOverlay";const Nt=h.forwardRef(({className:r,children:a,showCloseButton:l=!0,...i},c)=>e.jsxs(h2,{children:[e.jsx(Kp,{}),e.jsxs(o2,{ref:c,"aria-describedby":void 0,className:lt("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),...i,children:[a,l&&e.jsxs(u2,{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(ms,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Nt.displayName="DialogContent";function kt({className:r,...a}){return e.jsx("div",{className:lt("flex flex-col gap-2 text-center sm:text-left",r),...a})}function Dt({className:r,...a}){return e.jsx("div",{className:lt("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function Et(r){return e.jsx(c2,{className:"text-lg font-semibold leading-none",...r})}function m2(r){return e.jsx(d2,{className:"text-sm text-muted-foreground",...r})}function _u(r,a){const[l,i]=h.useState(r);return h.useEffect(()=>{const c=setTimeout(()=>i(r),a);return()=>clearTimeout(c)},[r,a]),l}function Qs({page:r,totalPages:a,total:l,pageSize:i,onPageChange:c,onPageSizeChange:d,pageSizeOptions:m=[10,20,50,100]}){return a<=1&&!d?null:e.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[e.jsxs("span",{children:["共 ",l," 条"]}),d&&e.jsx("select",{value:i,onChange:f=>d(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 f2(){const[r,a]=h.useState([]),[l,i]=h.useState([]),[c,d]=h.useState(0),[m,f]=h.useState(0),[p,y]=h.useState(0),[g,v]=h.useState(1),[k,P]=h.useState(10),[T,N]=h.useState(""),j=_u(T,300),[C,E]=h.useState("all"),[b,R]=h.useState(!0),[G,X]=h.useState(null),[D,I]=h.useState(null),[w,V]=h.useState(""),[se,ie]=h.useState(!1);async function Y(){R(!0),X(null);try{const H=C==="all"?"":C==="completed"?"completed":C,A=new URLSearchParams({page:String(g),pageSize:String(k),...H&&{status:H},...j&&{search:j}}),[z,O]=await Promise.all([Oe(`/api/orders?${A}`),Oe("/api/db/users?page=1&pageSize=500")]);z!=null&&z.success&&(a(z.orders||[]),d(z.total??0),f(z.totalRevenue??0),y(z.todayRevenue??0)),O!=null&&O.success&&O.users&&i(O.users)}catch(H){console.error("加载订单失败",H),X("加载订单失败,请检查网络后重试")}finally{R(!1)}}h.useEffect(()=>{v(1)},[j,C]),h.useEffect(()=>{Y()},[g,k,j,C]);const ne=H=>{var A;return H.userNickname||((A=l.find(z=>z.id===H.userId))==null?void 0:A.nickname)||"匿名用户"},_=H=>{var A;return((A=l.find(z=>z.id===H))==null?void 0:A.phone)||"-"},Q=H=>{const A=H.productType||H.type||"",z=H.description||"";if(z){if(A==="section"&&z.includes("章节")){if(z.includes("-")){const O=z.split("-");if(O.length>=3)return{name:`第${O[1]}章 第${O[2]}节`,type:"《一场Soul的创业实验》"}}return{name:z,type:"章节购买"}}return A==="fullbook"||z.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:A==="vip"||z.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:A==="match"||z.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:z,type:"其他"}}return A==="section"?{name:`章节 ${H.productId||H.sectionId||""}`,type:"单章"}:A==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:A==="vip"?{name:"VIP年度会员",type:"VIP"}:A==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:A||"其他"}},ue=Math.ceil(c/k)||1;async function L(){var H;if(!(!(D!=null&&D.orderSn)&&!(D!=null&&D.id))){ie(!0),X(null);try{const A=await vt("/api/admin/orders/refund",{orderSn:D.orderSn||D.id,reason:w||void 0});A!=null&&A.success?(I(null),V(""),Y()):X((A==null?void 0:A.error)||"退款失败")}catch(A){const z=A;X(((H=z==null?void 0:z.data)==null?void 0:H.error)||"退款失败,请检查网络后重试")}finally{ie(!1)}}}function re(){if(r.length===0){alert("暂无数据可导出");return}const H=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],A=r.map(de=>{const q=Q(de);return[de.orderSn||de.id||"",ne(de),_(de.userId),q.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(",")}),z="\uFEFF"+[H.join(","),...A].join(` -`),O=new Blob([z],{type:"text/csv;charset=utf-8"}),ee=URL.createObjectURL(O),K=document.createElement("a");K.href=ee,K.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,K.click(),URL.revokeObjectURL(ee)}return e.jsxs("div",{className:"p-8 w-full",children:[G&&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:G}),e.jsx("button",{type:"button",onClick:()=>X(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(J,{variant:"outline",onClick:Y,disabled:b,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${b?"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:["¥",p.toFixed(2)]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(cn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(oe,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:T,onChange:H=>N(H.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qx,{className:"w-4 h-4 text-gray-400"}),e.jsxs("select",{value:C,onChange:H=>E(H.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(J,{variant:"outline",onClick:re,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(mj,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:b?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"订单号"}),e.jsx(je,{className:"text-gray-400",children:"用户"}),e.jsx(je,{className:"text-gray-400",children:"商品"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"支付方式"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"退款原因"}),e.jsx(je,{className:"text-gray-400",children:"分销佣金"}),e.jsx(je,{className:"text-gray-400",children:"下单时间"}),e.jsx(je,{className:"text-gray-400",children:"操作"})]})}),e.jsxs(ps,{children:[r.map(H=>{const A=Q(H);return e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(ge,{className:"font-mono text-xs text-gray-400",children:[(H.orderSn||H.id||"").slice(0,12),"..."]}),e.jsx(ge,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:ne(H)}),e.jsx("p",{className:"text-gray-500 text-xs",children:_(H.userId)})]})}),e.jsx(ge,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[A.name,(H.productType||H.type)==="vip"&&e.jsx(Le,{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(ge,{className:"text-[#38bdac] font-bold",children:["¥",Number(H.amount||0).toFixed(2)]}),e.jsx(ge,{className:"text-gray-300",children:H.paymentMethod==="wechat"?"微信支付":H.paymentMethod==="alipay"?"支付宝":H.paymentMethod||"微信支付"}),e.jsx(ge,{children:H.status==="refunded"?e.jsx(Le,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):H.status==="paid"||H.status==="completed"?e.jsx(Le,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):H.status==="pending"||H.status==="created"?e.jsx(Le,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):e.jsx(Le,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),e.jsx(ge,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:H.refundReason,children:H.status==="refunded"&&H.refundReason?H.refundReason:"-"}),e.jsx(ge,{className:"text-[#FFD700]",children:H.referrerEarnings?`¥${Number(H.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(ge,{className:"text-gray-400 text-sm",children:new Date(H.createdAt).toLocaleString("zh-CN")}),e.jsx(ge,{children:(H.status==="paid"||H.status==="completed")&&e.jsxs(J,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{I(H),V("")},children:[e.jsx(Zx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},H.id)}),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Qs,{page:g,totalPages:ue,total:c,pageSize:k,onPageChange:v,onPageSizeChange:H=>{P(H),v(1)}})]})})}),e.jsx(Ct,{open:!!D,onOpenChange:H=>!H&&I(null),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsx(Et,{className:"text-white",children:"订单退款"})}),D&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",D.orderSn||D.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(D.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(oe,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:w,onChange:H=>V(H.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>I(null),disabled:se,children:"取消"}),e.jsx(J,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:L,disabled:se,children:se?"退款中...":"确认退款"})]})]})})]})}var x2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],p2=x2.reduce((r,a)=>{const l=tp(`Primitive.${a}`),i=h.forwardRef((c,d)=>{const{asChild:m,...f}=c,p=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...f,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{}),g2="Label",Gp=h.forwardRef((r,a)=>e.jsx(p2.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())}}));Gp.displayName=g2;var Yp=Gp;const te=h.forwardRef(({className:r,...a},l)=>e.jsx(Yp,{ref:l,className:lt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));te.displayName=Yp.displayName;function Mu(r){const a=r+"CollectionProvider",[l,i]=vn(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),m=N=>{const{scope:j,children:C}=N,E=tn.useRef(null),b=tn.useRef(new Map).current;return e.jsx(c,{scope:j,itemMap:b,collectionRef:E,children:C})};m.displayName=a;const f=r+"CollectionSlot",p=Dl(f),y=tn.forwardRef((N,j)=>{const{scope:C,children:E}=N,b=d(f,C),R=at(j,b.collectionRef);return e.jsx(p,{ref:R,children:E})});y.displayName=f;const g=r+"CollectionItemSlot",v="data-radix-collection-item",k=Dl(g),P=tn.forwardRef((N,j)=>{const{scope:C,children:E,...b}=N,R=tn.useRef(null),G=at(j,R),X=d(g,C);return tn.useEffect(()=>(X.itemMap.set(R,{ref:R,...b}),()=>void X.itemMap.delete(R))),e.jsx(k,{[v]:"",ref:G,children:E})});P.displayName=g;function T(N){const j=d(r+"CollectionConsumer",N);return tn.useCallback(()=>{const E=j.collectionRef.current;if(!E)return[];const b=Array.from(E.querySelectorAll(`[${v}]`));return Array.from(j.itemMap.values()).sort((X,D)=>b.indexOf(X.ref.current)-b.indexOf(D.ref.current))},[j.collectionRef,j.itemMap])}return[{Provider:m,Slot:y,ItemSlot:P},T,i]}var y2=h.createContext(void 0);function Eo(r){const a=h.useContext(y2);return r||a||"ltr"}var Od="rovingFocusGroup.onEntryFocus",v2={bubbles:!1,cancelable:!0},zl="RovingFocusGroup",[su,Qp,b2]=Mu(zl),[j2,qp]=vn(zl,[b2]),[N2,w2]=j2(zl),Xp=h.forwardRef((r,a)=>e.jsx(su.Provider,{scope:r.__scopeRovingFocusGroup,children:e.jsx(su.Slot,{scope:r.__scopeRovingFocusGroup,children:e.jsx(S2,{...r,ref:a})})}));Xp.displayName=zl;var S2=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:i,loop:c=!1,dir:d,currentTabStopId:m,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:p,onEntryFocus:y,preventScrollOnEntryFocus:g=!1,...v}=r,k=h.useRef(null),P=at(a,k),T=Eo(d),[N,j]=Vn({prop:m,defaultProp:f??null,onChange:p,caller:zl}),[C,E]=h.useState(!1),b=mn(y),R=Qp(l),G=h.useRef(!1),[X,D]=h.useState(0);return h.useEffect(()=>{const I=k.current;if(I)return I.addEventListener(Od,b),()=>I.removeEventListener(Od,b)},[b]),e.jsx(N2,{scope:l,orientation:i,dir:T,loop:c,currentTabStopId:N,onItemFocus:h.useCallback(I=>j(I),[j]),onItemShiftTab:h.useCallback(()=>E(!0),[]),onFocusableItemAdd:h.useCallback(()=>D(I=>I+1),[]),onFocusableItemRemove:h.useCallback(()=>D(I=>I-1),[]),children:e.jsx(Xe.div,{tabIndex:C||X===0?-1:0,"data-orientation":i,...v,ref:P,style:{outline:"none",...r.style},onMouseDown:Ge(r.onMouseDown,()=>{G.current=!0}),onFocus:Ge(r.onFocus,I=>{const w=!G.current;if(I.target===I.currentTarget&&w&&!C){const V=new CustomEvent(Od,v2);if(I.currentTarget.dispatchEvent(V),!V.defaultPrevented){const se=R().filter(Q=>Q.focusable),ie=se.find(Q=>Q.active),Y=se.find(Q=>Q.id===N),_=[ie,Y,...se].filter(Boolean).map(Q=>Q.ref.current);e0(_,g)}}G.current=!1}),onBlur:Ge(r.onBlur,()=>E(!1))})})}),Jp="RovingFocusGroupItem",Zp=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:i=!0,active:c=!1,tabStopId:d,children:m,...f}=r,p=dn(),y=d||p,g=w2(Jp,l),v=g.currentTabStopId===y,k=Qp(l),{onFocusableItemAdd:P,onFocusableItemRemove:T,currentTabStopId:N}=g;return h.useEffect(()=>{if(i)return P(),()=>T()},[i,P,T]),e.jsx(su.ItemSlot,{scope:l,id:y,focusable:i,active:c,children:e.jsx(Xe.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:a,onMouseDown:Ge(r.onMouseDown,j=>{i?g.onItemFocus(y):j.preventDefault()}),onFocus:Ge(r.onFocus,()=>g.onItemFocus(y)),onKeyDown:Ge(r.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){g.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const C=E2(j,g.orientation,g.dir);if(C!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let b=k().filter(R=>R.focusable).map(R=>R.ref.current);if(C==="last")b.reverse();else if(C==="prev"||C==="next"){C==="prev"&&b.reverse();const R=b.indexOf(j.currentTarget);b=g.loop?P2(b,R+1):b.slice(R+1)}setTimeout(()=>e0(b))}}),children:typeof m=="function"?m({isCurrentTabStop:v,hasTabStop:N!=null}):m})})});Zp.displayName=Jp;var C2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function k2(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function E2(r,a,l){const i=k2(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return C2[i]}function e0(r,a=!1){const l=document.activeElement;for(const i of r)if(i===l||(i.focus({preventScroll:a}),document.activeElement!==l))return}function P2(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var T2=Xp,R2=Zp,Po="Tabs",[I2]=vn(Po,[qp]),t0=qp(),[_2,Au]=I2(Po),s0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,onValueChange:c,defaultValue:d,orientation:m="horizontal",dir:f,activationMode:p="automatic",...y}=r,g=Eo(f),[v,k]=Vn({prop:i,onChange:c,defaultProp:d??"",caller:Po});return e.jsx(_2,{scope:l,baseId:dn(),value:v,onValueChange:k,orientation:m,dir:g,activationMode:p,children:e.jsx(Xe.div,{dir:g,"data-orientation":m,...y,ref:a})})});s0.displayName=Po;var r0="TabsList",n0=h.forwardRef((r,a)=>{const{__scopeTabs:l,loop:i=!0,...c}=r,d=Au(r0,l),m=t0(l);return e.jsx(T2,{asChild:!0,...m,orientation:d.orientation,dir:d.dir,loop:i,children:e.jsx(Xe.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});n0.displayName=r0;var a0="TabsTrigger",l0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,disabled:c=!1,...d}=r,m=Au(a0,l),f=t0(l),p=c0(m.baseId,i),y=d0(m.baseId,i),g=i===m.value;return e.jsx(R2,{asChild:!0,...f,focusable:!c,active:g,children:e.jsx(Xe.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":y,"data-state":g?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:p,...d,ref:a,onMouseDown:Ge(r.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?m.onValueChange(i):v.preventDefault()}),onKeyDown:Ge(r.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&m.onValueChange(i)}),onFocus:Ge(r.onFocus,()=>{const v=m.activationMode!=="manual";!g&&!c&&v&&m.onValueChange(i)})})})});l0.displayName=a0;var i0="TabsContent",o0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,forceMount:c,children:d,...m}=r,f=Au(i0,l),p=c0(f.baseId,i),y=d0(f.baseId,i),g=i===f.value,v=h.useRef(g);return h.useEffect(()=>{const k=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(k)},[]),e.jsx(Fl,{present:c||g,children:({present:k})=>e.jsx(Xe.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":p,hidden:!k,id:y,tabIndex:0,...m,ref:a,style:{...r.style,animationDuration:v.current?"0s":void 0},children:k&&d})})});o0.displayName=i0;function c0(r,a){return`${r}-trigger-${a}`}function d0(r,a){return`${r}-content-${a}`}var M2=s0,u0=n0,h0=l0,m0=o0;const $l=M2,Ba=h.forwardRef(({className:r,...a},l)=>e.jsx(u0,{ref:l,className:lt("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));Ba.displayName=u0.displayName;const Lt=h.forwardRef(({className:r,...a},l)=>e.jsx(h0,{ref:l,className:lt("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=h0.displayName;const Ot=h.forwardRef(({className:r,...a},l)=>e.jsx(m0,{ref:l,className:lt("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=m0.displayName;function Du(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 Lu(r){const[a,l]=h.useState(void 0);return Zt(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const i=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let m,f;if("borderBoxSize"in d){const p=d.borderBoxSize,y=Array.isArray(p)?p[0]:p;m=y.inlineSize,f=y.blockSize}else m=r.offsetWidth,f=r.offsetHeight;l({width:m,height:f})});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else l(void 0)},[r]),a}var To="Switch",[A2]=vn(To),[D2,L2]=A2(To),f0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,name:i,checked:c,defaultChecked:d,required:m,disabled:f,value:p="on",onCheckedChange:y,form:g,...v}=r,[k,P]=h.useState(null),T=at(a,b=>P(b)),N=h.useRef(!1),j=k?g||!!k.closest("form"):!0,[C,E]=Vn({prop:c,defaultProp:d??!1,onChange:y,caller:To});return e.jsxs(D2,{scope:l,checked:C,disabled:f,children:[e.jsx(Xe.button,{type:"button",role:"switch","aria-checked":C,"aria-required":m,"data-state":y0(C),"data-disabled":f?"":void 0,disabled:f,value:p,...v,ref:T,onClick:Ge(r.onClick,b=>{E(R=>!R),j&&(N.current=b.isPropagationStopped(),N.current||b.stopPropagation())})}),j&&e.jsx(g0,{control:k,bubbles:!N.current,name:i,value:p,checked:C,required:m,disabled:f,form:g,style:{transform:"translateX(-100%)"}})]})});f0.displayName=To;var x0="SwitchThumb",p0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,...i}=r,c=L2(x0,l);return e.jsx(Xe.span,{"data-state":y0(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})});p0.displayName=x0;var O2="SwitchBubbleInput",g0=h.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:i=!0,...c},d)=>{const m=h.useRef(null),f=at(m,d),p=Du(l),y=Lu(a);return h.useEffect(()=>{const g=m.current;if(!g)return;const v=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(v,"checked").set;if(p!==l&&P){const T=new Event("click",{bubbles:i});P.call(g,l),g.dispatchEvent(T)}},[p,l,i]),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}})});g0.displayName=O2;function y0(r){return r?"checked":"unchecked"}var v0=f0,F2=p0;const ot=h.forwardRef(({className:r,...a},l)=>e.jsx(v0,{className:lt("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(F2,{className:lt("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")})}));ot.displayName=v0.displayName;const un=h.forwardRef(({className:r,...a},l)=>e.jsx("textarea",{className:lt("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}));un.displayName="Textarea";function b0({open:r,onClose:a,userId:l,onUserUpdated:i}){var $e;const[c,d]=h.useState(null),[m,f]=h.useState([]),[p,y]=h.useState([]),[g,v]=h.useState(!1),[k,P]=h.useState(!1),[T,N]=h.useState(!1),[j,C]=h.useState("info"),[E,b]=h.useState(""),[R,G]=h.useState(""),[X,D]=h.useState([]),[I,w]=h.useState(""),[V,se]=h.useState(!1),[ie,Y]=h.useState(null),[ne,_]=h.useState(null),[Q,ue]=h.useState(""),[L,re]=h.useState(""),[H,A]=h.useState(""),[z,O]=h.useState(!1),[ee,K]=h.useState(null),[de,q]=h.useState("");h.useEffect(()=>{r&&l&&(C("info"),Y(null),_(null),K(null),q(""),ye())},[r,l]);async function ye(){if(l){v(!0);try{const me=await Oe(`/api/db/users?id=${encodeURIComponent(l)}`);if(me!=null&&me.success&&me.user){const pe=me.user;d(pe),b(pe.phone||""),G(pe.nickname||""),ue(pe.phone||""),re(pe.wechatId||""),A(pe.openId||"");try{D(typeof pe.tags=="string"?JSON.parse(pe.tags||"[]"):[])}catch{D([])}}try{const pe=await Oe(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);pe!=null&&pe.success&&pe.tracks&&f(pe.tracks)}catch{f([])}try{const pe=await Oe(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);pe!=null&&pe.success&&pe.referrals&&y(pe.referrals)}catch{y([])}}catch(me){console.error("Load user detail error:",me)}finally{v(!1)}}}async function Se(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}P(!0);try{const me=await ut("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});me!=null&&me.success?(alert("同步成功"),ye()):alert("同步失败: "+(me==null?void 0:me.error))}catch(me){console.error("Sync CKB error:",me),alert("同步失败")}finally{P(!1)}}async function F(){if(c){N(!0);try{const me={id:c.id,phone:E||void 0,nickname:R||void 0,tags:JSON.stringify(X)},pe=await vt("/api/db/users",me);pe!=null&&pe.success?(alert("保存成功"),ye(),i==null||i()):alert("保存失败: "+(pe==null?void 0:pe.error))}catch(me){console.error("Save user error:",me),alert("保存失败")}finally{N(!1)}}}const xe=()=>{I&&!X.includes(I)&&(D([...X,I]),w(""))},ke=me=>D(X.filter(pe=>pe!==me));async function Ve(){if(!Q&&!H&&!L){_("请至少输入手机号、微信号或 OpenID 中的一项");return}se(!0),_(null),Y(null);try{const me=new URLSearchParams;Q&&me.set("phone",Q),H&&me.set("openId",H),L&&me.set("wechatId",L);const pe=await Oe(`/api/admin/shensheshou/query?${me}`);pe!=null&&pe.success&&pe.data?(Y(pe.data),c&&await We(pe.data)):_((pe==null?void 0:pe.error)||"未查询到数据,该用户可能未在神射手收录")}catch(me){console.error("SSS query error:",me),_("请求失败,请检查神射手接口配置")}finally{se(!1)}}async function We(me){if(c)try{await ut("/api/admin/shensheshou/enrich",{userId:c.id,phone:Q||c.phone||"",openId:H||c.openId||"",wechatId:L||c.wechatId||""}),ye()}catch(pe){console.error("SSS enrich error:",pe)}}async function Ke(){if(c){O(!0),K(null);try{const me={users:[{phone:c.phone||"",name:c.nickname||"",openId:c.openId||"",tags:X}]},pe=await ut("/api/admin/shensheshou/ingest",me);pe!=null&&pe.success&&pe.data?K(pe.data):K({error:(pe==null?void 0:pe.error)||"推送失败"})}catch(me){console.error("SSS ingest error:",me),K({error:"请求失败"})}finally{O(!1)}}}const tt=me=>{const ft={view_chapter:qs,purchase:Xd,match:Kt,login:Ia,register:Ia,share:Pr,bind_phone:eN,bind_wechat:Kj,fill_profile:Ed,visit_page:Ta}[me]||Qd;return e.jsx(ft,{className:"w-4 h-4"})};return r?e.jsx(Ct,{open:r,onOpenChange:()=>a(),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Ia,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"}),(c==null?void 0:c.isVip)&&e.jsx(Le,{className:"bg-amber-500/20 text-amber-400 border-0",children:"VIP"})]})}),g?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx(Be,{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:""}):(($e=c.nickname)==null?void 0:$e.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(Le,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"}),c.vipRole&&e.jsx(Le,{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($l,{value:j,onValueChange:C,className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(Ba,{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(Ta,{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(ln,{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(te,{className:"text-gray-300",children:"手机号"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:E,onChange:me=>b(me.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:R,onChange:me=>G(me.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(Jx,{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(nn,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{className:"text-white font-medium",children:"VIP 信息"}),e.jsx(Le,{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(Al,{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(oe,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"输入归属微信号(如 wxid_xxxx)",value:de,onChange:me=>q(me.target.value)}),e.jsxs(J,{size:"sm",onClick:async()=>{if(!(!de||!c))try{await vt("/api/db/users",{id:c.id,wechatId:de}),alert("已保存微信归属"),ye()}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(It,{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(Pr,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),e.jsx(J,{size:"sm",onClick:Se,disabled:k||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:k?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Be,{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(Le,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):e.jsx(Le,{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(Ed,{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(Yd,{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(me=>e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1.5",children:me.category}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:me.tags.map(pe=>e.jsxs("button",{type:"button",onClick:()=>{X.includes(pe)?ke(pe):D([...X,pe])},className:`px-2 py-0.5 rounded text-xs border transition-all ${X.includes(pe)?"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:[X.includes(pe)?"✓ ":"",pe]},pe))})]},me.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:[X.map((me,pe)=>e.jsxs(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[me,e.jsx("button",{type:"button",onClick:()=>ke(me),className:"ml-1 hover:text-red-400",children:e.jsx(ms,{className:"w-3 h-3"})})]},pe)),X.length===0&&e.jsx("span",{className:"text-gray-600 text-sm",children:"暂未选择标签"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(oe,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"自定义标签(回车添加)",value:I,onChange:me=>w(me.target.value),onKeyDown:me=>me.key==="Enter"&&xe()}),e.jsx(J,{onClick:xe,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(Ed,{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((me,pe)=>e.jsx(Le,{className:"bg-purple-500/20 text-purple-400 border-0",children:me.trim()},pe))})]})]}),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(Ta,{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((me,pe)=>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:tt(me.action)}),pe0?p.map((me,pe)=>{var es;const ft=me;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:((es=ft.nickname)==null?void 0:es.charAt(0))||"?"}),e.jsx("span",{className:"text-white text-sm",children:ft.nickname})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[ft.status==="vip"&&e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),e.jsx("span",{className:"text-gray-500 text-xs",children:ft.createdAt?new Date(ft.createdAt).toLocaleDateString():""})]})]},ft.id||pe)}):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(ln,{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(te,{className:"text-gray-500 text-xs mb-1 block",children:"手机号"}),e.jsx(oe,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"11位手机号",value:Q,onChange:me=>ue(me.target.value)})]}),e.jsxs("div",{children:[e.jsx(te,{className:"text-gray-500 text-xs mb-1 block",children:"微信号"}),e.jsx(oe,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"微信 ID",value:L,onChange:me=>re(me.target.value)})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx(te,{className:"text-gray-500 text-xs mb-1 block",children:"微信 OpenID"}),e.jsx(oe,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"openid_xxxx(自动填入)",value:H,onChange:me=>A(me.target.value)})]})]}),e.jsx(J,{onClick:Ve,disabled:V,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:V?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 查询并自动回填中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(cn,{className:"w-4 h-4 mr-1"})," 查询并自动完善用户资料"]})}),e.jsx("p",{className:"text-gray-600 text-xs mt-2",children:"查询成功后,神射手返回的标签将自动同步到该用户"}),ne&&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:ne}),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((me,pe)=>e.jsx(Le,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/20",children:me},pe))})]}),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(ln,{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(J,{onClick:Ke,disabled:z||!c.phone,variant:"outline",className:"border-purple-500/40 text-purple-400 hover:bg-purple-500/10 bg-transparent shrink-0 ml-4",children:z?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 推送中"]}):e.jsxs(e.Fragment,{children:[e.jsx(ln,{className:"w-4 h-4 mr-1"})," 推送"]})})]}),!c.phone&&e.jsx("p",{className:"text-yellow-500/70 text-xs",children:"⚠ 用户未绑定手机号,无法推送"}),ee&&e.jsx("div",{className:"mt-3 p-3 bg-[#162840] rounded-lg text-sm",children:ee.error?e.jsx("p",{className:"text-red-400",children:String(ee.error)}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-green-400 flex items-center gap-1",children:[e.jsx(Yd,{className:"w-4 h-4"})," 推送成功"]}),ee.enriched!==void 0&&e.jsxs("p",{className:"text-gray-400",children:["自动补全标签数:",String(ee.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(J,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"关闭"]}),e.jsxs(J,{onClick:F,disabled:T,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),T?"保存中...":"保存修改"]})]})]}):e.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Fd={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function z2({open:r,onClose:a,userId:l,userNickname:i="",onSaved:c}){const[d,m]=h.useState(Fd),[f,p]=h.useState([]),[y,g]=h.useState(!1),[v,k]=h.useState(!1);h.useEffect(()=>{if(!r){m(Fd);return}let T=!1;return g(!0),Promise.all([Oe("/api/db/vip-roles"),l?Oe(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([N,j])=>{if(T)return;const C=N!=null&&N.success&&N.data?N.data:[];p(C);const E=j&&j.user?j.user:null;if(E){const b=String(E.vipRole??""),R=C.some(G=>G.name===b);m({isVip:!!(E.isVip??!1),vipExpireDate:E.vipExpireDate?String(E.vipExpireDate).slice(0,10):"",vipSort:typeof E.vipSort=="number"?E.vipSort:"",vipRole:R?b:b?"__custom__":"",vipRoleCustom:R?"":b,vipName:String(E.vipName??""),vipProject:String(E.vipProject??""),vipContact:String(E.vipContact??""),vipBio:String(E.vipBio??"")})}else m(Fd)}).catch(N=>{T||console.error("Load error:",N)}).finally(()=>{T||g(!1)}),()=>{T=!0}},[r,l]);async function P(){if(l){if(d.isVip&&!d.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(d.isVip&&d.vipExpireDate.trim()){const T=new Date(d.vipExpireDate);if(isNaN(T.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}k(!0);try{const T=d.vipRole==="__custom__"?d.vipRoleCustom.trim():d.vipRole,N={id:l,isVip:d.isVip,vipExpireDate:d.isVip?d.vipExpireDate:void 0,vipSort:d.vipSort===""?void 0:d.vipSort,vipRole:T||void 0,vipName:d.vipName||void 0,vipProject:d.vipProject||void 0,vipContact:d.vipContact||void 0,vipBio:d.vipBio||void 0},j=await vt("/api/db/users",N);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{k(!1)}}}return r?e.jsx(Ct,{open:r,onOpenChange:()=>a(),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",i||l]})}),y?e.jsx("div",{className:"py-8 text-center text-gray-400",children:"加载中..."}):e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 会员"}),e.jsx(ot,{checked:d.isVip,onCheckedChange:T=>m(N=>({...N,isVip:T}))})]}),d.isVip&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",e.jsx("span",{className:"text-amber-400",children:"*"})]}),e.jsx(oe,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:d.vipExpireDate,onChange:T=>m(N=>({...N,vipExpireDate:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(oe,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:d.vipSort===""?"":d.vipSort,onChange:T=>{const N=T.target.value;m(j=>({...j,vipSort:N===""?"":parseInt(N,10)||0}))}})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:d.vipRole,onChange:T=>m(N=>({...N,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:"其他(手动填写)"})]}),d.vipRole==="__custom__"&&e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:d.vipRoleCustom,onChange:T=>m(N=>({...N,vipRoleCustom:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:d.vipName,onChange:T=>m(N=>({...N,vipName:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"项目/公司"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:d.vipProject,onChange:T=>m(N=>({...N,vipProject:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"联系方式"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:d.vipContact,onChange:T=>m(N=>({...N,vipContact:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"一句话简介"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:d.vipBio,onChange:T=>m(N=>({...N,vipBio:T.target.value}))})]})]}),e.jsxs(Dt,{children:[e.jsxs(J,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:P,disabled:v||y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})}):null}const so=[{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 as,Pn,er,xr,Pt;const[r,a]=Wx(),l=r.get("pool"),[i,c]=h.useState([]),[d,m]=h.useState(0),[f,p]=h.useState(1),[y,g]=h.useState(10),[v,k]=h.useState(""),P=_u(v,300),T=l==="vip"?"vip":l==="complete"?"complete":"all",[N,j]=h.useState(T),[C,E]=h.useState(!0),[b,R]=h.useState(null),[G,X]=h.useState(!1),[D,I]=h.useState("desc");h.useEffect(()=>{l==="vip"?j("vip"):l==="complete"?j("complete"):l==="all"&&j("all")},[l]);const[w,V]=h.useState(!1),[se,ie]=h.useState(!1),[Y,ne]=h.useState(null),[_,Q]=h.useState(""),[ue,L]=h.useState(""),[re,H]=h.useState(!1),[A,z]=h.useState(!1),[O,ee]=h.useState({referrals:[],stats:{}}),[K,de]=h.useState(!1),[q,ye]=h.useState(null),[Se,F]=h.useState(!1),[xe,ke]=h.useState(null),[Ve,We]=h.useState(!1),[Ke,tt]=h.useState(null),[$e,me]=h.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),[pe,ft]=h.useState([]),[es,hr]=h.useState(!1),[Nn,As]=h.useState(!1),[Bt,Mr]=h.useState(null),[ct,gs]=h.useState({title:"",description:"",trigger:"",sort:0,enabled:!0}),[wn,mr]=h.useState([]),[Cs,Yn]=h.useState(!1),[Qn,ks]=h.useState(!1),[Sn,fr]=h.useState(null),[ys,Ds]=h.useState({name:"",sort:0}),[Ls,Cn]=h.useState({}),[Es,Os]=h.useState(!1);async function Fs(){var B;E(!0),R(null);try{if(G){const He=new URLSearchParams({search:P,limit:String(y*5)}),Je=await Oe(`/api/db/users/rfm?${He}`);if(Je!=null&&Je.success){let ls=Je.users||[];D==="asc"&&(ls=[...ls].reverse());const dt=(f-1)*y;c(ls.slice(dt,dt+y)),m(((B=Je.users)==null?void 0:B.length)??0),ls.length===0&&(X(!1),R("暂无订单数据,RFM 排序需要用户有购买记录后才能生效"))}else X(!1),R((Je==null?void 0:Je.error)||"RFM 加载失败,已切回普通模式")}else{const He=new URLSearchParams({page:String(f),pageSize:String(y),search:P,...N==="vip"&&{vip:"true"},...N==="complete"&&{pool:"complete"}}),Je=await Oe(`/api/db/users?${He}`);Je!=null&&Je.success?(c(Je.users||[]),m(Je.total??0)):R((Je==null?void 0:Je.error)||"加载失败")}}catch(He){console.error("Load users error:",He),R("网络错误")}finally{E(!1)}}h.useEffect(()=>{p(1)},[P,N,G]),h.useEffect(()=>{Fs()},[f,y,P,N,G,D]);const qn=Math.ceil(d/y)||1,Xn=()=>{G?D==="desc"?I("asc"):(X(!1),I("desc")):(X(!0),I("desc"))},Jn=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 Zn(B){if(confirm("确定要删除这个用户吗?"))try{const He=await Tr(`/api/db/users?id=${encodeURIComponent(B)}`);He!=null&&He.success?Fs():alert("删除失败: "+((He==null?void 0:He.error)||""))}catch{alert("删除失败")}}const kn=B=>{ne(B),me({phone:B.phone||"",nickname:B.nickname||"",password:"",isAdmin:!!(B.isAdmin??!1),hasFullBook:!!(B.hasFullBook??!1)}),V(!0)},En=()=>{ne(null),me({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),V(!0)};async function zs(){if(!$e.phone||!$e.nickname){alert("请填写手机号和昵称");return}H(!0);try{if(Y){const B=await vt("/api/db/users",{id:Y.id,nickname:$e.nickname,isAdmin:$e.isAdmin,hasFullBook:$e.hasFullBook,...$e.password&&{password:$e.password}});if(!(B!=null&&B.success)){alert("更新失败: "+((B==null?void 0:B.error)||""));return}}else{const B=await ut("/api/db/users",{phone:$e.phone,nickname:$e.nickname,password:$e.password,isAdmin:$e.isAdmin});if(!(B!=null&&B.success)){alert("创建失败: "+((B==null?void 0:B.error)||""));return}}V(!1),Fs()}catch{alert("保存失败")}finally{H(!1)}}const Ar=B=>{ne(B),Q(""),L(""),ie(!0)};async function $s(B){ye(B),z(!0),de(!0);try{const He=await Oe(`/api/db/users/referrals?userId=${encodeURIComponent(B.id)}`);He!=null&&He.success?ee({referrals:He.referrals||[],stats:He.stats||{}}):ee({referrals:[],stats:{}})}catch{ee({referrals:[],stats:{}})}finally{de(!1)}}async function ea(){if(!_){alert("请输入新密码");return}if(_!==ue){alert("两次密码不一致");return}if(_.length<6){alert("密码至少6位");return}H(!0);try{const B=await vt("/api/db/users",{id:Y==null?void 0:Y.id,password:_});B!=null&&B.success?(alert("修改成功"),ie(!1)):alert("修改失败: "+((B==null?void 0:B.error)||""))}catch{alert("修改失败")}finally{H(!1)}}const ts=h.useCallback(async()=>{hr(!0);try{const B=await Oe("/api/db/user-rules");B!=null&&B.success&&ft(B.rules||[])}catch{}finally{hr(!1)}},[]);async function $(){if(!ct.title){alert("请填写规则标题");return}H(!0);try{if(Bt){const B=await vt("/api/db/user-rules",{id:Bt.id,...ct});if(!(B!=null&&B.success)){alert("更新失败: "+((B==null?void 0:B.error)||""));return}}else{const B=await ut("/api/db/user-rules",ct);if(!(B!=null&&B.success)){alert("创建失败: "+((B==null?void 0:B.error)||""));return}}As(!1),ts()}catch{alert("保存失败")}finally{H(!1)}}async function ce(B){if(confirm("确定删除?"))try{const He=await Tr(`/api/db/user-rules?id=${B}`);He!=null&&He.success&&ts()}catch{}}async function Ce(B){try{await vt("/api/db/user-rules",{id:B.id,enabled:!B.enabled}),ts()}catch{}}const Ee=h.useCallback(async()=>{Yn(!0);try{const B=await Oe("/api/db/vip-roles");B!=null&&B.success&&mr(B.roles||[])}catch{}finally{Yn(!1)}},[]);async function xt(){if(!ys.name){alert("请填写角色名称");return}H(!0);try{if(Sn){const B=await vt("/api/db/vip-roles",{id:Sn.id,...ys});if(!(B!=null&&B.success)){alert("更新失败");return}}else{const B=await ut("/api/db/vip-roles",ys);if(!(B!=null&&B.success)){alert("创建失败");return}}ks(!1),Ee()}catch{alert("保存失败")}finally{H(!1)}}async function ns(B){if(confirm("确定删除?"))try{const He=await Tr(`/api/db/vip-roles?id=${B}`);He!=null&&He.success&&Ee()}catch{}}const nt=h.useCallback(async()=>{Os(!0);try{const B=await Oe("/api/db/users/journey-stats");B!=null&&B.success&&B.stats&&Cn(B.stats)}catch{}finally{Os(!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:()=>R(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:["共 ",d," 位注册用户",G&&" · RFM 排序中"]})]})}),e.jsxs($l,{defaultValue:"users",className:"w-full",children:[e.jsxs(Ba,{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(Kt,{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:nt,children:[e.jsx(Ta,{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:ts,children:[e.jsx(Un,{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:Ee,children:[e.jsx(nn,{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(J,{variant:"outline",onClick:Fs,disabled:C,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${C?"animate-spin":""}`})," 刷新"]}),e.jsxs("select",{value:N,onChange:B=>{const He=B.target.value;j(He),p(1),l&&(r.delete("pool"),a(r))},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",disabled:G,children:[e.jsx("option",{value:"all",children:"全部用户"}),e.jsx("option",{value:"vip",children:"VIP会员(超级个体)"}),e.jsx("option",{value:"complete",children:"完善资料用户"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(cn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(oe,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-56",value:v,onChange:B=>k(B.target.value)})]}),e.jsxs(J,{onClick:En,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Jd,{className:"w-4 h-4 mr-2"})," 添加用户"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:C?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"用户信息"}),e.jsx(je,{className:"text-gray-400",children:"绑定信息"}),e.jsx(je,{className:"text-gray-400",children:"购买状态"}),e.jsx(je,{className:"text-gray-400",children:"分销收益"}),e.jsxs(je,{className:"text-gray-400 cursor-pointer select-none",onClick:Xn,children:[e.jsxs("div",{className:"flex items-center gap-1 group",children:[e.jsx(Ra,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"RFM分值"}),G?D==="desc"?e.jsx(Ml,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Kx,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Wb,{className:"w-3.5 h-3.5 text-gray-600 group-hover:text-gray-400"})]}),G&&e.jsx("div",{className:"text-[10px] text-[#38bdac] font-normal mt-0.5",children:"点击切换方向/关闭"})]}),e.jsx(je,{className:"text-gray-400",children:"注册时间"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(ps,{children:[i.map(B=>{var He,Je,ls;return e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{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:""}):((He=B.nickname)==null?void 0:He.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(Le,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),B.openId&&!((Je=B.id)!=null&&Je.startsWith("user_"))&&e.jsx(Le,{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)+"...":(ls=B.id)==null?void 0:ls.slice(0,12)})]})]})}),e.jsx(ge,{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(ge,{children:B.hasFullBook?e.jsx(Le,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):e.jsx(Le,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),e.jsx(ge,{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:()=>$s(B),role:"button",tabIndex:0,onKeyDown:dt=>dt.key==="Enter"&&$s(B),children:[e.jsx(Kt,{className:"w-3 h-3"})," 绑定",B.referralCount||0,"人"]})]})}),e.jsx(ge,{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(Le,{className:`border-0 text-xs ${Jn(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(ge,{className:"text-gray-400",children:B.createdAt?new Date(B.createdAt).toLocaleDateString():"-"}),e.jsx(ge,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>{tt(B),We(!0)},className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:e.jsx(nn,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>{ke(B.id),F(!0)},className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:e.jsx(Er,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>kn(B),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>Ar(B),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx(Bf,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Zn(B.id),title:"删除",children:e.jsx(Ht,{className:"w-4 h-4"})})]})})]},B.id)}),i.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Qs,{page:f,totalPages:qn,total:d,pageSize:y,onPageChange:p,onPageSizeChange:B=>{g(B),p(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(J,{variant:"outline",onClick:nt,disabled:Es,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${Es?"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:so.map((B,He)=>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(Je=>Je.startsWith("text-"))}`,children:B.label}),Ls[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:Ls[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:He+1})]}),Hee.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(qs,{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:"实时更新"})]}),Es?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Be,{className:"w-5 h-5 text-[#38bdac] animate-spin"})}):Object.keys(Ls).length>0?e.jsx("div",{className:"space-y-2",children:so.map(B=>{const He=Ls[B.id]||0,Je=Math.max(...so.map(dt=>Ls[dt.id]||0),1),ls=Math.round(He/Je*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:`${ls}%`}})}),e.jsx("span",{className:"text-gray-400 text-xs w-10 text-right",children:He})]},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(J,{variant:"outline",onClick:ts,disabled:es,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${es?"animate-spin":""}`})," 刷新"]}),e.jsxs(J,{onClick:()=>{Mr(null),gs({title:"",description:"",trigger:"",sort:0,enabled:!0}),As(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"})," 添加规则"]})]})]}),es?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):pe.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(qs,{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(J,{onClick:ts,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Be,{className:"w-4 h-4 mr-2"})," 重新加载"]})]}):e.jsx("div",{className:"space-y-2",children:pe.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(Le,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/30 text-xs",children:["触发:",B.trigger]}),e.jsx(Le,{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(ot,{checked:B.enabled,onCheckedChange:()=>Ce(B)}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>{Mr(B),gs({title:B.title,description:B.description,trigger:B.trigger,sort:B.sort,enabled:B.enabled}),As(!0)},className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>ce(B.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Ht,{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(J,{variant:"outline",onClick:Ee,disabled:Cs,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${Cs?"animate-spin":""}`})," 刷新"]}),e.jsxs(J,{onClick:()=>{fr(null),Ds({name:"",sort:0}),ks(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"})," 添加角色"]})]})]}),Cs?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"})}):wn.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(nn,{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(J,{onClick:()=>{fr(null),Ds({name:"",sort:0}),ks(!0)},className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{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:wn.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(nn,{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:()=>{fr(B),Ds({name:B.name,sort:B.sort}),ks(!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:()=>ns(B.id),className:"text-gray-500 hover:text-red-400",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["排序: ",B.sort]})]},B.id))})]})]}),e.jsx(Ct,{open:w,onOpenChange:V,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[Y?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Jd,{className:"w-5 h-5 text-[#38bdac]"}),Y?"编辑用户":"添加用户"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"手机号"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:$e.phone,onChange:B=>me({...$e,phone:B.target.value}),disabled:!!Y})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:$e.nickname,onChange:B=>me({...$e,nickname:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:Y?"新密码 (留空则不修改)":"密码"}),e.jsx(oe,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:Y?"留空则不修改":"请输入密码",value:$e.password,onChange:B=>me({...$e,password:B.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"管理员权限"}),e.jsx(ot,{checked:$e.isAdmin,onCheckedChange:B=>me({...$e,isAdmin:B})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"已购全书"}),e.jsx(ot,{checked:$e.hasFullBook,onCheckedChange:B=>me({...$e,hasFullBook:B})})]})]}),e.jsxs(Dt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>V(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:zs,disabled:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),re?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:se,onOpenChange:ie,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Bf,{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:["用户:",Y==null?void 0:Y.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",Y==null?void 0:Y.phone]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"新密码"}),e.jsx(oe,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:_,onChange:B=>Q(B.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"确认密码"}),e.jsx(oe,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入",value:ue,onChange:B=>L(B.target.value)})]})]}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>ie(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:ea,disabled:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:re?"保存中...":"确认修改"})]})]})}),e.jsx(Ct,{open:Nn,onOpenChange:As,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),Bt?"编辑规则":"添加规则"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"规则标题 *"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:匹配后填写头像、付款1980需填写信息",value:ct.title,onChange:B=>gs({...ct,title:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"规则描述"}),e.jsx(un,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[80px] resize-none",placeholder:"详细说明规则内容...",value:ct.description,onChange:B=>gs({...ct,description:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"触发条件"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:完成匹配、付款后、注册时",value:ct.trigger,onChange:B=>gs({...ct,trigger:B.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx(te,{className:"text-gray-300",children:"启用状态"})}),e.jsx(ot,{checked:ct.enabled,onCheckedChange:B=>gs({...ct,enabled:B})})]})]}),e.jsxs(Dt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>As(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:$,disabled:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),re?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:Qn,onOpenChange:ks,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-amber-400"}),Sn?"编辑 VIP 角色":"添加 VIP 角色"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色名称 *"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:创业者、资源整合者、技术咖",value:ys.name,onChange:B=>Ds({...ys,name:B.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序(越小越前)"}),e.jsx(oe,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:ys.sort,onChange:B=>Ds({...ys,sort:parseInt(B.target.value)||0})})]})]}),e.jsxs(Dt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>ks(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:xt,disabled:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),re?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:A,onOpenChange:z,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系 - ",q==null?void 0:q.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:((as=O.stats)==null?void 0:as.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:((Pn=O.stats)==null?void 0:Pn.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:["¥",(((er=O.stats)==null?void 0:er.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:["¥",(((xr=O.stats)==null?void 0:xr.pendingEarnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),K?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Be,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((Pt=O.referrals)==null?void 0:Pt.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(O.referrals??[]).map((B,He)=>{var ls;const Je=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:((ls=Je.nickname)==null?void 0:ls.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white text-sm",children:Je.nickname}),e.jsx("div",{className:"text-xs text-gray-500",children:Je.phone||(Je.hasOpenId?"微信用户":"未绑定")})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Je.status==="vip"&&e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),Je.status==="paid"&&e.jsxs(Le,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",Je.purchasedSections,"章"]}),Je.status==="free"&&e.jsx(Le,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),e.jsx("span",{className:"text-xs text-gray-500",children:Je.createdAt?new Date(Je.createdAt).toLocaleDateString():""})]})]},Je.id||He)})}):e.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),e.jsx(Dt,{children:e.jsx(J,{variant:"outline",onClick:()=>z(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),e.jsx(b0,{open:Se,onClose:()=>F(!1),userId:xe,onUserUpdated:Fs}),e.jsx(z2,{open:Ve,onClose:()=>{We(!1),tt(null)},userId:(Ke==null?void 0:Ke.id)??null,userNickname:Ke==null?void 0:Ke.nickname,onSaved:Fs})]})}function xo(r,[a,l]){return Math.min(l,Math.max(a,r))}var j0=["PageUp","PageDown"],N0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],w0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ua="Slider",[ru,B2,U2]=Mu(Ua),[S0]=vn(Ua,[U2]),[V2,Ro]=S0(Ua),C0=h.forwardRef((r,a)=>{const{name:l,min:i=0,max:c=100,step:d=1,orientation:m="horizontal",disabled:f=!1,minStepsBetweenThumbs:p=0,defaultValue:y=[i],value:g,onValueChange:v=()=>{},onValueCommit:k=()=>{},inverted:P=!1,form:T,...N}=r,j=h.useRef(new Set),C=h.useRef(0),b=m==="horizontal"?W2:H2,[R=[],G]=Vn({prop:g,defaultProp:y,onChange:se=>{var Y;(Y=[...j.current][C.current])==null||Y.focus(),v(se)}}),X=h.useRef(R);function D(se){const ie=q2(R,se);V(se,ie)}function I(se){V(se,C.current)}function w(){const se=X.current[C.current];R[C.current]!==se&&k(R)}function V(se,ie,{commit:Y}={commit:!1}){const ne=e4(d),_=t4(Math.round((se-i)/d)*d+i,ne),Q=xo(_,[i,c]);G((ue=[])=>{const L=Y2(ue,Q,ie);if(Z2(L,p*d)){C.current=L.indexOf(Q);const re=String(L)!==String(ue);return re&&Y&&k(L),re?L:ue}else return ue})}return e.jsx(V2,{scope:r.__scopeSlider,name:l,disabled:f,min:i,max:c,valueIndexToChangeRef:C,thumbs:j.current,values:R,orientation:m,form:T,children:e.jsx(ru.Provider,{scope:r.__scopeSlider,children:e.jsx(ru.Slot,{scope:r.__scopeSlider,children:e.jsx(b,{"aria-disabled":f,"data-disabled":f?"":void 0,...N,ref:a,onPointerDown:Ge(N.onPointerDown,()=>{f||(X.current=R)}),min:i,max:c,inverted:P,onSlideStart:f?void 0:D,onSlideMove:f?void 0:I,onSlideEnd:f?void 0:w,onHomeKeyDown:()=>!f&&V(i,0,{commit:!0}),onEndKeyDown:()=>!f&&V(c,R.length-1,{commit:!0}),onStepKeyDown:({event:se,direction:ie})=>{if(!f){const _=j0.includes(se.key)||se.shiftKey&&N0.includes(se.key)?10:1,Q=C.current,ue=R[Q],L=d*_*ie;V(ue+L,Q,{commit:!0})}}})})})})});C0.displayName=Ua;var[k0,E0]=S0(Ua,{startEdge:"left",endEdge:"right",size:"width",direction:1}),W2=h.forwardRef((r,a)=>{const{min:l,max:i,dir:c,inverted:d,onSlideStart:m,onSlideMove:f,onSlideEnd:p,onStepKeyDown:y,...g}=r,[v,k]=h.useState(null),P=at(a,b=>k(b)),T=h.useRef(void 0),N=Eo(c),j=N==="ltr",C=j&&!d||!j&&d;function E(b){const R=T.current||v.getBoundingClientRect(),G=[0,R.width],D=Ou(G,C?[l,i]:[i,l]);return T.current=R,D(b-R.left)}return e.jsx(k0,{scope:r.__scopeSlider,startEdge:C?"left":"right",endEdge:C?"right":"left",direction:C?1:-1,size:"width",children:e.jsx(P0,{dir:N,"data-orientation":"horizontal",...g,ref:P,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const R=E(b.clientX);m==null||m(R)},onSlideMove:b=>{const R=E(b.clientX);f==null||f(R)},onSlideEnd:()=>{T.current=void 0,p==null||p()},onStepKeyDown:b=>{const G=w0[C?"from-left":"from-right"].includes(b.key);y==null||y({event:b,direction:G?-1:1})}})})}),H2=h.forwardRef((r,a)=>{const{min:l,max:i,inverted:c,onSlideStart:d,onSlideMove:m,onSlideEnd:f,onStepKeyDown:p,...y}=r,g=h.useRef(null),v=at(a,g),k=h.useRef(void 0),P=!c;function T(N){const j=k.current||g.current.getBoundingClientRect(),C=[0,j.height],b=Ou(C,P?[i,l]:[l,i]);return k.current=j,b(N-j.top)}return e.jsx(k0,{scope:r.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:e.jsx(P0,{"data-orientation":"vertical",...y,ref:v,style:{...y.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:N=>{const j=T(N.clientY);d==null||d(j)},onSlideMove:N=>{const j=T(N.clientY);m==null||m(j)},onSlideEnd:()=>{k.current=void 0,f==null||f()},onStepKeyDown:N=>{const C=w0[P?"from-bottom":"from-top"].includes(N.key);p==null||p({event:N,direction:C?-1:1})}})})}),P0=h.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:m,onEndKeyDown:f,onStepKeyDown:p,...y}=r,g=Ro(Ua,l);return e.jsx(Xe.span,{...y,ref:a,onKeyDown:Ge(r.onKeyDown,v=>{v.key==="Home"?(m(v),v.preventDefault()):v.key==="End"?(f(v),v.preventDefault()):j0.concat(N0).includes(v.key)&&(p(v),v.preventDefault())}),onPointerDown:Ge(r.onPointerDown,v=>{const k=v.target;k.setPointerCapture(v.pointerId),v.preventDefault(),g.thumbs.has(k)?k.focus():i(v)}),onPointerMove:Ge(r.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:Ge(r.onPointerUp,v=>{const k=v.target;k.hasPointerCapture(v.pointerId)&&(k.releasePointerCapture(v.pointerId),d(v))})})}),T0="SliderTrack",R0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=Ro(T0,l);return e.jsx(Xe.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...i,ref:a})});R0.displayName=T0;var nu="SliderRange",I0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=Ro(nu,l),d=E0(nu,l),m=h.useRef(null),f=at(a,m),p=c.values.length,y=c.values.map(k=>A0(k,c.min,c.max)),g=p>1?Math.min(...y):0,v=100-Math.max(...y);return e.jsx(Xe.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...i,ref:f,style:{...r.style,[d.startEdge]:g+"%",[d.endEdge]:v+"%"}})});I0.displayName=nu;var au="SliderThumb",_0=h.forwardRef((r,a)=>{const l=B2(r.__scopeSlider),[i,c]=h.useState(null),d=at(a,f=>c(f)),m=h.useMemo(()=>i?l().findIndex(f=>f.ref.current===i):-1,[l,i]);return e.jsx(K2,{...r,ref:d,index:m})}),K2=h.forwardRef((r,a)=>{const{__scopeSlider:l,index:i,name:c,...d}=r,m=Ro(au,l),f=E0(au,l),[p,y]=h.useState(null),g=at(a,E=>y(E)),v=p?m.form||!!p.closest("form"):!0,k=Lu(p),P=m.values[i],T=P===void 0?0:A0(P,m.min,m.max),N=Q2(i,m.values.length),j=k==null?void 0:k[f.size],C=j?X2(j,T,f.direction):0;return h.useEffect(()=>{if(p)return m.thumbs.add(p),()=>{m.thumbs.delete(p)}},[p,m.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${T}% + ${C}px)`},children:[e.jsx(ru.ItemSlot,{scope:r.__scopeSlider,children:e.jsx(Xe.span,{role:"slider","aria-label":r["aria-label"]||N,"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,...d,ref:g,style:P===void 0?{display:"none"}:r.style,onFocus:Ge(r.onFocus,()=>{m.valueIndexToChangeRef.current=i})})}),v&&e.jsx(M0,{name:c??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:P},i)]})});_0.displayName=au;var G2="RadioBubbleInput",M0=h.forwardRef(({__scopeSlider:r,value:a,...l},i)=>{const c=h.useRef(null),d=at(c,i),m=Du(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(m!==a&&g){const v=new Event("input",{bubbles:!0});g.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(Xe.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});M0.displayName=G2;function Y2(r=[],a,l){const i=[...r];return i[l]=a,i.sort((c,d)=>c-d)}function A0(r,a,l){const d=100/(l-a)*(r-a);return xo(d,[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)),i=Math.min(...l);return l.indexOf(i)}function X2(r,a,l){const i=r/2,d=Ou([0,50],[0,i]);return(i-d(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 Ou(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const i=(a[1]-a[0])/(r[1]-r[0]);return a[0]+i*(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=C0,r4=R0,n4=I0,a4=_0;function l4({className:r,defaultValue:a,value:l,min:i=0,max:c=100,...d}){const m=h.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[i,c],[l,a,i,c]);return e.jsxs(s4,{defaultValue:a,value:l,min:i,max:c,className:lt("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...d,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,p)=>e.jsx(a4,{className:"block size-4 shrink-0 rounded-full border-2 border-[#38bdac] bg-white shadow-sm focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},p))]})}const i4={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function D0({embedded:r=!1}){const[a,l]=h.useState(i4),[i,c]=h.useState(!0),[d,m]=h.useState(!1);h.useEffect(()=>{Oe("/api/admin/referral-settings").then(y=>{const g=y==null?void 0:y.data;g&&typeof g=="object"&&l({distributorShare:g.distributorShare??90,minWithdrawAmount:g.minWithdrawAmount??10,bindingDays:g.bindingDays??30,userDiscount:g.userDiscount??5,enableAutoWithdraw:g.enableAutoWithdraw??!1,vipOrderShareVip:g.vipOrderShareVip??20,vipOrderShareNonVip:g.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},g=await ut("/api/admin/referral-settings",y);if(!g||g.success===!1){alert("保存失败: "+(g&&typeof g=="object"&&"error"in g?g.error:""));return}alert(`✅ 分销配置已保存成功! - -• 小程序与网站的推广规则会一起生效 -• 绑定关系会使用新的天数配置 -• 佣金比例会立即应用到新订单 - -如有缓存,请刷新前台/小程序页面。`)}catch(y){console.error(y),alert("保存失败: "+(y instanceof Error?y.message:String(y)))}finally{m(!1)}},p=y=>g=>{const v=parseFloat(g.target.value||"0");l(k=>({...k,[y]:isNaN(v)?0:v}))};return i?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Aa,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),e.jsxs(J,{onClick:f,disabled:d||i,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),d?"保存中...":"保存配置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"flex items-center gap-2 text-white",children:[e.jsx(Jj,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),e.jsx(bt,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),e.jsx(we,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Yi,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),e.jsx(oe,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.userDiscount,onChange:p("userDiscount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Kt,{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(g=>({...g,distributorShare:y}))}),e.jsx(oe,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:a.distributorShare,onChange:p("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(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Yi,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),e.jsx(oe,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.vipOrderShareVip,onChange:p("vipOrderShareVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Yi,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),e.jsx(oe,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.vipOrderShareNonVip,onChange:p("vipOrderShareNonVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Kt,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),e.jsx(oe,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:a.bindingDays,onChange:p("bindingDays")}),e.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"flex items-center gap-2 text-white",children:[e.jsx(Aa,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),e.jsx(bt,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),e.jsx(we,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最低提现金额(元)"}),e.jsx(oe,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:a.minWithdrawAmount,onChange:p("minWithdrawAmount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",e.jsx(Le,{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(ot,{checked:a.enableAutoWithdraw,onCheckedChange:y=>l(g=>({...g,enableAutoWithdraw:y}))}),e.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Qe,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[e.jsx(Yi,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),e.jsxs(we,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[e.jsxs("p",{children:["1. 以上配置会写入"," ",e.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),e.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),e.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}function o4(){var Se;const[r,a]=h.useState("overview"),[l,i]=h.useState([]),[c,d]=h.useState(null),[m,f]=h.useState([]),[p,y]=h.useState([]),[g,v]=h.useState([]),[k,P]=h.useState(!0),[T,N]=h.useState(null),[j,C]=h.useState(""),[E,b]=h.useState("all"),[R,G]=h.useState(1),[X,D]=h.useState(10),[I,w]=h.useState(0),[V,se]=h.useState(new Set),[ie,Y]=h.useState(null),[ne,_]=h.useState(""),[Q,ue]=h.useState(!1);h.useEffect(()=>{L()},[]),h.useEffect(()=>{G(1)},[r,E]),h.useEffect(()=>{re(r)},[r]),h.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&re(r,!0)},[R,X,E,j]);async function L(){N(null);try{const F=await Oe("/api/admin/distribution/overview");F!=null&&F.success&&F.overview&&d(F.overview)}catch(F){console.error("[Admin] 概览接口异常:",F),N("加载概览失败")}try{const F=await Oe("/api/db/users");v((F==null?void 0:F.users)||[])}catch(F){console.error("[Admin] 用户数据加载失败:",F)}}async function re(F,xe=!1){var ke;if(!(!xe&&V.has(F))){P(!0);try{const Ve=g;switch(F){case"overview":break;case"orders":{try{const We=new URLSearchParams({page:String(R),pageSize:String(X),...E!=="all"&&{status:E},...j&&{search:j}}),Ke=await Oe(`/api/orders?${We}`);if(Ke!=null&&Ke.success&&Ke.orders){const tt=Ke.orders.map($e=>{const me=Ve.find(ft=>ft.id===$e.userId),pe=$e.referrerId?Ve.find(ft=>ft.id===$e.referrerId):null;return{...$e,amount:parseFloat(String($e.amount))||0,userNickname:(me==null?void 0:me.nickname)||$e.userNickname||"未知用户",userPhone:(me==null?void 0:me.phone)||$e.userPhone||"-",referrerNickname:(pe==null?void 0:pe.nickname)||null,referrerCode:(pe==null?void 0:pe.referralCode)??null,type:$e.productType||$e.type}});i(tt),w(Ke.total??tt.length)}else i([]),w(0)}catch(We){console.error(We),N("加载订单失败"),i([])}break}case"bindings":{try{const We=new URLSearchParams({page:String(R),pageSize:String(X),...E!=="all"&&{status:E}}),Ke=await Oe(`/api/db/distribution?${We}`);f((Ke==null?void 0:Ke.bindings)||[]),w((Ke==null?void 0:Ke.total)??((ke=Ke==null?void 0:Ke.bindings)==null?void 0:ke.length)??0)}catch(We){console.error(We),N("加载绑定数据失败"),f([])}break}case"withdrawals":{try{const We=E==="completed"?"success":E==="rejected"?"failed":E,Ke=new URLSearchParams({...We&&We!=="all"&&{status:We},page:String(R),pageSize:String(X)}),tt=await Oe(`/api/admin/withdrawals?${Ke}`);if(tt!=null&&tt.success&&tt.withdrawals){const $e=tt.withdrawals.map(me=>({...me,account:me.account??"未绑定微信号",status:me.status==="success"?"completed":me.status==="failed"?"rejected":me.status}));y($e),w((tt==null?void 0:tt.total)??$e.length)}else tt!=null&&tt.success||N(`获取提现记录失败: ${(tt==null?void 0:tt.error)||"未知错误"}`),y([])}catch(We){console.error(We),N("加载提现数据失败"),y([])}break}}se(We=>new Set(We).add(F))}catch(Ve){console.error(Ve)}finally{P(!1)}}}async function H(){N(null),se(F=>{const xe=new Set(F);return xe.delete(r),xe}),r==="overview"&&L(),await re(r,!0)}async function A(F){if(confirm("确认审核通过并打款?"))try{const xe=await vt("/api/admin/withdrawals",{id:F,action:"approve"});if(!(xe!=null&&xe.success)){const ke=(xe==null?void 0:xe.message)||(xe==null?void 0:xe.error)||"操作失败";alert(ke);return}await H()}catch(xe){console.error(xe),alert("操作失败")}}async function z(F){const xe=prompt("请输入拒绝原因:");if(xe)try{const ke=await vt("/api/admin/withdrawals",{id:F,action:"reject",errorMessage:xe});if(!(ke!=null&&ke.success)){alert((ke==null?void 0:ke.error)||"操作失败");return}await H()}catch(ke){console.error(ke),alert("操作失败")}}async function O(){var F;if(!(!(ie!=null&&ie.orderSn)&&!(ie!=null&&ie.id))){ue(!0),N(null);try{const xe=await vt("/api/admin/orders/refund",{orderSn:ie.orderSn||ie.id,reason:ne||void 0});xe!=null&&xe.success?(Y(null),_(""),await re("orders",!0)):N((xe==null?void 0:xe.error)||"退款失败")}catch(xe){const ke=xe;N(((F=ke==null?void 0:ke.data)==null?void 0:F.error)||"退款失败,请检查网络后重试")}finally{ue(!1)}}}function ee(F){const xe={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(Le,{className:`${xe[F]||"bg-gray-500/20 text-gray-400"} border-0`,children:ke[F]||F})}const K=Math.ceil(I/X)||1,de=l,q=m.filter(F=>{var ke,Ve,We,Ke;if(!j)return!0;const xe=j.toLowerCase();return((ke=F.refereeNickname)==null?void 0:ke.toLowerCase().includes(xe))||((Ve=F.refereePhone)==null?void 0:Ve.includes(xe))||((We=F.referrerName)==null?void 0:We.toLowerCase().includes(xe))||((Ke=F.referrerCode)==null?void 0:Ke.toLowerCase().includes(xe))}),ye=p.filter(F=>{var ke;if(!j)return!0;const xe=j.toLowerCase();return((ke=F.userName)==null?void 0:ke.toLowerCase().includes(xe))||F.account&&F.account.toLowerCase().includes(xe)});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:()=>N(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(J,{onClick:H,disabled:k,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${k?"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:Ra},{key:"orders",label:"订单管理",icon:co},{key:"bindings",label:"绑定管理",icon:Pr},{key:"withdrawals",label:"提现审核",icon:Aa},{key:"settings",label:"推广设置",icon:Un}].map(F=>e.jsxs("button",{type:"button",onClick:()=>{a(F.key),b("all"),C("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===F.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[e.jsx(F.icon,{className:"w-4 h-4"}),F.label]},F.key))}),k?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx(Be,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"总点击次数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(Er,{className:"w-6 h-6 text-blue-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日独立用户"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayUniqueVisitors??0}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"去重访客数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-cyan-500/20 flex items-center justify-center",children:e.jsx(Kt,{className:"w-6 h-6 text-cyan-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日总文章点击率"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:(c.todayClickRate??0).toFixed(2)}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"人均点击(总点击/独立用户)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-amber-500/20 flex items-center justify-center",children:e.jsx(Ra,{className:"w-6 h-6 text-amber-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:e.jsx(Pr,{className:"w-6 h-6 text-green-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:e.jsx(zf,{className:"w-6 h-6 text-purple-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),e.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:e.jsx(co,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),(((Se=c.todayClicksByPage)==null?void 0:Se.length)??0)>0&&e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Er,{className:"w-5 h-5 text-[#38bdac]"}),"每篇文章今日点击(按来源页/文章统计)"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"实际用户与实际文章的点击均计入;今日总点击与上表一致"})]}),e.jsx(we,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"pb-3 pr-4",children:"来源页/文章"}),e.jsx("th",{className:"pb-3 pr-4 text-right",children:"今日点击"}),e.jsx("th",{className:"pb-3 text-right",children:"占比"})]})}),e.jsx("tbody",{children:[...c.todayClicksByPage??[]].sort((F,xe)=>xe.clicks-F.clicks).map((F,xe)=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-4 text-white font-mono",children:F.page||"(未区分)"}),e.jsx("td",{className:"py-2 pr-4 text-right text-white",children:F.clicks}),e.jsxs("td",{className:"py-2 text-right text-gray-400",children:[c.todayClicks>0?(F.clicks/c.todayClicks*100).toFixed(1):0,"%"]})]},xe))})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Ne,{className:"bg-orange-500/10 border-orange-500/30",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:e.jsx(Qd,{className:"w-6 h-6 text-orange-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),e.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),e.jsx(Ne,{className:"bg-blue-500/10 border-blue-500/30",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(Aa,{className:"w-6 h-6 text-blue-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),e.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),e.jsx(J,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(oo,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),e.jsx(we,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Ra,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),e.jsxs(we,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),e.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-300",children:"点击转化率"}),e.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ye,{children:e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),e.jsx(we,{children:e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),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(cn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(oe,{value:j,onChange:F=>C(F.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:F=>b(F.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[l.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:de.map(F=>{var xe,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:[(xe=F.id)==null?void 0:xe.slice(0,12),"..."]}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:F.userNickname}),e.jsx("p",{className:"text-gray-500 text-xs",children:F.userPhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:(()=>{const Ve=F.productType||F.type;return Ve==="fullbook"?`${F.bookName||"《底层逻辑》"} - 全本`:Ve==="match"?"匹配次数购买":`${F.bookName||"《底层逻辑》"} - ${F.sectionTitle||F.chapterTitle||`章节${F.productId||F.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const Ve=F.productType||F.type;return Ve==="fullbook"?"全书解锁":Ve==="match"?"功能权益":F.chapterTitle||"单章购买"})()})]})}),e.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof F.amount=="number"?F.amount.toFixed(2):parseFloat(String(F.amount||"0")).toFixed(2)]}),e.jsx("td",{className:"p-4 text-gray-300",children:F.paymentMethod==="wechat"?"微信支付":F.paymentMethod==="alipay"?"支付宝":F.paymentMethod||"微信支付"}),e.jsx("td",{className:"p-4",children:F.status==="refunded"?e.jsx(Le,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):F.status==="completed"||F.status==="paid"?e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):F.status==="pending"||F.status==="created"?e.jsx(Le,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):e.jsx(Le,{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:F.refundReason,children:F.status==="refunded"&&F.refundReason?F.refundReason:"-"}),e.jsx("td",{className:"p-4 text-gray-300 text-sm",children:F.referrerId||F.referralCode?e.jsxs("span",{title:F.referralCode||F.referrerCode||F.referrerId||"",children:[F.referrerNickname||F.referralCode||F.referrerCode||((ke=F.referrerId)==null?void 0:ke.slice(0,8)),(F.referralCode||F.referrerCode)&&` (${F.referralCode||F.referrerCode})`]}):"-"}),e.jsx("td",{className:"p-4 text-[#FFD700]",children:F.referrerEarnings?`¥${(typeof F.referrerEarnings=="number"?F.referrerEarnings:parseFloat(String(F.referrerEarnings))).toFixed(2)}`:"-"}),e.jsx("td",{className:"p-4 text-gray-400 text-sm",children:F.createdAt?new Date(F.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:(F.status==="paid"||F.status==="completed")&&e.jsxs(J,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{Y(F),_("")},children:[e.jsx(Zx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},F.id)})})]})}),r==="orders"&&e.jsx(Qs,{page:R,totalPages:K,total:I,pageSize:X,onPageChange:G,onPageSizeChange:F=>{D(F),G(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(cn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(oe,{value:j,onChange:F=>C(F.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:F=>b(F.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"active",children:"有效"}),e.jsx("option",{value:"converted",children:"已转化"}),e.jsx("option",{value:"expired",children:"已过期"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[q.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:q.map(F=>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:F.refereeNickname||"匿名用户"}),e.jsx("p",{className:"text-gray-500 text-xs",children:F.refereePhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white",children:F.referrerName||"-"}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:F.referrerCode})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:F.boundAt?new Date(F.boundAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:F.expiresAt?new Date(F.expiresAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:ee(F.status)}),e.jsx("td",{className:"p-4",children:F.commission?e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",F.commission.toFixed(2)]}):e.jsx("span",{className:"text-gray-500",children:"-"})})]},F.id))})]})}),r==="bindings"&&e.jsx(Qs,{page:R,totalPages:K,total:I,pageSize:X,onPageChange:G,onPageSizeChange:F=>{D(F),G(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(cn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(oe,{value:j,onChange:F=>C(F.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:F=>b(F.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"pending",children:"待审核"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[ye.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:ye.map(F=>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:[F.userAvatar?e.jsx("img",{src:F.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:(F.userName||F.name||"?").slice(0,1)}),e.jsx("p",{className:"text-white font-medium",children:F.userName||F.name})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",F.amount.toFixed(2)]})}),e.jsx("td",{className:"p-4",children:e.jsx(Le,{className:F.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:F.method==="wechat"?"微信":"支付宝"})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-mono text-xs",children:F.account}),e.jsx("p",{className:"text-gray-500 text-xs",children:F.name})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:F.createdAt?new Date(F.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:ee(F.status)}),e.jsx("td",{className:"p-4 text-right",children:F.status==="pending"&&e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsxs(J,{size:"sm",onClick:()=>A(F.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zf,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(J,{size:"sm",variant:"outline",onClick:()=>z(F.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx(Yx,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},F.id))})]})}),r==="withdrawals"&&e.jsx(Qs,{page:R,totalPages:K,total:I,pageSize:X,onPageChange:G,onPageSizeChange:F=>{D(F),G(1)}})]})})]})]}),e.jsx(Ct,{open:!!ie,onOpenChange:F=>!F&&Y(null),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(kt,{children:e.jsx(Et,{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(oe,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:ne,onChange:F=>_(F.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>Y(null),disabled:Q,children:"取消"}),e.jsx(J,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:O,disabled:Q,children:Q?"退款中...":"确认退款"})]})]})}),r==="settings"&&e.jsx("div",{className:"-mx-8 -mt-6",children:e.jsx(D0,{embedded:!0})})]})}function c4(){const[r,a]=h.useState([]),[l,i]=h.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=h.useState(!0),[m,f]=h.useState(null),[p,y]=h.useState("all"),[g,v]=h.useState(1),[k,P]=h.useState(10),[T,N]=h.useState(0),[j,C]=h.useState(null);async function E(){var D,I,w,V,se,ie,Y;d(!0),f(null);try{const ne=new URLSearchParams({status:p,page:String(g),pageSize:String(k)}),_=await Oe(`/api/admin/withdrawals?${ne}`);if(_!=null&&_.success){const Q=_.withdrawals||[];a(Q),N(_.total??((D=_.stats)==null?void 0:D.total)??Q.length),i({total:((I=_.stats)==null?void 0:I.total)??_.total??Q.length,pendingCount:((w=_.stats)==null?void 0:w.pendingCount)??0,pendingAmount:((V=_.stats)==null?void 0:V.pendingAmount)??0,successCount:((se=_.stats)==null?void 0:se.successCount)??0,successAmount:((ie=_.stats)==null?void 0:ie.successAmount)??0,failedCount:((Y=_.stats)==null?void 0:Y.failedCount)??0})}else f("加载提现记录失败")}catch(ne){console.error("Load withdrawals error:",ne),f("加载失败,请检查网络后重试")}finally{d(!1)}}h.useEffect(()=>{v(1)},[p]),h.useEffect(()=>{E()},[p,g,k]);const b=Math.ceil(T/k)||1;async function R(D){const I=r.find(w=>w.id===D);if(I!=null&&I.userCommissionInfo&&I.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${I.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 - -确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;C(D);try{const w=await vt("/api/admin/withdrawals",{id:D,action:"approve"});w!=null&&w.success?E():alert("操作失败: "+((w==null?void 0:w.error)??""))}catch{alert("操作失败")}finally{C(null)}}async function G(D){const I=prompt("请输入拒绝原因(将返还用户余额):");if(I){C(D);try{const w=await vt("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:I});w!=null&&w.success?E():alert("操作失败: "+((w==null?void 0:w.error)??""))}catch{alert("操作失败")}finally{C(null)}}}function X(D){switch(D){case"pending":return e.jsx(Le,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return e.jsx(Le,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return e.jsx(Le,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return e.jsx(Le,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return e.jsx(Le,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return e.jsx(Le,{className:"bg-gray-500/20 text-gray-400 border-0",children:D})}}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(J,{variant:"outline",onClick:E,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),e.jsx(Ne,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:e.jsx(we,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(co,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),e.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",e.jsx("span",{className:"text-white font-medium",children:"90%"})]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),e.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),e.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),e.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),e.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(D=>e.jsx(J,{variant:p===D?"default":"outline",size:"sm",onClick:()=>y(D),className:p===D?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:D==="all"?"全部":D==="pending"?"待处理":D==="success"?"已完成":"已拒绝"},D))}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:c?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{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(Aa,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"确认收款"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4 text-gray-400",children:new Date(D.createdAt??"").toLocaleString()}),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:D.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:(D.userName??"?").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-white",children:D.userName??"未知"}),e.jsx("p",{className:"text-xs text-gray-500",children:D.userPhone??D.referralCode??(D.userId??"").slice(0,10)})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(D.amount).toFixed(2)]})}),e.jsx("td",{className:"p-4",children:D.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:["¥",D.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:["¥",D.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:["¥",D.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:D.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",D.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):e.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),e.jsxs("td",{className:"p-4",children:[X(D.status),D.errorMessage&&e.jsx("p",{className:"text-xs text-red-400 mt-1",children:D.errorMessage})]}),e.jsx("td",{className:"p-4 text-gray-400",children:D.processedAt?new Date(D.processedAt).toLocaleString():"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:D.userConfirmedAt?e.jsxs("span",{className:"text-green-400",title:D.userConfirmedAt,children:["已确认 ",new Date(D.userConfirmedAt).toLocaleString()]}):"-"}),e.jsxs("td",{className:"p-4 text-right",children:[(D.status==="pending"||D.status==="pending_confirm")&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(J,{size:"sm",onClick:()=>R(D.id),disabled:j===D.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(wo,{className:"w-4 h-4 mr-1"}),"批准"]}),e.jsxs(J,{size:"sm",variant:"outline",onClick:()=>G(D.id),disabled:j===D.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(D.status==="success"||D.status==="completed")&&D.transactionId&&e.jsx("span",{className:"text-xs text-gray-500 font-mono",children:D.transactionId})]})]},D.id))})]})}),e.jsx(Qs,{page:g,totalPages:b,total:T,pageSize:k,onPageChange:v,onPageSizeChange:D=>{P(D),v(1)}})]})})})]})}const d4=["top","right","bottom","left"],fn=Math.min,ws=Math.max,po=Math.round,ro=Math.floor,cr=r=>({x:r,y:r}),u4={left:"right",right:"left",bottom:"top",top:"bottom"},h4={start:"end",end:"start"};function lu(r,a,l){return ws(r,fn(a,l))}function Rr(r,a){return typeof r=="function"?r(a):r}function Ir(r){return r.split("-")[0]}function Va(r){return r.split("-")[1]}function Fu(r){return r==="x"?"y":"x"}function zu(r){return r==="y"?"height":"width"}const m4=new Set(["top","bottom"]);function or(r){return m4.has(Ir(r))?"y":"x"}function $u(r){return Fu(or(r))}function f4(r,a,l){l===void 0&&(l=!1);const i=Va(r),c=$u(r),d=zu(c);let m=c==="x"?i===(l?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(m=go(m)),[m,go(m)]}function x4(r){const a=go(r);return[iu(r),a,iu(a)]}function iu(r){return r.replace(/start|end/g,a=>h4[a])}const dx=["left","right"],ux=["right","left"],p4=["top","bottom"],g4=["bottom","top"];function y4(r,a,l){switch(r){case"top":case"bottom":return l?a?ux:dx:a?dx:ux;case"left":case"right":return a?p4:g4;default:return[]}}function v4(r,a,l,i){const c=Va(r);let d=y4(Ir(r),l==="start",i);return c&&(d=d.map(m=>m+"-"+c),a&&(d=d.concat(d.map(iu)))),d}function go(r){return r.replace(/left|right|bottom|top/g,a=>u4[a])}function b4(r){return{top:0,right:0,bottom:0,left:0,...r}}function L0(r){return typeof r!="number"?b4(r):{top:r,right:r,bottom:r,left:r}}function yo(r){const{x:a,y:l,width:i,height:c}=r;return{width:i,height:c,top:l,left:a,right:a+i,bottom:l+c,x:a,y:l}}function hx(r,a,l){let{reference:i,floating:c}=r;const d=or(a),m=$u(a),f=zu(m),p=Ir(a),y=d==="y",g=i.x+i.width/2-c.width/2,v=i.y+i.height/2-c.height/2,k=i[f]/2-c[f]/2;let P;switch(p){case"top":P={x:g,y:i.y-c.height};break;case"bottom":P={x:g,y:i.y+i.height};break;case"right":P={x:i.x+i.width,y:v};break;case"left":P={x:i.x-c.width,y:v};break;default:P={x:i.x,y:i.y}}switch(Va(a)){case"start":P[m]-=k*(l&&y?-1:1);break;case"end":P[m]+=k*(l&&y?-1:1);break}return P}async function j4(r,a){var l;a===void 0&&(a={});const{x:i,y:c,platform:d,rects:m,elements:f,strategy:p}=r,{boundary:y="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:k=!1,padding:P=0}=Rr(a,r),T=L0(P),j=f[k?v==="floating"?"reference":"floating":v],C=yo(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(j)))==null||l?j:j.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(f.floating)),boundary:y,rootBoundary:g,strategy:p})),E=v==="floating"?{x:i,y:c,width:m.floating.width,height:m.floating.height}:m.reference,b=await(d.getOffsetParent==null?void 0:d.getOffsetParent(f.floating)),R=await(d.isElement==null?void 0:d.isElement(b))?await(d.getScale==null?void 0:d.getScale(b))||{x:1,y:1}:{x:1,y:1},G=yo(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:E,offsetParent:b,strategy:p}):E);return{top:(C.top-G.top+T.top)/R.y,bottom:(G.bottom-C.bottom+T.bottom)/R.y,left:(C.left-G.left+T.left)/R.x,right:(G.right-C.right+T.right)/R.x}}const N4=async(r,a,l)=>{const{placement:i="bottom",strategy:c="absolute",middleware:d=[],platform:m}=l,f=d.filter(Boolean),p=await(m.isRTL==null?void 0:m.isRTL(a));let y=await m.getElementRects({reference:r,floating:a,strategy:c}),{x:g,y:v}=hx(y,i,p),k=i,P={},T=0;for(let j=0;j({name:"arrow",options:r,async fn(a){const{x:l,y:i,placement:c,rects:d,platform:m,elements:f,middlewareData:p}=a,{element:y,padding:g=0}=Rr(r,a)||{};if(y==null)return{};const v=L0(g),k={x:l,y:i},P=$u(c),T=zu(P),N=await m.getDimensions(y),j=P==="y",C=j?"top":"left",E=j?"bottom":"right",b=j?"clientHeight":"clientWidth",R=d.reference[T]+d.reference[P]-k[P]-d.floating[T],G=k[P]-d.reference[P],X=await(m.getOffsetParent==null?void 0:m.getOffsetParent(y));let D=X?X[b]:0;(!D||!await(m.isElement==null?void 0:m.isElement(X)))&&(D=f.floating[b]||d.floating[T]);const I=R/2-G/2,w=D/2-N[T]/2-1,V=fn(v[C],w),se=fn(v[E],w),ie=V,Y=D-N[T]-se,ne=D/2-N[T]/2+I,_=lu(ie,ne,Y),Q=!p.arrow&&Va(c)!=null&&ne!==_&&d.reference[T]/2-(nene<=0)){var se,ie;const ne=(((se=d.flip)==null?void 0:se.index)||0)+1,_=D[ne];if(_&&(!(v==="alignment"?E!==or(_):!1)||V.every(L=>or(L.placement)===E?L.overflows[0]>0:!0)))return{data:{index:ne,overflows:V},reset:{placement:_}};let Q=(ie=V.filter(ue=>ue.overflows[0]<=0).sort((ue,L)=>ue.overflows[1]-L.overflows[1])[0])==null?void 0:ie.placement;if(!Q)switch(P){case"bestFit":{var Y;const ue=(Y=V.filter(L=>{if(X){const re=or(L.placement);return re===E||re==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(re=>re>0).reduce((re,H)=>re+H,0)]).sort((L,re)=>L[1]-re[1])[0])==null?void 0:Y[0];ue&&(Q=ue);break}case"initialPlacement":Q=f;break}if(c!==Q)return{reset:{placement:Q}}}return{}}}};function mx(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function fx(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:i}=a,{strategy:c="referenceHidden",...d}=Rr(r,a);switch(c){case"referenceHidden":{const m=await i.detectOverflow(a,{...d,elementContext:"reference"}),f=mx(m,l.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:fx(f)}}}case"escaped":{const m=await i.detectOverflow(a,{...d,altBoundary:!0}),f=mx(m,l.floating);return{data:{escapedOffsets:f,escaped:fx(f)}}}default:return{}}}}},O0=new Set(["left","top"]);async function k4(r,a){const{placement:l,platform:i,elements:c}=r,d=await(i.isRTL==null?void 0:i.isRTL(c.floating)),m=Ir(l),f=Va(l),p=or(l)==="y",y=O0.has(m)?-1:1,g=d&&p?-1:1,v=Rr(a,r);let{mainAxis:k,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),p?{x:P*g,y:k*y}:{x:k*y,y:P*g}}const E4=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,i;const{x:c,y:d,placement:m,middlewareData:f}=a,p=await k4(a,r);return m===((l=f.offset)==null?void 0:l.placement)&&(i=f.arrow)!=null&&i.alignmentOffset?{}:{x:c+p.x,y:d+p.y,data:{...p,placement:m}}}}},P4=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:i,placement:c,platform:d}=a,{mainAxis:m=!0,crossAxis:f=!1,limiter:p={fn:C=>{let{x:E,y:b}=C;return{x:E,y:b}}},...y}=Rr(r,a),g={x:l,y:i},v=await d.detectOverflow(a,y),k=or(Ir(c)),P=Fu(k);let T=g[P],N=g[k];if(m){const C=P==="y"?"top":"left",E=P==="y"?"bottom":"right",b=T+v[C],R=T-v[E];T=lu(b,T,R)}if(f){const C=k==="y"?"top":"left",E=k==="y"?"bottom":"right",b=N+v[C],R=N-v[E];N=lu(b,N,R)}const j=p.fn({...a,[P]:T,[k]:N});return{...j,data:{x:j.x-l,y:j.y-i,enabled:{[P]:m,[k]:f}}}}}},T4=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:i,placement:c,rects:d,middlewareData:m}=a,{offset:f=0,mainAxis:p=!0,crossAxis:y=!0}=Rr(r,a),g={x:l,y:i},v=or(c),k=Fu(v);let P=g[k],T=g[v];const N=Rr(f,a),j=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:0,crossAxis:0,...N};if(p){const b=k==="y"?"height":"width",R=d.reference[k]-d.floating[b]+j.mainAxis,G=d.reference[k]+d.reference[b]-j.mainAxis;PG&&(P=G)}if(y){var C,E;const b=k==="y"?"width":"height",R=O0.has(Ir(c)),G=d.reference[v]-d.floating[b]+(R&&((C=m.offset)==null?void 0:C[v])||0)+(R?0:j.crossAxis),X=d.reference[v]+d.reference[b]+(R?0:((E=m.offset)==null?void 0:E[v])||0)-(R?j.crossAxis:0);TX&&(T=X)}return{[k]:P,[v]:T}}}},R4=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,i;const{placement:c,rects:d,platform:m,elements:f}=a,{apply:p=()=>{},...y}=Rr(r,a),g=await m.detectOverflow(a,y),v=Ir(c),k=Va(c),P=or(c)==="y",{width:T,height:N}=d.floating;let j,C;v==="top"||v==="bottom"?(j=v,C=k===(await(m.isRTL==null?void 0:m.isRTL(f.floating))?"start":"end")?"left":"right"):(C=v,j=k==="end"?"top":"bottom");const E=N-g.top-g.bottom,b=T-g.left-g.right,R=fn(N-g[j],E),G=fn(T-g[C],b),X=!a.middlewareData.shift;let D=R,I=G;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(I=b),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(D=E),X&&!k){const V=ws(g.left,0),se=ws(g.right,0),ie=ws(g.top,0),Y=ws(g.bottom,0);P?I=T-2*(V!==0||se!==0?V+se:ws(g.left,g.right)):D=N-2*(ie!==0||Y!==0?ie+Y:ws(g.top,g.bottom))}await p({...a,availableWidth:I,availableHeight:D});const w=await m.getDimensions(f.floating);return T!==w.width||N!==w.height?{reset:{rects:!0}}:{}}}};function Io(){return typeof window<"u"}function Wa(r){return F0(r)?(r.nodeName||"").toLowerCase():"#document"}function Ss(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function ur(r){var a;return(a=(F0(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function F0(r){return Io()?r instanceof Node||r instanceof Ss(r).Node:!1}function Xs(r){return Io()?r instanceof Element||r instanceof Ss(r).Element:!1}function dr(r){return Io()?r instanceof HTMLElement||r instanceof Ss(r).HTMLElement:!1}function xx(r){return!Io()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Ss(r).ShadowRoot}const I4=new Set(["inline","contents"]);function Bl(r){const{overflow:a,overflowX:l,overflowY:i,display:c}=Js(r);return/auto|scroll|overlay|hidden|clip/.test(a+i+l)&&!I4.has(c)}const _4=new Set(["table","td","th"]);function M4(r){return _4.has(Wa(r))}const A4=[":popover-open",":modal"];function _o(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 Bu(r){const a=Uu(),l=Xs(r)?Js(r):r;return D4.some(i=>l[i]?l[i]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||L4.some(i=>(l.willChange||"").includes(i))||O4.some(i=>(l.contain||"").includes(i))}function F4(r){let a=xn(r);for(;dr(a)&&!La(a);){if(Bu(a))return a;if(_o(a))return null;a=xn(a)}return null}function Uu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const z4=new Set(["html","body","#document"]);function La(r){return z4.has(Wa(r))}function Js(r){return Ss(r).getComputedStyle(r)}function Mo(r){return Xs(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function xn(r){if(Wa(r)==="html")return r;const a=r.assignedSlot||r.parentNode||xx(r)&&r.host||ur(r);return xx(a)?a.host:a}function z0(r){const a=xn(r);return La(a)?r.ownerDocument?r.ownerDocument.body:r.body:dr(a)&&Bl(a)?a:z0(a)}function Ll(r,a,l){var i;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=z0(r),d=c===((i=r.ownerDocument)==null?void 0:i.body),m=Ss(c);if(d){const f=ou(m);return a.concat(m,m.visualViewport||[],Bl(c)?c:[],f&&l?Ll(f):[])}return a.concat(c,Ll(c,[],l))}function ou(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function $0(r){const a=Js(r);let l=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const c=dr(r),d=c?r.offsetWidth:l,m=c?r.offsetHeight:i,f=po(l)!==d||po(i)!==m;return f&&(l=d,i=m),{width:l,height:i,$:f}}function Vu(r){return Xs(r)?r:r.contextElement}function Ma(r){const a=Vu(r);if(!dr(a))return cr(1);const l=a.getBoundingClientRect(),{width:i,height:c,$:d}=$0(a);let m=(d?po(l.width):l.width)/i,f=(d?po(l.height):l.height)/c;return(!m||!Number.isFinite(m))&&(m=1),(!f||!Number.isFinite(f))&&(f=1),{x:m,y:f}}const $4=cr(0);function B0(r){const a=Ss(r);return!Uu()||!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 Hn(r,a,l,i){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),d=Vu(r);let m=cr(1);a&&(i?Xs(i)&&(m=Ma(i)):m=Ma(r));const f=B4(d,l,i)?B0(d):cr(0);let p=(c.left+f.x)/m.x,y=(c.top+f.y)/m.y,g=c.width/m.x,v=c.height/m.y;if(d){const k=Ss(d),P=i&&Xs(i)?Ss(i):i;let T=k,N=ou(T);for(;N&&i&&P!==T;){const j=Ma(N),C=N.getBoundingClientRect(),E=Js(N),b=C.left+(N.clientLeft+parseFloat(E.paddingLeft))*j.x,R=C.top+(N.clientTop+parseFloat(E.paddingTop))*j.y;p*=j.x,y*=j.y,g*=j.x,v*=j.y,p+=b,y+=R,T=Ss(N),N=ou(T)}}return yo({width:g,height:v,x:p,y})}function Ao(r,a){const l=Mo(r).scrollLeft;return a?a.left+l:Hn(ur(r)).left+l}function U0(r,a){const l=r.getBoundingClientRect(),i=l.left+a.scrollLeft-Ao(r,l),c=l.top+a.scrollTop;return{x:i,y:c}}function U4(r){let{elements:a,rect:l,offsetParent:i,strategy:c}=r;const d=c==="fixed",m=ur(i),f=a?_o(a.floating):!1;if(i===m||f&&d)return l;let p={scrollLeft:0,scrollTop:0},y=cr(1);const g=cr(0),v=dr(i);if((v||!v&&!d)&&((Wa(i)!=="body"||Bl(m))&&(p=Mo(i)),dr(i))){const P=Hn(i);y=Ma(i),g.x=P.x+i.clientLeft,g.y=P.y+i.clientTop}const k=m&&!v&&!d?U0(m,p):cr(0);return{width:l.width*y.x,height:l.height*y.y,x:l.x*y.x-p.scrollLeft*y.x+g.x+k.x,y:l.y*y.y-p.scrollTop*y.y+g.y+k.y}}function V4(r){return Array.from(r.getClientRects())}function W4(r){const a=ur(r),l=Mo(r),i=r.ownerDocument.body,c=ws(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),d=ws(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let m=-l.scrollLeft+Ao(r);const f=-l.scrollTop;return Js(i).direction==="rtl"&&(m+=ws(a.clientWidth,i.clientWidth)-c),{width:c,height:d,x:m,y:f}}const px=25;function H4(r,a){const l=Ss(r),i=ur(r),c=l.visualViewport;let d=i.clientWidth,m=i.clientHeight,f=0,p=0;if(c){d=c.width,m=c.height;const g=Uu();(!g||g&&a==="fixed")&&(f=c.offsetLeft,p=c.offsetTop)}const y=Ao(i);if(y<=0){const g=i.ownerDocument,v=g.body,k=getComputedStyle(v),P=g.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,T=Math.abs(i.clientWidth-v.clientWidth-P);T<=px&&(d-=T)}else y<=px&&(d+=y);return{width:d,height:m,x:f,y:p}}const K4=new Set(["absolute","fixed"]);function G4(r,a){const l=Hn(r,!0,a==="fixed"),i=l.top+r.clientTop,c=l.left+r.clientLeft,d=dr(r)?Ma(r):cr(1),m=r.clientWidth*d.x,f=r.clientHeight*d.y,p=c*d.x,y=i*d.y;return{width:m,height:f,x:p,y}}function gx(r,a,l){let i;if(a==="viewport")i=H4(r,l);else if(a==="document")i=W4(ur(r));else if(Xs(a))i=G4(a,l);else{const c=B0(r);i={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return yo(i)}function V0(r,a){const l=xn(r);return l===a||!Xs(l)||La(l)?!1:Js(l).position==="fixed"||V0(l,a)}function Y4(r,a){const l=a.get(r);if(l)return l;let i=Ll(r,[],!1).filter(f=>Xs(f)&&Wa(f)!=="body"),c=null;const d=Js(r).position==="fixed";let m=d?xn(r):r;for(;Xs(m)&&!La(m);){const f=Js(m),p=Bu(m);!p&&f.position==="fixed"&&(c=null),(d?!p&&!c:!p&&f.position==="static"&&!!c&&K4.has(c.position)||Bl(m)&&!p&&V0(r,m))?i=i.filter(g=>g!==m):c=f,m=xn(m)}return a.set(r,i),i}function Q4(r){let{element:a,boundary:l,rootBoundary:i,strategy:c}=r;const m=[...l==="clippingAncestors"?_o(a)?[]:Y4(a,this._c):[].concat(l),i],f=m[0],p=m.reduce((y,g)=>{const v=gx(a,g,c);return y.top=ws(v.top,y.top),y.right=fn(v.right,y.right),y.bottom=fn(v.bottom,y.bottom),y.left=ws(v.left,y.left),y},gx(a,f,c));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function q4(r){const{width:a,height:l}=$0(r);return{width:a,height:l}}function X4(r,a,l){const i=dr(a),c=ur(a),d=l==="fixed",m=Hn(r,!0,d,a);let f={scrollLeft:0,scrollTop:0};const p=cr(0);function y(){p.x=Ao(c)}if(i||!i&&!d)if((Wa(a)!=="body"||Bl(c))&&(f=Mo(a)),i){const P=Hn(a,!0,d,a);p.x=P.x+a.clientLeft,p.y=P.y+a.clientTop}else c&&y();d&&!i&&c&&y();const g=c&&!i&&!d?U0(c,f):cr(0),v=m.left+f.scrollLeft-p.x-g.x,k=m.top+f.scrollTop-p.y-g.y;return{x:v,y:k,width:m.width,height:m.height}}function zd(r){return Js(r).position==="static"}function yx(r,a){if(!dr(r)||Js(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return ur(r)===l&&(l=l.ownerDocument.body),l}function W0(r,a){const l=Ss(r);if(_o(r))return l;if(!dr(r)){let c=xn(r);for(;c&&!La(c);){if(Xs(c)&&!zd(c))return c;c=xn(c)}return l}let i=yx(r,a);for(;i&&M4(i)&&zd(i);)i=yx(i,a);return i&&La(i)&&zd(i)&&!Bu(i)?l:i||F4(r)||l}const J4=async function(r){const a=this.getOffsetParent||W0,l=this.getDimensions,i=await l(r.floating);return{reference:X4(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Z4(r){return Js(r).direction==="rtl"}const eS={convertOffsetParentRelativeRectToViewportRelativeRect:U4,getDocumentElement:ur,getClippingRect:Q4,getOffsetParent:W0,getElementRects:J4,getClientRects:V4,getDimensions:q4,getScale:Ma,isElement:Xs,isRTL:Z4};function H0(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,i;const c=ur(r);function d(){var f;clearTimeout(i),(f=l)==null||f.disconnect(),l=null}function m(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),d();const y=r.getBoundingClientRect(),{left:g,top:v,width:k,height:P}=y;if(f||a(),!k||!P)return;const T=ro(v),N=ro(c.clientWidth-(g+k)),j=ro(c.clientHeight-(v+P)),C=ro(g),b={rootMargin:-T+"px "+-N+"px "+-j+"px "+-C+"px",threshold:ws(0,fn(1,p))||1};let R=!0;function G(X){const D=X[0].intersectionRatio;if(D!==p){if(!R)return m();D?m(!1,D):i=setTimeout(()=>{m(!1,1e-7)},1e3)}D===1&&!H0(y,r.getBoundingClientRect())&&m(),R=!1}try{l=new IntersectionObserver(G,{...b,root:c.ownerDocument})}catch{l=new IntersectionObserver(G,b)}l.observe(r)}return m(!0),d}function sS(r,a,l,i){i===void 0&&(i={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:p=!1}=i,y=Vu(r),g=c||d?[...y?Ll(y):[],...Ll(a)]:[];g.forEach(C=>{c&&C.addEventListener("scroll",l,{passive:!0}),d&&C.addEventListener("resize",l)});const v=y&&f?tS(y,l):null;let k=-1,P=null;m&&(P=new ResizeObserver(C=>{let[E]=C;E&&E.target===y&&P&&(P.unobserve(a),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var b;(b=P)==null||b.observe(a)})),l()}),y&&!p&&P.observe(y),P.observe(a));let T,N=p?Hn(r):null;p&&j();function j(){const C=Hn(r);N&&!H0(N,C)&&l(),N=C,T=requestAnimationFrame(j)}return l(),()=>{var C;g.forEach(E=>{c&&E.removeEventListener("scroll",l),d&&E.removeEventListener("resize",l)}),v==null||v(),(C=P)==null||C.disconnect(),P=null,p&&cancelAnimationFrame(T)}}const rS=E4,nS=P4,aS=S4,lS=R4,iS=C4,vx=w4,oS=T4,cS=(r,a,l)=>{const i=new Map,c={platform:eS,...l},d={...c.platform,_c:i};return N4(r,a,{...c,platform:d})};var dS=typeof document<"u",uS=function(){},lo=dS?h.useLayoutEffect:uS;function vo(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,i,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(i=l;i--!==0;)if(!vo(r[i],a[i]))return!1;return!0}if(c=Object.keys(r),l=c.length,l!==Object.keys(a).length)return!1;for(i=l;i--!==0;)if(!{}.hasOwnProperty.call(a,c[i]))return!1;for(i=l;i--!==0;){const d=c[i];if(!(d==="_owner"&&r.$$typeof)&&!vo(r[d],a[d]))return!1}return!0}return r!==r&&a!==a}function K0(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function bx(r,a){const l=K0(r);return Math.round(a*l)/l}function $d(r){const a=h.useRef(r);return lo(()=>{a.current=r}),a}function hS(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:i=[],platform:c,elements:{reference:d,floating:m}={},transform:f=!0,whileElementsMounted:p,open:y}=r,[g,v]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[k,P]=h.useState(i);vo(k,i)||P(i);const[T,N]=h.useState(null),[j,C]=h.useState(null),E=h.useCallback(L=>{L!==X.current&&(X.current=L,N(L))},[]),b=h.useCallback(L=>{L!==D.current&&(D.current=L,C(L))},[]),R=d||T,G=m||j,X=h.useRef(null),D=h.useRef(null),I=h.useRef(g),w=p!=null,V=$d(p),se=$d(c),ie=$d(y),Y=h.useCallback(()=>{if(!X.current||!D.current)return;const L={placement:a,strategy:l,middleware:k};se.current&&(L.platform=se.current),cS(X.current,D.current,L).then(re=>{const H={...re,isPositioned:ie.current!==!1};ne.current&&!vo(I.current,H)&&(I.current=H,Ol.flushSync(()=>{v(H)}))})},[k,a,l,se,ie]);lo(()=>{y===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,v(L=>({...L,isPositioned:!1})))},[y]);const ne=h.useRef(!1);lo(()=>(ne.current=!0,()=>{ne.current=!1}),[]),lo(()=>{if(R&&(X.current=R),G&&(D.current=G),R&&G){if(V.current)return V.current(R,G,Y);Y()}},[R,G,Y,V,w]);const _=h.useMemo(()=>({reference:X,floating:D,setReference:E,setFloating:b}),[E,b]),Q=h.useMemo(()=>({reference:R,floating:G}),[R,G]),ue=h.useMemo(()=>{const L={position:l,left:0,top:0};if(!Q.floating)return L;const re=bx(Q.floating,g.x),H=bx(Q.floating,g.y);return f?{...L,transform:"translate("+re+"px, "+H+"px)",...K0(Q.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:re,top:H}},[l,f,Q.floating,g.x,g.y]);return h.useMemo(()=>({...g,update:Y,refs:_,elements:Q,floatingStyles:ue}),[g,Y,_,Q,ue])}const mS=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:i,padding:c}=typeof r=="function"?r(l):r;return i&&a(i)?i.current!=null?vx({element:i.current,padding:c}).fn(l):{}:i?vx({element:i,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]}),bS=(r,a)=>({...mS(r),options:[r,a]});var jS="Arrow",G0=h.forwardRef((r,a)=>{const{children:l,width:i=10,height:c=5,...d}=r;return e.jsx(Xe.svg,{...d,ref:a,width:i,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});G0.displayName=jS;var NS=G0,Wu="Popper",[Y0,Q0]=vn(Wu),[wS,q0]=Y0(Wu),X0=r=>{const{__scopePopper:a,children:l}=r,[i,c]=h.useState(null);return e.jsx(wS,{scope:a,anchor:i,onAnchorChange:c,children:l})};X0.displayName=Wu;var J0="PopperAnchor",Z0=h.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:i,...c}=r,d=q0(J0,l),m=h.useRef(null),f=at(a,m),p=h.useRef(null);return h.useEffect(()=>{const y=p.current;p.current=(i==null?void 0:i.current)||m.current,y!==p.current&&d.onAnchorChange(p.current)}),i?null:e.jsx(Xe.div,{...c,ref:f})});Z0.displayName=J0;var Hu="PopperContent",[SS,CS]=Y0(Hu),eg=h.forwardRef((r,a)=>{var q,ye,Se,F,xe,ke;const{__scopePopper:l,side:i="bottom",sideOffset:c=0,align:d="center",alignOffset:m=0,arrowPadding:f=0,avoidCollisions:p=!0,collisionBoundary:y=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:k=!1,updatePositionStrategy:P="optimized",onPlaced:T,...N}=r,j=q0(Hu,l),[C,E]=h.useState(null),b=at(a,Ve=>E(Ve)),[R,G]=h.useState(null),X=Lu(R),D=(X==null?void 0:X.width)??0,I=(X==null?void 0:X.height)??0,w=i+(d!=="center"?"-"+d:""),V=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},se=Array.isArray(y)?y:[y],ie=se.length>0,Y={padding:V,boundary:se.filter(ES),altBoundary:ie},{refs:ne,floatingStyles:_,placement:Q,isPositioned:ue,middlewareData:L}=hS({strategy:"fixed",placement:w,whileElementsMounted:(...Ve)=>sS(...Ve,{animationFrame:P==="always"}),elements:{reference:j.anchor},middleware:[fS({mainAxis:c+I,alignmentAxis:m}),p&&xS({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?pS():void 0,...Y}),p&&gS({...Y}),yS({...Y,apply:({elements:Ve,rects:We,availableWidth:Ke,availableHeight:tt})=>{const{width:$e,height:me}=We.reference,pe=Ve.floating.style;pe.setProperty("--radix-popper-available-width",`${Ke}px`),pe.setProperty("--radix-popper-available-height",`${tt}px`),pe.setProperty("--radix-popper-anchor-width",`${$e}px`),pe.setProperty("--radix-popper-anchor-height",`${me}px`)}}),R&&bS({element:R,padding:f}),PS({arrowWidth:D,arrowHeight:I}),k&&vS({strategy:"referenceHidden",...Y})]}),[re,H]=rg(Q),A=mn(T);Zt(()=>{ue&&(A==null||A())},[ue,A]);const z=(q=L.arrow)==null?void 0:q.x,O=(ye=L.arrow)==null?void 0:ye.y,ee=((Se=L.arrow)==null?void 0:Se.centerOffset)!==0,[K,de]=h.useState();return Zt(()=>{C&&de(window.getComputedStyle(C).zIndex)},[C]),e.jsx("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:ue?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(F=L.transformOrigin)==null?void 0:F.x,(xe=L.transformOrigin)==null?void 0:xe.y].join(" "),...((ke=L.hide)==null?void 0:ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:e.jsx(SS,{scope:l,placedSide:re,onArrowChange:G,arrowX:z,arrowY:O,shouldHideArrow:ee,children:e.jsx(Xe.div,{"data-side":re,"data-align":H,...N,ref:b,style:{...N.style,animation:ue?void 0:"none"}})})})});eg.displayName=Hu;var tg="PopperArrow",kS={top:"bottom",right:"left",bottom:"top",left:"right"},sg=h.forwardRef(function(a,l){const{__scopePopper:i,...c}=a,d=CS(tg,i),m=kS[d.placedSide];return e.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:e.jsx(NS,{...c,ref:l,style:{...c.style,display:"block"}})})});sg.displayName=tg;function ES(r){return r!==null}var PS=r=>({name:"transformOrigin",options:r,fn(a){var j,C,E;const{placement:l,rects:i,middlewareData:c}=a,m=((j=c.arrow)==null?void 0:j.centerOffset)!==0,f=m?0:r.arrowWidth,p=m?0:r.arrowHeight,[y,g]=rg(l),v={start:"0%",center:"50%",end:"100%"}[g],k=(((C=c.arrow)==null?void 0:C.x)??0)+f/2,P=(((E=c.arrow)==null?void 0:E.y)??0)+p/2;let T="",N="";return y==="bottom"?(T=m?v:`${k}px`,N=`${-p}px`):y==="top"?(T=m?v:`${k}px`,N=`${i.floating.height+p}px`):y==="right"?(T=`${-p}px`,N=m?v:`${P}px`):y==="left"&&(T=`${i.floating.width+p}px`,N=m?v:`${P}px`),{data:{x:T,y:N}}}});function rg(r){const[a,l="center"]=r.split("-");return[a,l]}var TS=X0,RS=Z0,IS=eg,_S=sg,ng=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(Xe.span,{...r,ref:a,style:{...ng,...r.style}}));AS.displayName=MS;var DS=[" ","Enter","ArrowUp","ArrowDown"],LS=[" ","Enter"],Kn="Select",[Do,Lo,OS]=Mu(Kn),[Ha]=vn(Kn,[OS,Q0]),Oo=Q0(),[FS,bn]=Ha(Kn),[zS,$S]=Ha(Kn),ag=r=>{const{__scopeSelect:a,children:l,open:i,defaultOpen:c,onOpenChange:d,value:m,defaultValue:f,onValueChange:p,dir:y,name:g,autoComplete:v,disabled:k,required:P,form:T}=r,N=Oo(a),[j,C]=h.useState(null),[E,b]=h.useState(null),[R,G]=h.useState(!1),X=Eo(y),[D,I]=Vn({prop:i,defaultProp:c??!1,onChange:d,caller:Kn}),[w,V]=Vn({prop:m,defaultProp:f,onChange:p,caller:Kn}),se=h.useRef(null),ie=j?T||!!j.closest("form"):!0,[Y,ne]=h.useState(new Set),_=Array.from(Y).map(Q=>Q.props.value).join(";");return e.jsx(TS,{...N,children:e.jsxs(FS,{required:P,scope:a,trigger:j,onTriggerChange:C,valueNode:E,onValueNodeChange:b,valueNodeHasChildren:R,onValueNodeHasChildrenChange:G,contentId:dn(),value:w,onValueChange:V,open:D,onOpenChange:I,dir:X,triggerPointerDownPosRef:se,disabled:k,children:[e.jsx(Do.Provider,{scope:a,children:e.jsx(zS,{scope:r.__scopeSelect,onNativeOptionAdd:h.useCallback(Q=>{ne(ue=>new Set(ue).add(Q))},[]),onNativeOptionRemove:h.useCallback(Q=>{ne(ue=>{const L=new Set(ue);return L.delete(Q),L})},[]),children:l})}),ie?e.jsxs(Eg,{"aria-hidden":!0,required:P,tabIndex:-1,name:g,autoComplete:v,value:w,onChange:Q=>V(Q.target.value),disabled:k,form:T,children:[w===void 0?e.jsx("option",{value:""}):null,Array.from(Y)]},_):null]})})};ag.displayName=Kn;var lg="SelectTrigger",ig=h.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:i=!1,...c}=r,d=Oo(l),m=bn(lg,l),f=m.disabled||i,p=at(a,m.onTriggerChange),y=Lo(l),g=h.useRef("touch"),[v,k,P]=Tg(N=>{const j=y().filter(b=>!b.disabled),C=j.find(b=>b.value===m.value),E=Rg(j,N,C);E!==void 0&&m.onValueChange(E.value)}),T=N=>{f||(m.onOpenChange(!0),P()),N&&(m.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})};return e.jsx(RS,{asChild:!0,...d,children:e.jsx(Xe.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":Pg(m.value)?"":void 0,...c,ref:p,onClick:Ge(c.onClick,N=>{N.currentTarget.focus(),g.current!=="mouse"&&T(N)}),onPointerDown:Ge(c.onPointerDown,N=>{g.current=N.pointerType;const j=N.target;j.hasPointerCapture(N.pointerId)&&j.releasePointerCapture(N.pointerId),N.button===0&&N.ctrlKey===!1&&N.pointerType==="mouse"&&(T(N),N.preventDefault())}),onKeyDown:Ge(c.onKeyDown,N=>{const j=v.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&k(N.key),!(j&&N.key===" ")&&DS.includes(N.key)&&(T(),N.preventDefault())})})})});ig.displayName=lg;var og="SelectValue",cg=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,children:d,placeholder:m="",...f}=r,p=bn(og,l),{onValueNodeHasChildrenChange:y}=p,g=d!==void 0,v=at(a,p.onValueNodeChange);return Zt(()=>{y(g)},[y,g]),e.jsx(Xe.span,{...f,ref:v,style:{pointerEvents:"none"},children:Pg(p.value)?e.jsx(e.Fragment,{children:m}):d})});cg.displayName=og;var BS="SelectIcon",dg=h.forwardRef((r,a)=>{const{__scopeSelect:l,children:i,...c}=r;return e.jsx(Xe.span,{"aria-hidden":!0,...c,ref:a,children:i||"▼"})});dg.displayName=BS;var US="SelectPortal",ug=r=>e.jsx(Eu,{asChild:!0,...r});ug.displayName=US;var Gn="SelectContent",hg=h.forwardRef((r,a)=>{const l=bn(Gn,r.__scopeSelect),[i,c]=h.useState();if(Zt(()=>{c(new DocumentFragment)},[]),!l.open){const d=i;return d?Ol.createPortal(e.jsx(mg,{scope:r.__scopeSelect,children:e.jsx(Do.Slot,{scope:r.__scopeSelect,children:e.jsx("div",{children:r.children})})}),d):null}return e.jsx(fg,{...r,ref:a})});hg.displayName=Gn;var Ys=10,[mg,jn]=Ha(Gn),VS="SelectContentImpl",WS=Dl("SelectContent.RemoveScroll"),fg=h.forwardRef((r,a)=>{const{__scopeSelect:l,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:m,side:f,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:k,collisionPadding:P,sticky:T,hideWhenDetached:N,avoidCollisions:j,...C}=r,E=bn(Gn,l),[b,R]=h.useState(null),[G,X]=h.useState(null),D=at(a,q=>R(q)),[I,w]=h.useState(null),[V,se]=h.useState(null),ie=Lo(l),[Y,ne]=h.useState(!1),_=h.useRef(!1);h.useEffect(()=>{if(b)return Rp(b)},[b]),jp();const Q=h.useCallback(q=>{const[ye,...Se]=ie().map(ke=>ke.ref.current),[F]=Se.slice(-1),xe=document.activeElement;for(const ke of q)if(ke===xe||(ke==null||ke.scrollIntoView({block:"nearest"}),ke===ye&&G&&(G.scrollTop=0),ke===F&&G&&(G.scrollTop=G.scrollHeight),ke==null||ke.focus(),document.activeElement!==xe))return},[ie,G]),ue=h.useCallback(()=>Q([I,b]),[Q,I,b]);h.useEffect(()=>{Y&&ue()},[Y,ue]);const{onOpenChange:L,triggerPointerDownPosRef:re}=E;h.useEffect(()=>{if(b){let q={x:0,y:0};const ye=F=>{var xe,ke;q={x:Math.abs(Math.round(F.pageX)-(((xe=re.current)==null?void 0:xe.x)??0)),y:Math.abs(Math.round(F.pageY)-(((ke=re.current)==null?void 0:ke.y)??0))}},Se=F=>{q.x<=10&&q.y<=10?F.preventDefault():b.contains(F.target)||L(!1),document.removeEventListener("pointermove",ye),re.current=null};return re.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",Se,{capture:!0})}}},[b,L,re]),h.useEffect(()=>{const q=()=>L(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[L]);const[H,A]=Tg(q=>{const ye=ie().filter(xe=>!xe.disabled),Se=ye.find(xe=>xe.ref.current===document.activeElement),F=Rg(ye,q,Se);F&&setTimeout(()=>F.ref.current.focus())}),z=h.useCallback((q,ye,Se)=>{const F=!_.current&&!Se;(E.value!==void 0&&E.value===ye||F)&&(w(q),F&&(_.current=!0))},[E.value]),O=h.useCallback(()=>b==null?void 0:b.focus(),[b]),ee=h.useCallback((q,ye,Se)=>{const F=!_.current&&!Se;(E.value!==void 0&&E.value===ye||F)&&se(q)},[E.value]),K=i==="popper"?cu:xg,de=K===cu?{side:f,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:k,collisionPadding:P,sticky:T,hideWhenDetached:N,avoidCollisions:j}:{};return e.jsx(mg,{scope:l,content:b,viewport:G,onViewportChange:X,itemRefCallback:z,selectedItem:I,onItemLeave:O,itemTextRefCallback:ee,focusSelectedItem:ue,selectedItemText:V,position:i,isPositioned:Y,searchRef:H,children:e.jsx(Pu,{as:WS,allowPinchZoom:!0,children:e.jsx(ku,{asChild:!0,trapped:E.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Ge(c,q=>{var ye;(ye=E.trigger)==null||ye.focus({preventScroll:!0}),q.preventDefault()}),children:e.jsx(Cu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:e.jsx(K,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:q=>q.preventDefault(),...C,...de,onPlaced:()=>ne(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:Ge(C.onKeyDown,q=>{const ye=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!ye&&q.key.length===1&&A(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let F=ie().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(q.key)&&(F=F.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const xe=q.target,ke=F.indexOf(xe);F=F.slice(ke+1)}setTimeout(()=>Q(F)),q.preventDefault()}})})})})})})});fg.displayName=VS;var HS="SelectItemAlignedPosition",xg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:i,...c}=r,d=bn(Gn,l),m=jn(Gn,l),[f,p]=h.useState(null),[y,g]=h.useState(null),v=at(a,D=>g(D)),k=Lo(l),P=h.useRef(!1),T=h.useRef(!0),{viewport:N,selectedItem:j,selectedItemText:C,focusSelectedItem:E}=m,b=h.useCallback(()=>{if(d.trigger&&d.valueNode&&f&&y&&N&&j&&C){const D=d.trigger.getBoundingClientRect(),I=y.getBoundingClientRect(),w=d.valueNode.getBoundingClientRect(),V=C.getBoundingClientRect();if(d.dir!=="rtl"){const xe=V.left-I.left,ke=w.left-xe,Ve=D.left-ke,We=D.width+Ve,Ke=Math.max(We,I.width),tt=window.innerWidth-Ys,$e=xo(ke,[Ys,Math.max(Ys,tt-Ke)]);f.style.minWidth=We+"px",f.style.left=$e+"px"}else{const xe=I.right-V.right,ke=window.innerWidth-w.right-xe,Ve=window.innerWidth-D.right-ke,We=D.width+Ve,Ke=Math.max(We,I.width),tt=window.innerWidth-Ys,$e=xo(ke,[Ys,Math.max(Ys,tt-Ke)]);f.style.minWidth=We+"px",f.style.right=$e+"px"}const se=k(),ie=window.innerHeight-Ys*2,Y=N.scrollHeight,ne=window.getComputedStyle(y),_=parseInt(ne.borderTopWidth,10),Q=parseInt(ne.paddingTop,10),ue=parseInt(ne.borderBottomWidth,10),L=parseInt(ne.paddingBottom,10),re=_+Q+Y+L+ue,H=Math.min(j.offsetHeight*5,re),A=window.getComputedStyle(N),z=parseInt(A.paddingTop,10),O=parseInt(A.paddingBottom,10),ee=D.top+D.height/2-Ys,K=ie-ee,de=j.offsetHeight/2,q=j.offsetTop+de,ye=_+Q+q,Se=re-ye;if(ye<=ee){const xe=se.length>0&&j===se[se.length-1].ref.current;f.style.bottom="0px";const ke=y.clientHeight-N.offsetTop-N.offsetHeight,Ve=Math.max(K,de+(xe?O:0)+ke+ue),We=ye+Ve;f.style.height=We+"px"}else{const xe=se.length>0&&j===se[0].ref.current;f.style.top="0px";const Ve=Math.max(ee,_+N.offsetTop+(xe?z:0)+de)+Se;f.style.height=Ve+"px",N.scrollTop=ye-ee+N.offsetTop}f.style.margin=`${Ys}px 0`,f.style.minHeight=H+"px",f.style.maxHeight=ie+"px",i==null||i(),requestAnimationFrame(()=>P.current=!0)}},[k,d.trigger,d.valueNode,f,y,N,j,C,d.dir,i]);Zt(()=>b(),[b]);const[R,G]=h.useState();Zt(()=>{y&&G(window.getComputedStyle(y).zIndex)},[y]);const X=h.useCallback(D=>{D&&T.current===!0&&(b(),E==null||E(),T.current=!1)},[b,E]);return e.jsx(GS,{scope:l,contentWrapper:f,shouldExpandOnScrollRef:P,onScrollButtonChange:X,children:e.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:e.jsx(Xe.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});xg.displayName=HS;var KS="SelectPopperPosition",cu=h.forwardRef((r,a)=>{const{__scopeSelect:l,align:i="start",collisionPadding:c=Ys,...d}=r,m=Oo(l);return e.jsx(IS,{...m,...d,ref:a,align:i,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});cu.displayName=KS;var[GS,Ku]=Ha(Gn,{}),du="SelectViewport",pg=h.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:i,...c}=r,d=jn(du,l),m=Ku(du,l),f=at(a,d.onViewportChange),p=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:i}),e.jsx(Do.Slot,{scope:l,children:e.jsx(Xe.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Ge(c.onScroll,y=>{const g=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:k}=m;if(k!=null&&k.current&&v){const P=Math.abs(p.current-g.scrollTop);if(P>0){const T=window.innerHeight-Ys*2,N=parseFloat(v.style.minHeight),j=parseFloat(v.style.height),C=Math.max(N,j);if(C0?R:0,v.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})});pg.displayName=du;var gg="SelectGroup",[YS,QS]=Ha(gg),qS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=dn();return e.jsx(YS,{scope:l,id:c,children:e.jsx(Xe.div,{role:"group","aria-labelledby":c,...i,ref:a})})});qS.displayName=gg;var yg="SelectLabel",XS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=QS(yg,l);return e.jsx(Xe.div,{id:c.id,...i,ref:a})});XS.displayName=yg;var bo="SelectItem",[JS,vg]=Ha(bo),bg=h.forwardRef((r,a)=>{const{__scopeSelect:l,value:i,disabled:c=!1,textValue:d,...m}=r,f=bn(bo,l),p=jn(bo,l),y=f.value===i,[g,v]=h.useState(d??""),[k,P]=h.useState(!1),T=at(a,E=>{var b;return(b=p.itemRefCallback)==null?void 0:b.call(p,E,i,c)}),N=dn(),j=h.useRef("touch"),C=()=>{c||(f.onValueChange(i),f.onOpenChange(!1))};if(i==="")throw new Error("A 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:i,disabled:c,textId:N,isSelected:y,onItemTextChange:h.useCallback(E=>{v(b=>b||((E==null?void 0:E.textContent)??"").trim())},[]),children:e.jsx(Do.ItemSlot,{scope:l,value:i,disabled:c,textValue:g,children:e.jsx(Xe.div,{role:"option","aria-labelledby":N,"data-highlighted":k?"":void 0,"aria-selected":y&&k,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...m,ref:T,onFocus:Ge(m.onFocus,()=>P(!0)),onBlur:Ge(m.onBlur,()=>P(!1)),onClick:Ge(m.onClick,()=>{j.current!=="mouse"&&C()}),onPointerUp:Ge(m.onPointerUp,()=>{j.current==="mouse"&&C()}),onPointerDown:Ge(m.onPointerDown,E=>{j.current=E.pointerType}),onPointerMove:Ge(m.onPointerMove,E=>{var b;j.current=E.pointerType,c?(b=p.onItemLeave)==null||b.call(p):j.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ge(m.onPointerLeave,E=>{var b;E.currentTarget===document.activeElement&&((b=p.onItemLeave)==null||b.call(p))}),onKeyDown:Ge(m.onKeyDown,E=>{var R;((R=p.searchRef)==null?void 0:R.current)!==""&&E.key===" "||(LS.includes(E.key)&&C(),E.key===" "&&E.preventDefault())})})})})});bg.displayName=bo;var Tl="SelectItemText",jg=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,...d}=r,m=bn(Tl,l),f=jn(Tl,l),p=vg(Tl,l),y=$S(Tl,l),[g,v]=h.useState(null),k=at(a,C=>v(C),p.onItemTextChange,C=>{var E;return(E=f.itemTextRefCallback)==null?void 0:E.call(f,C,p.value,p.disabled)}),P=g==null?void 0:g.textContent,T=h.useMemo(()=>e.jsx("option",{value:p.value,disabled:p.disabled,children:P},p.value),[p.disabled,p.value,P]),{onNativeOptionAdd:N,onNativeOptionRemove:j}=y;return Zt(()=>(N(T),()=>j(T)),[N,j,T]),e.jsxs(e.Fragment,{children:[e.jsx(Xe.span,{id:p.textId,...d,ref:k}),p.isSelected&&m.valueNode&&!m.valueNodeHasChildren?Ol.createPortal(d.children,m.valueNode):null]})});jg.displayName=Tl;var Ng="SelectItemIndicator",wg=h.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return vg(Ng,l).isSelected?e.jsx(Xe.span,{"aria-hidden":!0,...i,ref:a}):null});wg.displayName=Ng;var uu="SelectScrollUpButton",Sg=h.forwardRef((r,a)=>{const l=jn(uu,r.__scopeSelect),i=Ku(uu,r.__scopeSelect),[c,d]=h.useState(!1),m=at(a,i.onScrollButtonChange);return Zt(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=p.scrollTop>0;d(y)};const p=l.viewport;return f(),p.addEventListener("scroll",f),()=>p.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(kg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:p}=l;f&&p&&(f.scrollTop=f.scrollTop-p.offsetHeight)}}):null});Sg.displayName=uu;var hu="SelectScrollDownButton",Cg=h.forwardRef((r,a)=>{const l=jn(hu,r.__scopeSelect),i=Ku(hu,r.__scopeSelect),[c,d]=h.useState(!1),m=at(a,i.onScrollButtonChange);return Zt(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)p.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(kg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:p}=l;f&&p&&(f.scrollTop=f.scrollTop+p.offsetHeight)}}):null});Cg.displayName=hu;var kg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:i,...c}=r,d=jn("SelectScrollButton",l),m=h.useRef(null),f=Lo(l),p=h.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return h.useEffect(()=>()=>p(),[p]),Zt(()=>{var g;const y=f().find(v=>v.ref.current===document.activeElement);(g=y==null?void 0:y.ref.current)==null||g.scrollIntoView({block:"nearest"})},[f]),e.jsx(Xe.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Ge(c.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(i,50))}),onPointerMove:Ge(c.onPointerMove,()=>{var y;(y=d.onItemLeave)==null||y.call(d),m.current===null&&(m.current=window.setInterval(i,50))}),onPointerLeave:Ge(c.onPointerLeave,()=>{p()})})}),ZS="SelectSeparator",e3=h.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return e.jsx(Xe.div,{"aria-hidden":!0,...i,ref:a})});e3.displayName=ZS;var mu="SelectArrow",t3=h.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=Oo(l),d=bn(mu,l),m=jn(mu,l);return d.open&&m.position==="popper"?e.jsx(_S,{...c,...i,ref:a}):null});t3.displayName=mu;var s3="SelectBubbleInput",Eg=h.forwardRef(({__scopeSelect:r,value:a,...l},i)=>{const c=h.useRef(null),d=at(i,c),m=Du(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const p=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(m!==a&&g){const v=new Event("change",{bubbles:!0});g.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(Xe.select,{...l,style:{...ng,...l.style},ref:d,defaultValue:a})});Eg.displayName=s3;function Pg(r){return r===""||r===void 0}function Tg(r){const a=mn(r),l=h.useRef(""),i=h.useRef(0),c=h.useCallback(m=>{const f=l.current+m;a(f),(function p(y){l.current=y,window.clearTimeout(i.current),y!==""&&(i.current=window.setTimeout(()=>p(""),1e3))})(f)},[a]),d=h.useCallback(()=>{l.current="",window.clearTimeout(i.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(i.current),[]),[l,c,d]}function Rg(r,a,l){const c=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a,d=l?r.indexOf(l):-1;let m=r3(r,Math.max(d,0));c.length===1&&(m=m.filter(y=>y!==l));const p=m.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return p!==l?p:void 0}function r3(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var n3=ag,Ig=ig,a3=cg,l3=dg,i3=ug,_g=hg,o3=pg,Mg=bg,c3=jg,d3=wg,u3=Sg,h3=Cg;const El=n3,Pl=a3,Ea=h.forwardRef(({className:r,children:a,...l},i)=>e.jsxs(Ig,{ref:i,className:lt("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(l3,{asChild:!0,children:e.jsx(Ml,{className:"h-4 w-4 opacity-50"})})]}));Ea.displayName=Ig.displayName;const Pa=h.forwardRef(({className:r,children:a,position:l="popper",...i},c)=>e.jsx(i3,{children:e.jsxs(_g,{ref:c,className:lt("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,...i,children:[e.jsx(u3,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Kx,{className:"h-4 w-4"})}),e.jsx(o3,{className:"p-1",children:a}),e.jsx(h3,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Ml,{className:"h-4 w-4"})})]})}));Pa.displayName=_g.displayName;const lr=h.forwardRef(({className:r,children:a,...l},i)=>e.jsxs(Mg,{ref:i,className:lt("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(d3,{children:e.jsx(wo,{className:"h-4 w-4"})})}),e.jsx(c3,{children:a})]}));lr.displayName=Mg.displayName;const m3=["一","二","三","四","五","六","七","八","九","十"];function Bd(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 f3({parts:r,expandedParts:a,onTogglePart:l,onReorder:i,onReadSection:c,onDeleteSection:d,onAddSectionInPart:m,onAddChapterInPart:f,onDeleteChapter:p,onEditPart:y,onDeletePart:g,onEditChapter:v,selectedSectionIds:k=[],onToggleSectionSelect:P,onShowSectionOrders:T}){const[N,j]=h.useState(null),[C,E]=h.useState(null),b=(w,V)=>(N==null?void 0:N.type)===w&&(N==null?void 0:N.id)===V,R=(w,V)=>(C==null?void 0:C.type)===w&&(C==null?void 0:C.id)===V,G=h.useCallback(()=>{const w=[];for(const V of r)for(const se of V.chapters)for(const ie of se.sections)w.push({id:ie.id,partId:V.id,partTitle:V.title,chapterId:se.id,chapterTitle:se.title});return w},[r]),X=h.useCallback(async(w,V,se,ie)=>{var ue;w.preventDefault(),w.stopPropagation();const Y=w.dataTransfer.getData("text/plain"),ne=Bd(Y);if(!ne||ne.type===V&&ne.id===se)return;const _=G(),Q=new Map(_.map(L=>[L.id,L]));if(ne.type==="part"&&V==="part"){const L=r.map(O=>O.id),re=L.indexOf(ne.id),H=L.indexOf(se);if(re===-1||H===-1)return;const A=[...L];A.splice(re,1),A.splice(reK.id===O);if(ee)for(const K of ee.chapters)for(const de of K.sections){const q=Q.get(de.id);q&&z.push(q)}}await i(z);return}if(ne.type==="chapter"&&(V==="chapter"||V==="section"||V==="part")){const L=r.find(q=>q.chapters.some(ye=>ye.id===ne.id)),re=L==null?void 0:L.chapters.find(q=>q.id===ne.id);if(!L||!re)return;let H,A,z=null;if(V==="section"){const q=Q.get(se);if(!q)return;H=q.partId,A=q.partTitle,z=se}else if(V==="chapter"){const q=r.find(F=>F.chapters.some(xe=>xe.id===se)),ye=q==null?void 0:q.chapters.find(F=>F.id===se);if(!q||!ye)return;H=q.id,A=q.title;const Se=_.filter(F=>F.chapterId===se).pop();z=(Se==null?void 0:Se.id)??null}else{const q=r.find(Se=>Se.id===se);if(!q||!q.chapters[0])return;H=q.id,A=q.title;const ye=_.filter(Se=>Se.partId===q.id&&Se.chapterId===q.chapters[0].id);z=((ue=ye[ye.length-1])==null?void 0:ue.id)??null}const O=re.sections.map(q=>q.id),ee=_.filter(q=>!O.includes(q.id));let K=ee.length;if(z){const q=ee.findIndex(ye=>ye.id===z);q>=0&&(K=q+1)}const de=O.map(q=>({...Q.get(q),partId:H,partTitle:A,chapterId:re.id,chapterTitle:re.title}));await i([...ee.slice(0,K),...de,...ee.slice(K)]);return}if(ne.type==="section"&&(V==="section"||V==="chapter"||V==="part")){if(!ie)return;const{partId:L,partTitle:re,chapterId:H,chapterTitle:A}=ie;let z;if(V==="section")z=_.findIndex(ye=>ye.id===se);else if(V==="chapter"){const ye=_.filter(Se=>Se.chapterId===se).pop();z=ye?_.findIndex(Se=>Se.id===ye.id)+1:_.length}else{const ye=r.find(xe=>xe.id===se);if(!(ye!=null&&ye.chapters[0]))return;const Se=_.filter(xe=>xe.partId===ye.id&&xe.chapterId===ye.chapters[0].id),F=Se[Se.length-1];z=F?_.findIndex(xe=>xe.id===F.id)+1:0}const O=_.findIndex(ye=>ye.id===ne.id);if(O===-1)return;const ee=_.filter(ye=>ye.id!==ne.id),K=O({onDragEnter:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",E({type:w,id:V})},onDragOver:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",E({type:w,id:V})},onDragLeave:()=>E(null),onDrop:ie=>{E(null);const Y=Bd(ie.dataTransfer.getData("text/plain"));if(Y&&!(w==="section"&&Y.type==="section"&&Y.id===V))if(w==="part")if(Y.type==="part")X(ie,"part",V);else{const ne=r.find(Q=>Q.id===V);(ne==null?void 0:ne.chapters[0])&&se&&X(ie,"part",V,se)}else w==="chapter"&&se?(Y.type==="section"||Y.type==="chapter")&&X(ie,"chapter",V,se):w==="section"&&se&&X(ie,"section",V,se)}}),I=w=>m3[w]??String(w+1);return e.jsx("div",{className:"space-y-3",children:r.map((w,V)=>{var re,H,A,z;const se=w.title==="序言"||w.title.includes("序言"),ie=w.title==="尾声"||w.title.includes("尾声"),Y=w.title==="附录"||w.title.includes("附录"),ne=R("part",w.id),_=a.includes(w.id),Q=w.chapters.length,ue=w.chapters.reduce((O,ee)=>O+ee.sections.length,0);if(se&&w.chapters.length===1&&w.chapters[0].sections.length===1){const O=w.chapters[0].sections[0],ee=R("section",O.id),K={partId:w.id,partTitle:w.title,chapterId:w.chapters[0].id,chapterTitle:w.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+O.id),de.dataTransfer.effectAllowed="move",j({type:"section",id:O.id})},onDragEnd:()=>{j(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${ee?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${b("section",O.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...D("section",O.id,K),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(Sr,{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:k.includes(O.id),onChange:()=>P(O.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(qs,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[w.chapters[0].title," | ",O.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[O.price===0||O.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:["¥",O.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",O.clickCount??0," · 付款 ",O.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(O.hotScore??0).toFixed(1)," · 第",O.hotRank&&O.hotRank>0?O.hotRank:"-","名"]}),T&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(O),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(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(O),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500"})]})]},w.id)}if(w.title==="2026每日派对干货"||w.title.includes("2026每日派对干货")){const O=R("part",w.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${O?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,...D("part",w.id,{partId:w.id,partTitle:w.title,chapterId:((re=w.chapters[0])==null?void 0:re.id)??"",chapterTitle:((H=w.chapters[0])==null?void 0:H.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:ee=>{ee.stopPropagation(),ee.dataTransfer.setData("text/plain","part:"+w.id),ee.dataTransfer.effectAllowed="move",j({type:"part",id:w.id})},onDragEnd:()=>{j(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${b("part",w.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/50"}`,onClick:()=>l(w.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(Sr,{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:w.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ue," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:[m&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(w),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[Q,"章"]}),_?e.jsx(Ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(sn,{className:"w-5 h-5 text-gray-500"})]})]}),_&&w.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:w.chapters.map(ee=>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:ee.title}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:K=>K.stopPropagation(),children:[v&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>v(w,ee),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(J,{variant:"ghost",size:"sm",onClick:()=>f(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>p(w,ee),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:ee.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:q=>{q.stopPropagation(),q.dataTransfer.setData("text/plain","section:"+K.id),q.dataTransfer.effectAllowed="move",j({type:"section",id:K.id})},onDragEnd:()=>{j(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg min-h-[40px] cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${b("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...D("section",K.id,{partId:w.id,partTitle:w.title,chapterId:ee.id,chapterTitle:ee.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Sr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:q=>q.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:k.includes(K.id),onChange:()=>P(K.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:[K.id," ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),T&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>T(K),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),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(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]},K.id)})})]},ee.id))})]},w.id)}if(Y)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:w.chapters.map((O,ee)=>O.sections.length>0?O.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:q=>{q.stopPropagation(),q.dataTransfer.setData("text/plain","section:"+K.id),q.dataTransfer.effectAllowed="move",j({type:"section",id:K.id})},onDragEnd:()=>{j(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 group cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${b("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...D("section",K.id,{partId:w.id,partTitle:w.title,chapterId:O.id,chapterTitle:O.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Sr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:q=>q.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:k.includes(K.id),onChange:()=>P(K.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:["附录",ee+1," | ",O.title," | ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),T&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>T(K),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(J,{variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>c(K),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(J,{variant:"ghost",size:"sm",onClick:()=>d(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},K.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:["附录",ee+1," | ",O.title,"(空)"]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},O.id))})]},w.id);if(ie&&w.chapters.length===1&&w.chapters[0].sections.length===1){const O=w.chapters[0].sections[0],ee=R("section",O.id),K={partId:w.id,partTitle:w.title,chapterId:w.chapters[0].id,chapterTitle:w.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+O.id),de.dataTransfer.effectAllowed="move",j({type:"section",id:O.id})},onDragEnd:()=>{j(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${ee?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${b("section",O.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...D("section",O.id,K),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(Sr,{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:k.includes(O.id),onChange:()=>P(O.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(qs,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[w.chapters[0].title," | ",O.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[O.price===0||O.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:["¥",O.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",O.clickCount??0," · 付款 ",O.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(O.hotScore??0).toFixed(1)," · 第",O.hotRank&&O.hotRank>0?O.hotRank:"-","名"]}),T&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(O),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(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(O),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500"})]})]},w.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:w.chapters.map(O=>O.sections.map(ee=>{const K=R("section",ee.id);return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+ee.id),de.dataTransfer.effectAllowed="move",j({type:"section",id:ee.id})},onDragEnd:()=>{j(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${K?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${b("section",ee.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...D("section",ee.id,{partId:w.id,partTitle:w.title,chapterId:O.id,chapterTitle:O.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Sr,{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:k.includes(ee.id),onChange:()=>P(ee.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:[O.title," | ",ee.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",ee.clickCount??0," · 付款 ",ee.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(ee.hotScore??0).toFixed(1)," · 第",ee.hotRank&&ee.hotRank>0?ee.hotRank:"-","名"]}),T&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(ee),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(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(ee),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(ee),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(ee),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]})]},ee.id)}))})]},w.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${ne?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...D("part",w.id,{partId:w.id,partTitle:w.title,chapterId:((A=w.chapters[0])==null?void 0:A.id)??"",chapterTitle:((z=w.chapters[0])==null?void 0:z.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:O=>{O.stopPropagation(),O.dataTransfer.setData("text/plain","part:"+w.id),O.dataTransfer.effectAllowed="move",j({type:"part",id:w.id})},onDragEnd:()=>{j(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${b("part",w.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(w.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(Sr,{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:I(V)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:w.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ue," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:O=>O.stopPropagation(),onClick:O=>O.stopPropagation(),children:[m&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(mt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(w),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[Q,"章"]}),_?e.jsx(Ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(sn,{className:"w-5 h-5 text-gray-500"})]})]}),_&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:w.chapters.map(O=>{const ee=R("chapter",O.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:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","chapter:"+O.id),K.dataTransfer.effectAllowed="move",j({type:"chapter",id:O.id})},onDragEnd:()=>{j(null),E(null)},onDragEnter:K=>{K.preventDefault(),K.stopPropagation(),K.dataTransfer.dropEffect="move",E({type:"chapter",id:O.id})},onDragOver:K=>{K.preventDefault(),K.stopPropagation(),K.dataTransfer.dropEffect="move",E({type:"chapter",id:O.id})},onDragLeave:()=>E(null),onDrop:K=>{E(null);const de=Bd(K.dataTransfer.getData("text/plain"));if(!de)return;const q={partId:w.id,partTitle:w.title,chapterId:O.id,chapterTitle:O.title};(de.type==="section"||de.type==="chapter")&&X(K,"chapter",O.id,q)},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 ${ee?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${b("chapter",O.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[e.jsx(Sr,{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:O.title})]}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:K=>K.stopPropagation(),children:[v&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>v(w,O),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(J,{variant:"ghost",size:"sm",onClick:()=>f(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>p(w,O),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:O.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:q=>{q.stopPropagation(),q.dataTransfer.setData("text/plain","section:"+K.id),q.dataTransfer.effectAllowed="move",j({type:"section",id:K.id})},onDragEnd:()=>{j(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg group cursor-grab active:cursor-grabbing select-none min-h-[40px] transition-all duration-200 ${de?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${b("section",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...D("section",K.id,{partId:w.id,partTitle:w.title,chapterId:O.id,chapterTitle:O.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:q=>q.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:k.includes(K.id),onChange:()=>P(K.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx(Sr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${K.price===0||K.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[K.id," ",K.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:q=>q.stopPropagation(),onClick:q=>q.stopPropagation(),children:[K.isNew&&e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),K.price===0||K.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:["¥",K.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",title:"点击次数 · 付款笔数",children:["点击 ",K.clickCount??0," · 付款 ",K.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(K.hotScore??0).toFixed(1)," · 第",K.hotRank&&K.hotRank>0?K.hotRank:"-","名"]}),T&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>T(K),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(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),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(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(K),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500"})]})]},K.id)})})]},O.id)})})]},w.id)})})}function x3(r){const a=new Map;for(const f of r){const p=f.partId||"part-1",y=f.partTitle||"未分类",g=f.chapterId||"chapter-1",v=f.chapterTitle||"未分类";a.has(p)||a.set(p,{id:p,title:y,chapters:new Map});const k=a.get(p);k.chapters.has(g)||k.chapters.set(g,{id:g,title:v,sections:[]}),k.chapters.get(g).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",i="2026每日派对干货";Array.from(a.values()).some(f=>f.title===i||f.title.includes(i))||a.set(l,{id:l,title:i,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:i,sections:[]}]])});const d=Array.from(a.values()).map(f=>({...f,chapters:Array.from(f.chapters.values())})),m=f=>f.includes("序言")?0:f.includes(i)?1.5:f.includes("附录")?2:f.includes("尾声")?3:1;return d.sort((f,p)=>{const y=m(f.title),g=m(p.title);return y!==g?y-g:0})}function p3(){var $s,ea,ts;const[r,a]=h.useState([]),[l,i]=h.useState(!0),[c,d]=h.useState([]),[m,f]=h.useState(null),[p,y]=h.useState(!1),[g,v]=h.useState(!1),[k,P]=h.useState(!1),[T,N]=h.useState(""),[j,C]=h.useState([]),[E,b]=h.useState(!1),[R,G]=h.useState(!1),X=h.useRef(null),[D,I]=h.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[w,V]=h.useState(null),[se,ie]=h.useState(!1),[Y,ne]=h.useState(!1),[_,Q]=h.useState(null),[ue,L]=h.useState(!1),[re,H]=h.useState([]),[A,z]=h.useState(!1),[O,ee]=h.useState(""),[K,de]=h.useState(""),[q,ye]=h.useState(!1),[Se,F]=h.useState(""),[xe,ke]=h.useState(!1),[Ve,We]=h.useState(null),[Ke,tt]=h.useState(!1),[$e,me]=h.useState(!1),[pe,ft]=h.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[es,hr]=h.useState(!1),[Nn,As]=h.useState(!1),Bt=x3(r),Mr=r.length,ct=async()=>{i(!0);try{const $=await Oe("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray($==null?void 0:$.sections)?$.sections:[])}catch($){console.error($),a([])}finally{i(!1)}};h.useEffect(()=>{ct()},[]);const gs=$=>{d(ce=>ce.includes($)?ce.filter(Ce=>Ce!==$):[...ce,$])},wn=h.useCallback($=>{const ce=r,Ce=$.flatMap(Ee=>{const xt=ce.find(ns=>ns.id===Ee.id);return xt?[{...xt,partId:Ee.partId,partTitle:Ee.partTitle,chapterId:Ee.chapterId,chapterTitle:Ee.chapterTitle}]:[]});return a(Ce),vt("/api/db/book",{action:"reorder",items:$}).then(Ee=>{Ee&&Ee.success===!1&&(a(ce),alert("排序失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误")))}).catch(Ee=>{a(ce),console.error("排序失败:",Ee),alert("排序失败: "+(Ee instanceof Error?Ee.message:"网络或服务异常"))}),Promise.resolve()},[r]),mr=async $=>{if(confirm(`确定要删除章节「${$.title}」吗?此操作不可恢复。`))try{const ce=await Tr(`/api/db/book?id=${encodeURIComponent($.id)}`);ce&&ce.success!==!1?(alert("已删除"),ct()):alert("删除失败: "+(ce&&typeof ce=="object"&&"error"in ce?ce.error:"未知错误"))}catch(ce){console.error(ce),alert("删除失败")}},Cs=h.useCallback(async()=>{hr(!0);try{const $=await Oe("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),ce=$&&$.data;ce&&typeof ce.readWeight=="number"&&typeof ce.recencyWeight=="number"&&typeof ce.payWeight=="number"&&ft({readWeight:Math.max(0,Math.min(1,ce.readWeight)),recencyWeight:Math.max(0,Math.min(1,ce.recencyWeight)),payWeight:Math.max(0,Math.min(1,ce.payWeight))})}catch{}finally{hr(!1)}},[]);h.useEffect(()=>{$e&&Cs()},[$e,Cs]);const Yn=async()=>{const{readWeight:$,recencyWeight:ce,payWeight:Ce}=pe,Ee=$+ce+Ce;if(Math.abs(Ee-1)>.001){alert("三个权重之和必须等于 1");return}As(!0);try{const xt=await ut("/api/db/config",{key:"article_ranking_weights",value:{readWeight:$,recencyWeight:ce,payWeight:Ce},description:"文章排名算法权重"});xt&&xt.success!==!1?(alert("已保存"),ct()):alert("保存失败: "+(xt&&typeof xt=="object"&&"error"in xt?xt.error:""))}catch(xt){console.error(xt),alert("保存失败")}finally{As(!1)}},Qn=async $=>{We({section:$,orders:[]}),tt(!0);try{const ce=await Oe(`/api/db/book?action=section-orders&id=${encodeURIComponent($.id)}`),Ce=ce!=null&&ce.success&&Array.isArray(ce.orders)?ce.orders:[];We(Ee=>Ee?{...Ee,orders:Ce}:null)}catch(ce){console.error(ce),We(Ce=>Ce?{...Ce,orders:[]}:null)}finally{tt(!1)}},ks=async $=>{v(!0);try{const ce=await Oe(`/api/db/book?action=read&id=${encodeURIComponent($.id)}`);if(ce!=null&&ce.success&&ce.section){const Ce=ce.section;f({id:$.id,title:ce.section.title??$.title,price:ce.section.price??$.price,content:ce.section.content??"",filePath:$.filePath,isFree:$.isFree||$.price===0,isNew:Ce.isNew??$.isNew})}else f({id:$.id,title:$.title,price:$.price,content:"",filePath:$.filePath,isFree:$.isFree,isNew:$.isNew}),ce&&!ce.success&&alert("无法读取文件内容: "+(ce.error||"未知错误"))}catch(ce){console.error(ce),f({id:$.id,title:$.title,price:$.price,content:"",filePath:$.filePath,isFree:$.isFree})}finally{v(!1)}},Sn=async()=>{var $;if(m){P(!0);try{let ce=m.content||"";const Ce=[new RegExp(`^#+\\s*${m.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${m.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${($=m.title)==null?void 0:$.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const xt of Ce)ce=ce.replace(xt,"");ce=ce.replace(/^\s*\n+/,"").trim();const Ee=await vt("/api/db/book",{id:m.id,title:m.title,price:m.isFree?0:m.price,content:ce,isFree:m.isFree||m.price===0,isNew:m.isNew,saveToFile:!0});Ee&&Ee.success!==!1?(alert(`已保存章节: ${m.title}`),f(null),ct()):alert("保存失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(ce){console.error(ce),alert("保存失败")}finally{P(!1)}}},fr=async()=>{if(!D.id||!D.title){alert("请填写章节ID和标题");return}P(!0);try{const $=await vt("/api/db/book",{id:D.id,title:D.title,price:D.price,content:D.content,partId:D.partId,chapterId:D.chapterId,saveToFile:!1});$&&$.success!==!1?(alert(`章节创建成功: ${D.title}`),y(!1),I({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),ct()):alert("创建失败: "+($&&typeof $=="object"&&"error"in $?$.error:"未知错误"))}catch($){console.error($),alert("创建失败")}finally{P(!1)}},ys=$=>{I(ce=>{var Ce;return{...ce,partId:$.id,chapterId:((Ce=$.chapters[0])==null?void 0:Ce.id)??"chapter-1"}}),y(!0)},Ds=$=>{V({id:$.id,title:$.title})},Ls=async()=>{var $;if(($=w==null?void 0:w.title)!=null&&$.trim()){ie(!0);try{const ce=r.map(Ee=>({id:Ee.id,partId:Ee.partId||"part-1",partTitle:Ee.partId===w.id?w.title.trim():Ee.partTitle||"",chapterId:Ee.chapterId||"chapter-1",chapterTitle:Ee.chapterTitle||""})),Ce=await vt("/api/db/book",{action:"reorder",items:ce});Ce&&Ce.success!==!1?(V(null),ct()):alert("更新篇名失败: "+(Ce&&typeof Ce=="object"&&"error"in Ce?Ce.error:"未知错误"))}catch(ce){console.error(ce),alert("更新篇名失败")}finally{ie(!1)}}},Cn=$=>{const ce=$.chapters.length+1,Ce=`chapter-${$.id}-${ce}-${Date.now()}`;I({id:`${ce}.1`,title:"新章节",price:1,partId:$.id,chapterId:Ce,content:""}),y(!0)},Es=($,ce)=>{Q({part:$,chapter:ce,title:ce.title})},Os=async()=>{var $;if(($=_==null?void 0:_.title)!=null&&$.trim()){L(!0);try{const ce=r.map(Ee=>({id:Ee.id,partId:Ee.partId||_.part.id,partTitle:Ee.partId===_.part.id?_.part.title:Ee.partTitle||"",chapterId:Ee.chapterId||_.chapter.id,chapterTitle:Ee.partId===_.part.id&&Ee.chapterId===_.chapter.id?_.title.trim():Ee.chapterTitle||""})),Ce=await vt("/api/db/book",{action:"reorder",items:ce});Ce&&Ce.success!==!1?(Q(null),ct()):alert("保存失败: "+(Ce&&typeof Ce=="object"&&"error"in Ce?Ce.error:"未知错误"))}catch(ce){console.error(ce),alert("保存失败")}finally{L(!1)}}},Fs=async($,ce)=>{const Ce=ce.sections.map(Ee=>Ee.id);if(Ce.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${$.chapters.indexOf(ce)+1}章 | ${ce.title}」吗?将删除共 ${Ce.length} 节,此操作不可恢复。`))try{for(const Ee of Ce)await Tr(`/api/db/book?id=${encodeURIComponent(Ee)}`);ct()}catch(Ee){console.error(Ee),alert("删除失败")}},qn=async()=>{if(!Se.trim()){alert("请输入篇名");return}ke(!0);try{const $=`part-new-${Date.now()}`,ce="chapter-1",Ce=`part-placeholder-${Date.now()}`,Ee=await vt("/api/db/book",{id:Ce,title:"占位节(可编辑)",price:0,content:"",partId:$,partTitle:Se.trim(),chapterId:ce,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Ee&&Ee.success!==!1?(alert(`篇「${Se}」创建成功,请编辑占位节`),ne(!1),F(""),ct()):alert("创建失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch($){console.error($),alert("创建失败")}finally{ke(!1)}},Xn=async()=>{if(re.length===0){alert("请先勾选要移动的章节");return}const $=Bt.find(Ce=>Ce.id===O),ce=$==null?void 0:$.chapters.find(Ce=>Ce.id===K);if(!$||!ce||!O||!K){alert("请选择目标篇和章");return}ye(!0);try{const Ce=()=>{const nt=new Set(re),as=r.map(Pt=>({id:Pt.id,partId:Pt.partId||"",partTitle:Pt.partTitle||"",chapterId:Pt.chapterId||"",chapterTitle:Pt.chapterTitle||""})),Pn=as.filter(Pt=>nt.has(Pt.id)).map(Pt=>({...Pt,partId:O,partTitle:$.title||O,chapterId:K,chapterTitle:ce.title||K})),er=as.filter(Pt=>!nt.has(Pt.id));let xr=er.length;for(let Pt=er.length-1;Pt>=0;Pt-=1){const B=er[Pt];if(B.partId===O&&B.chapterId===K){xr=Pt+1;break}}return[...er.slice(0,xr),...Pn,...er.slice(xr)]},Ee=async()=>{const nt=Ce(),as=await vt("/api/db/book",{action:"reorder",items:nt});return as&&as.success!==!1?(alert(`已移动 ${re.length} 节到「${$.title}」-「${ce.title}」`),z(!1),H([]),await ct(),!0):!1},xt={action:"move-sections",sectionIds:re,targetPartId:O,targetChapterId:K,targetPartTitle:$.title||O,targetChapterTitle:ce.title||K},ns=await vt("/api/db/book",xt);if(ns&&ns.success!==!1)alert(`已移动 ${ns.count??re.length} 节到「${$.title}」-「${ce.title}」`),z(!1),H([]),await ct();else{const nt=ns&&typeof ns=="object"&&"error"in ns?ns.error||"":"未知错误";if((nt.includes("缺少 id")||nt.includes("无效的 action"))&&await Ee())return;alert("移动失败: "+nt)}}catch(Ce){console.error(Ce),alert("移动失败: "+(Ce instanceof Error?Ce.message:"网络或服务异常"))}finally{ye(!1)}},Jn=$=>{H(ce=>ce.includes($)?ce.filter(Ce=>Ce!==$):[...ce,$])},Zn=async $=>{const ce=r.filter(Ce=>Ce.partId===$.id).map(Ce=>Ce.id);if(ce.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${$.title}」整篇吗?将删除共 ${ce.length} 节内容,此操作不可恢复。`))try{for(const Ce of ce)await Tr(`/api/db/book?id=${encodeURIComponent(Ce)}`);ct()}catch(Ce){console.error(Ce),alert("删除失败")}},kn=async $=>{var Ce,Ee;const ce=(Ce=$.target.files)==null?void 0:Ce[0];if(ce){G(!0);try{const xt=new FormData;xt.append("file",ce),xt.append("folder","book-images");const nt=await(await fetch(Da("/api/upload"),{method:"POST",body:xt,credentials:"include"})).json();if(nt!=null&&nt.success&&((Ee=nt==null?void 0:nt.data)!=null&&Ee.url)){const as=`![${ce.name}](${nt.data.url})`;m&&f({...m,content:(m.content||"")+` - -`+as}),alert(`图片上传成功: ${nt.data.url}`)}else alert("上传失败: "+((nt==null?void 0:nt.error)||"未知错误"))}catch(xt){console.error(xt),alert("上传失败")}finally{G(!1),X.current&&(X.current.value="")}}},En=async()=>{var $;if(T.trim()){b(!0);try{const ce=await Oe(`/api/search?q=${encodeURIComponent(T)}`);ce!=null&&ce.success&&(($=ce.data)!=null&&$.results)?C(ce.data.results):(C([]),ce&&!ce.success&&alert("搜索失败: "+ce.error))}catch(ce){console.error(ce),C([]),alert("搜索失败")}finally{b(!1)}}},zs=Bt.find($=>$.id===D.partId),Ar=(zs==null?void 0:zs.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:["共 ",Bt.length," 篇 · ",Mr," 节内容"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(J,{onClick:()=>me(!0),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10 bg-transparent",children:[e.jsx(kd,{className:"w-4 h-4 mr-2"}),"排名算法"]}),e.jsxs(J,{onClick:()=>{const $=typeof window<"u"?`${window.location.origin}/api-doc`:"";$&&window.open($,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Pr,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(Ct,{open:p,onOpenChange:y,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Rt,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节ID *"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:D.id,onChange:$=>I({...D,id:$.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(oe,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:D.price,onChange:$=>I({...D,price:Number($.target.value)})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题 *"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:D.title,onChange:$=>I({...D,title:$.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属篇"}),e.jsxs(El,{value:D.partId,onValueChange:$=>I({...D,partId:$,chapterId:"chapter-1"}),children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Pl,{})}),e.jsxs(Pa,{className:"bg-[#0f2137] border-gray-700",children:[Bt.map($=>e.jsx(lr,{value:$.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:$.title},$.id)),Bt.length===0&&e.jsx(lr,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属章"}),e.jsxs(El,{value:D.chapterId,onValueChange:$=>I({...D,chapterId:$}),children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Pl,{})}),e.jsxs(Pa,{className:"bg-[#0f2137] border-gray-700",children:[Ar.map($=>e.jsx(lr,{value:$.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:$.title},$.id)),Ar.length===0&&e.jsx(lr,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsx(un,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:D.content,onChange:$=>I({...D,content:$.target.value})})]})]}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:fr,disabled:k||!D.id||!D.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:k?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),e.jsx(Ct,{open:!!w,onOpenChange:$=>!$&&V(null),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),w&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"篇名"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:w.title,onChange:$=>V({...w,title:$.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>V(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:Ls,disabled:se||!(($s=w==null?void 0:w.title)!=null&&$s.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:se?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(Ct,{open:!!_,onOpenChange:$=>!$&&Q(null),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),_&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节名称(如:第8章|底层结构)"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:_.title,onChange:$=>Q({..._,title:$.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>Q(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:Os,disabled:ue||!((ea=_==null?void 0:_.title)!=null&&ea.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ue?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(Ct,{open:A,onOpenChange:$=>{var ce;if(z($),$&&Bt.length>0){const Ce=Bt[0];ee(Ce.id),de(((ce=Ce.chapters[0])==null?void 0:ce.id)??"")}},children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsx(Et,{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:re.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标篇"}),e.jsxs(El,{value:O,onValueChange:$=>{var Ce;ee($);const ce=Bt.find(Ee=>Ee.id===$);de(((Ce=ce==null?void 0:ce.chapters[0])==null?void 0:Ce.id)??"")},children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Pl,{placeholder:"选择篇"})}),e.jsx(Pa,{className:"bg-[#0f2137] border-gray-700",children:Bt.map($=>e.jsx(lr,{value:$.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:$.title},$.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标章"}),e.jsxs(El,{value:K,onValueChange:de,children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Pl,{placeholder:"选择章"})}),e.jsx(Pa,{className:"bg-[#0f2137] border-gray-700",children:(((ts=Bt.find($=>$.id===O))==null?void 0:ts.chapters)??[]).map($=>e.jsx(lr,{value:$.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:$.title},$.id))})]})]})]}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>z(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:Xn,disabled:q||re.length===0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:q?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"移动中..."]}):"确认移动"})]})]})}),e.jsx(Ct,{open:!!Ve,onOpenChange:$=>!$&&We(null),children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white",children:["付款记录 — ",(Ve==null?void 0:Ve.section.title)??""]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:Ke?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):Ve&&Ve.orders.length===0?e.jsx("p",{className:"text-gray-500 text-center py-6",children:"暂无付款记录"}):Ve?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:Ve.orders.map($=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:$.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:$.userId??$.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",$.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:$.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:$.payTime??$.createdAt??"-"})]},$.id??$.orderSn??""))})]}):null})]})}),e.jsx(Ct,{open:$e,onOpenChange:me,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(kd,{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)"}),es?e.jsx("p",{className:"text-gray-500",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"阅读权重"}),e.jsx(oe,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:pe.readWeight,onChange:$=>ft(ce=>({...ce,readWeight:Math.max(0,Math.min(1,parseFloat($.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"新度权重"}),e.jsx(oe,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:pe.recencyWeight,onChange:$=>ft(ce=>({...ce,recencyWeight:Math.max(0,Math.min(1,parseFloat($.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"付款权重"}),e.jsx(oe,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:pe.payWeight,onChange:$=>ft(ce=>({...ce,payWeight:Math.max(0,Math.min(1,parseFloat($.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(pe.readWeight+pe.recencyWeight+pe.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(J,{onClick:Yn,disabled:Nn||Math.abs(pe.readWeight+pe.recencyWeight+pe.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:Nn?"保存中...":"保存权重"})]})]})]})}),e.jsx(Ct,{open:Y,onOpenChange:ne,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[e.jsx(Rt,{className:"w-5 h-5 text-amber-400"}),"新建篇"]})}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"篇名(如:第六篇|真实的社会)"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:Se,onChange:$=>F($.target.value),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>{ne(!1),F("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:qn,disabled:xe||!Se.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:xe?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),e.jsx(Ct,{open:!!m,onOpenChange:()=>f(null),children:e.jsxs(Nt,{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(kt,{className:"shrink-0 px-6 pt-6 pb-2",children:e.jsxs(Et,{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(te,{className:"text-gray-300",children:"章节ID"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(oe,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:m.isFree?0:m.price,onChange:$=>f({...m,price:Number($.target.value),isFree:Number($.target.value)===0}),disabled:m.isFree})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"免费章节(唯一入口,小程序以 is_free 或 price=0 为准)"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m.isFree||m.price===0,onChange:$=>f({...m,isFree:$.target.checked,price:$.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最新新增"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m.isNew??!1,onChange:$=>f({...m,isNew:$.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.title,onChange:$=>f({...m,title:$.target.value})})]}),m.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"文件路径"}),e.jsx(oe,{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(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:X,type:"file",accept:"image/*",onChange:kn,className:"hidden"}),e.jsxs(J,{variant:"outline",size:"sm",onClick:()=>{var $;return($=X.current)==null?void 0:$.click()},disabled:R,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[R?e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(Xx,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),g?e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(un,{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({...m,content:$.target.value})})]})]}),e.jsxs(Dt,{className:"shrink-0 px-6 py-4 border-t border-gray-700/50",children:[e.jsxs(J,{variant:"outline",onClick:()=>f(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsx(J,{onClick:Sn,disabled:k,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:k?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),e.jsxs($l,{defaultValue:"chapters",className:"space-y-6",children:[e.jsxs(Ba,{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(qs,{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(cn,{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(kd,{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(qs,{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:Mr}),e.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(J,{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(Rt,{className:"w-4 h-4 mr-2"}),"新建章节"]}),e.jsxs(J,{onClick:()=>ne(!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(Rt,{className:"w-4 h-4 mr-2"}),"新建篇"]}),e.jsxs(J,{variant:"outline",onClick:()=>z(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",re.length," 节)"]})]}),l?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(f3,{parts:Bt,expandedParts:c,onTogglePart:gs,onReorder:wn,onReadSection:ks,onDeleteSection:mr,onAddSectionInPart:ys,onAddChapterInPart:Cn,onDeleteChapter:Fs,onEditPart:Ds,onDeletePart:Zn,onEditChapter:Es,selectedSectionIds:re,onToggleSectionSelect:Jn,onShowSectionOrders:Qn})]}),e.jsx(Ot,{value:"search",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"内容搜索"})}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:T,onChange:$=>N($.target.value),onKeyDown:$=>$.key==="Enter"&&En()}),e.jsx(J,{onClick:En,disabled:E||!T.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?e.jsx(Be,{className:"w-4 h-4 animate-spin"}):e.jsx(cn,{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($=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>ks({id:$.id,title:$.title,price:$.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:$.id}),e.jsx("span",{className:"text-white",children:$.title})]}),e.jsx(Le,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:$.matchType==="title"?"标题匹配":"内容匹配"})]}),$.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:$.snippet}),($.partTitle||$.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[$.partTitle," · ",$.chapterTitle]})]},$.id))]})]})]})}),e.jsx(Ot,{value:"hooks",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"引流钩子配置"})}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[e.jsx(te,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),e.jsxs(El,{defaultValue:"3",children:[e.jsx(Ea,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(Pl,{placeholder:"选择章节"})}),e.jsxs(Pa,{className:"bg-[#0f2137] border-gray-700",children:[e.jsx(lr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),e.jsx(lr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),e.jsx(lr,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),e.jsxs("div",{className:"grid w-full gap-1.5",children:[e.jsx(te,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),e.jsx(un,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),e.jsx(J,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}const kr={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 jx(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):kr.stats}function Nx(r){return Array.isArray(r)?r.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):kr.highlights}function g3(){const[r,a]=h.useState(kr),[l,i]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(!1),p=h.useRef(null);h.useEffect(()=>{Oe("/api/admin/author-settings").then(C=>{const E=C==null?void 0:C.data;E&&typeof E=="object"&&a({name:String(E.name??kr.name),avatar:String(E.avatar??kr.avatar),avatarImg:String(E.avatarImg??""),title:String(E.title??kr.title),bio:String(E.bio??kr.bio),stats:jx(E.stats).length?jx(E.stats):kr.stats,highlights:Nx(E.highlights).length?Nx(E.highlights):kr.highlights})}).catch(console.error).finally(()=>i(!1))},[]);const y=async()=>{d(!0);try{const C={name:r.name,avatar:r.avatar||"K",avatarImg:r.avatarImg,title:r.title,bio:r.bio,stats:r.stats.filter(R=>R.label||R.value),highlights:r.highlights.filter(Boolean)},E=await ut("/api/admin/author-settings",C);if(!E||E.success===!1){alert("保存失败: "+(E&&typeof E=="object"&&"error"in E?E.error:""));return}d(!1);const b=document.createElement("div");b.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",b.textContent="作者设置已保存",document.body.appendChild(b),setTimeout(()=>b.remove(),2e3)}catch(C){console.error(C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}finally{d(!1)}},g=async C=>{var b;const E=(b=C.target.files)==null?void 0:b[0];if(E){f(!0);try{const R=new FormData;R.append("file",E),R.append("folder","avatars");const G=Nu(),X={};G&&(X.Authorization=`Bearer ${G}`);const I=await(await fetch(Da("/api/upload"),{method:"POST",body:R,credentials:"include",headers:X})).json();I!=null&&I.success&&(I!=null&&I.url)?a(w=>({...w,avatarImg:I.url})):alert("上传失败: "+((I==null?void 0:I.error)||"未知错误"))}catch(R){console.error(R),alert("上传失败")}finally{f(!1),p.current&&(p.current.value="")}}},v=()=>a(C=>({...C,stats:[...C.stats,{label:"",value:""}]})),k=C=>a(E=>({...E,stats:E.stats.filter((b,R)=>R!==C)})),P=(C,E,b)=>a(R=>({...R,stats:R.stats.map((G,X)=>X===C?{...G,[E]:b}:G)})),T=()=>a(C=>({...C,highlights:[...C.highlights,""]})),N=C=>a(E=>({...E,highlights:E.highlights.filter((b,R)=>R!==C)})),j=(C,E)=>a(b=>({...b,highlights:b.highlights.map((R,G)=>G===C?E:R)}));return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Ia,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),e.jsxs(J,{onClick:y,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"flex items-center gap-2 text-white",children:[e.jsx(Ia,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),e.jsx(bt,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"姓名"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.name,onChange:C=>a(E=>({...E,name:C.target.value})),placeholder:"卡若"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:r.avatar,onChange:C=>a(E=>({...E,avatar:C.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Xx,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(oe,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:r.avatarImg,onChange:C=>a(E=>({...E,avatarImg:C.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),e.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:g}),e.jsxs(J,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:m,onClick:()=>{var C;return(C=p.current)==null?void 0:C.click()},children:[e.jsx(uo,{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:Da(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(te,{className:"text-gray-300",children:"头衔"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.title,onChange:C=>a(E=>({...E,title:C.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"个人简介"}),e.jsx(un,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:r.bio,onChange:C=>a(E=>({...E,bio:C.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsx(Qe,{className:"text-white",children:"统计数据"}),e.jsx(bt,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),e.jsxs(we,{className:"space-y-3",children:[r.stats.map((C,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(oe,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:C.label,onChange:b=>P(E,"label",b.target.value),placeholder:"标签"}),e.jsx(oe,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:C.value,onChange:b=>P(E,"value",b.target.value),placeholder:"数值"}),e.jsx(J,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>k(E),children:e.jsx(ms,{className:"w-4 h-4"})})]},E)),e.jsxs(J,{variant:"outline",size:"sm",onClick:v,className:"border-gray-600 text-gray-400",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsx(Qe,{className:"text-white",children:"亮点标签"}),e.jsx(bt,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),e.jsxs(we,{className:"space-y-3",children:[r.highlights.map((C,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(oe,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:C,onChange:b=>j(E,b.target.value),placeholder:"5年私域运营经验"}),e.jsx(J,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>N(E),children:e.jsx(ms,{className:"w-4 h-4"})})]},E)),e.jsxs(J,{variant:"outline",size:"sm",onClick:T,className:"border-gray-600 text-gray-400",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}function y3(){const[r,a]=h.useState([]),[l,i]=h.useState(0),[c,d]=h.useState(1),[m]=h.useState(10),[f,p]=h.useState(0),[y,g]=h.useState(""),v=_u(y,300),[k,P]=h.useState(!0),[T,N]=h.useState(null),[j,C]=h.useState(!1),[E,b]=h.useState(null),[R,G]=h.useState(""),[X,D]=h.useState(""),[I,w]=h.useState(""),[V,se]=h.useState("admin"),[ie,Y]=h.useState("active"),[ne,_]=h.useState(!1);async function Q(){var z;P(!0),N(null);try{const O=new URLSearchParams({page:String(c),pageSize:String(m)});v.trim()&&O.set("search",v.trim());const ee=await Oe(`/api/admin/users?${O}`);ee!=null&&ee.success?(a(ee.records||[]),i(ee.total??0),p(ee.totalPages??0)):N(ee.error||"加载失败")}catch(O){const ee=O;N(ee.status===403?"无权限访问":((z=ee==null?void 0:ee.data)==null?void 0:z.error)||"加载失败"),a([])}finally{P(!1)}}h.useEffect(()=>{Q()},[c,m,v]);const ue=()=>{b(null),G(""),D(""),w(""),se("admin"),Y("active"),C(!0)},L=z=>{b(z),G(z.username),D(""),w(z.name||""),se(z.role==="super_admin"?"super_admin":"admin"),Y(z.status==="disabled"?"disabled":"active"),C(!0)},re=async()=>{var z;if(!R.trim()){N("用户名不能为空");return}if(!E&&!X){N("新建时密码必填,至少 6 位");return}if(X&&X.length<6){N("密码至少 6 位");return}N(null),_(!0);try{if(E){const O=await vt("/api/admin/users",{id:E.id,password:X||void 0,name:I.trim(),role:V,status:ie});O!=null&&O.success?(C(!1),Q()):N((O==null?void 0:O.error)||"保存失败")}else{const O=await ut("/api/admin/users",{username:R.trim(),password:X,name:I.trim(),role:V});O!=null&&O.success?(C(!1),Q()):N((O==null?void 0:O.error)||"保存失败")}}catch(O){const ee=O;N(((z=ee==null?void 0:ee.data)==null?void 0:z.error)||"保存失败")}finally{_(!1)}},H=async z=>{var O;if(confirm("确定删除该管理员?"))try{const ee=await Tr(`/api/admin/users?id=${z}`);ee!=null&&ee.success?Q():N((ee==null?void 0:ee.error)||"删除失败")}catch(ee){const K=ee;N(((O=K==null?void 0:K.data)==null?void 0:O.error)||"删除失败")}},A=z=>{if(!z)return"-";try{const O=new Date(z);return isNaN(O.getTime())?z:O.toLocaleString("zh-CN")}catch{return z}};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(bu,{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(oe,{placeholder:"搜索用户名/昵称",value:y,onChange:z=>g(z.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(J,{variant:"outline",size:"sm",onClick:Q,disabled:k,className:"border-gray-600 text-gray-300",children:e.jsx(Be,{className:`w-4 h-4 ${k?"animate-spin":""}`})}),e.jsxs(J,{onClick:ue,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{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:()=>N(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:k?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户名"}),e.jsx(je,{className:"text-gray-400",children:"昵称"}),e.jsx(je,{className:"text-gray-400",children:"角色"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(ps,{children:[r.map(z=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(ge,{className:"text-gray-300",children:z.id}),e.jsx(ge,{className:"text-white font-medium",children:z.username}),e.jsx(ge,{className:"text-gray-400",children:z.name||"-"}),e.jsx(ge,{children:e.jsx(Le,{variant:"outline",className:z.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:z.role==="super_admin"?"超级管理员":"管理员"})}),e.jsx(ge,{children:e.jsx(Le,{variant:"outline",className:z.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:z.status==="active"?"正常":"已禁用"})}),e.jsx(ge,{className:"text-gray-500 text-sm",children:A(z.createdAt)}),e.jsxs(ge,{className:"text-right",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>L(z),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>H(z.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]},z.id)),r.length===0&&!k&&e.jsx(et,{children:e.jsx(ge,{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(Qs,{page:c,pageSize:m,total:l,totalPages:f,onPageChange:d})})]})})}),e.jsx(Ct,{open:j,onOpenChange:C,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(kt,{children:e.jsx(Et,{className:"text-white",children:E?"编辑管理员":"新增管理员"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"用户名"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:R,onChange:z=>G(z.target.value),disabled:!!E}),E&&e.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:E?"新密码(留空不改)":"密码"}),e.jsx(oe,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:E?"留空表示不修改":"至少 6 位",value:X,onChange:z=>D(z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:I,onChange:z=>w(z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:V,onChange:z=>se(z.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"admin",children:"管理员"}),e.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),E&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"状态"}),e.jsxs("select",{value:ie,onChange:z=>Y(z.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(J,{variant:"outline",onClick:()=>C(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:re,disabled:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),ne?"保存中...":"保存"]})]})]})})]})}const v3={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},b3={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},j3={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...b3}},N3={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},w3=["system","author","admin"];function S3(){const[r,a]=Wx(),l=r.get("tab")??"system",i=w3.includes(l)?l:"system",[c,d]=h.useState(j3),[m,f]=h.useState(N3),[p,y]=h.useState(v3),[g,v]=h.useState(!1),[k,P]=h.useState(!0),[T,N]=h.useState(!1),[j,C]=h.useState(""),[E,b]=h.useState(""),[R,G]=h.useState(!1),[X,D]=h.useState(!1),I=(Y,ne,_=!1)=>{C(Y),b(ne),G(_),N(!0)};h.useEffect(()=>{(async()=>{try{const ne=await Oe("/api/admin/settings");if(!ne||ne.success===!1)return;if(ne.featureConfig&&Object.keys(ne.featureConfig).length&&f(_=>({..._,...ne.featureConfig})),ne.mpConfig&&typeof ne.mpConfig=="object"&&y(_=>({..._,...ne.mpConfig})),ne.siteSettings&&typeof ne.siteSettings=="object"){const _=ne.siteSettings;d(Q=>({...Q,...typeof _.sectionPrice=="number"&&{sectionPrice:_.sectionPrice},...typeof _.baseBookPrice=="number"&&{baseBookPrice:_.baseBookPrice},...typeof _.distributorShare=="number"&&{distributorShare:_.distributorShare},..._.authorInfo&&typeof _.authorInfo=="object"&&{authorInfo:{...Q.authorInfo,..._.authorInfo}}}))}}catch(ne){console.error("Load settings error:",ne)}finally{P(!1)}})()},[]);const w=async(Y,ne)=>{D(!0);try{const _=await ut("/api/admin/settings",{featureConfig:Y});if(!_||_.success===!1){ne(),I("保存失败",(_==null?void 0:_.error)??"未知错误",!0);return}I("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(_){console.error("Save feature config error:",_),ne(),I("保存失败",_ instanceof Error?_.message:String(_),!0)}finally{D(!1)}},V=(Y,ne)=>{const _=m,Q={..._,[Y]:ne};f(Q),w(Q,()=>f(_))},se=async()=>{v(!0);try{const Y=await ut("/api/admin/settings",{featureConfig:m,siteSettings:{sectionPrice:c.sectionPrice,baseBookPrice:c.baseBookPrice,distributorShare:c.distributorShare,authorInfo:c.authorInfo},mpConfig:{...p,appId:p.appId||"",withdrawSubscribeTmplId:p.withdrawSubscribeTmplId||"",mchId:p.mchId||"",minWithdraw:typeof p.minWithdraw=="number"?p.minWithdraw:10}});if(!Y||Y.success===!1){I("保存失败",(Y==null?void 0:Y.error)??"未知错误",!0);return}I("已保存","设置已保存成功。")}catch(Y){console.error("Save settings error:",Y),I("保存失败",Y instanceof Error?Y.message:String(Y),!0)}finally{v(!1)}},ie=Y=>{a(Y==="system"?{}:{tab:Y})};return k?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:"配置全站基础参数与开关"})]}),i==="system"&&e.jsxs(J,{onClick:se,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存设置"]})]}),e.jsxs($l,{value:i,onValueChange:ie,className:"w-full",children:[e.jsxs(Ba,{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(Un,{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(Cd,{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(bu,{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(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Cd,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),e.jsx(bt,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Cd,{className:"w-3 h-3"}),"主理人名称"]}),e.jsx(oe,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.name??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,name:Y.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(oo,{className:"w-3 h-3"}),"开播日期"]}),e.jsx(oe,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:c.authorInfo.startDate??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,startDate:Y.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(oo,{className:"w-3 h-3"}),"直播时间"]}),e.jsx(oe,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:c.authorInfo.liveTime??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,liveTime:Y.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Jx,{className:"w-3 h-3"}),"直播平台"]}),e.jsx(oe,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:c.authorInfo.platform??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,platform:Y.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(qs,{className:"w-3 h-3"}),"简介描述"]}),e.jsx(oe,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.description??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,description:Y.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),e.jsx(un,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:c.authorInfo.bio??"",onChange:Y=>d(ne=>({...ne,authorInfo:{...ne.authorInfo,bio:Y.target.value}}))})]}),e.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-[#00CED1] to-[#20B2AA] flex items-center justify-center text-xl font-bold text-white",children:(c.authorInfo.name??"K").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-semibold",children:c.authorInfo.name}),e.jsx("p",{className:"text-gray-400 text-xs",children:c.authorInfo.description}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",c.authorInfo.liveTime," · ",c.authorInfo.platform]})]})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(co,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),e.jsx(we,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单节价格 (元)"}),e.jsx(oe,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.sectionPrice,onChange:Y=>d(ne=>({...ne,sectionPrice:Number.parseFloat(Y.target.value)||1}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"整本价格 (元)"}),e.jsx(oe,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.baseBookPrice,onChange:Y=>d(ne=>({...ne,baseBookPrice:Number.parseFloat(Y.target.value)||9.9}))})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Al,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),e.jsx(bt,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),e.jsx(we,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"小程序 AppID"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:p.appId??"",onChange:Y=>y(ne=>({...ne,appId:Y.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提现订阅模板 ID"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:p.withdrawSubscribeTmplId??"",onChange:Y=>y(ne=>({...ne,withdrawSubscribeTmplId:Y.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"微信支付商户号"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:p.mchId??"",onChange:Y=>y(ne=>({...ne,mchId:Y.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最低提现金额 (元)"}),e.jsx(oe,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.minWithdraw??10,onChange:Y=>y(ne=>({...ne,minWithdraw:Number.parseFloat(Y.target.value)||10}))})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Un,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),e.jsx(bt,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Kt,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),e.jsx(ot,{id:"match-enabled",checked:m.matchEnabled,disabled:X,onCheckedChange:Y=>V("matchEnabled",Y)})]}),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(bj,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),e.jsx(ot,{id:"referral-enabled",checked:m.referralEnabled,disabled:X,onCheckedChange:Y=>V("referralEnabled",Y)})]}),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(qs,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),e.jsx(ot,{id:"search-enabled",checked:m.searchEnabled,disabled:X,onCheckedChange:Y=>V("searchEnabled",Y)})]}),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(Un,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),e.jsx(ot,{id:"about-enabled",checked:m.aboutEnabled,disabled:X,onCheckedChange:Y=>V("aboutEnabled",Y)})]})]}),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(g3,{})}),e.jsx(Ot,{value:"admin",className:"mt-0",children:e.jsx(y3,{})})]}),e.jsx(Ct,{open:T,onOpenChange:N,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[e.jsxs(kt,{children:[e.jsx(Et,{className:R?"text-red-400":"text-[#38bdac]",children:j}),e.jsx(m2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:E})]}),e.jsx(Dt,{className:"mt-4",children:e.jsx(J,{onClick:()=>N(!1),className:R?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const wx={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 C3(){const[r,a]=h.useState(!1),[l,i]=h.useState(wx),[c,d]=h.useState(""),m=async()=>{a(!0);try{const C=await Oe("/api/config");C!=null&&C.paymentMethods&&i({...wx,...C.paymentMethods})}catch(C){console.error(C)}finally{a(!1)}};h.useEffect(()=>{m()},[]);const f=async()=>{a(!0);try{await ut("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(C){console.error("保存失败:",C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}finally{a(!1)}},p=(C,E)=>{navigator.clipboard.writeText(C),d(E),setTimeout(()=>d(""),2e3)},y=(C,E)=>{i(b=>({...b,wechat:{...b.wechat,[C]:E}}))},g=(C,E)=>{i(b=>({...b,alipay:{...b.alipay,[C]:E}}))},v=(C,E)=>{i(b=>({...b,usdt:{...b.usdt,[C]:E}}))},k=(C,E)=>{i(b=>({...b,paypal:{...b.paypal,[C]:E}}))},P=l.wechat,T=l.alipay,N=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(J,{variant:"outline",onClick:m,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"同步配置"]}),e.jsxs(J,{onClick:f,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{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(Gx,{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($l,{defaultValue:"wechat",className:"space-y-6",children:[e.jsxs(Ba,{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(Al,{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($f,{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(Ff,{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(qd,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),e.jsx(Ot,{value:"wechat",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Qe,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Al,{className:"w-5 h-5"}),"微信支付配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(ot,{checked:!!P.enabled,onCheckedChange:C=>y("enabled",C)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"网站AppID"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:C=>y("websiteAppId",C.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"商户号"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.merchantId??""),onChange:C=>y("merchantId",C.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(hn,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"微信收款码/支付链接"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(P.qrCode??""),onChange:C=>y("qrCode",C.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),e.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[e.jsx(te,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),e.jsx(oe,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(P.groupQrCode??""),onChange:C=>y("groupQrCode",C.target.value)}),e.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),e.jsx(Ot,{value:"alipay",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Qe,{className:"text-[#1677FF] flex items-center gap-2",children:[e.jsx($f,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(bt,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(ot,{checked:!!T.enabled,onCheckedChange:C=>g("enabled",C)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"合作者身份 (PID)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.partnerId??""),onChange:C=>g("partnerId",C.target.value)}),e.jsx(J,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>p(String(T.partnerId??""),"pid"),children:c==="pid"?e.jsx(wo,{className:"w-4 h-4 text-green-500"}):e.jsx(Qx,{className:"w-4 h-4 text-gray-400"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"安全校验码 (Key)"}),e.jsx(oe,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.securityKey??""),onChange:C=>g("securityKey",C.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(hn,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(T.qrCode??""),onChange:C=>g("qrCode",C.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),e.jsx(Ot,{value:"usdt",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Qe,{className:"text-[#26A17B] flex items-center gap-2",children:[e.jsx(Ff,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(ot,{checked:!!N.enabled,onCheckedChange:C=>v("enabled",C)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"网络类型"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(N.network??"TRC20"),onChange:C=>v("network",C.target.value),children:[e.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),e.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),e.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"收款地址"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(N.address??""),onChange:C=>v("address",C.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(oe,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(N.exchangeRate)??7.2,onChange:C=>v("exchangeRate",Number.parseFloat(C.target.value)||7.2)})]})]})]})}),e.jsx(Ot,{value:"paypal",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Qe,{className:"text-[#169BD7] flex items-center gap-2",children:[e.jsx(qd,{className:"w-5 h-5"}),"PayPal配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(ot,{checked:!!j.enabled,onCheckedChange:C=>k("enabled",C)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"PayPal邮箱"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(j.email??""),onChange:C=>k("email",C.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(oe,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(j.exchangeRate)??7.2,onChange:C=>k("exchangeRate",Number(C.target.value)||7.2)})]})]})]})})]})]})}const k3={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},E3={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},P3={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function T3(){const[r,a]=h.useState({siteConfig:{...k3},menuConfig:{...E3},pageConfig:{...P3}}),[l,i]=h.useState(!1),[c,d]=h.useState(!1);h.useEffect(()=>{Oe("/api/config").then(g=>{g!=null&&g.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...g.siteConfig}})),g!=null&&g.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...g.menuConfig}})),g!=null&&g.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...g.pageConfig}}))}).catch(console.error)},[]);const m=async()=>{d(!0);try{await ut("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await ut("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await ut("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),i(!0),setTimeout(()=>i(!1),2e3),alert("配置已保存")}catch(g){console.error(g),alert("保存失败: "+(g instanceof Error?g.message:String(g)))}finally{d(!1)}},f=r.siteConfig,p=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(J,{onClick:m,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(qd,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),e.jsx(bt,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),e.jsx(oe,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteName??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),e.jsx(oe,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteTitle??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),e.jsx(oe,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteDescription??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:g.target.value}}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),e.jsx(oe,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:f.logo??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),e.jsx(oe,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:f.favicon??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:g.target.value}}))})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Qj,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),e.jsx(bt,{className:"text-gray-400",children:"配置网站主题色"})]}),e.jsx(we,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(te,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(oe,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:f.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:f.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))})]})]}),e.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:f.primaryColor??"#00CED1"},children:"预览"})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Wj,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),e.jsx(bt,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),e.jsx(we,{className:"space-y-4",children:Object.entries(p).map(([g,v])=>e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx(ot,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:k=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,enabled:k}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:g}),e.jsx(oe,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:k=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,label:k.target.value}}}))})]}),e.jsx("span",{className:`text-sm ${v!=null&&v.enabled?"text-green-400":"text-gray-500"}`,children:v!=null&&v.enabled?"显示":"隐藏"})]},g))})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(gj,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首页标题"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首页副标题"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeSubtitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目录页标题"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.chaptersTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配页标题"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.matchTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"我的页标题"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.myTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"关于作者标题"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.aboutTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:g.target.value}}))})]})]})]})]})]})]})}function R3(){const[r,a]=h.useState(""),[l,i]=h.useState(""),[c,d]=h.useState(""),[m,f]=h.useState({}),p=async()=>{var P,T,N,j;try{const C=await Oe("/api/config"),E=(T=(P=C==null?void 0:C.liveQRCodes)==null?void 0:P[0])==null?void 0:T.urls;Array.isArray(E)&&a(E.join(` -`));const b=(j=(N=C==null?void 0:C.paymentMethods)==null?void 0:N.wechat)==null?void 0:j.groupQrCode;b&&i(b),f({paymentMethods:C==null?void 0:C.paymentMethods,liveQRCodes:C==null?void 0:C.liveQRCodes})}catch(C){console.error(C)}};h.useEffect(()=>{p()},[]);const y=(P,T)=>{navigator.clipboard.writeText(P),d(T),setTimeout(()=>d(""),2e3)},g=async()=>{try{const P=r.split(` -`).map(N=>N.trim()).filter(Boolean),T=[...m.liveQRCodes||[]];T[0]?T[0].urls=P:T.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await ut("/api/db/config",{key:"live_qr_codes",value:T,description:"群活码配置"}),alert("群活码配置已保存!"),await p()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},v=async()=>{var P;try{await ut("/api/db/config",{key:"payment_methods",value:{...m.paymentMethods||{},wechat:{...((P=m.paymentMethods)==null?void 0:P.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await p()}catch(T){console.error(T),alert("保存失败: "+(T instanceof Error?T.message:String(T)))}},k=()=>{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(Gx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),e.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[e.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:"访问草料二维码创建活码"}),e.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),e.jsx("li",{children:"复制生成的短链接填入下方配置"}),e.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),e.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),e.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Vf,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),e.jsx(bt,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Uf,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(oe,{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=>i(P.target.value)}),e.jsx(J,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>y(l,"group"),children:c==="group"?e.jsx(wo,{className:"w-4 h-4 text-green-500"}):e.jsx(Qx,{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(hn,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(J,{onClick:v,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[e.jsx(uo,{className:"w-4 h-4 mr-2"}),"保存配置"]}),e.jsxs(J,{onClick:k,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[e.jsx(hn,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Vf,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),e.jsx(bt,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Uf,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),e.jsx(un,{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(J,{onClick:g,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(uo,{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 Sx={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}},I3=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function _3(){const[r,a]=h.useState(Sx),[l,i]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(!1),[p,y]=h.useState(null),[g,v]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),k=async()=>{i(!0);try{const b=await Oe("/api/db/config/full?key=match_config"),R=(b==null?void 0:b.data)??(b==null?void 0:b.config);R&&a({...Sx,...R})}catch(b){console.error("加载匹配配置失败:",b)}finally{i(!1)}};h.useEffect(()=>{k()},[]);const P=async()=>{d(!0);try{const b=await ut("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});b&&b.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(b&&typeof b=="object"&&"error"in b?b.error:"未知错误"))}catch(b){console.error("保存配置失败:",b),alert("保存失败")}finally{d(!1)}},T=b=>{y(b),v({id:b.id,label:b.label,matchLabel:b.matchLabel,icon:b.icon,matchFromDB:b.matchFromDB,showJoinAfterMatch:b.showJoinAfterMatch,price:b.price,enabled:b.enabled}),f(!0)},N=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},j=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const b=[...r.matchTypes];if(p){const R=b.findIndex(G=>G.id===p.id);R!==-1&&(b[R]={...g})}else{if(b.some(R=>R.id===g.id)){alert("类型ID已存在");return}b.push({...g})}a({...r,matchTypes:b}),f(!1)},C=b=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(R=>R.id!==b)})},E=b=>{a({...r,matchTypes:r.matchTypes.map(R=>R.id===b?{...R,enabled:!R.enabled}:R)})};return e.jsxs("div",{className:"p-8 w-full space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Un,{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(J,{variant:"outline",onClick:k,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),e.jsxs(J,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(ln,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(we,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(oe,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:b=>a({...r,freeMatchLimit:parseInt(b.target.value,10)||0})}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(oe,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:b=>a({...r,matchPrice:parseFloat(b.target.value)||1})}),e.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(oe,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:b=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(b.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(ot,{checked:r.settings.enableFreeMatches,onCheckedChange:b=>a({...r,settings:{...r.settings,enableFreeMatches:b}})}),e.jsx(te,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:r.settings.enablePaidMatches,onCheckedChange:b=>a({...r,settings:{...r.settings,enablePaidMatches:b}})}),e.jsx(te,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),e.jsx(bt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(J,{onClick:N,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),e.jsx(we,{children:e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"图标"}),e.jsx(je,{className:"text-gray-400",children:"类型ID"}),e.jsx(je,{className:"text-gray-400",children:"显示名称"}),e.jsx(je,{className:"text-gray-400",children:"匹配标签"}),e.jsx(je,{className:"text-gray-400",children:"价格"}),e.jsx(je,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(ps,{children:r.matchTypes.map(b=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{children:e.jsx("span",{className:"text-2xl",children:b.icon})}),e.jsx(ge,{className:"font-mono text-gray-300",children:b.id}),e.jsx(ge,{className:"text-white font-medium",children:b.label}),e.jsx(ge,{className:"text-gray-300",children:b.matchLabel}),e.jsx(ge,{children:e.jsxs(Le,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",b.price]})}),e.jsx(ge,{children:b.matchFromDB?e.jsx(Le,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Le,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(ge,{children:e.jsx(ot,{checked:b.enabled,onCheckedChange:()=>E(b.id)})}),e.jsx(ge,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>T(b),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>C(b.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Ht,{className:"w-4 h-4"})})]})})]},b.id))})]})})]}),e.jsx(Ct,{open:m,onOpenChange:f,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[p?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Rt,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:b=>v({...g,id:b.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:I3.map(b=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===b?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:b}),children:b},b))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:g.label,onChange:b=>v({...g,label:b.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:g.matchLabel,onChange:b=>v({...g,matchLabel:b.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(oe,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:b=>v({...g,price:parseFloat(b.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(ot,{checked:g.matchFromDB,onCheckedChange:b=>v({...g,matchFromDB:b})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:g.showJoinAfterMatch,onCheckedChange:b=>v({...g,showJoinAfterMatch:b})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:g.enabled,onCheckedChange:b=>v({...g,enabled:b})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>f(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(J,{onClick:j,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const Cx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function M3(){const[r,a]=h.useState([]),[l,i]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(""),[g,v]=h.useState(!0),[k,P]=h.useState(null);async function T(){v(!0),P(null);try{const j=new URLSearchParams({page:String(c),pageSize:String(m)});p&&j.set("matchType",p);const C=await Oe(`/api/db/match-records?${j}`);C!=null&&C.success?(a(C.records||[]),i(C.total??0)):P("加载匹配记录失败")}catch(j){console.error("加载匹配记录失败",j),P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{T()},[c,p]);const N=Math.ceil(l/m)||1;return e.jsxs("div",{className:"p-8 w-full",children:[k&&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:k}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:j=>{y(j.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(Cx).map(([j,C])=>e.jsx("option",{value:j,children:C},j))]}),e.jsxs("button",{type:"button",onClick:T,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx(Be,{className:`w-4 h-4 ${g?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(ps,{children:[r.map(j=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{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:C=>{C.currentTarget.style.display="none";const E=C.currentTarget.nextElementSibling;E&&E.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(ge,{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:C=>{C.currentTarget.style.display="none";const E=C.currentTarget.nextElementSibling;E&&E.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(ge,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Cx[j.matchType]||j.matchType})}),e.jsxs(ge,{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(ge,{className:"text-gray-400",children:j.createdAt?new Date(j.createdAt).toLocaleString():"-"})]},j.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:N,total:l,pageSize:m,onPageChange:d,onPageSizeChange:j=>{f(j),d(1)}})]})})})]})}function A3(){const[r,a]=h.useState([]),[l,i]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(null),[p,y]=h.useState(""),[g,v]=h.useState(0),[k,P]=h.useState(!1);async function T(){i(!0);try{const b=await Oe("/api/db/vip-roles");b!=null&&b.success&&b.data&&a(b.data)}catch(b){console.error("Load roles error:",b)}finally{i(!1)}}h.useEffect(()=>{T()},[]);const N=()=>{f(null),y(""),v(r.length>0?Math.max(...r.map(b=>b.sort))+1:0),d(!0)},j=b=>{f(b),y(b.name),v(b.sort),d(!0)},C=async()=>{if(!p.trim()){alert("角色名称不能为空");return}P(!0);try{if(m){const b=await vt("/api/db/vip-roles",{id:m.id,name:p.trim(),sort:g});b!=null&&b.success?(d(!1),T()):alert("更新失败: "+(b==null?void 0:b.error))}else{const b=await ut("/api/db/vip-roles",{name:p.trim(),sort:g});b!=null&&b.success?(d(!1),T()):alert("新增失败: "+(b==null?void 0:b.error))}}catch(b){console.error("Save error:",b),alert("保存失败")}finally{P(!1)}},E=async b=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const R=await Tr(`/api/db/vip-roles?id=${b}`);R!=null&&R.success?T():alert("删除失败: "+(R==null?void 0:R.error))}catch(R){console.error("Delete error:",R),alert("删除失败")}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),e.jsxs(J,{onClick:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"角色名称"}),e.jsx(je,{className:"text-gray-400",children:"排序"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(ps,{children:[r.map(b=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(ge,{className:"text-gray-300",children:b.id}),e.jsx(ge,{className:"text-white",children:b.name}),e.jsx(ge,{className:"text-gray-400",children:b.sort}),e.jsxs(ge,{className:"text-right",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>j(b),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>E(b.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]},b.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),e.jsx(Ct,{open:c,onOpenChange:d,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(kt,{children:e.jsx(Et,{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(te,{className:"text-gray-300",children:"角色名称"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:p,onChange:b=>y(b.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),e.jsx(oe,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:g,onChange:b=>v(parseInt(b.target.value,10)||0)})]})]}),e.jsxs(Dt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:C,disabled:k,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),k?"保存中...":"保存"]})]})]})})]})}function Ag({embedded:r=!1}){const[a,l]=h.useState([]),[i,c]=h.useState(!0),[d,m]=h.useState(!1),[f,p]=h.useState(null),[y,g]=h.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[v,k]=h.useState(!1),[P,T]=h.useState(!1),N=h.useRef(null),j=async I=>{var V;const w=(V=I.target.files)==null?void 0:V[0];if(w){T(!0);try{const se=new FormData;se.append("file",w),se.append("folder","mentors");const ie=Nu(),Y={};ie&&(Y.Authorization=`Bearer ${ie}`);const _=await(await fetch(Da("/api/upload"),{method:"POST",body:se,credentials:"include",headers:Y})).json();_!=null&&_.success&&(_!=null&&_.url)?g(Q=>({...Q,avatar:_.url})):alert("上传失败: "+((_==null?void 0:_.error)||"未知错误"))}catch(se){console.error(se),alert("上传失败")}finally{T(!1),N.current&&(N.current.value="")}}};async function C(){c(!0);try{const I=await Oe("/api/db/mentors");I!=null&&I.success&&I.data&&l(I.data)}catch(I){console.error("Load mentors error:",I)}finally{c(!1)}}h.useEffect(()=>{C()},[]);const E=()=>{g({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:a.length>0?Math.max(...a.map(I=>I.sort))+1:0,enabled:!0})},b=()=>{p(null),E(),m(!0)},R=I=>{p(I),g({name:I.name,avatar:I.avatar||"",intro:I.intro||"",tags:I.tags||"",priceSingle:I.priceSingle!=null?String(I.priceSingle):"",priceHalfYear:I.priceHalfYear!=null?String(I.priceHalfYear):"",priceYear:I.priceYear!=null?String(I.priceYear):"",quote:I.quote||"",whyFind:I.whyFind||"",offering:I.offering||"",judgmentStyle:I.judgmentStyle||"",sort:I.sort,enabled:I.enabled??!0}),m(!0)},G=async()=>{if(!y.name.trim()){alert("导师姓名不能为空");return}k(!0);try{const I=V=>V===""?void 0:parseFloat(V),w={name:y.name.trim(),avatar:y.avatar.trim()||void 0,intro:y.intro.trim()||void 0,tags:y.tags.trim()||void 0,priceSingle:I(y.priceSingle),priceHalfYear:I(y.priceHalfYear),priceYear:I(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 V=await vt("/api/db/mentors",{id:f.id,...w});V!=null&&V.success?(m(!1),C()):alert("更新失败: "+(V==null?void 0:V.error))}else{const V=await ut("/api/db/mentors",w);V!=null&&V.success?(m(!1),C()):alert("新增失败: "+(V==null?void 0:V.error))}}catch(I){console.error("Save error:",I),alert("保存失败")}finally{k(!1)}},X=async I=>{if(confirm("确定删除该导师?"))try{const w=await Tr(`/api/db/mentors?id=${I}`);w!=null&&w.success?C():alert("删除失败: "+(w==null?void 0:w.error))}catch(w){console.error("Delete error:",w),alert("删除失败")}},D=I=>I!=null?`¥${I}`:"-";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(Kt,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),e.jsxs(J,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:i?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"姓名"}),e.jsx(je,{className:"text-gray-400",children:"简介"}),e.jsx(je,{className:"text-gray-400",children:"单次"}),e.jsx(je,{className:"text-gray-400",children:"半年"}),e.jsx(je,{className:"text-gray-400",children:"年度"}),e.jsx(je,{className:"text-gray-400",children:"排序"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(ps,{children:[a.map(I=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(ge,{className:"text-gray-300",children:I.id}),e.jsx(ge,{className:"text-white",children:I.name}),e.jsx(ge,{className:"text-gray-400 max-w-[200px] truncate",children:I.intro||"-"}),e.jsx(ge,{className:"text-gray-400",children:D(I.priceSingle)}),e.jsx(ge,{className:"text-gray-400",children:D(I.priceHalfYear)}),e.jsx(ge,{className:"text-gray-400",children:D(I.priceYear)}),e.jsx(ge,{className:"text-gray-400",children:I.sort}),e.jsxs(ge,{className:"text-right",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>R(I),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>X(I.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]},I.id)),a.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),e.jsx(Ct,{open:d,onOpenChange:m,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx(kt,{children:e.jsx(Et,{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(te,{className:"text-gray-300",children:"姓名 *"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:y.name,onChange:I=>g(w=>({...w,name:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(oe,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:y.sort,onChange:I=>g(w=>({...w,sort:parseInt(I.target.value,10)||0}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"头像"}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(oe,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:y.avatar,onChange:I=>g(w=>({...w,avatar:I.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:N,type:"file",accept:"image/*",className:"hidden",onChange:j}),e.jsxs(J,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:P,onClick:()=>{var I;return(I=N.current)==null?void 0:I.click()},children:[e.jsx(uo,{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:Da(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(te,{className:"text-gray-300",children:"简介"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:y.intro,onChange:I=>g(w=>({...w,intro:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:y.tags,onChange:I=>g(w=>({...w,tags:I.target.value}))})]}),e.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[e.jsx(te,{className:"text-gray-300 block mb-2",children:"价格配置(每个导师独立)"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),e.jsx(oe,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:y.priceSingle,onChange:I=>g(w=>({...w,priceSingle:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),e.jsx(oe,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:y.priceHalfYear,onChange:I=>g(w=>({...w,priceHalfYear:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),e.jsx(oe,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:y.priceYear,onChange:I=>g(w=>({...w,priceYear:I.target.value}))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"引言"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:y.quote,onChange:I=>g(w=>({...w,quote:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"为什么找(文本)"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:y.whyFind,onChange:I=>g(w=>({...w,whyFind:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提供什么(文本)"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:y.offering,onChange:I=>g(w=>({...w,offering:I.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:y.judgmentStyle,onChange:I=>g(w=>({...w,judgmentStyle:I.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:y.enabled,onChange:I=>g(w=>({...w,enabled:I.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),e.jsx(te,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),e.jsxs(Dt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:G,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})})]})}function D3(){const[r,a]=h.useState([]),[l,i]=h.useState(!0),[c,d]=h.useState("");async function m(){i(!0);try{const y=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",g=await Oe(y);g!=null&&g.success&&g.data&&a(g.data)}catch(y){console.error("Load consultations error:",y)}finally{i(!1)}}h.useEffect(()=>{m()},[c]);const f={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},p={single:"单次",half_year:"半年",year:"年度"};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(oo,{className:"w-5 h-5 text-[#38bdac]"}),"导师预约列表"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师咨询预约记录"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:y=>d(y.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(f).map(([y,g])=>e.jsx("option",{value:y,children:g},y))]}),e.jsxs(J,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户ID"}),e.jsx(je,{className:"text-gray-400",children:"导师ID"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(ps,{children:[r.map(y=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(ge,{className:"text-gray-300",children:y.id}),e.jsx(ge,{className:"text-gray-400",children:y.userId}),e.jsx(ge,{className:"text-gray-400",children:y.mentorId}),e.jsx(ge,{className:"text-gray-400",children:p[y.consultationType]||y.consultationType}),e.jsxs(ge,{className:"text-white",children:["¥",y.amount]}),e.jsx(ge,{className:"text-gray-400",children:f[y.status]||y.status}),e.jsx(ge,{className:"text-gray-500 text-sm",children:y.createdAt})]},y.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const Rl={poolSource:["vip"],requirePhone:!0,requireNickname:!0,requireAvatar:!1,requireBusiness:!1},kx={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:Rl},L3=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function O3(){const r=yn(),[a,l]=h.useState(kx),[i,c]=h.useState(!0),[d,m]=h.useState(!1),[f,p]=h.useState(!1),[y,g]=h.useState(null),[v,k]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),[P,T]=h.useState(null),[N,j]=h.useState(!1),C=async()=>{j(!0);try{const w=await Oe("/api/db/match-pool-counts");w!=null&&w.success&&w.data&&T(w.data)}catch(w){console.error("加载池子人数失败:",w)}finally{j(!1)}},E=async()=>{c(!0);try{const w=await Oe("/api/db/config/full?key=match_config"),V=(w==null?void 0:w.data)??(w==null?void 0:w.config);if(V){let se=V.poolSettings??Rl;se.poolSource&&!Array.isArray(se.poolSource)&&(se={...se,poolSource:[se.poolSource]}),l({...kx,...V,poolSettings:se})}}catch(w){console.error("加载匹配配置失败:",w)}finally{c(!1)}};h.useEffect(()=>{E(),C()},[]);const b=async()=>{m(!0);try{const w=await ut("/api/db/config",{key:"match_config",value:a,description:"匹配功能配置"});alert((w==null?void 0:w.success)!==!1?"配置保存成功!":"保存失败: "+((w==null?void 0:w.error)||"未知错误"))}catch(w){console.error(w),alert("保存失败")}finally{m(!1)}},R=w=>{g(w),k({...w}),p(!0)},G=()=>{g(null),k({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),p(!0)},X=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const w=[...a.matchTypes];if(y){const V=w.findIndex(se=>se.id===y.id);V!==-1&&(w[V]={...v})}else{if(w.some(V=>V.id===v.id)){alert("类型ID已存在");return}w.push({...v})}l({...a,matchTypes:w}),p(!1)},D=w=>{confirm("确定要删除这个匹配类型吗?")&&l({...a,matchTypes:a.matchTypes.filter(V=>V.id!==w)})},I=w=>{l({...a,matchTypes:a.matchTypes.map(V=>V.id===w?{...V,enabled:!V.enabled}:V)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsxs(J,{variant:"outline",onClick:E,disabled:i,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${i?"animate-spin":""}`})," 刷新"]}),e.jsxs(J,{onClick:b,disabled:d,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"})," ",d?"保存中...":"保存配置"]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(qx,{className:"w-5 h-5 text-blue-400"})," 匹配池选择"]}),e.jsx(bt,{className:"text-gray-400",children:"选择匹配的用户池和完善程度要求,只有满足条件的用户才可被匹配到"})]}),e.jsxs(we,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(te,{className:"text-gray-300",children:"匹配来源池"}),e.jsx("p",{className:"text-gray-500 text-xs",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(w=>{const V=a.poolSettings??Rl,ie=(Array.isArray(V.poolSource)?V.poolSource:[V.poolSource]).includes(w.value),Y=P==null?void 0:P[w.countKey],ne=()=>{const _=Array.isArray(V.poolSource)?[...V.poolSource]:[V.poolSource],Q=ie?_.filter(ue=>ue!==w.value):[..._,w.value];Q.length===0&&Q.push(w.value),l({...a,poolSettings:{...V,poolSource:Q}})};return e.jsxs("button",{type:"button",onClick:ne,className:`p-4 rounded-lg border text-left transition-all ${ie?"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("div",{className:`w-5 h-5 rounded border-2 flex items-center justify-center text-xs ${ie?"border-[#38bdac] bg-[#38bdac] text-white":"border-gray-600"}`,children:ie&&"✓"}),e.jsx("span",{className:"text-xl",children:w.icon}),e.jsx("span",{className:`text-sm font-medium ${ie?"text-[#38bdac]":"text-gray-300"}`,children:w.label})]}),e.jsxs("span",{className:"text-lg font-bold text-white",children:[N?"...":Y??"-",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:w.desc}),e.jsx("span",{role:"link",tabIndex:0,onClick:_=>{_.stopPropagation(),r(`/users?pool=${w.value}`)},onKeyDown:_=>{_.key==="Enter"&&(_.stopPropagation(),r(`/users?pool=${w.value}`))},className:"text-[#38bdac] text-xs mt-2 inline-block hover:underline cursor-pointer",children:"查看用户列表 →"})]},w.value)})})]}),e.jsxs("div",{className:"space-y-3 pt-4 border-t border-gray-700/50",children:[e.jsx(te,{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(w=>{const se=(a.poolSettings??Rl)[w.key];return e.jsxs("div",{className:"flex items-center gap-3 bg-[#0a1628] rounded-lg p-3",children:[e.jsx(ot,{checked:se,onCheckedChange:ie=>l({...a,poolSettings:{...a.poolSettings??Rl,[w.key]:ie}})}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{children:w.icon}),e.jsx(te,{className:"text-gray-300 text-sm",children:w.label})]})]},w.key)})})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(ln,{className:"w-5 h-5 text-yellow-400"})," 基础设置"]}),e.jsx(bt,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(we,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(oe,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.freeMatchLimit,onChange:w=>l({...a,freeMatchLimit:parseInt(w.target.value,10)||0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(oe,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:a.matchPrice,onChange:w=>l({...a,matchPrice:parseFloat(w.target.value)||1})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(oe,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.settings.maxMatchesPerDay,onChange:w=>l({...a,settings:{...a.settings,maxMatchesPerDay:parseInt(w.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(ot,{checked:a.settings.enableFreeMatches,onCheckedChange:w=>l({...a,settings:{...a.settings,enableFreeMatches:w}})}),e.jsx(te,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:a.settings.enablePaidMatches,onCheckedChange:w=>l({...a,settings:{...a.settings,enablePaidMatches:w}})}),e.jsx(te,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Qe,{className:"text-white flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-[#38bdac]"})," 匹配类型管理"]}),e.jsx(bt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(J,{onClick:G,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-1"})," 添加类型"]})]}),e.jsx(we,{children:e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"图标"}),e.jsx(je,{className:"text-gray-400",children:"类型ID"}),e.jsx(je,{className:"text-gray-400",children:"显示名称"}),e.jsx(je,{className:"text-gray-400",children:"匹配标签"}),e.jsx(je,{className:"text-gray-400",children:"价格"}),e.jsx(je,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(ps,{children:a.matchTypes.map(w=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{children:e.jsx("span",{className:"text-2xl",children:w.icon})}),e.jsx(ge,{className:"font-mono text-gray-300",children:w.id}),e.jsx(ge,{className:"text-white font-medium",children:w.label}),e.jsx(ge,{className:"text-gray-300",children:w.matchLabel}),e.jsx(ge,{children:e.jsxs(Le,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",w.price]})}),e.jsx(ge,{children:w.matchFromDB?e.jsx(Le,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Le,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(ge,{children:e.jsx(ot,{checked:w.enabled,onCheckedChange:()=>I(w.id)})}),e.jsx(ge,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>R(w),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(mt,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>D(w.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Ht,{className:"w-4 h-4"})})]})})]},w.id))})]})})]}),e.jsx(Ct,{open:f,onOpenChange:p,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(kt,{children:e.jsxs(Et,{className:"text-white flex items-center gap-2",children:[y?e.jsx(mt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Rt,{className:"w-5 h-5 text-[#38bdac]"}),y?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:v.id,onChange:w=>k({...v,id:w.target.value}),disabled:!!y})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:L3.map(w=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${v.icon===w?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>k({...v,icon:w}),children:w},w))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:v.label,onChange:w=>k({...v,label:w.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:v.matchLabel,onChange:w=>k({...v,matchLabel:w.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(oe,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:v.price,onChange:w=>k({...v,price:parseFloat(w.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(ot,{checked:v.matchFromDB,onCheckedChange:w=>k({...v,matchFromDB:w})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:v.showJoinAfterMatch,onCheckedChange:w=>k({...v,showJoinAfterMatch:w})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:v.enabled,onCheckedChange:w=>k({...v,enabled:w})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>p(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(J,{onClick:X,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const Ex={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function F3(){const[r,a]=h.useState([]),[l,i]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(""),[g,v]=h.useState(!0),[k,P]=h.useState(null),[T,N]=h.useState(null);async function j(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(m)});p&&b.set("matchType",p);const R=await Oe(`/api/db/match-records?${b}`);R!=null&&R.success?(a(R.records||[]),i(R.total??0)):P("加载匹配记录失败")}catch{P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{j()},[c,p]);const C=Math.ceil(l/m)||1,E=({userId:b,nickname:R,avatar:G})=>e.jsxs("div",{className:"flex items-center gap-3 cursor-pointer group",onClick:()=>N(b),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:[G?e.jsx("img",{src:G,alt:"",className:"w-full h-full object-cover",onError:X=>{X.currentTarget.style.display="none"}}):null,e.jsx("span",{className:G?"hidden":"",children:(R||b||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white group-hover:text-[#38bdac] transition-colors",children:R||b}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b==null?void 0:b.slice(0,16),(b==null?void 0:b.length)>16?"...":""]})]})]});return e.jsxs("div",{children:[k&&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:k}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("p",{className:"text-gray-400",children:["共 ",l," 条匹配记录 · 点击用户名查看详情"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(Ex).map(([b,R])=>e.jsx("option",{value:b,children:R},b))]}),e.jsxs("button",{type:"button",onClick:j,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(Be,{className:`w-4 h-4 ${g?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(ps,{children:[r.map(b=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{children:e.jsx(E,{userId:b.userId,nickname:b.userNickname,avatar:b.userAvatar})}),e.jsx(ge,{children:b.matchedUserId?e.jsx(E,{userId:b.matchedUserId,nickname:b.matchedNickname,avatar:b.matchedUserAvatar}):e.jsx("span",{className:"text-gray-500",children:"—"})}),e.jsx(ge,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Ex[b.matchType]||b.matchType})}),e.jsxs(ge,{className:"text-sm",children:[b.phone&&e.jsxs("div",{className:"text-green-400",children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{className:"text-blue-400",children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&e.jsx("span",{className:"text-gray-600",children:"-"})]}),e.jsx(ge,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:C,total:l,pageSize:m,onPageChange:d,onPageSizeChange:b=>{f(b),d(1)}})]})})}),e.jsx(b0,{open:!!T,onClose:()=>N(null),userId:T,onUserUpdated:j})]})}function z3(){const[r,a]=h.useState("records");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",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:"匹配记录"}),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:"匹配池设置"})]}),r==="records"&&e.jsx(F3,{}),r==="pool"&&e.jsx(O3,{})]})}const Px={investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function $3(){const[r,a]=h.useState([]),[l,i]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(!0),[g,v]=h.useState("investor"),[k,P]=h.useState(null);async function T(){y(!0);try{const E=new URLSearchParams({page:String(c),pageSize:String(m),matchType:g}),b=await Oe(`/api/db/match-records?${E}`);b!=null&&b.success&&(a(b.records||[]),i(b.total??0))}catch(E){console.error(E)}finally{y(!1)}}h.useEffect(()=>{T()},[c,g]);const N=async E=>{if(!E.phone&&!E.wechatId){alert("该记录无联系方式,无法推送到存客宝");return}P(E.id);try{const b=await ut("/api/ckb/join",{type:E.matchType||"investor",phone:E.phone||"",wechat:E.wechatId||"",userId:E.userId,name:E.userNickname||""});alert((b==null?void 0:b.message)||(b!=null&&b.success?"推送成功":"推送失败"))}catch(b){alert("推送失败: "+(b instanceof Error?b.message:"网络错误"))}finally{P(null)}},j=Math.ceil(l/m)||1,C=E=>!!(E.phone||E.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:g,onChange:E=>{v(E.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:Object.entries(Px).map(([E,b])=>e.jsx("option",{value:E,children:b},E))}),e.jsxs(J,{onClick:T,disabled:p,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${p?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"时间"}),e.jsx(je,{className:"text-gray-400 text-right",children:"操作"})]})}),e.jsxs(ps,{children:[r.map(E=>{var b,R;return e.jsxs(et,{className:`border-gray-700/50 ${C(E)?"hover:bg-[#0a1628]":"opacity-60"}`,children:[e.jsx(ge,{className:"text-white",children:E.userNickname||((b=E.userId)==null?void 0:b.slice(0,12))}),e.jsx(ge,{className:"text-white",children:E.matchedNickname||((R=E.matchedUserId)==null?void 0:R.slice(0,12))}),e.jsx(ge,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Px[E.matchType]||E.matchType})}),e.jsxs(ge,{className:"text-sm",children:[E.phone&&e.jsxs("div",{className:"text-green-400",children:["📱 ",E.phone]}),E.wechatId&&e.jsxs("div",{className:"text-blue-400",children:["💬 ",E.wechatId]}),!E.phone&&!E.wechatId&&e.jsx("span",{className:"text-gray-600",children:"无联系方式"})]}),e.jsx(ge,{className:"text-gray-400 text-sm",children:E.createdAt?new Date(E.createdAt).toLocaleString():"-"}),e.jsx(ge,{className:"text-right",children:C(E)?e.jsxs(J,{size:"sm",onClick:()=>N(E),disabled:k===E.id,className:"bg-[#38bdac] hover:bg-[#2da396] text-white text-xs h-7 px-3",children:[e.jsx(iN,{className:"w-3 h-3 mr-1"}),k===E.id?"推送中...":"推送CKB"]}):e.jsx("span",{className:"text-gray-600 text-xs",children:"—"})})]},E.id)}),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:6,className:"text-center py-12 text-gray-500",children:"暂无记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:j,total:l,pageSize:m,onPageChange:d,onPageSizeChange:E=>{f(E),d(1)}})]})})})]})}const Tx={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},B3={single:"单次",half_year:"半年",year:"年度"};function U3(){const[r,a]=h.useState([]),[l,i]=h.useState(!0),[c,d]=h.useState("");async function m(){i(!0);try{const f=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",p=await Oe(f);p!=null&&p.success&&p.data&&a(p.data)}catch(f){console.error(f)}finally{i(!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=>d(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(Tx).map(([f,p])=>e.jsx("option",{value:f,children:p},f))]}),e.jsxs(J,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户ID"}),e.jsx(je,{className:"text-gray-400",children:"导师ID"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(ps,{children:[r.map(f=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(ge,{className:"text-gray-300",children:f.id}),e.jsx(ge,{className:"text-gray-400",children:f.userId}),e.jsx(ge,{className:"text-gray-400",children:f.mentorId}),e.jsx(ge,{className:"text-gray-400",children:B3[f.consultationType]||f.consultationType}),e.jsxs(ge,{className:"text-white",children:["¥",f.amount]}),e.jsx(ge,{className:"text-gray-400",children:Tx[f.status]||f.status}),e.jsx(ge,{className:"text-gray-500 text-sm",children:f.createdAt?new Date(f.createdAt).toLocaleString():"-"})]},f.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function V3(){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(U3,{}),r==="manage"&&e.jsx("div",{className:"-mx-8",children:e.jsx(Ag,{embedded:!0})})]})}function W3(){const[r,a]=h.useState([]),[l,i]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(!0);async function g(){y(!0);try{const k=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"team"}),P=await Oe(`/api/db/match-records?${k}`);P!=null&&P.success&&(a(P.records||[]),i(P.total??0))}catch(k){console.error(k)}finally{y(!1)}}h.useEffect(()=>{g()},[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:g,disabled:p,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx(Be,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{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(fs,{children:[e.jsx(xs,{children:e.jsxs(et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(ps,{children:[r.map(k=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(ge,{className:"text-white",children:k.userNickname||k.userId}),e.jsx(ge,{className:"text-white",children:k.matchedNickname||k.matchedUserId}),e.jsxs(ge,{className:"text-gray-400 text-sm",children:[k.phone&&e.jsxs("div",{children:["📱 ",k.phone]}),k.wechatId&&e.jsxs("div",{children:["💬 ",k.wechatId]}),!k.phone&&!k.wechatId&&"-"]}),e.jsx(ge,{className:"text-gray-400",children:k.createdAt?new Date(k.createdAt).toLocaleString():"-"})]},k.id)),r.length===0&&e.jsx(et,{children:e.jsx(ge,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无团队招募记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:v,total:l,pageSize:m,onPageChange:d,onPageSizeChange:k=>{f(k),d(1)}})]})})})]})}const Rx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},Ix={partner:"⭐",investor:"👥",mentor:"❤️",team:"🎮"};function H3({onSwitchTab:r,onOpenCKB:a}={}){const l=yn(),[i,c]=h.useState(null),[d,m]=h.useState(null),[f,p]=h.useState(!0),y=h.useCallback(async()=>{var v,k;p(!0);try{const[P,T]=await Promise.allSettled([Oe("/api/db/match-records?stats=true"),Oe("/api/db/ckb-plan-stats")]);if(P.status==="fulfilled"&&((v=P.value)!=null&&v.success)&&P.value.data){let N=P.value.data;if(N.totalMatches>0&&(!N.uniqueUsers||N.uniqueUsers===0))try{const j=await Oe("/api/db/match-records?page=1&pageSize=200");if(j!=null&&j.success&&j.records){const C=new Set(j.records.map(E=>E.userId).filter(Boolean));N={...N,uniqueUsers:C.size}}}catch{}c(N)}T.status==="fulfilled"&&((k=T.value)!=null&&k.success)&&T.value.data&&m(T.value.data)}catch(P){console.error("加载统计失败:",P)}finally{p(!1)}},[]);h.useEffect(()=>{y()},[y]);const g=v=>f?"—":String(v??0);return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-[#38bdac]"})," 找伙伴数据"]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-5",children:[e.jsx(Ne,{className:"bg-gradient-to-br from-[#0f2137] to-[#162d4a] border-gray-700/40 cursor-pointer hover:border-[#38bdac]/60 transition-all",onClick:()=>r==null?void 0:r("partner"),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"总匹配次数"}),e.jsx("p",{className:"text-4xl font-bold text-white",children:g(i==null?void 0:i.totalMatches)}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-3 flex items-center gap-1",children:[e.jsx(hn,{className:"w-3 h-3"})," 查看匹配记录"]})]})}),e.jsx(Ne,{className:"bg-gradient-to-br from-[#0f2137] to-[#162d4a] border-gray-700/40 cursor-pointer hover:border-yellow-500/60 transition-all",onClick:()=>r==null?void 0:r("partner"),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"今日匹配"}),e.jsx("p",{className:"text-4xl font-bold text-white",children:g(i==null?void 0:i.todayMatches)}),e.jsxs("p",{className:"text-yellow-400/60 text-xs mt-3 flex items-center gap-1",children:[e.jsx(ln,{className:"w-3 h-3"})," 今日实时"]})]})}),e.jsx(Ne,{className:"bg-gradient-to-br from-[#0f2137] to-[#162d4a] border-gray-700/40 cursor-pointer hover:border-blue-500/60 transition-all",onClick:()=>l("/users"),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"匹配用户数"}),e.jsx("p",{className:"text-4xl font-bold text-white",children:g(i==null?void 0:i.uniqueUsers)}),e.jsxs("p",{className:"text-blue-400/60 text-xs mt-3 flex items-center gap-1",children:[e.jsx(hn,{className:"w-3 h-3"})," 查看用户管理"]})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/40",children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"人均匹配"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:f?"—":i!=null&&i.uniqueUsers?(i.totalMatches/i.uniqueUsers).toFixed(1):"0"})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/40",children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"付费匹配次数"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:g(i==null?void 0:i.paidMatchCount)})]})})]})]}),(i==null?void 0:i.byType)&&i.byType.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"各类型匹配分布"}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:i.byType.map(v=>{const k=i.totalMatches>0?v.count/i.totalMatches*100:0;return e.jsxs("div",{className:"bg-[#0f2137] border border-gray-700/40 rounded-xl p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"text-2xl",children:Ix[v.matchType]||"📊"}),e.jsx("span",{className:"text-gray-300 font-medium",children:Rx[v.matchType]||v.matchType})]}),e.jsx("p",{className:"text-3xl font-bold text-white mb-2",children:v.count}),e.jsx("div",{className:"w-full h-2 bg-gray-700/50 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#38bdac] rounded-full transition-all",style:{width:`${Math.min(k,100)}%`}})}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1.5",children:[k.toFixed(1),"%"]})]},v.matchType)})})]}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(Pr,{className:"w-5 h-5 text-orange-400"})," AI 获客数据"]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-5 mb-6",children:[e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20 cursor-pointer hover:border-orange-500/50 transition-colors",onClick:()=>a==null?void 0:a("submitted"),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"已提交线索"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:f?"—":(d==null?void 0:d.ckbTotal)??0}),e.jsx("p",{className:"text-orange-400/60 text-xs mt-2",children:"点击查看明细 →"})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20 cursor-pointer hover:border-orange-500/50 transition-colors",onClick:()=>a==null?void 0:a("contact"),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"有联系方式"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:f?"—":(d==null?void 0:d.withContact)??0}),e.jsx("p",{className:"text-orange-400/60 text-xs mt-2",children:"点击查看明细 →"})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20 cursor-pointer hover:border-orange-500/50 transition-colors",onClick:()=>a==null?void 0:a("test"),children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"AI 添加进度"}),e.jsx("p",{className:"text-xl font-bold text-orange-400",children:"查看详情 →"}),e.jsx("p",{className:"text-gray-500 text-xs mt-2",children:"添加成功率 · 回复率 · API 文档"})]})})]}),(d==null?void 0:d.byType)&&d.byType.length>0&&e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-6",children:d.byType.map(v=>e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-lg p-4 flex items-center gap-3",children:[e.jsx("span",{className:"text-xl",children:Ix[v.matchType]||"📋"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:Rx[v.matchType]||v.matchType}),e.jsx("p",{className:"text-xl font-bold text-white",children:v.total})]})]},v.matchType))})]})]})}const K3=["partner","investor","mentor","team"],Ud=[{key:"join_partner",label:"找伙伴场景"},{key:"join_investor",label:"资源对接场景"},{key:"join_mentor",label:"导师顾问场景"},{key:"join_team",label:"团队招募场景"},{key:"match",label:"匹配上报"},{key:"lead",label:"链接卡若"}],_x=`# 场景获客接口摘要 -- 地址:POST /v1/api/scenarios -- 必填:apiKey、sign、timestamp -- 主标识:phone 或 wechatId 至少一项 -- 可选:name、source、remark、tags、siteTags、portrait -- 签名:排除 sign/apiKey/portrait,键名升序拼接值后双重 MD5 -- 成功:code=200,message=新增成功 或 已存在`;function G3({initialTab:r="overview"}){const[a,l]=h.useState(r),[i,c]=h.useState("13800000000"),[d,m]=h.useState(""),[f,p]=h.useState(""),[y,g]=h.useState(_x),[v,k]=h.useState(!1),[P,T]=h.useState(!1),[N,j]=h.useState([]),[C,E]=h.useState([]),[b,R]=h.useState({}),[G,X]=h.useState([{endpoint:"/api/ckb/join",label:"找伙伴",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"资源对接",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"导师顾问",method:"POST",status:"idle"},{endpoint:"/api/ckb/join",label:"团队招募",method:"POST",status:"idle"},{endpoint:"/api/ckb/match",label:"匹配上报",method:"POST",status:"idle"},{endpoint:"/api/miniprogram/ckb/lead",label:"链接卡若",method:"POST",status:"idle"},{endpoint:"/api/match/config",label:"匹配配置",method:"GET",status:"idle"}]),D=h.useMemo(()=>{const _={};return Ud.forEach(Q=>{_[Q.key]=b[Q.key]||{apiUrl:"https://ckbapi.quwanzhi.com/v1/api/scenarios",apiKey:"fyngh-ecy9h-qkdae-epwd5-rz6kd",source:"",tags:"",siteTags:"创业实验APP",notes:""}}),_},[b]),I=_=>{const Q=i.trim(),ue=d.trim();return _<=3?{type:K3[_],phone:Q||void 0,wechat:ue||void 0,userId:"admin_test",name:"后台测试"}:_===4?{matchType:"partner",phone:Q||void 0,wechat:ue||void 0,userId:"admin_test",nickname:"后台测试",matchedUser:{id:"test",nickname:"测试",matchScore:88}}:_===5?{phone:Q||void 0,wechatId:ue||void 0,userId:"admin_test",name:"后台测试"}:{}};async function w(){T(!0);try{const[_,Q,ue]=await Promise.all([Oe("/api/db/config/full?key=ckb_config"),Oe("/api/db/ckb-leads?mode=submitted&page=1&pageSize=50"),Oe("/api/db/ckb-leads?mode=contact&page=1&pageSize=50")]),L=_==null?void 0:_.data;L!=null&&L.routes&&R(L.routes),L!=null&&L.docNotes&&p(L.docNotes),L!=null&&L.docContent&&g(L.docContent),Q!=null&&Q.success&&j(Q.records||[]),ue!=null&&ue.success&&E(ue.records||[])}finally{T(!1)}}h.useEffect(()=>{l(r)},[r]),h.useEffect(()=>{w()},[]);async function V(){k(!0);try{const _=await ut("/api/db/config",{key:"ckb_config",value:{routes:D,docNotes:f,docContent:y},description:"存客宝接口配置"});alert((_==null?void 0:_.success)!==!1?"存客宝配置已保存":`保存失败: ${(_==null?void 0:_.error)||"未知错误"}`)}catch(_){alert(`保存失败: ${_ instanceof Error?_.message:"网络错误"}`)}finally{k(!1)}}const se=(_,Q)=>{R(ue=>({...ue,[_]:{...D[_],...Q}}))},ie=async _=>{const Q=G[_];if(Q.method==="POST"&&!i.trim()&&!d.trim()){alert("请填写测试手机号");return}const ue=[...G];ue[_]={...Q,status:"testing",message:void 0,responseTime:void 0},X(ue);const L=performance.now();try{const re=Q.method==="GET"?await Oe(Q.endpoint):await ut(Q.endpoint,I(_)),H=Math.round(performance.now()-L),A=(re==null?void 0:re.message)||"",z=(re==null?void 0:re.success)===!0||A.includes("已存在")||A.includes("已加入")||A.includes("已提交"),O=[...G];O[_]={...Q,status:z?"success":"error",message:A||(z?"正常":"异常"),responseTime:H},X(O),await w()}catch(re){const H=Math.round(performance.now()-L),A=[...G];A[_]={...Q,status:"error",message:re instanceof Error?re.message:"失败",responseTime:H},X(A)}},Y=async()=>{if(!i.trim()&&!d.trim()){alert("请填写测试手机号");return}for(let _=0;_e.jsx("div",{className:"overflow-auto rounded-lg border border-gray-700/30",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-[#0a1628] text-gray-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-3",children:"发起人"}),e.jsx("th",{className:"text-left px-4 py-3",children:"类型"}),e.jsx("th",{className:"text-left px-4 py-3",children:"手机号"}),e.jsx("th",{className:"text-left px-4 py-3",children:"微信号"}),e.jsx("th",{className:"text-left px-4 py-3",children:"时间"})]})}),e.jsx("tbody",{children:_.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"text-center py-10 text-gray-500",children:Q})}):_.map(ue=>e.jsxs("tr",{className:"border-t border-gray-700/30",children:[e.jsx("td",{className:"px-4 py-3 text-white",children:ue.userNickname||ue.userId}),e.jsx("td",{className:"px-4 py-3 text-gray-300",children:ue.matchType}),e.jsx("td",{className:"px-4 py-3 text-green-400",children:ue.phone||"—"}),e.jsx("td",{className:"px-4 py-3 text-blue-400",children:ue.wechatId||"—"}),e.jsx("td",{className:"px-4 py-3 text-gray-400",children:ue.createdAt?new Date(ue.createdAt).toLocaleString():"—"})]},ue.id))})]})});return e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/30 mb-6",children:e.jsxs(we,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h3",{className:"text-white font-semibold",children:"存客宝工作台"}),e.jsx(Le,{className:"bg-orange-500/20 text-orange-400 border-0 text-xs",children:"CKB"}),e.jsxs("button",{type:"button",onClick:()=>l("doc"),className:"text-orange-400/60 text-xs hover:text-orange-400 flex items-center gap-1",children:[e.jsx(hn,{className:"w-3 h-3"})," API 文档"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(J,{onClick:()=>w(),variant:"outline",size:"sm",className:"border-gray-700 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-3.5 h-3.5 mr-1 ${P?"animate-spin":""}`})," 刷新"]}),e.jsxs(J,{onClick:V,disabled:v,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(It,{className:"w-3.5 h-3.5 mr-1"})," ",v?"保存中...":"保存配置"]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-5",children:[["overview","概览"],["submitted","已提交线索"],["contact","有联系方式"],["config","场景配置"],["test","接口测试"],["doc","API 文档"]].map(([_,Q])=>e.jsx("button",{type:"button",onClick:()=>l(_),className:`px-4 py-2 rounded-lg text-sm transition-colors ${a===_?"bg-orange-500 text-white":"bg-[#0a1628] text-gray-400 hover:text-white"}`,children:Q},_))}),a==="overview"&&e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-xl p-5",children:[e.jsx("p",{className:"text-gray-400 text-xs mb-2",children:"已提交线索"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:N.length})]}),e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-xl p-5",children:[e.jsx("p",{className:"text-gray-400 text-xs mb-2",children:"有联系方式"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:C.length})]}),e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-xl p-5",children:[e.jsx("p",{className:"text-gray-400 text-xs mb-2",children:"场景配置数"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:Ud.length})]}),e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-xl p-5",children:[e.jsx("p",{className:"text-gray-400 text-xs mb-2",children:"文档备注"}),e.jsx("p",{className:"text-sm text-gray-300 line-clamp-3",children:f||"未填写"})]})]}),a==="submitted"&&ne(N,"暂无已提交线索"),a==="contact"&&ne(C,"暂无有联系方式线索"),a==="config"&&e.jsx("div",{className:"space-y-4",children:Ud.map(_=>e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700/30 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"text-white font-medium",children:_.label}),e.jsx(Le,{className:"bg-orange-500/20 text-orange-300 border-0 text-xs",children:_.key})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"API 地址"}),e.jsx(oe,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:D[_.key].apiUrl,onChange:Q=>se(_.key,{apiUrl:Q.target.value})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"API Key"}),e.jsx(oe,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:D[_.key].apiKey,onChange:Q=>se(_.key,{apiKey:Q.target.value})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"Source"}),e.jsx(oe,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:D[_.key].source,onChange:Q=>se(_.key,{source:Q.target.value})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"Tags"}),e.jsx(oe,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:D[_.key].tags,onChange:Q=>se(_.key,{tags:Q.target.value})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"SiteTags"}),e.jsx(oe,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:D[_.key].siteTags,onChange:Q=>se(_.key,{siteTags:Q.target.value})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"说明备注"}),e.jsx(oe,{className:"bg-[#0f2137] border-gray-700 text-white h-9 text-sm",value:D[_.key].notes,onChange:Q=>se(_.key,{notes:Q.target.value})})]})]})]},_.key))}),a==="test"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-3 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx(Al,{className:"w-4 h-4 text-gray-500 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"测试手机号"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white h-8 text-sm mt-0.5",value:i,onChange:_=>c(_.target.value)})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx("span",{className:"text-gray-500 text-sm shrink-0",children:"💬"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"微信号(可选)"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white h-8 text-sm mt-0.5",value:d,onChange:_=>m(_.target.value)})]})]}),e.jsx("div",{className:"flex items-end",children:e.jsxs(J,{onClick:Y,className:"bg-orange-500 hover:bg-orange-600 text-white",children:[e.jsx(ln,{className:"w-3.5 h-3.5 mr-1"})," 全部测试"]})})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2",children:G.map((_,Q)=>e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg px-3 py-2 border border-gray-700/30",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[_.status==="idle"&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-600 shrink-0"}),_.status==="testing"&&e.jsx(Be,{className:"w-3 h-3 text-yellow-400 animate-spin shrink-0"}),_.status==="success"&&e.jsx(Yd,{className:"w-3 h-3 text-green-400 shrink-0"}),_.status==="error"&&e.jsx(Yx,{className:"w-3 h-3 text-red-400 shrink-0"}),e.jsx("span",{className:"text-white text-xs truncate",children:_.label})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[_.responseTime!==void 0&&e.jsxs("span",{className:"text-gray-600 text-[10px]",children:[_.responseTime,"ms"]}),e.jsx("button",{type:"button",onClick:()=>ie(Q),disabled:_.status==="testing",className:"text-orange-400/60 hover:text-orange-400 text-[10px] disabled:opacity-50",children:"测试"})]})]},`${_.endpoint}-${Q}`))})]}),a==="doc"&&e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg border border-gray-700/30 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"text-white text-sm font-medium",children:"场景获客 API 摘要"}),e.jsxs("a",{href:"https://ckbapi.quwanzhi.com/v1/api/scenarios",target:"_blank",rel:"noreferrer",className:"text-orange-400/70 hover:text-orange-400 text-xs flex items-center gap-1",children:[e.jsx(hn,{className:"w-3 h-3"})," 打开外链"]})]}),e.jsx("pre",{className:"whitespace-pre-wrap text-xs text-gray-400 leading-6",children:y||_x})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg border border-gray-700/30 p-4",children:[e.jsx("h4",{className:"text-white text-sm font-medium mb-3",children:"说明备注(可编辑)"}),e.jsx("textarea",{className:"w-full min-h-[260px] bg-[#0f2137] border border-gray-700 rounded-md text-sm text-gray-300 p-3 outline-none focus:border-orange-500/50 resize-y",value:f,onChange:_=>p(_.target.value),placeholder:"记录 Token、入口差异、回复率统计规则、对接约定等。"})]})]})]})})}const Y3=[{id:"stats",label:"数据统计",icon:Qb},{id:"partner",label:"找伙伴",icon:Kt},{id:"resource",label:"资源对接",icon:Pj},{id:"mentor",label:"导师预约",icon:Cj},{id:"team",label:"团队招募",icon:Jd}];function Q3(){const[r,a]=h.useState("stats"),[l,i]=h.useState(!1),[c,d]=h.useState("overview");return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Kt,{className:"w-6 h-6 text-[#38bdac]"}),"找伙伴"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"数据统计、匹配池与记录、资源对接、导师预约、团队招募"})]}),e.jsxs(J,{type:"button",variant:"outline",onClick:()=>i(m=>!m),className:"border-orange-500/40 text-orange-300 hover:bg-orange-500/10 bg-transparent",children:[e.jsx(Pr,{className:"w-4 h-4 mr-2"}),"存客宝"]})]}),l&&e.jsx(G3,{initialTab:c}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:Y3.map(m=>{const f=r===m.id;return e.jsxs("button",{type:"button",onClick:()=>a(m.id),className:`flex items-center gap-2 px-5 py-2.5 rounded-md text-sm font-medium transition-all ${f?"bg-[#38bdac] text-white shadow-lg":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:[e.jsx(m.icon,{className:"w-4 h-4"}),m.label]},m.id)})}),r==="stats"&&e.jsx(H3,{onSwitchTab:m=>a(m),onOpenCKB:m=>{d(m||"overview"),i(!0)}}),r==="partner"&&e.jsx(z3,{}),r==="resource"&&e.jsx($3,{}),r==="mentor"&&e.jsx(V3,{}),r==="team"&&e.jsx(W3,{})]})}function q3(){return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[e.jsx(Pr,{className:"w-8 h-8 text-[#38bdac]"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"API 接口文档"})]}),e.jsx("p",{className:"text-gray-400 mb-6",children:"API 风格:RESTful · 版本 v1.0 · 基础路径 /api · 简单、清晰、易用。"}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"1. 接口总览"})}),e.jsxs(we,{className:"space-y-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"接口分类"}),e.jsxs("ul",{className:"space-y-1 text-gray-300 font-mono",children:[e.jsx("li",{children:"/api/book — 书籍内容(章节列表、内容获取、同步)"}),e.jsx("li",{children:"/api/payment — 支付系统(订单创建、回调、状态查询)"}),e.jsx("li",{children:"/api/referral — 分销系统(邀请码、收益、提现)"}),e.jsx("li",{children:"/api/user — 用户系统(登录、注册、信息更新)"}),e.jsx("li",{children:"/api/match — 匹配系统(寻找匹配、匹配历史)"}),e.jsx("li",{children:"/api/admin — 管理后台(内容/订单/用户/分销管理)"}),e.jsx("li",{children:"/api/config — 配置系统"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"认证方式"}),e.jsx("p",{className:"text-gray-300",children:"用户:Cookie session_id(可选)"}),e.jsx("p",{className:"text-gray-300",children:"管理端:Authorization: Bearer admin-token-secret"})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"2. 书籍内容"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET /api/book/all-chapters — 获取所有章节"}),e.jsx("p",{children:"GET /api/book/chapter/:id — 获取单章内容"}),e.jsx("p",{children:"POST /api/book/sync — 同步章节(需管理员认证)"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"3. 支付"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"POST /api/payment/create-order — 创建订单"}),e.jsx("p",{children:"POST /api/payment/alipay/notify — 支付宝回调"}),e.jsx("p",{children:"POST /api/payment/wechat/notify — 微信回调"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"4. 分销与用户"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"/api/referral/* — 邀请码、收益查询、提现"}),e.jsx("p",{children:"/api/user/* — 登录、注册、信息更新"}),e.jsx("p",{children:"/api/match/* — 匹配、匹配历史"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ye,{children:e.jsx(Qe,{className:"text-white",children:"5. 管理后台"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET/POST /api/admin/referral-settings — 推广/分销设置(含 VIP 配置)"}),e.jsx("p",{children:"GET /api/db/users、/api/db/book — 用户与章节数据"}),e.jsx("p",{children:"GET /api/orders — 订单列表"})]})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"完整说明见项目内 开发文档/5、接口/API接口完整文档.md"})]})}function X3(){const r=gn();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(tj,{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(J,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:e.jsxs(Gd,{to:"/",children:[e.jsx(Rj,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function J3(){return e.jsxs(kb,{children:[e.jsx(yt,{path:"/login",element:e.jsx(Ew,{})}),e.jsxs(yt,{path:"/",element:e.jsx(RN,{}),children:[e.jsx(yt,{index:!0,element:e.jsx(Sd,{to:"/dashboard",replace:!0})}),e.jsx(yt,{path:"dashboard",element:e.jsx(Tw,{})}),e.jsx(yt,{path:"orders",element:e.jsx(f2,{})}),e.jsx(yt,{path:"users",element:e.jsx($2,{})}),e.jsx(yt,{path:"distribution",element:e.jsx(o4,{})}),e.jsx(yt,{path:"withdrawals",element:e.jsx(c4,{})}),e.jsx(yt,{path:"content",element:e.jsx(p3,{})}),e.jsx(yt,{path:"referral-settings",element:e.jsx(D0,{})}),e.jsx(yt,{path:"author-settings",element:e.jsx(Sd,{to:"/settings?tab=author",replace:!0})}),e.jsx(yt,{path:"admin-users",element:e.jsx(Sd,{to:"/settings?tab=admin",replace:!0})}),e.jsx(yt,{path:"vip-roles",element:e.jsx(A3,{})}),e.jsx(yt,{path:"mentors",element:e.jsx(Ag,{})}),e.jsx(yt,{path:"mentor-consultations",element:e.jsx(D3,{})}),e.jsx(yt,{path:"settings",element:e.jsx(S3,{})}),e.jsx(yt,{path:"payment",element:e.jsx(C3,{})}),e.jsx(yt,{path:"site",element:e.jsx(T3,{})}),e.jsx(yt,{path:"qrcodes",element:e.jsx(R3,{})}),e.jsx(yt,{path:"find-partner",element:e.jsx(Q3,{})}),e.jsx(yt,{path:"match",element:e.jsx(_3,{})}),e.jsx(yt,{path:"match-records",element:e.jsx(M3,{})}),e.jsx(yt,{path:"api-doc",element:e.jsx(q3,{})})]}),e.jsx(yt,{path:"*",element:e.jsx(X3,{})})]})}Rv.createRoot(document.getElementById("root")).render(e.jsx(h.StrictMode,{children:e.jsx(Ab,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(J3,{})})})); diff --git a/soul-admin/dist/assets/index-b6lYPhij.css b/soul-admin/dist/assets/index-b6lYPhij.css deleted file mode 100644 index 9ab961bd..00000000 --- a/soul-admin/dist/assets/index-b6lYPhij.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.-top-2\.5{top:calc(var(--spacing)*-2.5)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-4{top:calc(var(--spacing)*4)}.top-16{top:calc(var(--spacing)*16)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-1\/4{right:25%}.right-4{right:calc(var(--spacing)*4)}.bottom-1\/4{bottom:25%}.-left-2\.5{left:calc(var(--spacing)*-2.5)}.left-0{left:calc(var(--spacing)*0)}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-10{z-index:10}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.-mx-8{margin-inline:calc(var(--spacing)*-8)}.mx-20{margin-inline:calc(var(--spacing)*20)}.mx-auto{margin-inline:auto}.-mt-6{margin-top:calc(var(--spacing)*-6)}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-6{margin-left:calc(var(--spacing)*6)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.h-0\.5{height:calc(var(--spacing)*.5)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-96{height:calc(var(--spacing)*96)}.h-\[75vh\]{height:75vh}.h-auto{height:auto}.h-full{height:100%}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[250px\]{max-height:250px}.max-h-\[300px\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[32px\]{min-height:32px}.min-h-\[40px\]{min-height:40px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[140px\]{min-height:140px}.min-h-\[260px\]{min-height:260px}.min-h-\[300px\]{min-height:300px}.min-h-\[400px\]{min-height:400px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-0\.5{width:calc(var(--spacing)*.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-48{width:calc(var(--spacing)*48)}.w-56{width:calc(var(--spacing)*56)}.w-64{width:calc(var(--spacing)*64)}.w-96{width:calc(var(--spacing)*96)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[120px\]{min-width:120px}.min-w-\[1024px\]{min-width:1024px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-1\/2{--tw-translate-x: 50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.scale-\[0\.98\]{scale:.98}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-gray-700\/50>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.divide-gray-700\/50>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}:where(.divide-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-\[\#07C160\]{border-color:#07c160}.border-\[\#07C160\]\/20{border-color:#07c16033}.border-\[\#07C160\]\/30{border-color:#07c1604d}.border-\[\#38bdac\]{border-color:#38bdac}.border-\[\#38bdac\]\/20{border-color:#38bdac33}.border-\[\#38bdac\]\/30{border-color:#38bdac4d}.border-\[\#38bdac\]\/40{border-color:#38bdac66}.border-\[\#38bdac\]\/50{border-color:#38bdac80}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500)40%,transparent)}}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.border-blue-500\/40{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/40{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.border-blue-500\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500)30%,transparent)}}.border-cyan-500\/40{border-color:#00b7d766}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/40{border-color:color-mix(in oklab,var(--color-cyan-500)40%,transparent)}}.border-gray-500{border-color:var(--color-gray-500)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-700\/30{border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/30{border-color:color-mix(in oklab,var(--color-gray-700)30%,transparent)}}.border-gray-700\/40{border-color:#36415366}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/40{border-color:color-mix(in oklab,var(--color-gray-700)40%,transparent)}}.border-gray-700\/50{border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/50{border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-green-500\/40{border-color:#00c75866}@supports (color:color-mix(in lab,red,red)){.border-green-500\/40{border-color:color-mix(in oklab,var(--color-green-500)40%,transparent)}}.border-orange-500\/20{border-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/20{border-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.border-orange-500\/40{border-color:#fe6e0066}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/40{border-color:color-mix(in oklab,var(--color-orange-500)40%,transparent)}}.border-orange-500\/50{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/50{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.border-purple-500\/20{border-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/20{border-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.border-purple-500\/40{border-color:#ac4bff66}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/40{border-color:color-mix(in oklab,var(--color-purple-500)40%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.border-red-500\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/30{border-color:color-mix(in oklab,var(--color-yellow-500)30%,transparent)}}.border-yellow-500\/40{border-color:#edb20066}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/40{border-color:color-mix(in oklab,var(--color-yellow-500)40%,transparent)}}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0a1628\]\/50{background-color:#0a162880}.bg-\[\#0f2137\]{background-color:#0f2137}.bg-\[\#00CED1\]{background-color:#00ced1}.bg-\[\#1C1C1E\]{background-color:#1c1c1e}.bg-\[\#07C160\]{background-color:#07c160}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#07C160\]\/10{background-color:#07c1601a}.bg-\[\#38bdac\]{background-color:#38bdac}.bg-\[\#38bdac\]\/5{background-color:#38bdac0d}.bg-\[\#38bdac\]\/10{background-color:#38bdac1a}.bg-\[\#38bdac\]\/15{background-color:#38bdac26}.bg-\[\#38bdac\]\/20{background-color:#38bdac33}.bg-\[\#38bdac\]\/30{background-color:#38bdac4d}.bg-\[\#38bdac\]\/60{background-color:#38bdac99}.bg-\[\#38bdac\]\/80{background-color:#38bdaccc}.bg-\[\#162840\]{background-color:#162840}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/90{background-color:#000000e6}@supports (color:color-mix(in lab,red,red)){.bg-black\/90{background-color:color-mix(in oklab,var(--color-black)90%,transparent)}}.bg-blue-500\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-600\/50{background-color:#4a556580}@supports (color:color-mix(in lab,red,red)){.bg-gray-600\/50{background-color:color-mix(in oklab,var(--color-gray-600)50%,transparent)}}.bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-pink-500\/20{background-color:#f6339a33}@supports (color:color-mix(in lab,red,red)){.bg-pink-500\/20{background-color:color-mix(in oklab,var(--color-pink-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#0f2137\]{--tw-gradient-from:#0f2137;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#00CED1\]{--tw-gradient-from:#00ced1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#38bdac\]\/10{--tw-gradient-from:oklab(72.378% -.11483 -.0053193/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-blue-500\/20{--tw-gradient-from:#3080ff33}@supports (color:color-mix(in lab,red,red)){.from-blue-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.from-blue-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-cyan-500\/20{--tw-gradient-from:#00b7d733}@supports (color:color-mix(in lab,red,red)){.from-cyan-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.from-cyan-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-green-500\/20{--tw-gradient-from:#00c75833}@supports (color:color-mix(in lab,red,red)){.from-green-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.from-green-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-500\/20{--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.from-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-yellow-500\/20{--tw-gradient-from:#edb20033}@supports (color:color-mix(in lab,red,red)){.from-yellow-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.from-yellow-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-\[\#38bdac\]\/30{--tw-gradient-via:oklab(72.378% -.11483 -.0053193/.3);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-\[\#0f2137\]{--tw-gradient-to:#0f2137;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#20B2AA\]{--tw-gradient-to:#20b2aa;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#162d4a\]{--tw-gradient-to:#162d4a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-amber-500\/20{--tw-gradient-to:#f99c0033}@supports (color:color-mix(in lab,red,red)){.to-amber-500\/20{--tw-gradient-to:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.to-amber-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-500\/5{--tw-gradient-to:#00b7d70d}@supports (color:color-mix(in lab,red,red)){.to-cyan-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-cyan-500)5%,transparent)}}.to-cyan-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-green-500\/5{--tw-gradient-to:#00c7580d}@supports (color:color-mix(in lab,red,red)){.to-green-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-green-500)5%,transparent)}}.to-green-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-500\/5{--tw-gradient-to:#ac4bff0d}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-purple-500)5%,transparent)}}.to-purple-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-yellow-500\/5{--tw-gradient-to:#edb2000d}@supports (color:color-mix(in lab,red,red)){.to-yellow-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-yellow-500)5%,transparent)}}.to-yellow-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-repeat{background-repeat:repeat}.mask-no-clip{-webkit-mask-clip:no-clip;mask-clip:no-clip}.mask-repeat{-webkit-mask-repeat:repeat;mask-repeat:repeat}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.py-16{padding-block:calc(var(--spacing)*16)}.py-20{padding-block:calc(var(--spacing)*20)}.py-24{padding-block:calc(var(--spacing)*24)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#00CED1\]{color:#00ced1}.text-\[\#07C160\]{color:#07c160}.text-\[\#07C160\]\/60{color:#07c16099}.text-\[\#07C160\]\/70{color:#07c160b3}.text-\[\#07C160\]\/80{color:#07c160cc}.text-\[\#26A17B\]{color:#26a17b}.text-\[\#38bdac\]{color:#38bdac}.text-\[\#38bdac\]\/30{color:#38bdac4d}.text-\[\#38bdac\]\/40{color:#38bdac66}.text-\[\#169BD7\]{color:#169bd7}.text-\[\#1677FF\]{color:#1677ff}.text-\[\#FFD700\]{color:gold}.text-amber-200{color:var(--color-amber-200)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/30{color:#fcbb004d}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/30{color:color-mix(in oklab,var(--color-amber-400)30%,transparent)}}.text-amber-400\/90{color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/90{color:color-mix(in oklab,var(--color-amber-400)90%,transparent)}}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-blue-300\/60{color:#90c5ff99}@supports (color:color-mix(in lab,red,red)){.text-blue-300\/60{color:color-mix(in oklab,var(--color-blue-300)60%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-400\/60{color:#54a2ff99}@supports (color:color-mix(in lab,red,red)){.text-blue-400\/60{color:color-mix(in oklab,var(--color-blue-400)60%,transparent)}}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-orange-300{color:var(--color-orange-300)}.text-orange-300\/60{color:#ffb96d99}@supports (color:color-mix(in lab,red,red)){.text-orange-300\/60{color:color-mix(in oklab,var(--color-orange-300)60%,transparent)}}.text-orange-400{color:var(--color-orange-400)}.text-orange-400\/60{color:#ff8b1a99}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/60{color:color-mix(in oklab,var(--color-orange-400)60%,transparent)}}.text-orange-400\/70{color:#ff8b1ab3}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/70{color:color-mix(in oklab,var(--color-orange-400)70%,transparent)}}.text-orange-400\/80{color:#ff8b1acc}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/80{color:color-mix(in oklab,var(--color-orange-400)80%,transparent)}}.text-pink-400{color:var(--color-pink-400)}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-400\/60{color:#fac80099}@supports (color:color-mix(in lab,red,red)){.text-yellow-400\/60{color:color-mix(in oklab,var(--color-yellow-400)60%,transparent)}}.text-yellow-500\/70{color:#edb200b3}@supports (color:color-mix(in lab,red,red)){.text-yellow-500\/70{color:color-mix(in oklab,var(--color-yellow-500)70%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-55{opacity:.55}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[\#38bdac\]\/20{--tw-shadow-color:#38bdac33}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#38bdac\]\/30{--tw-shadow-color:#38bdac4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.3) var(--tw-shadow-alpha),transparent)}}.ring-\[\#38bdac\]{--tw-ring-color:#38bdac}.ring-\[\#38bdac\]\/40{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.4)}.ring-\[\#38bdac\]\/50{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.5)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:text-\[\#38bdac\]:is(:where(.group):hover *){color:#38bdac}.group-hover\:text-gray-400:is(:where(.group):hover *){color:var(--color-gray-400)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.placeholder\:text-gray-500::placeholder{color:var(--color-gray-500)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[\#38bdac\]\/30:hover{border-color:#38bdac4d}.hover\:border-\[\#38bdac\]\/50:hover{border-color:#38bdac80}.hover\:border-\[\#38bdac\]\/60:hover{border-color:#38bdac99}.hover\:border-amber-500\/40:hover{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.hover\:border-amber-500\/40:hover{border-color:color-mix(in oklab,var(--color-amber-500)40%,transparent)}}.hover\:border-blue-500\/60:hover{border-color:#3080ff99}@supports (color:color-mix(in lab,red,red)){.hover\:border-blue-500\/60:hover{border-color:color-mix(in oklab,var(--color-blue-500)60%,transparent)}}.hover\:border-gray-500:hover{border-color:var(--color-gray-500)}.hover\:border-gray-600:hover{border-color:var(--color-gray-600)}.hover\:border-orange-500\/50:hover{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.hover\:border-orange-500\/50:hover{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.hover\:border-yellow-500\/60:hover{border-color:#edb20099}@supports (color:color-mix(in lab,red,red)){.hover\:border-yellow-500\/60:hover{border-color:color-mix(in oklab,var(--color-yellow-500)60%,transparent)}}.hover\:bg-\[\#0a1628\]:hover{background-color:#0a1628}.hover\:bg-\[\#1a3050\]:hover{background-color:#1a3050}.hover\:bg-\[\#2da396\]:hover{background-color:#2da396}.hover\:bg-\[\#06AD51\]:hover{background-color:#06ad51}.hover\:bg-\[\#07C160\]\/10:hover{background-color:#07c1601a}.hover\:bg-\[\#20B2AA\]:hover{background-color:#20b2aa}.hover\:bg-\[\#38bdac\]\/10:hover{background-color:#38bdac1a}.hover\:bg-\[\#38bdac\]\/20:hover{background-color:#38bdac33}.hover\:bg-\[\#162840\]\/30:hover{background-color:#1628404d}.hover\:bg-\[\#162840\]\/50:hover{background-color:#16284080}.hover\:bg-amber-400\/10:hover{background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-400\/10:hover{background-color:color-mix(in oklab,var(--color-amber-400)10%,transparent)}}.hover\:bg-amber-500\/10:hover{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/10:hover{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.hover\:bg-amber-500\/20:hover{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/20:hover{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-blue-400\/10:hover{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-400\/10:hover{background-color:color-mix(in oklab,var(--color-blue-400)10%,transparent)}}.hover\:bg-blue-500\/20:hover{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-500\/20:hover{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.hover\:bg-gray-500\/20:hover{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-500\/20:hover{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/10:hover{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/10:hover{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-purple-500\/10:hover{background-color:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/10:hover{background-color:color-mix(in oklab,var(--color-purple-500)10%,transparent)}}.hover\:bg-purple-500\/20:hover{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/20:hover{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.hover\:bg-purple-500\/30:hover{background-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/30:hover{background-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\:bg-yellow-400\/10:hover{background-color:#fac8001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-400\/10:hover{background-color:color-mix(in oklab,var(--color-yellow-400)10%,transparent)}}.hover\:bg-yellow-500\/20:hover{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-500\/20:hover{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.hover\:text-\[\#38bdac\]:hover{color:#38bdac}.hover\:text-amber-300:hover{color:var(--color-amber-300)}.hover\:text-amber-400:hover{color:var(--color-amber-400)}.hover\:text-blue-400:hover{color:var(--color-blue-400)}.hover\:text-gray-300:hover{color:var(--color-gray-300)}.hover\:text-orange-400:hover{color:var(--color-orange-400)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-yellow-400:hover{color:var(--color-yellow-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:border-\[\#38bdac\]:focus{border-color:#38bdac}.focus\:border-orange-500\/50:focus{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.focus\:border-orange-500\/50:focus{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.focus\:bg-\[\#38bdac\]\/20:focus{background-color:#38bdac33}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#38bdac\]:focus{--tw-ring-color:#38bdac}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#38bdac\]:focus-visible{--tw-ring-color:#38bdac}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-\[\#0a1628\]:focus-visible{--tw-ring-offset-color:#0a1628}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-\[\#07C160\]\/20[data-state=active]{background-color:#07c16033}.data-\[state\=active\]\:bg-\[\#26A17B\]\/20[data-state=active]{background-color:#26a17b33}.data-\[state\=active\]\:bg-\[\#38bdac\]\/20[data-state=active]{background-color:#38bdac33}.data-\[state\=active\]\:bg-\[\#1677FF\]\/20[data-state=active]{background-color:#1677ff33}.data-\[state\=active\]\:bg-\[\#003087\]\/20[data-state=active]{background-color:#00308733}.data-\[state\=active\]\:font-medium[data-state=active]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[state\=active\]\:text-\[\#07C160\][data-state=active]{color:#07c160}.data-\[state\=active\]\:text-\[\#26A17B\][data-state=active]{color:#26a17b}.data-\[state\=active\]\:text-\[\#38bdac\][data-state=active]{color:#38bdac}.data-\[state\=active\]\:text-\[\#169BD7\][data-state=active]{color:#169bd7}.data-\[state\=active\]\:text-\[\#1677FF\][data-state=active]{color:#1677ff}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[\#38bdac\][data-state=checked]{background-color:#38bdac}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-gray-600[data-state=unchecked]{background-color:var(--color-gray-600)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(min-width:64rem){.lg\:block{display:block}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}@media(min-width:80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}}:root{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20% .02 240);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20% .02 240);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(65% .15 180);--primary-foreground:oklch(20% 0 0);--secondary:oklch(27% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27% 0 0);--muted-foreground:oklch(65% 0 0);--accent:oklch(27% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(55% .2 25);--destructive-foreground:oklch(98.5% 0 0);--border:oklch(35% 0 0);--input:oklch(35% 0 0);--ring:oklch(65% .15 180);--radius:.625rem}body{font-family:var(--font-sans);color:var(--foreground);background:#0a1628}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/soul-admin/dist/assets/index-jScXDwzJ.css b/soul-admin/dist/assets/index-jScXDwzJ.css new file mode 100644 index 00000000..7a0ab602 --- /dev/null +++ b/soul-admin/dist/assets/index-jScXDwzJ.css @@ -0,0 +1 @@ +/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.-top-2\.5{top:calc(var(--spacing)*-2.5)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-4{top:calc(var(--spacing)*4)}.top-16{top:calc(var(--spacing)*16)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-1\/4{right:25%}.right-4{right:calc(var(--spacing)*4)}.bottom-1\/4{bottom:25%}.-left-2\.5{left:calc(var(--spacing)*-2.5)}.left-0{left:calc(var(--spacing)*0)}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-10{z-index:10}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.-mx-8{margin-inline:calc(var(--spacing)*-8)}.mx-20{margin-inline:calc(var(--spacing)*20)}.mx-auto{margin-inline:auto}.-mt-6{margin-top:calc(var(--spacing)*-6)}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-6{margin-left:calc(var(--spacing)*6)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.h-0\.5{height:calc(var(--spacing)*.5)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-96{height:calc(var(--spacing)*96)}.h-\[75vh\]{height:75vh}.h-auto{height:auto}.h-full{height:100%}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[250px\]{max-height:250px}.max-h-\[300px\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[32px\]{min-height:32px}.min-h-\[40px\]{min-height:40px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[260px\]{min-height:260px}.min-h-\[300px\]{min-height:300px}.min-h-\[400px\]{min-height:400px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-0\.5{width:calc(var(--spacing)*.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-48{width:calc(var(--spacing)*48)}.w-56{width:calc(var(--spacing)*56)}.w-64{width:calc(var(--spacing)*64)}.w-96{width:calc(var(--spacing)*96)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[60px\]{min-width:60px}.min-w-\[120px\]{min-width:120px}.min-w-\[1024px\]{min-width:1024px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-1\/2{--tw-translate-x: 50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.scale-\[0\.98\]{scale:.98}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[40px_40px_1fr_80px_80px_80px_60px\]{grid-template-columns:40px 40px 1fr 80px 80px 80px 60px}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*0)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*0)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-gray-700\/50>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.divide-gray-700\/50>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}:where(.divide-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-\[\#07C160\]{border-color:#07c160}.border-\[\#07C160\]\/20{border-color:#07c16033}.border-\[\#07C160\]\/30{border-color:#07c1604d}.border-\[\#38bdac\]{border-color:#38bdac}.border-\[\#38bdac\]\/20{border-color:#38bdac33}.border-\[\#38bdac\]\/30{border-color:#38bdac4d}.border-\[\#38bdac\]\/40{border-color:#38bdac66}.border-\[\#38bdac\]\/50{border-color:#38bdac80}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500)40%,transparent)}}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.border-blue-500\/40{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/40{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.border-blue-500\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500)30%,transparent)}}.border-cyan-500\/40{border-color:#00b7d766}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/40{border-color:color-mix(in oklab,var(--color-cyan-500)40%,transparent)}}.border-gray-500{border-color:var(--color-gray-500)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-700\/30{border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/30{border-color:color-mix(in oklab,var(--color-gray-700)30%,transparent)}}.border-gray-700\/40{border-color:#36415366}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/40{border-color:color-mix(in oklab,var(--color-gray-700)40%,transparent)}}.border-gray-700\/50{border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/50{border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-green-500\/40{border-color:#00c75866}@supports (color:color-mix(in lab,red,red)){.border-green-500\/40{border-color:color-mix(in oklab,var(--color-green-500)40%,transparent)}}.border-orange-500\/20{border-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/20{border-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.border-orange-500\/40{border-color:#fe6e0066}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/40{border-color:color-mix(in oklab,var(--color-orange-500)40%,transparent)}}.border-orange-500\/50{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/50{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.border-purple-500\/20{border-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/20{border-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.border-purple-500\/40{border-color:#ac4bff66}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/40{border-color:color-mix(in oklab,var(--color-purple-500)40%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.border-red-500\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/30{border-color:color-mix(in oklab,var(--color-yellow-500)30%,transparent)}}.border-yellow-500\/40{border-color:#edb20066}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/40{border-color:color-mix(in oklab,var(--color-yellow-500)40%,transparent)}}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0a1628\]\/50{background-color:#0a162880}.bg-\[\#0f2137\]{background-color:#0f2137}.bg-\[\#00CED1\]{background-color:#00ced1}.bg-\[\#1C1C1E\]{background-color:#1c1c1e}.bg-\[\#07C160\]{background-color:#07c160}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#07C160\]\/10{background-color:#07c1601a}.bg-\[\#38bdac\]{background-color:#38bdac}.bg-\[\#38bdac\]\/5{background-color:#38bdac0d}.bg-\[\#38bdac\]\/10{background-color:#38bdac1a}.bg-\[\#38bdac\]\/15{background-color:#38bdac26}.bg-\[\#38bdac\]\/20{background-color:#38bdac33}.bg-\[\#38bdac\]\/30{background-color:#38bdac4d}.bg-\[\#38bdac\]\/60{background-color:#38bdac99}.bg-\[\#38bdac\]\/80{background-color:#38bdaccc}.bg-\[\#162840\]{background-color:#162840}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/5{background-color:color-mix(in oklab,var(--color-amber-500)5%,transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/90{background-color:#000000e6}@supports (color:color-mix(in lab,red,red)){.bg-black\/90{background-color:color-mix(in oklab,var(--color-black)90%,transparent)}}.bg-blue-500\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-600\/50{background-color:#4a556580}@supports (color:color-mix(in lab,red,red)){.bg-gray-600\/50{background-color:color-mix(in oklab,var(--color-gray-600)50%,transparent)}}.bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-pink-500\/20{background-color:#f6339a33}@supports (color:color-mix(in lab,red,red)){.bg-pink-500\/20{background-color:color-mix(in oklab,var(--color-pink-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#0f2137\]{--tw-gradient-from:#0f2137;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#00CED1\]{--tw-gradient-from:#00ced1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#38bdac\]\/10{--tw-gradient-from:oklab(72.378% -.11483 -.0053193/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-blue-500\/20{--tw-gradient-from:#3080ff33}@supports (color:color-mix(in lab,red,red)){.from-blue-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.from-blue-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-cyan-500\/20{--tw-gradient-from:#00b7d733}@supports (color:color-mix(in lab,red,red)){.from-cyan-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.from-cyan-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-green-500\/20{--tw-gradient-from:#00c75833}@supports (color:color-mix(in lab,red,red)){.from-green-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.from-green-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-500\/20{--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.from-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-yellow-500\/20{--tw-gradient-from:#edb20033}@supports (color:color-mix(in lab,red,red)){.from-yellow-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.from-yellow-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-\[\#38bdac\]\/30{--tw-gradient-via:oklab(72.378% -.11483 -.0053193/.3);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-\[\#0f2137\]{--tw-gradient-to:#0f2137;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#20B2AA\]{--tw-gradient-to:#20b2aa;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#162d4a\]{--tw-gradient-to:#162d4a;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-amber-500\/20{--tw-gradient-to:#f99c0033}@supports (color:color-mix(in lab,red,red)){.to-amber-500\/20{--tw-gradient-to:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.to-amber-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-500\/5{--tw-gradient-to:#00b7d70d}@supports (color:color-mix(in lab,red,red)){.to-cyan-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-cyan-500)5%,transparent)}}.to-cyan-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-green-500\/5{--tw-gradient-to:#00c7580d}@supports (color:color-mix(in lab,red,red)){.to-green-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-green-500)5%,transparent)}}.to-green-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-500\/5{--tw-gradient-to:#ac4bff0d}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-purple-500)5%,transparent)}}.to-purple-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-yellow-500\/5{--tw-gradient-to:#edb2000d}@supports (color:color-mix(in lab,red,red)){.to-yellow-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-yellow-500)5%,transparent)}}.to-yellow-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-repeat{background-repeat:repeat}.mask-no-clip{-webkit-mask-clip:no-clip;mask-clip:no-clip}.mask-repeat{-webkit-mask-repeat:repeat;mask-repeat:repeat}.fill-current{fill:currentColor}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.py-16{padding-block:calc(var(--spacing)*16)}.py-20{padding-block:calc(var(--spacing)*20)}.py-24{padding-block:calc(var(--spacing)*24)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#00CED1\]{color:#00ced1}.text-\[\#07C160\]{color:#07c160}.text-\[\#07C160\]\/60{color:#07c16099}.text-\[\#07C160\]\/70{color:#07c160b3}.text-\[\#07C160\]\/80{color:#07c160cc}.text-\[\#26A17B\]{color:#26a17b}.text-\[\#38bdac\]{color:#38bdac}.text-\[\#38bdac\]\/30{color:#38bdac4d}.text-\[\#38bdac\]\/40{color:#38bdac66}.text-\[\#169BD7\]{color:#169bd7}.text-\[\#1677FF\]{color:#1677ff}.text-\[\#FFD700\]{color:gold}.text-amber-200{color:var(--color-amber-200)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/30{color:#fcbb004d}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/30{color:color-mix(in oklab,var(--color-amber-400)30%,transparent)}}.text-amber-400\/90{color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/90{color:color-mix(in oklab,var(--color-amber-400)90%,transparent)}}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-blue-300\/60{color:#90c5ff99}@supports (color:color-mix(in lab,red,red)){.text-blue-300\/60{color:color-mix(in oklab,var(--color-blue-300)60%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-400\/60{color:#54a2ff99}@supports (color:color-mix(in lab,red,red)){.text-blue-400\/60{color:color-mix(in oklab,var(--color-blue-400)60%,transparent)}}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-orange-300{color:var(--color-orange-300)}.text-orange-300\/60{color:#ffb96d99}@supports (color:color-mix(in lab,red,red)){.text-orange-300\/60{color:color-mix(in oklab,var(--color-orange-300)60%,transparent)}}.text-orange-400{color:var(--color-orange-400)}.text-orange-400\/60{color:#ff8b1a99}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/60{color:color-mix(in oklab,var(--color-orange-400)60%,transparent)}}.text-orange-400\/70{color:#ff8b1ab3}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/70{color:color-mix(in oklab,var(--color-orange-400)70%,transparent)}}.text-orange-400\/80{color:#ff8b1acc}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/80{color:color-mix(in oklab,var(--color-orange-400)80%,transparent)}}.text-pink-400{color:var(--color-pink-400)}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-400\/60{color:#fac80099}@supports (color:color-mix(in lab,red,red)){.text-yellow-400\/60{color:color-mix(in oklab,var(--color-yellow-400)60%,transparent)}}.text-yellow-500\/70{color:#edb200b3}@supports (color:color-mix(in lab,red,red)){.text-yellow-500\/70{color:color-mix(in oklab,var(--color-yellow-500)70%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-55{opacity:.55}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[\#38bdac\]\/20{--tw-shadow-color:#38bdac33}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#38bdac\]\/30{--tw-shadow-color:#38bdac4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.3) var(--tw-shadow-alpha),transparent)}}.ring-\[\#38bdac\]{--tw-ring-color:#38bdac}.ring-\[\#38bdac\]\/40{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.4)}.ring-\[\#38bdac\]\/50{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.5)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:text-\[\#38bdac\]:is(:where(.group):hover *){color:#38bdac}.group-hover\:text-gray-400:is(:where(.group):hover *){color:var(--color-gray-400)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.placeholder\:text-gray-500::placeholder{color:var(--color-gray-500)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[\#38bdac\]\/30:hover{border-color:#38bdac4d}.hover\:border-\[\#38bdac\]\/50:hover{border-color:#38bdac80}.hover\:border-\[\#38bdac\]\/60:hover{border-color:#38bdac99}.hover\:border-amber-500\/40:hover{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.hover\:border-amber-500\/40:hover{border-color:color-mix(in oklab,var(--color-amber-500)40%,transparent)}}.hover\:border-blue-500\/60:hover{border-color:#3080ff99}@supports (color:color-mix(in lab,red,red)){.hover\:border-blue-500\/60:hover{border-color:color-mix(in oklab,var(--color-blue-500)60%,transparent)}}.hover\:border-gray-500:hover{border-color:var(--color-gray-500)}.hover\:border-gray-600:hover{border-color:var(--color-gray-600)}.hover\:border-orange-500\/50:hover{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.hover\:border-orange-500\/50:hover{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.hover\:border-yellow-500\/60:hover{border-color:#edb20099}@supports (color:color-mix(in lab,red,red)){.hover\:border-yellow-500\/60:hover{border-color:color-mix(in oklab,var(--color-yellow-500)60%,transparent)}}.hover\:bg-\[\#0a1628\]:hover{background-color:#0a1628}.hover\:bg-\[\#1a3050\]:hover{background-color:#1a3050}.hover\:bg-\[\#2da396\]:hover{background-color:#2da396}.hover\:bg-\[\#06AD51\]:hover{background-color:#06ad51}.hover\:bg-\[\#07C160\]\/10:hover{background-color:#07c1601a}.hover\:bg-\[\#20B2AA\]:hover{background-color:#20b2aa}.hover\:bg-\[\#38bdac\]\/10:hover{background-color:#38bdac1a}.hover\:bg-\[\#38bdac\]\/20:hover{background-color:#38bdac33}.hover\:bg-\[\#162840\]:hover{background-color:#162840}.hover\:bg-\[\#162840\]\/30:hover{background-color:#1628404d}.hover\:bg-\[\#162840\]\/50:hover{background-color:#16284080}.hover\:bg-amber-400\/10:hover{background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-400\/10:hover{background-color:color-mix(in oklab,var(--color-amber-400)10%,transparent)}}.hover\:bg-amber-500\/10:hover{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/10:hover{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.hover\:bg-amber-500\/20:hover{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/20:hover{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-blue-400\/10:hover{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-400\/10:hover{background-color:color-mix(in oklab,var(--color-blue-400)10%,transparent)}}.hover\:bg-blue-500\/20:hover{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-500\/20:hover{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.hover\:bg-gray-500\/20:hover{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-500\/20:hover{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/10:hover{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/10:hover{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-purple-500\/10:hover{background-color:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/10:hover{background-color:color-mix(in oklab,var(--color-purple-500)10%,transparent)}}.hover\:bg-purple-500\/20:hover{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/20:hover{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.hover\:bg-purple-500\/30:hover{background-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/30:hover{background-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\:bg-yellow-400\/10:hover{background-color:#fac8001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-400\/10:hover{background-color:color-mix(in oklab,var(--color-yellow-400)10%,transparent)}}.hover\:bg-yellow-500\/20:hover{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-500\/20:hover{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.hover\:text-\[\#38bdac\]:hover{color:#38bdac}.hover\:text-amber-300:hover{color:var(--color-amber-300)}.hover\:text-amber-400:hover{color:var(--color-amber-400)}.hover\:text-blue-400:hover{color:var(--color-blue-400)}.hover\:text-gray-300:hover{color:var(--color-gray-300)}.hover\:text-orange-400:hover{color:var(--color-orange-400)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-yellow-400:hover{color:var(--color-yellow-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:border-\[\#38bdac\]:focus{border-color:#38bdac}.focus\:border-orange-500\/50:focus{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.focus\:border-orange-500\/50:focus{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.focus\:bg-\[\#38bdac\]\/20:focus{background-color:#38bdac33}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#38bdac\]:focus{--tw-ring-color:#38bdac}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#38bdac\]:focus-visible{--tw-ring-color:#38bdac}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-\[\#0a1628\]:focus-visible{--tw-ring-offset-color:#0a1628}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-\[\#07C160\]\/20[data-state=active]{background-color:#07c16033}.data-\[state\=active\]\:bg-\[\#26A17B\]\/20[data-state=active]{background-color:#26a17b33}.data-\[state\=active\]\:bg-\[\#38bdac\]\/20[data-state=active]{background-color:#38bdac33}.data-\[state\=active\]\:bg-\[\#1677FF\]\/20[data-state=active]{background-color:#1677ff33}.data-\[state\=active\]\:bg-\[\#003087\]\/20[data-state=active]{background-color:#00308733}.data-\[state\=active\]\:bg-amber-500\/20[data-state=active]{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.data-\[state\=active\]\:bg-amber-500\/20[data-state=active]{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.data-\[state\=active\]\:font-medium[data-state=active]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[state\=active\]\:text-\[\#07C160\][data-state=active]{color:#07c160}.data-\[state\=active\]\:text-\[\#26A17B\][data-state=active]{color:#26a17b}.data-\[state\=active\]\:text-\[\#38bdac\][data-state=active]{color:#38bdac}.data-\[state\=active\]\:text-\[\#169BD7\][data-state=active]{color:#169bd7}.data-\[state\=active\]\:text-\[\#1677FF\][data-state=active]{color:#1677ff}.data-\[state\=active\]\:text-amber-400[data-state=active]{color:var(--color-amber-400)}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[\#38bdac\][data-state=checked]{background-color:#38bdac}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-gray-600[data-state=unchecked]{background-color:var(--color-gray-600)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(min-width:64rem){.lg\:block{display:block}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}}@media(min-width:80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}}:root{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20% .02 240);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20% .02 240);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(65% .15 180);--primary-foreground:oklch(20% 0 0);--secondary:oklch(27% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27% 0 0);--muted-foreground:oklch(65% 0 0);--accent:oklch(27% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(55% .2 25);--destructive-foreground:oklch(98.5% 0 0);--border:oklch(35% 0 0);--input:oklch(35% 0 0);--ring:oklch(65% .15 180);--radius:.625rem}body{font-family:var(--font-sans);color:var(--foreground);background:#0a1628}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/soul-admin/dist/index.html b/soul-admin/dist/index.html index 2855467c..e73b350b 100644 --- a/soul-admin/dist/index.html +++ b/soul-admin/dist/index.html @@ -4,8 +4,8 @@ 管理后台 - Soul创业派对 - - + +
diff --git a/soul-admin/src/pages/content/ChapterTree.tsx b/soul-admin/src/pages/content/ChapterTree.tsx index 4a442f6d..e50e35bf 100644 --- a/soul-admin/src/pages/content/ChapterTree.tsx +++ b/soul-admin/src/pages/content/ChapterTree.tsx @@ -331,17 +331,13 @@ export function ChapterTree({ )}
- -
- )