diff --git a/soul-admin/dist/assets/index-CTqemkTd.css b/soul-admin/dist/assets/index-CTqemkTd.css new file mode 100644 index 00000000..28bdaa29 --- /dev/null +++ b/soul-admin/dist/assets/index-CTqemkTd.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}.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-\[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}.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-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-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-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\: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))}}.\[\&_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-H95_wL23.css b/soul-admin/dist/assets/index-H95_wL23.css deleted file mode 100644 index ef99a3a4..00000000 --- a/soul-admin/dist/assets/index-H95_wL23.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-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-1\.5{margin-right:calc(var(--spacing)*1.5)}.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}.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-2\.5{height:calc(var(--spacing)*2.5)}.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-\[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-2\.5{width:calc(var(--spacing)*2.5)}.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-\[180px\]{max-width:180px}.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}.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-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-gray-800{background-color:var(--color-gray-800)}.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-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-2\.5{padding-inline:calc(var(--spacing)*2.5)}.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-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-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\/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-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-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\: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))}}.\[\&_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-CjXbMT_6.js b/soul-admin/dist/assets/index-ytee3iAw.js similarity index 60% rename from soul-admin/dist/assets/index-CjXbMT_6.js rename to soul-admin/dist/assets/index-ytee3iAw.js index 9e696472..5d0e6bec 100644 --- a/soul-admin/dist/assets/index-CjXbMT_6.js +++ b/soul-admin/dist/assets/index-ytee3iAw.js @@ -1,4 +1,4 @@ -function bv(r,a){for(var l=0;lo[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(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 o(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function Ix(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var yd={exports:{}},Sl={},vd={exports:{}},Ze={};/** +function bv(r,a){for(var l=0;lo[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function l(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(c){if(c.ep)return;c.ep=!0;const u=l(c);fetch(c.href,u)}})();function Ix(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 * @@ -6,7 +6,7 @@ function bv(r,a){for(var l=0;l>>1,O=B[A];if(0>>1;Ac(G,K))dec(Q,G)?(B[A]=Q,B[de]=K,A=de):(B[A]=G,B[J]=K,A=J);else if(dec(Q,K))B[A]=Q,B[de]=K,A=de;else break e}}return ce}function c(B,ce){var K=B.sortIndex-ce.sortIndex;return K!==0?K:B.id-ce.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 y=[],g=[],p=1,v=null,C=3,P=!1,T=!1,b=!1,N=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,k=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(B){for(var ce=l(g);ce!==null;){if(ce.callback===null)o(g);else if(ce.startTime<=B)o(g),ce.sortIndex=ce.expirationTime,a(y,ce);else break;ce=l(g)}}function _(B){if(b=!1,j(B),!T)if(l(y)!==null)T=!0,ie(U);else{var ce=l(g);ce!==null&&ve(_,ce.startTime-B)}}function U(B,ce){T=!1,b&&(b=!1,w(R),R=-1),P=!0;var K=C;try{for(j(ce),v=l(y);v!==null&&(!(v.expirationTime>ce)||B&&!ne());){var A=v.callback;if(typeof A=="function"){v.callback=null,C=v.priorityLevel;var O=A(v.expirationTime<=ce);ce=r.unstable_now(),typeof O=="function"?v.callback=O:v===l(y)&&o(y),j(ce)}else o(y);v=l(y)}if(v!==null)var L=!0;else{var J=l(g);J!==null&&ve(_,J.startTime-ce),L=!1}return L}finally{v=null,C=K,P=!1}}var V=!1,I=null,R=-1,E=5,Y=-1;function ne(){return!(r.unstable_now()-YB||125A?(B.sortIndex=K,a(g,B),l(y)===null&&B===l(g)&&(b?(w(R),R=-1):b=!0,ve(_,K-A))):(B.sortIndex=O,a(y,B),T||P||(T=!0,ie(U))),B},r.unstable_shouldYield=ne,r.unstable_wrapCallback=function(B){var ce=C;return function(){var K=C;C=ce;try{return B.apply(this,arguments)}finally{C=K}}}})(Nd)),Nd}var wf;function kv(){return wf||(wf=1,bd.exports=Cv()),bd.exports}/** + */var Nf;function Cv(){return Nf||(Nf=1,(function(r){function a(z,ne){var W=z.length;z.push(ne);e:for(;0>>1,O=z[M];if(0>>1;Mc(K,W))dec(Y,K)?(z[M]=Y,z[de]=W,M=de):(z[M]=K,z[X]=W,M=X);else if(dec(Y,W))z[M]=Y,z[de]=W,M=de;else break e}}return ne}function c(z,ne){var W=z.sortIndex-ne.sortIndex;return W!==0?W:z.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;r.unstable_now=function(){return u.now()}}else{var m=Date,f=m.now();r.unstable_now=function(){return m.now()-f}}var y=[],g=[],p=1,v=null,k=3,P=!1,T=!1,b=!1,N=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(z){for(var ne=l(g);ne!==null;){if(ne.callback===null)o(g);else if(ne.startTime<=z)o(g),ne.sortIndex=ne.expirationTime,a(y,ne);else break;ne=l(g)}}function R(z){if(b=!1,j(z),!T)if(l(y)!==null)T=!0,ie(Q);else{var ne=l(g);ne!==null&&ve(R,ne.startTime-z)}}function Q(z,ne){T=!1,b&&(b=!1,C(I),I=-1),P=!0;var W=k;try{for(j(ne),v=l(y);v!==null&&(!(v.expirationTime>ne)||z&&!se());){var M=v.callback;if(typeof M=="function"){v.callback=null,k=v.priorityLevel;var O=M(v.expirationTime<=ne);ne=r.unstable_now(),typeof O=="function"?v.callback=O:v===l(y)&&o(y),j(ne)}else o(y);v=l(y)}if(v!==null)var L=!0;else{var X=l(g);X!==null&&ve(R,X.startTime-ne),L=!1}return L}finally{v=null,k=W,P=!1}}var Z=!1,A=null,I=-1,w=5,U=-1;function se(){return!(r.unstable_now()-Uz||125M?(z.sortIndex=W,a(g,z),l(y)===null&&z===l(g)&&(b?(C(I),I=-1):b=!0,ve(R,W-M))):(z.sortIndex=O,a(y,z),T||P||(T=!0,ie(Q))),z},r.unstable_shouldYield=se,r.unstable_wrapCallback=function(z){var ne=k;return function(){var W=k;k=ne;try{return z.apply(this,arguments)}finally{k=W}}}})(Nd)),Nd}var wf;function kv(){return wf||(wf=1,bd.exports=Cv()),bd.exports}/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function bv(r,a){for(var l=0;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},v={};function C(t){return y.call(v,t)?!0:y.call(p,t)?!1:g.test(t)?v[t]=!0:(p[t]=!0,!1)}function P(t,s,n,i){if(n!==null&&n.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function T(t,s,n,i){if(s===null||typeof s>"u"||P(t,s,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function b(t,s,n,i,u,x,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=i,this.attributeNamespace=u,this.mustUseProperty=n,this.propertyName=t,this.type=s,this.sanitizeURL=x,this.removeEmptyString=S}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){N[t]=new b(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var s=t[0];N[s]=new b(s,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){N[t]=new b(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){N[t]=new b(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){N[t]=new b(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){N[t]=new b(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){N[t]=new b(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){N[t]=new b(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){N[t]=new b(t,5,!1,t.toLowerCase(),null,!1,!1)});var w=/[\-:]([a-z])/g;function k(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var s=t.replace(w,k);N[s]=new b(s,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var s=t.replace(w,k);N[s]=new b(s,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var s=t.replace(w,k);N[s]=new b(s,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){N[t]=new b(t,1,!1,t.toLowerCase(),null,!1,!1)}),N.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){N[t]=new b(t,1,!1,t.toLowerCase(),null,!0,!0)});function j(t,s,n,i){var u=N.hasOwnProperty(s)?N[s]:null;(u!==null?u.type!==0:i||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},v={};function k(t){return y.call(v,t)?!0:y.call(p,t)?!1:g.test(t)?v[t]=!0:(p[t]=!0,!1)}function P(t,s,n,i){if(n!==null&&n.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function T(t,s,n,i){if(s===null||typeof s>"u"||P(t,s,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function b(t,s,n,i,d,x,S){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=n,this.propertyName=t,this.type=s,this.sanitizeURL=x,this.removeEmptyString=S}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){N[t]=new b(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var s=t[0];N[s]=new b(s,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){N[t]=new b(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){N[t]=new b(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){N[t]=new b(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){N[t]=new b(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){N[t]=new b(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){N[t]=new b(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){N[t]=new b(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);N[s]=new b(s,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var s=t.replace(C,E);N[s]=new b(s,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var s=t.replace(C,E);N[s]=new b(s,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){N[t]=new b(t,1,!1,t.toLowerCase(),null,!1,!1)}),N.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){N[t]=new b(t,1,!1,t.toLowerCase(),null,!0,!0)});function j(t,s,n,i){var d=N.hasOwnProperty(s)?N[s]:null;(d!==null?d.type!==0:i||!(2M||u[S]!==x[M]){var $=` -`+u[S].replace(" at new "," at ");return t.displayName&&$.includes("")&&($=$.replace("",t.displayName)),$}while(1<=S&&0<=M);break}}}finally{L=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?O(t):""}function G(t){switch(t.tag){case 5:return O(t.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return t=J(t.type,!1),t;case 11:return t=J(t.type.render,!1),t;case 1:return t=J(t.type,!0),t;default:return""}}function de(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case I:return"Fragment";case V:return"Portal";case E:return"Profiler";case R:return"StrictMode";case q:return"Suspense";case se:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case ne:return(t.displayName||"Context")+".Consumer";case Y:return(t._context.displayName||"Context")+".Provider";case ae:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return s=t.displayName||null,s!==null?s:de(t.type)||"Memo";case ie: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===R?"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 ge(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 D(t){var s=Se(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),i=""+t[s];if(!t.hasOwnProperty(s)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var u=n.get,x=n.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return u.call(this)},set:function(S){i=""+S,x.call(this,S)}}),Object.defineProperty(t,s,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(S){i=""+S},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function fe(t){t._valueTracker||(t._valueTracker=D(t))}function ke(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var n=s.getValue(),i="";return t&&(i=Se(t)?t.checked?"true":"false":t.value),t=i,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 K({},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,i=s.checked!=null?s.checked:s.defaultChecked;n=ge(s.value!=null?s.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function tt(t,s){s=s.checked,s!=null&&j(t,"checked",s,!1)}function ze(t,s){tt(t,s);var n=ge(s.value),i=s.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}s.hasOwnProperty("value")?xe(t,s.type,n):s.hasOwnProperty("defaultValue")&&xe(t,s.type,ge(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(t.defaultChecked=!!s.defaultChecked)}function he(t,s,n){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var i=s.type;if(!(i!=="submit"&&i!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+t._wrapperState.initialValue,n||s===t.value||(t.value=s),t.defaultValue=s}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function xe(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,i){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 i=n.indexOf("--")===0,u=Qn(n,s[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,u):t[n]=u}}var Sn=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function 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=cl(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-(Og(t)/Fg|0)|0}var Wl=64,Hl=4194304;function Ha(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 i=0,u=t.suspendedLanes,x=t.pingedLanes,S=n&268435455;if(S!==0){var M=S&~u;M!==0?i=Ha(M):(x&=S,x!==0&&(i=Ha(x)))}else S=n&~u,S!==0?i=Ha(S):x!==0&&(i=Ha(x));if(i===0)return 0;if(s!==0&&s!==i&&(s&u)===0&&(u=i&-i,x=s&-s,u>=x||u===16&&(x&4194240)!==0))return s;if((i&4)!==0&&(i|=n&16),s=t.entangledLanes,s!==0)for(t=t.entanglements,s&=i;0n;n++)s.push(t);return s}function Ka(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 Ug(t,s){var n=t.pendingLanes&~s;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=s,t.mutableReadLanes&=s,t.entangledLanes&=s,s=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0=el),dh=" ",uh=!1;function hh(t,s){switch(t){case"keyup":return py.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ra=!1;function yy(t,s){switch(t){case"compositionend":return mh(s);case"keypress":return s.which!==32?null:(uh=!0,dh);case"textInput":return t=s.data,t===dh&&uh?null:t;default:return null}}function vy(t,s){if(ra)return t==="compositionend"||!Jo&&hh(t,s)?(t=nh(),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=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=jh(n)}}function Nh(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Nh(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function wh(){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 Py(t){var s=wh(),n=t.focusedElem,i=t.selectionRange;if(s!==n&&n&&n.ownerDocument&&Nh(n.ownerDocument.documentElement,n)){if(i!==null&&tc(n)){if(s=i.start,t=i.end,t===void 0&&(t=s),"selectionStart"in n)n.selectionStart=s,n.selectionEnd=Math.min(t,n.value.length);else if(t=(s=n.ownerDocument||document)&&s.defaultView||window,t.getSelection){t=t.getSelection();var u=n.textContent.length,x=Math.min(i.start,u);i=i.end===void 0?x:Math.min(i.end,u),!t.extend&&x>i&&(u=i,i=x,x=u),u=bh(n,x);var S=bh(n,i);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>i?(t.addRange(s),t.extend(S.node,S.offset)):(s.setEnd(S.node,S.offset),t.addRange(s)))}}for(s=[],t=n;t=t.parentNode;)t.nodeType===1&&s.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,na=null,sc=null,nl=null,rc=!1;function Sh(t,s,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;rc||na==null||na!==Ve(i)||(i=na,"selectionStart"in i&&tc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),nl&&rl(nl,i)||(nl=i,i=ai(sc,"onSelect"),0ca||(t.current=xc[ca],xc[ca]=null,ca--)}function ut(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 i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===s)return i.__reactInternalMemoizedMaskedChildContext;var u={},x;for(x in n)u[x]=s[x];return i&&(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 zh(t,s,n){if(Qt.current!==Vr)throw Error(l(168));ut(Qt,s),ut(is,n)}function $h(t,s,n){var i=t.stateNode;if(s=s.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var u in i)if(!(u in s))throw Error(l(108,Q(t)||"Unknown",u));return K({},n,i)}function di(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Vr,Rn=Qt.current,ut(Qt,t),ut(is,is.current),!0}function Bh(t,s,n){var i=t.stateNode;if(!i)throw Error(l(169));n?(t=$h(t,s,Rn),i.__reactInternalMemoizedMergedChildContext=t,gt(is),gt(Qt),ut(Qt,t)):gt(is),ut(is,n)}var gr=null,ui=!1,pc=!1;function Uh(t){gr===null?gr=[t]:gr.push(t)}function $y(t){ui=!0,Uh(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=Fe,Fe=null):Wt=Fe.sibling;var rt=ue(X,Fe,ee[Ue],je);if(rt===null){Fe===null&&(Fe=Wt);break}t&&Fe&&rt.alternate===null&&s(X,Fe),W=x(rt,W,Ue),Oe===null?De=rt:Oe.sibling=rt,Oe=rt,Fe=Wt}if(Ue===ee.length)return n(X,Fe),bt&&_n(X,Ue),De;if(Fe===null){for(;UeUe?(Wt=Fe,Fe=null):Wt=Fe.sibling;var Zr=ue(X,Fe,rt.value,je);if(Zr===null){Fe===null&&(Fe=Wt);break}t&&Fe&&Zr.alternate===null&&s(X,Fe),W=x(Zr,W,Ue),Oe===null?De=Zr:Oe.sibling=Zr,Oe=Zr,Fe=Wt}if(rt.done)return n(X,Fe),bt&&_n(X,Ue),De;if(Fe===null){for(;!rt.done;Ue++,rt=ee.next())rt=ye(X,rt.value,je),rt!==null&&(W=x(rt,W,Ue),Oe===null?De=rt:Oe.sibling=rt,Oe=rt);return bt&&_n(X,Ue),De}for(Fe=i(X,Fe);!rt.done;Ue++,rt=ee.next())rt=Pe(Fe,X,Ue,rt.value,je),rt!==null&&(t&&rt.alternate!==null&&Fe.delete(rt.key===null?Ue:rt.key),W=x(rt,W,Ue),Oe===null?De=rt:Oe.sibling=rt,Oe=rt);return t&&Fe.forEach(function(jv){return s(X,jv)}),bt&&_n(X,Ue),De}function It(X,W,ee,je){if(typeof ee=="object"&&ee!==null&&ee.type===I&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case U:e:{for(var De=ee.key,Oe=W;Oe!==null;){if(Oe.key===De){if(De=ee.type,De===I){if(Oe.tag===7){n(X,Oe.sibling),W=u(Oe,ee.props.children),W.return=X,X=W;break e}}else if(Oe.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===ie&&Yh(De)===Oe.type){n(X,Oe.sibling),W=u(Oe,ee.props),W.ref=dl(X,Oe,ee),W.return=X,X=W;break e}n(X,Oe);break}else s(X,Oe);Oe=Oe.sibling}ee.type===I?(W=$n(ee.props.children,X.mode,je,ee.key),W.return=X,X=W):(je=zi(ee.type,ee.key,ee.props,null,X.mode,je),je.ref=dl(X,W,ee),je.return=X,X=je)}return S(X);case V:e:{for(Oe=ee.key;W!==null;){if(W.key===Oe)if(W.tag===4&&W.stateNode.containerInfo===ee.containerInfo&&W.stateNode.implementation===ee.implementation){n(X,W.sibling),W=u(W,ee.children||[]),W.return=X,X=W;break e}else{n(X,W);break}else s(X,W);W=W.sibling}W=md(ee,X.mode,je),W.return=X,X=W}return S(X);case ie:return Oe=ee._init,It(X,W,Oe(ee._payload),je)}if(ft(ee))return Ie(X,W,ee,je);if(ce(ee))return Ae(X,W,ee,je);xi(X,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,W!==null&&W.tag===6?(n(X,W.sibling),W=u(W,ee),W.return=X,X=W):(n(X,W),W=hd(ee,X.mode,je),W.return=X,X=W),S(X)):n(X,W)}return It}var fa=Qh(!0),qh=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 i=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,i!==null&&(i.childLanes|=s)):i!==null&&(i.childLanes&s)!==s&&(i.childLanes|=s),t===n)break;t=t.return}}function 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 Xh(t,s,n,i){var u=s.interleaved;return u===null?(n.next=n,kc(s)):(n.next=u.next,u.next=n),s.interleaved=n,jr(t,i)}function jr(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 Jh(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 br(t,s){return{eventTime:t,lane:s,tag:0,payload:null,callback:null,next:null}}function Kr(t,s,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(st&2)!==0){var u=i.pending;return u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s,jr(t,n)}return u=i.interleaved,u===null?(s.next=s,kc(i)):(s.next=u.next,u.next=s),i.interleaved=s,jr(t,n)}function yi(t,s,n){if(s=s.updateQueue,s!==null&&(s=s.shared,(n&4194240)!==0)){var i=s.lanes;i&=t.pendingLanes,n|=i,s.lanes=n,Bo(t,n)}}function Zh(t,s){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var u=null,x=null;if(n=n.firstBaseUpdate,n!==null){do{var 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:i.baseState,firstBaseUpdate:u,lastBaseUpdate:x,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=s:t.next=s,n.lastBaseUpdate=s}function vi(t,s,n,i){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 $=M,re=$.next;$.next=null,S===null?x=re:S.next=re,S=$;var me=t.alternate;me!==null&&(me=me.updateQueue,M=me.lastBaseUpdate,M!==S&&(M===null?me.firstBaseUpdate=re:M.next=re,me.lastBaseUpdate=$))}if(x!==null){var ye=u.baseState;S=0,me=re=$=null,M=x;do{var ue=M.lane,Pe=M.eventTime;if((i&ue)===ue){me!==null&&(me=me.next={eventTime:Pe,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var Ie=t,Ae=M;switch(ue=s,Pe=n,Ae.tag){case 1:if(Ie=Ae.payload,typeof Ie=="function"){ye=Ie.call(Pe,ye,ue);break e}ye=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Ae.payload,ue=typeof Ie=="function"?Ie.call(Pe,ye,ue):Ie,ue==null)break e;ye=K({},ye,ue);break e;case 2:Hr=!0}}M.callback!==null&&M.lane!==0&&(t.flags|=64,ue=u.effects,ue===null?u.effects=[M]:ue.push(M))}else Pe={eventTime:Pe,lane:ue,tag:M.tag,payload:M.payload,callback:M.callback,next:null},me===null?(re=me=Pe,$=ye):me=me.next=Pe,S|=ue;if(M=M.next,M===null){if(M=u.shared.pending,M===null)break;ue=M,M=ue.next,ue.next=null,u.lastBaseUpdate=ue,u.shared.pending=null}}while(!0);if(me===null&&($=ye),u.baseState=$,u.firstBaseUpdate=re,u.lastBaseUpdate=me,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=ye}}function em(t,s,n){if(t=s.effects,s.effects=null,t!==null)for(s=0;sn?n:4,t(!0);var i=_c.transition;_c.transition={};try{t(!1),s()}finally{it=n,_c.transition=i}}function vm(){return Is().memoizedState}function Wy(t,s,n){var i=qr(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},jm(t))bm(s,n);else if(n=Xh(t,s,n,i),n!==null){var u=rs();Gs(n,t,i,u),Nm(n,s,i)}}function Hy(t,s,n){var i=qr(t),u={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(jm(t))bm(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 $=s.interleaved;$===null?(u.next=u,kc(s)):(u.next=$.next,$.next=u),s.interleaved=u;return}}catch{}finally{}n=Xh(t,s,u,i),n!==null&&(u=rs(),Gs(n,t,i,u),Nm(n,s,i))}}function jm(t){var s=t.alternate;return t===St||s!==null&&s===St}function bm(t,s){fl=Ni=!0;var n=t.pending;n===null?s.next=s:(s.next=n.next,n.next=s),t.pending=s}function Nm(t,s,n){if((n&4194240)!==0){var i=s.lanes;i&=t.pendingLanes,n|=i,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},Ky={readContext:Rs,useCallback:function(t,s){return nr().memoizedState=[t,s===void 0?null:s],t},useContext:Rs,useEffect:um,useImperativeHandle:function(t,s,n){return n=n!=null?n.concat([t]):null,wi(4194308,4,fm.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 i=nr();return s=n!==void 0?n(s):s,i.memoizedState=i.baseState=s,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},i.queue=t,t=t.dispatch=Wy.bind(null,St,t),[i.memoizedState,t]},useRef:function(t){var s=nr();return t={current:t},s.memoizedState=t},useState:cm,useDebugValue:zc,useDeferredValue:function(t){return nr().memoizedState=t},useTransition:function(){var t=cm(!1),s=t[0];return t=Vy.bind(null,t[1]),nr().memoizedState=t,[s,t]},useMutableSource:function(){},useSyncExternalStore:function(t,s,n){var i=St,u=nr();if(bt){if(n===void 0)throw Error(l(407));n=n()}else{if(n=s(),Vt===null)throw Error(l(349));(Dn&30)!==0||nm(i,s,n)}u.memoizedState=n;var x={value:n,getSnapshot:s};return u.queue=x,um(lm.bind(null,i,x,t),[t]),i.flags|=2048,gl(9,am.bind(null,i,x,n,s),void 0,null),n},useId:function(){var t=nr(),s=Vt.identifierPrefix;if(bt){var n=vr,i=yr;n=(i&~(1<<32-Bs(i)-1)).toString(32)+n,s=":"+s+"R"+n,n=xl++,0_||d[S]!==x[_]){var B=` +`+d[S].replace(" at new "," at ");return t.displayName&&B.includes("")&&(B=B.replace("",t.displayName)),B}while(1<=S&&0<=_);break}}}finally{L=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?O(t):""}function K(t){switch(t.tag){case 5:return O(t.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return t=X(t.type,!1),t;case 11:return t=X(t.type.render,!1),t;case 1:return t=X(t.type,!0),t;default:return""}}function de(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case Z:return"Portal";case w:return"Profiler";case I:return"StrictMode";case G:return"Suspense";case re:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case se:return(t.displayName||"Context")+".Consumer";case U:return(t._context.displayName||"Context")+".Provider";case le:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return s=t.displayName||null,s!==null?s:de(t.type)||"Memo";case ie:s=t._payload,t=t._init;try{return de(t(s))}catch{}}return null}function Y(t){var s=t.type;switch(t.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=s.render,t=t.displayName||t.name||"",s.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(s);case 8:return s===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 ge(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 D(t){var s=Se(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),i=""+t[s];if(!t.hasOwnProperty(s)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var d=n.get,x=n.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return d.call(this)},set:function(S){i=""+S,x.call(this,S)}}),Object.defineProperty(t,s,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(S){i=""+S},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function fe(t){t._valueTracker||(t._valueTracker=D(t))}function ke(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var n=s.getValue(),i="";return t&&(i=Se(t)?t.checked?"true":"false":t.value),t=i,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 W({},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,i=s.checked!=null?s.checked:s.defaultChecked;n=ge(s.value!=null?s.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function tt(t,s){s=s.checked,s!=null&&j(t,"checked",s,!1)}function ze(t,s){tt(t,s);var n=ge(s.value),i=s.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}s.hasOwnProperty("value")?xe(t,s.type,n):s.hasOwnProperty("defaultValue")&&xe(t,s.type,ge(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(t.defaultChecked=!!s.defaultChecked)}function he(t,s,n){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var i=s.type;if(!(i!=="submit"&&i!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+t._wrapperState.initialValue,n||s===t.value||(t.value=s),t.defaultValue=s}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function xe(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,i){if(t=t.options,s){s={};for(var d=0;d"+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 i=n.indexOf("--")===0,d=Qn(n,s[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,d):t[n]=d}}var wn=W({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fr(t,s){if(s){if(wn[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 Sn=null,Es=null,Os=null;function Fs(t){if(t=dl(t)){if(typeof Sn!="function")throw Error(l(280));var s=t.stateNode;s&&(s=oi(s),Sn(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-(Og(t)/Fg|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 i=0,d=t.suspendedLanes,x=t.pingedLanes,S=n&268435455;if(S!==0){var _=S&~d;_!==0?i=Ka(_):(x&=S,x!==0&&(i=Ka(x)))}else S=n&~d,S!==0?i=Ka(S):x!==0&&(i=Ka(x));if(i===0)return 0;if(s!==0&&s!==i&&(s&d)===0&&(d=i&-i,x=s&-s,d>=x||d===16&&(x&4194240)!==0))return s;if((i&4)!==0&&(i|=n&16),s=t.entangledLanes,s!==0)for(t=t.entanglements,s&=i;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 Ug(t,s){var n=t.pendingLanes&~s;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=s,t.mutableReadLanes&=s,t.entangledLanes&=s,s=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0=tl),dh=" ",uh=!1;function hh(t,s){switch(t){case"keyup":return py.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ra=!1;function yy(t,s){switch(t){case"compositionend":return mh(s);case"keypress":return s.which!==32?null:(uh=!0,dh);case"textInput":return t=s.data,t===dh&&uh?null:t;default:return null}}function vy(t,s){if(ra)return t==="compositionend"||!Jo&&hh(t,s)?(t=nh(),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=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=jh(n)}}function Nh(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Nh(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function wh(){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 Py(t){var s=wh(),n=t.focusedElem,i=t.selectionRange;if(s!==n&&n&&n.ownerDocument&&Nh(n.ownerDocument.documentElement,n)){if(i!==null&&tc(n)){if(s=i.start,t=i.end,t===void 0&&(t=s),"selectionStart"in n)n.selectionStart=s,n.selectionEnd=Math.min(t,n.value.length);else if(t=(s=n.ownerDocument||document)&&s.defaultView||window,t.getSelection){t=t.getSelection();var d=n.textContent.length,x=Math.min(i.start,d);i=i.end===void 0?x:Math.min(i.end,d),!t.extend&&x>i&&(d=i,i=x,x=d),d=bh(n,x);var S=bh(n,i);d&&S&&(t.rangeCount!==1||t.anchorNode!==d.node||t.anchorOffset!==d.offset||t.focusNode!==S.node||t.focusOffset!==S.offset)&&(s=s.createRange(),s.setStart(d.node,d.offset),t.removeAllRanges(),x>i?(t.addRange(s),t.extend(S.node,S.offset)):(s.setEnd(S.node,S.offset),t.addRange(s)))}}for(s=[],t=n;t=t.parentNode;)t.nodeType===1&&s.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,na=null,sc=null,al=null,rc=!1;function Sh(t,s,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;rc||na==null||na!==Ve(i)||(i=na,"selectionStart"in i&&tc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),al&&nl(al,i)||(al=i,i=ai(sc,"onSelect"),0ca||(t.current=xc[ca],xc[ca]=null,ca--)}function ut(t,s){ca++,xc[ca]=t.current,t.current=s}var Vr={},Qt=Ur(Vr),is=Ur(!1),Tn=Vr;function da(t,s){var n=t.type.contextTypes;if(!n)return Vr;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===s)return i.__reactInternalMemoizedMaskedChildContext;var d={},x;for(x in n)d[x]=s[x];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=d),d}function os(t){return t=t.childContextTypes,t!=null}function ci(){gt(is),gt(Qt)}function zh(t,s,n){if(Qt.current!==Vr)throw Error(l(168));ut(Qt,s),ut(is,n)}function $h(t,s,n){var i=t.stateNode;if(s=s.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var d in i)if(!(d in s))throw Error(l(108,Y(t)||"Unknown",d));return W({},n,i)}function di(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Vr,Tn=Qt.current,ut(Qt,t),ut(is,is.current),!0}function Bh(t,s,n){var i=t.stateNode;if(!i)throw Error(l(169));n?(t=$h(t,s,Tn),i.__reactInternalMemoizedMergedChildContext=t,gt(is),gt(Qt),ut(Qt,t)):gt(is),ut(is,n)}var gr=null,ui=!1,pc=!1;function Uh(t){gr===null?gr=[t]:gr.push(t)}function $y(t){ui=!0,Uh(t)}function Wr(){if(!pc&&gr!==null){pc=!0;var t=0,s=it;try{var n=gr;for(it=1;t>=S,d-=S,yr=1<<32-Bs(s)+d|n<Ue?(Wt=Fe,Fe=null):Wt=Fe.sibling;var rt=ue(q,Fe,ee[Ue],je);if(rt===null){Fe===null&&(Fe=Wt);break}t&&Fe&&rt.alternate===null&&s(q,Fe),V=x(rt,V,Ue),Oe===null?De=rt:Oe.sibling=rt,Oe=rt,Fe=Wt}if(Ue===ee.length)return n(q,Fe),bt&&In(q,Ue),De;if(Fe===null){for(;UeUe?(Wt=Fe,Fe=null):Wt=Fe.sibling;var Zr=ue(q,Fe,rt.value,je);if(Zr===null){Fe===null&&(Fe=Wt);break}t&&Fe&&Zr.alternate===null&&s(q,Fe),V=x(Zr,V,Ue),Oe===null?De=Zr:Oe.sibling=Zr,Oe=Zr,Fe=Wt}if(rt.done)return n(q,Fe),bt&&In(q,Ue),De;if(Fe===null){for(;!rt.done;Ue++,rt=ee.next())rt=ye(q,rt.value,je),rt!==null&&(V=x(rt,V,Ue),Oe===null?De=rt:Oe.sibling=rt,Oe=rt);return bt&&In(q,Ue),De}for(Fe=i(q,Fe);!rt.done;Ue++,rt=ee.next())rt=Pe(Fe,q,Ue,rt.value,je),rt!==null&&(t&&rt.alternate!==null&&Fe.delete(rt.key===null?Ue:rt.key),V=x(rt,V,Ue),Oe===null?De=rt:Oe.sibling=rt,Oe=rt);return t&&Fe.forEach(function(jv){return s(q,jv)}),bt&&In(q,Ue),De}function It(q,V,ee,je){if(typeof ee=="object"&&ee!==null&&ee.type===A&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case Q:e:{for(var De=ee.key,Oe=V;Oe!==null;){if(Oe.key===De){if(De=ee.type,De===A){if(Oe.tag===7){n(q,Oe.sibling),V=d(Oe,ee.props.children),V.return=q,q=V;break e}}else if(Oe.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===ie&&Yh(De)===Oe.type){n(q,Oe.sibling),V=d(Oe,ee.props),V.ref=ul(q,Oe,ee),V.return=q,q=V;break e}n(q,Oe);break}else s(q,Oe);Oe=Oe.sibling}ee.type===A?(V=zn(ee.props.children,q.mode,je,ee.key),V.return=q,q=V):(je=zi(ee.type,ee.key,ee.props,null,q.mode,je),je.ref=ul(q,V,ee),je.return=q,q=je)}return S(q);case Z:e:{for(Oe=ee.key;V!==null;){if(V.key===Oe)if(V.tag===4&&V.stateNode.containerInfo===ee.containerInfo&&V.stateNode.implementation===ee.implementation){n(q,V.sibling),V=d(V,ee.children||[]),V.return=q,q=V;break e}else{n(q,V);break}else s(q,V);V=V.sibling}V=md(ee,q.mode,je),V.return=q,q=V}return S(q);case ie:return Oe=ee._init,It(q,V,Oe(ee._payload),je)}if(ft(ee))return Ie(q,V,ee,je);if(ne(ee))return Ae(q,V,ee,je);xi(q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,V!==null&&V.tag===6?(n(q,V.sibling),V=d(V,ee),V.return=q,q=V):(n(q,V),V=hd(ee,q.mode,je),V.return=q,q=V),S(q)):n(q,V)}return It}var fa=Qh(!0),qh=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 i=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,i!==null&&(i.childLanes|=s)):i!==null&&(i.childLanes&s)!==s&&(i.childLanes|=s),t===n)break;t=t.return}}function 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 _n=null;function kc(t){_n===null?_n=[t]:_n.push(t)}function Xh(t,s,n,i){var d=s.interleaved;return d===null?(n.next=n,kc(s)):(n.next=d.next,d.next=n),s.interleaved=n,jr(t,i)}function jr(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 Jh(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 br(t,s){return{eventTime:t,lane:s,tag:0,payload:null,callback:null,next:null}}function Kr(t,s,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(st&2)!==0){var d=i.pending;return d===null?s.next=s:(s.next=d.next,d.next=s),i.pending=s,jr(t,n)}return d=i.interleaved,d===null?(s.next=s,kc(i)):(s.next=d.next,d.next=s),i.interleaved=s,jr(t,n)}function yi(t,s,n){if(s=s.updateQueue,s!==null&&(s=s.shared,(n&4194240)!==0)){var i=s.lanes;i&=t.pendingLanes,n|=i,s.lanes=n,Bo(t,n)}}function Zh(t,s){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var d=null,x=null;if(n=n.firstBaseUpdate,n!==null){do{var S={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};x===null?d=x=S:x=x.next=S,n=n.next}while(n!==null);x===null?d=x=s:x=x.next=s}else d=x=s;n={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:x,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=s:t.next=s,n.lastBaseUpdate=s}function vi(t,s,n,i){var d=t.updateQueue;Hr=!1;var x=d.firstBaseUpdate,S=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var B=_,ae=B.next;B.next=null,S===null?x=ae:S.next=ae,S=B;var me=t.alternate;me!==null&&(me=me.updateQueue,_=me.lastBaseUpdate,_!==S&&(_===null?me.firstBaseUpdate=ae:_.next=ae,me.lastBaseUpdate=B))}if(x!==null){var ye=d.baseState;S=0,me=ae=B=null,_=x;do{var ue=_.lane,Pe=_.eventTime;if((i&ue)===ue){me!==null&&(me=me.next={eventTime:Pe,lane:0,tag:_.tag,payload:_.payload,callback:_.callback,next:null});e:{var Ie=t,Ae=_;switch(ue=s,Pe=n,Ae.tag){case 1:if(Ie=Ae.payload,typeof Ie=="function"){ye=Ie.call(Pe,ye,ue);break e}ye=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Ae.payload,ue=typeof Ie=="function"?Ie.call(Pe,ye,ue):Ie,ue==null)break e;ye=W({},ye,ue);break e;case 2:Hr=!0}}_.callback!==null&&_.lane!==0&&(t.flags|=64,ue=d.effects,ue===null?d.effects=[_]:ue.push(_))}else Pe={eventTime:Pe,lane:ue,tag:_.tag,payload:_.payload,callback:_.callback,next:null},me===null?(ae=me=Pe,B=ye):me=me.next=Pe,S|=ue;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;ue=_,_=ue.next,ue.next=null,d.lastBaseUpdate=ue,d.shared.pending=null}}while(!0);if(me===null&&(B=ye),d.baseState=B,d.firstBaseUpdate=ae,d.lastBaseUpdate=me,s=d.shared.interleaved,s!==null){d=s;do S|=d.lane,d=d.next;while(d!==s)}else x===null&&(d.shared.lanes=0);Dn|=S,t.lanes=S,t.memoizedState=ye}}function em(t,s,n){if(t=s.effects,s.effects=null,t!==null)for(s=0;sn?n:4,t(!0);var i=_c.transition;_c.transition={};try{t(!1),s()}finally{it=n,_c.transition=i}}function vm(){return Is().memoizedState}function Wy(t,s,n){var i=qr(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},jm(t))bm(s,n);else if(n=Xh(t,s,n,i),n!==null){var d=rs();Gs(n,t,i,d),Nm(n,s,i)}}function Hy(t,s,n){var i=qr(t),d={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(jm(t))bm(s,d);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var S=s.lastRenderedState,_=x(S,n);if(d.hasEagerState=!0,d.eagerState=_,Us(_,S)){var B=s.interleaved;B===null?(d.next=d,kc(s)):(d.next=B.next,B.next=d),s.interleaved=d;return}}catch{}finally{}n=Xh(t,s,d,i),n!==null&&(d=rs(),Gs(n,t,i,d),Nm(n,s,i))}}function jm(t){var s=t.alternate;return t===St||s!==null&&s===St}function bm(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 Nm(t,s,n){if((n&4194240)!==0){var i=s.lanes;i&=t.pendingLanes,n|=i,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},Ky={readContext:Rs,useCallback:function(t,s){return nr().memoizedState=[t,s===void 0?null:s],t},useContext:Rs,useEffect:um,useImperativeHandle:function(t,s,n){return n=n!=null?n.concat([t]):null,wi(4194308,4,fm.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 i=nr();return s=n!==void 0?n(s):s,i.memoizedState=i.baseState=s,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},i.queue=t,t=t.dispatch=Wy.bind(null,St,t),[i.memoizedState,t]},useRef:function(t){var s=nr();return t={current:t},s.memoizedState=t},useState:cm,useDebugValue:zc,useDeferredValue:function(t){return nr().memoizedState=t},useTransition:function(){var t=cm(!1),s=t[0];return t=Vy.bind(null,t[1]),nr().memoizedState=t,[s,t]},useMutableSource:function(){},useSyncExternalStore:function(t,s,n){var i=St,d=nr();if(bt){if(n===void 0)throw Error(l(407));n=n()}else{if(n=s(),Vt===null)throw Error(l(349));(An&30)!==0||nm(i,s,n)}d.memoizedState=n;var x={value:n,getSnapshot:s};return d.queue=x,um(lm.bind(null,i,x,t),[t]),i.flags|=2048,yl(9,am.bind(null,i,x,n,s),void 0,null),n},useId:function(){var t=nr(),s=Vt.identifierPrefix;if(bt){var n=vr,i=yr;n=(i&~(1<<32-Bs(i)-1)).toString(32)+n,s=":"+s+"R"+n,n=pl++,0<\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=S.createElement(n,{is:i.is}):(t=S.createElement(n),n==="select"&&(S=t,i.multiple?S.multiple=!0:i.size&&(S.size=i.size))):t=S.createElementNS(t,n),t[sr]=s,t[ol]=i,Um(t,s,!1,!1),s.stateNode=t;e:{switch(S=ys(n,i),n){case"dialog":pt("cancel",t),pt("close",t),u=i;break;case"iframe":case"object":case"embed":pt("load",t),u=i;break;case"video":case"audio":for(u=0;uba&&(s.flags|=128,i=!0,yl(x,!1),s.lanes=4194304)}else{if(!i)if(t=ji(S),t!==null){if(s.flags|=128,i=!0,n=t.updateQueue,n!==null&&(s.updateQueue=n,s.flags|=4),yl(x,!0),x.tail===null&&x.tailMode==="hidden"&&!S.alternate&&!bt)return Xt(s),null}else 2*dt()-x.renderingStartTime>ba&&n!==1073741824&&(s.flags|=128,i=!0,yl(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,ut(wt,i?n&1|2:n&1),s):(Xt(s),null);case 22:case 23:return cd(),i=s.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(s.flags|=8192),i&&(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 ev(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,tv=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(i){Tt(t,s,i)}else n.current=null}function Xc(t,s,n){try{n()}catch(i){Tt(t,s,i)}}var Hm=!1;function sv(t,s){if(cc=Ql,t=wh(),tc(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var u=i.anchorOffset,x=i.focusNode;i=i.focusOffset;try{n.nodeType,x.nodeType}catch{n=null;break e}var S=0,M=-1,$=-1,re=0,me=0,ye=t,ue=null;t:for(;;){for(var Pe;ye!==n||u!==0&&ye.nodeType!==3||(M=S+u),ye!==x||i!==0&&ye.nodeType!==3||($=S+i),ye.nodeType===3&&(S+=ye.nodeValue.length),(Pe=ye.firstChild)!==null;)ue=ye,ye=Pe;for(;;){if(ye===t)break t;if(ue===n&&++re===u&&(M=S),ue===x&&++me===i&&($=S),(Pe=ye.nextSibling)!==null)break;ye=ue,ue=ye.parentNode}ye=Pe}n=M===-1||$===-1?null:{start:M,end:$}}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,It=Ie.memoizedState,X=s.stateNode,W=X.getSnapshotBeforeUpdate(s.elementType===s.type?Ae:Ws(s.type,Ae),It);X.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var ee=s.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.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=Hm,Hm=!1,Ie}function vl(t,s,n){var i=s.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&t)===t){var x=u.destroy;u.destroy=void 0,x!==void 0&&Xc(s,n,x)}u=u.next}while(u!==i)}}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 i=n.create;n.destroy=i()}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 Km(t){var s=t.alternate;s!==null&&(t.alternate=null,Km(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&(delete s[sr],delete s[ol],delete s[fc],delete s[Fy],delete s[zy])),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 Gm(t){return t.tag===5||t.tag===3||t.tag===4}function Ym(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Gm(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 i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.nodeType===8?n.parentNode.insertBefore(t,s):n.insertBefore(t,s):(n.nodeType===8?(s=n.parentNode,s.insertBefore(t,n)):(s=n,s.appendChild(t)),n=n._reactRootContainer,n!=null||s.onclick!==null||(s.onclick=ii));else if(i!==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 i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.insertBefore(t,s):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(ed(t,s,n),t=t.sibling;t!==null;)ed(t,s,n),t=t.sibling}var Kt=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 i=Kt,u=Hs;Kt=null,Gr(t,s,n),Kt=i,Hs=u,Kt!==null&&(Hs?(t=Kt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Kt.removeChild(n.stateNode));break;case 18:Kt!==null&&(Hs?(t=Kt,n=n.stateNode,t.nodeType===8?mc(t.parentNode,n):t.nodeType===1&&mc(t,n),Xa(t)):mc(Kt,n.stateNode));break;case 4:i=Kt,u=Hs,Kt=n.stateNode.containerInfo,Hs=!0,Gr(t,s,n),Kt=i,Hs=u;break;case 0:case 11:case 14:case 15:if(!Jt&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){u=i=i.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!==i)}Gr(t,s,n);break;case 1:if(!Jt&&(va(n,s),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.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=(i=Jt)||n.memoizedState!==null,Gr(t,s,n),Jt=i):Gr(t,s,n);break;default:Gr(t,s,n)}}function qm(t){var s=t.updateQueue;if(s!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new tv),s.forEach(function(i){var u=uv.bind(null,t,i);n.has(i)||(n.add(i),i.then(u,u))})}}function Ks(t,s){var n=s.deletions;if(n!==null)for(var i=0;iu&&(u=S),i&=~x}if(i=u,i=dt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*nv(i/1960))-i,10t?16:t,Qr===null)var i=!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 $=0;$dt()-rd?Fn(t,0):sd|=n),us(t,s)}function df(t,s){s===0&&((t.mode&1)===0?s=1:(s=Hl,Hl<<=1,(Hl&130023424)===0&&(Hl=4194304)));var n=rs();t=jr(t,s),t!==null&&(Ka(t,s,n),us(t,n))}function dv(t){var s=t.memoizedState,n=0;s!==null&&(n=s.retryLane),df(t,n)}function uv(t,s){var n=0;switch(t.tag){case 13:var i=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(s),df(t,n)}var uf;uf=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,Jy(t,s,n);cs=(t.flags&131072)!==0}else cs=!1,bt&&(s.flags&1048576)!==0&&Vh(s,mi,s.index);switch(s.lanes=0,s.tag){case 2:var i=s.type;Pi(t,s),t=s.pendingProps;var u=da(s,Qt.current);pa(s,n),u=Ac(null,s,i,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(i)?(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,i,t,n),s=Hc(null,s,i,!0,x,n)):(s.tag=0,bt&&x&&gc(s),ss(null,s,u,n),s=s.child),s;case 16:i=s.elementType;e:{switch(Pi(t,s),t=s.pendingProps,u=i._init,i=u(i._payload),s.type=i,u=s.tag=mv(i),t=Ws(i,t),u){case 0:s=Wc(null,s,i,t,n);break e;case 1:s=Lm(null,s,i,t,n);break e;case 11:s=Im(null,s,i,t,n);break e;case 14:s=_m(null,s,i,Ws(i.type,t),n);break e}throw Error(l(306,i,""))}return s;case 0:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:Ws(i,u),Wc(t,s,i,u,n);case 1:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:Ws(i,u),Lm(t,s,i,u,n);case 3:e:{if(Om(s),t===null)throw Error(l(387));i=s.pendingProps,x=s.memoizedState,u=x.element,Jh(t,s),vi(s,i,null,n);var S=s.memoizedState;if(i=S.element,x.isDehydrated)if(x={element:i,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){u=ya(Error(l(423)),s),s=Fm(t,s,i,n,u);break e}else if(i!==u){u=ya(Error(l(424)),s),s=Fm(t,s,i,n,u);break e}else for(bs=Br(s.stateNode.containerInfo.firstChild),js=s,bt=!0,Vs=null,n=qh(s,null,i,n),s.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ma(),i===u){s=Nr(t,s,n);break e}ss(t,s,i,n)}s=s.child}return s;case 5:return tm(s),t===null&&jc(s),i=s.type,u=s.pendingProps,x=t!==null?t.memoizedProps:null,S=u.children,uc(i,u)?S=null:x!==null&&uc(i,x)&&(s.flags|=32),Dm(t,s),ss(t,s,S,n),s.child;case 6:return t===null&&jc(s),null;case 13:return zm(t,s,n);case 4:return Pc(s,s.stateNode.containerInfo),i=s.pendingProps,t===null?s.child=fa(s,null,i,n):ss(t,s,i,n),s.child;case 11:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:Ws(i,u),Im(t,s,i,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(i=s.type._context,u=s.pendingProps,x=s.memoizedProps,S=u.value,ut(pi,i._currentValue),i._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 $=M.firstContext;$!==null;){if($.context===i){if(x.tag===1){$=br(-1,n&-n),$.tag=2;var re=x.updateQueue;if(re!==null){re=re.shared;var me=re.pending;me===null?$.next=$:($.next=me.next,me.next=$),re.pending=$}}x.lanes|=n,$=x.alternate,$!==null&&($.lanes|=n),Cc(x.return,n,s),M.lanes|=n;break}$=$.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,i=s.pendingProps.children,pa(s,n),u=Rs(u),i=i(u),s.flags|=1,ss(t,s,i,n),s.child;case 14:return i=s.type,u=Ws(i,s.pendingProps),u=Ws(i.type,u),_m(t,s,i,u,n);case 15:return Mm(t,s,s.type,s.pendingProps,n);case 17:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:Ws(i,u),Pi(t,s),s.tag=1,os(i)?(t=!0,di(s)):t=!1,pa(s,n),Sm(s,i,u),Bc(s,i,u,n),Hc(null,s,i,!0,t,n);case 19:return Bm(t,s,n);case 22:return Am(t,s,n)}throw Error(l(156,s.tag))};function hf(t,s){return z(t,s)}function hv(t,s,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ms(t,s,n,i){return new hv(t,s,n,i)}function ud(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mv(t){if(typeof t=="function")return ud(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ae)return 11;if(t===H)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,i,u,x){var S=2;if(i=t,typeof t=="function")ud(t)&&(S=1);else if(typeof t=="string")S=5;else e:switch(t){case I:return $n(n.children,u,x,s);case R:S=8,u|=8;break;case E:return t=Ms(12,n,s,u|2),t.elementType=E,t.lanes=x,t;case q:return t=Ms(13,n,s,u),t.elementType=q,t.lanes=x,t;case se:return t=Ms(19,n,s,u),t.elementType=se,t.lanes=x,t;case ve:return $i(n,u,x,s);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Y:S=10;break e;case ne:S=9;break e;case ae:S=11;break e;case H:S=14;break e;case ie:S=16,i=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return s=Ms(S,n,s,u),s.elementType=t,s.type=i,s.lanes=x,s}function $n(t,s,n,i){return t=Ms(7,t,i,s),t.lanes=n,t}function $i(t,s,n,i){return t=Ms(22,t,i,s),t.elementType=ve,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 fv(t,s,n,i,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=i,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function fd(t,s,n,i,u,x,S,M,$){return t=new fv(t,s,n,M,$),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:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ec(x),t}function xv(t,s,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),jd.exports=Ev(),jd.exports}var kf;function Pv(){if(kf)return Gi;kf=1;var r=_x();return Gi.createRoot=r.createRoot,Gi.hydrateRoot=r.hydrateRoot,Gi}var Tv=Pv(),Ol=_x();const Rv=Ix(Ol);/** +`+x.stack}return{value:t,source:s,stack:d,digest:null}}function Uc(t,s,n){return{value:t,source:null,stack:n??null,digest:s??null}}function Vc(t,s){try{console.error(s.value)}catch(n){setTimeout(function(){throw n})}}var Qy=typeof WeakMap=="function"?WeakMap:Map;function km(t,s,n){n=br(-1,n),n.tag=3,n.payload={element:null};var i=s.value;return n.callback=function(){Mi||(Mi=!0,nd=i),Vc(t,s)},n}function Em(t,s,n){n=br(-1,n),n.tag=3;var i=t.type.getDerivedStateFromError;if(typeof i=="function"){var d=s.value;n.payload=function(){return i(d)},n.callback=function(){Vc(t,s)}}var x=t.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(n.callback=function(){Vc(t,s),typeof i!="function"&&(Yr===null?Yr=new Set([this]):Yr.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})}),n}function Pm(t,s,n){var i=t.pingCache;if(i===null){i=t.pingCache=new Qy;var d=new Set;i.set(s,d)}else d=i.get(s),d===void 0&&(d=new Set,i.set(s,d));d.has(n)||(d.add(n),t=cv.bind(null,t,s,n),s.then(t,t))}function Tm(t){do{var s;if((s=t.tag===13)&&(s=t.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return t;t=t.return}while(t!==null);return null}function Rm(t,s,n,i,d){return(t.mode&1)===0?(t===s?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(s=br(-1,1),s.tag=2,Kr(n,s,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=d,t)}var qy=R.ReactCurrentOwner,cs=!1;function ss(t,s,n,i){s.child=t===null?qh(s,null,n,i):fa(s,t.child,n,i)}function Im(t,s,n,i,d){n=n.render;var x=s.ref;return pa(s,d),i=Ac(t,s,n,i,x,d),n=Dc(),t!==null&&!cs?(s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~d,Nr(t,s,d)):(bt&&n&&gc(s),s.flags|=1,ss(t,s,i,d),s.child)}function _m(t,s,n,i,d){if(t===null){var x=n.type;return typeof x=="function"&&!ud(x)&&x.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(s.tag=15,s.type=x,Mm(t,s,x,i,d)):(t=zi(n.type,null,i,s,s.mode,d),t.ref=s.ref,t.return=s,s.child=t)}if(x=t.child,(t.lanes&d)===0){var S=x.memoizedProps;if(n=n.compare,n=n!==null?n:nl,n(S,i)&&t.ref===s.ref)return Nr(t,s,d)}return s.flags|=1,t=Jr(x,i),t.ref=s.ref,t.return=s,s.child=t}function Mm(t,s,n,i,d){if(t!==null){var x=t.memoizedProps;if(nl(x,i)&&t.ref===s.ref)if(cs=!1,s.pendingProps=i=x,(t.lanes&d)!==0)(t.flags&131072)!==0&&(cs=!0);else return s.lanes=t.lanes,Nr(t,s,d)}return Wc(t,s,n,i,d)}function Am(t,s,n){var i=s.pendingProps,d=i.children,x=t!==null?t.memoizedState:null;if(i.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(ja,Ns),Ns|=n;else{if((n&1073741824)===0)return t=x!==null?x.baseLanes|n:n,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:t,cachePool:null,transitions:null},s.updateQueue=null,ut(ja,Ns),Ns|=t,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=x!==null?x.baseLanes:n,ut(ja,Ns),Ns|=i}else x!==null?(i=x.baseLanes|n,s.memoizedState=null):i=n,ut(ja,Ns),Ns|=i;return ss(t,s,d,n),s.child}function Dm(t,s){var n=s.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(s.flags|=512,s.flags|=2097152)}function Wc(t,s,n,i,d){var x=os(n)?Tn:Qt.current;return x=da(s,x),pa(s,d),n=Ac(t,s,n,i,x,d),i=Dc(),t!==null&&!cs?(s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~d,Nr(t,s,d)):(bt&&i&&gc(s),s.flags|=1,ss(t,s,n,d),s.child)}function Lm(t,s,n,i,d){if(os(n)){var x=!0;di(s)}else x=!1;if(pa(s,d),s.stateNode===null)Pi(t,s),Sm(s,n,i),Bc(s,n,i,d),i=!0;else if(t===null){var S=s.stateNode,_=s.memoizedProps;S.props=_;var B=S.context,ae=n.contextType;typeof ae=="object"&&ae!==null?ae=Rs(ae):(ae=os(n)?Tn:Qt.current,ae=da(s,ae));var me=n.getDerivedStateFromProps,ye=typeof me=="function"||typeof S.getSnapshotBeforeUpdate=="function";ye||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(_!==i||B!==ae)&&Cm(s,S,i,ae),Hr=!1;var ue=s.memoizedState;S.state=ue,vi(s,i,S,d),B=s.memoizedState,_!==i||ue!==B||is.current||Hr?(typeof me=="function"&&($c(s,n,me,i),B=s.memoizedState),(_=Hr||wm(s,n,_,i,ue,B,ae))?(ye||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(s.flags|=4194308)):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=i,s.memoizedState=B),S.props=i,S.state=B,S.context=ae,i=_):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),i=!1)}else{S=s.stateNode,Jh(t,s),_=s.memoizedProps,ae=s.type===s.elementType?_:Ws(s.type,_),S.props=ae,ye=s.pendingProps,ue=S.context,B=n.contextType,typeof B=="object"&&B!==null?B=Rs(B):(B=os(n)?Tn:Qt.current,B=da(s,B));var Pe=n.getDerivedStateFromProps;(me=typeof Pe=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(_!==ye||ue!==B)&&Cm(s,S,i,B),Hr=!1,ue=s.memoizedState,S.state=ue,vi(s,i,S,d);var Ie=s.memoizedState;_!==ye||ue!==Ie||is.current||Hr?(typeof Pe=="function"&&($c(s,n,Pe,i),Ie=s.memoizedState),(ae=Hr||wm(s,n,ae,i,ue,Ie,B)||!1)?(me||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(i,Ie,B),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(i,Ie,B)),typeof S.componentDidUpdate=="function"&&(s.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof S.componentDidUpdate!="function"||_===t.memoizedProps&&ue===t.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||_===t.memoizedProps&&ue===t.memoizedState||(s.flags|=1024),s.memoizedProps=i,s.memoizedState=Ie),S.props=i,S.state=Ie,S.context=B,i=ae):(typeof S.componentDidUpdate!="function"||_===t.memoizedProps&&ue===t.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||_===t.memoizedProps&&ue===t.memoizedState||(s.flags|=1024),i=!1)}return Hc(t,s,n,i,x,d)}function Hc(t,s,n,i,d,x){Dm(t,s);var S=(s.flags&128)!==0;if(!i&&!S)return d&&Bh(s,n,!1),Nr(t,s,x);i=s.stateNode,qy.current=s;var _=S&&typeof n.getDerivedStateFromError!="function"?null:i.render();return s.flags|=1,t!==null&&S?(s.child=fa(s,t.child,null,x),s.child=fa(s,null,_,x)):ss(t,s,_,x),s.memoizedState=i.state,d&&Bh(s,n,!0),s.child}function Om(t){var s=t.stateNode;s.pendingContext?zh(t,s.pendingContext,s.pendingContext!==s.context):s.context&&zh(t,s.context,!1),Pc(t,s.containerInfo)}function Fm(t,s,n,i,d){return ma(),bc(d),s.flags|=256,ss(t,s,n,i),s.child}var Kc={dehydrated:null,treeContext:null,retryLane:0};function Gc(t){return{baseLanes:t,cachePool:null,transitions:null}}function zm(t,s,n){var i=s.pendingProps,d=wt.current,x=!1,S=(s.flags&128)!==0,_;if((_=S)||(_=t!==null&&t.memoizedState===null?!1:(d&2)!==0),_?(x=!0,s.flags&=-129):(t===null||t.memoizedState!==null)&&(d|=1),ut(wt,d&1),t===null)return jc(s),t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((s.mode&1)===0?s.lanes=1:t.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(S=i.children,t=i.fallback,x?(i=s.mode,x=s.child,S={mode:"hidden",children:S},(i&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=S):x=$i(S,i,0,null),t=zn(t,i,n,null),x.return=s,t.return=s,x.sibling=t,s.child=x,s.child.memoizedState=Gc(n),s.memoizedState=Kc,t):Yc(s,S));if(d=t.memoizedState,d!==null&&(_=d.dehydrated,_!==null))return Xy(t,s,S,i,_,d,n);if(x){x=i.fallback,S=s.mode,d=t.child,_=d.sibling;var B={mode:"hidden",children:i.children};return(S&1)===0&&s.child!==d?(i=s.child,i.childLanes=0,i.pendingProps=B,s.deletions=null):(i=Jr(d,B),i.subtreeFlags=d.subtreeFlags&14680064),_!==null?x=Jr(_,x):(x=zn(x,S,n,null),x.flags|=2),x.return=s,i.return=s,i.sibling=x,s.child=i,i=x,x=s.child,S=t.child.memoizedState,S=S===null?Gc(n):{baseLanes:S.baseLanes|n,cachePool:null,transitions:S.transitions},x.memoizedState=S,x.childLanes=t.childLanes&~n,s.memoizedState=Kc,i}return x=t.child,t=x.sibling,i=Jr(x,{mode:"visible",children:i.children}),(s.mode&1)===0&&(i.lanes=n),i.return=s,i.sibling=null,t!==null&&(n=s.deletions,n===null?(s.deletions=[t],s.flags|=16):n.push(t)),s.child=i,s.memoizedState=null,i}function Yc(t,s){return s=$i({mode:"visible",children:s},t.mode,0,null),s.return=t,t.child=s}function Ei(t,s,n,i){return i!==null&&bc(i),fa(s,t.child,null,n),t=Yc(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function Xy(t,s,n,i,d,x,S){if(n)return s.flags&256?(s.flags&=-257,i=Uc(Error(l(422))),Ei(t,s,S,i)):s.memoizedState!==null?(s.child=t.child,s.flags|=128,null):(x=i.fallback,d=s.mode,i=$i({mode:"visible",children:i.children},d,0,null),x=zn(x,d,S,null),x.flags|=2,i.return=s,x.return=s,i.sibling=x,s.child=i,(s.mode&1)!==0&&fa(s,t.child,null,S),s.child.memoizedState=Gc(S),s.memoizedState=Kc,x);if((s.mode&1)===0)return Ei(t,s,S,null);if(d.data==="$!"){if(i=d.nextSibling&&d.nextSibling.dataset,i)var _=i.dgst;return i=_,x=Error(l(419)),i=Uc(x,i,void 0),Ei(t,s,S,i)}if(_=(S&t.childLanes)!==0,cs||_){if(i=Vt,i!==null){switch(S&-S){case 4:d=2;break;case 16:d=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(i.suspendedLanes|S))!==0?0:d,d!==0&&d!==x.retryLane&&(x.retryLane=d,jr(t,d),Gs(i,t,d,-1))}return dd(),i=Uc(Error(l(421))),Ei(t,s,S,i)}return d.data==="$?"?(s.flags|=128,s.child=t.child,s=dv.bind(null,t),d._reactRetry=s,null):(t=x.treeContext,bs=Br(d.nextSibling),js=s,bt=!0,Vs=null,t!==null&&(Ps[Ts++]=yr,Ps[Ts++]=vr,Ps[Ts++]=Rn,yr=t.id,vr=t.overflow,Rn=s),s=Yc(s,i.children),s.flags|=4096,s)}function $m(t,s,n){t.lanes|=s;var i=t.alternate;i!==null&&(i.lanes|=s),Cc(t.return,s,n)}function Qc(t,s,n,i,d){var x=t.memoizedState;x===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:d}:(x.isBackwards=s,x.rendering=null,x.renderingStartTime=0,x.last=i,x.tail=n,x.tailMode=d)}function Bm(t,s,n){var i=s.pendingProps,d=i.revealOrder,x=i.tail;if(ss(t,s,i.children,n),i=wt.current,(i&2)!==0)i=i&1|2,s.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&$m(t,n,s);else if(t.tag===19)$m(t,n,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===s)break e;for(;t.sibling===null;){if(t.return===null||t.return===s)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(ut(wt,i),(s.mode&1)===0)s.memoizedState=null;else switch(d){case"forwards":for(n=s.child,d=null;n!==null;)t=n.alternate,t!==null&&ji(t)===null&&(d=n),n=n.sibling;n=d,n===null?(d=s.child,s.child=null):(d=n.sibling,n.sibling=null),Qc(s,!1,d,n,x);break;case"backwards":for(n=null,d=s.child,s.child=null;d!==null;){if(t=d.alternate,t!==null&&ji(t)===null){s.child=d;break}t=d.sibling,d.sibling=n,n=d,d=t}Qc(s,!0,n,null,x);break;case"together":Qc(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Pi(t,s){(s.mode&1)===0&&t!==null&&(t.alternate=null,s.alternate=null,s.flags|=2)}function Nr(t,s,n){if(t!==null&&(s.dependencies=t.dependencies),Dn|=s.lanes,(n&s.childLanes)===0)return null;if(t!==null&&s.child!==t.child)throw Error(l(153));if(s.child!==null){for(t=s.child,n=Jr(t,t.pendingProps),s.child=n,n.return=s;t.sibling!==null;)t=t.sibling,n=n.sibling=Jr(t,t.pendingProps),n.return=s;n.sibling=null}return s.child}function Jy(t,s,n){switch(s.tag){case 3:Om(s),ma();break;case 5:tm(s);break;case 1:os(s.type)&&di(s);break;case 4:Pc(s,s.stateNode.containerInfo);break;case 10:var i=s.type._context,d=s.memoizedProps.value;ut(pi,i._currentValue),i._currentValue=d;break;case 13:if(i=s.memoizedState,i!==null)return i.dehydrated!==null?(ut(wt,wt.current&1),s.flags|=128,null):(n&s.child.childLanes)!==0?zm(t,s,n):(ut(wt,wt.current&1),t=Nr(t,s,n),t!==null?t.sibling:null);ut(wt,wt.current&1);break;case 19:if(i=(n&s.childLanes)!==0,(t.flags&128)!==0){if(i)return Bm(t,s,n);s.flags|=128}if(d=s.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ut(wt,wt.current),i)break;return null;case 22:case 23:return s.lanes=0,Am(t,s,n)}return Nr(t,s,n)}var Um,qc,Vm,Wm;Um=function(t,s){for(var n=s.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break;for(;n.sibling===null;){if(n.return===null||n.return===s)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},qc=function(){},Vm=function(t,s,n,i){var d=t.memoizedProps;if(d!==i){t=s.stateNode,Mn(rr.current);var x=null;switch(n){case"input":d=We(t,d),i=We(t,i),x=[];break;case"select":d=W({},d,{value:void 0}),i=W({},i,{value:void 0}),x=[];break;case"textarea":d=hr(t,d),i=hr(t,i),x=[];break;default:typeof d.onClick!="function"&&typeof i.onClick=="function"&&(t.onclick=ii)}fr(n,i);var S;n=null;for(ae in d)if(!i.hasOwnProperty(ae)&&d.hasOwnProperty(ae)&&d[ae]!=null)if(ae==="style"){var _=d[ae];for(S in _)_.hasOwnProperty(S)&&(n||(n={}),n[S]="")}else ae!=="dangerouslySetInnerHTML"&&ae!=="children"&&ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&ae!=="autoFocus"&&(c.hasOwnProperty(ae)?x||(x=[]):(x=x||[]).push(ae,null));for(ae in i){var B=i[ae];if(_=d!=null?d[ae]:void 0,i.hasOwnProperty(ae)&&B!==_&&(B!=null||_!=null))if(ae==="style")if(_){for(S in _)!_.hasOwnProperty(S)||B&&B.hasOwnProperty(S)||(n||(n={}),n[S]="");for(S in B)B.hasOwnProperty(S)&&_[S]!==B[S]&&(n||(n={}),n[S]=B[S])}else n||(x||(x=[]),x.push(ae,n)),n=B;else ae==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,_=_?_.__html:void 0,B!=null&&_!==B&&(x=x||[]).push(ae,B)):ae==="children"?typeof B!="string"&&typeof B!="number"||(x=x||[]).push(ae,""+B):ae!=="suppressContentEditableWarning"&&ae!=="suppressHydrationWarning"&&(c.hasOwnProperty(ae)?(B!=null&&ae==="onScroll"&&pt("scroll",t),x||_===B||(x=[])):(x=x||[]).push(ae,B))}n&&(x=x||[]).push("style",n);var ae=x;(s.updateQueue=ae)&&(s.flags|=4)}},Wm=function(t,s,n,i){n!==i&&(s.flags|=4)};function vl(t,s){if(!bt)switch(t.tailMode){case"hidden":s=t.tail;for(var n=null;s!==null;)s.alternate!==null&&(n=s),s=s.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?s||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Xt(t){var s=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(s)for(var d=t.child;d!==null;)n|=d.lanes|d.childLanes,i|=d.subtreeFlags&14680064,i|=d.flags&14680064,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)n|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=i,t.childLanes=n,s}function Zy(t,s,n){var i=s.pendingProps;switch(yc(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(s),null;case 1:return os(s.type)&&ci(),Xt(s),null;case 3:return i=s.stateNode,ga(),gt(is),gt(Qt),Ic(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(fi(s)?s.flags|=4:t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Vs!==null&&(id(Vs),Vs=null))),qc(t,s),Xt(s),null;case 5:Tc(s);var d=Mn(fl.current);if(n=s.type,t!==null&&s.stateNode!=null)Vm(t,s,n,i,d),t.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!i){if(s.stateNode===null)throw Error(l(166));return Xt(s),null}if(t=Mn(rr.current),fi(s)){i=s.stateNode,n=s.type;var x=s.memoizedProps;switch(i[sr]=s,i[cl]=x,t=(s.mode&1)!==0,n){case"dialog":pt("cancel",i),pt("close",i);break;case"iframe":case"object":case"embed":pt("load",i);break;case"video":case"audio":for(d=0;d<\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=S.createElement(n,{is:i.is}):(t=S.createElement(n),n==="select"&&(S=t,i.multiple?S.multiple=!0:i.size&&(S.size=i.size))):t=S.createElementNS(t,n),t[sr]=s,t[cl]=i,Um(t,s,!1,!1),s.stateNode=t;e:{switch(S=ys(n,i),n){case"dialog":pt("cancel",t),pt("close",t),d=i;break;case"iframe":case"object":case"embed":pt("load",t),d=i;break;case"video":case"audio":for(d=0;dba&&(s.flags|=128,i=!0,vl(x,!1),s.lanes=4194304)}else{if(!i)if(t=ji(S),t!==null){if(s.flags|=128,i=!0,n=t.updateQueue,n!==null&&(s.updateQueue=n,s.flags|=4),vl(x,!0),x.tail===null&&x.tailMode==="hidden"&&!S.alternate&&!bt)return Xt(s),null}else 2*dt()-x.renderingStartTime>ba&&n!==1073741824&&(s.flags|=128,i=!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,ut(wt,i?n&1|2:n&1),s):(Xt(s),null);case 22:case 23:return cd(),i=s.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(s.flags|=8192),i&&(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 ev(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,tv=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(i){Tt(t,s,i)}else n.current=null}function Xc(t,s,n){try{n()}catch(i){Tt(t,s,i)}}var Hm=!1;function sv(t,s){if(cc=Ql,t=wh(),tc(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var d=i.anchorOffset,x=i.focusNode;i=i.focusOffset;try{n.nodeType,x.nodeType}catch{n=null;break e}var S=0,_=-1,B=-1,ae=0,me=0,ye=t,ue=null;t:for(;;){for(var Pe;ye!==n||d!==0&&ye.nodeType!==3||(_=S+d),ye!==x||i!==0&&ye.nodeType!==3||(B=S+i),ye.nodeType===3&&(S+=ye.nodeValue.length),(Pe=ye.firstChild)!==null;)ue=ye,ye=Pe;for(;;){if(ye===t)break t;if(ue===n&&++ae===d&&(_=S),ue===x&&++me===i&&(B=S),(Pe=ye.nextSibling)!==null)break;ye=ue,ue=ye.parentNode}ye=Pe}n=_===-1||B===-1?null:{start:_,end:B}}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,It=Ie.memoizedState,q=s.stateNode,V=q.getSnapshotBeforeUpdate(s.elementType===s.type?Ae:Ws(s.type,Ae),It);q.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var ee=s.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.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=Hm,Hm=!1,Ie}function jl(t,s,n){var i=s.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var d=i=i.next;do{if((d.tag&t)===t){var x=d.destroy;d.destroy=void 0,x!==void 0&&Xc(s,n,x)}d=d.next}while(d!==i)}}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 i=n.create;n.destroy=i()}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 Km(t){var s=t.alternate;s!==null&&(t.alternate=null,Km(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[Fy],delete s[zy])),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 Gm(t){return t.tag===5||t.tag===3||t.tag===4}function Ym(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Gm(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 i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.nodeType===8?n.parentNode.insertBefore(t,s):n.insertBefore(t,s):(n.nodeType===8?(s=n.parentNode,s.insertBefore(t,n)):(s=n,s.appendChild(t)),n=n._reactRootContainer,n!=null||s.onclick!==null||(s.onclick=ii));else if(i!==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 i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.insertBefore(t,s):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(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 i=Gt,d=Hs;Gt=null,Gr(t,s,n),Gt=i,Hs=d,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:i=Gt,d=Hs,Gt=n.stateNode.containerInfo,Hs=!0,Gr(t,s,n),Gt=i,Hs=d;break;case 0:case 11:case 14:case 15:if(!Jt&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){d=i=i.next;do{var x=d,S=x.destroy;x=x.tag,S!==void 0&&((x&2)!==0||(x&4)!==0)&&Xc(n,s,S),d=d.next}while(d!==i)}Gr(t,s,n);break;case 1:if(!Jt&&(va(n,s),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(_){Tt(n,s,_)}Gr(t,s,n);break;case 21:Gr(t,s,n);break;case 22:n.mode&1?(Jt=(i=Jt)||n.memoizedState!==null,Gr(t,s,n),Jt=i):Gr(t,s,n);break;default:Gr(t,s,n)}}function qm(t){var s=t.updateQueue;if(s!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new tv),s.forEach(function(i){var d=uv.bind(null,t,i);n.has(i)||(n.add(i),i.then(d,d))})}}function Ks(t,s){var n=s.deletions;if(n!==null)for(var i=0;id&&(d=S),i&=~x}if(i=d,i=dt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*nv(i/1960))-i,10t?16:t,Qr===null)var i=!1;else{if(t=Qr,Qr=null,Di=0,(st&6)!==0)throw Error(l(331));var d=st;for(st|=4,Re=t.current;Re!==null;){var x=Re,S=x.child;if((Re.flags&16)!==0){var _=x.deletions;if(_!==null){for(var B=0;B<_.length;B++){var ae=_[B];for(Re=ae;Re!==null;){var me=Re;switch(me.tag){case 0:case 11:case 15:jl(8,me,x)}var ye=me.child;if(ye!==null)ye.return=me,Re=ye;else for(;Re!==null;){me=Re;var ue=me.sibling,Pe=me.return;if(Km(me),me===ae){Re=null;break}if(ue!==null){ue.return=Pe,Re=ue;break}Re=Pe}}}var Ie=x.alternate;if(Ie!==null){var Ae=Ie.child;if(Ae!==null){Ie.child=null;do{var It=Ae.sibling;Ae.sibling=null,Ae=It}while(Ae!==null)}}Re=x}}if((x.subtreeFlags&2064)!==0&&S!==null)S.return=x,Re=S;else e:for(;Re!==null;){if(x=Re,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:jl(9,x,x.return)}var q=x.sibling;if(q!==null){q.return=x.return,Re=q;break e}Re=x.return}}var V=t.current;for(Re=V;Re!==null;){S=Re;var ee=S.child;if((S.subtreeFlags&2064)!==0&&ee!==null)ee.return=S,Re=ee;else e:for(S=V;Re!==null;){if(_=Re,(_.flags&2048)!==0)try{switch(_.tag){case 0:case 11:case 15:Ri(9,_)}}catch(De){Tt(_,_.return,De)}if(_===S){Re=null;break e}var je=_.sibling;if(je!==null){je.return=_.return,Re=je;break e}Re=_.return}}if(st=d,Wr(),tr&&typeof tr.onPostCommitFiberRoot=="function")try{tr.onPostCommitFiberRoot(Vl,t)}catch{}i=!0}return i}finally{it=n,_s.transition=s}}return!1}function cf(t,s,n){s=ya(n,s),s=km(t,s,1),t=Kr(t,s,1),s=rs(),t!==null&&(Ga(t,1,s),us(t,s))}function Tt(t,s,n){if(t.tag===3)cf(t,t,n);else for(;s!==null;){if(s.tag===3){cf(s,t,n);break}else if(s.tag===1){var i=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Yr===null||!Yr.has(i))){t=ya(n,t),t=Em(s,t,1),s=Kr(s,t,1),t=rs(),s!==null&&(Ga(s,1,t),us(s,t));break}}s=s.return}}function cv(t,s,n){var i=t.pingCache;i!==null&&i.delete(s),s=rs(),t.pingedLanes|=t.suspendedLanes&n,Vt===t&&(Yt&n)===n&&(zt===4||zt===3&&(Yt&130023424)===Yt&&500>dt()-rd?On(t,0):sd|=n),us(t,s)}function df(t,s){s===0&&((t.mode&1)===0?s=1:(s=Hl,Hl<<=1,(Hl&130023424)===0&&(Hl=4194304)));var n=rs();t=jr(t,s),t!==null&&(Ga(t,s,n),us(t,n))}function dv(t){var s=t.memoizedState,n=0;s!==null&&(n=s.retryLane),df(t,n)}function uv(t,s){var n=0;switch(t.tag){case 13:var i=t.stateNode,d=t.memoizedState;d!==null&&(n=d.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(s),df(t,n)}var uf;uf=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,Jy(t,s,n);cs=(t.flags&131072)!==0}else cs=!1,bt&&(s.flags&1048576)!==0&&Vh(s,mi,s.index);switch(s.lanes=0,s.tag){case 2:var i=s.type;Pi(t,s),t=s.pendingProps;var d=da(s,Qt.current);pa(s,n),d=Ac(null,s,i,t,d,n);var x=Dc();return s.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,os(i)?(x=!0,di(s)):x=!1,s.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Ec(s),d.updater=ki,s.stateNode=d,d._reactInternals=s,Bc(s,i,t,n),s=Hc(null,s,i,!0,x,n)):(s.tag=0,bt&&x&&gc(s),ss(null,s,d,n),s=s.child),s;case 16:i=s.elementType;e:{switch(Pi(t,s),t=s.pendingProps,d=i._init,i=d(i._payload),s.type=i,d=s.tag=mv(i),t=Ws(i,t),d){case 0:s=Wc(null,s,i,t,n);break e;case 1:s=Lm(null,s,i,t,n);break e;case 11:s=Im(null,s,i,t,n);break e;case 14:s=_m(null,s,i,Ws(i.type,t),n);break e}throw Error(l(306,i,""))}return s;case 0:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:Ws(i,d),Wc(t,s,i,d,n);case 1:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:Ws(i,d),Lm(t,s,i,d,n);case 3:e:{if(Om(s),t===null)throw Error(l(387));i=s.pendingProps,x=s.memoizedState,d=x.element,Jh(t,s),vi(s,i,null,n);var S=s.memoizedState;if(i=S.element,x.isDehydrated)if(x={element:i,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){d=ya(Error(l(423)),s),s=Fm(t,s,i,n,d);break e}else if(i!==d){d=ya(Error(l(424)),s),s=Fm(t,s,i,n,d);break e}else for(bs=Br(s.stateNode.containerInfo.firstChild),js=s,bt=!0,Vs=null,n=qh(s,null,i,n),s.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ma(),i===d){s=Nr(t,s,n);break e}ss(t,s,i,n)}s=s.child}return s;case 5:return tm(s),t===null&&jc(s),i=s.type,d=s.pendingProps,x=t!==null?t.memoizedProps:null,S=d.children,uc(i,d)?S=null:x!==null&&uc(i,x)&&(s.flags|=32),Dm(t,s),ss(t,s,S,n),s.child;case 6:return t===null&&jc(s),null;case 13:return zm(t,s,n);case 4:return Pc(s,s.stateNode.containerInfo),i=s.pendingProps,t===null?s.child=fa(s,null,i,n):ss(t,s,i,n),s.child;case 11:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:Ws(i,d),Im(t,s,i,d,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(i=s.type._context,d=s.pendingProps,x=s.memoizedProps,S=d.value,ut(pi,i._currentValue),i._currentValue=S,x!==null)if(Us(x.value,S)){if(x.children===d.children&&!is.current){s=Nr(t,s,n);break e}}else for(x=s.child,x!==null&&(x.return=s);x!==null;){var _=x.dependencies;if(_!==null){S=x.child;for(var B=_.firstContext;B!==null;){if(B.context===i){if(x.tag===1){B=br(-1,n&-n),B.tag=2;var ae=x.updateQueue;if(ae!==null){ae=ae.shared;var me=ae.pending;me===null?B.next=B:(B.next=me.next,me.next=B),ae.pending=B}}x.lanes|=n,B=x.alternate,B!==null&&(B.lanes|=n),Cc(x.return,n,s),_.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,_=S.alternate,_!==null&&(_.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,d.children,n),s=s.child}return s;case 9:return d=s.type,i=s.pendingProps.children,pa(s,n),d=Rs(d),i=i(d),s.flags|=1,ss(t,s,i,n),s.child;case 14:return i=s.type,d=Ws(i,s.pendingProps),d=Ws(i.type,d),_m(t,s,i,d,n);case 15:return Mm(t,s,s.type,s.pendingProps,n);case 17:return i=s.type,d=s.pendingProps,d=s.elementType===i?d:Ws(i,d),Pi(t,s),s.tag=1,os(i)?(t=!0,di(s)):t=!1,pa(s,n),Sm(s,i,d),Bc(s,i,d,n),Hc(null,s,i,!0,t,n);case 19:return Bm(t,s,n);case 22:return Am(t,s,n)}throw Error(l(156,s.tag))};function hf(t,s){return $(t,s)}function hv(t,s,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ms(t,s,n,i){return new hv(t,s,n,i)}function ud(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mv(t){if(typeof t=="function")return ud(t)?1:0;if(t!=null){if(t=t.$$typeof,t===le)return 11;if(t===H)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,i,d,x){var S=2;if(i=t,typeof t=="function")ud(t)&&(S=1);else if(typeof t=="string")S=5;else e:switch(t){case A:return zn(n.children,d,x,s);case I:S=8,d|=8;break;case w:return t=Ms(12,n,s,d|2),t.elementType=w,t.lanes=x,t;case G:return t=Ms(13,n,s,d),t.elementType=G,t.lanes=x,t;case re:return t=Ms(19,n,s,d),t.elementType=re,t.lanes=x,t;case ve:return $i(n,d,x,s);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case U:S=10;break e;case se:S=9;break e;case le:S=11;break e;case H:S=14;break e;case ie:S=16,i=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return s=Ms(S,n,s,d),s.elementType=t,s.type=i,s.lanes=x,s}function zn(t,s,n,i){return t=Ms(7,t,i,s),t.lanes=n,t}function $i(t,s,n,i){return t=Ms(22,t,i,s),t.elementType=ve,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 fv(t,s,n,i,d){this.tag=s,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$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=i,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function fd(t,s,n,i,d,x,S,_,B){return t=new fv(t,s,n,_,B),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:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ec(x),t}function xv(t,s,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),jd.exports=Ev(),jd.exports}var kf;function Pv(){if(kf)return Gi;kf=1;var r=_x();return Gi.createRoot=r.createRoot,Gi.hydrateRoot=r.hydrateRoot,Gi}var Tv=Pv(),Ol=_x();const Rv=Ix(Ol);/** * @remix-run/router v1.23.2 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+x.message+` * 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 fu(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function _v(){return Math.random().toString(36).substr(2,8)}function Pf(r,a){return{usr:r.state,key:r.key,idx:a}}function Ud(r,a,l,o){return l===void 0&&(l=null),Il({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?La(a):a,{state:l,key:a&&a.key||o||_v()})}function io(r){let{pathname:a="/",search:l="",hash:o=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function La(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let o=r.indexOf("?");o>=0&&(a.search=r.substr(o),r=r.substr(0,o)),r&&(a.pathname=r)}return a}function Mv(r,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:d=!1}=o,m=c.history,f=an.Pop,y=null,g=p();g==null&&(g=0,m.replaceState(Il({},m.state,{idx:g}),""));function p(){return(m.state||{idx:null}).idx}function v(){f=an.Pop;let N=p(),w=N==null?null:N-g;g=N,y&&y({action:f,location:b.location,delta:w})}function C(N,w){f=an.Push;let k=Ud(b.location,N,w);g=p()+1;let j=Pf(k,g),_=b.createHref(k);try{m.pushState(j,"",_)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;c.location.assign(_)}d&&y&&y({action:f,location:b.location,delta:1})}function P(N,w){f=an.Replace;let k=Ud(b.location,N,w);g=p();let j=Pf(k,g),_=b.createHref(k);m.replaceState(j,"",_),d&&y&&y({action:f,location:b.location,delta:0})}function T(N){let w=c.location.origin!=="null"?c.location.origin:c.location.href,k=typeof N=="string"?N:io(N);return k=k.replace(/ $/,"%20"),_t(w,"No window.location.(origin|href) available to create URL for href: "+k),new URL(k,w)}let b={get action(){return f},get location(){return r(c,m)},listen(N){if(y)throw new Error("A history only accepts one active listener");return c.addEventListener(Ef,v),y=N,()=>{c.removeEventListener(Ef,v),y=null}},createHref(N){return a(c,N)},createURL:T,encodeLocation(N){let w=T(N);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:C,replace:P,go(N){return m.go(N)}};return b}var Tf;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Tf||(Tf={}));function Av(r,a,l){return l===void 0&&(l="/"),Dv(r,a,l)}function Dv(r,a,l,o){let c=typeof a=="string"?La(a):a,d=xu(c.pathname||"/",l);if(d==null)return null;let m=Mx(r);Lv(m);let f=null;for(let y=0;f==null&&y{let y={relativePath:f===void 0?d.path||"":f,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};y.relativePath.startsWith("/")&&(_t(y.relativePath.startsWith(o),'Absolute route path "'+y.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),y.relativePath=y.relativePath.slice(o.length));let g=on([o,y.relativePath]),p=l.concat(y);d.children&&d.children.length>0&&(_t(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Mx(d.children,a,p,g)),!(d.path==null&&!d.index)&&a.push({path:g,score:Vv(g,d.index),routesMeta:p})};return r.forEach((d,m)=>{var f;if(d.path===""||!((f=d.path)!=null&&f.includes("?")))c(d,m);else for(let y of Ax(d.path))c(d,m,y)}),a}function Ax(r){let a=r.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(o.length===0)return c?[d,""]:[d];let m=Ax(o.join("/")),f=[];return f.push(...m.map(y=>y===""?d:[d,y].join("/"))),c&&f.push(...m),f.map(y=>r.startsWith("/")&&y===""?"/":y)}function Lv(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:Wv(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const Ov=/^:[\w-]+$/,Fv=3,zv=2,$v=1,Bv=10,Uv=-2,Rf=r=>r==="*";function Vv(r,a){let l=r.split("/"),o=l.length;return l.some(Rf)&&(o+=Uv),a&&(o+=zv),l.filter(c=>!Rf(c)).reduce((c,d)=>c+(Ov.test(d)?Fv:d===""?$v:Bv),o)}function Wv(r,a){return r.length===a.length&&r.slice(0,-1).every((o,c)=>o===a[c])?r[r.length-1]-a[a.length-1]:0}function Hv(r,a,l){let{routesMeta:o}=r,c={},d="/",m=[];for(let f=0;f{let{paramName:C,isOptional:P}=p;if(C==="*"){let b=f[v]||"";m=d.slice(0,d.length-b.length).replace(/(.)\/+$/,"$1")}const T=f[v];return P&&!T?g[C]=void 0:g[C]=(T||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:m,pattern:r}}function Gv(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),fu(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let o=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,f,y)=>(o.push({paramName:f,isOptional:y!=null}),y?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(o.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function Yv(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return fu(!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 xu(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=r.charAt(l);return o&&o!=="/"?null:r.slice(l)||"/"}const Qv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qv=r=>Qv.test(r);function Xv(r,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof r=="string"?La(r):r,d;if(l)if(qv(l))d=l;else{if(l.includes("//")){let m=l;l=l.replace(/\/\/+/g,"/"),fu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(m+" -> "+l))}l.startsWith("/")?d=If(l.substring(1),"/"):d=If(l,a)}else d=a;return{pathname:d,search:ej(o),hash:tj(c)}}function If(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,o){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Jv(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function pu(r,a){let l=Jv(r);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function gu(r,a,l,o){o===void 0&&(o=!1);let c;typeof r=="string"?c=La(r):(c=Il({},r),_t(!c.pathname||!c.pathname.includes("?"),wd("?","pathname","search",c)),_t(!c.pathname||!c.pathname.includes("#"),wd("#","pathname","hash",c)),_t(!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(!o&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),v-=1;c.pathname=C.join("/")}f=v>=0?a[v]:"/"}let y=Xv(c,f),g=m&&m!=="/"&&m.endsWith("/"),p=(d||m===".")&&l.endsWith("/");return!y.pathname.endsWith("/")&&(g||p)&&(y.pathname+="/"),y}const on=r=>r.join("/").replace(/\/\/+/g,"/"),Zv=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),ej=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,tj=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function sj(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Dx=["post","put","patch","delete"];new Set(Dx);const rj=["get",...Dx];new Set(rj);/** + */function Il(){return Il=Object.assign?Object.assign.bind():function(r){for(var a=1;a"u")throw new Error(a)}function fu(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function _v(){return Math.random().toString(36).substr(2,8)}function Pf(r,a){return{usr:r.state,key:r.key,idx:a}}function Ud(r,a,l,o){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||o||_v()})}function io(r){let{pathname:a="/",search:l="",hash:o=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function Oa(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let o=r.indexOf("?");o>=0&&(a.search=r.substr(o),r=r.substr(0,o)),r&&(a.pathname=r)}return a}function Mv(r,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:u=!1}=o,m=c.history,f=an.Pop,y=null,g=p();g==null&&(g=0,m.replaceState(Il({},m.state,{idx:g}),""));function p(){return(m.state||{idx:null}).idx}function v(){f=an.Pop;let N=p(),C=N==null?null:N-g;g=N,y&&y({action:f,location:b.location,delta:C})}function k(N,C){f=an.Push;let E=Ud(b.location,N,C);g=p()+1;let j=Pf(E,g),R=b.createHref(E);try{m.pushState(j,"",R)}catch(Q){if(Q instanceof DOMException&&Q.name==="DataCloneError")throw Q;c.location.assign(R)}u&&y&&y({action:f,location:b.location,delta:1})}function P(N,C){f=an.Replace;let E=Ud(b.location,N,C);g=p();let j=Pf(E,g),R=b.createHref(E);m.replaceState(j,"",R),u&&y&&y({action:f,location:b.location,delta:0})}function T(N){let C=c.location.origin!=="null"?c.location.origin:c.location.href,E=typeof N=="string"?N:io(N);return E=E.replace(/ $/,"%20"),_t(C,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,C)}let b={get action(){return f},get location(){return r(c,m)},listen(N){if(y)throw new Error("A history only accepts one active listener");return c.addEventListener(Ef,v),y=N,()=>{c.removeEventListener(Ef,v),y=null}},createHref(N){return a(c,N)},createURL:T,encodeLocation(N){let C=T(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:k,replace:P,go(N){return m.go(N)}};return b}var Tf;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Tf||(Tf={}));function Av(r,a,l){return l===void 0&&(l="/"),Dv(r,a,l)}function Dv(r,a,l,o){let c=typeof a=="string"?Oa(a):a,u=xu(c.pathname||"/",l);if(u==null)return null;let m=Mx(r);Lv(m);let f=null;for(let y=0;f==null&&y{let y={relativePath:f===void 0?u.path||"":f,caseSensitive:u.caseSensitive===!0,childrenIndex:m,route:u};y.relativePath.startsWith("/")&&(_t(y.relativePath.startsWith(o),'Absolute route path "'+y.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),y.relativePath=y.relativePath.slice(o.length));let g=on([o,y.relativePath]),p=l.concat(y);u.children&&u.children.length>0&&(_t(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Mx(u.children,a,p,g)),!(u.path==null&&!u.index)&&a.push({path:g,score:Vv(g,u.index),routesMeta:p})};return r.forEach((u,m)=>{var f;if(u.path===""||!((f=u.path)!=null&&f.includes("?")))c(u,m);else for(let y of Ax(u.path))c(u,m,y)}),a}function Ax(r){let a=r.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let m=Ax(o.join("/")),f=[];return f.push(...m.map(y=>y===""?u:[u,y].join("/"))),c&&f.push(...m),f.map(y=>r.startsWith("/")&&y===""?"/":y)}function Lv(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:Wv(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const Ov=/^:[\w-]+$/,Fv=3,zv=2,$v=1,Bv=10,Uv=-2,Rf=r=>r==="*";function Vv(r,a){let l=r.split("/"),o=l.length;return l.some(Rf)&&(o+=Uv),a&&(o+=zv),l.filter(c=>!Rf(c)).reduce((c,u)=>c+(Ov.test(u)?Fv:u===""?$v:Bv),o)}function Wv(r,a){return r.length===a.length&&r.slice(0,-1).every((o,c)=>o===a[c])?r[r.length-1]-a[a.length-1]:0}function Hv(r,a,l){let{routesMeta:o}=r,c={},u="/",m=[];for(let f=0;f{let{paramName:k,isOptional:P}=p;if(k==="*"){let b=f[v]||"";m=u.slice(0,u.length-b.length).replace(/(.)\/+$/,"$1")}const T=f[v];return P&&!T?g[k]=void 0:g[k]=(T||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:m,pattern:r}}function Gv(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),fu(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let o=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,f,y)=>(o.push({paramName:f,isOptional:y!=null}),y?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(o.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function Yv(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return fu(!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 xu(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=r.charAt(l);return o&&o!=="/"?null:r.slice(l)||"/"}const Qv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qv=r=>Qv.test(r);function Xv(r,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof r=="string"?Oa(r):r,u;if(l)if(qv(l))u=l;else{if(l.includes("//")){let m=l;l=l.replace(/\/\/+/g,"/"),fu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(m+" -> "+l))}l.startsWith("/")?u=If(l.substring(1),"/"):u=If(l,a)}else u=a;return{pathname:u,search:ej(o),hash:tj(c)}}function If(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,o){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Jv(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function pu(r,a){let l=Jv(r);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function gu(r,a,l,o){o===void 0&&(o=!1);let c;typeof r=="string"?c=Oa(r):(c=Il({},r),_t(!c.pathname||!c.pathname.includes("?"),wd("?","pathname","search",c)),_t(!c.pathname||!c.pathname.includes("#"),wd("#","pathname","hash",c)),_t(!c.search||!c.search.includes("#"),wd("#","search","hash",c)));let u=r===""||c.pathname==="",m=u?"/":c.pathname,f;if(m==null)f=l;else{let v=a.length-1;if(!o&&m.startsWith("..")){let k=m.split("/");for(;k[0]==="..";)k.shift(),v-=1;c.pathname=k.join("/")}f=v>=0?a[v]:"/"}let y=Xv(c,f),g=m&&m!=="/"&&m.endsWith("/"),p=(u||m===".")&&l.endsWith("/");return!y.pathname.endsWith("/")&&(g||p)&&(y.pathname+="/"),y}const on=r=>r.join("/").replace(/\/\/+/g,"/"),Zv=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),ej=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,tj=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function sj(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Dx=["post","put","patch","delete"];new Set(Dx);const rj=["get",...Dx];new Set(rj);/** * React Router v6.30.3 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+x.message+` * 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(g,p){if(p===void 0&&(p={}),!f.current)return;if(typeof g=="number"){o.go(g);return}let v=gu(g,JSON.parse(m),d,p.relative==="path");r==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:on([a,v.pathname])),(p.replace?o.replace:o.push)(v,p.state,p)},[a,o,m,d,r])}const ij=h.createContext(null);function oj(r){let a=h.useContext(_r).outlet;return a&&h.createElement(ij.Provider,{value:r},a)}function Fx(r,a){let{relative:l}=a===void 0?{}:a,{future:o}=h.useContext(pn),{matches:c}=h.useContext(_r),{pathname:d}=gn(),m=JSON.stringify(pu(c,o.v7_relativeSplatPath));return h.useMemo(()=>gu(r,JSON.parse(m),d,l==="path"),[r,m,d,l])}function cj(r,a){return dj(r,a)}function dj(r,a,l,o){Oa()||_t(!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 y=m?m.pathnameBase:"/";m&&m.route;let g=gn(),p;if(a){var v;let N=typeof a=="string"?La(a):a;y==="/"||(v=N.pathname)!=null&&v.startsWith(y)||_t(!1),p=N}else p=g;let C=p.pathname||"/",P=C;if(y!=="/"){let N=y.replace(/^\//,"").split("/");P="/"+C.replace(/^\//,"").split("/").slice(N.length).join("/")}let T=Av(r,{pathname:P}),b=xj(T&&T.map(N=>Object.assign({},N,{params:Object.assign({},f,N.params),pathname:on([y,c.encodeLocation?c.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?y:on([y,c.encodeLocation?c.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),d,l,o);return a&&b?h.createElement(No.Provider,{value:{location:_l({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:an.Pop}},b):b}function uj(){let r=vj(),a=sj(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 hj=h.createElement(uj,null);class mj 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(Lx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function fj(r){let{routeContext:a,match:l,children:o}=r,c=h.useContext(yu);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),h.createElement(_r.Provider,{value:a},o)}function xj(r,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),r==null){var d;if(!l)return null;if(l.errors)r=l.matches;else if((d=o)!=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 p=m.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);p>=0||_t(!1),m=m.slice(0,Math.min(m.length,p+1))}let y=!1,g=-1;if(l&&o&&o.v7_partialHydration)for(let p=0;p=0?m=m.slice(0,g+1):m=[m[0]];break}}}return m.reduceRight((p,v,C)=>{let P,T=!1,b=null,N=null;l&&(P=f&&v.route.id?f[v.route.id]:void 0,b=v.route.errorElement||hj,y&&(g<0&&C===0?(bj("route-fallback"),T=!0,N=null):g===C&&(T=!0,N=v.route.hydrateFallbackElement||null)));let w=a.concat(m.slice(0,C+1)),k=()=>{let j;return P?j=b:T?j=N:v.route.Component?j=h.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=p,h.createElement(fj,{match:v,routeContext:{outlet:p,matches:w,isDataRoute:l!=null},children:j})};return l&&(v.route.ErrorBoundary||v.route.errorElement||C===0)?h.createElement(mj,{location:l.location,revalidation:l.revalidation,component:b,error:P,children:k(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):k()},null)}var zx=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(zx||{}),$x=(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})($x||{});function pj(r){let a=h.useContext(yu);return a||_t(!1),a}function gj(r){let a=h.useContext(nj);return a||_t(!1),a}function yj(r){let a=h.useContext(_r);return a||_t(!1),a}function Bx(r){let a=yj(),l=a.matches[a.matches.length-1];return l.route.id||_t(!1),l.route.id}function vj(){var r;let a=h.useContext(Lx),l=gj(),o=Bx();return a!==void 0?a:(r=l.errors)==null?void 0:r[o]}function jj(){let{router:r}=pj(zx.UseNavigateStable),a=Bx($x.UseNavigateStable),l=h.useRef(!1);return Ox(()=>{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 _f={};function bj(r,a,l){_f[r]||(_f[r]=!0)}function Nj(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Sd(r){let{to:a,replace:l,state:o,relative:c}=r;Oa()||_t(!1);let{future:d,static:m}=h.useContext(pn),{matches:f}=h.useContext(_r),{pathname:y}=gn(),g=yn(),p=gu(a,pu(f,d.v7_relativeSplatPath),y,c==="path"),v=JSON.stringify(p);return h.useEffect(()=>g(JSON.parse(v),{replace:l,state:o,relative:c}),[g,v,c,l,o]),null}function wj(r){return oj(r.context)}function yt(r){_t(!1)}function Sj(r){let{basename:a="/",children:l=null,location:o,navigationType:c=an.Pop,navigator:d,static:m=!1,future:f}=r;Oa()&&_t(!1);let y=a.replace(/^\/*/,"/"),g=h.useMemo(()=>({basename:y,navigator:d,static:m,future:_l({v7_relativeSplatPath:!1},f)}),[y,f,d,m]);typeof o=="string"&&(o=La(o));let{pathname:p="/",search:v="",hash:C="",state:P=null,key:T="default"}=o,b=h.useMemo(()=>{let N=xu(p,y);return N==null?null:{location:{pathname:N,search:v,hash:C,state:P,key:T},navigationType:c}},[y,p,v,C,P,T,c]);return b==null?null:h.createElement(pn.Provider,{value:g},h.createElement(No.Provider,{children:l,value:b}))}function Cj(r){let{children:a,location:l}=r;return cj(Vd(a),l)}new Promise(()=>{});function Vd(r,a){a===void 0&&(a=[]);let l=[];return h.Children.forEach(r,(o,c)=>{if(!h.isValidElement(o))return;let d=[...a,c];if(o.type===h.Fragment){l.push.apply(l,Vd(o.props.children,d));return}o.type!==yt&&_t(!1),!o.props.index||!o.props.children||_t(!1);let m={id:o.props.id||d.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(m.children=Vd(o.props.children,d)),l.push(m)}),l}/** + */function _l(){return _l=Object.assign?Object.assign.bind():function(r){for(var a=1;a{f.current=!0}),h.useCallback(function(g,p){if(p===void 0&&(p={}),!f.current)return;if(typeof g=="number"){o.go(g);return}let v=gu(g,JSON.parse(m),u,p.relative==="path");r==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:on([a,v.pathname])),(p.replace?o.replace:o.push)(v,p.state,p)},[a,o,m,u,r])}const ij=h.createContext(null);function oj(r){let a=h.useContext(_r).outlet;return a&&h.createElement(ij.Provider,{value:r},a)}function Fx(r,a){let{relative:l}=a===void 0?{}:a,{future:o}=h.useContext(xn),{matches:c}=h.useContext(_r),{pathname:u}=pn(),m=JSON.stringify(pu(c,o.v7_relativeSplatPath));return h.useMemo(()=>gu(r,JSON.parse(m),u,l==="path"),[r,m,u,l])}function cj(r,a){return dj(r,a)}function dj(r,a,l,o){Fa()||_t(!1);let{navigator:c}=h.useContext(xn),{matches:u}=h.useContext(_r),m=u[u.length-1],f=m?m.params:{};m&&m.pathname;let y=m?m.pathnameBase:"/";m&&m.route;let g=pn(),p;if(a){var v;let N=typeof a=="string"?Oa(a):a;y==="/"||(v=N.pathname)!=null&&v.startsWith(y)||_t(!1),p=N}else p=g;let k=p.pathname||"/",P=k;if(y!=="/"){let N=y.replace(/^\//,"").split("/");P="/"+k.replace(/^\//,"").split("/").slice(N.length).join("/")}let T=Av(r,{pathname:P}),b=xj(T&&T.map(N=>Object.assign({},N,{params:Object.assign({},f,N.params),pathname:on([y,c.encodeLocation?c.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?y:on([y,c.encodeLocation?c.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),u,l,o);return a&&b?h.createElement(No.Provider,{value:{location:_l({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:an.Pop}},b):b}function uj(){let r=vj(),a=sj(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 hj=h.createElement(uj,null);class mj 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(Lx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function fj(r){let{routeContext:a,match:l,children:o}=r,c=h.useContext(yu);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),h.createElement(_r.Provider,{value:a},o)}function xj(r,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),r==null){var u;if(!l)return null;if(l.errors)r=l.matches;else if((u=o)!=null&&u.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let m=r,f=(c=l)==null?void 0:c.errors;if(f!=null){let p=m.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);p>=0||_t(!1),m=m.slice(0,Math.min(m.length,p+1))}let y=!1,g=-1;if(l&&o&&o.v7_partialHydration)for(let p=0;p=0?m=m.slice(0,g+1):m=[m[0]];break}}}return m.reduceRight((p,v,k)=>{let P,T=!1,b=null,N=null;l&&(P=f&&v.route.id?f[v.route.id]:void 0,b=v.route.errorElement||hj,y&&(g<0&&k===0?(bj("route-fallback"),T=!0,N=null):g===k&&(T=!0,N=v.route.hydrateFallbackElement||null)));let C=a.concat(m.slice(0,k+1)),E=()=>{let j;return P?j=b:T?j=N:v.route.Component?j=h.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=p,h.createElement(fj,{match:v,routeContext:{outlet:p,matches:C,isDataRoute:l!=null},children:j})};return l&&(v.route.ErrorBoundary||v.route.errorElement||k===0)?h.createElement(mj,{location:l.location,revalidation:l.revalidation,component:b,error:P,children:E(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):E()},null)}var zx=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(zx||{}),$x=(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})($x||{});function pj(r){let a=h.useContext(yu);return a||_t(!1),a}function gj(r){let a=h.useContext(nj);return a||_t(!1),a}function yj(r){let a=h.useContext(_r);return a||_t(!1),a}function Bx(r){let a=yj(),l=a.matches[a.matches.length-1];return l.route.id||_t(!1),l.route.id}function vj(){var r;let a=h.useContext(Lx),l=gj(),o=Bx();return a!==void 0?a:(r=l.errors)==null?void 0:r[o]}function jj(){let{router:r}=pj(zx.UseNavigateStable),a=Bx($x.UseNavigateStable),l=h.useRef(!1);return Ox(()=>{l.current=!0}),h.useCallback(function(c,u){u===void 0&&(u={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,_l({fromRouteId:a},u)))},[r,a])}const _f={};function bj(r,a,l){_f[r]||(_f[r]=!0)}function Nj(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Sd(r){let{to:a,replace:l,state:o,relative:c}=r;Fa()||_t(!1);let{future:u,static:m}=h.useContext(xn),{matches:f}=h.useContext(_r),{pathname:y}=pn(),g=gn(),p=gu(a,pu(f,u.v7_relativeSplatPath),y,c==="path"),v=JSON.stringify(p);return h.useEffect(()=>g(JSON.parse(v),{replace:l,state:o,relative:c}),[g,v,c,l,o]),null}function wj(r){return oj(r.context)}function yt(r){_t(!1)}function Sj(r){let{basename:a="/",children:l=null,location:o,navigationType:c=an.Pop,navigator:u,static:m=!1,future:f}=r;Fa()&&_t(!1);let y=a.replace(/^\/*/,"/"),g=h.useMemo(()=>({basename:y,navigator:u,static:m,future:_l({v7_relativeSplatPath:!1},f)}),[y,f,u,m]);typeof o=="string"&&(o=Oa(o));let{pathname:p="/",search:v="",hash:k="",state:P=null,key:T="default"}=o,b=h.useMemo(()=>{let N=xu(p,y);return N==null?null:{location:{pathname:N,search:v,hash:k,state:P,key:T},navigationType:c}},[y,p,v,k,P,T,c]);return b==null?null:h.createElement(xn.Provider,{value:g},h.createElement(No.Provider,{children:l,value:b}))}function Cj(r){let{children:a,location:l}=r;return cj(Vd(a),l)}new Promise(()=>{});function Vd(r,a){a===void 0&&(a=[]);let l=[];return h.Children.forEach(r,(o,c)=>{if(!h.isValidElement(o))return;let u=[...a,c];if(o.type===h.Fragment){l.push.apply(l,Vd(o.props.children,u));return}o.type!==yt&&_t(!1),!o.props.index||!o.props.children||_t(!1);let m={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(m.children=Vd(o.props.children,u)),l.push(m)}),l}/** * React Router DOM v6.30.3 * * Copyright (c) Remix Software Inc. @@ -64,7 +64,7 @@ Error generating stack: `+x.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Wd(){return Wd=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function Ej(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Pj(r,a){return r.button===0&&(!a||a==="_self")&&!Ej(r)}function Hd(r){return r===void 0&&(r=""),new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((a,l)=>{let o=r[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function Tj(r,a){let l=Hd(r);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(d=>{l.append(c,d)})}),l}const Rj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Ij="6";try{window.__reactRouterVersion=Ij}catch{}const _j="startTransition",Mf=bo[_j];function Mj(r){let{basename:a,children:l,future:o,window:c}=r,d=h.useRef();d.current==null&&(d.current=Iv({window:c,v5Compat:!0}));let m=d.current,[f,y]=h.useState({action:m.action,location:m.location}),{v7_startTransition:g}=o||{},p=h.useCallback(v=>{g&&Mf?Mf(()=>y(v)):y(v)},[y,g]);return h.useLayoutEffect(()=>m.listen(p),[m,p]),h.useEffect(()=>Nj(o),[o]),h.createElement(Sj,{basename:a,children:l,location:f.location,navigationType:f.action,navigator:m,future:o})}const Aj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Dj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kd=h.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:d,replace:m,state:f,target:y,to:g,preventScrollReset:p,viewTransition:v}=a,C=kj(a,Rj),{basename:P}=h.useContext(pn),T,b=!1;if(typeof g=="string"&&Dj.test(g)&&(T=g,Aj))try{let j=new URL(window.location.href),_=g.startsWith("//")?new URL(j.protocol+g):new URL(g),U=xu(_.pathname,P);_.origin===j.origin&&U!=null?g=U+_.search+_.hash:b=!0}catch{}let N=aj(g,{relative:c}),w=Lj(g,{replace:m,state:f,target:y,preventScrollReset:p,relative:c,viewTransition:v});function k(j){o&&o(j),j.defaultPrevented||w(j)}return h.createElement("a",Wd({},C,{href:T||N,onClick:b||d?o:k,ref:l,target:y}))});var Af;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Af||(Af={}));var Df;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(Df||(Df={}));function Lj(r,a){let{target:l,replace:o,state:c,preventScrollReset:d,relative:m,viewTransition:f}=a===void 0?{}:a,y=yn(),g=gn(),p=Fx(r,{relative:m});return h.useCallback(v=>{if(Pj(v,l)){v.preventDefault();let C=o!==void 0?o:io(g)===io(p);y(r,{replace:C,state:c,preventScrollReset:d,relative:m,viewTransition:f})}},[g,y,p,o,c,l,r,d,m,f])}function Ux(r){let a=h.useRef(Hd(r)),l=h.useRef(!1),o=gn(),c=h.useMemo(()=>Tj(o.search,l.current?null:a.current),[o.search]),d=yn(),m=h.useCallback((f,y)=>{const g=Hd(typeof f=="function"?f(c):f);l.current=!0,d("?"+g,y)},[d,c]);return[c,m]}/** + */function Wd(){return Wd=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function Ej(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Pj(r,a){return r.button===0&&(!a||a==="_self")&&!Ej(r)}function Hd(r){return r===void 0&&(r=""),new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((a,l)=>{let o=r[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function Tj(r,a){let l=Hd(r);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(u=>{l.append(c,u)})}),l}const Rj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Ij="6";try{window.__reactRouterVersion=Ij}catch{}const _j="startTransition",Mf=bo[_j];function Mj(r){let{basename:a,children:l,future:o,window:c}=r,u=h.useRef();u.current==null&&(u.current=Iv({window:c,v5Compat:!0}));let m=u.current,[f,y]=h.useState({action:m.action,location:m.location}),{v7_startTransition:g}=o||{},p=h.useCallback(v=>{g&&Mf?Mf(()=>y(v)):y(v)},[y,g]);return h.useLayoutEffect(()=>m.listen(p),[m,p]),h.useEffect(()=>Nj(o),[o]),h.createElement(Sj,{basename:a,children:l,location:f.location,navigationType:f.action,navigator:m,future:o})}const Aj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Dj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kd=h.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:u,replace:m,state:f,target:y,to:g,preventScrollReset:p,viewTransition:v}=a,k=kj(a,Rj),{basename:P}=h.useContext(xn),T,b=!1;if(typeof g=="string"&&Dj.test(g)&&(T=g,Aj))try{let j=new URL(window.location.href),R=g.startsWith("//")?new URL(j.protocol+g):new URL(g),Q=xu(R.pathname,P);R.origin===j.origin&&Q!=null?g=Q+R.search+R.hash:b=!0}catch{}let N=aj(g,{relative:c}),C=Lj(g,{replace:m,state:f,target:y,preventScrollReset:p,relative:c,viewTransition:v});function E(j){o&&o(j),j.defaultPrevented||C(j)}return h.createElement("a",Wd({},k,{href:T||N,onClick:b||u?o:E,ref:l,target:y}))});var Af;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Af||(Af={}));var Df;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(Df||(Df={}));function Lj(r,a){let{target:l,replace:o,state:c,preventScrollReset:u,relative:m,viewTransition:f}=a===void 0?{}:a,y=gn(),g=pn(),p=Fx(r,{relative:m});return h.useCallback(v=>{if(Pj(v,l)){v.preventDefault();let k=o!==void 0?o:io(g)===io(p);y(r,{replace:k,state:c,preventScrollReset:u,relative:m,viewTransition:f})}},[g,y,p,o,c,l,r,u,m,f])}function Ux(r){let a=h.useRef(Hd(r)),l=h.useRef(!1),o=pn(),c=h.useMemo(()=>Tj(o.search,l.current?null:a.current),[o.search]),u=gn(),m=h.useCallback((f,y)=>{const g=Hd(typeof f=="function"?f(c):f);l.current=!0,u("?"+g,y)},[u,c]);return[c,m]}/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. @@ -79,12 +79,12 @@ Error generating stack: `+x.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bj=h.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:d,iconNode:m,...f},y)=>h.createElement("svg",{ref:y,...$j,width:a,height:a,stroke:r,strokeWidth:o?Number(l)*24/Number(a):l,className:Vx("lucide",c),...!d&&!zj(f)&&{"aria-hidden":"true"},...f},[...m.map(([g,p])=>h.createElement(g,p)),...Array.isArray(d)?d:[d]]));/** + */const Bj=h.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:m,...f},y)=>h.createElement("svg",{ref:y,...$j,width:a,height:a,stroke:r,strokeWidth:o?Number(l)*24/Number(a):l,className:Vx("lucide",c),...!u&&!zj(f)&&{"aria-hidden":"true"},...f},[...m.map(([g,p])=>h.createElement(g,p)),...Array.isArray(u)?u:[u]]));/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Te=(r,a)=>{const l=h.forwardRef(({className:o,...c},d)=>h.createElement(Bj,{ref:d,iconNode:a,className:Vx(`lucide-${Oj(Lf(r))}`,`lucide-${r}`,o),...c}));return l.displayName=Lf(r),l};/** + */const Te=(r,a)=>{const l=h.forwardRef(({className:o,...c},u)=>h.createElement(Bj,{ref:u,iconNode:a,className:Vx(`lucide-${Oj(Lf(r))}`,`lucide-${r}`,o),...c}));return l.displayName=Lf(r),l};/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. @@ -359,7 +359,7 @@ Error generating stack: `+x.message+` * * 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:"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"}]],dn=Te("settings",lN);/** + */const lN=[["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"}]],Bn=Te("settings",lN);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. @@ -394,7 +394,7 @@ Error generating stack: `+x.message+` * * 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:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Rl=Te("trending-up",mN);/** + */const mN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Ra=Te("trending-up",mN);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. @@ -414,17 +414,17 @@ Error generating stack: `+x.message+` * * 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:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ra=Te("user",gN);/** + */const gN=[["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",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"}],["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=Te("users",yN);/** + */const yN=[["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",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 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"}]],Ma=Te("wallet",vN);/** + */const vN=[["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",vN);/** * @license lucide-react v0.562.0 - ISC * * This source code is licensed under the ISC license. @@ -434,17 +434,17 @@ Error generating stack: `+x.message+` * * 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:"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",bN),ju="admin_token";function bu(){try{return localStorage.getItem(ju)}catch{return null}}function NN(r){try{localStorage.setItem(ju,r)}catch{}}function wN(){try{localStorage.removeItem(ju)}catch{}}const SN="https://soulapi.quwanzhi.com",CN=15e3,kN=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):SN};function Aa(r){const a=kN(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function So(r,a={}){const{data:l,...o}=a,c=Aa(r),d=new Headers(o.headers),m=bu();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):o.body,y=new AbortController,g=setTimeout(()=>y.abort(),CN),p=await fetch(c,{...o,headers:d,body:f,credentials:"include",signal:y.signal}).finally(()=>clearTimeout(g)),C=(p.headers.get("Content-Type")||"").includes("application/json")?await p.json():p;if(!p.ok){const P=new Error((C==null?void 0:C.error)||`HTTP ${p.status}`);throw P.status=p.status,P.data=C,P}return C}function $e(r,a){return So(r,{...a,method:"GET"})}function mt(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 EN=[{icon:Mb,label:"数据概览",href:"/dashboard"},{icon:qs,label:"内容管理",href:"/content"},{icon:Yt,label:"用户管理",href:"/users"},{icon:jb,label:"找伙伴",href:"/find-partner"},{icon:Ma,label:"推广中心",href:"/distribution"}];function PN(){const r=gn(),a=yn(),[l,o]=h.useState(!1),[c,d]=h.useState(!1);h.useEffect(()=>{o(!0)},[]),h.useEffect(()=>{if(!l)return;d(!1);let f=!1;return $e("/api/admin").then(y=>{f||(y&&y.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{f||a("/login",{replace:!0})}),()=>{f=!0}},[l,a]);const m=async()=>{wN();try{await mt("/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:[EN.map(f=>{const y=r.pathname===f.href;return e.jsxs(Kd,{to:f.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${y?"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(Kd,{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(dn,{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(zb,{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(wj,{})})})]})}function Vf(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function Nu(...r){return a=>{let l=!1;const o=r.map(c=>{const d=Vf(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c{let{children:d,...m}=o;Zx(d)&&typeof ho=="function"&&(d=ho(d._payload));const f=h.Children.toArray(d),y=f.find(MN);if(y){const g=y.props.children,p=f.map(v=>v===y?h.Children.count(g)>1?h.Children.only(null):h.isValidElement(g)?g.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(g)?h.cloneElement(g,void 0,p):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}var tp=ep("Slot");function IN(r){const a=h.forwardRef((l,o)=>{let{children:c,...d}=l;if(Zx(c)&&typeof ho=="function"&&(c=ho(c._payload)),h.isValidElement(c)){const m=DN(c),f=AN(d,c.props);return c.type!==h.Fragment&&(f.ref=o?Nu(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var _N=Symbol("radix.slottable");function MN(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===_N}function AN(r,a){const l={...a};for(const o in a){const c=r[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...f)=>{const y=d(...f);return c(...f),y}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function DN(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}function sp(r){var a,l,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;atypeof r=="boolean"?`${r}`:r===0?"0":r,Hf=rp,np=(r,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return Hf(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,m=Object.keys(c).map(g=>{const p=l==null?void 0:l[g],v=d==null?void 0:d[g];if(p===null)return null;const C=Wf(p)||Wf(v);return c[g][C]}),f=l&&Object.entries(l).reduce((g,p)=>{let[v,C]=p;return C===void 0||(g[v]=C),g},{}),y=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((g,p)=>{let{class:v,className:C,...P}=p;return Object.entries(P).every(T=>{let[b,N]=T;return Array.isArray(N)?N.includes({...d,...f}[b]):{...d,...f}[b]===N})?[...g,v,C]:g},[]);return Hf(r,m,y,l==null?void 0:l.class,l==null?void 0:l.className)},LN=(r,a)=>{const l=new Array(r.length+a.length);for(let o=0;o({classGroupId:r,validator:a}),ap=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),mo="-",Kf=[],FN="arbitrary..",zN=r=>{const a=BN(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return $N(m);const f=m.split(mo),y=f[0]===""&&f.length>1?1:0;return lp(f,y,a)},getConflictingClassGroupIds:(m,f)=>{if(f){const y=o[m],g=l[m];return y?g?LN(g,y):y:g||Kf}return l[m]||Kf}}},lp=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],d=l.nextPart.get(c);if(d){const g=lp(r,a+1,d);if(g)return g}const m=l.validators;if(m===null)return;const f=a===0?r.join(mo):r.slice(a).join(mo),y=m.length;for(let g=0;gr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?FN+o:void 0})(),BN=r=>{const{theme:a,classGroups:l}=r;return UN(l,a)},UN=(r,a)=>{const l=ap();for(const o in r){const c=r[o];wu(c,l,o,a)}return l},wu=(r,a,l,o)=>{const c=r.length;for(let d=0;d{if(typeof r=="string"){WN(r,a,l);return}if(typeof r=="function"){HN(r,a,l,o);return}KN(r,a,l,o)},WN=(r,a,l)=>{const o=r===""?a:ip(a,r);o.classGroupId=l},HN=(r,a,l,o)=>{if(GN(r)){wu(r(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(ON(l,r))},KN=(r,a,l,o)=>{const c=Object.entries(r),d=c.length;for(let m=0;m{let l=r;const o=a.split(mo),c=o.length;for(let d=0;d"isThemeGetter"in r&&r.isThemeGetter===!0,YN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(d,m)=>{l[d]=m,a++,a>r&&(a=0,o=l,l=Object.create(null))};return{get(d){let m=l[d];if(m!==void 0)return m;if((m=o[d])!==void 0)return c(d,m),m},set(d,m){d in l?l[d]=m:c(d,m)}}},Jd="!",Gf=":",QN=[],Yf=(r,a,l,o,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),qN=r=>{const{prefix:a,experimentalParseClassName:l}=r;let o=c=>{const d=[];let m=0,f=0,y=0,g;const p=c.length;for(let b=0;by?g-y:void 0;return Yf(d,P,C,T)};if(a){const c=a+Gf,d=o;o=m=>m.startsWith(c)?d(m.slice(c.length)):Yf(QN,!1,m,void 0,!0)}if(l){const c=o;o=d=>l({className:d,parseClassName:c})}return o},XN=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let d=0;d0&&(c.sort(),o.push(...c),c=[]),o.push(m)):c.push(m)}return c.length>0&&(c.sort(),o.push(...c)),o}},JN=r=>({cache:YN(r.cacheSize),parseClassName:qN(r),sortModifiers:XN(r),...zN(r)}),ZN=/\s+/,ew=(r,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:d}=a,m=[],f=r.trim().split(ZN);let y="";for(let g=f.length-1;g>=0;g-=1){const p=f[g],{isExternal:v,modifiers:C,hasImportantModifier:P,baseClassName:T,maybePostfixModifierPosition:b}=l(p);if(v){y=p+(y.length>0?" "+y:y);continue}let N=!!b,w=o(N?T.substring(0,b):T);if(!w){if(!N){y=p+(y.length>0?" "+y:y);continue}if(w=o(T),!w){y=p+(y.length>0?" "+y:y);continue}N=!1}const k=C.length===0?"":C.length===1?C[0]:d(C).join(":"),j=P?k+Jd:k,_=j+w;if(m.indexOf(_)>-1)continue;m.push(_);const U=c(w,N);for(let V=0;V0?" "+y:y)}return y},tw=(...r)=>{let a=0,l,o,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let o=0;o{let l,o,c,d;const m=y=>{const g=a.reduce((p,v)=>v(p),r());return l=JN(g),o=l.cache.get,c=l.cache.set,d=f,f(y)},f=y=>{const g=o(y);if(g)return g;const p=ew(y,l);return c(y,p),p};return d=m,(...y)=>d(tw(...y))},rw=[],$t=r=>{const a=l=>l[r]||rw;return a.isThemeGetter=!0,a},cp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nw=/^\d+\/\d+$/,aw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lw=/\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$/,iw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ow=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wa=r=>nw.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=>aw.test(r),dw=()=>!0,uw=r=>lw.test(r)&&!iw.test(r),up=()=>!1,hw=r=>ow.test(r),mw=r=>cw.test(r),fw=r=>!_e(r)&&!Me(r),xw=r=>Fa(r,fp,up),_e=r=>cp.test(r),Bn=r=>Fa(r,xp,uw),Td=r=>Fa(r,jw,qe),Qf=r=>Fa(r,hp,up),pw=r=>Fa(r,mp,mw),Qi=r=>Fa(r,pp,hw),Me=r=>dp.test(r),Cl=r=>za(r,xp),gw=r=>za(r,bw),qf=r=>za(r,hp),yw=r=>za(r,fp),vw=r=>za(r,mp),qi=r=>za(r,pp,!0),Fa=(r,a,l)=>{const o=cp.exec(r);return o?o[1]?a(o[1]):l(o[2]):!1},za=(r,a,l=!1)=>{const o=dp.exec(r);return o?o[1]?a(o[1]):l:!1},hp=r=>r==="position"||r==="percentage",mp=r=>r==="image"||r==="url",fp=r=>r==="length"||r==="size"||r==="bg-size",xp=r=>r==="length",jw=r=>r==="number",bw=r=>r==="family-name",pp=r=>r==="shadow",Nw=()=>{const r=$t("color"),a=$t("font"),l=$t("text"),o=$t("font-weight"),c=$t("tracking"),d=$t("leading"),m=$t("breakpoint"),f=$t("container"),y=$t("spacing"),g=$t("radius"),p=$t("shadow"),v=$t("inset-shadow"),C=$t("text-shadow"),P=$t("drop-shadow"),T=$t("blur"),b=$t("perspective"),N=$t("aspect"),w=$t("ease"),k=$t("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[..._(),Me,_e],V=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],R=()=>[Me,_e,y],E=()=>[wa,"full","auto",...R()],Y=()=>[en,"none","subgrid",Me,_e],ne=()=>["auto",{span:["full",en,Me,_e]},en,Me,_e],ae=()=>[en,"auto",Me,_e],q=()=>["auto","min","max","fr",Me,_e],se=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],ie=()=>["auto",...R()],ve=()=>[wa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],B=()=>[r,Me,_e],ce=()=>[..._(),qf,Qf,{position:[Me,_e]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",yw,xw,{size:[Me,_e]}],O=()=>[Pd,Cl,Bn],L=()=>["","none","full",g,Me,_e],J=()=>["",qe,Cl,Bn],G=()=>["solid","dashed","dotted","double"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[qe,Pd,qf,Qf],ge=()=>["","none",T,Me,_e],Se=()=>["none",qe,Me,_e],D=()=>["none",qe,Me,_e],fe=()=>[qe,Me,_e],ke=()=>[wa,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Cr],breakpoint:[Cr],color:[dw],container:[Cr],"drop-shadow":[Cr],ease:["in","out","in-out"],font:[fw],"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,N]}],container:["container"],columns:[{columns:[qe,_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:U()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[en,"auto",Me,_e]}],basis:[{basis:[wa,"full","auto",f,...R()]}],"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":Y()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":Y()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...se(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...se()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":se()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:ie()}],mx:[{mx:ie()}],my:[{my:ie()}],ms:[{ms:ie()}],me:[{me:ie()}],mt:[{mt:ie()}],mr:[{mr:ie()}],mb:[{mb:ie()}],ml:[{ml:ie()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:ve()}],w:[{w:[f,"screen",...ve()]}],"min-w":[{"min-w":[f,"screen","none",...ve()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[m]},...ve()]}],h:[{h:["screen","lh",...ve()]}],"min-h":[{"min-h":["screen","lh","none",...ve()]}],"max-h":[{"max-h":["screen","lh",...ve()]}],"font-size":[{text:["base",l,Cl,Bn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,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:[gw,_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,...R()]}],"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:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",Me,Bn]}],"text-decoration-color":[{decoration:B()}],"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:R()}],"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:ce()}],"bg-repeat":[{bg:K()}],"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]},vw,pw]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,Me,_e]}],"outline-w":[{outline:["",qe,Cl,Bn]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",p,qi,Qi]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",v,qi,Qi]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[qe,Bn]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",C,qi,Qi]}],"text-shadow-color":[{"text-shadow":B()}],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":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"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":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"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":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"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":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"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":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"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":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"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":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"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":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,_e]}],filter:[{filter:["","none",Me,_e]}],blur:[{blur:ge()}],brightness:[{brightness:[qe,Me,_e]}],contrast:[{contrast:[qe,Me,_e]}],"drop-shadow":[{"drop-shadow":["","none",P,qi,Qi]}],"drop-shadow-color":[{"drop-shadow":B()}],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":ge()}],"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":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"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",w,Me,_e]}],delay:[{delay:[qe,Me,_e]}],animate:[{animate:["none",k,Me,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Me,_e]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[Me,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"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:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",...B()]}],"stroke-w":[{stroke:[qe,Cl,Bn,Td]}],stroke:[{stroke:["none",...B()]}],"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"]}},ww=sw(Nw);function lt(...r){return ww(rp(r))}const Sw=np("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Z({className:r,variant:a,size:l,asChild:o=!1,...c}){const d=o?tp:"button";return e.jsx(d,{"data-slot":"button",className:lt(Sw({variant:a,size:l,className:r})),...c})}function le({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 Cw(){const r=yn(),[a,l]=h.useState(""),[o,c]=h.useState(""),[d,m]=h.useState(""),[f,y]=h.useState(!1),g=async()=>{m(""),y(!0);try{const p=await mt("/api/admin",{username:a.trim(),password:o});if((p==null?void 0:p.success)!==!1&&(p!=null&&p.token)){NN(p.token),r("/dashboard",{replace:!0});return}m(p.error||"用户名或密码错误")}catch(p){const v=p;m(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{y(!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(vu,{className:"w-8 h-8 text-[#38bdac]"})}),e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),e.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),e.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[e.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ra,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(le,{type:"text",value:a,onChange:p=>l(p.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ob,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(le,{type:"password",value:o,onChange:p=>c(p.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:p=>p.key==="Enter"&&g()})]})]}),d&&e.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:d}),e.jsx(Z,{onClick:g,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 jt=h.forwardRef(({className:r,...a},l)=>e.jsx("p",{ref:l,className:lt("text-sm text-muted-foreground",r),...a}));jt.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 kw=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:lt("flex items-center p-6 pt-0",r),...a}));kw.displayName="CardFooter";function Ew(){const r=yn(),[a,l]=h.useState(!0),[o,c]=h.useState([]),[d,m]=h.useState([]),[f,y]=h.useState(0),[g,p]=h.useState(0),[v,C]=h.useState(0),[P,T]=h.useState(0),[b,N]=h.useState(null);async function w(){var U;l(!0),N(null);try{try{const H=await $e("/api/admin/dashboard/overview");if(H!=null&&H.success){y(H.totalUsers??0),p(H.paidOrderCount??0),C(H.totalRevenue??0),T(H.conversionRate??0),m(H.recentOrders??[]),c(H.newUsers??[]);return}}catch(H){console.error("数据概览接口失败,尝试降级拉取",H)}const[V,I]=await Promise.all([$e("/api/db/users?page=1&pageSize=10"),$e("/api/orders?page=1&pageSize=20&status=paid")]),R=typeof(V==null?void 0:V.total)=="number"?V.total:((U=V==null?void 0:V.users)==null?void 0:U.length)??0,E=(I==null?void 0:I.orders)??[],Y=typeof(I==null?void 0:I.total)=="number"?I.total:E.length,ne=E.filter(H=>H.status==="paid"||H.status==="completed"||H.status==="success"),ae=ne.reduce((H,ie)=>H+Number(ie.amount||0),0),q=new Set(ne.map(H=>H.userId).filter(Boolean)),se=R>0&&q.size>0?q.size/R*100:0;y(R),p(Y),C(ae),T(se),m(E.slice(0,5)),c((V==null?void 0:V.users)??[])}catch(V){console.error("降级拉取失败",V);const I=V;(I==null?void 0:I.status)===401?N("登录已过期,请重新登录"):(I==null?void 0:I.name)==="AbortError"?N("请求超时,请检查网络后点击重试"):N("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(h.useEffect(()=>{w();const U=setInterval(w,3e4);return()=>clearInterval(U)},[]),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 k=f,j=U=>{const V=U.productType||"",I=U.description||"";if(I){if(V==="section"&&I.includes("章节")){if(I.includes("-")){const R=I.split("-");if(R.length>=3)return{title:`第${R[1]}章 第${R[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:I,subtitle:"章节购买"}}return V==="fullbook"||I.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:V==="match"||I.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:I,subtitle:V==="section"?"单章":V==="fullbook"?"全书":"其他"}}return V==="section"?{title:`章节 ${U.productId||""}`,subtitle:"单章购买"}:V==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:V==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:V||"其他"}},_=[{title:"总用户数",value:k,icon:Yt,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${(v??0).toFixed(2)}`,icon:Rl,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:g,icon:qd,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"}];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),b&&e.jsxs("div",{className:"mb-6 px-4 py-3 rounded-lg bg-amber-500/20 border border-amber-500/50 text-amber-200 text-sm flex items-center justify-between",children:[e.jsx("span",{children:b}),e.jsx("button",{type:"button",onClick:()=>w(),className:"text-amber-400 hover:text-amber-300 underline",children:"重试"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:_.map((U,V)=>e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>U.link&&r(U.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:U.title}),e.jsx("div",{className:`p-2 rounded-lg ${U.bg}`,children:e.jsx(U.icon,{className:`w-4 h-4 ${U.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:U.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:()=>w(),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(U=>{var Y;const V=U.referrerId?o.find(ne=>ne.id===U.referrerId):void 0,I=U.referralCode||(V==null?void 0:V.referralCode)||(V==null?void 0:V.nickname)||(U.referrerId?String(U.referrerId).slice(0,8):""),R=j(U),E=U.userNickname||((Y=o.find(ne=>ne.id===U.userId))==null?void 0:Y.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:[U.userAvatar?e.jsx("img",{src:U.userAvatar,alt:E,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:ne=>{ne.currentTarget.style.display="none";const ae=ne.currentTarget.nextElementSibling;ae&&ae.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 ${U.userAvatar?"hidden":""}`,children:E.charAt(0)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm text-gray-300",children:E}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:R.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:R.subtitle}),e.jsx("span",{children:new Date(U.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),I&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",I]})]})]}),e.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(U.amount).toFixed(2)]}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:U.paymentMethod||"微信"})]})]},U.id)}),d.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(qd,{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:[o.slice(0,5).map(U=>{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=U.nickname)==null?void 0:V.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-white",children:U.nickname||"匿名用户"}),e.jsx("p",{className:"text-xs text-gray-500",children:U.phone||"-"})]})]}),e.jsx("p",{className:"text-xs text-gray-400",children:U.createdAt?new Date(U.createdAt).toLocaleDateString():"-"})]},U.id)}),o.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 be=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}));be.displayName="TableHead";const pe=h.forwardRef(({className:r,...a},l)=>e.jsx("td",{ref:l,className:lt("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));pe.displayName="TableCell";const Pw=np("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,...o}){const c=l?tp:"span";return e.jsx(c,{className:lt(Pw({variant:a}),r),...o})}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 Tw(r,a){const l=h.createContext(a),o=d=>{const{children:m,...f}=d,y=h.useMemo(()=>f,Object.values(f));return e.jsx(l.Provider,{value:y,children:m})};o.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[o,c]}function vn(r,a=[]){let l=[];function o(d,m){const f=h.createContext(m),y=l.length;l=[...l,m];const g=v=>{var w;const{scope:C,children:P,...T}=v,b=((w=C==null?void 0:C[r])==null?void 0:w[y])||f,N=h.useMemo(()=>T,Object.values(T));return e.jsx(b.Provider,{value:N,children:P})};g.displayName=d+"Provider";function p(v,C){var b;const P=((b=C==null?void 0:C[r])==null?void 0:b[y])||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[g,p]}const c=()=>{const d=l.map(m=>h.createContext(m));return function(f){const y=(f==null?void 0:f[r])||d;return h.useMemo(()=>({[`__scope${r}`]:{...f,[r]:y}}),[f,y])}};return c.scopeName=r,[o,Rw(c,...a)]}function Rw(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const o=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const m=o.reduce((f,{useScope:y,scopeName:g})=>{const v=y(d)[`__scope${g}`];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:()=>{},Iw=bo[" useId ".trim().toString()]||(()=>{}),_w=0;function un(r){const[a,l]=h.useState(Iw());return Zt(()=>{l(o=>o??String(_w++))},[r]),a?`radix-${a}`:""}var Mw=bo[" useInsertionEffect ".trim().toString()]||Zt;function Vn({prop:r,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,d,m]=Aw({defaultProp:a,onChange:l}),f=r!==void 0,y=f?r:c;{const p=h.useRef(r!==void 0);h.useEffect(()=>{const v=p.current;v!==f&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=f},[f,o])}const g=h.useCallback(p=>{var v;if(f){const C=Dw(p)?p(r):p;C!==r&&((v=m.current)==null||v.call(m,C))}else d(p)},[f,r,d,m]);return[y,g]}function Aw({defaultProp:r,onChange:a}){const[l,o]=h.useState(r),c=h.useRef(l),d=h.useRef(a);return Mw(()=>{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,o,d]}function Dw(r){return typeof r=="function"}function Dl(r){const a=Lw(r),l=h.forwardRef((o,c)=>{const{children:d,...m}=o,f=h.Children.toArray(d),y=f.find(Fw);if(y){const g=y.props.children,p=f.map(v=>v===y?h.Children.count(g)>1?h.Children.only(null):h.isValidElement(g)?g.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(g)?h.cloneElement(g,void 0,p):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}function Lw(r){const a=h.forwardRef((l,o)=>{const{children:c,...d}=l;if(h.isValidElement(c)){const m=$w(c),f=zw(d,c.props);return c.type!==h.Fragment&&(f.ref=o?Nu(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var Ow=Symbol("radix.slottable");function Fw(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Ow}function zw(r,a){const l={...a};for(const o in a){const c=r[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...f)=>{const y=d(...f);return c(...f),y}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function $w(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Bw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=Bw.reduce((r,a)=>{const l=Dl(`Primitive.${a}`),o=h.forwardRef((c,d)=>{const{asChild:m,...f}=c,y=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(y,{...f,ref:d})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{});function Uw(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 o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function Vw(r,a=globalThis==null?void 0:globalThis.document){const l=mn(r);h.useEffect(()=>{const o=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",o,{capture:!0}),()=>a.removeEventListener("keydown",o,{capture:!0})},[l,a])}var Ww="DismissableLayer",Zd="dismissableLayer.update",Hw="dismissableLayer.pointerDownOutside",Kw="dismissableLayer.focusOutside",Xf,gp=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Su=h.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:m,onDismiss:f,...y}=r,g=h.useContext(gp),[p,v]=h.useState(null),C=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=h.useState({}),T=at(a,I=>v(I)),b=Array.from(g.layers),[N]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),w=b.indexOf(N),k=p?b.indexOf(p):-1,j=g.layersWithOutsidePointerEventsDisabled.size>0,_=k>=w,U=Qw(I=>{const R=I.target,E=[...g.branches].some(Y=>Y.contains(R));!_||E||(c==null||c(I),m==null||m(I),I.defaultPrevented||f==null||f())},C),V=qw(I=>{const R=I.target;[...g.branches].some(Y=>Y.contains(R))||(d==null||d(I),m==null||m(I),I.defaultPrevented||f==null||f())},C);return Vw(I=>{k===g.layers.size-1&&(o==null||o(I),!I.defaultPrevented&&f&&(I.preventDefault(),f()))},C),h.useEffect(()=>{if(p)return l&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Xf=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(p)),g.layers.add(p),Jf(),()=>{l&&g.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=Xf)}},[p,C,l,g]),h.useEffect(()=>()=>{p&&(g.layers.delete(p),g.layersWithOutsidePointerEventsDisabled.delete(p),Jf())},[p,g]),h.useEffect(()=>{const I=()=>P({});return document.addEventListener(Zd,I),()=>document.removeEventListener(Zd,I)},[]),e.jsx(Xe.div,{...y,ref:T,style:{pointerEvents:j?_?"auto":"none":void 0,...r.style},onFocusCapture:Ge(r.onFocusCapture,V.onFocusCapture),onBlurCapture:Ge(r.onBlurCapture,V.onBlurCapture),onPointerDownCapture:Ge(r.onPointerDownCapture,U.onPointerDownCapture)})});Su.displayName=Ww;var Gw="DismissableLayerBranch",Yw=h.forwardRef((r,a)=>{const l=h.useContext(gp),o=h.useRef(null),c=at(a,o);return h.useEffect(()=>{const d=o.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),e.jsx(Xe.div,{...r,ref:c})});Yw.displayName=Gw;function Qw(r,a=globalThis==null?void 0:globalThis.document){const l=mn(r),o=h.useRef(!1),c=h.useRef(()=>{});return h.useEffect(()=>{const d=f=>{if(f.target&&!o.current){let y=function(){yp(Hw,l,g,{discrete:!0})};const g={originalEvent:f};f.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=y,a.addEventListener("click",c.current,{once:!0})):y()}else a.removeEventListener("click",c.current);o.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:()=>o.current=!0}}function qw(r,a=globalThis==null?void 0:globalThis.document){const l=mn(r),o=h.useRef(!1);return h.useEffect(()=>{const c=d=>{d.target&&!o.current&&yp(Kw,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Jf(){const r=new CustomEvent(Zd);document.dispatchEvent(r)}function yp(r,a,l,{discrete:o}){const c=l.originalEvent.target,d=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),o?Uw(c,d):c.dispatchEvent(d)}var Rd="focusScope.autoFocusOnMount",Id="focusScope.autoFocusOnUnmount",Zf={bubbles:!1,cancelable:!0},Xw="FocusScope",Cu=h.forwardRef((r,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...m}=r,[f,y]=h.useState(null),g=mn(c),p=mn(d),v=h.useRef(null),C=at(a,b=>y(b)),P=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let b=function(j){if(P.paused||!f)return;const _=j.target;f.contains(_)?v.current=_:rn(v.current,{select:!0})},N=function(j){if(P.paused||!f)return;const _=j.relatedTarget;_!==null&&(f.contains(_)||rn(v.current,{select:!0}))},w=function(j){if(document.activeElement===document.body)for(const U of j)U.removedNodes.length>0&&rn(f)};document.addEventListener("focusin",b),document.addEventListener("focusout",N);const k=new MutationObserver(w);return f&&k.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",N),k.disconnect()}}},[o,f,P.paused]),h.useEffect(()=>{if(f){tx.add(P);const b=document.activeElement;if(!f.contains(b)){const w=new CustomEvent(Rd,Zf);f.addEventListener(Rd,g),f.dispatchEvent(w),w.defaultPrevented||(Jw(r1(vp(f)),{select:!0}),document.activeElement===b&&rn(f))}return()=>{f.removeEventListener(Rd,g),setTimeout(()=>{const w=new CustomEvent(Id,Zf);f.addEventListener(Id,p),f.dispatchEvent(w),w.defaultPrevented||rn(b??document.body,{select:!0}),f.removeEventListener(Id,p),tx.remove(P)},0)}}},[f,g,p,P]);const T=h.useCallback(b=>{if(!l&&!o||P.paused)return;const N=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,w=document.activeElement;if(N&&w){const k=b.currentTarget,[j,_]=Zw(k);j&&_?!b.shiftKey&&w===_?(b.preventDefault(),l&&rn(j,{select:!0})):b.shiftKey&&w===j&&(b.preventDefault(),l&&rn(_,{select:!0})):w===k&&b.preventDefault()}},[l,o,P.paused]);return e.jsx(Xe.div,{tabIndex:-1,...m,ref:C,onKeyDown:T})});Cu.displayName=Xw;function Jw(r,{select:a=!1}={}){const l=document.activeElement;for(const o of r)if(rn(o,{select:a}),document.activeElement!==l)return}function Zw(r){const a=vp(r),l=ex(a,r),o=ex(a.reverse(),r);return[l,o]}function vp(r){const a=[],l=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function ex(r,a){for(const l of r)if(!e1(l,{upTo:a}))return l}function e1(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 t1(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&&t1(r)&&a&&r.select()}}var tx=s1();function s1(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=sx(r,a),r.unshift(a)},remove(a){var l;r=sx(r,a),(l=r[0])==null||l.resume()}}}function sx(r,a){const l=[...r],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function r1(r){return r.filter(a=>a.tagName!=="A")}var n1="Portal",ku=h.forwardRef((r,a)=>{var f;const{container:l,...o}=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?Rv.createPortal(e.jsx(Xe.div,{...o,ref:a}),m):null});ku.displayName=n1;function a1(r,a){return h.useReducer((l,o)=>a[l][o]??l,r)}var Fl=r=>{const{present:a,children:l}=r,o=l1(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),d=at(o.ref,i1(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:d}):null};Fl.displayName="Presence";function l1(r){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(r),d=h.useRef("none"),m=r?"mounted":"unmounted",[f,y]=a1(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const g=Xi(o.current);d.current=f==="mounted"?g:"none"},[f]),Zt(()=>{const g=o.current,p=c.current;if(p!==r){const C=d.current,P=Xi(g);r?y("MOUNT"):P==="none"||(g==null?void 0:g.display)==="none"?y("UNMOUNT"):y(p&&C!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,y]),Zt(()=>{if(a){let g;const p=a.ownerDocument.defaultView??window,v=P=>{const b=Xi(o.current).includes(CSS.escape(P.animationName));if(P.target===a&&b&&(y("ANIMATION_END"),!c.current)){const N=a.style.animationFillMode;a.style.animationFillMode="forwards",g=p.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=N)})}},C=P=>{P.target===a&&(d.current=Xi(o.current))};return a.addEventListener("animationstart",C),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{p.clearTimeout(g),a.removeEventListener("animationstart",C),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else y("ANIMATION_END")},[a,y]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:h.useCallback(g=>{o.current=g?getComputedStyle(g):null,l(g)},[])}}function Xi(r){return(r==null?void 0:r.animationName)||"none"}function i1(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var _d=0;function jp(){h.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??rx()),document.body.insertAdjacentElement("beforeend",r[1]??rx()),_d++,()=>{_d===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),_d--}},[])}function rx(){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,o=1,c=arguments.length;o"u")return S1;var a=C1(r),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},E1=Sp(),Ia="data-scroll-locked",P1=function(r,a,l,o){var c=r.left,d=r.top,m=r.right,f=r.gap;return l===void 0&&(l="margin"),` + */const bN=[["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",bN),ju="admin_token";function bu(){try{return localStorage.getItem(ju)}catch{return null}}function NN(r){try{localStorage.setItem(ju,r)}catch{}}function wN(){try{localStorage.removeItem(ju)}catch{}}const SN="https://soulapi.quwanzhi.com",CN=15e3,kN=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):SN};function Da(r){const a=kN(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function So(r,a={}){const{data:l,...o}=a,c=Da(r),u=new Headers(o.headers),m=bu();m&&u.set("Authorization",`Bearer ${m}`),l!=null&&!u.has("Content-Type")&&u.set("Content-Type","application/json");const f=l!=null?JSON.stringify(l):o.body,y=new AbortController,g=setTimeout(()=>y.abort(),CN),p=await fetch(c,{...o,headers:u,body:f,credentials:"include",signal:y.signal}).finally(()=>clearTimeout(g)),k=(p.headers.get("Content-Type")||"").includes("application/json")?await p.json():p;if(!p.ok){const P=new Error((k==null?void 0:k.error)||`HTTP ${p.status}`);throw P.status=p.status,P.data=k,P}return k}function $e(r,a){return So(r,{...a,method:"GET"})}function mt(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 EN=[{icon:Mb,label:"数据概览",href:"/dashboard"},{icon:qs,label:"内容管理",href:"/content"},{icon:Kt,label:"用户管理",href:"/users"},{icon:jb,label:"找伙伴",href:"/find-partner"},{icon:Aa,label:"推广中心",href:"/distribution"}];function PN(){const r=pn(),a=gn(),[l,o]=h.useState(!1),[c,u]=h.useState(!1);h.useEffect(()=>{o(!0)},[]),h.useEffect(()=>{if(!l)return;u(!1);let f=!1;return $e("/api/admin").then(y=>{f||(y&&y.success!==!1?u(!0):a("/login",{replace:!0}))}).catch(()=>{f||a("/login",{replace:!0})}),()=>{f=!0}},[l,a]);const m=async()=>{wN();try{await mt("/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:[EN.map(f=>{const y=r.pathname===f.href;return e.jsxs(Kd,{to:f.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${y?"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(Kd,{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(Bn,{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(zb,{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(wj,{})})})]})}function Vf(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function Nu(...r){return a=>{let l=!1;const o=r.map(c=>{const u=Vf(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c{let{children:u,...m}=o;Zx(u)&&typeof ho=="function"&&(u=ho(u._payload));const f=h.Children.toArray(u),y=f.find(MN);if(y){const g=y.props.children,p=f.map(v=>v===y?h.Children.count(g)>1?h.Children.only(null):h.isValidElement(g)?g.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(g)?h.cloneElement(g,void 0,p):null})}return e.jsx(a,{...m,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}var tp=ep("Slot");function IN(r){const a=h.forwardRef((l,o)=>{let{children:c,...u}=l;if(Zx(c)&&typeof ho=="function"&&(c=ho(c._payload)),h.isValidElement(c)){const m=DN(c),f=AN(u,c.props);return c.type!==h.Fragment&&(f.ref=o?Nu(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var _N=Symbol("radix.slottable");function MN(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===_N}function AN(r,a){const l={...a};for(const o in a){const c=r[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...f)=>{const y=u(...f);return c(...f),y}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function DN(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}function sp(r){var a,l,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;atypeof r=="boolean"?`${r}`:r===0?"0":r,Hf=rp,np=(r,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return Hf(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:u}=a,m=Object.keys(c).map(g=>{const p=l==null?void 0:l[g],v=u==null?void 0:u[g];if(p===null)return null;const k=Wf(p)||Wf(v);return c[g][k]}),f=l&&Object.entries(l).reduce((g,p)=>{let[v,k]=p;return k===void 0||(g[v]=k),g},{}),y=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((g,p)=>{let{class:v,className:k,...P}=p;return Object.entries(P).every(T=>{let[b,N]=T;return Array.isArray(N)?N.includes({...u,...f}[b]):{...u,...f}[b]===N})?[...g,v,k]:g},[]);return Hf(r,m,y,l==null?void 0:l.class,l==null?void 0:l.className)},LN=(r,a)=>{const l=new Array(r.length+a.length);for(let o=0;o({classGroupId:r,validator:a}),ap=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),mo="-",Kf=[],FN="arbitrary..",zN=r=>{const a=BN(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return $N(m);const f=m.split(mo),y=f[0]===""&&f.length>1?1:0;return lp(f,y,a)},getConflictingClassGroupIds:(m,f)=>{if(f){const y=o[m],g=l[m];return y?g?LN(g,y):y:g||Kf}return l[m]||Kf}}},lp=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],u=l.nextPart.get(c);if(u){const g=lp(r,a+1,u);if(g)return g}const m=l.validators;if(m===null)return;const f=a===0?r.join(mo):r.slice(a).join(mo),y=m.length;for(let g=0;gr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?FN+o:void 0})(),BN=r=>{const{theme:a,classGroups:l}=r;return UN(l,a)},UN=(r,a)=>{const l=ap();for(const o in r){const c=r[o];wu(c,l,o,a)}return l},wu=(r,a,l,o)=>{const c=r.length;for(let u=0;u{if(typeof r=="string"){WN(r,a,l);return}if(typeof r=="function"){HN(r,a,l,o);return}KN(r,a,l,o)},WN=(r,a,l)=>{const o=r===""?a:ip(a,r);o.classGroupId=l},HN=(r,a,l,o)=>{if(GN(r)){wu(r(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(ON(l,r))},KN=(r,a,l,o)=>{const c=Object.entries(r),u=c.length;for(let m=0;m{let l=r;const o=a.split(mo),c=o.length;for(let u=0;u"isThemeGetter"in r&&r.isThemeGetter===!0,YN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(u,m)=>{l[u]=m,a++,a>r&&(a=0,o=l,l=Object.create(null))};return{get(u){let m=l[u];if(m!==void 0)return m;if((m=o[u])!==void 0)return c(u,m),m},set(u,m){u in l?l[u]=m:c(u,m)}}},Jd="!",Gf=":",QN=[],Yf=(r,a,l,o,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),qN=r=>{const{prefix:a,experimentalParseClassName:l}=r;let o=c=>{const u=[];let m=0,f=0,y=0,g;const p=c.length;for(let b=0;by?g-y:void 0;return Yf(u,P,k,T)};if(a){const c=a+Gf,u=o;o=m=>m.startsWith(c)?u(m.slice(c.length)):Yf(QN,!1,m,void 0,!0)}if(l){const c=o;o=u=>l({className:u,parseClassName:c})}return o},XN=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let u=0;u0&&(c.sort(),o.push(...c),c=[]),o.push(m)):c.push(m)}return c.length>0&&(c.sort(),o.push(...c)),o}},JN=r=>({cache:YN(r.cacheSize),parseClassName:qN(r),sortModifiers:XN(r),...zN(r)}),ZN=/\s+/,ew=(r,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:u}=a,m=[],f=r.trim().split(ZN);let y="";for(let g=f.length-1;g>=0;g-=1){const p=f[g],{isExternal:v,modifiers:k,hasImportantModifier:P,baseClassName:T,maybePostfixModifierPosition:b}=l(p);if(v){y=p+(y.length>0?" "+y:y);continue}let N=!!b,C=o(N?T.substring(0,b):T);if(!C){if(!N){y=p+(y.length>0?" "+y:y);continue}if(C=o(T),!C){y=p+(y.length>0?" "+y:y);continue}N=!1}const E=k.length===0?"":k.length===1?k[0]:u(k).join(":"),j=P?E+Jd:E,R=j+C;if(m.indexOf(R)>-1)continue;m.push(R);const Q=c(C,N);for(let Z=0;Z0?" "+y:y)}return y},tw=(...r)=>{let a=0,l,o,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let o=0;o{let l,o,c,u;const m=y=>{const g=a.reduce((p,v)=>v(p),r());return l=JN(g),o=l.cache.get,c=l.cache.set,u=f,f(y)},f=y=>{const g=o(y);if(g)return g;const p=ew(y,l);return c(y,p),p};return u=m,(...y)=>u(tw(...y))},rw=[],$t=r=>{const a=l=>l[r]||rw;return a.isThemeGetter=!0,a},cp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nw=/^\d+\/\d+$/,aw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lw=/\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$/,iw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ow=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wa=r=>nw.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=>aw.test(r),dw=()=>!0,uw=r=>lw.test(r)&&!iw.test(r),up=()=>!1,hw=r=>ow.test(r),mw=r=>cw.test(r),fw=r=>!_e(r)&&!Me(r),xw=r=>za(r,fp,up),_e=r=>cp.test(r),$n=r=>za(r,xp,uw),Td=r=>za(r,jw,qe),Qf=r=>za(r,hp,up),pw=r=>za(r,mp,mw),Qi=r=>za(r,pp,hw),Me=r=>dp.test(r),kl=r=>$a(r,xp),gw=r=>$a(r,bw),qf=r=>$a(r,hp),yw=r=>$a(r,fp),vw=r=>$a(r,mp),qi=r=>$a(r,pp,!0),za=(r,a,l)=>{const o=cp.exec(r);return o?o[1]?a(o[1]):l(o[2]):!1},$a=(r,a,l=!1)=>{const o=dp.exec(r);return o?o[1]?a(o[1]):l:!1},hp=r=>r==="position"||r==="percentage",mp=r=>r==="image"||r==="url",fp=r=>r==="length"||r==="size"||r==="bg-size",xp=r=>r==="length",jw=r=>r==="number",bw=r=>r==="family-name",pp=r=>r==="shadow",Nw=()=>{const r=$t("color"),a=$t("font"),l=$t("text"),o=$t("font-weight"),c=$t("tracking"),u=$t("leading"),m=$t("breakpoint"),f=$t("container"),y=$t("spacing"),g=$t("radius"),p=$t("shadow"),v=$t("inset-shadow"),k=$t("text-shadow"),P=$t("drop-shadow"),T=$t("blur"),b=$t("perspective"),N=$t("aspect"),C=$t("ease"),E=$t("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"],Q=()=>[...R(),Me,_e],Z=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],I=()=>[Me,_e,y],w=()=>[wa,"full","auto",...I()],U=()=>[en,"none","subgrid",Me,_e],se=()=>["auto",{span:["full",en,Me,_e]},en,Me,_e],le=()=>[en,"auto",Me,_e],G=()=>["auto","min","max","fr",Me,_e],re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],ie=()=>["auto",...I()],ve=()=>[wa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],z=()=>[r,Me,_e],ne=()=>[...R(),qf,Qf,{position:[Me,_e]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",yw,xw,{size:[Me,_e]}],O=()=>[Pd,kl,$n],L=()=>["","none","full",g,Me,_e],X=()=>["",qe,kl,$n],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"],Y=()=>[qe,Pd,qf,Qf],ge=()=>["","none",T,Me,_e],Se=()=>["none",qe,Me,_e],D=()=>["none",qe,Me,_e],fe=()=>[qe,Me,_e],ke=()=>[wa,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Cr],breakpoint:[Cr],color:[dw],container:[Cr],"drop-shadow":[Cr],ease:["in","out","in-out"],font:[fw],"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,N]}],container:["container"],columns:[{columns:[qe,_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:Q()}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],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":U()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:se()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...re(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...re()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],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:ie()}],mx:[{mx:ie()}],my:[{my:ie()}],ms:[{ms:ie()}],me:[{me:ie()}],mt:[{mt:ie()}],mr:[{mr:ie()}],mb:[{mb:ie()}],ml:[{ml:ie()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:ve()}],w:[{w:[f,"screen",...ve()]}],"min-w":[{"min-w":[f,"screen","none",...ve()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[m]},...ve()]}],h:[{h:["screen","lh",...ve()]}],"min-h":[{"min-h":["screen","lh","none",...ve()]}],"max-h":[{"max-h":["screen","lh",...ve()]}],"font-size":[{text:["base",l,kl,$n]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,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:[gw,_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:[u,...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:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",Me,$n]}],"text-decoration-color":[{decoration:z()}],"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:ne()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},en,Me,_e],radial:["",Me,_e],conic:[en,Me,_e]},vw,pw]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,Me,_e]}],"outline-w":[{outline:["",qe,kl,$n]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",p,qi,Qi]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",v,qi,Qi]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[qe,$n]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",k,qi,Qi]}],"text-shadow-color":[{"text-shadow":z()}],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":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[Me,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,_e]}],filter:[{filter:["","none",Me,_e]}],blur:[{blur:ge()}],brightness:[{brightness:[qe,Me,_e]}],contrast:[{contrast:[qe,Me,_e]}],"drop-shadow":[{"drop-shadow":["","none",P,qi,Qi]}],"drop-shadow-color":[{"drop-shadow":z()}],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":ge()}],"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:[b,Me,_e]}],"perspective-origin":[{"perspective-origin":Q()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[Me,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:Q()}],"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:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",...z()]}],"stroke-w":[{stroke:[qe,kl,$n,Td]}],stroke:[{stroke:["none",...z()]}],"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"]}},ww=sw(Nw);function lt(...r){return ww(rp(r))}const Sw=np("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:o=!1,...c}){const u=o?tp:"button";return e.jsx(u,{"data-slot":"button",className:lt(Sw({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 Cw(){const r=gn(),[a,l]=h.useState(""),[o,c]=h.useState(""),[u,m]=h.useState(""),[f,y]=h.useState(!1),g=async()=>{m(""),y(!0);try{const p=await mt("/api/admin",{username:a.trim(),password:o});if((p==null?void 0:p.success)!==!1&&(p!=null&&p.token)){NN(p.token),r("/dashboard",{replace:!0});return}m(p.error||"用户名或密码错误")}catch(p){const v=p;m(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{y(!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(vu,{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:p=>l(p.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(Ob,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(oe,{type:"password",value:o,onChange:p=>c(p.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:p=>p.key==="Enter"&&g()})]})]}),u&&e.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:u}),e.jsx(J,{onClick:g,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 jt=h.forwardRef(({className:r,...a},l)=>e.jsx("p",{ref:l,className:lt("text-sm text-muted-foreground",r),...a}));jt.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 kw=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:lt("flex items-center p-6 pt-0",r),...a}));kw.displayName="CardFooter";function Ew(){const r=gn(),[a,l]=h.useState(!0),[o,c]=h.useState([]),[u,m]=h.useState([]),[f,y]=h.useState(0),[g,p]=h.useState(0),[v,k]=h.useState(0),[P,T]=h.useState(0),[b,N]=h.useState(0),[C,E]=h.useState(0),[j,R]=h.useState(null);async function Q(){var w;l(!0),R(null);try{try{const ne=await $e("/api/admin/dashboard/overview");if(ne!=null&&ne.success){y(ne.totalUsers??0),p(ne.paidOrderCount??0),k(ne.totalRevenue??0),T(ne.conversionRate??0),N(ne.totalMatches??0),E(ne.matchRevenue??0),m(ne.recentOrders??[]),c(ne.newUsers??[]);return}}catch(ne){console.error("数据概览接口失败,尝试降级拉取",ne)}const[U,se]=await Promise.all([$e("/api/db/users?page=1&pageSize=10"),$e("/api/orders?page=1&pageSize=20&status=paid")]),le=typeof(U==null?void 0:U.total)=="number"?U.total:((w=U==null?void 0:U.users)==null?void 0:w.length)??0,G=(se==null?void 0:se.orders)??[],re=typeof(se==null?void 0:se.total)=="number"?se.total:G.length,H=G.filter(ne=>ne.status==="paid"||ne.status==="completed"||ne.status==="success"),ie=H.reduce((ne,W)=>ne+Number(W.amount||0),0),ve=new Set(H.map(ne=>ne.userId).filter(Boolean)),z=le>0&&ve.size>0?ve.size/le*100:0;y(le),p(re),k(ie),T(z),m(G.slice(0,5)),c((U==null?void 0:U.users)??[])}catch(U){console.error("降级拉取失败",U);const se=U;(se==null?void 0:se.status)===401?R("登录已过期,请重新登录"):(se==null?void 0:se.name)==="AbortError"?R("请求超时,请检查网络后点击重试"):R("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(h.useEffect(()=>{Q();const w=setInterval(Q,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 Z=f,A=w=>{const U=w.productType||"",se=w.description||"";if(se){if(U==="section"&&se.includes("章节")){if(se.includes("-")){const le=se.split("-");if(le.length>=3)return{title:`第${le[1]}章 第${le[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:se,subtitle:"章节购买"}}return U==="fullbook"||se.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"||se.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:se,subtitle:U==="section"?"单章":U==="fullbook"?"全书":"其他"}}return U==="section"?{title:`章节 ${w.productId||""}`,subtitle:"单章购买"}:U==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:U||"其他"}},I=[{title:"总用户数",value:Z,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:g,icon:qd,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(b),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:"数据概览"}),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:()=>Q(),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,U)=>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"})]})})]},U))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ye,{className:"flex flex-row items-center justify-between",children:[e.jsx(Qe,{className:"text-white",children:"最近订单"}),e.jsxs("button",{type:"button",onClick:()=>Q(),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:[u.slice(0,5).map(w=>{var re;const U=w.referrerId?o.find(H=>H.id===w.referrerId):void 0,se=w.referralCode||(U==null?void 0:U.referralCode)||(U==null?void 0:U.nickname)||(w.referrerId?String(w.referrerId).slice(0,8):""),le=A(w),G=w.userNickname||((re=o.find(H=>H.id===w.userId))==null?void 0:re.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:G,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:H=>{H.currentTarget.style.display="none";const ie=H.currentTarget.nextElementSibling;ie&&ie.classList.remove("hidden")}}):null,e.jsx("div",{className:`w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 mt-0.5 ${w.userAvatar?"hidden":""}`,children:G.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:G}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:le.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:le.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)}),u.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(qd,{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:[o.slice(0,5).map(w=>{var U;return e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((U=w.nickname)==null?void 0:U.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)}),o.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 be=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}));be.displayName="TableHead";const pe=h.forwardRef(({className:r,...a},l)=>e.jsx("td",{ref:l,className:lt("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));pe.displayName="TableCell";const Pw=np("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,...o}){const c=l?tp:"span";return e.jsx(c,{className:lt(Pw({variant:a}),r),...o})}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 Tw(r,a){const l=h.createContext(a),o=u=>{const{children:m,...f}=u,y=h.useMemo(()=>f,Object.values(f));return e.jsx(l.Provider,{value:y,children:m})};o.displayName=r+"Provider";function c(u){const m=h.useContext(l);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${r}\``)}return[o,c]}function yn(r,a=[]){let l=[];function o(u,m){const f=h.createContext(m),y=l.length;l=[...l,m];const g=v=>{var C;const{scope:k,children:P,...T}=v,b=((C=k==null?void 0:k[r])==null?void 0:C[y])||f,N=h.useMemo(()=>T,Object.values(T));return e.jsx(b.Provider,{value:N,children:P})};g.displayName=u+"Provider";function p(v,k){var b;const P=((b=k==null?void 0:k[r])==null?void 0:b[y])||f,T=h.useContext(P);if(T)return T;if(m!==void 0)return m;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[g,p]}const c=()=>{const u=l.map(m=>h.createContext(m));return function(f){const y=(f==null?void 0:f[r])||u;return h.useMemo(()=>({[`__scope${r}`]:{...f,[r]:y}}),[f,y])}};return c.scopeName=r,[o,Rw(c,...a)]}function Rw(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const o=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(u){const m=o.reduce((f,{useScope:y,scopeName:g})=>{const v=y(u)[`__scope${g}`];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:()=>{},Iw=bo[" useId ".trim().toString()]||(()=>{}),_w=0;function dn(r){const[a,l]=h.useState(Iw());return Zt(()=>{l(o=>o??String(_w++))},[r]),a?`radix-${a}`:""}var Mw=bo[" useInsertionEffect ".trim().toString()]||Zt;function Vn({prop:r,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,u,m]=Aw({defaultProp:a,onChange:l}),f=r!==void 0,y=f?r:c;{const p=h.useRef(r!==void 0);h.useEffect(()=>{const v=p.current;v!==f&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=f},[f,o])}const g=h.useCallback(p=>{var v;if(f){const k=Dw(p)?p(r):p;k!==r&&((v=m.current)==null||v.call(m,k))}else u(p)},[f,r,u,m]);return[y,g]}function Aw({defaultProp:r,onChange:a}){const[l,o]=h.useState(r),c=h.useRef(l),u=h.useRef(a);return Mw(()=>{u.current=a},[a]),h.useEffect(()=>{var m;c.current!==l&&((m=u.current)==null||m.call(u,l),c.current=l)},[l,c]),[l,o,u]}function Dw(r){return typeof r=="function"}function Dl(r){const a=Lw(r),l=h.forwardRef((o,c)=>{const{children:u,...m}=o,f=h.Children.toArray(u),y=f.find(Fw);if(y){const g=y.props.children,p=f.map(v=>v===y?h.Children.count(g)>1?h.Children.only(null):h.isValidElement(g)?g.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(g)?h.cloneElement(g,void 0,p):null})}return e.jsx(a,{...m,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}function Lw(r){const a=h.forwardRef((l,o)=>{const{children:c,...u}=l;if(h.isValidElement(c)){const m=$w(c),f=zw(u,c.props);return c.type!==h.Fragment&&(f.ref=o?Nu(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var Ow=Symbol("radix.slottable");function Fw(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Ow}function zw(r,a){const l={...a};for(const o in a){const c=r[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...f)=>{const y=u(...f);return c(...f),y}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function $w(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Bw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=Bw.reduce((r,a)=>{const l=Dl(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:m,...f}=c,y=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(y,{...f,ref:u})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{});function Uw(r,a){r&&Ol.flushSync(()=>r.dispatchEvent(a))}function hn(r){const a=h.useRef(r);return h.useEffect(()=>{a.current=r}),h.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function Vw(r,a=globalThis==null?void 0:globalThis.document){const l=hn(r);h.useEffect(()=>{const o=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",o,{capture:!0}),()=>a.removeEventListener("keydown",o,{capture:!0})},[l,a])}var Ww="DismissableLayer",Zd="dismissableLayer.update",Hw="dismissableLayer.pointerDownOutside",Kw="dismissableLayer.focusOutside",Xf,gp=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Su=h.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:m,onDismiss:f,...y}=r,g=h.useContext(gp),[p,v]=h.useState(null),k=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=h.useState({}),T=at(a,A=>v(A)),b=Array.from(g.layers),[N]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),C=b.indexOf(N),E=p?b.indexOf(p):-1,j=g.layersWithOutsidePointerEventsDisabled.size>0,R=E>=C,Q=Qw(A=>{const I=A.target,w=[...g.branches].some(U=>U.contains(I));!R||w||(c==null||c(A),m==null||m(A),A.defaultPrevented||f==null||f())},k),Z=qw(A=>{const I=A.target;[...g.branches].some(U=>U.contains(I))||(u==null||u(A),m==null||m(A),A.defaultPrevented||f==null||f())},k);return Vw(A=>{E===g.layers.size-1&&(o==null||o(A),!A.defaultPrevented&&f&&(A.preventDefault(),f()))},k),h.useEffect(()=>{if(p)return l&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Xf=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(p)),g.layers.add(p),Jf(),()=>{l&&g.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=Xf)}},[p,k,l,g]),h.useEffect(()=>()=>{p&&(g.layers.delete(p),g.layersWithOutsidePointerEventsDisabled.delete(p),Jf())},[p,g]),h.useEffect(()=>{const A=()=>P({});return document.addEventListener(Zd,A),()=>document.removeEventListener(Zd,A)},[]),e.jsx(Xe.div,{...y,ref:T,style:{pointerEvents:j?R?"auto":"none":void 0,...r.style},onFocusCapture:Ge(r.onFocusCapture,Z.onFocusCapture),onBlurCapture:Ge(r.onBlurCapture,Z.onBlurCapture),onPointerDownCapture:Ge(r.onPointerDownCapture,Q.onPointerDownCapture)})});Su.displayName=Ww;var Gw="DismissableLayerBranch",Yw=h.forwardRef((r,a)=>{const l=h.useContext(gp),o=h.useRef(null),c=at(a,o);return h.useEffect(()=>{const u=o.current;if(u)return l.branches.add(u),()=>{l.branches.delete(u)}},[l.branches]),e.jsx(Xe.div,{...r,ref:c})});Yw.displayName=Gw;function Qw(r,a=globalThis==null?void 0:globalThis.document){const l=hn(r),o=h.useRef(!1),c=h.useRef(()=>{});return h.useEffect(()=>{const u=f=>{if(f.target&&!o.current){let y=function(){yp(Hw,l,g,{discrete:!0})};const g={originalEvent:f};f.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=y,a.addEventListener("click",c.current,{once:!0})):y()}else a.removeEventListener("click",c.current);o.current=!1},m=window.setTimeout(()=>{a.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(m),a.removeEventListener("pointerdown",u),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>o.current=!0}}function qw(r,a=globalThis==null?void 0:globalThis.document){const l=hn(r),o=h.useRef(!1);return h.useEffect(()=>{const c=u=>{u.target&&!o.current&&yp(Kw,l,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Jf(){const r=new CustomEvent(Zd);document.dispatchEvent(r)}function yp(r,a,l,{discrete:o}){const c=l.originalEvent.target,u=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),o?Uw(c,u):c.dispatchEvent(u)}var Rd="focusScope.autoFocusOnMount",Id="focusScope.autoFocusOnUnmount",Zf={bubbles:!1,cancelable:!0},Xw="FocusScope",Cu=h.forwardRef((r,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:u,...m}=r,[f,y]=h.useState(null),g=hn(c),p=hn(u),v=h.useRef(null),k=at(a,b=>y(b)),P=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let b=function(j){if(P.paused||!f)return;const R=j.target;f.contains(R)?v.current=R:rn(v.current,{select:!0})},N=function(j){if(P.paused||!f)return;const R=j.relatedTarget;R!==null&&(f.contains(R)||rn(v.current,{select:!0}))},C=function(j){if(document.activeElement===document.body)for(const Q of j)Q.removedNodes.length>0&&rn(f)};document.addEventListener("focusin",b),document.addEventListener("focusout",N);const E=new MutationObserver(C);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",N),E.disconnect()}}},[o,f,P.paused]),h.useEffect(()=>{if(f){tx.add(P);const b=document.activeElement;if(!f.contains(b)){const C=new CustomEvent(Rd,Zf);f.addEventListener(Rd,g),f.dispatchEvent(C),C.defaultPrevented||(Jw(r1(vp(f)),{select:!0}),document.activeElement===b&&rn(f))}return()=>{f.removeEventListener(Rd,g),setTimeout(()=>{const C=new CustomEvent(Id,Zf);f.addEventListener(Id,p),f.dispatchEvent(C),C.defaultPrevented||rn(b??document.body,{select:!0}),f.removeEventListener(Id,p),tx.remove(P)},0)}}},[f,g,p,P]);const T=h.useCallback(b=>{if(!l&&!o||P.paused)return;const N=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,C=document.activeElement;if(N&&C){const E=b.currentTarget,[j,R]=Zw(E);j&&R?!b.shiftKey&&C===R?(b.preventDefault(),l&&rn(j,{select:!0})):b.shiftKey&&C===j&&(b.preventDefault(),l&&rn(R,{select:!0})):C===E&&b.preventDefault()}},[l,o,P.paused]);return e.jsx(Xe.div,{tabIndex:-1,...m,ref:k,onKeyDown:T})});Cu.displayName=Xw;function Jw(r,{select:a=!1}={}){const l=document.activeElement;for(const o of r)if(rn(o,{select:a}),document.activeElement!==l)return}function Zw(r){const a=vp(r),l=ex(a,r),o=ex(a.reverse(),r);return[l,o]}function vp(r){const a=[],l=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function ex(r,a){for(const l of r)if(!e1(l,{upTo:a}))return l}function e1(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 t1(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&&t1(r)&&a&&r.select()}}var tx=s1();function s1(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=sx(r,a),r.unshift(a)},remove(a){var l;r=sx(r,a),(l=r[0])==null||l.resume()}}}function sx(r,a){const l=[...r],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function r1(r){return r.filter(a=>a.tagName!=="A")}var n1="Portal",ku=h.forwardRef((r,a)=>{var f;const{container:l,...o}=r,[c,u]=h.useState(!1);Zt(()=>u(!0),[]);const m=l||c&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return m?Rv.createPortal(e.jsx(Xe.div,{...o,ref:a}),m):null});ku.displayName=n1;function a1(r,a){return h.useReducer((l,o)=>a[l][o]??l,r)}var Fl=r=>{const{present:a,children:l}=r,o=l1(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),u=at(o.ref,i1(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:u}):null};Fl.displayName="Presence";function l1(r){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(r),u=h.useRef("none"),m=r?"mounted":"unmounted",[f,y]=a1(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const g=Xi(o.current);u.current=f==="mounted"?g:"none"},[f]),Zt(()=>{const g=o.current,p=c.current;if(p!==r){const k=u.current,P=Xi(g);r?y("MOUNT"):P==="none"||(g==null?void 0:g.display)==="none"?y("UNMOUNT"):y(p&&k!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,y]),Zt(()=>{if(a){let g;const p=a.ownerDocument.defaultView??window,v=P=>{const b=Xi(o.current).includes(CSS.escape(P.animationName));if(P.target===a&&b&&(y("ANIMATION_END"),!c.current)){const N=a.style.animationFillMode;a.style.animationFillMode="forwards",g=p.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=N)})}},k=P=>{P.target===a&&(u.current=Xi(o.current))};return a.addEventListener("animationstart",k),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{p.clearTimeout(g),a.removeEventListener("animationstart",k),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else y("ANIMATION_END")},[a,y]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:h.useCallback(g=>{o.current=g?getComputedStyle(g):null,l(g)},[])}}function Xi(r){return(r==null?void 0:r.animationName)||"none"}function i1(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var _d=0;function jp(){h.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??rx()),document.body.insertAdjacentElement("beforeend",r[1]??rx()),_d++,()=>{_d===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),_d--}},[])}function rx(){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,o=1,c=arguments.length;o"u")return S1;var a=C1(r),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},E1=Sp(),_a="data-scroll-locked",P1=function(r,a,l,o){var c=r.left,u=r.top,m=r.right,f=r.gap;return l===void 0&&(l="margin"),` .`.concat(c1,` { overflow: hidden `).concat(o,`; padding-right: `).concat(f,"px ").concat(o,`; } - body[`).concat(Ia,`] { + body[`).concat(_a,`] { overflow: hidden `).concat(o,`; overscroll-behavior: contain; `).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&` padding-left: `.concat(c,`px; - padding-top: `).concat(d,`px; + padding-top: `).concat(u,`px; padding-right: `).concat(m,`px; margin-left:0; margin-top:0; @@ -468,28 +468,28 @@ Error generating stack: `+x.message+` margin-right: 0 `).concat(o,`; } - body[`).concat(Ia,`] { + body[`).concat(_a,`] { `).concat(d1,": ").concat(f,`px; } -`)},ax=function(){var r=parseInt(document.body.getAttribute(Ia)||"0",10);return isFinite(r)?r:0},T1=function(){h.useEffect(function(){return document.body.setAttribute(Ia,(ax()+1).toString()),function(){var r=ax()-1;r<=0?document.body.removeAttribute(Ia):document.body.setAttribute(Ia,r.toString())}},[])},R1=function(r){var a=r.noRelative,l=r.noImportant,o=r.gapMode,c=o===void 0?"margin":o;T1();var d=h.useMemo(function(){return k1(c)},[c]);return h.createElement(E1,{styles:P1(d,!a,c,l?"":"!important")})},eu=!1;if(typeof window<"u")try{var Ji=Object.defineProperty({},"passive",{get:function(){return eu=!0,!0}});window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{eu=!1}var Sa=eu?{passive:!1}:!1,I1=function(r){return r.tagName==="TEXTAREA"},Cp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!I1(r)&&l[a]==="visible")},_1=function(r){return Cp(r,"overflowY")},M1=function(r){return Cp(r,"overflowX")},lx=function(r,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=kp(r,o);if(c){var d=Ep(r,o),m=d[1],f=d[2];if(m>f)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},A1=function(r){var a=r.scrollTop,l=r.scrollHeight,o=r.clientHeight;return[a,l,o]},D1=function(r){var a=r.scrollLeft,l=r.scrollWidth,o=r.clientWidth;return[a,l,o]},kp=function(r,a){return r==="v"?_1(a):M1(a)},Ep=function(r,a){return r==="v"?A1(a):D1(a)},L1=function(r,a){return r==="h"&&a==="rtl"?-1:1},O1=function(r,a,l,o,c){var d=L1(r,window.getComputedStyle(a).direction),m=d*o,f=l.target,y=a.contains(f),g=!1,p=m>0,v=0,C=0;do{if(!f)break;var P=Ep(r,f),T=P[0],b=P[1],N=P[2],w=b-N-d*T;(T||w)&&kp(r,f)&&(v+=w,C+=T);var k=f.parentNode;f=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!y&&f!==document.body||y&&(a.contains(f)||a===f));return(p&&Math.abs(v)<1||!p&&Math.abs(C)<1)&&(g=!0),g},Zi=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},ix=function(r){return[r.deltaX,r.deltaY]},ox=function(r){return r&&"current"in r?r.current:r},F1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},z1=function(r){return` +`)},ax=function(){var r=parseInt(document.body.getAttribute(_a)||"0",10);return isFinite(r)?r:0},T1=function(){h.useEffect(function(){return document.body.setAttribute(_a,(ax()+1).toString()),function(){var r=ax()-1;r<=0?document.body.removeAttribute(_a):document.body.setAttribute(_a,r.toString())}},[])},R1=function(r){var a=r.noRelative,l=r.noImportant,o=r.gapMode,c=o===void 0?"margin":o;T1();var u=h.useMemo(function(){return k1(c)},[c]);return h.createElement(E1,{styles:P1(u,!a,c,l?"":"!important")})},eu=!1;if(typeof window<"u")try{var Ji=Object.defineProperty({},"passive",{get:function(){return eu=!0,!0}});window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{eu=!1}var Sa=eu?{passive:!1}:!1,I1=function(r){return r.tagName==="TEXTAREA"},Cp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!I1(r)&&l[a]==="visible")},_1=function(r){return Cp(r,"overflowY")},M1=function(r){return Cp(r,"overflowX")},lx=function(r,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=kp(r,o);if(c){var u=Ep(r,o),m=u[1],f=u[2];if(m>f)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},A1=function(r){var a=r.scrollTop,l=r.scrollHeight,o=r.clientHeight;return[a,l,o]},D1=function(r){var a=r.scrollLeft,l=r.scrollWidth,o=r.clientWidth;return[a,l,o]},kp=function(r,a){return r==="v"?_1(a):M1(a)},Ep=function(r,a){return r==="v"?A1(a):D1(a)},L1=function(r,a){return r==="h"&&a==="rtl"?-1:1},O1=function(r,a,l,o,c){var u=L1(r,window.getComputedStyle(a).direction),m=u*o,f=l.target,y=a.contains(f),g=!1,p=m>0,v=0,k=0;do{if(!f)break;var P=Ep(r,f),T=P[0],b=P[1],N=P[2],C=b-N-u*T;(T||C)&&kp(r,f)&&(v+=C,k+=T);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!y&&f!==document.body||y&&(a.contains(f)||a===f));return(p&&Math.abs(v)<1||!p&&Math.abs(k)<1)&&(g=!0),g},Zi=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},ix=function(r){return[r.deltaX,r.deltaY]},ox=function(r){return r&&"current"in r?r.current:r},F1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},z1=function(r){return` .block-interactivity-`.concat(r,` {pointer-events: none;} .allow-interactivity-`).concat(r,` {pointer-events: all;} -`)},$1=0,Ca=[];function B1(r){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState($1++)[0],d=h.useState(Sp)[0],m=h.useRef(r);h.useEffect(function(){m.current=r},[r]),h.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var b=o1([r.lockRef.current],(r.shards||[]).map(ox),!0).filter(Boolean);return b.forEach(function(N){return N.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),b.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var f=h.useCallback(function(b,N){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!m.current.allowPinchZoom;var w=Zi(b),k=l.current,j="deltaX"in b?b.deltaX:k[0]-w[0],_="deltaY"in b?b.deltaY:k[1]-w[1],U,V=b.target,I=Math.abs(j)>Math.abs(_)?"h":"v";if("touches"in b&&I==="h"&&V.type==="range")return!1;var R=window.getSelection(),E=R&&R.anchorNode,Y=E?E===V||E.contains(V):!1;if(Y)return!1;var ne=lx(I,V);if(!ne)return!0;if(ne?U=I:(U=I==="v"?"h":"v",ne=lx(I,V)),!ne)return!1;if(!o.current&&"changedTouches"in b&&(j||_)&&(o.current=U),!U)return!0;var ae=o.current||U;return O1(ae,N,b,ae==="h"?j:_)},[]),y=h.useCallback(function(b){var N=b;if(!(!Ca.length||Ca[Ca.length-1]!==d)){var w="deltaY"in N?ix(N):Zi(N),k=a.current.filter(function(U){return U.name===N.type&&(U.target===N.target||N.target===U.shadowParent)&&F1(U.delta,w)})[0];if(k&&k.should){N.cancelable&&N.preventDefault();return}if(!k){var j=(m.current.shards||[]).map(ox).filter(Boolean).filter(function(U){return U.contains(N.target)}),_=j.length>0?f(N,j[0]):!m.current.noIsolation;_&&N.cancelable&&N.preventDefault()}}},[]),g=h.useCallback(function(b,N,w,k){var j={name:b,delta:N,target:w,should:k,shadowParent:U1(w)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(_){return _!==j})},1)},[]),p=h.useCallback(function(b){l.current=Zi(b),o.current=void 0},[]),v=h.useCallback(function(b){g(b.type,ix(b),b.target,f(b,r.lockRef.current))},[]),C=h.useCallback(function(b){g(b.type,Zi(b),b.target,f(b,r.lockRef.current))},[]);h.useEffect(function(){return Ca.push(d),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:C}),document.addEventListener("wheel",y,Sa),document.addEventListener("touchmove",y,Sa),document.addEventListener("touchstart",p,Sa),function(){Ca=Ca.filter(function(b){return b!==d}),document.removeEventListener("wheel",y,Sa),document.removeEventListener("touchmove",y,Sa),document.removeEventListener("touchstart",p,Sa)}},[]);var P=r.removeScrollBar,T=r.inert;return h.createElement(h.Fragment,null,T?h.createElement(d,{styles:z1(c)}):null,P?h.createElement(R1,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function U1(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const V1=g1(wp,B1);var Eu=h.forwardRef(function(r,a){return h.createElement(Co,ir({},r,{ref:a,sideCar:V1}))});Eu.classNames=Co.classNames;var W1=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,Pp=function(r){return r&&(r.host||Pp(r.parentNode))},H1=function(r,a){return a.map(function(l){if(r.contains(l))return l;var o=Pp(l);return o&&r.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},K1=function(r,a,l,o){var c=H1(a,Array.isArray(r)?r:[r]);to[l]||(to[l]=new WeakMap);var d=to[l],m=[],f=new Set,y=new Set(c),g=function(v){!v||f.has(v)||(f.add(v),g(v.parentNode))};c.forEach(g);var p=function(v){!v||y.has(v)||Array.prototype.forEach.call(v.children,function(C){if(f.has(C))p(C);else try{var P=C.getAttribute(o),T=P!==null&&P!=="false",b=(ka.get(C)||0)+1,N=(d.get(C)||0)+1;ka.set(C,b),d.set(C,N),m.push(C),b===1&&T&&eo.set(C,!0),N===1&&C.setAttribute(l,"true"),T||C.setAttribute(o,"true")}catch(w){console.error("aria-hidden: cannot operate on ",C,w)}})};return p(a),f.clear(),Ld++,function(){m.forEach(function(v){var C=ka.get(v)-1,P=d.get(v)-1;ka.set(v,C),d.set(v,P),C||(eo.has(v)||v.removeAttribute(o),eo.delete(v)),P||v.removeAttribute(l)}),Ld--,Ld||(ka=new WeakMap,ka=new WeakMap,eo=new WeakMap,to={})}},Tp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(r)?r:[r]),c=W1(r);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),K1(o,c,l,"aria-hidden")):function(){return null}},ko="Dialog",[Rp]=vn(ko),[G1,Zs]=Rp(ko),Ip=r=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:d,modal:m=!0}=r,f=h.useRef(null),y=h.useRef(null),[g,p]=Vn({prop:o,defaultProp:c??!1,onChange:d,caller:ko});return e.jsx(G1,{scope:a,triggerRef:f,contentRef:y,contentId:un(),titleId:un(),descriptionId:un(),open:g,onOpenChange:p,onOpenToggle:h.useCallback(()=>p(v=>!v),[p]),modal:m,children:l})};Ip.displayName=ko;var _p="DialogTrigger",Y1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Zs(_p,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":Ru(c.open),...o,ref:d,onClick:Ge(r.onClick,c.onOpenToggle)})});Y1.displayName=_p;var Pu="DialogPortal",[Q1,Mp]=Rp(Pu,{forceMount:void 0}),Ap=r=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=r,d=Zs(Pu,a);return e.jsx(Q1,{scope:a,forceMount:l,children:h.Children.map(o,m=>e.jsx(Fl,{present:l||d.open,children:e.jsx(ku,{asChild:!0,container:c,children:m})}))})};Ap.displayName=Pu;var fo="DialogOverlay",Dp=h.forwardRef((r,a)=>{const l=Mp(fo,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,d=Zs(fo,r.__scopeDialog);return d.modal?e.jsx(Fl,{present:o||d.open,children:e.jsx(X1,{...c,ref:a})}):null});Dp.displayName=fo;var q1=Dl("DialogOverlay.RemoveScroll"),X1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Zs(fo,l);return e.jsx(Eu,{as:q1,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(Xe.div,{"data-state":Ru(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),Wn="DialogContent",Lp=h.forwardRef((r,a)=>{const l=Mp(Wn,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,d=Zs(Wn,r.__scopeDialog);return e.jsx(Fl,{present:o||d.open,children:d.modal?e.jsx(J1,{...c,ref:a}):e.jsx(Z1,{...c,ref:a})})});Lp.displayName=Wn;var J1=h.forwardRef((r,a)=>{const l=Zs(Wn,r.__scopeDialog),o=h.useRef(null),c=at(a,l.contentRef,o);return h.useEffect(()=>{const d=o.current;if(d)return Tp(d)},[]),e.jsx(Op,{...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())})}),Z1=h.forwardRef((r,a)=>{const l=Zs(Wn,r.__scopeDialog),o=h.useRef(!1),c=h.useRef(!1);return e.jsx(Op,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var m,f;(m=r.onCloseAutoFocus)==null||m.call(r,d),d.defaultPrevented||(o.current||(f=l.triggerRef.current)==null||f.focus(),d.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:d=>{var y,g;(y=r.onInteractOutside)==null||y.call(r,d),d.defaultPrevented||(o.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const m=d.target;((g=l.triggerRef.current)==null?void 0:g.contains(m))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),Op=h.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:d,...m}=r,f=Zs(Wn,l),y=h.useRef(null),g=at(a,y);return jp(),e.jsxs(e.Fragment,{children:[e.jsx(Cu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:d,children:e.jsx(Su,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Ru(f.open),...m,ref:g,onDismiss:()=>f.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(e2,{titleId:f.titleId}),e.jsx(s2,{contentRef:y,descriptionId:f.descriptionId})]})]})}),Tu="DialogTitle",Fp=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Zs(Tu,l);return e.jsx(Xe.h2,{id:c.titleId,...o,ref:a})});Fp.displayName=Tu;var zp="DialogDescription",$p=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Zs(zp,l);return e.jsx(Xe.p,{id:c.descriptionId,...o,ref:a})});$p.displayName=zp;var Bp="DialogClose",Up=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Zs(Bp,l);return e.jsx(Xe.button,{type:"button",...o,ref:a,onClick:Ge(r.onClick,()=>c.onOpenChange(!1))})});Up.displayName=Bp;function Ru(r){return r?"open":"closed"}var Vp="DialogTitleWarning",[XC,Wp]=Tw(Vp,{contentName:Wn,titleName:Tu,docsSlug:"dialog"}),e2=({titleId:r})=>{const a=Wp(Vp),l=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users. +`)},$1=0,Ca=[];function B1(r){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState($1++)[0],u=h.useState(Sp)[0],m=h.useRef(r);h.useEffect(function(){m.current=r},[r]),h.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var b=o1([r.lockRef.current],(r.shards||[]).map(ox),!0).filter(Boolean);return b.forEach(function(N){return N.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),b.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var f=h.useCallback(function(b,N){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!m.current.allowPinchZoom;var C=Zi(b),E=l.current,j="deltaX"in b?b.deltaX:E[0]-C[0],R="deltaY"in b?b.deltaY:E[1]-C[1],Q,Z=b.target,A=Math.abs(j)>Math.abs(R)?"h":"v";if("touches"in b&&A==="h"&&Z.type==="range")return!1;var I=window.getSelection(),w=I&&I.anchorNode,U=w?w===Z||w.contains(Z):!1;if(U)return!1;var se=lx(A,Z);if(!se)return!0;if(se?Q=A:(Q=A==="v"?"h":"v",se=lx(A,Z)),!se)return!1;if(!o.current&&"changedTouches"in b&&(j||R)&&(o.current=Q),!Q)return!0;var le=o.current||Q;return O1(le,N,b,le==="h"?j:R)},[]),y=h.useCallback(function(b){var N=b;if(!(!Ca.length||Ca[Ca.length-1]!==u)){var C="deltaY"in N?ix(N):Zi(N),E=a.current.filter(function(Q){return Q.name===N.type&&(Q.target===N.target||N.target===Q.shadowParent)&&F1(Q.delta,C)})[0];if(E&&E.should){N.cancelable&&N.preventDefault();return}if(!E){var j=(m.current.shards||[]).map(ox).filter(Boolean).filter(function(Q){return Q.contains(N.target)}),R=j.length>0?f(N,j[0]):!m.current.noIsolation;R&&N.cancelable&&N.preventDefault()}}},[]),g=h.useCallback(function(b,N,C,E){var j={name:b,delta:N,target:C,should:E,shadowParent:U1(C)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(R){return R!==j})},1)},[]),p=h.useCallback(function(b){l.current=Zi(b),o.current=void 0},[]),v=h.useCallback(function(b){g(b.type,ix(b),b.target,f(b,r.lockRef.current))},[]),k=h.useCallback(function(b){g(b.type,Zi(b),b.target,f(b,r.lockRef.current))},[]);h.useEffect(function(){return Ca.push(u),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:k}),document.addEventListener("wheel",y,Sa),document.addEventListener("touchmove",y,Sa),document.addEventListener("touchstart",p,Sa),function(){Ca=Ca.filter(function(b){return b!==u}),document.removeEventListener("wheel",y,Sa),document.removeEventListener("touchmove",y,Sa),document.removeEventListener("touchstart",p,Sa)}},[]);var P=r.removeScrollBar,T=r.inert;return h.createElement(h.Fragment,null,T?h.createElement(u,{styles:z1(c)}):null,P?h.createElement(R1,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function U1(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const V1=g1(wp,B1);var Eu=h.forwardRef(function(r,a){return h.createElement(Co,ir({},r,{ref:a,sideCar:V1}))});Eu.classNames=Co.classNames;var W1=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,Pp=function(r){return r&&(r.host||Pp(r.parentNode))},H1=function(r,a){return a.map(function(l){if(r.contains(l))return l;var o=Pp(l);return o&&r.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},K1=function(r,a,l,o){var c=H1(a,Array.isArray(r)?r:[r]);to[l]||(to[l]=new WeakMap);var u=to[l],m=[],f=new Set,y=new Set(c),g=function(v){!v||f.has(v)||(f.add(v),g(v.parentNode))};c.forEach(g);var p=function(v){!v||y.has(v)||Array.prototype.forEach.call(v.children,function(k){if(f.has(k))p(k);else try{var P=k.getAttribute(o),T=P!==null&&P!=="false",b=(ka.get(k)||0)+1,N=(u.get(k)||0)+1;ka.set(k,b),u.set(k,N),m.push(k),b===1&&T&&eo.set(k,!0),N===1&&k.setAttribute(l,"true"),T||k.setAttribute(o,"true")}catch(C){console.error("aria-hidden: cannot operate on ",k,C)}})};return p(a),f.clear(),Ld++,function(){m.forEach(function(v){var k=ka.get(v)-1,P=u.get(v)-1;ka.set(v,k),u.set(v,P),k||(eo.has(v)||v.removeAttribute(o),eo.delete(v)),P||v.removeAttribute(l)}),Ld--,Ld||(ka=new WeakMap,ka=new WeakMap,eo=new WeakMap,to={})}},Tp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(r)?r:[r]),c=W1(r);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),K1(o,c,l,"aria-hidden")):function(){return null}},ko="Dialog",[Rp]=yn(ko),[G1,Zs]=Rp(ko),Ip=r=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:u,modal:m=!0}=r,f=h.useRef(null),y=h.useRef(null),[g,p]=Vn({prop:o,defaultProp:c??!1,onChange:u,caller:ko});return e.jsx(G1,{scope:a,triggerRef:f,contentRef:y,contentId:dn(),titleId:dn(),descriptionId:dn(),open:g,onOpenChange:p,onOpenToggle:h.useCallback(()=>p(v=>!v),[p]),modal:m,children:l})};Ip.displayName=ko;var _p="DialogTrigger",Y1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Zs(_p,l),u=at(a,c.triggerRef);return e.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Ru(c.open),...o,ref:u,onClick:Ge(r.onClick,c.onOpenToggle)})});Y1.displayName=_p;var Pu="DialogPortal",[Q1,Mp]=Rp(Pu,{forceMount:void 0}),Ap=r=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=r,u=Zs(Pu,a);return e.jsx(Q1,{scope:a,forceMount:l,children:h.Children.map(o,m=>e.jsx(Fl,{present:l||u.open,children:e.jsx(ku,{asChild:!0,container:c,children:m})}))})};Ap.displayName=Pu;var fo="DialogOverlay",Dp=h.forwardRef((r,a)=>{const l=Mp(fo,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,u=Zs(fo,r.__scopeDialog);return u.modal?e.jsx(Fl,{present:o||u.open,children:e.jsx(X1,{...c,ref:a})}):null});Dp.displayName=fo;var q1=Dl("DialogOverlay.RemoveScroll"),X1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Zs(fo,l);return e.jsx(Eu,{as:q1,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(Xe.div,{"data-state":Ru(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),Wn="DialogContent",Lp=h.forwardRef((r,a)=>{const l=Mp(Wn,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,u=Zs(Wn,r.__scopeDialog);return e.jsx(Fl,{present:o||u.open,children:u.modal?e.jsx(J1,{...c,ref:a}):e.jsx(Z1,{...c,ref:a})})});Lp.displayName=Wn;var J1=h.forwardRef((r,a)=>{const l=Zs(Wn,r.__scopeDialog),o=h.useRef(null),c=at(a,l.contentRef,o);return h.useEffect(()=>{const u=o.current;if(u)return Tp(u)},[]),e.jsx(Op,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ge(r.onCloseAutoFocus,u=>{var m;u.preventDefault(),(m=l.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Ge(r.onPointerDownOutside,u=>{const m=u.detail.originalEvent,f=m.button===0&&m.ctrlKey===!0;(m.button===2||f)&&u.preventDefault()}),onFocusOutside:Ge(r.onFocusOutside,u=>u.preventDefault())})}),Z1=h.forwardRef((r,a)=>{const l=Zs(Wn,r.__scopeDialog),o=h.useRef(!1),c=h.useRef(!1);return e.jsx(Op,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var m,f;(m=r.onCloseAutoFocus)==null||m.call(r,u),u.defaultPrevented||(o.current||(f=l.triggerRef.current)==null||f.focus(),u.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:u=>{var y,g;(y=r.onInteractOutside)==null||y.call(r,u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const m=u.target;((g=l.triggerRef.current)==null?void 0:g.contains(m))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&c.current&&u.preventDefault()}})}),Op=h.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u,...m}=r,f=Zs(Wn,l),y=h.useRef(null),g=at(a,y);return jp(),e.jsxs(e.Fragment,{children:[e.jsx(Cu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:u,children:e.jsx(Su,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Ru(f.open),...m,ref:g,onDismiss:()=>f.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(e2,{titleId:f.titleId}),e.jsx(s2,{contentRef:y,descriptionId:f.descriptionId})]})]})}),Tu="DialogTitle",Fp=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Zs(Tu,l);return e.jsx(Xe.h2,{id:c.titleId,...o,ref:a})});Fp.displayName=Tu;var zp="DialogDescription",$p=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Zs(zp,l);return e.jsx(Xe.p,{id:c.descriptionId,...o,ref:a})});$p.displayName=zp;var Bp="DialogClose",Up=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Zs(Bp,l);return e.jsx(Xe.button,{type:"button",...o,ref:a,onClick:Ge(r.onClick,()=>c.onOpenChange(!1))})});Up.displayName=Bp;function Ru(r){return r?"open":"closed"}var Vp="DialogTitleWarning",[XC,Wp]=Tw(Vp,{contentName:Wn,titleName:Tu,docsSlug:"dialog"}),e2=({titleId:r})=>{const a=Wp(Vp),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},t2="DialogDescriptionWarning",s2=({contentRef:r,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wp(t2).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(o))},[o,r,a]),null},r2=Ip,n2=Ap,a2=Dp,l2=Lp,i2=Fp,o2=$p,c2=Up;function Ct(r){return e.jsx(r2,{"data-slot":"dialog",...r})}function d2(r){return e.jsx(n2,{...r})}const Hp=h.forwardRef(({className:r,...a},l)=>e.jsx(a2,{ref:l,className:lt("fixed inset-0 z-50 bg-black/50",r),...a}));Hp.displayName="DialogOverlay";const Nt=h.forwardRef(({className:r,children:a,showCloseButton:l=!0,...o},c)=>e.jsxs(d2,{children:[e.jsx(Hp,{}),e.jsxs(l2,{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),...o,children:[a,l&&e.jsxs(c2,{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(i2,{className:"text-lg font-semibold leading-none",...r})}function u2(r){return e.jsx(o2,{className:"text-sm text-muted-foreground",...r})}function Iu(r,a){const[l,o]=h.useState(r);return h.useEffect(()=>{const c=setTimeout(()=>o(r),a);return()=>clearTimeout(c)},[r,a]),l}function Qs({page:r,totalPages:a,total:l,pageSize:o,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:o,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 h2(){const[r,a]=h.useState([]),[l,o]=h.useState([]),[c,d]=h.useState(0),[m,f]=h.useState(0),[y,g]=h.useState(0),[p,v]=h.useState(1),[C,P]=h.useState(10),[T,b]=h.useState(""),N=Iu(T,300),[w,k]=h.useState("all"),[j,_]=h.useState(!0),[U,V]=h.useState(null),[I,R]=h.useState(null),[E,Y]=h.useState(""),[ne,ae]=h.useState(!1);async function q(){_(!0),V(null);try{const K=w==="all"?"":w==="completed"?"completed":w,A=new URLSearchParams({page:String(p),pageSize:String(C),...K&&{status:K},...N&&{search:N}}),[O,L]=await Promise.all([$e(`/api/orders?${A}`),$e("/api/db/users?page=1&pageSize=500")]);O!=null&&O.success&&(a(O.orders||[]),d(O.total??0),f(O.totalRevenue??0),g(O.todayRevenue??0)),L!=null&&L.success&&L.users&&o(L.users)}catch(K){console.error("加载订单失败",K),V("加载订单失败,请检查网络后重试")}finally{_(!1)}}h.useEffect(()=>{v(1)},[N,w]),h.useEffect(()=>{q()},[p,C,N,w]);const se=K=>{var A;return K.userNickname||((A=l.find(O=>O.id===K.userId))==null?void 0:A.nickname)||"匿名用户"},H=K=>{var A;return((A=l.find(O=>O.id===K))==null?void 0:A.phone)||"-"},ie=K=>{const A=K.productType||K.type||"",O=K.description||"";if(O){if(A==="section"&&O.includes("章节")){if(O.includes("-")){const L=O.split("-");if(L.length>=3)return{name:`第${L[1]}章 第${L[2]}节`,type:"《一场Soul的创业实验》"}}return{name:O,type:"章节购买"}}return A==="fullbook"||O.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:A==="vip"||O.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:A==="match"||O.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:O,type:"其他"}}return A==="section"?{name:`章节 ${K.productId||K.sectionId||""}`,type:"单章"}:A==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:A==="vip"?{name:"VIP年度会员",type:"VIP"}:A==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:A||"其他"}},ve=Math.ceil(c/C)||1;async function B(){var K;if(!(!(I!=null&&I.orderSn)&&!(I!=null&&I.id))){ae(!0),V(null);try{const A=await vt("/api/admin/orders/refund",{orderSn:I.orderSn||I.id,reason:E||void 0});A!=null&&A.success?(R(null),Y(""),q()):V((A==null?void 0:A.error)||"退款失败")}catch(A){const O=A;V(((K=O==null?void 0:O.data)==null?void 0:K.error)||"退款失败,请检查网络后重试")}finally{ae(!1)}}}function ce(){if(r.length===0){alert("暂无数据可导出");return}const K=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],A=r.map(de=>{const Q=ie(de);return[de.orderSn||de.id||"",se(de),H(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(",")}),O="\uFEFF"+[K.join(","),...A].join(` -`),L=new Blob([O],{type:"text/csv;charset=utf-8"}),J=URL.createObjectURL(L),G=document.createElement("a");G.href=J,G.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,G.click(),URL.revokeObjectURL(J)}return e.jsxs("div",{className:"p-8 w-full",children:[U&&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:U}),e.jsx("button",{type:"button",onClick:()=>V(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(Z,{variant:"outline",onClick:q,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:["¥",y.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(le,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:T,onChange:K=>b(K.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qx,{className:"w-4 h-4 text-gray-400"}),e.jsxs("select",{value:w,onChange:K=>k(K.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"created",children:"已创建"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsxs(Z,{variant:"outline",onClick:ce,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(hb,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:j?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(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(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(ps,{children:[r.map(K=>{const A=ie(K);return e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(pe,{className:"font-mono text-xs text-gray-400",children:[(K.orderSn||K.id||"").slice(0,12),"..."]}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:se(K)}),e.jsx("p",{className:"text-gray-500 text-xs",children:H(K.userId)})]})}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[A.name,(K.productType||K.type)==="vip"&&e.jsx(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(pe,{className:"text-[#38bdac] font-bold",children:["¥",Number(K.amount||0).toFixed(2)]}),e.jsx(pe,{className:"text-gray-300",children:K.paymentMethod==="wechat"?"微信支付":K.paymentMethod==="alipay"?"支付宝":K.paymentMethod||"微信支付"}),e.jsx(pe,{children:K.status==="refunded"?e.jsx(Le,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):K.status==="paid"||K.status==="completed"?e.jsx(Le,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):K.status==="pending"||K.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(pe,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:K.refundReason,children:K.status==="refunded"&&K.refundReason?K.refundReason:"-"}),e.jsx(pe,{className:"text-[#FFD700]",children:K.referrerEarnings?`¥${Number(K.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(pe,{className:"text-gray-400 text-sm",children:new Date(K.createdAt).toLocaleString("zh-CN")}),e.jsx(pe,{children:(K.status==="paid"||K.status==="completed")&&e.jsxs(Z,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{R(K),Y("")},children:[e.jsx(Jx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},K.id)}),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Qs,{page:p,totalPages:ve,total:c,pageSize:C,onPageChange:v,onPageSizeChange:K=>{P(K),v(1)}})]})})}),e.jsx(Ct,{open:!!I,onOpenChange:K=>!K&&R(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:"订单退款"})}),I&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",I.orderSn||I.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(I.amount||0).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:E,onChange:K=>Y(K.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(Z,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>R(null),disabled:ne,children:"取消"}),e.jsx(Z,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:B,disabled:ne,children:ne?"退款中...":"确认退款"})]})]})})]})}var m2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],f2=m2.reduce((r,a)=>{const l=ep(`Primitive.${a}`),o=h.forwardRef((c,d)=>{const{asChild:m,...f}=c,y=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(y,{...f,ref:d})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{}),x2="Label",Kp=h.forwardRef((r,a)=>e.jsx(f2.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())}}));Kp.displayName=x2;var Gp=Kp;const te=h.forwardRef(({className:r,...a},l)=>e.jsx(Gp,{ref:l,className:lt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));te.displayName=Gp.displayName;function _u(r){const a=r+"CollectionProvider",[l,o]=vn(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),m=b=>{const{scope:N,children:w}=b,k=tn.useRef(null),j=tn.useRef(new Map).current;return e.jsx(c,{scope:N,itemMap:j,collectionRef:k,children:w})};m.displayName=a;const f=r+"CollectionSlot",y=Dl(f),g=tn.forwardRef((b,N)=>{const{scope:w,children:k}=b,j=d(f,w),_=at(N,j.collectionRef);return e.jsx(y,{ref:_,children:k})});g.displayName=f;const p=r+"CollectionItemSlot",v="data-radix-collection-item",C=Dl(p),P=tn.forwardRef((b,N)=>{const{scope:w,children:k,...j}=b,_=tn.useRef(null),U=at(N,_),V=d(p,w);return tn.useEffect(()=>(V.itemMap.set(_,{ref:_,...j}),()=>void V.itemMap.delete(_))),e.jsx(C,{[v]:"",ref:U,children:k})});P.displayName=p;function T(b){const N=d(r+"CollectionConsumer",b);return tn.useCallback(()=>{const k=N.collectionRef.current;if(!k)return[];const j=Array.from(k.querySelectorAll(`[${v}]`));return Array.from(N.itemMap.values()).sort((V,I)=>j.indexOf(V.ref.current)-j.indexOf(I.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:m,Slot:g,ItemSlot:P},T,o]}var p2=h.createContext(void 0);function Eo(r){const a=h.useContext(p2);return r||a||"ltr"}var Od="rovingFocusGroup.onEntryFocus",g2={bubbles:!1,cancelable:!0},zl="RovingFocusGroup",[tu,Yp,y2]=_u(zl),[v2,Qp]=vn(zl,[y2]),[j2,b2]=v2(zl),qp=h.forwardRef((r,a)=>e.jsx(tu.Provider,{scope:r.__scopeRovingFocusGroup,children:e.jsx(tu.Slot,{scope:r.__scopeRovingFocusGroup,children:e.jsx(N2,{...r,ref:a})})}));qp.displayName=zl;var N2=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:d,currentTabStopId:m,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:y,onEntryFocus:g,preventScrollOnEntryFocus:p=!1,...v}=r,C=h.useRef(null),P=at(a,C),T=Eo(d),[b,N]=Vn({prop:m,defaultProp:f??null,onChange:y,caller:zl}),[w,k]=h.useState(!1),j=mn(g),_=Yp(l),U=h.useRef(!1),[V,I]=h.useState(0);return h.useEffect(()=>{const R=C.current;if(R)return R.addEventListener(Od,j),()=>R.removeEventListener(Od,j)},[j]),e.jsx(j2,{scope:l,orientation:o,dir:T,loop:c,currentTabStopId:b,onItemFocus:h.useCallback(R=>N(R),[N]),onItemShiftTab:h.useCallback(()=>k(!0),[]),onFocusableItemAdd:h.useCallback(()=>I(R=>R+1),[]),onFocusableItemRemove:h.useCallback(()=>I(R=>R-1),[]),children:e.jsx(Xe.div,{tabIndex:w||V===0?-1:0,"data-orientation":o,...v,ref:P,style:{outline:"none",...r.style},onMouseDown:Ge(r.onMouseDown,()=>{U.current=!0}),onFocus:Ge(r.onFocus,R=>{const E=!U.current;if(R.target===R.currentTarget&&E&&!w){const Y=new CustomEvent(Od,g2);if(R.currentTarget.dispatchEvent(Y),!Y.defaultPrevented){const ne=_().filter(ie=>ie.focusable),ae=ne.find(ie=>ie.active),q=ne.find(ie=>ie.id===b),H=[ae,q,...ne].filter(Boolean).map(ie=>ie.ref.current);Zp(H,p)}}U.current=!1}),onBlur:Ge(r.onBlur,()=>k(!1))})})}),Xp="RovingFocusGroupItem",Jp=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:d,children:m,...f}=r,y=un(),g=d||y,p=b2(Xp,l),v=p.currentTabStopId===g,C=Yp(l),{onFocusableItemAdd:P,onFocusableItemRemove:T,currentTabStopId:b}=p;return h.useEffect(()=>{if(o)return P(),()=>T()},[o,P,T]),e.jsx(tu.ItemSlot,{scope:l,id:g,focusable:o,active:c,children:e.jsx(Xe.span,{tabIndex:v?0:-1,"data-orientation":p.orientation,...f,ref:a,onMouseDown:Ge(r.onMouseDown,N=>{o?p.onItemFocus(g):N.preventDefault()}),onFocus:Ge(r.onFocus,()=>p.onItemFocus(g)),onKeyDown:Ge(r.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){p.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const w=C2(N,p.orientation,p.dir);if(w!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let j=C().filter(_=>_.focusable).map(_=>_.ref.current);if(w==="last")j.reverse();else if(w==="prev"||w==="next"){w==="prev"&&j.reverse();const _=j.indexOf(N.currentTarget);j=p.loop?k2(j,_+1):j.slice(_+1)}setTimeout(()=>Zp(j))}}),children:typeof m=="function"?m({isCurrentTabStop:v,hasTabStop:b!=null}):m})})});Jp.displayName=Xp;var w2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function S2(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function C2(r,a,l){const o=S2(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return w2[o]}function Zp(r,a=!1){const l=document.activeElement;for(const o of r)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function k2(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var E2=qp,P2=Jp,Po="Tabs",[T2]=vn(Po,[Qp]),e0=Qp(),[R2,Mu]=T2(Po),t0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:d,orientation:m="horizontal",dir:f,activationMode:y="automatic",...g}=r,p=Eo(f),[v,C]=Vn({prop:o,onChange:c,defaultProp:d??"",caller:Po});return e.jsx(R2,{scope:l,baseId:un(),value:v,onValueChange:C,orientation:m,dir:p,activationMode:y,children:e.jsx(Xe.div,{dir:p,"data-orientation":m,...g,ref:a})})});t0.displayName=Po;var s0="TabsList",r0=h.forwardRef((r,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=r,d=Mu(s0,l),m=e0(l);return e.jsx(E2,{asChild:!0,...m,orientation:d.orientation,dir:d.dir,loop:o,children:e.jsx(Xe.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});r0.displayName=s0;var n0="TabsTrigger",a0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...d}=r,m=Mu(n0,l),f=e0(l),y=o0(m.baseId,o),g=c0(m.baseId,o),p=o===m.value;return e.jsx(P2,{asChild:!0,...f,focusable:!c,active:p,children:e.jsx(Xe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":g,"data-state":p?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:y,...d,ref:a,onMouseDown:Ge(r.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?m.onValueChange(o):v.preventDefault()}),onKeyDown:Ge(r.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&m.onValueChange(o)}),onFocus:Ge(r.onFocus,()=>{const v=m.activationMode!=="manual";!p&&!c&&v&&m.onValueChange(o)})})})});a0.displayName=n0;var l0="TabsContent",i0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:d,...m}=r,f=Mu(l0,l),y=o0(f.baseId,o),g=c0(f.baseId,o),p=o===f.value,v=h.useRef(p);return h.useEffect(()=>{const C=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(C)},[]),e.jsx(Fl,{present:c||p,children:({present:C})=>e.jsx(Xe.div,{"data-state":p?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":y,hidden:!C,id:g,tabIndex:0,...m,ref:a,style:{...r.style,animationDuration:v.current?"0s":void 0},children:C&&d})})});i0.displayName=l0;function o0(r,a){return`${r}-trigger-${a}`}function c0(r,a){return`${r}-content-${a}`}var I2=t0,d0=r0,u0=a0,h0=i0;const $l=I2,$a=h.forwardRef(({className:r,...a},l)=>e.jsx(d0,{ref:l,className:lt("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));$a.displayName=d0.displayName;const Lt=h.forwardRef(({className:r,...a},l)=>e.jsx(u0,{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=u0.displayName;const Ot=h.forwardRef(({className:r,...a},l)=>e.jsx(h0,{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=h0.displayName;function Au(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 Du(r){const[a,l]=h.useState(void 0);return Zt(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let m,f;if("borderBoxSize"in d){const y=d.borderBoxSize,g=Array.isArray(y)?y[0]:y;m=g.inlineSize,f=g.blockSize}else m=r.offsetWidth,f=r.offsetHeight;l({width:m,height:f})});return o.observe(r,{box:"border-box"}),()=>o.unobserve(r)}else l(void 0)},[r]),a}var To="Switch",[_2]=vn(To),[M2,A2]=_2(To),m0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:d,required:m,disabled:f,value:y="on",onCheckedChange:g,form:p,...v}=r,[C,P]=h.useState(null),T=at(a,j=>P(j)),b=h.useRef(!1),N=C?p||!!C.closest("form"):!0,[w,k]=Vn({prop:c,defaultProp:d??!1,onChange:g,caller:To});return e.jsxs(M2,{scope:l,checked:w,disabled:f,children:[e.jsx(Xe.button,{type:"button",role:"switch","aria-checked":w,"aria-required":m,"data-state":g0(w),"data-disabled":f?"":void 0,disabled:f,value:y,...v,ref:T,onClick:Ge(r.onClick,j=>{k(_=>!_),N&&(b.current=j.isPropagationStopped(),b.current||j.stopPropagation())})}),N&&e.jsx(p0,{control:C,bubbles:!b.current,name:o,value:y,checked:w,required:m,disabled:f,form:p,style:{transform:"translateX(-100%)"}})]})});m0.displayName=To;var f0="SwitchThumb",x0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,...o}=r,c=A2(f0,l);return e.jsx(Xe.span,{"data-state":g0(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});x0.displayName=f0;var D2="SwitchBubbleInput",p0=h.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:o=!0,...c},d)=>{const m=h.useRef(null),f=at(m,d),y=Au(l),g=Du(a);return h.useEffect(()=>{const p=m.current;if(!p)return;const v=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(v,"checked").set;if(y!==l&&P){const T=new Event("click",{bubbles:o});P.call(p,l),p.dispatchEvent(T)}},[y,l,o]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:f,style:{...c.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});p0.displayName=D2;function g0(r){return r?"checked":"unchecked"}var y0=m0,L2=x0;const ot=h.forwardRef(({className:r,...a},l)=>e.jsx(y0,{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(L2,{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=y0.displayName;const hn=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}));hn.displayName="Textarea";function v0({open:r,onClose:a,userId:l,onUserUpdated:o}){var ze;const[c,d]=h.useState(null),[m,f]=h.useState([]),[y,g]=h.useState([]),[p,v]=h.useState(!1),[C,P]=h.useState(!1),[T,b]=h.useState(!1),[N,w]=h.useState("info"),[k,j]=h.useState(""),[_,U]=h.useState(""),[V,I]=h.useState([]),[R,E]=h.useState(""),[Y,ne]=h.useState(!1),[ae,q]=h.useState(null),[se,H]=h.useState(null),[ie,ve]=h.useState(""),[B,ce]=h.useState(""),[K,A]=h.useState(""),[O,L]=h.useState(!1),[J,G]=h.useState(null),[de,Q]=h.useState("");h.useEffect(()=>{r&&l&&(w("info"),q(null),H(null),G(null),Q(""),ge())},[r,l]);async function ge(){if(l){v(!0);try{const he=await $e(`/api/db/users?id=${encodeURIComponent(l)}`);if(he!=null&&he.success&&he.user){const xe=he.user;d(xe),j(xe.phone||""),U(xe.nickname||""),ve(xe.phone||""),ce(xe.wechatId||""),A(xe.openId||"");try{I(typeof xe.tags=="string"?JSON.parse(xe.tags||"[]"):[])}catch{I([])}}try{const xe=await $e(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);xe!=null&&xe.success&&xe.tracks&&f(xe.tracks)}catch{f([])}try{const xe=await $e(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);xe!=null&&xe.success&&xe.referrals&&g(xe.referrals)}catch{g([])}}catch(he){console.error("Load user detail error:",he)}finally{v(!1)}}}async function Se(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}P(!0);try{const he=await mt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});he!=null&&he.success?(alert("同步成功"),ge()):alert("同步失败: "+(he==null?void 0:he.error))}catch(he){console.error("Sync CKB error:",he),alert("同步失败")}finally{P(!1)}}async function D(){if(c){b(!0);try{const he={id:c.id,phone:k||void 0,nickname:_||void 0,tags:JSON.stringify(V)},xe=await vt("/api/db/users",he);xe!=null&&xe.success?(alert("保存成功"),ge(),o==null||o()):alert("保存失败: "+(xe==null?void 0:xe.error))}catch(he){console.error("Save user error:",he),alert("保存失败")}finally{b(!1)}}}const fe=()=>{R&&!V.includes(R)&&(I([...V,R]),E(""))},ke=he=>I(V.filter(xe=>xe!==he));async function Ve(){if(!ie&&!K&&!B){H("请至少输入手机号、微信号或 OpenID 中的一项");return}ne(!0),H(null),q(null);try{const he=new URLSearchParams;ie&&he.set("phone",ie),K&&he.set("openId",K),B&&he.set("wechatId",B);const xe=await $e(`/api/admin/shensheshou/query?${he}`);xe!=null&&xe.success&&xe.data?(q(xe.data),c&&await We(xe.data)):H((xe==null?void 0:xe.error)||"未查询到数据,该用户可能未在神射手收录")}catch(he){console.error("SSS query error:",he),H("请求失败,请检查神射手接口配置")}finally{ne(!1)}}async function We(he){if(c)try{await mt("/api/admin/shensheshou/enrich",{userId:c.id,phone:ie||c.phone||"",openId:K||c.openId||"",wechatId:B||c.wechatId||""}),ge()}catch(xe){console.error("SSS enrich error:",xe)}}async function Ke(){if(c){L(!0),G(null);try{const he={users:[{phone:c.phone||"",name:c.nickname||"",openId:c.openId||"",tags:V}]},xe=await mt("/api/admin/shensheshou/ingest",he);xe!=null&&xe.success&&xe.data?G(xe.data):G({error:(xe==null?void 0:xe.error)||"推送失败"})}catch(he){console.error("SSS ingest error:",he),G({error:"请求失败"})}finally{L(!1)}}}const tt=he=>{const ft={view_chapter:qs,purchase:qd,match:Yt,login:Ra,register:Ra,share:Pr,bind_phone:Jb,bind_wechat:Wb,fill_profile:Ed,visit_page:Ta}[he]||Yd;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(Ra,{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"})]})}),p?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:""}):((ze=c.nickname)==null?void 0:ze.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:N,onValueChange:w,className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs($a,{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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:k,onChange:he=>j(he.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:_,onChange:he=>U(he.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(Xx,{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(le,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"输入归属微信号(如 wxid_xxxx)",value:de,onChange:he=>Q(he.target.value)}),e.jsxs(Z,{size:"sm",onClick:async()=>{if(!(!de||!c))try{await vt("/api/db/users",{id:c.id,wechatId:de}),alert("已保存微信归属"),ge()}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(Mt,{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(Z,{size:"sm",onClick:Se,disabled:C||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?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(Gd,{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(he=>e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1.5",children:he.category}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:he.tags.map(xe=>e.jsxs("button",{type:"button",onClick:()=>{V.includes(xe)?ke(xe):I([...V,xe])},className:`px-2 py-0.5 rounded text-xs border transition-all ${V.includes(xe)?"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:[V.includes(xe)?"✓ ":"",xe]},xe))})]},he.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:[V.map((he,xe)=>e.jsxs(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[he,e.jsx("button",{type:"button",onClick:()=>ke(he),className:"ml-1 hover:text-red-400",children:e.jsx(ms,{className:"w-3 h-3"})})]},xe)),V.length===0&&e.jsx("span",{className:"text-gray-600 text-sm",children:"暂未选择标签"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"自定义标签(回车添加)",value:R,onChange:he=>E(he.target.value),onKeyDown:he=>he.key==="Enter"&&fe()}),e.jsx(Z,{onClick:fe,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((he,xe)=>e.jsx(Le,{className:"bg-purple-500/20 text-purple-400 border-0",children:he.trim()},xe))})]})]}),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((he,xe)=>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(he.action)}),xe0?y.map((he,xe)=>{var es;const ft=he;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||xe)}):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(le,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"11位手机号",value:ie,onChange:he=>ve(he.target.value)})]}),e.jsxs("div",{children:[e.jsx(te,{className:"text-gray-500 text-xs mb-1 block",children:"微信号"}),e.jsx(le,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"微信 ID",value:B,onChange:he=>ce(he.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(le,{className:"bg-[#162840] border-gray-700 text-white",placeholder:"openid_xxxx(自动填入)",value:K,onChange:he=>A(he.target.value)})]})]}),e.jsx(Z,{onClick:Ve,disabled:Y,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:Y?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:"查询成功后,神射手返回的标签将自动同步到该用户"}),se&&e.jsx("div",{className:"mt-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400 text-sm",children:se}),ae&&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:ae.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:ae.user_level??"-"})]})]}),ae.tags&&ae.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:ae.tags.map((he,xe)=>e.jsx(Le,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/20",children:he},xe))})]}),ae.last_active&&e.jsxs("div",{className:"text-sm text-gray-500",children:["最近活跃:",ae.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(Z,{onClick:Ke,disabled:O||!c.phone,variant:"outline",className:"border-purple-500/40 text-purple-400 hover:bg-purple-500/10 bg-transparent shrink-0 ml-4",children:O?e.jsxs(e.Fragment,{children:[e.jsx(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:"⚠ 用户未绑定手机号,无法推送"}),J&&e.jsx("div",{className:"mt-3 p-3 bg-[#162840] rounded-lg text-sm",children:J.error?e.jsx("p",{className:"text-red-400",children:String(J.error)}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-green-400 flex items-center gap-1",children:[e.jsx(Gd,{className:"w-4 h-4"})," 推送成功"]}),J.enriched!==void 0&&e.jsxs("p",{className:"text-gray-400",children:["自动补全标签数:",String(J.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(Z,{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(Z,{onClick:D,disabled:T,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{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 O2({open:r,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[d,m]=h.useState(Fd),[f,y]=h.useState([]),[g,p]=h.useState(!1),[v,C]=h.useState(!1);h.useEffect(()=>{if(!r){m(Fd);return}let T=!1;return p(!0),Promise.all([$e("/api/db/vip-roles"),l?$e(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([b,N])=>{if(T)return;const w=b!=null&&b.success&&b.data?b.data:[];y(w);const k=N&&N.user?N.user:null;if(k){const j=String(k.vipRole??""),_=w.some(U=>U.name===j);m({isVip:!!(k.isVip??!1),vipExpireDate:k.vipExpireDate?String(k.vipExpireDate).slice(0,10):"",vipSort:typeof k.vipSort=="number"?k.vipSort:"",vipRole:_?j:j?"__custom__":"",vipRoleCustom:_?"":j,vipName:String(k.vipName??""),vipProject:String(k.vipProject??""),vipContact:String(k.vipContact??""),vipBio:String(k.vipBio??"")})}else m(Fd)}).catch(b=>{T||console.error("Load error:",b)}).finally(()=>{T||p(!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}}C(!0);try{const T=d.vipRole==="__custom__"?d.vipRoleCustom.trim():d.vipRole,b={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},N=await vt("/api/db/users",b);N!=null&&N.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(N==null?void 0:N.error))}catch(T){console.error("Save VIP error:",T),alert("保存失败")}finally{C(!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 - ",o||l]})}),g?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(b=>({...b,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(le,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:d.vipExpireDate,onChange:T=>m(b=>({...b,vipExpireDate:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:d.vipSort===""?"":d.vipSort,onChange:T=>{const b=T.target.value;m(N=>({...N,vipSort:b===""?"":parseInt(b,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(b=>({...b,vipRole:T.target.value})),children:[e.jsx("option",{value:"",children:"请选择或下方手动填写"}),f.map(T=>e.jsx("option",{value:T.name,children:T.name},T.id)),e.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),d.vipRole==="__custom__"&&e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:d.vipRoleCustom,onChange:T=>m(b=>({...b,vipRoleCustom:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:d.vipName,onChange:T=>m(b=>({...b,vipName:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"项目/公司"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:d.vipProject,onChange:T=>m(b=>({...b,vipProject:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"联系方式"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:d.vipContact,onChange:T=>m(b=>({...b,vipContact:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"一句话简介"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:d.vipBio,onChange:T=>m(b=>({...b,vipBio:T.target.value}))})]})]}),e.jsxs(Dt,{children:[e.jsxs(Z,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:P,disabled:v||g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{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 F2(){var as,Pn,er,xr,Pt;const[r,a]=Ux(),l=r.get("pool"),[o,c]=h.useState([]),[d,m]=h.useState(0),[f,y]=h.useState(1),[g,p]=h.useState(10),[v,C]=h.useState(""),P=Iu(v,300),T=l==="vip"?"vip":l==="complete"?"complete":"all",[b,N]=h.useState(T),[w,k]=h.useState(!0),[j,_]=h.useState(null),[U,V]=h.useState(!1),[I,R]=h.useState("desc");h.useEffect(()=>{l==="vip"?N("vip"):l==="complete"?N("complete"):l==="all"&&N("all")},[l]);const[E,Y]=h.useState(!1),[ne,ae]=h.useState(!1),[q,se]=h.useState(null),[H,ie]=h.useState(""),[ve,B]=h.useState(""),[ce,K]=h.useState(!1),[A,O]=h.useState(!1),[L,J]=h.useState({referrals:[],stats:{}}),[G,de]=h.useState(!1),[Q,ge]=h.useState(null),[Se,D]=h.useState(!1),[fe,ke]=h.useState(null),[Ve,We]=h.useState(!1),[Ke,tt]=h.useState(null),[ze,he]=h.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),[xe,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 z;k(!0),_(null);try{if(U){const He=new URLSearchParams({search:P,limit:String(g*5)}),Je=await $e(`/api/db/users/rfm?${He}`);if(Je!=null&&Je.success){let ls=Je.users||[];I==="asc"&&(ls=[...ls].reverse());const dt=(f-1)*g;c(ls.slice(dt,dt+g)),m(((z=Je.users)==null?void 0:z.length)??0),ls.length===0&&(V(!1),_("暂无订单数据,RFM 排序需要用户有购买记录后才能生效"))}else V(!1),_((Je==null?void 0:Je.error)||"RFM 加载失败,已切回普通模式")}else{const He=new URLSearchParams({page:String(f),pageSize:String(g),search:P,...b==="vip"&&{vip:"true"},...b==="complete"&&{pool:"complete"}}),Je=await $e(`/api/db/users?${He}`);Je!=null&&Je.success?(c(Je.users||[]),m(Je.total??0)):_((Je==null?void 0:Je.error)||"加载失败")}}catch(He){console.error("Load users error:",He),_("网络错误")}finally{k(!1)}}h.useEffect(()=>{y(1)},[P,b,U]),h.useEffect(()=>{Fs()},[f,g,P,b,U,I]);const qn=Math.ceil(d/g)||1,Xn=()=>{U?I==="desc"?R("asc"):(V(!1),R("desc")):(V(!0),R("desc"))},Jn=z=>({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"})[z||""]||"bg-gray-500/20 text-gray-400";async function Zn(z){if(confirm("确定要删除这个用户吗?"))try{const He=await Tr(`/api/db/users?id=${encodeURIComponent(z)}`);He!=null&&He.success?Fs():alert("删除失败: "+((He==null?void 0:He.error)||""))}catch{alert("删除失败")}}const kn=z=>{se(z),he({phone:z.phone||"",nickname:z.nickname||"",password:"",isAdmin:!!(z.isAdmin??!1),hasFullBook:!!(z.hasFullBook??!1)}),Y(!0)},En=()=>{se(null),he({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),Y(!0)};async function zs(){if(!ze.phone||!ze.nickname){alert("请填写手机号和昵称");return}K(!0);try{if(q){const z=await vt("/api/db/users",{id:q.id,nickname:ze.nickname,isAdmin:ze.isAdmin,hasFullBook:ze.hasFullBook,...ze.password&&{password:ze.password}});if(!(z!=null&&z.success)){alert("更新失败: "+((z==null?void 0:z.error)||""));return}}else{const z=await mt("/api/db/users",{phone:ze.phone,nickname:ze.nickname,password:ze.password,isAdmin:ze.isAdmin});if(!(z!=null&&z.success)){alert("创建失败: "+((z==null?void 0:z.error)||""));return}}Y(!1),Fs()}catch{alert("保存失败")}finally{K(!1)}}const Ar=z=>{se(z),ie(""),B(""),ae(!0)};async function $s(z){ge(z),O(!0),de(!0);try{const He=await $e(`/api/db/users/referrals?userId=${encodeURIComponent(z.id)}`);He!=null&&He.success?J({referrals:He.referrals||[],stats:He.stats||{}}):J({referrals:[],stats:{}})}catch{J({referrals:[],stats:{}})}finally{de(!1)}}async function ea(){if(!H){alert("请输入新密码");return}if(H!==ve){alert("两次密码不一致");return}if(H.length<6){alert("密码至少6位");return}K(!0);try{const z=await vt("/api/db/users",{id:q==null?void 0:q.id,password:H});z!=null&&z.success?(alert("修改成功"),ae(!1)):alert("修改失败: "+((z==null?void 0:z.error)||""))}catch{alert("修改失败")}finally{K(!1)}}const ts=h.useCallback(async()=>{hr(!0);try{const z=await $e("/api/db/user-rules");z!=null&&z.success&&ft(z.rules||[])}catch{}finally{hr(!1)}},[]);async function F(){if(!ct.title){alert("请填写规则标题");return}K(!0);try{if(Bt){const z=await vt("/api/db/user-rules",{id:Bt.id,...ct});if(!(z!=null&&z.success)){alert("更新失败: "+((z==null?void 0:z.error)||""));return}}else{const z=await mt("/api/db/user-rules",ct);if(!(z!=null&&z.success)){alert("创建失败: "+((z==null?void 0:z.error)||""));return}}As(!1),ts()}catch{alert("保存失败")}finally{K(!1)}}async function oe(z){if(confirm("确定删除?"))try{const He=await Tr(`/api/db/user-rules?id=${z}`);He!=null&&He.success&&ts()}catch{}}async function Ce(z){try{await vt("/api/db/user-rules",{id:z.id,enabled:!z.enabled}),ts()}catch{}}const Ee=h.useCallback(async()=>{Yn(!0);try{const z=await $e("/api/db/vip-roles");z!=null&&z.success&&mr(z.roles||[])}catch{}finally{Yn(!1)}},[]);async function xt(){if(!ys.name){alert("请填写角色名称");return}K(!0);try{if(Sn){const z=await vt("/api/db/vip-roles",{id:Sn.id,...ys});if(!(z!=null&&z.success)){alert("更新失败");return}}else{const z=await mt("/api/db/vip-roles",ys);if(!(z!=null&&z.success)){alert("创建失败");return}}ks(!1),Ee()}catch{alert("保存失败")}finally{K(!1)}}async function ns(z){if(confirm("确定删除?"))try{const He=await Tr(`/api/db/vip-roles?id=${z}`);He!=null&&He.success&&Ee()}catch{}}const nt=h.useCallback(async()=>{Os(!0);try{const z=await $e("/api/db/users/journey-stats");z!=null&&z.success&&z.stats&&Cn(z.stats)}catch{}finally{Os(!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:()=>_(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," 位注册用户",U&&" · RFM 排序中"]})]})}),e.jsxs($l,{defaultValue:"users",className:"w-full",children:[e.jsxs($a,{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(Yt,{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(dn,{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(Z,{variant:"outline",onClick:Fs,disabled:w,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 ${w?"animate-spin":""}`})," 刷新"]}),e.jsxs("select",{value:b,onChange:z=>{const He=z.target.value;N(He),y(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:U,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(le,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-56",value:v,onChange:z=>C(z.target.value)})]}),e.jsxs(Z,{onClick:En,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Xd,{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:w?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(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:Xn,children:[e.jsxs("div",{className:"flex items-center gap-1 group",children:[e.jsx(Rl,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"RFM分值"}),U?I==="desc"?e.jsx(Ml,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Wx,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Vj,{className:"w-3.5 h-3.5 text-gray-600 group-hover:text-gray-400"})]}),U&&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(ps,{children:[o.map(z=>{var He,Je,ls;return e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:z.avatar?e.jsx("img",{src:z.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((He=z.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:z.nickname}),z.isAdmin&&e.jsx(Le,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),z.openId&&!((Je=z.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:z.openId?z.openId.slice(0,12)+"...":(ls=z.id)==null?void 0:ls.slice(0,12)})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"space-y-1",children:[z.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:z.phone})]}),z.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:z.wechatId})]}),z.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:z.openId,children:[z.openId.slice(0,12),"..."]})]}),!z.phone&&!z.wechatId&&!z.openId&&e.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),e.jsx(pe,{children:z.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(pe,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(z.earnings||0)).toFixed(2)]}),parseFloat(String(z.pendingEarnings||0))>0&&e.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(z.pendingEarnings||0)).toFixed(2)]}),e.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>$s(z),role:"button",tabIndex:0,onKeyDown:dt=>dt.key==="Enter"&&$s(z),children:[e.jsx(Yt,{className:"w-3 h-3"})," 绑定",z.referralCount||0,"人"]})]})}),e.jsx(pe,{children:z.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:z.rfmScore}),e.jsx(Le,{className:`border-0 text-xs ${Jn(z.rfmLevel)}`,children:z.rfmLevel})]})}):e.jsxs("span",{className:"text-gray-600 text-sm",children:["— ",e.jsx("span",{className:"text-xs text-gray-700",children:"点列头排序"})]})}),e.jsx(pe,{className:"text-gray-400",children:z.createdAt?new Date(z.createdAt).toLocaleDateString():"-"}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>{tt(z),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(Z,{variant:"ghost",size:"sm",onClick:()=>{ke(z.id),D(!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(Z,{variant:"ghost",size:"sm",onClick:()=>kn(z),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>Ar(z),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx($f,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Zn(z.id),title:"删除",children:e.jsx(Ht,{className:"w-4 h-4"})})]})})]},z.id)}),o.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Qs,{page:f,totalPages:qn,total:d,pageSize:g,onPageChange:y,onPageSizeChange:z=>{p(z),y(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(Z,{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((z,He)=>e.jsxs("div",{className:"relative flex flex-col items-center",children:[e.jsxs("div",{className:`relative w-full p-3 rounded-xl border ${z.color} text-center cursor-default`,children:[e.jsx("div",{className:"text-2xl mb-1",children:z.icon}),e.jsx("div",{className:`text-xs font-medium ${z.color.split(" ").find(Je=>Je.startsWith("text-"))}`,children:z.label}),Ls[z.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[z.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:z.step}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-300",children:z.action}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["→ ",z.next]})]})]},z.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(z=>{const He=Ls[z.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:[z.icon," ",z.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})]},z.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(Z,{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(Z,{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"})}):xe.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(Z,{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:xe.map(z=>e.jsx("div",{className:`p-4 rounded-lg border transition-all ${z.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(ht,{className:"w-4 h-4 text-[#38bdac] shrink-0"}),e.jsx("span",{className:"text-white font-medium",children:z.title}),z.trigger&&e.jsxs(Le,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/30 text-xs",children:["触发:",z.trigger]}),e.jsx(Le,{className:`text-xs border-0 ${z.enabled?"bg-green-500/20 text-green-400":"bg-gray-500/20 text-gray-400"}`,children:z.enabled?"启用":"禁用"})]}),z.description&&e.jsx("p",{className:"text-gray-400 text-sm ml-6",children:z.description})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4 shrink-0",children:[e.jsx(ot,{checked:z.enabled,onCheckedChange:()=>Ce(z)}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>{Mr(z),gs({title:z.title,description:z.description,trigger:z.trigger,sort:z.sort,enabled:z.enabled}),As(!0)},className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>oe(z.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]})},z.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(Z,{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(Z,{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(Z,{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(z=>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:z.name})]}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{type:"button",onClick:()=>{fr(z),Ds({name:z.name,sort:z.sort}),ks(!0)},className:"text-gray-500 hover:text-[#38bdac]",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>ns(z.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:["排序: ",z.sort]})]},z.id))})]})]}),e.jsx(Ct,{open:E,onOpenChange:Y,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:[q?e.jsx(ht,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Xd,{className:"w-5 h-5 text-[#38bdac]"}),q?"编辑用户":"添加用户"]})}),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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:ze.phone,onChange:z=>he({...ze,phone:z.target.value}),disabled:!!q})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:ze.nickname,onChange:z=>he({...ze,nickname:z.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:q?"新密码 (留空则不修改)":"密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:q?"留空则不修改":"请输入密码",value:ze.password,onChange:z=>he({...ze,password:z.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"管理员权限"}),e.jsx(ot,{checked:ze.isAdmin,onCheckedChange:z=>he({...ze,isAdmin:z})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"已购全书"}),e.jsx(ot,{checked:ze.hasFullBook,onCheckedChange:z=>he({...ze,hasFullBook:z})})]})]}),e.jsxs(Dt,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>Y(!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(Z,{onClick:zs,disabled:ce,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),ce?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:ne,onOpenChange:ae,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($f,{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:["用户:",q==null?void 0:q.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",q==null?void 0:q.phone]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"新密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:H,onChange:z=>ie(z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"确认密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入",value:ve,onChange:z=>B(z.target.value)})]})]}),e.jsxs(Dt,{children:[e.jsx(Z,{variant:"outline",onClick:()=>ae(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:ea,disabled:ce,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ce?"保存中...":"确认修改"})]})]})}),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(ht,{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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:匹配后填写头像、付款1980需填写信息",value:ct.title,onChange:z=>gs({...ct,title:z.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"规则描述"}),e.jsx(hn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[80px] resize-none",placeholder:"详细说明规则内容...",value:ct.description,onChange:z=>gs({...ct,description:z.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"触发条件"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:完成匹配、付款后、注册时",value:ct.trigger,onChange:z=>gs({...ct,trigger:z.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:z=>gs({...ct,enabled:z})})]})]}),e.jsxs(Dt,{children:[e.jsxs(Z,{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(Z,{onClick:F,disabled:ce,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),ce?"保存中...":"保存"]})]})]})}),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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:创业者、资源整合者、技术咖",value:ys.name,onChange:z=>Ds({...ys,name:z.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序(越小越前)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:ys.sort,onChange:z=>Ds({...ys,sort:parseInt(z.target.value)||0})})]})]}),e.jsxs(Dt,{children:[e.jsxs(Z,{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(Z,{onClick:xt,disabled:ce,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),ce?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:A,onOpenChange:O,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(Yt,{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=L.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=L.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=L.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=L.stats)==null?void 0:xr.pendingEarnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),G?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=L.referrals)==null?void 0:Pt.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(L.referrals??[]).map((z,He)=>{var ls;const Je=z;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(Z,{variant:"outline",onClick:()=>O(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),e.jsx(v0,{open:Se,onClose:()=>D(!1),userId:fe,onUserUpdated:Fs}),e.jsx(O2,{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"],b0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],N0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ba="Slider",[su,z2,$2]=_u(Ba),[w0]=vn(Ba,[$2]),[B2,Ro]=w0(Ba),S0=h.forwardRef((r,a)=>{const{name:l,min:o=0,max:c=100,step:d=1,orientation:m="horizontal",disabled:f=!1,minStepsBetweenThumbs:y=0,defaultValue:g=[o],value:p,onValueChange:v=()=>{},onValueCommit:C=()=>{},inverted:P=!1,form:T,...b}=r,N=h.useRef(new Set),w=h.useRef(0),j=m==="horizontal"?U2:V2,[_=[],U]=Vn({prop:p,defaultProp:g,onChange:ne=>{var q;(q=[...N.current][w.current])==null||q.focus(),v(ne)}}),V=h.useRef(_);function I(ne){const ae=Y2(_,ne);Y(ne,ae)}function R(ne){Y(ne,w.current)}function E(){const ne=V.current[w.current];_[w.current]!==ne&&C(_)}function Y(ne,ae,{commit:q}={commit:!1}){const se=J2(d),H=Z2(Math.round((ne-o)/d)*d+o,se),ie=xo(H,[o,c]);U((ve=[])=>{const B=K2(ve,ie,ae);if(X2(B,y*d)){w.current=B.indexOf(ie);const ce=String(B)!==String(ve);return ce&&q&&C(B),ce?B:ve}else return ve})}return e.jsx(B2,{scope:r.__scopeSlider,name:l,disabled:f,min:o,max:c,valueIndexToChangeRef:w,thumbs:N.current,values:_,orientation:m,form:T,children:e.jsx(su.Provider,{scope:r.__scopeSlider,children:e.jsx(su.Slot,{scope:r.__scopeSlider,children:e.jsx(j,{"aria-disabled":f,"data-disabled":f?"":void 0,...b,ref:a,onPointerDown:Ge(b.onPointerDown,()=>{f||(V.current=_)}),min:o,max:c,inverted:P,onSlideStart:f?void 0:I,onSlideMove:f?void 0:R,onSlideEnd:f?void 0:E,onHomeKeyDown:()=>!f&&Y(o,0,{commit:!0}),onEndKeyDown:()=>!f&&Y(c,_.length-1,{commit:!0}),onStepKeyDown:({event:ne,direction:ae})=>{if(!f){const H=j0.includes(ne.key)||ne.shiftKey&&b0.includes(ne.key)?10:1,ie=w.current,ve=_[ie],B=d*H*ae;Y(ve+B,ie,{commit:!0})}}})})})})});S0.displayName=Ba;var[C0,k0]=w0(Ba,{startEdge:"left",endEdge:"right",size:"width",direction:1}),U2=h.forwardRef((r,a)=>{const{min:l,max:o,dir:c,inverted:d,onSlideStart:m,onSlideMove:f,onSlideEnd:y,onStepKeyDown:g,...p}=r,[v,C]=h.useState(null),P=at(a,j=>C(j)),T=h.useRef(void 0),b=Eo(c),N=b==="ltr",w=N&&!d||!N&&d;function k(j){const _=T.current||v.getBoundingClientRect(),U=[0,_.width],I=Lu(U,w?[l,o]:[o,l]);return T.current=_,I(j-_.left)}return e.jsx(C0,{scope:r.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:e.jsx(E0,{dir:b,"data-orientation":"horizontal",...p,ref:P,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const _=k(j.clientX);m==null||m(_)},onSlideMove:j=>{const _=k(j.clientX);f==null||f(_)},onSlideEnd:()=>{T.current=void 0,y==null||y()},onStepKeyDown:j=>{const U=N0[w?"from-left":"from-right"].includes(j.key);g==null||g({event:j,direction:U?-1:1})}})})}),V2=h.forwardRef((r,a)=>{const{min:l,max:o,inverted:c,onSlideStart:d,onSlideMove:m,onSlideEnd:f,onStepKeyDown:y,...g}=r,p=h.useRef(null),v=at(a,p),C=h.useRef(void 0),P=!c;function T(b){const N=C.current||p.current.getBoundingClientRect(),w=[0,N.height],j=Lu(w,P?[o,l]:[l,o]);return C.current=N,j(b-N.top)}return e.jsx(C0,{scope:r.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:e.jsx(E0,{"data-orientation":"vertical",...g,ref:v,style:{...g.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const N=T(b.clientY);d==null||d(N)},onSlideMove:b=>{const N=T(b.clientY);m==null||m(N)},onSlideEnd:()=>{C.current=void 0,f==null||f()},onStepKeyDown:b=>{const w=N0[P?"from-bottom":"from-top"].includes(b.key);y==null||y({event:b,direction:w?-1:1})}})})}),E0=h.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:m,onEndKeyDown:f,onStepKeyDown:y,...g}=r,p=Ro(Ba,l);return e.jsx(Xe.span,{...g,ref:a,onKeyDown:Ge(r.onKeyDown,v=>{v.key==="Home"?(m(v),v.preventDefault()):v.key==="End"?(f(v),v.preventDefault()):j0.concat(b0).includes(v.key)&&(y(v),v.preventDefault())}),onPointerDown:Ge(r.onPointerDown,v=>{const C=v.target;C.setPointerCapture(v.pointerId),v.preventDefault(),p.thumbs.has(C)?C.focus():o(v)}),onPointerMove:Ge(r.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:Ge(r.onPointerUp,v=>{const C=v.target;C.hasPointerCapture(v.pointerId)&&(C.releasePointerCapture(v.pointerId),d(v))})})}),P0="SliderTrack",T0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Ro(P0,l);return e.jsx(Xe.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});T0.displayName=P0;var ru="SliderRange",R0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Ro(ru,l),d=k0(ru,l),m=h.useRef(null),f=at(a,m),y=c.values.length,g=c.values.map(C=>M0(C,c.min,c.max)),p=y>1?Math.min(...g):0,v=100-Math.max(...g);return e.jsx(Xe.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:f,style:{...r.style,[d.startEdge]:p+"%",[d.endEdge]:v+"%"}})});R0.displayName=ru;var nu="SliderThumb",I0=h.forwardRef((r,a)=>{const l=z2(r.__scopeSlider),[o,c]=h.useState(null),d=at(a,f=>c(f)),m=h.useMemo(()=>o?l().findIndex(f=>f.ref.current===o):-1,[l,o]);return e.jsx(W2,{...r,ref:d,index:m})}),W2=h.forwardRef((r,a)=>{const{__scopeSlider:l,index:o,name:c,...d}=r,m=Ro(nu,l),f=k0(nu,l),[y,g]=h.useState(null),p=at(a,k=>g(k)),v=y?m.form||!!y.closest("form"):!0,C=Du(y),P=m.values[o],T=P===void 0?0:M0(P,m.min,m.max),b=G2(o,m.values.length),N=C==null?void 0:C[f.size],w=N?Q2(N,T,f.direction):0;return h.useEffect(()=>{if(y)return m.thumbs.add(y),()=>{m.thumbs.delete(y)}},[y,m.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${T}% + ${w}px)`},children:[e.jsx(su.ItemSlot,{scope:r.__scopeSlider,children:e.jsx(Xe.span,{role:"slider","aria-label":r["aria-label"]||b,"aria-valuemin":m.min,"aria-valuenow":P,"aria-valuemax":m.max,"aria-orientation":m.orientation,"data-orientation":m.orientation,"data-disabled":m.disabled?"":void 0,tabIndex:m.disabled?void 0:0,...d,ref:p,style:P===void 0?{display:"none"}:r.style,onFocus:Ge(r.onFocus,()=>{m.valueIndexToChangeRef.current=o})})}),v&&e.jsx(_0,{name:c??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:P},o)]})});I0.displayName=nu;var H2="RadioBubbleInput",_0=h.forwardRef(({__scopeSlider:r,value:a,...l},o)=>{const c=h.useRef(null),d=at(c,o),m=Au(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const y=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(y,"value").set;if(m!==a&&p){const v=new Event("input",{bubbles:!0});p.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(Xe.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});_0.displayName=H2;function K2(r=[],a,l){const o=[...r];return o[l]=a,o.sort((c,d)=>c-d)}function M0(r,a,l){const d=100/(l-a)*(r-a);return xo(d,[0,100])}function G2(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function Y2(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function Q2(r,a,l){const o=r/2,d=Lu([0,50],[0,o]);return(o-d(a)*l)*l}function q2(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function X2(r,a){if(a>0){const l=q2(r);return Math.min(...l)>=a}return!0}function Lu(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(r[1]-r[0]);return a[0]+o*(l-r[0])}}function J2(r){return(String(r).split(".")[1]||"").length}function Z2(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var e4=S0,t4=T0,s4=R0,r4=I0;function n4({className:r,defaultValue:a,value:l,min:o=0,max:c=100,...d}){const m=h.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return e.jsxs(e4,{defaultValue:a,value:l,min:o,max:c,className:lt("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...d,children:[e.jsx(t4,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:e.jsx(s4,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:m.length},(f,y)=>e.jsx(r4,{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"},y))]})}const a4={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function A0({embedded:r=!1}){const[a,l]=h.useState(a4),[o,c]=h.useState(!0),[d,m]=h.useState(!1);h.useEffect(()=>{$e("/api/admin/referral-settings").then(g=>{const p=g==null?void 0:g.data;p&&typeof p=="object"&&l({distributorShare:p.distributorShare??90,minWithdrawAmount:p.minWithdrawAmount??10,bindingDays:p.bindingDays??30,userDiscount:p.userDiscount??5,enableAutoWithdraw:p.enableAutoWithdraw??!1,vipOrderShareVip:p.vipOrderShareVip??20,vipOrderShareNonVip:p.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>c(!1))},[]);const f=async()=>{m(!0);try{const g={distributorShare:Number(a.distributorShare)||0,minWithdrawAmount:Number(a.minWithdrawAmount)||0,bindingDays:Number(a.bindingDays)||0,userDiscount:Number(a.userDiscount)||0,enableAutoWithdraw:!!a.enableAutoWithdraw,vipOrderShareVip:Number(a.vipOrderShareVip)||20,vipOrderShareNonVip:Number(a.vipOrderShareNonVip)||10},p=await mt("/api/admin/referral-settings",g);if(!p||p.success===!1){alert("保存失败: "+(p&&typeof p=="object"&&"error"in p?p.error:""));return}alert(`✅ 分销配置已保存成功! +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},t2="DialogDescriptionWarning",s2=({contentRef:r,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wp(t2).contentName}}.`;return h.useEffect(()=>{var u;const c=(u=r.current)==null?void 0:u.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(o))},[o,r,a]),null},r2=Ip,n2=Ap,a2=Dp,l2=Lp,i2=Fp,o2=$p,c2=Up;function Ct(r){return e.jsx(r2,{"data-slot":"dialog",...r})}function d2(r){return e.jsx(n2,{...r})}const Hp=h.forwardRef(({className:r,...a},l)=>e.jsx(a2,{ref:l,className:lt("fixed inset-0 z-50 bg-black/50",r),...a}));Hp.displayName="DialogOverlay";const Nt=h.forwardRef(({className:r,children:a,showCloseButton:l=!0,...o},c)=>e.jsxs(d2,{children:[e.jsx(Hp,{}),e.jsxs(l2,{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),...o,children:[a,l&&e.jsxs(c2,{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(i2,{className:"text-lg font-semibold leading-none",...r})}function u2(r){return e.jsx(o2,{className:"text-sm text-muted-foreground",...r})}function Iu(r,a){const[l,o]=h.useState(r);return h.useEffect(()=>{const c=setTimeout(()=>o(r),a);return()=>clearTimeout(c)},[r,a]),l}function Qs({page:r,totalPages:a,total:l,pageSize:o,onPageChange:c,onPageSizeChange:u,pageSizeOptions:m=[10,20,50,100]}){return a<=1&&!u?null:e.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[e.jsxs("span",{children:["共 ",l," 条"]}),u&&e.jsx("select",{value:o,onChange:f=>u(Number(f.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:m.map(f=>e.jsxs("option",{value:f,children:[f," 条/页"]},f))})]}),a>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>c(1),disabled:r<=1,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"首页"}),e.jsx("button",{type:"button",onClick:()=>c(r-1),disabled:r<=1,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"上一页"}),e.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[r," / ",a]}),e.jsx("button",{type:"button",onClick:()=>c(r+1),disabled:r>=a,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"下一页"}),e.jsx("button",{type:"button",onClick:()=>c(a),disabled:r>=a,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"末页"})]})]})}function h2(){const[r,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState(0),[m,f]=h.useState(0),[y,g]=h.useState(0),[p,v]=h.useState(1),[k,P]=h.useState(10),[T,b]=h.useState(""),N=Iu(T,300),[C,E]=h.useState("all"),[j,R]=h.useState(!0),[Q,Z]=h.useState(null),[A,I]=h.useState(null),[w,U]=h.useState(""),[se,le]=h.useState(!1);async function G(){R(!0),Z(null);try{const W=C==="all"?"":C==="completed"?"completed":C,M=new URLSearchParams({page:String(p),pageSize:String(k),...W&&{status:W},...N&&{search:N}}),[O,L]=await Promise.all([$e(`/api/orders?${M}`),$e("/api/db/users?page=1&pageSize=500")]);O!=null&&O.success&&(a(O.orders||[]),u(O.total??0),f(O.totalRevenue??0),g(O.todayRevenue??0)),L!=null&&L.success&&L.users&&o(L.users)}catch(W){console.error("加载订单失败",W),Z("加载订单失败,请检查网络后重试")}finally{R(!1)}}h.useEffect(()=>{v(1)},[N,C]),h.useEffect(()=>{G()},[p,k,N,C]);const re=W=>{var M;return W.userNickname||((M=l.find(O=>O.id===W.userId))==null?void 0:M.nickname)||"匿名用户"},H=W=>{var M;return((M=l.find(O=>O.id===W))==null?void 0:M.phone)||"-"},ie=W=>{const M=W.productType||W.type||"",O=W.description||"";if(O){if(M==="section"&&O.includes("章节")){if(O.includes("-")){const L=O.split("-");if(L.length>=3)return{name:`第${L[1]}章 第${L[2]}节`,type:"《一场Soul的创业实验》"}}return{name:O,type:"章节购买"}}return M==="fullbook"||O.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:M==="vip"||O.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:M==="match"||O.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:O,type:"其他"}}return M==="section"?{name:`章节 ${W.productId||W.sectionId||""}`,type:"单章"}:M==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:M==="vip"?{name:"VIP年度会员",type:"VIP"}:M==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:M||"其他"}},ve=Math.ceil(c/k)||1;async function z(){var W;if(!(!(A!=null&&A.orderSn)&&!(A!=null&&A.id))){le(!0),Z(null);try{const M=await vt("/api/admin/orders/refund",{orderSn:A.orderSn||A.id,reason:w||void 0});M!=null&&M.success?(I(null),U(""),G()):Z((M==null?void 0:M.error)||"退款失败")}catch(M){const O=M;Z(((W=O==null?void 0:O.data)==null?void 0:W.error)||"退款失败,请检查网络后重试")}finally{le(!1)}}}function ne(){if(r.length===0){alert("暂无数据可导出");return}const W=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],M=r.map(de=>{const Y=ie(de);return[de.orderSn||de.id||"",re(de),H(de.userId),Y.name,Number(de.amount||0).toFixed(2),de.paymentMethod==="wechat"?"微信支付":de.paymentMethod==="alipay"?"支付宝":de.paymentMethod||"微信支付",de.status==="refunded"?"已退款":de.status==="paid"||de.status==="completed"?"已完成":de.status==="pending"||de.status==="created"?"待支付":"已失败",de.status==="refunded"&&de.refundReason?de.refundReason:"-",de.referrerEarnings?Number(de.referrerEarnings).toFixed(2):"-",de.createdAt?new Date(de.createdAt).toLocaleString("zh-CN"):""].join(",")}),O="\uFEFF"+[W.join(","),...M].join(` +`),L=new Blob([O],{type:"text/csv;charset=utf-8"}),X=URL.createObjectURL(L),K=document.createElement("a");K.href=X,K.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,K.click(),URL.revokeObjectURL(X)}return e.jsxs("div",{className:"p-8 w-full",children:[Q&&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:Q}),e.jsx("button",{type:"button",onClick:()=>Z(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:G,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:["¥",y.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:W=>b(W.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:W=>E(W.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"created",children:"已创建"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsxs(J,{variant:"outline",onClick:ne,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(hb,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:j?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(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(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(ps,{children:[r.map(W=>{const M=ie(W);return e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(pe,{className:"font-mono text-xs text-gray-400",children:[(W.orderSn||W.id||"").slice(0,12),"..."]}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:re(W)}),e.jsx("p",{className:"text-gray-500 text-xs",children:H(W.userId)})]})}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[M.name,(W.productType||W.type)==="vip"&&e.jsx(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:M.type})]})}),e.jsxs(pe,{className:"text-[#38bdac] font-bold",children:["¥",Number(W.amount||0).toFixed(2)]}),e.jsx(pe,{className:"text-gray-300",children:W.paymentMethod==="wechat"?"微信支付":W.paymentMethod==="alipay"?"支付宝":W.paymentMethod||"微信支付"}),e.jsx(pe,{children:W.status==="refunded"?e.jsx(Le,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):W.status==="paid"||W.status==="completed"?e.jsx(Le,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):W.status==="pending"||W.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(pe,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:W.refundReason,children:W.status==="refunded"&&W.refundReason?W.refundReason:"-"}),e.jsx(pe,{className:"text-[#FFD700]",children:W.referrerEarnings?`¥${Number(W.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(pe,{className:"text-gray-400 text-sm",children:new Date(W.createdAt).toLocaleString("zh-CN")}),e.jsx(pe,{children:(W.status==="paid"||W.status==="completed")&&e.jsxs(J,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{I(W),U("")},children:[e.jsx(Jx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},W.id)}),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Qs,{page:p,totalPages:ve,total:c,pageSize:k,onPageChange:v,onPageSizeChange:W=>{P(W),v(1)}})]})})}),e.jsx(Ct,{open:!!A,onOpenChange:W=>!W&&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:"订单退款"})}),A&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",A.orderSn||A.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(A.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:W=>U(W.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:z,disabled:se,children:se?"退款中...":"确认退款"})]})]})})]})}var m2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],f2=m2.reduce((r,a)=>{const l=ep(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:m,...f}=c,y=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(y,{...f,ref:u})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{}),x2="Label",Kp=h.forwardRef((r,a)=>e.jsx(f2.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())}}));Kp.displayName=x2;var Gp=Kp;const te=h.forwardRef(({className:r,...a},l)=>e.jsx(Gp,{ref:l,className:lt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));te.displayName=Gp.displayName;function _u(r){const a=r+"CollectionProvider",[l,o]=yn(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),m=b=>{const{scope:N,children:C}=b,E=tn.useRef(null),j=tn.useRef(new Map).current;return e.jsx(c,{scope:N,itemMap:j,collectionRef:E,children:C})};m.displayName=a;const f=r+"CollectionSlot",y=Dl(f),g=tn.forwardRef((b,N)=>{const{scope:C,children:E}=b,j=u(f,C),R=at(N,j.collectionRef);return e.jsx(y,{ref:R,children:E})});g.displayName=f;const p=r+"CollectionItemSlot",v="data-radix-collection-item",k=Dl(p),P=tn.forwardRef((b,N)=>{const{scope:C,children:E,...j}=b,R=tn.useRef(null),Q=at(N,R),Z=u(p,C);return tn.useEffect(()=>(Z.itemMap.set(R,{ref:R,...j}),()=>void Z.itemMap.delete(R))),e.jsx(k,{[v]:"",ref:Q,children:E})});P.displayName=p;function T(b){const N=u(r+"CollectionConsumer",b);return tn.useCallback(()=>{const E=N.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${v}]`));return Array.from(N.itemMap.values()).sort((Z,A)=>j.indexOf(Z.ref.current)-j.indexOf(A.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:m,Slot:g,ItemSlot:P},T,o]}var p2=h.createContext(void 0);function Eo(r){const a=h.useContext(p2);return r||a||"ltr"}var Od="rovingFocusGroup.onEntryFocus",g2={bubbles:!1,cancelable:!0},zl="RovingFocusGroup",[tu,Yp,y2]=_u(zl),[v2,Qp]=yn(zl,[y2]),[j2,b2]=v2(zl),qp=h.forwardRef((r,a)=>e.jsx(tu.Provider,{scope:r.__scopeRovingFocusGroup,children:e.jsx(tu.Slot,{scope:r.__scopeRovingFocusGroup,children:e.jsx(N2,{...r,ref:a})})}));qp.displayName=zl;var N2=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:u,currentTabStopId:m,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:y,onEntryFocus:g,preventScrollOnEntryFocus:p=!1,...v}=r,k=h.useRef(null),P=at(a,k),T=Eo(u),[b,N]=Vn({prop:m,defaultProp:f??null,onChange:y,caller:zl}),[C,E]=h.useState(!1),j=hn(g),R=Yp(l),Q=h.useRef(!1),[Z,A]=h.useState(0);return h.useEffect(()=>{const I=k.current;if(I)return I.addEventListener(Od,j),()=>I.removeEventListener(Od,j)},[j]),e.jsx(j2,{scope:l,orientation:o,dir:T,loop:c,currentTabStopId:b,onItemFocus:h.useCallback(I=>N(I),[N]),onItemShiftTab:h.useCallback(()=>E(!0),[]),onFocusableItemAdd:h.useCallback(()=>A(I=>I+1),[]),onFocusableItemRemove:h.useCallback(()=>A(I=>I-1),[]),children:e.jsx(Xe.div,{tabIndex:C||Z===0?-1:0,"data-orientation":o,...v,ref:P,style:{outline:"none",...r.style},onMouseDown:Ge(r.onMouseDown,()=>{Q.current=!0}),onFocus:Ge(r.onFocus,I=>{const w=!Q.current;if(I.target===I.currentTarget&&w&&!C){const U=new CustomEvent(Od,g2);if(I.currentTarget.dispatchEvent(U),!U.defaultPrevented){const se=R().filter(ie=>ie.focusable),le=se.find(ie=>ie.active),G=se.find(ie=>ie.id===b),H=[le,G,...se].filter(Boolean).map(ie=>ie.ref.current);Zp(H,p)}}Q.current=!1}),onBlur:Ge(r.onBlur,()=>E(!1))})})}),Xp="RovingFocusGroupItem",Jp=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:u,children:m,...f}=r,y=dn(),g=u||y,p=b2(Xp,l),v=p.currentTabStopId===g,k=Yp(l),{onFocusableItemAdd:P,onFocusableItemRemove:T,currentTabStopId:b}=p;return h.useEffect(()=>{if(o)return P(),()=>T()},[o,P,T]),e.jsx(tu.ItemSlot,{scope:l,id:g,focusable:o,active:c,children:e.jsx(Xe.span,{tabIndex:v?0:-1,"data-orientation":p.orientation,...f,ref:a,onMouseDown:Ge(r.onMouseDown,N=>{o?p.onItemFocus(g):N.preventDefault()}),onFocus:Ge(r.onFocus,()=>p.onItemFocus(g)),onKeyDown:Ge(r.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){p.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const C=C2(N,p.orientation,p.dir);if(C!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.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(N.currentTarget);j=p.loop?k2(j,R+1):j.slice(R+1)}setTimeout(()=>Zp(j))}}),children:typeof m=="function"?m({isCurrentTabStop:v,hasTabStop:b!=null}):m})})});Jp.displayName=Xp;var w2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function S2(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function C2(r,a,l){const o=S2(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return w2[o]}function Zp(r,a=!1){const l=document.activeElement;for(const o of r)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function k2(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var E2=qp,P2=Jp,Po="Tabs",[T2]=yn(Po,[Qp]),e0=Qp(),[R2,Mu]=T2(Po),t0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:u,orientation:m="horizontal",dir:f,activationMode:y="automatic",...g}=r,p=Eo(f),[v,k]=Vn({prop:o,onChange:c,defaultProp:u??"",caller:Po});return e.jsx(R2,{scope:l,baseId:dn(),value:v,onValueChange:k,orientation:m,dir:p,activationMode:y,children:e.jsx(Xe.div,{dir:p,"data-orientation":m,...g,ref:a})})});t0.displayName=Po;var s0="TabsList",r0=h.forwardRef((r,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=r,u=Mu(s0,l),m=e0(l);return e.jsx(E2,{asChild:!0,...m,orientation:u.orientation,dir:u.dir,loop:o,children:e.jsx(Xe.div,{role:"tablist","aria-orientation":u.orientation,...c,ref:a})})});r0.displayName=s0;var n0="TabsTrigger",a0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...u}=r,m=Mu(n0,l),f=e0(l),y=o0(m.baseId,o),g=c0(m.baseId,o),p=o===m.value;return e.jsx(P2,{asChild:!0,...f,focusable:!c,active:p,children:e.jsx(Xe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":g,"data-state":p?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:y,...u,ref:a,onMouseDown:Ge(r.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?m.onValueChange(o):v.preventDefault()}),onKeyDown:Ge(r.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&m.onValueChange(o)}),onFocus:Ge(r.onFocus,()=>{const v=m.activationMode!=="manual";!p&&!c&&v&&m.onValueChange(o)})})})});a0.displayName=n0;var l0="TabsContent",i0=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:u,...m}=r,f=Mu(l0,l),y=o0(f.baseId,o),g=c0(f.baseId,o),p=o===f.value,v=h.useRef(p);return h.useEffect(()=>{const k=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(k)},[]),e.jsx(Fl,{present:c||p,children:({present:k})=>e.jsx(Xe.div,{"data-state":p?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":y,hidden:!k,id:g,tabIndex:0,...m,ref:a,style:{...r.style,animationDuration:v.current?"0s":void 0},children:k&&u})})});i0.displayName=l0;function o0(r,a){return`${r}-trigger-${a}`}function c0(r,a){return`${r}-content-${a}`}var I2=t0,d0=r0,u0=a0,h0=i0;const $l=I2,Ba=h.forwardRef(({className:r,...a},l)=>e.jsx(d0,{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=d0.displayName;const Lt=h.forwardRef(({className:r,...a},l)=>e.jsx(u0,{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=u0.displayName;const Ot=h.forwardRef(({className:r,...a},l)=>e.jsx(h0,{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=h0.displayName;function Au(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 Du(r){const[a,l]=h.useState(void 0);return Zt(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let m,f;if("borderBoxSize"in u){const y=u.borderBoxSize,g=Array.isArray(y)?y[0]:y;m=g.inlineSize,f=g.blockSize}else m=r.offsetWidth,f=r.offsetHeight;l({width:m,height:f})});return o.observe(r,{box:"border-box"}),()=>o.unobserve(r)}else l(void 0)},[r]),a}var To="Switch",[_2]=yn(To),[M2,A2]=_2(To),m0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:u,required:m,disabled:f,value:y="on",onCheckedChange:g,form:p,...v}=r,[k,P]=h.useState(null),T=at(a,j=>P(j)),b=h.useRef(!1),N=k?p||!!k.closest("form"):!0,[C,E]=Vn({prop:c,defaultProp:u??!1,onChange:g,caller:To});return e.jsxs(M2,{scope:l,checked:C,disabled:f,children:[e.jsx(Xe.button,{type:"button",role:"switch","aria-checked":C,"aria-required":m,"data-state":g0(C),"data-disabled":f?"":void 0,disabled:f,value:y,...v,ref:T,onClick:Ge(r.onClick,j=>{E(R=>!R),N&&(b.current=j.isPropagationStopped(),b.current||j.stopPropagation())})}),N&&e.jsx(p0,{control:k,bubbles:!b.current,name:o,value:y,checked:C,required:m,disabled:f,form:p,style:{transform:"translateX(-100%)"}})]})});m0.displayName=To;var f0="SwitchThumb",x0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,...o}=r,c=A2(f0,l);return e.jsx(Xe.span,{"data-state":g0(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});x0.displayName=f0;var D2="SwitchBubbleInput",p0=h.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:o=!0,...c},u)=>{const m=h.useRef(null),f=at(m,u),y=Au(l),g=Du(a);return h.useEffect(()=>{const p=m.current;if(!p)return;const v=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(v,"checked").set;if(y!==l&&P){const T=new Event("click",{bubbles:o});P.call(p,l),p.dispatchEvent(T)}},[y,l,o]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:f,style:{...c.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});p0.displayName=D2;function g0(r){return r?"checked":"unchecked"}var y0=m0,L2=x0;const ot=h.forwardRef(({className:r,...a},l)=>e.jsx(y0,{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(L2,{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=y0.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 v0({open:r,onClose:a,userId:l,onUserUpdated:o}){var ze;const[c,u]=h.useState(null),[m,f]=h.useState([]),[y,g]=h.useState([]),[p,v]=h.useState(!1),[k,P]=h.useState(!1),[T,b]=h.useState(!1),[N,C]=h.useState("info"),[E,j]=h.useState(""),[R,Q]=h.useState(""),[Z,A]=h.useState([]),[I,w]=h.useState(""),[U,se]=h.useState(!1),[le,G]=h.useState(null),[re,H]=h.useState(null),[ie,ve]=h.useState(""),[z,ne]=h.useState(""),[W,M]=h.useState(""),[O,L]=h.useState(!1),[X,K]=h.useState(null),[de,Y]=h.useState("");h.useEffect(()=>{r&&l&&(C("info"),G(null),H(null),K(null),Y(""),ge())},[r,l]);async function ge(){if(l){v(!0);try{const he=await $e(`/api/db/users?id=${encodeURIComponent(l)}`);if(he!=null&&he.success&&he.user){const xe=he.user;u(xe),j(xe.phone||""),Q(xe.nickname||""),ve(xe.phone||""),ne(xe.wechatId||""),M(xe.openId||"");try{A(typeof xe.tags=="string"?JSON.parse(xe.tags||"[]"):[])}catch{A([])}}try{const xe=await $e(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);xe!=null&&xe.success&&xe.tracks&&f(xe.tracks)}catch{f([])}try{const xe=await $e(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);xe!=null&&xe.success&&xe.referrals&&g(xe.referrals)}catch{g([])}}catch(he){console.error("Load user detail error:",he)}finally{v(!1)}}}async function Se(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}P(!0);try{const he=await mt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});he!=null&&he.success?(alert("同步成功"),ge()):alert("同步失败: "+(he==null?void 0:he.error))}catch(he){console.error("Sync CKB error:",he),alert("同步失败")}finally{P(!1)}}async function D(){if(c){b(!0);try{const he={id:c.id,phone:E||void 0,nickname:R||void 0,tags:JSON.stringify(Z)},xe=await vt("/api/db/users",he);xe!=null&&xe.success?(alert("保存成功"),ge(),o==null||o()):alert("保存失败: "+(xe==null?void 0:xe.error))}catch(he){console.error("Save user error:",he),alert("保存失败")}finally{b(!1)}}}const fe=()=>{I&&!Z.includes(I)&&(A([...Z,I]),w(""))},ke=he=>A(Z.filter(xe=>xe!==he));async function Ve(){if(!ie&&!W&&!z){H("请至少输入手机号、微信号或 OpenID 中的一项");return}se(!0),H(null),G(null);try{const he=new URLSearchParams;ie&&he.set("phone",ie),W&&he.set("openId",W),z&&he.set("wechatId",z);const xe=await $e(`/api/admin/shensheshou/query?${he}`);xe!=null&&xe.success&&xe.data?(G(xe.data),c&&await We(xe.data)):H((xe==null?void 0:xe.error)||"未查询到数据,该用户可能未在神射手收录")}catch(he){console.error("SSS query error:",he),H("请求失败,请检查神射手接口配置")}finally{se(!1)}}async function We(he){if(c)try{await mt("/api/admin/shensheshou/enrich",{userId:c.id,phone:ie||c.phone||"",openId:W||c.openId||"",wechatId:z||c.wechatId||""}),ge()}catch(xe){console.error("SSS enrich error:",xe)}}async function Ke(){if(c){L(!0),K(null);try{const he={users:[{phone:c.phone||"",name:c.nickname||"",openId:c.openId||"",tags:Z}]},xe=await mt("/api/admin/shensheshou/ingest",he);xe!=null&&xe.success&&xe.data?K(xe.data):K({error:(xe==null?void 0:xe.error)||"推送失败"})}catch(he){console.error("SSS ingest error:",he),K({error:"请求失败"})}finally{L(!1)}}}const tt=he=>{const ft={view_chapter:qs,purchase:qd,match:Kt,login:Ia,register:Ia,share:Pr,bind_phone:Jb,bind_wechat:Wb,fill_profile:Ed,visit_page:Ta}[he]||Yd;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"})]})}),p?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:""}):((ze=c.nickname)==null?void 0:ze.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:N,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:he=>j(he.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:he=>Q(he.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(Xx,{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:he=>Y(he.target.value)}),e.jsxs(J,{size:"sm",onClick:async()=>{if(!(!de||!c))try{await vt("/api/db/users",{id:c.id,wechatId:de}),alert("已保存微信归属"),ge()}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(Mt,{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(Gd,{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(he=>e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1.5",children:he.category}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:he.tags.map(xe=>e.jsxs("button",{type:"button",onClick:()=>{Z.includes(xe)?ke(xe):A([...Z,xe])},className:`px-2 py-0.5 rounded text-xs border transition-all ${Z.includes(xe)?"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:[Z.includes(xe)?"✓ ":"",xe]},xe))})]},he.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:[Z.map((he,xe)=>e.jsxs(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[he,e.jsx("button",{type:"button",onClick:()=>ke(he),className:"ml-1 hover:text-red-400",children:e.jsx(ms,{className:"w-3 h-3"})})]},xe)),Z.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:he=>w(he.target.value),onKeyDown:he=>he.key==="Enter"&&fe()}),e.jsx(J,{onClick:fe,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((he,xe)=>e.jsx(Le,{className:"bg-purple-500/20 text-purple-400 border-0",children:he.trim()},xe))})]})]}),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((he,xe)=>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(he.action)}),xe0?y.map((he,xe)=>{var es;const ft=he;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||xe)}):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:ie,onChange:he=>ve(he.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:z,onChange:he=>ne(he.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:W,onChange:he=>M(he.target.value)})]})]}),e.jsx(J,{onClick:Ve,disabled:U,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:U?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:"查询成功后,神射手返回的标签将自动同步到该用户"}),re&&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:re}),le&&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:le.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:le.user_level??"-"})]})]}),le.tags&&le.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:le.tags.map((he,xe)=>e.jsx(Le,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/20",children:he},xe))})]}),le.last_active&&e.jsxs("div",{className:"text-sm text-gray-500",children:["最近活跃:",le.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:O||!c.phone,variant:"outline",className:"border-purple-500/40 text-purple-400 hover:bg-purple-500/10 bg-transparent shrink-0 ml-4",children:O?e.jsxs(e.Fragment,{children:[e.jsx(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:"⚠ 用户未绑定手机号,无法推送"}),X&&e.jsx("div",{className:"mt-3 p-3 bg-[#162840] rounded-lg text-sm",children:X.error?e.jsx("p",{className:"text-red-400",children:String(X.error)}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-green-400 flex items-center gap-1",children:[e.jsx(Gd,{className:"w-4 h-4"})," 推送成功"]}),X.enriched!==void 0&&e.jsxs("p",{className:"text-gray-400",children:["自动补全标签数:",String(X.new_tags_added??0)]})]})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-3 border-t border-gray-700 mt-3",children:[e.jsxs(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:D,disabled:T,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{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 O2({open:r,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[u,m]=h.useState(Fd),[f,y]=h.useState([]),[g,p]=h.useState(!1),[v,k]=h.useState(!1);h.useEffect(()=>{if(!r){m(Fd);return}let T=!1;return p(!0),Promise.all([$e("/api/db/vip-roles"),l?$e(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([b,N])=>{if(T)return;const C=b!=null&&b.success&&b.data?b.data:[];y(C);const E=N&&N.user?N.user:null;if(E){const j=String(E.vipRole??""),R=C.some(Q=>Q.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(Fd)}).catch(b=>{T||console.error("Load error:",b)}).finally(()=>{T||p(!1)}),()=>{T=!0}},[r,l]);async function P(){if(l){if(u.isVip&&!u.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(u.isVip&&u.vipExpireDate.trim()){const T=new Date(u.vipExpireDate);if(isNaN(T.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}k(!0);try{const T=u.vipRole==="__custom__"?u.vipRoleCustom.trim():u.vipRole,b={id:l,isVip:u.isVip,vipExpireDate:u.isVip?u.vipExpireDate:void 0,vipSort:u.vipSort===""?void 0:u.vipSort,vipRole:T||void 0,vipName:u.vipName||void 0,vipProject:u.vipProject||void 0,vipContact:u.vipContact||void 0,vipBio:u.vipBio||void 0},N=await vt("/api/db/users",b);N!=null&&N.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(N==null?void 0:N.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 - ",o||l]})}),g?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:u.isVip,onCheckedChange:T=>m(b=>({...b,isVip:T}))})]}),u.isVip&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(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:u.vipExpireDate,onChange:T=>m(b=>({...b,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:u.vipSort===""?"":u.vipSort,onChange:T=>{const b=T.target.value;m(N=>({...N,vipSort:b===""?"":parseInt(b,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:u.vipRole,onChange:T=>m(b=>({...b,vipRole:T.target.value})),children:[e.jsx("option",{value:"",children:"请选择或下方手动填写"}),f.map(T=>e.jsx("option",{value:T.name,children:T.name},T.id)),e.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),u.vipRole==="__custom__"&&e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:u.vipRoleCustom,onChange:T=>m(b=>({...b,vipRoleCustom:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:u.vipName,onChange:T=>m(b=>({...b,vipName:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"项目/公司"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:u.vipProject,onChange:T=>m(b=>({...b,vipProject:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"联系方式"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:u.vipContact,onChange:T=>m(b=>({...b,vipContact:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"一句话简介"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:u.vipBio,onChange:T=>m(b=>({...b,vipBio:T.target.value}))})]})]}),e.jsxs(Dt,{children:[e.jsxs(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||g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{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 F2(){var as,En,er,xr,Pt;const[r,a]=Ux(),l=r.get("pool"),[o,c]=h.useState([]),[u,m]=h.useState(0),[f,y]=h.useState(1),[g,p]=h.useState(10),[v,k]=h.useState(""),P=Iu(v,300),T=l==="vip"?"vip":l==="complete"?"complete":"all",[b,N]=h.useState(T),[C,E]=h.useState(!0),[j,R]=h.useState(null),[Q,Z]=h.useState(!1),[A,I]=h.useState("desc");h.useEffect(()=>{l==="vip"?N("vip"):l==="complete"?N("complete"):l==="all"&&N("all")},[l]);const[w,U]=h.useState(!1),[se,le]=h.useState(!1),[G,re]=h.useState(null),[H,ie]=h.useState(""),[ve,z]=h.useState(""),[ne,W]=h.useState(!1),[M,O]=h.useState(!1),[L,X]=h.useState({referrals:[],stats:{}}),[K,de]=h.useState(!1),[Y,ge]=h.useState(null),[Se,D]=h.useState(!1),[fe,ke]=h.useState(null),[Ve,We]=h.useState(!1),[Ke,tt]=h.useState(null),[ze,he]=h.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),[xe,ft]=h.useState([]),[es,hr]=h.useState(!1),[bn,As]=h.useState(!1),[Bt,Mr]=h.useState(null),[ct,gs]=h.useState({title:"",description:"",trigger:"",sort:0,enabled:!0}),[Nn,mr]=h.useState([]),[Cs,Yn]=h.useState(!1),[Qn,ks]=h.useState(!1),[wn,fr]=h.useState(null),[ys,Ds]=h.useState({name:"",sort:0}),[Ls,Sn]=h.useState({}),[Es,Os]=h.useState(!1);async function Fs(){var $;E(!0),R(null);try{if(Q){const He=new URLSearchParams({search:P,limit:String(g*5)}),Je=await $e(`/api/db/users/rfm?${He}`);if(Je!=null&&Je.success){let ls=Je.users||[];A==="asc"&&(ls=[...ls].reverse());const dt=(f-1)*g;c(ls.slice(dt,dt+g)),m((($=Je.users)==null?void 0:$.length)??0),ls.length===0&&(Z(!1),R("暂无订单数据,RFM 排序需要用户有购买记录后才能生效"))}else Z(!1),R((Je==null?void 0:Je.error)||"RFM 加载失败,已切回普通模式")}else{const He=new URLSearchParams({page:String(f),pageSize:String(g),search:P,...b==="vip"&&{vip:"true"},...b==="complete"&&{pool:"complete"}}),Je=await $e(`/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(()=>{y(1)},[P,b,Q]),h.useEffect(()=>{Fs()},[f,g,P,b,Q,A]);const qn=Math.ceil(u/g)||1,Xn=()=>{Q?A==="desc"?I("asc"):(Z(!1),I("desc")):(Z(!0),I("desc"))},Jn=$=>({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"})[$||""]||"bg-gray-500/20 text-gray-400";async function Zn($){if(confirm("确定要删除这个用户吗?"))try{const He=await Tr(`/api/db/users?id=${encodeURIComponent($)}`);He!=null&&He.success?Fs():alert("删除失败: "+((He==null?void 0:He.error)||""))}catch{alert("删除失败")}}const Cn=$=>{re($),he({phone:$.phone||"",nickname:$.nickname||"",password:"",isAdmin:!!($.isAdmin??!1),hasFullBook:!!($.hasFullBook??!1)}),U(!0)},kn=()=>{re(null),he({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),U(!0)};async function zs(){if(!ze.phone||!ze.nickname){alert("请填写手机号和昵称");return}W(!0);try{if(G){const $=await vt("/api/db/users",{id:G.id,nickname:ze.nickname,isAdmin:ze.isAdmin,hasFullBook:ze.hasFullBook,...ze.password&&{password:ze.password}});if(!($!=null&&$.success)){alert("更新失败: "+(($==null?void 0:$.error)||""));return}}else{const $=await mt("/api/db/users",{phone:ze.phone,nickname:ze.nickname,password:ze.password,isAdmin:ze.isAdmin});if(!($!=null&&$.success)){alert("创建失败: "+(($==null?void 0:$.error)||""));return}}U(!1),Fs()}catch{alert("保存失败")}finally{W(!1)}}const Ar=$=>{re($),ie(""),z(""),le(!0)};async function $s($){ge($),O(!0),de(!0);try{const He=await $e(`/api/db/users/referrals?userId=${encodeURIComponent($.id)}`);He!=null&&He.success?X({referrals:He.referrals||[],stats:He.stats||{}}):X({referrals:[],stats:{}})}catch{X({referrals:[],stats:{}})}finally{de(!1)}}async function ea(){if(!H){alert("请输入新密码");return}if(H!==ve){alert("两次密码不一致");return}if(H.length<6){alert("密码至少6位");return}W(!0);try{const $=await vt("/api/db/users",{id:G==null?void 0:G.id,password:H});$!=null&&$.success?(alert("修改成功"),le(!1)):alert("修改失败: "+(($==null?void 0:$.error)||""))}catch{alert("修改失败")}finally{W(!1)}}const ts=h.useCallback(async()=>{hr(!0);try{const $=await $e("/api/db/user-rules");$!=null&&$.success&&ft($.rules||[])}catch{}finally{hr(!1)}},[]);async function F(){if(!ct.title){alert("请填写规则标题");return}W(!0);try{if(Bt){const $=await vt("/api/db/user-rules",{id:Bt.id,...ct});if(!($!=null&&$.success)){alert("更新失败: "+(($==null?void 0:$.error)||""));return}}else{const $=await mt("/api/db/user-rules",ct);if(!($!=null&&$.success)){alert("创建失败: "+(($==null?void 0:$.error)||""));return}}As(!1),ts()}catch{alert("保存失败")}finally{W(!1)}}async function ce($){if(confirm("确定删除?"))try{const He=await Tr(`/api/db/user-rules?id=${$}`);He!=null&&He.success&&ts()}catch{}}async function Ce($){try{await vt("/api/db/user-rules",{id:$.id,enabled:!$.enabled}),ts()}catch{}}const Ee=h.useCallback(async()=>{Yn(!0);try{const $=await $e("/api/db/vip-roles");$!=null&&$.success&&mr($.roles||[])}catch{}finally{Yn(!1)}},[]);async function xt(){if(!ys.name){alert("请填写角色名称");return}W(!0);try{if(wn){const $=await vt("/api/db/vip-roles",{id:wn.id,...ys});if(!($!=null&&$.success)){alert("更新失败");return}}else{const $=await mt("/api/db/vip-roles",ys);if(!($!=null&&$.success)){alert("创建失败");return}}ks(!1),Ee()}catch{alert("保存失败")}finally{W(!1)}}async function ns($){if(confirm("确定删除?"))try{const He=await Tr(`/api/db/vip-roles?id=${$}`);He!=null&&He.success&&Ee()}catch{}}const nt=h.useCallback(async()=>{Os(!0);try{const $=await $e("/api/db/users/journey-stats");$!=null&&$.success&&$.stats&&Sn($.stats)}catch{}finally{Os(!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:["共 ",u," 位注册用户",Q&&" · 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(Bn,{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:b,onChange:$=>{const He=$.target.value;N(He),y(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:Q,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:$=>k($.target.value)})]}),e.jsxs(J,{onClick:kn,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Xd,{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(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: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分值"}),Q?A==="desc"?e.jsx(Ml,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Wx,{className:"w-3.5 h-3.5 text-[#38bdac]"}):e.jsx(Vj,{className:"w-3.5 h-3.5 text-gray-600 group-hover:text-gray-400"})]}),Q&&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(ps,{children:[o.map($=>{var He,Je,ls;return e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:$.avatar?e.jsx("img",{src:$.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((He=$.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:$.nickname}),$.isAdmin&&e.jsx(Le,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),$.openId&&!((Je=$.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:$.openId?$.openId.slice(0,12)+"...":(ls=$.id)==null?void 0:ls.slice(0,12)})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"space-y-1",children:[$.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:$.phone})]}),$.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:$.wechatId})]}),$.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:$.openId,children:[$.openId.slice(0,12),"..."]})]}),!$.phone&&!$.wechatId&&!$.openId&&e.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),e.jsx(pe,{children:$.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(pe,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String($.earnings||0)).toFixed(2)]}),parseFloat(String($.pendingEarnings||0))>0&&e.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String($.pendingEarnings||0)).toFixed(2)]}),e.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>$s($),role:"button",tabIndex:0,onKeyDown:dt=>dt.key==="Enter"&&$s($),children:[e.jsx(Kt,{className:"w-3 h-3"})," 绑定",$.referralCount||0,"人"]})]})}),e.jsx(pe,{children:$.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:$.rfmScore}),e.jsx(Le,{className:`border-0 text-xs ${Jn($.rfmLevel)}`,children:$.rfmLevel})]})}):e.jsxs("span",{className:"text-gray-600 text-sm",children:["— ",e.jsx("span",{className:"text-xs text-gray-700",children:"点列头排序"})]})}),e.jsx(pe,{className:"text-gray-400",children:$.createdAt?new Date($.createdAt).toLocaleDateString():"-"}),e.jsx(pe,{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($),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($.id),D(!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:()=>Cn($),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>Ar($),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx($f,{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($.id),title:"删除",children:e.jsx(Ht,{className:"w-4 h-4"})})]})})]},$.id)}),o.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Qs,{page:f,totalPages:qn,total:u,pageSize:g,onPageChange:y,onPageSizeChange:$=>{p($),y(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(($,He)=>e.jsxs("div",{className:"relative flex flex-col items-center",children:[e.jsxs("div",{className:`relative w-full p-3 rounded-xl border ${$.color} text-center cursor-default`,children:[e.jsx("div",{className:"text-2xl mb-1",children:$.icon}),e.jsx("div",{className:`text-xs font-medium ${$.color.split(" ").find(Je=>Je.startsWith("text-"))}`,children:$.label}),Ls[$.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[$.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:$.step}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-300",children:$.action}),e.jsxs("p",{className:"text-gray-600 text-xs",children:["→ ",$.next]})]})]},$.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($=>{const He=Ls[$.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:[$.icon," ",$.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})]},$.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"})}):xe.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:xe.map($=>e.jsx("div",{className:`p-4 rounded-lg border transition-all ${$.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(ht,{className:"w-4 h-4 text-[#38bdac] shrink-0"}),e.jsx("span",{className:"text-white font-medium",children:$.title}),$.trigger&&e.jsxs(Le,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/30 text-xs",children:["触发:",$.trigger]}),e.jsx(Le,{className:`text-xs border-0 ${$.enabled?"bg-green-500/20 text-green-400":"bg-gray-500/20 text-gray-400"}`,children:$.enabled?"启用":"禁用"})]}),$.description&&e.jsx("p",{className:"text-gray-400 text-sm ml-6",children:$.description})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4 shrink-0",children:[e.jsx(ot,{checked:$.enabled,onCheckedChange:()=>Ce($)}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>{Mr($),gs({title:$.title,description:$.description,trigger:$.trigger,sort:$.sort,enabled:$.enabled}),As(!0)},className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>ce($.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]})},$.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"})}):Nn.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:Nn.map($=>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:$.name})]}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{type:"button",onClick:()=>{fr($),Ds({name:$.name,sort:$.sort}),ks(!0)},className:"text-gray-500 hover:text-[#38bdac]",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>ns($.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:["排序: ",$.sort]})]},$.id))})]})]}),e.jsx(Ct,{open:w,onOpenChange:U,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:[G?e.jsx(ht,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Xd,{className:"w-5 h-5 text-[#38bdac]"}),G?"编辑用户":"添加用户"]})}),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:ze.phone,onChange:$=>he({...ze,phone:$.target.value}),disabled:!!G})]}),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:ze.nickname,onChange:$=>he({...ze,nickname:$.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:G?"新密码 (留空则不修改)":"密码"}),e.jsx(oe,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:G?"留空则不修改":"请输入密码",value:ze.password,onChange:$=>he({...ze,password:$.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"管理员权限"}),e.jsx(ot,{checked:ze.isAdmin,onCheckedChange:$=>he({...ze,isAdmin:$})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"已购全书"}),e.jsx(ot,{checked:ze.hasFullBook,onCheckedChange:$=>he({...ze,hasFullBook:$})})]})]}),e.jsxs(Dt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>U(!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:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),ne?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:se,onOpenChange:le,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($f,{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:["用户:",G==null?void 0:G.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",G==null?void 0:G.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:H,onChange:$=>ie($.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:ve,onChange:$=>z($.target.value)})]})]}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>le(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:ea,disabled:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ne?"保存中...":"确认修改"})]})]})}),e.jsx(Ct,{open:bn,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(ht,{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:$=>gs({...ct,title:$.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:$=>gs({...ct,description:$.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:$=>gs({...ct,trigger:$.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:$=>gs({...ct,enabled:$})})]})]}),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:F,disabled:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),ne?"保存中...":"保存"]})]})]})}),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"}),wn?"编辑 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:$=>Ds({...ys,name:$.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:$=>Ds({...ys,sort:parseInt($.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:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),ne?"保存中...":"保存"]})]})]})}),e.jsx(Ct,{open:M,onOpenChange:O,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]"}),"绑定关系 - ",Y==null?void 0:Y.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=L.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:((En=L.stats)==null?void 0:En.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=L.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=L.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=L.referrals)==null?void 0:Pt.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(L.referrals??[]).map(($,He)=>{var ls;const Je=$;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:()=>O(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),e.jsx(v0,{open:Se,onClose:()=>D(!1),userId:fe,onUserUpdated:Fs}),e.jsx(O2,{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"],b0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],N0={"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",[su,z2,$2]=_u(Ua),[w0]=yn(Ua,[$2]),[B2,Ro]=w0(Ua),S0=h.forwardRef((r,a)=>{const{name:l,min:o=0,max:c=100,step:u=1,orientation:m="horizontal",disabled:f=!1,minStepsBetweenThumbs:y=0,defaultValue:g=[o],value:p,onValueChange:v=()=>{},onValueCommit:k=()=>{},inverted:P=!1,form:T,...b}=r,N=h.useRef(new Set),C=h.useRef(0),j=m==="horizontal"?U2:V2,[R=[],Q]=Vn({prop:p,defaultProp:g,onChange:se=>{var G;(G=[...N.current][C.current])==null||G.focus(),v(se)}}),Z=h.useRef(R);function A(se){const le=Y2(R,se);U(se,le)}function I(se){U(se,C.current)}function w(){const se=Z.current[C.current];R[C.current]!==se&&k(R)}function U(se,le,{commit:G}={commit:!1}){const re=J2(u),H=Z2(Math.round((se-o)/u)*u+o,re),ie=xo(H,[o,c]);Q((ve=[])=>{const z=K2(ve,ie,le);if(X2(z,y*u)){C.current=z.indexOf(ie);const ne=String(z)!==String(ve);return ne&&G&&k(z),ne?z:ve}else return ve})}return e.jsx(B2,{scope:r.__scopeSlider,name:l,disabled:f,min:o,max:c,valueIndexToChangeRef:C,thumbs:N.current,values:R,orientation:m,form:T,children:e.jsx(su.Provider,{scope:r.__scopeSlider,children:e.jsx(su.Slot,{scope:r.__scopeSlider,children:e.jsx(j,{"aria-disabled":f,"data-disabled":f?"":void 0,...b,ref:a,onPointerDown:Ge(b.onPointerDown,()=>{f||(Z.current=R)}),min:o,max:c,inverted:P,onSlideStart:f?void 0:A,onSlideMove:f?void 0:I,onSlideEnd:f?void 0:w,onHomeKeyDown:()=>!f&&U(o,0,{commit:!0}),onEndKeyDown:()=>!f&&U(c,R.length-1,{commit:!0}),onStepKeyDown:({event:se,direction:le})=>{if(!f){const H=j0.includes(se.key)||se.shiftKey&&b0.includes(se.key)?10:1,ie=C.current,ve=R[ie],z=u*H*le;U(ve+z,ie,{commit:!0})}}})})})})});S0.displayName=Ua;var[C0,k0]=w0(Ua,{startEdge:"left",endEdge:"right",size:"width",direction:1}),U2=h.forwardRef((r,a)=>{const{min:l,max:o,dir:c,inverted:u,onSlideStart:m,onSlideMove:f,onSlideEnd:y,onStepKeyDown:g,...p}=r,[v,k]=h.useState(null),P=at(a,j=>k(j)),T=h.useRef(void 0),b=Eo(c),N=b==="ltr",C=N&&!u||!N&&u;function E(j){const R=T.current||v.getBoundingClientRect(),Q=[0,R.width],A=Lu(Q,C?[l,o]:[o,l]);return T.current=R,A(j-R.left)}return e.jsx(C0,{scope:r.__scopeSlider,startEdge:C?"left":"right",endEdge:C?"right":"left",direction:C?1:-1,size:"width",children:e.jsx(E0,{dir:b,"data-orientation":"horizontal",...p,ref:P,style:{...p.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,y==null||y()},onStepKeyDown:j=>{const Q=N0[C?"from-left":"from-right"].includes(j.key);g==null||g({event:j,direction:Q?-1:1})}})})}),V2=h.forwardRef((r,a)=>{const{min:l,max:o,inverted:c,onSlideStart:u,onSlideMove:m,onSlideEnd:f,onStepKeyDown:y,...g}=r,p=h.useRef(null),v=at(a,p),k=h.useRef(void 0),P=!c;function T(b){const N=k.current||p.current.getBoundingClientRect(),C=[0,N.height],j=Lu(C,P?[o,l]:[l,o]);return k.current=N,j(b-N.top)}return e.jsx(C0,{scope:r.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:e.jsx(E0,{"data-orientation":"vertical",...g,ref:v,style:{...g.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const N=T(b.clientY);u==null||u(N)},onSlideMove:b=>{const N=T(b.clientY);m==null||m(N)},onSlideEnd:()=>{k.current=void 0,f==null||f()},onStepKeyDown:b=>{const C=N0[P?"from-bottom":"from-top"].includes(b.key);y==null||y({event:b,direction:C?-1:1})}})})}),E0=h.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:u,onHomeKeyDown:m,onEndKeyDown:f,onStepKeyDown:y,...g}=r,p=Ro(Ua,l);return e.jsx(Xe.span,{...g,ref:a,onKeyDown:Ge(r.onKeyDown,v=>{v.key==="Home"?(m(v),v.preventDefault()):v.key==="End"?(f(v),v.preventDefault()):j0.concat(b0).includes(v.key)&&(y(v),v.preventDefault())}),onPointerDown:Ge(r.onPointerDown,v=>{const k=v.target;k.setPointerCapture(v.pointerId),v.preventDefault(),p.thumbs.has(k)?k.focus():o(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),u(v))})})}),P0="SliderTrack",T0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Ro(P0,l);return e.jsx(Xe.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});T0.displayName=P0;var ru="SliderRange",R0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Ro(ru,l),u=k0(ru,l),m=h.useRef(null),f=at(a,m),y=c.values.length,g=c.values.map(k=>M0(k,c.min,c.max)),p=y>1?Math.min(...g):0,v=100-Math.max(...g);return e.jsx(Xe.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:f,style:{...r.style,[u.startEdge]:p+"%",[u.endEdge]:v+"%"}})});R0.displayName=ru;var nu="SliderThumb",I0=h.forwardRef((r,a)=>{const l=z2(r.__scopeSlider),[o,c]=h.useState(null),u=at(a,f=>c(f)),m=h.useMemo(()=>o?l().findIndex(f=>f.ref.current===o):-1,[l,o]);return e.jsx(W2,{...r,ref:u,index:m})}),W2=h.forwardRef((r,a)=>{const{__scopeSlider:l,index:o,name:c,...u}=r,m=Ro(nu,l),f=k0(nu,l),[y,g]=h.useState(null),p=at(a,E=>g(E)),v=y?m.form||!!y.closest("form"):!0,k=Du(y),P=m.values[o],T=P===void 0?0:M0(P,m.min,m.max),b=G2(o,m.values.length),N=k==null?void 0:k[f.size],C=N?Q2(N,T,f.direction):0;return h.useEffect(()=>{if(y)return m.thumbs.add(y),()=>{m.thumbs.delete(y)}},[y,m.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${T}% + ${C}px)`},children:[e.jsx(su.ItemSlot,{scope:r.__scopeSlider,children:e.jsx(Xe.span,{role:"slider","aria-label":r["aria-label"]||b,"aria-valuemin":m.min,"aria-valuenow":P,"aria-valuemax":m.max,"aria-orientation":m.orientation,"data-orientation":m.orientation,"data-disabled":m.disabled?"":void 0,tabIndex:m.disabled?void 0:0,...u,ref:p,style:P===void 0?{display:"none"}:r.style,onFocus:Ge(r.onFocus,()=>{m.valueIndexToChangeRef.current=o})})}),v&&e.jsx(_0,{name:c??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:P},o)]})});I0.displayName=nu;var H2="RadioBubbleInput",_0=h.forwardRef(({__scopeSlider:r,value:a,...l},o)=>{const c=h.useRef(null),u=at(c,o),m=Au(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const y=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(y,"value").set;if(m!==a&&p){const v=new Event("input",{bubbles:!0});p.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(Xe.input,{style:{display:"none"},...l,ref:u,defaultValue:a})});_0.displayName=H2;function K2(r=[],a,l){const o=[...r];return o[l]=a,o.sort((c,u)=>c-u)}function M0(r,a,l){const u=100/(l-a)*(r-a);return xo(u,[0,100])}function G2(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function Y2(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function Q2(r,a,l){const o=r/2,u=Lu([0,50],[0,o]);return(o-u(a)*l)*l}function q2(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function X2(r,a){if(a>0){const l=q2(r);return Math.min(...l)>=a}return!0}function Lu(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(r[1]-r[0]);return a[0]+o*(l-r[0])}}function J2(r){return(String(r).split(".")[1]||"").length}function Z2(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var e4=S0,t4=T0,s4=R0,r4=I0;function n4({className:r,defaultValue:a,value:l,min:o=0,max:c=100,...u}){const m=h.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return e.jsxs(e4,{defaultValue:a,value:l,min:o,max:c,className:lt("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...u,children:[e.jsx(t4,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:e.jsx(s4,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:m.length},(f,y)=>e.jsx(r4,{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"},y))]})}const a4={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function A0({embedded:r=!1}){const[a,l]=h.useState(a4),[o,c]=h.useState(!0),[u,m]=h.useState(!1);h.useEffect(()=>{$e("/api/admin/referral-settings").then(g=>{const p=g==null?void 0:g.data;p&&typeof p=="object"&&l({distributorShare:p.distributorShare??90,minWithdrawAmount:p.minWithdrawAmount??10,bindingDays:p.bindingDays??30,userDiscount:p.userDiscount??5,enableAutoWithdraw:p.enableAutoWithdraw??!1,vipOrderShareVip:p.vipOrderShareVip??20,vipOrderShareNonVip:p.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>c(!1))},[]);const f=async()=>{m(!0);try{const g={distributorShare:Number(a.distributorShare)||0,minWithdrawAmount:Number(a.minWithdrawAmount)||0,bindingDays:Number(a.bindingDays)||0,userDiscount:Number(a.userDiscount)||0,enableAutoWithdraw:!!a.enableAutoWithdraw,vipOrderShareVip:Number(a.vipOrderShareVip)||20,vipOrderShareNonVip:Number(a.vipOrderShareNonVip)||10},p=await mt("/api/admin/referral-settings",g);if(!p||p.success===!1){alert("保存失败: "+(p&&typeof p=="object"&&"error"in p?p.error:""));return}alert(`✅ 分销配置已保存成功! • 小程序与网站的推广规则会一起生效 • 绑定关系会使用新的天数配置 • 佣金比例会立即应用到新订单 -如有缓存,请刷新前台/小程序页面。`)}catch(g){console.error(g),alert("保存失败: "+(g instanceof Error?g.message:String(g)))}finally{m(!1)}},y=g=>p=>{const v=parseFloat(p.target.value||"0");l(C=>({...C,[g]:isNaN(v)?0:v}))};return o?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Ma,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),e.jsxs(Z,{onClick:f,disabled:d||o,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{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(qb,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),e.jsx(jt,{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(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.userDiscount,onChange:y("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(Yt,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(n4,{className:"flex-1",min:10,max:100,step:1,value:[a.distributorShare],onValueChange:([g])=>l(p=>({...p,distributorShare:g}))}),e.jsx(le,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:a.distributorShare,onChange:y("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(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.vipOrderShareVip,onChange:y("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(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.vipOrderShareNonVip,onChange:y("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(Yt,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),e.jsx(le,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:a.bindingDays,onChange:y("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(Ma,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),e.jsx(jt,{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(le,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:a.minWithdrawAmount,onChange:y("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:g=>l(p=>({...p,enableAutoWithdraw:g}))}),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 l4(){var Se;const[r,a]=h.useState("overview"),[l,o]=h.useState([]),[c,d]=h.useState(null),[m,f]=h.useState([]),[y,g]=h.useState([]),[p,v]=h.useState([]),[C,P]=h.useState(!0),[T,b]=h.useState(null),[N,w]=h.useState(""),[k,j]=h.useState("all"),[_,U]=h.useState(1),[V,I]=h.useState(10),[R,E]=h.useState(0),[Y,ne]=h.useState(new Set),[ae,q]=h.useState(null),[se,H]=h.useState(""),[ie,ve]=h.useState(!1);h.useEffect(()=>{B()},[]),h.useEffect(()=>{U(1)},[r,k]),h.useEffect(()=>{ce(r)},[r]),h.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&ce(r,!0)},[_,V,k,N]);async function B(){b(null);try{const D=await $e("/api/admin/distribution/overview");D!=null&&D.success&&D.overview&&d(D.overview)}catch(D){console.error("[Admin] 概览接口异常:",D),b("加载概览失败")}try{const D=await $e("/api/db/users");v((D==null?void 0:D.users)||[])}catch(D){console.error("[Admin] 用户数据加载失败:",D)}}async function ce(D,fe=!1){var ke;if(!(!fe&&Y.has(D))){P(!0);try{const Ve=p;switch(D){case"overview":break;case"orders":{try{const We=new URLSearchParams({page:String(_),pageSize:String(V),...k!=="all"&&{status:k},...N&&{search:N}}),Ke=await $e(`/api/orders?${We}`);if(Ke!=null&&Ke.success&&Ke.orders){const tt=Ke.orders.map(ze=>{const he=Ve.find(ft=>ft.id===ze.userId),xe=ze.referrerId?Ve.find(ft=>ft.id===ze.referrerId):null;return{...ze,amount:parseFloat(String(ze.amount))||0,userNickname:(he==null?void 0:he.nickname)||ze.userNickname||"未知用户",userPhone:(he==null?void 0:he.phone)||ze.userPhone||"-",referrerNickname:(xe==null?void 0:xe.nickname)||null,referrerCode:(xe==null?void 0:xe.referralCode)??null,type:ze.productType||ze.type}});o(tt),E(Ke.total??tt.length)}else o([]),E(0)}catch(We){console.error(We),b("加载订单失败"),o([])}break}case"bindings":{try{const We=new URLSearchParams({page:String(_),pageSize:String(V),...k!=="all"&&{status:k}}),Ke=await $e(`/api/db/distribution?${We}`);f((Ke==null?void 0:Ke.bindings)||[]),E((Ke==null?void 0:Ke.total)??((ke=Ke==null?void 0:Ke.bindings)==null?void 0:ke.length)??0)}catch(We){console.error(We),b("加载绑定数据失败"),f([])}break}case"withdrawals":{try{const We=k==="completed"?"success":k==="rejected"?"failed":k,Ke=new URLSearchParams({...We&&We!=="all"&&{status:We},page:String(_),pageSize:String(V)}),tt=await $e(`/api/admin/withdrawals?${Ke}`);if(tt!=null&&tt.success&&tt.withdrawals){const ze=tt.withdrawals.map(he=>({...he,account:he.account??"未绑定微信号",status:he.status==="success"?"completed":he.status==="failed"?"rejected":he.status}));g(ze),E((tt==null?void 0:tt.total)??ze.length)}else tt!=null&&tt.success||b(`获取提现记录失败: ${(tt==null?void 0:tt.error)||"未知错误"}`),g([])}catch(We){console.error(We),b("加载提现数据失败"),g([])}break}}ne(We=>new Set(We).add(D))}catch(Ve){console.error(Ve)}finally{P(!1)}}}async function K(){b(null),ne(D=>{const fe=new Set(D);return fe.delete(r),fe}),r==="overview"&&B(),await ce(r,!0)}async function A(D){if(confirm("确认审核通过并打款?"))try{const fe=await vt("/api/admin/withdrawals",{id:D,action:"approve"});if(!(fe!=null&&fe.success)){const ke=(fe==null?void 0:fe.message)||(fe==null?void 0:fe.error)||"操作失败";alert(ke);return}await K()}catch(fe){console.error(fe),alert("操作失败")}}async function O(D){const fe=prompt("请输入拒绝原因:");if(fe)try{const ke=await vt("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:fe});if(!(ke!=null&&ke.success)){alert((ke==null?void 0:ke.error)||"操作失败");return}await K()}catch(ke){console.error(ke),alert("操作失败")}}async function L(){var D;if(!(!(ae!=null&&ae.orderSn)&&!(ae!=null&&ae.id))){ve(!0),b(null);try{const fe=await vt("/api/admin/orders/refund",{orderSn:ae.orderSn||ae.id,reason:se||void 0});fe!=null&&fe.success?(q(null),H(""),await ce("orders",!0)):b((fe==null?void 0:fe.error)||"退款失败")}catch(fe){const ke=fe;b(((D=ke==null?void 0:ke.data)==null?void 0:D.error)||"退款失败,请检查网络后重试")}finally{ve(!1)}}}function J(D){const fe={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",pending_confirm:"bg-orange-500/20 text-orange-400",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},ke={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return e.jsx(Le,{className:`${fe[D]||"bg-gray-500/20 text-gray-400"} border-0`,children:ke[D]||D})}const G=Math.ceil(R/V)||1,de=l,Q=m.filter(D=>{var ke,Ve,We,Ke;if(!N)return!0;const fe=N.toLowerCase();return((ke=D.refereeNickname)==null?void 0:ke.toLowerCase().includes(fe))||((Ve=D.refereePhone)==null?void 0:Ve.includes(fe))||((We=D.referrerName)==null?void 0:We.toLowerCase().includes(fe))||((Ke=D.referrerCode)==null?void 0:Ke.toLowerCase().includes(fe))}),ge=y.filter(D=>{var ke;if(!N)return!0;const fe=N.toLowerCase();return((ke=D.userName)==null?void 0:ke.toLowerCase().includes(fe))||D.account&&D.account.toLowerCase().includes(fe)});return e.jsxs("div",{className:"p-8 w-full",children:[T&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:T}),e.jsx("button",{type:"button",onClick:()=>b(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"推广中心"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),e.jsxs(Z,{onClick:K,disabled:C,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${C?"animate-spin":""}`}),"刷新数据"]})]}),e.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4 flex-wrap",children:[{key:"overview",label:"数据概览",icon:Rl},{key:"orders",label:"订单管理",icon:co},{key:"bindings",label:"绑定管理",icon:Pr},{key:"withdrawals",label:"提现审核",icon:Ma},{key:"settings",label:"推广设置",icon:dn}].map(D=>e.jsxs("button",{type:"button",onClick:()=>{a(D.key),j("all"),w("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===D.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[e.jsx(D.icon,{className:"w-4 h-4"}),D.label]},D.key))}),C?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(Yt,{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(Rl,{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(Ff,{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((D,fe)=>fe.clicks-D.clicks).map((D,fe)=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-4 text-white font-mono",children:D.page||"(未区分)"}),e.jsx("td",{className:"py-2 pr-4 text-right text-white",children:D.clicks}),e.jsxs("td",{className:"py-2 text-right text-gray-400",children:[c.todayClicks>0?(D.clicks/c.todayClicks*100).toFixed(1):0,"%"]})]},fe))})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Ne,{className:"bg-orange-500/10 border-orange-500/30",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:e.jsx(Yd,{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(Ma,{className:"w-6 h-6 text-blue-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),e.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),e.jsx(Z,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(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(Rl,{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(Yt,{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(le,{value:N,onChange:D=>w(D.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:k,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[l.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:de.map(D=>{var fe,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:[(fe=D.id)==null?void 0:fe.slice(0,12),"..."]}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:D.userNickname}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.userPhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:(()=>{const Ve=D.productType||D.type;return Ve==="fullbook"?`${D.bookName||"《底层逻辑》"} - 全本`:Ve==="match"?"匹配次数购买":`${D.bookName||"《底层逻辑》"} - ${D.sectionTitle||D.chapterTitle||`章节${D.productId||D.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const Ve=D.productType||D.type;return Ve==="fullbook"?"全书解锁":Ve==="match"?"功能权益":D.chapterTitle||"单章购买"})()})]})}),e.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof D.amount=="number"?D.amount.toFixed(2):parseFloat(String(D.amount||"0")).toFixed(2)]}),e.jsx("td",{className:"p-4 text-gray-300",children:D.paymentMethod==="wechat"?"微信支付":D.paymentMethod==="alipay"?"支付宝":D.paymentMethod||"微信支付"}),e.jsx("td",{className:"p-4",children:D.status==="refunded"?e.jsx(Le,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):D.status==="completed"||D.status==="paid"?e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):D.status==="pending"||D.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:D.refundReason,children:D.status==="refunded"&&D.refundReason?D.refundReason:"-"}),e.jsx("td",{className:"p-4 text-gray-300 text-sm",children:D.referrerId||D.referralCode?e.jsxs("span",{title:D.referralCode||D.referrerCode||D.referrerId||"",children:[D.referrerNickname||D.referralCode||D.referrerCode||((ke=D.referrerId)==null?void 0:ke.slice(0,8)),(D.referralCode||D.referrerCode)&&` (${D.referralCode||D.referrerCode})`]}):"-"}),e.jsx("td",{className:"p-4 text-[#FFD700]",children:D.referrerEarnings?`¥${(typeof D.referrerEarnings=="number"?D.referrerEarnings:parseFloat(String(D.referrerEarnings))).toFixed(2)}`:"-"}),e.jsx("td",{className:"p-4 text-gray-400 text-sm",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:(D.status==="paid"||D.status==="completed")&&e.jsxs(Z,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{q(D),H("")},children:[e.jsx(Jx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},D.id)})})]})}),r==="orders"&&e.jsx(Qs,{page:_,totalPages:G,total:R,pageSize:V,onPageChange:U,onPageSizeChange:D=>{I(D),U(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(le,{value:N,onChange:D=>w(D.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:k,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"active",children:"有效"}),e.jsx("option",{value:"converted",children:"已转化"}),e.jsx("option",{value:"expired",children:"已过期"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[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(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-medium",children:D.refereeNickname||"匿名用户"}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.refereePhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white",children:D.referrerName||"-"}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:D.referrerCode})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.boundAt?new Date(D.boundAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:D.expiresAt?new Date(D.expiresAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:J(D.status)}),e.jsx("td",{className:"p-4",children:D.commission?e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",D.commission.toFixed(2)]}):e.jsx("span",{className:"text-gray-500",children:"-"})})]},D.id))})]})}),r==="bindings"&&e.jsx(Qs,{page:_,totalPages:G,total:R,pageSize:V,onPageChange:U,onPageSizeChange:D=>{I(D),U(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(le,{value:N,onChange:D=>w(D.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:k,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"pending",children:"待审核"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[ge.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:ge.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[D.userAvatar?e.jsx("img",{src:D.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(D.userName||D.name||"?").slice(0,1)}),e.jsx("p",{className:"text-white font-medium",children:D.userName||D.name})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",D.amount.toFixed(2)]})}),e.jsx("td",{className:"p-4",children:e.jsx(Le,{className:D.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:D.method==="wechat"?"微信":"支付宝"})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-mono text-xs",children:D.account}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.name})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:J(D.status)}),e.jsx("td",{className:"p-4 text-right",children:D.status==="pending"&&e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsxs(Z,{size:"sm",onClick:()=>A(D.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Ff,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>O(D.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx(Kx,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},D.id))})]})}),r==="withdrawals"&&e.jsx(Qs,{page:_,totalPages:G,total:R,pageSize:V,onPageChange:U,onPageSizeChange:D=>{I(D),U(1)}})]})})]})]}),e.jsx(Ct,{open:!!ae,onOpenChange:D=>!D&&q(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:"订单退款"})}),ae&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",ae.orderSn||ae.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof ae.amount=="number"?ae.amount.toFixed(2):parseFloat(String(ae.amount||"0")).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:se,onChange:D=>H(D.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Dt,{children:[e.jsx(Z,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>q(null),disabled:ie,children:"取消"}),e.jsx(Z,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:L,disabled:ie,children:ie?"退款中...":"确认退款"})]})]})}),r==="settings"&&e.jsx("div",{className:"-mx-8 -mt-6",children:e.jsx(A0,{embedded:!0})})]})}function i4(){const[r,a]=h.useState([]),[l,o]=h.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=h.useState(!0),[m,f]=h.useState(null),[y,g]=h.useState("all"),[p,v]=h.useState(1),[C,P]=h.useState(10),[T,b]=h.useState(0),[N,w]=h.useState(null);async function k(){var I,R,E,Y,ne,ae,q;d(!0),f(null);try{const se=new URLSearchParams({status:y,page:String(p),pageSize:String(C)}),H=await $e(`/api/admin/withdrawals?${se}`);if(H!=null&&H.success){const ie=H.withdrawals||[];a(ie),b(H.total??((I=H.stats)==null?void 0:I.total)??ie.length),o({total:((R=H.stats)==null?void 0:R.total)??H.total??ie.length,pendingCount:((E=H.stats)==null?void 0:E.pendingCount)??0,pendingAmount:((Y=H.stats)==null?void 0:Y.pendingAmount)??0,successCount:((ne=H.stats)==null?void 0:ne.successCount)??0,successAmount:((ae=H.stats)==null?void 0:ae.successAmount)??0,failedCount:((q=H.stats)==null?void 0:q.failedCount)??0})}else f("加载提现记录失败")}catch(se){console.error("Load withdrawals error:",se),f("加载失败,请检查网络后重试")}finally{d(!1)}}h.useEffect(()=>{v(1)},[y]),h.useEffect(()=>{k()},[y,p,C]);const j=Math.ceil(T/C)||1;async function _(I){const R=r.find(E=>E.id===I);if(R!=null&&R.userCommissionInfo&&R.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${R.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 +如有缓存,请刷新前台/小程序页面。`)}catch(g){console.error(g),alert("保存失败: "+(g instanceof Error?g.message:String(g)))}finally{m(!1)}},y=g=>p=>{const v=parseFloat(p.target.value||"0");l(k=>({...k,[g]:isNaN(v)?0:v}))};return o?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(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:u||o,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),u?"保存中...":"保存配置"]})]}),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(qb,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),e.jsx(jt,{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:y("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(n4,{className:"flex-1",min:10,max:100,step:1,value:[a.distributorShare],onValueChange:([g])=>l(p=>({...p,distributorShare:g}))}),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:y("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:y("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:y("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:y("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(jt,{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:y("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:g=>l(p=>({...p,enableAutoWithdraw:g}))}),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 l4(){var Se;const[r,a]=h.useState("overview"),[l,o]=h.useState([]),[c,u]=h.useState(null),[m,f]=h.useState([]),[y,g]=h.useState([]),[p,v]=h.useState([]),[k,P]=h.useState(!0),[T,b]=h.useState(null),[N,C]=h.useState(""),[E,j]=h.useState("all"),[R,Q]=h.useState(1),[Z,A]=h.useState(10),[I,w]=h.useState(0),[U,se]=h.useState(new Set),[le,G]=h.useState(null),[re,H]=h.useState(""),[ie,ve]=h.useState(!1);h.useEffect(()=>{z()},[]),h.useEffect(()=>{Q(1)},[r,E]),h.useEffect(()=>{ne(r)},[r]),h.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&ne(r,!0)},[R,Z,E,N]);async function z(){b(null);try{const D=await $e("/api/admin/distribution/overview");D!=null&&D.success&&D.overview&&u(D.overview)}catch(D){console.error("[Admin] 概览接口异常:",D),b("加载概览失败")}try{const D=await $e("/api/db/users");v((D==null?void 0:D.users)||[])}catch(D){console.error("[Admin] 用户数据加载失败:",D)}}async function ne(D,fe=!1){var ke;if(!(!fe&&U.has(D))){P(!0);try{const Ve=p;switch(D){case"overview":break;case"orders":{try{const We=new URLSearchParams({page:String(R),pageSize:String(Z),...E!=="all"&&{status:E},...N&&{search:N}}),Ke=await $e(`/api/orders?${We}`);if(Ke!=null&&Ke.success&&Ke.orders){const tt=Ke.orders.map(ze=>{const he=Ve.find(ft=>ft.id===ze.userId),xe=ze.referrerId?Ve.find(ft=>ft.id===ze.referrerId):null;return{...ze,amount:parseFloat(String(ze.amount))||0,userNickname:(he==null?void 0:he.nickname)||ze.userNickname||"未知用户",userPhone:(he==null?void 0:he.phone)||ze.userPhone||"-",referrerNickname:(xe==null?void 0:xe.nickname)||null,referrerCode:(xe==null?void 0:xe.referralCode)??null,type:ze.productType||ze.type}});o(tt),w(Ke.total??tt.length)}else o([]),w(0)}catch(We){console.error(We),b("加载订单失败"),o([])}break}case"bindings":{try{const We=new URLSearchParams({page:String(R),pageSize:String(Z),...E!=="all"&&{status:E}}),Ke=await $e(`/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),b("加载绑定数据失败"),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(Z)}),tt=await $e(`/api/admin/withdrawals?${Ke}`);if(tt!=null&&tt.success&&tt.withdrawals){const ze=tt.withdrawals.map(he=>({...he,account:he.account??"未绑定微信号",status:he.status==="success"?"completed":he.status==="failed"?"rejected":he.status}));g(ze),w((tt==null?void 0:tt.total)??ze.length)}else tt!=null&&tt.success||b(`获取提现记录失败: ${(tt==null?void 0:tt.error)||"未知错误"}`),g([])}catch(We){console.error(We),b("加载提现数据失败"),g([])}break}}se(We=>new Set(We).add(D))}catch(Ve){console.error(Ve)}finally{P(!1)}}}async function W(){b(null),se(D=>{const fe=new Set(D);return fe.delete(r),fe}),r==="overview"&&z(),await ne(r,!0)}async function M(D){if(confirm("确认审核通过并打款?"))try{const fe=await vt("/api/admin/withdrawals",{id:D,action:"approve"});if(!(fe!=null&&fe.success)){const ke=(fe==null?void 0:fe.message)||(fe==null?void 0:fe.error)||"操作失败";alert(ke);return}await W()}catch(fe){console.error(fe),alert("操作失败")}}async function O(D){const fe=prompt("请输入拒绝原因:");if(fe)try{const ke=await vt("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:fe});if(!(ke!=null&&ke.success)){alert((ke==null?void 0:ke.error)||"操作失败");return}await W()}catch(ke){console.error(ke),alert("操作失败")}}async function L(){var D;if(!(!(le!=null&&le.orderSn)&&!(le!=null&&le.id))){ve(!0),b(null);try{const fe=await vt("/api/admin/orders/refund",{orderSn:le.orderSn||le.id,reason:re||void 0});fe!=null&&fe.success?(G(null),H(""),await ne("orders",!0)):b((fe==null?void 0:fe.error)||"退款失败")}catch(fe){const ke=fe;b(((D=ke==null?void 0:ke.data)==null?void 0:D.error)||"退款失败,请检查网络后重试")}finally{ve(!1)}}}function X(D){const fe={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",pending_confirm:"bg-orange-500/20 text-orange-400",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},ke={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return e.jsx(Le,{className:`${fe[D]||"bg-gray-500/20 text-gray-400"} border-0`,children:ke[D]||D})}const K=Math.ceil(I/Z)||1,de=l,Y=m.filter(D=>{var ke,Ve,We,Ke;if(!N)return!0;const fe=N.toLowerCase();return((ke=D.refereeNickname)==null?void 0:ke.toLowerCase().includes(fe))||((Ve=D.refereePhone)==null?void 0:Ve.includes(fe))||((We=D.referrerName)==null?void 0:We.toLowerCase().includes(fe))||((Ke=D.referrerCode)==null?void 0:Ke.toLowerCase().includes(fe))}),ge=y.filter(D=>{var ke;if(!N)return!0;const fe=N.toLowerCase();return((ke=D.userName)==null?void 0:ke.toLowerCase().includes(fe))||D.account&&D.account.toLowerCase().includes(fe)});return e.jsxs("div",{className:"p-8 w-full",children:[T&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:T}),e.jsx("button",{type:"button",onClick:()=>b(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"推广中心"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),e.jsxs(J,{onClick:W,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:Bn}].map(D=>e.jsxs("button",{type:"button",onClick:()=>{a(D.key),j("all"),C("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===D.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[e.jsx(D.icon,{className:"w-4 h-4"}),D.label]},D.key))}),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(Ff,{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((D,fe)=>fe.clicks-D.clicks).map((D,fe)=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-4 text-white font-mono",children:D.page||"(未区分)"}),e.jsx("td",{className:"py-2 pr-4 text-right text-white",children:D.clicks}),e.jsxs("td",{className:"py-2 text-right text-gray-400",children:[c.todayClicks>0?(D.clicks/c.todayClicks*100).toFixed(1):0,"%"]})]},fe))})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Ne,{className:"bg-orange-500/10 border-orange-500/30",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:e.jsx(Yd,{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:N,onChange:D=>C(D.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[l.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:de.map(D=>{var fe,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:[(fe=D.id)==null?void 0:fe.slice(0,12),"..."]}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:D.userNickname}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.userPhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:(()=>{const Ve=D.productType||D.type;return Ve==="fullbook"?`${D.bookName||"《底层逻辑》"} - 全本`:Ve==="match"?"匹配次数购买":`${D.bookName||"《底层逻辑》"} - ${D.sectionTitle||D.chapterTitle||`章节${D.productId||D.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const Ve=D.productType||D.type;return Ve==="fullbook"?"全书解锁":Ve==="match"?"功能权益":D.chapterTitle||"单章购买"})()})]})}),e.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof D.amount=="number"?D.amount.toFixed(2):parseFloat(String(D.amount||"0")).toFixed(2)]}),e.jsx("td",{className:"p-4 text-gray-300",children:D.paymentMethod==="wechat"?"微信支付":D.paymentMethod==="alipay"?"支付宝":D.paymentMethod||"微信支付"}),e.jsx("td",{className:"p-4",children:D.status==="refunded"?e.jsx(Le,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):D.status==="completed"||D.status==="paid"?e.jsx(Le,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):D.status==="pending"||D.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:D.refundReason,children:D.status==="refunded"&&D.refundReason?D.refundReason:"-"}),e.jsx("td",{className:"p-4 text-gray-300 text-sm",children:D.referrerId||D.referralCode?e.jsxs("span",{title:D.referralCode||D.referrerCode||D.referrerId||"",children:[D.referrerNickname||D.referralCode||D.referrerCode||((ke=D.referrerId)==null?void 0:ke.slice(0,8)),(D.referralCode||D.referrerCode)&&` (${D.referralCode||D.referrerCode})`]}):"-"}),e.jsx("td",{className:"p-4 text-[#FFD700]",children:D.referrerEarnings?`¥${(typeof D.referrerEarnings=="number"?D.referrerEarnings:parseFloat(String(D.referrerEarnings))).toFixed(2)}`:"-"}),e.jsx("td",{className:"p-4 text-gray-400 text-sm",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:(D.status==="paid"||D.status==="completed")&&e.jsxs(J,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{G(D),H("")},children:[e.jsx(Jx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},D.id)})})]})}),r==="orders"&&e.jsx(Qs,{page:R,totalPages:K,total:I,pageSize:Z,onPageChange:Q,onPageSizeChange:D=>{A(D),Q(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:N,onChange:D=>C(D.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"active",children:"有效"}),e.jsx("option",{value:"converted",children:"已转化"}),e.jsx("option",{value:"expired",children:"已过期"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[Y.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:Y.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-medium",children:D.refereeNickname||"匿名用户"}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.refereePhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white",children:D.referrerName||"-"}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:D.referrerCode})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.boundAt?new Date(D.boundAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:D.expiresAt?new Date(D.expiresAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4",children:D.commission?e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",D.commission.toFixed(2)]}):e.jsx("span",{className:"text-gray-500",children:"-"})})]},D.id))})]})}),r==="bindings"&&e.jsx(Qs,{page:R,totalPages:K,total:I,pageSize:Z,onPageChange:Q,onPageSizeChange:D=>{A(D),Q(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:N,onChange:D=>C(D.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"pending",children:"待审核"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[ge.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:ge.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[D.userAvatar?e.jsx("img",{src:D.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(D.userName||D.name||"?").slice(0,1)}),e.jsx("p",{className:"text-white font-medium",children:D.userName||D.name})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",D.amount.toFixed(2)]})}),e.jsx("td",{className:"p-4",children:e.jsx(Le,{className:D.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:D.method==="wechat"?"微信":"支付宝"})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-mono text-xs",children:D.account}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.name})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4 text-right",children:D.status==="pending"&&e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsxs(J,{size:"sm",onClick:()=>M(D.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Ff,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(J,{size:"sm",variant:"outline",onClick:()=>O(D.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx(Kx,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},D.id))})]})}),r==="withdrawals"&&e.jsx(Qs,{page:R,totalPages:K,total:I,pageSize:Z,onPageChange:Q,onPageSizeChange:D=>{A(D),Q(1)}})]})})]})]}),e.jsx(Ct,{open:!!le,onOpenChange:D=>!D&&G(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:"订单退款"})}),le&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",le.orderSn||le.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof le.amount=="number"?le.amount.toFixed(2):parseFloat(String(le.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:re,onChange:D=>H(D.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:()=>G(null),disabled:ie,children:"取消"}),e.jsx(J,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:L,disabled:ie,children:ie?"退款中...":"确认退款"})]})]})}),r==="settings"&&e.jsx("div",{className:"-mx-8 -mt-6",children:e.jsx(A0,{embedded:!0})})]})}function i4(){const[r,a]=h.useState([]),[l,o]=h.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,u]=h.useState(!0),[m,f]=h.useState(null),[y,g]=h.useState("all"),[p,v]=h.useState(1),[k,P]=h.useState(10),[T,b]=h.useState(0),[N,C]=h.useState(null);async function E(){var A,I,w,U,se,le,G;u(!0),f(null);try{const re=new URLSearchParams({status:y,page:String(p),pageSize:String(k)}),H=await $e(`/api/admin/withdrawals?${re}`);if(H!=null&&H.success){const ie=H.withdrawals||[];a(ie),b(H.total??((A=H.stats)==null?void 0:A.total)??ie.length),o({total:((I=H.stats)==null?void 0:I.total)??H.total??ie.length,pendingCount:((w=H.stats)==null?void 0:w.pendingCount)??0,pendingAmount:((U=H.stats)==null?void 0:U.pendingAmount)??0,successCount:((se=H.stats)==null?void 0:se.successCount)??0,successAmount:((le=H.stats)==null?void 0:le.successAmount)??0,failedCount:((G=H.stats)==null?void 0:G.failedCount)??0})}else f("加载提现记录失败")}catch(re){console.error("Load withdrawals error:",re),f("加载失败,请检查网络后重试")}finally{u(!1)}}h.useEffect(()=>{v(1)},[y]),h.useEffect(()=>{E()},[y,p,k]);const j=Math.ceil(T/k)||1;async function R(A){const I=r.find(w=>w.id===A);if(I!=null&&I.userCommissionInfo&&I.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${I.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 -确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;w(I);try{const E=await vt("/api/admin/withdrawals",{id:I,action:"approve"});E!=null&&E.success?k():alert("操作失败: "+((E==null?void 0:E.error)??""))}catch{alert("操作失败")}finally{w(null)}}async function U(I){const R=prompt("请输入拒绝原因(将返还用户余额):");if(R){w(I);try{const E=await vt("/api/admin/withdrawals",{id:I,action:"reject",errorMessage:R});E!=null&&E.success?k():alert("操作失败: "+((E==null?void 0:E.error)??""))}catch{alert("操作失败")}finally{w(null)}}}function V(I){switch(I){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:I})}}return e.jsxs("div",{className:"p-8 w-full",children:[m&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:m}),e.jsx("button",{type:"button",onClick:()=>f(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-start mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),e.jsxs(Z,{variant:"outline",onClick:k,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(I=>e.jsx(Z,{variant:y===I?"default":"outline",size:"sm",onClick:()=>g(I),className:y===I?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:I==="all"?"全部":I==="pending"?"待处理":I==="success"?"已完成":"已拒绝"},I))}),e.jsx(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(Ma,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"确认收款"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(I=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4 text-gray-400",children:new Date(I.createdAt??"").toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[I.userAvatar?e.jsx("img",{src:I.userAvatar,alt:I.userName??"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:(I.userName??"?").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-white",children:I.userName??"未知"}),e.jsx("p",{className:"text-xs text-gray-500",children:I.userPhone??I.referralCode??(I.userId??"").slice(0,10)})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(I.amount).toFixed(2)]})}),e.jsx("td",{className:"p-4",children:I.userCommissionInfo?e.jsxs("div",{className:"text-xs space-y-1",children:[e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",I.userCommissionInfo.totalCommission.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"已提现:"}),e.jsxs("span",{className:"text-gray-400",children:["¥",I.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"待审核:"}),e.jsxs("span",{className:"text-orange-400",children:["¥",I.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[e.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),e.jsxs("span",{className:I.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",I.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):e.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),e.jsxs("td",{className:"p-4",children:[V(I.status),I.errorMessage&&e.jsx("p",{className:"text-xs text-red-400 mt-1",children:I.errorMessage})]}),e.jsx("td",{className:"p-4 text-gray-400",children:I.processedAt?new Date(I.processedAt).toLocaleString():"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:I.userConfirmedAt?e.jsxs("span",{className:"text-green-400",title:I.userConfirmedAt,children:["已确认 ",new Date(I.userConfirmedAt).toLocaleString()]}):"-"}),e.jsxs("td",{className:"p-4 text-right",children:[(I.status==="pending"||I.status==="pending_confirm")&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(Z,{size:"sm",onClick:()=>_(I.id),disabled:N===I.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(wo,{className:"w-4 h-4 mr-1"}),"批准"]}),e.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>U(I.id),disabled:N===I.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"}),"拒绝"]})]}),(I.status==="success"||I.status==="completed")&&I.transactionId&&e.jsx("span",{className:"text-xs text-gray-500 font-mono",children:I.transactionId})]})]},I.id))})]})}),e.jsx(Qs,{page:p,totalPages:j,total:T,pageSize:C,onPageChange:v,onPageSizeChange:I=>{P(I),v(1)}})]})})})]})}const o4=["top","right","bottom","left"],fn=Math.min,ws=Math.max,po=Math.round,ro=Math.floor,cr=r=>({x:r,y:r}),c4={left:"right",right:"left",bottom:"top",top:"bottom"},d4={start:"end",end:"start"};function au(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 Ua(r){return r.split("-")[1]}function Ou(r){return r==="x"?"y":"x"}function Fu(r){return r==="y"?"height":"width"}const u4=new Set(["top","bottom"]);function or(r){return u4.has(Ir(r))?"y":"x"}function zu(r){return Ou(or(r))}function h4(r,a,l){l===void 0&&(l=!1);const o=Ua(r),c=zu(r),d=Fu(c);let m=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(m=go(m)),[m,go(m)]}function m4(r){const a=go(r);return[lu(r),a,lu(a)]}function lu(r){return r.replace(/start|end/g,a=>d4[a])}const cx=["left","right"],dx=["right","left"],f4=["top","bottom"],x4=["bottom","top"];function p4(r,a,l){switch(r){case"top":case"bottom":return l?a?dx:cx:a?cx:dx;case"left":case"right":return a?f4:x4;default:return[]}}function g4(r,a,l,o){const c=Ua(r);let d=p4(Ir(r),l==="start",o);return c&&(d=d.map(m=>m+"-"+c),a&&(d=d.concat(d.map(lu)))),d}function go(r){return r.replace(/left|right|bottom|top/g,a=>c4[a])}function y4(r){return{top:0,right:0,bottom:0,left:0,...r}}function D0(r){return typeof r!="number"?y4(r):{top:r,right:r,bottom:r,left:r}}function yo(r){const{x:a,y:l,width:o,height:c}=r;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function ux(r,a,l){let{reference:o,floating:c}=r;const d=or(a),m=zu(a),f=Fu(m),y=Ir(a),g=d==="y",p=o.x+o.width/2-c.width/2,v=o.y+o.height/2-c.height/2,C=o[f]/2-c[f]/2;let P;switch(y){case"top":P={x:p,y:o.y-c.height};break;case"bottom":P={x:p,y:o.y+o.height};break;case"right":P={x:o.x+o.width,y:v};break;case"left":P={x:o.x-c.width,y:v};break;default:P={x:o.x,y:o.y}}switch(Ua(a)){case"start":P[m]-=C*(l&&g?-1:1);break;case"end":P[m]+=C*(l&&g?-1:1);break}return P}async function v4(r,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:d,rects:m,elements:f,strategy:y}=r,{boundary:g="clippingAncestors",rootBoundary:p="viewport",elementContext:v="floating",altBoundary:C=!1,padding:P=0}=Rr(a,r),T=D0(P),N=f[C?v==="floating"?"reference":"floating":v],w=yo(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(N)))==null||l?N:N.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(f.floating)),boundary:g,rootBoundary:p,strategy:y})),k=v==="floating"?{x:o,y:c,width:m.floating.width,height:m.floating.height}:m.reference,j=await(d.getOffsetParent==null?void 0:d.getOffsetParent(f.floating)),_=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},U=yo(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:k,offsetParent:j,strategy:y}):k);return{top:(w.top-U.top+T.top)/_.y,bottom:(U.bottom-w.bottom+T.bottom)/_.y,left:(w.left-U.left+T.left)/_.x,right:(U.right-w.right+T.right)/_.x}}const j4=async(r,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:d=[],platform:m}=l,f=d.filter(Boolean),y=await(m.isRTL==null?void 0:m.isRTL(a));let g=await m.getElementRects({reference:r,floating:a,strategy:c}),{x:p,y:v}=ux(g,o,y),C=o,P={},T=0;for(let N=0;N({name:"arrow",options:r,async fn(a){const{x:l,y:o,placement:c,rects:d,platform:m,elements:f,middlewareData:y}=a,{element:g,padding:p=0}=Rr(r,a)||{};if(g==null)return{};const v=D0(p),C={x:l,y:o},P=zu(c),T=Fu(P),b=await m.getDimensions(g),N=P==="y",w=N?"top":"left",k=N?"bottom":"right",j=N?"clientHeight":"clientWidth",_=d.reference[T]+d.reference[P]-C[P]-d.floating[T],U=C[P]-d.reference[P],V=await(m.getOffsetParent==null?void 0:m.getOffsetParent(g));let I=V?V[j]:0;(!I||!await(m.isElement==null?void 0:m.isElement(V)))&&(I=f.floating[j]||d.floating[T]);const R=_/2-U/2,E=I/2-b[T]/2-1,Y=fn(v[w],E),ne=fn(v[k],E),ae=Y,q=I-b[T]-ne,se=I/2-b[T]/2+R,H=au(ae,se,q),ie=!y.arrow&&Ua(c)!=null&&se!==H&&d.reference[T]/2-(sese<=0)){var ne,ae;const se=(((ne=d.flip)==null?void 0:ne.index)||0)+1,H=I[se];if(H&&(!(v==="alignment"?k!==or(H):!1)||Y.every(B=>or(B.placement)===k?B.overflows[0]>0:!0)))return{data:{index:se,overflows:Y},reset:{placement:H}};let ie=(ae=Y.filter(ve=>ve.overflows[0]<=0).sort((ve,B)=>ve.overflows[1]-B.overflows[1])[0])==null?void 0:ae.placement;if(!ie)switch(P){case"bestFit":{var q;const ve=(q=Y.filter(B=>{if(V){const ce=or(B.placement);return ce===k||ce==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ce=>ce>0).reduce((ce,K)=>ce+K,0)]).sort((B,ce)=>B[1]-ce[1])[0])==null?void 0:q[0];ve&&(ie=ve);break}case"initialPlacement":ie=f;break}if(c!==ie)return{reset:{placement:ie}}}return{}}}};function hx(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function mx(r){return o4.some(a=>r[a]>=0)}const w4=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...d}=Rr(r,a);switch(c){case"referenceHidden":{const m=await o.detectOverflow(a,{...d,elementContext:"reference"}),f=hx(m,l.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:mx(f)}}}case"escaped":{const m=await o.detectOverflow(a,{...d,altBoundary:!0}),f=hx(m,l.floating);return{data:{escapedOffsets:f,escaped:mx(f)}}}default:return{}}}}},L0=new Set(["left","top"]);async function S4(r,a){const{placement:l,platform:o,elements:c}=r,d=await(o.isRTL==null?void 0:o.isRTL(c.floating)),m=Ir(l),f=Ua(l),y=or(l)==="y",g=L0.has(m)?-1:1,p=d&&y?-1:1,v=Rr(a,r);let{mainAxis:C,crossAxis:P,alignmentAxis:T}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof T=="number"&&(P=f==="end"?T*-1:T),y?{x:P*p,y:C*g}:{x:C*g,y:P*p}}const C4=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,o;const{x:c,y:d,placement:m,middlewareData:f}=a,y=await S4(a,r);return m===((l=f.offset)==null?void 0:l.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:c+y.x,y:d+y.y,data:{...y,placement:m}}}}},k4=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:o,placement:c,platform:d}=a,{mainAxis:m=!0,crossAxis:f=!1,limiter:y={fn:w=>{let{x:k,y:j}=w;return{x:k,y:j}}},...g}=Rr(r,a),p={x:l,y:o},v=await d.detectOverflow(a,g),C=or(Ir(c)),P=Ou(C);let T=p[P],b=p[C];if(m){const w=P==="y"?"top":"left",k=P==="y"?"bottom":"right",j=T+v[w],_=T-v[k];T=au(j,T,_)}if(f){const w=C==="y"?"top":"left",k=C==="y"?"bottom":"right",j=b+v[w],_=b-v[k];b=au(j,b,_)}const N=y.fn({...a,[P]:T,[C]:b});return{...N,data:{x:N.x-l,y:N.y-o,enabled:{[P]:m,[C]:f}}}}}},E4=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:o,placement:c,rects:d,middlewareData:m}=a,{offset:f=0,mainAxis:y=!0,crossAxis:g=!0}=Rr(r,a),p={x:l,y:o},v=or(c),C=Ou(v);let P=p[C],T=p[v];const b=Rr(f,a),N=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(y){const j=C==="y"?"height":"width",_=d.reference[C]-d.floating[j]+N.mainAxis,U=d.reference[C]+d.reference[j]-N.mainAxis;P<_?P=_:P>U&&(P=U)}if(g){var w,k;const j=C==="y"?"width":"height",_=L0.has(Ir(c)),U=d.reference[v]-d.floating[j]+(_&&((w=m.offset)==null?void 0:w[v])||0)+(_?0:N.crossAxis),V=d.reference[v]+d.reference[j]+(_?0:((k=m.offset)==null?void 0:k[v])||0)-(_?N.crossAxis:0);TV&&(T=V)}return{[C]:P,[v]:T}}}},P4=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,o;const{placement:c,rects:d,platform:m,elements:f}=a,{apply:y=()=>{},...g}=Rr(r,a),p=await m.detectOverflow(a,g),v=Ir(c),C=Ua(c),P=or(c)==="y",{width:T,height:b}=d.floating;let N,w;v==="top"||v==="bottom"?(N=v,w=C===(await(m.isRTL==null?void 0:m.isRTL(f.floating))?"start":"end")?"left":"right"):(w=v,N=C==="end"?"top":"bottom");const k=b-p.top-p.bottom,j=T-p.left-p.right,_=fn(b-p[N],k),U=fn(T-p[w],j),V=!a.middlewareData.shift;let I=_,R=U;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(R=j),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(I=k),V&&!C){const Y=ws(p.left,0),ne=ws(p.right,0),ae=ws(p.top,0),q=ws(p.bottom,0);P?R=T-2*(Y!==0||ne!==0?Y+ne:ws(p.left,p.right)):I=b-2*(ae!==0||q!==0?ae+q:ws(p.top,p.bottom))}await y({...a,availableWidth:R,availableHeight:I});const E=await m.getDimensions(f.floating);return T!==E.width||b!==E.height?{reset:{rects:!0}}:{}}}};function Io(){return typeof window<"u"}function Va(r){return O0(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=(O0(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function O0(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 fx(r){return!Io()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Ss(r).ShadowRoot}const T4=new Set(["inline","contents"]);function Bl(r){const{overflow:a,overflowX:l,overflowY:o,display:c}=Js(r);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!T4.has(c)}const R4=new Set(["table","td","th"]);function I4(r){return R4.has(Va(r))}const _4=[":popover-open",":modal"];function _o(r){return _4.some(a=>{try{return r.matches(a)}catch{return!1}})}const M4=["transform","translate","scale","rotate","perspective"],A4=["transform","translate","scale","rotate","perspective","filter"],D4=["paint","layout","strict","content"];function $u(r){const a=Bu(),l=Xs(r)?Js(r):r;return M4.some(o=>l[o]?l[o]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||A4.some(o=>(l.willChange||"").includes(o))||D4.some(o=>(l.contain||"").includes(o))}function L4(r){let a=xn(r);for(;dr(a)&&!Da(a);){if($u(a))return a;if(_o(a))return null;a=xn(a)}return null}function Bu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const O4=new Set(["html","body","#document"]);function Da(r){return O4.has(Va(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(Va(r)==="html")return r;const a=r.assignedSlot||r.parentNode||fx(r)&&r.host||ur(r);return fx(a)?a.host:a}function F0(r){const a=xn(r);return Da(a)?r.ownerDocument?r.ownerDocument.body:r.body:dr(a)&&Bl(a)?a:F0(a)}function Ll(r,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=F0(r),d=c===((o=r.ownerDocument)==null?void 0:o.body),m=Ss(c);if(d){const f=iu(m);return a.concat(m,m.visualViewport||[],Bl(c)?c:[],f&&l?Ll(f):[])}return a.concat(c,Ll(c,[],l))}function iu(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function z0(r){const a=Js(r);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=dr(r),d=c?r.offsetWidth:l,m=c?r.offsetHeight:o,f=po(l)!==d||po(o)!==m;return f&&(l=d,o=m),{width:l,height:o,$:f}}function Uu(r){return Xs(r)?r:r.contextElement}function _a(r){const a=Uu(r);if(!dr(a))return cr(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:d}=z0(a);let m=(d?po(l.width):l.width)/o,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 F4=cr(0);function $0(r){const a=Ss(r);return!Bu()||!a.visualViewport?F4:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function z4(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==Ss(r)?!1:a}function Hn(r,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),d=Uu(r);let m=cr(1);a&&(o?Xs(o)&&(m=_a(o)):m=_a(r));const f=z4(d,l,o)?$0(d):cr(0);let y=(c.left+f.x)/m.x,g=(c.top+f.y)/m.y,p=c.width/m.x,v=c.height/m.y;if(d){const C=Ss(d),P=o&&Xs(o)?Ss(o):o;let T=C,b=iu(T);for(;b&&o&&P!==T;){const N=_a(b),w=b.getBoundingClientRect(),k=Js(b),j=w.left+(b.clientLeft+parseFloat(k.paddingLeft))*N.x,_=w.top+(b.clientTop+parseFloat(k.paddingTop))*N.y;y*=N.x,g*=N.y,p*=N.x,v*=N.y,y+=j,g+=_,T=Ss(b),b=iu(T)}}return yo({width:p,height:v,x:y,y:g})}function Ao(r,a){const l=Mo(r).scrollLeft;return a?a.left+l:Hn(ur(r)).left+l}function B0(r,a){const l=r.getBoundingClientRect(),o=l.left+a.scrollLeft-Ao(r,l),c=l.top+a.scrollTop;return{x:o,y:c}}function $4(r){let{elements:a,rect:l,offsetParent:o,strategy:c}=r;const d=c==="fixed",m=ur(o),f=a?_o(a.floating):!1;if(o===m||f&&d)return l;let y={scrollLeft:0,scrollTop:0},g=cr(1);const p=cr(0),v=dr(o);if((v||!v&&!d)&&((Va(o)!=="body"||Bl(m))&&(y=Mo(o)),dr(o))){const P=Hn(o);g=_a(o),p.x=P.x+o.clientLeft,p.y=P.y+o.clientTop}const C=m&&!v&&!d?B0(m,y):cr(0);return{width:l.width*g.x,height:l.height*g.y,x:l.x*g.x-y.scrollLeft*g.x+p.x+C.x,y:l.y*g.y-y.scrollTop*g.y+p.y+C.y}}function B4(r){return Array.from(r.getClientRects())}function U4(r){const a=ur(r),l=Mo(r),o=r.ownerDocument.body,c=ws(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),d=ws(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let m=-l.scrollLeft+Ao(r);const f=-l.scrollTop;return Js(o).direction==="rtl"&&(m+=ws(a.clientWidth,o.clientWidth)-c),{width:c,height:d,x:m,y:f}}const xx=25;function V4(r,a){const l=Ss(r),o=ur(r),c=l.visualViewport;let d=o.clientWidth,m=o.clientHeight,f=0,y=0;if(c){d=c.width,m=c.height;const p=Bu();(!p||p&&a==="fixed")&&(f=c.offsetLeft,y=c.offsetTop)}const g=Ao(o);if(g<=0){const p=o.ownerDocument,v=p.body,C=getComputedStyle(v),P=p.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,T=Math.abs(o.clientWidth-v.clientWidth-P);T<=xx&&(d-=T)}else g<=xx&&(d+=g);return{width:d,height:m,x:f,y}}const W4=new Set(["absolute","fixed"]);function H4(r,a){const l=Hn(r,!0,a==="fixed"),o=l.top+r.clientTop,c=l.left+r.clientLeft,d=dr(r)?_a(r):cr(1),m=r.clientWidth*d.x,f=r.clientHeight*d.y,y=c*d.x,g=o*d.y;return{width:m,height:f,x:y,y:g}}function px(r,a,l){let o;if(a==="viewport")o=V4(r,l);else if(a==="document")o=U4(ur(r));else if(Xs(a))o=H4(a,l);else{const c=$0(r);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return yo(o)}function U0(r,a){const l=xn(r);return l===a||!Xs(l)||Da(l)?!1:Js(l).position==="fixed"||U0(l,a)}function K4(r,a){const l=a.get(r);if(l)return l;let o=Ll(r,[],!1).filter(f=>Xs(f)&&Va(f)!=="body"),c=null;const d=Js(r).position==="fixed";let m=d?xn(r):r;for(;Xs(m)&&!Da(m);){const f=Js(m),y=$u(m);!y&&f.position==="fixed"&&(c=null),(d?!y&&!c:!y&&f.position==="static"&&!!c&&W4.has(c.position)||Bl(m)&&!y&&U0(r,m))?o=o.filter(p=>p!==m):c=f,m=xn(m)}return a.set(r,o),o}function G4(r){let{element:a,boundary:l,rootBoundary:o,strategy:c}=r;const m=[...l==="clippingAncestors"?_o(a)?[]:K4(a,this._c):[].concat(l),o],f=m[0],y=m.reduce((g,p)=>{const v=px(a,p,c);return g.top=ws(v.top,g.top),g.right=fn(v.right,g.right),g.bottom=fn(v.bottom,g.bottom),g.left=ws(v.left,g.left),g},px(a,f,c));return{width:y.right-y.left,height:y.bottom-y.top,x:y.left,y:y.top}}function Y4(r){const{width:a,height:l}=z0(r);return{width:a,height:l}}function Q4(r,a,l){const o=dr(a),c=ur(a),d=l==="fixed",m=Hn(r,!0,d,a);let f={scrollLeft:0,scrollTop:0};const y=cr(0);function g(){y.x=Ao(c)}if(o||!o&&!d)if((Va(a)!=="body"||Bl(c))&&(f=Mo(a)),o){const P=Hn(a,!0,d,a);y.x=P.x+a.clientLeft,y.y=P.y+a.clientTop}else c&&g();d&&!o&&c&&g();const p=c&&!o&&!d?B0(c,f):cr(0),v=m.left+f.scrollLeft-y.x-p.x,C=m.top+f.scrollTop-y.y-p.y;return{x:v,y:C,width:m.width,height:m.height}}function zd(r){return Js(r).position==="static"}function gx(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 V0(r,a){const l=Ss(r);if(_o(r))return l;if(!dr(r)){let c=xn(r);for(;c&&!Da(c);){if(Xs(c)&&!zd(c))return c;c=xn(c)}return l}let o=gx(r,a);for(;o&&I4(o)&&zd(o);)o=gx(o,a);return o&&Da(o)&&zd(o)&&!$u(o)?l:o||L4(r)||l}const q4=async function(r){const a=this.getOffsetParent||V0,l=this.getDimensions,o=await l(r.floating);return{reference:Q4(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function X4(r){return Js(r).direction==="rtl"}const J4={convertOffsetParentRelativeRectToViewportRelativeRect:$4,getDocumentElement:ur,getClippingRect:G4,getOffsetParent:V0,getElementRects:q4,getClientRects:B4,getDimensions:Y4,getScale:_a,isElement:Xs,isRTL:X4};function W0(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function Z4(r,a){let l=null,o;const c=ur(r);function d(){var f;clearTimeout(o),(f=l)==null||f.disconnect(),l=null}function m(f,y){f===void 0&&(f=!1),y===void 0&&(y=1),d();const g=r.getBoundingClientRect(),{left:p,top:v,width:C,height:P}=g;if(f||a(),!C||!P)return;const T=ro(v),b=ro(c.clientWidth-(p+C)),N=ro(c.clientHeight-(v+P)),w=ro(p),j={rootMargin:-T+"px "+-b+"px "+-N+"px "+-w+"px",threshold:ws(0,fn(1,y))||1};let _=!0;function U(V){const I=V[0].intersectionRatio;if(I!==y){if(!_)return m();I?m(!1,I):o=setTimeout(()=>{m(!1,1e-7)},1e3)}I===1&&!W0(g,r.getBoundingClientRect())&&m(),_=!1}try{l=new IntersectionObserver(U,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(U,j)}l.observe(r)}return m(!0),d}function eS(r,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:y=!1}=o,g=Uu(r),p=c||d?[...g?Ll(g):[],...Ll(a)]:[];p.forEach(w=>{c&&w.addEventListener("scroll",l,{passive:!0}),d&&w.addEventListener("resize",l)});const v=g&&f?Z4(g,l):null;let C=-1,P=null;m&&(P=new ResizeObserver(w=>{let[k]=w;k&&k.target===g&&P&&(P.unobserve(a),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var j;(j=P)==null||j.observe(a)})),l()}),g&&!y&&P.observe(g),P.observe(a));let T,b=y?Hn(r):null;y&&N();function N(){const w=Hn(r);b&&!W0(b,w)&&l(),b=w,T=requestAnimationFrame(N)}return l(),()=>{var w;p.forEach(k=>{c&&k.removeEventListener("scroll",l),d&&k.removeEventListener("resize",l)}),v==null||v(),(w=P)==null||w.disconnect(),P=null,y&&cancelAnimationFrame(T)}}const tS=C4,sS=k4,rS=N4,nS=P4,aS=w4,yx=b4,lS=E4,iS=(r,a,l)=>{const o=new Map,c={platform:J4,...l},d={...c.platform,_c:o};return j4(r,a,{...c,platform:d})};var oS=typeof document<"u",cS=function(){},lo=oS?h.useLayoutEffect:cS;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,o,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!vo(r[o],a[o]))return!1;return!0}if(c=Object.keys(r),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const d=c[o];if(!(d==="_owner"&&r.$$typeof)&&!vo(r[d],a[d]))return!1}return!0}return r!==r&&a!==a}function H0(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function vx(r,a){const l=H0(r);return Math.round(a*l)/l}function $d(r){const a=h.useRef(r);return lo(()=>{a.current=r}),a}function dS(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:d,floating:m}={},transform:f=!0,whileElementsMounted:y,open:g}=r,[p,v]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[C,P]=h.useState(o);vo(C,o)||P(o);const[T,b]=h.useState(null),[N,w]=h.useState(null),k=h.useCallback(B=>{B!==V.current&&(V.current=B,b(B))},[]),j=h.useCallback(B=>{B!==I.current&&(I.current=B,w(B))},[]),_=d||T,U=m||N,V=h.useRef(null),I=h.useRef(null),R=h.useRef(p),E=y!=null,Y=$d(y),ne=$d(c),ae=$d(g),q=h.useCallback(()=>{if(!V.current||!I.current)return;const B={placement:a,strategy:l,middleware:C};ne.current&&(B.platform=ne.current),iS(V.current,I.current,B).then(ce=>{const K={...ce,isPositioned:ae.current!==!1};se.current&&!vo(R.current,K)&&(R.current=K,Ol.flushSync(()=>{v(K)}))})},[C,a,l,ne,ae]);lo(()=>{g===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,v(B=>({...B,isPositioned:!1})))},[g]);const se=h.useRef(!1);lo(()=>(se.current=!0,()=>{se.current=!1}),[]),lo(()=>{if(_&&(V.current=_),U&&(I.current=U),_&&U){if(Y.current)return Y.current(_,U,q);q()}},[_,U,q,Y,E]);const H=h.useMemo(()=>({reference:V,floating:I,setReference:k,setFloating:j}),[k,j]),ie=h.useMemo(()=>({reference:_,floating:U}),[_,U]),ve=h.useMemo(()=>{const B={position:l,left:0,top:0};if(!ie.floating)return B;const ce=vx(ie.floating,p.x),K=vx(ie.floating,p.y);return f?{...B,transform:"translate("+ce+"px, "+K+"px)",...H0(ie.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:ce,top:K}},[l,f,ie.floating,p.x,p.y]);return h.useMemo(()=>({...p,update:q,refs:H,elements:ie,floatingStyles:ve}),[p,q,H,ie,ve])}const uS=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:o,padding:c}=typeof r=="function"?r(l):r;return o&&a(o)?o.current!=null?yx({element:o.current,padding:c}).fn(l):{}:o?yx({element:o,padding:c}).fn(l):{}}}},hS=(r,a)=>({...tS(r),options:[r,a]}),mS=(r,a)=>({...sS(r),options:[r,a]}),fS=(r,a)=>({...lS(r),options:[r,a]}),xS=(r,a)=>({...rS(r),options:[r,a]}),pS=(r,a)=>({...nS(r),options:[r,a]}),gS=(r,a)=>({...aS(r),options:[r,a]}),yS=(r,a)=>({...uS(r),options:[r,a]});var vS="Arrow",K0=h.forwardRef((r,a)=>{const{children:l,width:o=10,height:c=5,...d}=r;return e.jsx(Xe.svg,{...d,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});K0.displayName=vS;var jS=K0,Vu="Popper",[G0,Y0]=vn(Vu),[bS,Q0]=G0(Vu),q0=r=>{const{__scopePopper:a,children:l}=r,[o,c]=h.useState(null);return e.jsx(bS,{scope:a,anchor:o,onAnchorChange:c,children:l})};q0.displayName=Vu;var X0="PopperAnchor",J0=h.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:o,...c}=r,d=Q0(X0,l),m=h.useRef(null),f=at(a,m),y=h.useRef(null);return h.useEffect(()=>{const g=y.current;y.current=(o==null?void 0:o.current)||m.current,g!==y.current&&d.onAnchorChange(y.current)}),o?null:e.jsx(Xe.div,{...c,ref:f})});J0.displayName=X0;var Wu="PopperContent",[NS,wS]=G0(Wu),Z0=h.forwardRef((r,a)=>{var Q,ge,Se,D,fe,ke;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:d="center",alignOffset:m=0,arrowPadding:f=0,avoidCollisions:y=!0,collisionBoundary:g=[],collisionPadding:p=0,sticky:v="partial",hideWhenDetached:C=!1,updatePositionStrategy:P="optimized",onPlaced:T,...b}=r,N=Q0(Wu,l),[w,k]=h.useState(null),j=at(a,Ve=>k(Ve)),[_,U]=h.useState(null),V=Du(_),I=(V==null?void 0:V.width)??0,R=(V==null?void 0:V.height)??0,E=o+(d!=="center"?"-"+d:""),Y=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},ne=Array.isArray(g)?g:[g],ae=ne.length>0,q={padding:Y,boundary:ne.filter(CS),altBoundary:ae},{refs:se,floatingStyles:H,placement:ie,isPositioned:ve,middlewareData:B}=dS({strategy:"fixed",placement:E,whileElementsMounted:(...Ve)=>eS(...Ve,{animationFrame:P==="always"}),elements:{reference:N.anchor},middleware:[hS({mainAxis:c+R,alignmentAxis:m}),y&&mS({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?fS():void 0,...q}),y&&xS({...q}),pS({...q,apply:({elements:Ve,rects:We,availableWidth:Ke,availableHeight:tt})=>{const{width:ze,height:he}=We.reference,xe=Ve.floating.style;xe.setProperty("--radix-popper-available-width",`${Ke}px`),xe.setProperty("--radix-popper-available-height",`${tt}px`),xe.setProperty("--radix-popper-anchor-width",`${ze}px`),xe.setProperty("--radix-popper-anchor-height",`${he}px`)}}),_&&yS({element:_,padding:f}),kS({arrowWidth:I,arrowHeight:R}),C&&gS({strategy:"referenceHidden",...q})]}),[ce,K]=sg(ie),A=mn(T);Zt(()=>{ve&&(A==null||A())},[ve,A]);const O=(Q=B.arrow)==null?void 0:Q.x,L=(ge=B.arrow)==null?void 0:ge.y,J=((Se=B.arrow)==null?void 0:Se.centerOffset)!==0,[G,de]=h.useState();return Zt(()=>{w&&de(window.getComputedStyle(w).zIndex)},[w]),e.jsx("div",{ref:se.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ve?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(D=B.transformOrigin)==null?void 0:D.x,(fe=B.transformOrigin)==null?void 0:fe.y].join(" "),...((ke=B.hide)==null?void 0:ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:e.jsx(NS,{scope:l,placedSide:ce,onArrowChange:U,arrowX:O,arrowY:L,shouldHideArrow:J,children:e.jsx(Xe.div,{"data-side":ce,"data-align":K,...b,ref:j,style:{...b.style,animation:ve?void 0:"none"}})})})});Z0.displayName=Wu;var eg="PopperArrow",SS={top:"bottom",right:"left",bottom:"top",left:"right"},tg=h.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,d=wS(eg,o),m=SS[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(jS,{...c,ref:l,style:{...c.style,display:"block"}})})});tg.displayName=eg;function CS(r){return r!==null}var kS=r=>({name:"transformOrigin",options:r,fn(a){var N,w,k;const{placement:l,rects:o,middlewareData:c}=a,m=((N=c.arrow)==null?void 0:N.centerOffset)!==0,f=m?0:r.arrowWidth,y=m?0:r.arrowHeight,[g,p]=sg(l),v={start:"0%",center:"50%",end:"100%"}[p],C=(((w=c.arrow)==null?void 0:w.x)??0)+f/2,P=(((k=c.arrow)==null?void 0:k.y)??0)+y/2;let T="",b="";return g==="bottom"?(T=m?v:`${C}px`,b=`${-y}px`):g==="top"?(T=m?v:`${C}px`,b=`${o.floating.height+y}px`):g==="right"?(T=`${-y}px`,b=m?v:`${P}px`):g==="left"&&(T=`${o.floating.width+y}px`,b=m?v:`${P}px`),{data:{x:T,y:b}}}});function sg(r){const[a,l="center"]=r.split("-");return[a,l]}var ES=q0,PS=J0,TS=Z0,RS=tg,rg=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),IS="VisuallyHidden",_S=h.forwardRef((r,a)=>e.jsx(Xe.span,{...r,ref:a,style:{...rg,...r.style}}));_S.displayName=IS;var MS=[" ","Enter","ArrowUp","ArrowDown"],AS=[" ","Enter"],Kn="Select",[Do,Lo,DS]=_u(Kn),[Wa]=vn(Kn,[DS,Y0]),Oo=Y0(),[LS,jn]=Wa(Kn),[OS,FS]=Wa(Kn),ng=r=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:d,value:m,defaultValue:f,onValueChange:y,dir:g,name:p,autoComplete:v,disabled:C,required:P,form:T}=r,b=Oo(a),[N,w]=h.useState(null),[k,j]=h.useState(null),[_,U]=h.useState(!1),V=Eo(g),[I,R]=Vn({prop:o,defaultProp:c??!1,onChange:d,caller:Kn}),[E,Y]=Vn({prop:m,defaultProp:f,onChange:y,caller:Kn}),ne=h.useRef(null),ae=N?T||!!N.closest("form"):!0,[q,se]=h.useState(new Set),H=Array.from(q).map(ie=>ie.props.value).join(";");return e.jsx(ES,{...b,children:e.jsxs(LS,{required:P,scope:a,trigger:N,onTriggerChange:w,valueNode:k,onValueNodeChange:j,valueNodeHasChildren:_,onValueNodeHasChildrenChange:U,contentId:un(),value:E,onValueChange:Y,open:I,onOpenChange:R,dir:V,triggerPointerDownPosRef:ne,disabled:C,children:[e.jsx(Do.Provider,{scope:a,children:e.jsx(OS,{scope:r.__scopeSelect,onNativeOptionAdd:h.useCallback(ie=>{se(ve=>new Set(ve).add(ie))},[]),onNativeOptionRemove:h.useCallback(ie=>{se(ve=>{const B=new Set(ve);return B.delete(ie),B})},[]),children:l})}),ae?e.jsxs(kg,{"aria-hidden":!0,required:P,tabIndex:-1,name:p,autoComplete:v,value:E,onChange:ie=>Y(ie.target.value),disabled:C,form:T,children:[E===void 0?e.jsx("option",{value:""}):null,Array.from(q)]},H):null]})})};ng.displayName=Kn;var ag="SelectTrigger",lg=h.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=r,d=Oo(l),m=jn(ag,l),f=m.disabled||o,y=at(a,m.onTriggerChange),g=Lo(l),p=h.useRef("touch"),[v,C,P]=Pg(b=>{const N=g().filter(j=>!j.disabled),w=N.find(j=>j.value===m.value),k=Tg(N,b,w);k!==void 0&&m.onValueChange(k.value)}),T=b=>{f||(m.onOpenChange(!0),P()),b&&(m.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return e.jsx(PS,{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":Eg(m.value)?"":void 0,...c,ref:y,onClick:Ge(c.onClick,b=>{b.currentTarget.focus(),p.current!=="mouse"&&T(b)}),onPointerDown:Ge(c.onPointerDown,b=>{p.current=b.pointerType;const N=b.target;N.hasPointerCapture(b.pointerId)&&N.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(T(b),b.preventDefault())}),onKeyDown:Ge(c.onKeyDown,b=>{const N=v.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&C(b.key),!(N&&b.key===" ")&&MS.includes(b.key)&&(T(),b.preventDefault())})})})});lg.displayName=ag;var ig="SelectValue",og=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,children:d,placeholder:m="",...f}=r,y=jn(ig,l),{onValueNodeHasChildrenChange:g}=y,p=d!==void 0,v=at(a,y.onValueNodeChange);return Zt(()=>{g(p)},[g,p]),e.jsx(Xe.span,{...f,ref:v,style:{pointerEvents:"none"},children:Eg(y.value)?e.jsx(e.Fragment,{children:m}):d})});og.displayName=ig;var zS="SelectIcon",cg=h.forwardRef((r,a)=>{const{__scopeSelect:l,children:o,...c}=r;return e.jsx(Xe.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});cg.displayName=zS;var $S="SelectPortal",dg=r=>e.jsx(ku,{asChild:!0,...r});dg.displayName=$S;var Gn="SelectContent",ug=h.forwardRef((r,a)=>{const l=jn(Gn,r.__scopeSelect),[o,c]=h.useState();if(Zt(()=>{c(new DocumentFragment)},[]),!l.open){const d=o;return d?Ol.createPortal(e.jsx(hg,{scope:r.__scopeSelect,children:e.jsx(Do.Slot,{scope:r.__scopeSelect,children:e.jsx("div",{children:r.children})})}),d):null}return e.jsx(mg,{...r,ref:a})});ug.displayName=Gn;var Ys=10,[hg,bn]=Wa(Gn),BS="SelectContentImpl",US=Dl("SelectContent.RemoveScroll"),mg=h.forwardRef((r,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:m,side:f,sideOffset:y,align:g,alignOffset:p,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:T,hideWhenDetached:b,avoidCollisions:N,...w}=r,k=jn(Gn,l),[j,_]=h.useState(null),[U,V]=h.useState(null),I=at(a,Q=>_(Q)),[R,E]=h.useState(null),[Y,ne]=h.useState(null),ae=Lo(l),[q,se]=h.useState(!1),H=h.useRef(!1);h.useEffect(()=>{if(j)return Tp(j)},[j]),jp();const ie=h.useCallback(Q=>{const[ge,...Se]=ae().map(ke=>ke.ref.current),[D]=Se.slice(-1),fe=document.activeElement;for(const ke of Q)if(ke===fe||(ke==null||ke.scrollIntoView({block:"nearest"}),ke===ge&&U&&(U.scrollTop=0),ke===D&&U&&(U.scrollTop=U.scrollHeight),ke==null||ke.focus(),document.activeElement!==fe))return},[ae,U]),ve=h.useCallback(()=>ie([R,j]),[ie,R,j]);h.useEffect(()=>{q&&ve()},[q,ve]);const{onOpenChange:B,triggerPointerDownPosRef:ce}=k;h.useEffect(()=>{if(j){let Q={x:0,y:0};const ge=D=>{var fe,ke;Q={x:Math.abs(Math.round(D.pageX)-(((fe=ce.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(D.pageY)-(((ke=ce.current)==null?void 0:ke.y)??0))}},Se=D=>{Q.x<=10&&Q.y<=10?D.preventDefault():j.contains(D.target)||B(!1),document.removeEventListener("pointermove",ge),ce.current=null};return ce.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",Se,{capture:!0})}}},[j,B,ce]),h.useEffect(()=>{const Q=()=>B(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[B]);const[K,A]=Pg(Q=>{const ge=ae().filter(fe=>!fe.disabled),Se=ge.find(fe=>fe.ref.current===document.activeElement),D=Tg(ge,Q,Se);D&&setTimeout(()=>D.ref.current.focus())}),O=h.useCallback((Q,ge,Se)=>{const D=!H.current&&!Se;(k.value!==void 0&&k.value===ge||D)&&(E(Q),D&&(H.current=!0))},[k.value]),L=h.useCallback(()=>j==null?void 0:j.focus(),[j]),J=h.useCallback((Q,ge,Se)=>{const D=!H.current&&!Se;(k.value!==void 0&&k.value===ge||D)&&ne(Q)},[k.value]),G=o==="popper"?ou:fg,de=G===ou?{side:f,sideOffset:y,align:g,alignOffset:p,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:T,hideWhenDetached:b,avoidCollisions:N}:{};return e.jsx(hg,{scope:l,content:j,viewport:U,onViewportChange:V,itemRefCallback:O,selectedItem:R,onItemLeave:L,itemTextRefCallback:J,focusSelectedItem:ve,selectedItemText:Y,position:o,isPositioned:q,searchRef:K,children:e.jsx(Eu,{as:US,allowPinchZoom:!0,children:e.jsx(Cu,{asChild:!0,trapped:k.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Ge(c,Q=>{var ge;(ge=k.trigger)==null||ge.focus({preventScroll:!0}),Q.preventDefault()}),children:e.jsx(Su,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:e.jsx(G,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:Q=>Q.preventDefault(),...w,...de,onPlaced:()=>se(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Ge(w.onKeyDown,Q=>{const ge=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ge&&Q.key.length===1&&A(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let D=ae().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const fe=Q.target,ke=D.indexOf(fe);D=D.slice(ke+1)}setTimeout(()=>ie(D)),Q.preventDefault()}})})})})})})});mg.displayName=BS;var VS="SelectItemAlignedPosition",fg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=r,d=jn(Gn,l),m=bn(Gn,l),[f,y]=h.useState(null),[g,p]=h.useState(null),v=at(a,I=>p(I)),C=Lo(l),P=h.useRef(!1),T=h.useRef(!0),{viewport:b,selectedItem:N,selectedItemText:w,focusSelectedItem:k}=m,j=h.useCallback(()=>{if(d.trigger&&d.valueNode&&f&&g&&b&&N&&w){const I=d.trigger.getBoundingClientRect(),R=g.getBoundingClientRect(),E=d.valueNode.getBoundingClientRect(),Y=w.getBoundingClientRect();if(d.dir!=="rtl"){const fe=Y.left-R.left,ke=E.left-fe,Ve=I.left-ke,We=I.width+Ve,Ke=Math.max(We,R.width),tt=window.innerWidth-Ys,ze=xo(ke,[Ys,Math.max(Ys,tt-Ke)]);f.style.minWidth=We+"px",f.style.left=ze+"px"}else{const fe=R.right-Y.right,ke=window.innerWidth-E.right-fe,Ve=window.innerWidth-I.right-ke,We=I.width+Ve,Ke=Math.max(We,R.width),tt=window.innerWidth-Ys,ze=xo(ke,[Ys,Math.max(Ys,tt-Ke)]);f.style.minWidth=We+"px",f.style.right=ze+"px"}const ne=C(),ae=window.innerHeight-Ys*2,q=b.scrollHeight,se=window.getComputedStyle(g),H=parseInt(se.borderTopWidth,10),ie=parseInt(se.paddingTop,10),ve=parseInt(se.borderBottomWidth,10),B=parseInt(se.paddingBottom,10),ce=H+ie+q+B+ve,K=Math.min(N.offsetHeight*5,ce),A=window.getComputedStyle(b),O=parseInt(A.paddingTop,10),L=parseInt(A.paddingBottom,10),J=I.top+I.height/2-Ys,G=ae-J,de=N.offsetHeight/2,Q=N.offsetTop+de,ge=H+ie+Q,Se=ce-ge;if(ge<=J){const fe=ne.length>0&&N===ne[ne.length-1].ref.current;f.style.bottom="0px";const ke=g.clientHeight-b.offsetTop-b.offsetHeight,Ve=Math.max(G,de+(fe?L:0)+ke+ve),We=ge+Ve;f.style.height=We+"px"}else{const fe=ne.length>0&&N===ne[0].ref.current;f.style.top="0px";const Ve=Math.max(J,H+b.offsetTop+(fe?O:0)+de)+Se;f.style.height=Ve+"px",b.scrollTop=ge-J+b.offsetTop}f.style.margin=`${Ys}px 0`,f.style.minHeight=K+"px",f.style.maxHeight=ae+"px",o==null||o(),requestAnimationFrame(()=>P.current=!0)}},[C,d.trigger,d.valueNode,f,g,b,N,w,d.dir,o]);Zt(()=>j(),[j]);const[_,U]=h.useState();Zt(()=>{g&&U(window.getComputedStyle(g).zIndex)},[g]);const V=h.useCallback(I=>{I&&T.current===!0&&(j(),k==null||k(),T.current=!1)},[j,k]);return e.jsx(HS,{scope:l,contentWrapper:f,shouldExpandOnScrollRef:P,onScrollButtonChange:V,children:e.jsx("div",{ref:y,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:e.jsx(Xe.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});fg.displayName=VS;var WS="SelectPopperPosition",ou=h.forwardRef((r,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=Ys,...d}=r,m=Oo(l);return e.jsx(TS,{...m,...d,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ou.displayName=WS;var[HS,Hu]=Wa(Gn,{}),cu="SelectViewport",xg=h.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:o,...c}=r,d=bn(cu,l),m=Hu(cu,l),f=at(a,d.onViewportChange),y=h.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),e.jsx(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,g=>{const p=g.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:C}=m;if(C!=null&&C.current&&v){const P=Math.abs(y.current-p.scrollTop);if(P>0){const T=window.innerHeight-Ys*2,b=parseFloat(v.style.minHeight),N=parseFloat(v.style.height),w=Math.max(b,N);if(w0?_:0,v.style.justifyContent="flex-end")}}}y.current=p.scrollTop})})})]})});xg.displayName=cu;var pg="SelectGroup",[KS,GS]=Wa(pg),YS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=un();return e.jsx(KS,{scope:l,id:c,children:e.jsx(Xe.div,{role:"group","aria-labelledby":c,...o,ref:a})})});YS.displayName=pg;var gg="SelectLabel",QS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=GS(gg,l);return e.jsx(Xe.div,{id:c.id,...o,ref:a})});QS.displayName=gg;var jo="SelectItem",[qS,yg]=Wa(jo),vg=h.forwardRef((r,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:d,...m}=r,f=jn(jo,l),y=bn(jo,l),g=f.value===o,[p,v]=h.useState(d??""),[C,P]=h.useState(!1),T=at(a,k=>{var j;return(j=y.itemRefCallback)==null?void 0:j.call(y,k,o,c)}),b=un(),N=h.useRef("touch"),w=()=>{c||(f.onValueChange(o),f.onOpenChange(!1))};if(o==="")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(qS,{scope:l,value:o,disabled:c,textId:b,isSelected:g,onItemTextChange:h.useCallback(k=>{v(j=>j||((k==null?void 0:k.textContent)??"").trim())},[]),children:e.jsx(Do.ItemSlot,{scope:l,value:o,disabled:c,textValue:p,children:e.jsx(Xe.div,{role:"option","aria-labelledby":b,"data-highlighted":C?"":void 0,"aria-selected":g&&C,"data-state":g?"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,()=>{N.current!=="mouse"&&w()}),onPointerUp:Ge(m.onPointerUp,()=>{N.current==="mouse"&&w()}),onPointerDown:Ge(m.onPointerDown,k=>{N.current=k.pointerType}),onPointerMove:Ge(m.onPointerMove,k=>{var j;N.current=k.pointerType,c?(j=y.onItemLeave)==null||j.call(y):N.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ge(m.onPointerLeave,k=>{var j;k.currentTarget===document.activeElement&&((j=y.onItemLeave)==null||j.call(y))}),onKeyDown:Ge(m.onKeyDown,k=>{var _;((_=y.searchRef)==null?void 0:_.current)!==""&&k.key===" "||(AS.includes(k.key)&&w(),k.key===" "&&k.preventDefault())})})})})});vg.displayName=jo;var Pl="SelectItemText",jg=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,...d}=r,m=jn(Pl,l),f=bn(Pl,l),y=yg(Pl,l),g=FS(Pl,l),[p,v]=h.useState(null),C=at(a,w=>v(w),y.onItemTextChange,w=>{var k;return(k=f.itemTextRefCallback)==null?void 0:k.call(f,w,y.value,y.disabled)}),P=p==null?void 0:p.textContent,T=h.useMemo(()=>e.jsx("option",{value:y.value,disabled:y.disabled,children:P},y.value),[y.disabled,y.value,P]),{onNativeOptionAdd:b,onNativeOptionRemove:N}=g;return Zt(()=>(b(T),()=>N(T)),[b,N,T]),e.jsxs(e.Fragment,{children:[e.jsx(Xe.span,{id:y.textId,...d,ref:C}),y.isSelected&&m.valueNode&&!m.valueNodeHasChildren?Ol.createPortal(d.children,m.valueNode):null]})});jg.displayName=Pl;var bg="SelectItemIndicator",Ng=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return yg(bg,l).isSelected?e.jsx(Xe.span,{"aria-hidden":!0,...o,ref:a}):null});Ng.displayName=bg;var du="SelectScrollUpButton",wg=h.forwardRef((r,a)=>{const l=bn(du,r.__scopeSelect),o=Hu(du,r.__scopeSelect),[c,d]=h.useState(!1),m=at(a,o.onScrollButtonChange);return Zt(()=>{if(l.viewport&&l.isPositioned){let f=function(){const g=y.scrollTop>0;d(g)};const y=l.viewport;return f(),y.addEventListener("scroll",f),()=>y.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(Cg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:y}=l;f&&y&&(f.scrollTop=f.scrollTop-y.offsetHeight)}}):null});wg.displayName=du;var uu="SelectScrollDownButton",Sg=h.forwardRef((r,a)=>{const l=bn(uu,r.__scopeSelect),o=Hu(uu,r.__scopeSelect),[c,d]=h.useState(!1),m=at(a,o.onScrollButtonChange);return Zt(()=>{if(l.viewport&&l.isPositioned){let f=function(){const g=y.scrollHeight-y.clientHeight,p=Math.ceil(y.scrollTop)y.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(Cg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:y}=l;f&&y&&(f.scrollTop=f.scrollTop+y.offsetHeight)}}):null});Sg.displayName=uu;var Cg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=r,d=bn("SelectScrollButton",l),m=h.useRef(null),f=Lo(l),y=h.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return h.useEffect(()=>()=>y(),[y]),Zt(()=>{var p;const g=f().find(v=>v.ref.current===document.activeElement);(p=g==null?void 0:g.ref.current)==null||p.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(o,50))}),onPointerMove:Ge(c.onPointerMove,()=>{var g;(g=d.onItemLeave)==null||g.call(d),m.current===null&&(m.current=window.setInterval(o,50))}),onPointerLeave:Ge(c.onPointerLeave,()=>{y()})})}),XS="SelectSeparator",JS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return e.jsx(Xe.div,{"aria-hidden":!0,...o,ref:a})});JS.displayName=XS;var hu="SelectArrow",ZS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=Oo(l),d=jn(hu,l),m=bn(hu,l);return d.open&&m.position==="popper"?e.jsx(RS,{...c,...o,ref:a}):null});ZS.displayName=hu;var eC="SelectBubbleInput",kg=h.forwardRef(({__scopeSelect:r,value:a,...l},o)=>{const c=h.useRef(null),d=at(o,c),m=Au(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const y=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(y,"value").set;if(m!==a&&p){const v=new Event("change",{bubbles:!0});p.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(Xe.select,{...l,style:{...rg,...l.style},ref:d,defaultValue:a})});kg.displayName=eC;function Eg(r){return r===""||r===void 0}function Pg(r){const a=mn(r),l=h.useRef(""),o=h.useRef(0),c=h.useCallback(m=>{const f=l.current+m;a(f),(function y(g){l.current=g,window.clearTimeout(o.current),g!==""&&(o.current=window.setTimeout(()=>y(""),1e3))})(f)},[a]),d=h.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,d]}function Tg(r,a,l){const c=a.length>1&&Array.from(a).every(g=>g===a[0])?a[0]:a,d=l?r.indexOf(l):-1;let m=tC(r,Math.max(d,0));c.length===1&&(m=m.filter(g=>g!==l));const y=m.find(g=>g.textValue.toLowerCase().startsWith(c.toLowerCase()));return y!==l?y:void 0}function tC(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var sC=ng,Rg=lg,rC=og,nC=cg,aC=dg,Ig=ug,lC=xg,_g=vg,iC=jg,oC=Ng,cC=wg,dC=Sg;const kl=sC,El=rC,Ea=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(Rg,{ref:o,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(nC,{asChild:!0,children:e.jsx(Ml,{className:"h-4 w-4 opacity-50"})})]}));Ea.displayName=Rg.displayName;const Pa=h.forwardRef(({className:r,children:a,position:l="popper",...o},c)=>e.jsx(aC,{children:e.jsxs(Ig,{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,...o,children:[e.jsx(cC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Wx,{className:"h-4 w-4"})}),e.jsx(lC,{className:"p-1",children:a}),e.jsx(dC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Ml,{className:"h-4 w-4"})})]})}));Pa.displayName=Ig.displayName;const lr=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(_g,{ref:o,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(oC,{children:e.jsx(wo,{className:"h-4 w-4"})})}),e.jsx(iC,{children:a})]}));lr.displayName=_g.displayName;const uC=["一","二","三","四","五","六","七","八","九","十"];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 hC({parts:r,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:d,onAddSectionInPart:m,onAddChapterInPart:f,onDeleteChapter:y,onEditPart:g,onDeletePart:p,onEditChapter:v,selectedSectionIds:C=[],onToggleSectionSelect:P,onShowSectionOrders:T}){const[b,N]=h.useState(null),[w,k]=h.useState(null),j=(E,Y)=>(b==null?void 0:b.type)===E&&(b==null?void 0:b.id)===Y,_=(E,Y)=>(w==null?void 0:w.type)===E&&(w==null?void 0:w.id)===Y,U=h.useCallback(()=>{const E=[];for(const Y of r)for(const ne of Y.chapters)for(const ae of ne.sections)E.push({id:ae.id,partId:Y.id,partTitle:Y.title,chapterId:ne.id,chapterTitle:ne.title});return E},[r]),V=h.useCallback(async(E,Y,ne,ae)=>{var ve;E.preventDefault(),E.stopPropagation();const q=E.dataTransfer.getData("text/plain"),se=Bd(q);if(!se||se.type===Y&&se.id===ne)return;const H=U(),ie=new Map(H.map(B=>[B.id,B]));if(se.type==="part"&&Y==="part"){const B=r.map(L=>L.id),ce=B.indexOf(se.id),K=B.indexOf(ne);if(ce===-1||K===-1)return;const A=[...B];A.splice(ce,1),A.splice(ceG.id===L);if(J)for(const G of J.chapters)for(const de of G.sections){const Q=ie.get(de.id);Q&&O.push(Q)}}await o(O);return}if(se.type==="chapter"&&(Y==="chapter"||Y==="section"||Y==="part")){const B=r.find(Q=>Q.chapters.some(ge=>ge.id===se.id)),ce=B==null?void 0:B.chapters.find(Q=>Q.id===se.id);if(!B||!ce)return;let K,A,O=null;if(Y==="section"){const Q=ie.get(ne);if(!Q)return;K=Q.partId,A=Q.partTitle,O=ne}else if(Y==="chapter"){const Q=r.find(D=>D.chapters.some(fe=>fe.id===ne)),ge=Q==null?void 0:Q.chapters.find(D=>D.id===ne);if(!Q||!ge)return;K=Q.id,A=Q.title;const Se=H.filter(D=>D.chapterId===ne).pop();O=(Se==null?void 0:Se.id)??null}else{const Q=r.find(Se=>Se.id===ne);if(!Q||!Q.chapters[0])return;K=Q.id,A=Q.title;const ge=H.filter(Se=>Se.partId===Q.id&&Se.chapterId===Q.chapters[0].id);O=((ve=ge[ge.length-1])==null?void 0:ve.id)??null}const L=ce.sections.map(Q=>Q.id),J=H.filter(Q=>!L.includes(Q.id));let G=J.length;if(O){const Q=J.findIndex(ge=>ge.id===O);Q>=0&&(G=Q+1)}const de=L.map(Q=>({...ie.get(Q),partId:K,partTitle:A,chapterId:ce.id,chapterTitle:ce.title}));await o([...J.slice(0,G),...de,...J.slice(G)]);return}if(se.type==="section"&&(Y==="section"||Y==="chapter"||Y==="part")){if(!ae)return;const{partId:B,partTitle:ce,chapterId:K,chapterTitle:A}=ae;let O;if(Y==="section")O=H.findIndex(ge=>ge.id===ne);else if(Y==="chapter"){const ge=H.filter(Se=>Se.chapterId===ne).pop();O=ge?H.findIndex(Se=>Se.id===ge.id)+1:H.length}else{const ge=r.find(fe=>fe.id===ne);if(!(ge!=null&&ge.chapters[0]))return;const Se=H.filter(fe=>fe.partId===ge.id&&fe.chapterId===ge.chapters[0].id),D=Se[Se.length-1];O=D?H.findIndex(fe=>fe.id===D.id)+1:0}const L=H.findIndex(ge=>ge.id===se.id);if(L===-1)return;const J=H.filter(ge=>ge.id!==se.id),G=L({onDragEnter:ae=>{ae.preventDefault(),ae.stopPropagation(),ae.dataTransfer.dropEffect="move",k({type:E,id:Y})},onDragOver:ae=>{ae.preventDefault(),ae.stopPropagation(),ae.dataTransfer.dropEffect="move",k({type:E,id:Y})},onDragLeave:()=>k(null),onDrop:ae=>{k(null);const q=Bd(ae.dataTransfer.getData("text/plain"));if(q&&!(E==="section"&&q.type==="section"&&q.id===Y))if(E==="part")if(q.type==="part")V(ae,"part",Y);else{const se=r.find(ie=>ie.id===Y);(se==null?void 0:se.chapters[0])&&ne&&V(ae,"part",Y,ne)}else E==="chapter"&&ne?(q.type==="section"||q.type==="chapter")&&V(ae,"chapter",Y,ne):E==="section"&&ne&&V(ae,"section",Y,ne)}}),R=E=>uC[E]??String(E+1);return e.jsx("div",{className:"space-y-3",children:r.map((E,Y)=>{var ce,K,A,O;const ne=E.title==="序言"||E.title.includes("序言"),ae=E.title==="尾声"||E.title.includes("尾声"),q=E.title==="附录"||E.title.includes("附录"),se=_("part",E.id),H=a.includes(E.id),ie=E.chapters.length,ve=E.chapters.reduce((L,J)=>L+J.sections.length,0);if(ne&&E.chapters.length===1&&E.chapters[0].sections.length===1){const L=E.chapters[0].sections[0],J=_("section",L.id),G={partId:E.id,partTitle:E.title,chapterId:E.chapters[0].id,chapterTitle:E.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+L.id),de.dataTransfer.effectAllowed="move",N({type:"section",id:L.id})},onDragEnd:()=>{N(null),k(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] ${J?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...I("section",L.id,G),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(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:C.includes(L.id),onChange:()=>P(L.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(qs,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[E.chapters[0].title," | ",L.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[L.price===0||L.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",L.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",L.clickCount??0," · 付款 ",L.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(L.hotScore??0).toFixed(1)," · 第",L.hotRank&&L.hotRank>0?L.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(L),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(L),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"})]})]},E.id)}if(E.title==="2026每日派对干货"||E.title.includes("2026每日派对干货")){const L=_("part",E.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${L?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,...I("part",E.id,{partId:E.id,partTitle:E.title,chapterId:((ce=E.chapters[0])==null?void 0:ce.id)??"",chapterTitle:((K=E.chapters[0])==null?void 0:K.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:J=>{J.stopPropagation(),J.dataTransfer.setData("text/plain","part:"+E.id),J.dataTransfer.effectAllowed="move",N({type:"part",id:E.id})},onDragEnd:()=>{N(null),k(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",E.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/50"}`,onClick:()=>l(E.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:E.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ve," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:J=>J.stopPropagation(),onClick:J=>J.stopPropagation(),children:[m&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(E),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(E),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),p&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>p(E),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:[ie,"章"]}),H?e.jsx(Ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(sn,{className:"w-5 h-5 text-gray-500"})]})]}),H&&E.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:E.chapters.map(J=>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:J.title}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:G=>G.stopPropagation(),children:[v&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>v(E,J),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),f&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>f(E),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"})}),y&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>y(E,J),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:J.sections.map(G=>{const de=_("section",G.id);return e.jsxs("div",{draggable:!0,onDragStart:Q=>{Q.stopPropagation(),Q.dataTransfer.setData("text/plain","section:"+G.id),Q.dataTransfer.effectAllowed="move",N({type:"section",id:G.id})},onDragEnd:()=>{N(null),k(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",G.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...I("section",G.id,{partId:E.id,partTitle:E.title,chapterId:J.id,chapterTitle:J.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:C.includes(G.id),onChange:()=>P(G.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[G.id," ",G.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",G.clickCount??0," · 付款 ",G.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(G.hotScore??0).toFixed(1)," · 第",G.hotRank&&G.hotRank>0?G.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(G),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(G),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(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(G),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(G),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]},G.id)})})]},J.id))})]},E.id)}if(q)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:E.chapters.map((L,J)=>L.sections.length>0?L.sections.map(G=>{const de=_("section",G.id);return e.jsxs("div",{draggable:!0,onDragStart:Q=>{Q.stopPropagation(),Q.dataTransfer.setData("text/plain","section:"+G.id),Q.dataTransfer.effectAllowed="move",N({type:"section",id:G.id})},onDragEnd:()=>{N(null),k(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",G.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...I("section",G.id,{partId:E.id,partTitle:E.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(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:C.includes(G.id),onChange:()=>P(G.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300 truncate",children:["附录",J+1," | ",L.title," | ",G.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",G.clickCount??0," · 付款 ",G.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(G.hotScore??0).toFixed(1)," · 第",G.hotRank&&G.hotRank>0?G.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(G),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>c(G),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(Z,{variant:"ghost",size:"sm",onClick:()=>c(G),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>d(G),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"})]},G.id)}):e.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2",children:[e.jsxs("span",{className:"text-sm text-gray-500",children:["附录",J+1," | ",L.title,"(空)"]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},L.id))})]},E.id);if(ae&&E.chapters.length===1&&E.chapters[0].sections.length===1){const L=E.chapters[0].sections[0],J=_("section",L.id),G={partId:E.id,partTitle:E.title,chapterId:E.chapters[0].id,chapterTitle:E.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+L.id),de.dataTransfer.effectAllowed="move",N({type:"section",id:L.id})},onDragEnd:()=>{N(null),k(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] ${J?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...I("section",L.id,G),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(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:C.includes(L.id),onChange:()=>P(L.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(qs,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[E.chapters[0].title," | ",L.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[L.price===0||L.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",L.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",L.clickCount??0," · 付款 ",L.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(L.hotScore??0).toFixed(1)," · 第",L.hotRank&&L.hotRank>0?L.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(L),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(L),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"})]})]},E.id)}return ae?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:E.chapters.map(L=>L.sections.map(J=>{const G=_("section",J.id);return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+J.id),de.dataTransfer.effectAllowed="move",N({type:"section",id:J.id})},onDragEnd:()=>{N(null),k(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${G?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",J.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...I("section",J.id,{partId:E.id,partTitle:E.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(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:C.includes(J.id),onChange:()=>P(J.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300",children:[L.title," | ",J.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",J.clickCount??0," · 付款 ",J.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(J.hotScore??0).toFixed(1)," · 第",J.hotRank&&J.hotRank>0?J.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(J),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(J),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(Er,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(J),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(J),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]})]},J.id)}))})]},E.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${se?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...I("part",E.id,{partId:E.id,partTitle:E.title,chapterId:((A=E.chapters[0])==null?void 0:A.id)??"",chapterTitle:((O=E.chapters[0])==null?void 0:O.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:L=>{L.stopPropagation(),L.dataTransfer.setData("text/plain","part:"+E.id),L.dataTransfer.effectAllowed="move",N({type:"part",id:E.id})},onDragEnd:()=>{N(null),k(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",E.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(E.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:R(Y)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:E.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",ve," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:L=>L.stopPropagation(),onClick:L=>L.stopPropagation(),children:[m&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(E),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(E),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),p&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>p(E),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:[ie,"章"]}),H?e.jsx(Ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(sn,{className:"w-5 h-5 text-gray-500"})]})]}),H&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:E.chapters.map(L=>{const J=_("chapter",L.id);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsxs("div",{draggable:!0,onDragStart:G=>{G.stopPropagation(),G.dataTransfer.setData("text/plain","chapter:"+L.id),G.dataTransfer.effectAllowed="move",N({type:"chapter",id:L.id})},onDragEnd:()=>{N(null),k(null)},onDragEnter:G=>{G.preventDefault(),G.stopPropagation(),G.dataTransfer.dropEffect="move",k({type:"chapter",id:L.id})},onDragOver:G=>{G.preventDefault(),G.stopPropagation(),G.dataTransfer.dropEffect="move",k({type:"chapter",id:L.id})},onDragLeave:()=>k(null),onDrop:G=>{k(null);const de=Bd(G.dataTransfer.getData("text/plain"));if(!de)return;const Q={partId:E.id,partTitle:E.title,chapterId:L.id,chapterTitle:L.title};(de.type==="section"||de.type==="chapter")&&V(G,"chapter",L.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 ${J?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",L.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:L.title})]}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:G=>G.stopPropagation(),children:[v&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>v(E,L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),f&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>f(E),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"})}),y&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>y(E,L),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:L.sections.map(G=>{const de=_("section",G.id);return e.jsxs("div",{draggable:!0,onDragStart:Q=>{Q.stopPropagation(),Q.dataTransfer.setData("text/plain","section:"+G.id),Q.dataTransfer.effectAllowed="move",N({type:"section",id:G.id})},onDragEnd:()=>{N(null),k(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",G.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...I("section",G.id,{partId:E.id,partTitle:E.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:Q=>Q.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(G.id),onChange:()=>P(G.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx(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 ${G.price===0||G.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[G.id," ",G.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:Q=>Q.stopPropagation(),onClick:Q=>Q.stopPropagation(),children:[G.isNew&&e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),G.price===0||G.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",G.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",title:"点击次数 · 付款笔数",children:["点击 ",G.clickCount??0," · 付款 ",G.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(G.hotScore??0).toFixed(1)," · 第",G.hotRank&&G.hotRank>0?G.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(G),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5 shrink-0",children:"付款记录"}),e.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(G),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(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(G),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(G),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"})]})]},G.id)})})]},L.id)})})]},E.id)})})}function mC(r){const a=new Map;for(const f of r){const y=f.partId||"part-1",g=f.partTitle||"未分类",p=f.chapterId||"chapter-1",v=f.chapterTitle||"未分类";a.has(y)||a.set(y,{id:y,title:g,chapters:new Map});const C=a.get(y);C.chapters.has(p)||C.chapters.set(p,{id:p,title:v,sections:[]}),C.chapters.get(p).sections.push({id:f.id,title:f.title,price:f.price??1,filePath:f.filePath,isFree:f.isFree,isNew:f.isNew,clickCount:f.clickCount??0,payCount:f.payCount??0,hotScore:f.hotScore??0,hotRank:f.hotRank??0})}const l="part-2026-daily",o="2026每日派对干货";Array.from(a.values()).some(f=>f.title===o||f.title.includes(o))||a.set(l,{id:l,title:o,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:o,sections:[]}]])});const d=Array.from(a.values()).map(f=>({...f,chapters:Array.from(f.chapters.values())})),m=f=>f.includes("序言")?0:f.includes(o)?1.5:f.includes("附录")?2:f.includes("尾声")?3:1;return d.sort((f,y)=>{const g=m(f.title),p=m(y.title);return g!==p?g-p:0})}function fC(){var $s,ea,ts;const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState([]),[m,f]=h.useState(null),[y,g]=h.useState(!1),[p,v]=h.useState(!1),[C,P]=h.useState(!1),[T,b]=h.useState(""),[N,w]=h.useState([]),[k,j]=h.useState(!1),[_,U]=h.useState(!1),V=h.useRef(null),[I,R]=h.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[E,Y]=h.useState(null),[ne,ae]=h.useState(!1),[q,se]=h.useState(!1),[H,ie]=h.useState(null),[ve,B]=h.useState(!1),[ce,K]=h.useState([]),[A,O]=h.useState(!1),[L,J]=h.useState(""),[G,de]=h.useState(""),[Q,ge]=h.useState(!1),[Se,D]=h.useState(""),[fe,ke]=h.useState(!1),[Ve,We]=h.useState(null),[Ke,tt]=h.useState(!1),[ze,he]=h.useState(!1),[xe,ft]=h.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[es,hr]=h.useState(!1),[Nn,As]=h.useState(!1),Bt=mC(r),Mr=r.length,ct=async()=>{o(!0);try{const F=await $e("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray(F==null?void 0:F.sections)?F.sections:[])}catch(F){console.error(F),a([])}finally{o(!1)}};h.useEffect(()=>{ct()},[]);const gs=F=>{d(oe=>oe.includes(F)?oe.filter(Ce=>Ce!==F):[...oe,F])},wn=h.useCallback(F=>{const oe=r,Ce=F.flatMap(Ee=>{const xt=oe.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:F}).then(Ee=>{Ee&&Ee.success===!1&&(a(oe),alert("排序失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误")))}).catch(Ee=>{a(oe),console.error("排序失败:",Ee),alert("排序失败: "+(Ee instanceof Error?Ee.message:"网络或服务异常"))}),Promise.resolve()},[r]),mr=async F=>{if(confirm(`确定要删除章节「${F.title}」吗?此操作不可恢复。`))try{const oe=await Tr(`/api/db/book?id=${encodeURIComponent(F.id)}`);oe&&oe.success!==!1?(alert("已删除"),ct()):alert("删除失败: "+(oe&&typeof oe=="object"&&"error"in oe?oe.error:"未知错误"))}catch(oe){console.error(oe),alert("删除失败")}},Cs=h.useCallback(async()=>{hr(!0);try{const F=await $e("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),oe=F&&F.data;oe&&typeof oe.readWeight=="number"&&typeof oe.recencyWeight=="number"&&typeof oe.payWeight=="number"&&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{hr(!1)}},[]);h.useEffect(()=>{ze&&Cs()},[ze,Cs]);const Yn=async()=>{const{readWeight:F,recencyWeight:oe,payWeight:Ce}=xe,Ee=F+oe+Ce;if(Math.abs(Ee-1)>.001){alert("三个权重之和必须等于 1");return}As(!0);try{const xt=await mt("/api/db/config",{key:"article_ranking_weights",value:{readWeight:F,recencyWeight:oe,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 F=>{We({section:F,orders:[]}),tt(!0);try{const oe=await $e(`/api/db/book?action=section-orders&id=${encodeURIComponent(F.id)}`),Ce=oe!=null&&oe.success&&Array.isArray(oe.orders)?oe.orders:[];We(Ee=>Ee?{...Ee,orders:Ce}:null)}catch(oe){console.error(oe),We(Ce=>Ce?{...Ce,orders:[]}:null)}finally{tt(!1)}},ks=async F=>{v(!0);try{const oe=await $e(`/api/db/book?action=read&id=${encodeURIComponent(F.id)}`);if(oe!=null&&oe.success&&oe.section){const Ce=oe.section;f({id:F.id,title:oe.section.title??F.title,price:oe.section.price??F.price,content:oe.section.content??"",filePath:F.filePath,isFree:F.isFree||F.price===0,isNew:Ce.isNew??F.isNew})}else f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree,isNew:F.isNew}),oe&&!oe.success&&alert("无法读取文件内容: "+(oe.error||"未知错误"))}catch(oe){console.error(oe),f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree})}finally{v(!1)}},Sn=async()=>{var F;if(m){P(!0);try{let oe=m.content||"";const Ce=[new RegExp(`^#+\\s*${m.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${m.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(F=m.title)==null?void 0:F.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const xt of Ce)oe=oe.replace(xt,"");oe=oe.replace(/^\s*\n+/,"").trim();const Ee=await vt("/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});Ee&&Ee.success!==!1?(alert(`已保存章节: ${m.title}`),f(null),ct()):alert("保存失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(oe){console.error(oe),alert("保存失败")}finally{P(!1)}}},fr=async()=>{if(!I.id||!I.title){alert("请填写章节ID和标题");return}P(!0);try{const F=await vt("/api/db/book",{id:I.id,title:I.title,price:I.price,content:I.content,partId:I.partId,chapterId:I.chapterId,saveToFile:!1});F&&F.success!==!1?(alert(`章节创建成功: ${I.title}`),g(!1),R({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),ct()):alert("创建失败: "+(F&&typeof F=="object"&&"error"in F?F.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{P(!1)}},ys=F=>{R(oe=>{var Ce;return{...oe,partId:F.id,chapterId:((Ce=F.chapters[0])==null?void 0:Ce.id)??"chapter-1"}}),g(!0)},Ds=F=>{Y({id:F.id,title:F.title})},Ls=async()=>{var F;if((F=E==null?void 0:E.title)!=null&&F.trim()){ae(!0);try{const oe=r.map(Ee=>({id:Ee.id,partId:Ee.partId||"part-1",partTitle:Ee.partId===E.id?E.title.trim():Ee.partTitle||"",chapterId:Ee.chapterId||"chapter-1",chapterTitle:Ee.chapterTitle||""})),Ce=await vt("/api/db/book",{action:"reorder",items:oe});Ce&&Ce.success!==!1?(Y(null),ct()):alert("更新篇名失败: "+(Ce&&typeof Ce=="object"&&"error"in Ce?Ce.error:"未知错误"))}catch(oe){console.error(oe),alert("更新篇名失败")}finally{ae(!1)}}},Cn=F=>{const oe=F.chapters.length+1,Ce=`chapter-${F.id}-${oe}-${Date.now()}`;R({id:`${oe}.1`,title:"新章节",price:1,partId:F.id,chapterId:Ce,content:""}),g(!0)},Es=(F,oe)=>{ie({part:F,chapter:oe,title:oe.title})},Os=async()=>{var F;if((F=H==null?void 0:H.title)!=null&&F.trim()){B(!0);try{const oe=r.map(Ee=>({id:Ee.id,partId:Ee.partId||H.part.id,partTitle:Ee.partId===H.part.id?H.part.title:Ee.partTitle||"",chapterId:Ee.chapterId||H.chapter.id,chapterTitle:Ee.partId===H.part.id&&Ee.chapterId===H.chapter.id?H.title.trim():Ee.chapterTitle||""})),Ce=await vt("/api/db/book",{action:"reorder",items:oe});Ce&&Ce.success!==!1?(ie(null),ct()):alert("保存失败: "+(Ce&&typeof Ce=="object"&&"error"in Ce?Ce.error:"未知错误"))}catch(oe){console.error(oe),alert("保存失败")}finally{B(!1)}}},Fs=async(F,oe)=>{const Ce=oe.sections.map(Ee=>Ee.id);if(Ce.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${F.chapters.indexOf(oe)+1}章 | ${oe.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 F=`part-new-${Date.now()}`,oe="chapter-1",Ce=`part-placeholder-${Date.now()}`,Ee=await vt("/api/db/book",{id:Ce,title:"占位节(可编辑)",price:0,content:"",partId:F,partTitle:Se.trim(),chapterId:oe,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Ee&&Ee.success!==!1?(alert(`篇「${Se}」创建成功,请编辑占位节`),se(!1),D(""),ct()):alert("创建失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{ke(!1)}},Xn=async()=>{if(ce.length===0){alert("请先勾选要移动的章节");return}const F=Bt.find(Ce=>Ce.id===L),oe=F==null?void 0:F.chapters.find(Ce=>Ce.id===G);if(!F||!oe||!L||!G){alert("请选择目标篇和章");return}ge(!0);try{const Ce=()=>{const nt=new Set(ce),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:L,partTitle:F.title||L,chapterId:G,chapterTitle:oe.title||G})),er=as.filter(Pt=>!nt.has(Pt.id));let xr=er.length;for(let Pt=er.length-1;Pt>=0;Pt-=1){const z=er[Pt];if(z.partId===L&&z.chapterId===G){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(`已移动 ${ce.length} 节到「${F.title}」-「${oe.title}」`),O(!1),K([]),await ct(),!0):!1},xt={action:"move-sections",sectionIds:ce,targetPartId:L,targetChapterId:G,targetPartTitle:F.title||L,targetChapterTitle:oe.title||G},ns=await vt("/api/db/book",xt);if(ns&&ns.success!==!1)alert(`已移动 ${ns.count??ce.length} 节到「${F.title}」-「${oe.title}」`),O(!1),K([]),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{ge(!1)}},Jn=F=>{K(oe=>oe.includes(F)?oe.filter(Ce=>Ce!==F):[...oe,F])},Zn=async F=>{const oe=r.filter(Ce=>Ce.partId===F.id).map(Ce=>Ce.id);if(oe.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${F.title}」整篇吗?将删除共 ${oe.length} 节内容,此操作不可恢复。`))try{for(const Ce of oe)await Tr(`/api/db/book?id=${encodeURIComponent(Ce)}`);ct()}catch(Ce){console.error(Ce),alert("删除失败")}},kn=async F=>{var Ce,Ee;const oe=(Ce=F.target.files)==null?void 0:Ce[0];if(oe){U(!0);try{const xt=new FormData;xt.append("file",oe),xt.append("folder","book-images");const nt=await(await fetch(Aa("/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=`![${oe.name}](${nt.data.url})`;m&&f({...m,content:(m.content||"")+` +确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;C(A);try{const w=await vt("/api/admin/withdrawals",{id:A,action:"approve"});w!=null&&w.success?E():alert("操作失败: "+((w==null?void 0:w.error)??""))}catch{alert("操作失败")}finally{C(null)}}async function Q(A){const I=prompt("请输入拒绝原因(将返还用户余额):");if(I){C(A);try{const w=await vt("/api/admin/withdrawals",{id:A,action:"reject",errorMessage:I});w!=null&&w.success?E():alert("操作失败: "+((w==null?void 0:w.error)??""))}catch{alert("操作失败")}finally{C(null)}}}function Z(A){switch(A){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:A})}}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(A=>e.jsx(J,{variant:y===A?"default":"outline",size:"sm",onClick:()=>g(A),className:y===A?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:A==="all"?"全部":A==="pending"?"待处理":A==="success"?"已完成":"已拒绝"},A))}),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(A=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4 text-gray-400",children:new Date(A.createdAt??"").toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[A.userAvatar?e.jsx("img",{src:A.userAvatar,alt:A.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:(A.userName??"?").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-white",children:A.userName??"未知"}),e.jsx("p",{className:"text-xs text-gray-500",children:A.userPhone??A.referralCode??(A.userId??"").slice(0,10)})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(A.amount).toFixed(2)]})}),e.jsx("td",{className:"p-4",children:A.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:["¥",A.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:["¥",A.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:["¥",A.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:A.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",A.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):e.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),e.jsxs("td",{className:"p-4",children:[Z(A.status),A.errorMessage&&e.jsx("p",{className:"text-xs text-red-400 mt-1",children:A.errorMessage})]}),e.jsx("td",{className:"p-4 text-gray-400",children:A.processedAt?new Date(A.processedAt).toLocaleString():"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:A.userConfirmedAt?e.jsxs("span",{className:"text-green-400",title:A.userConfirmedAt,children:["已确认 ",new Date(A.userConfirmedAt).toLocaleString()]}):"-"}),e.jsxs("td",{className:"p-4 text-right",children:[(A.status==="pending"||A.status==="pending_confirm")&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(J,{size:"sm",onClick:()=>R(A.id),disabled:N===A.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:()=>Q(A.id),disabled:N===A.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"}),"拒绝"]})]}),(A.status==="success"||A.status==="completed")&&A.transactionId&&e.jsx("span",{className:"text-xs text-gray-500 font-mono",children:A.transactionId})]})]},A.id))})]})}),e.jsx(Qs,{page:p,totalPages:j,total:T,pageSize:k,onPageChange:v,onPageSizeChange:A=>{P(A),v(1)}})]})})})]})}const o4=["top","right","bottom","left"],mn=Math.min,ws=Math.max,po=Math.round,ro=Math.floor,cr=r=>({x:r,y:r}),c4={left:"right",right:"left",bottom:"top",top:"bottom"},d4={start:"end",end:"start"};function au(r,a,l){return ws(r,mn(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 Ou(r){return r==="x"?"y":"x"}function Fu(r){return r==="y"?"height":"width"}const u4=new Set(["top","bottom"]);function or(r){return u4.has(Ir(r))?"y":"x"}function zu(r){return Ou(or(r))}function h4(r,a,l){l===void 0&&(l=!1);const o=Va(r),c=zu(r),u=Fu(c);let m=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(m=go(m)),[m,go(m)]}function m4(r){const a=go(r);return[lu(r),a,lu(a)]}function lu(r){return r.replace(/start|end/g,a=>d4[a])}const cx=["left","right"],dx=["right","left"],f4=["top","bottom"],x4=["bottom","top"];function p4(r,a,l){switch(r){case"top":case"bottom":return l?a?dx:cx:a?cx:dx;case"left":case"right":return a?f4:x4;default:return[]}}function g4(r,a,l,o){const c=Va(r);let u=p4(Ir(r),l==="start",o);return c&&(u=u.map(m=>m+"-"+c),a&&(u=u.concat(u.map(lu)))),u}function go(r){return r.replace(/left|right|bottom|top/g,a=>c4[a])}function y4(r){return{top:0,right:0,bottom:0,left:0,...r}}function D0(r){return typeof r!="number"?y4(r):{top:r,right:r,bottom:r,left:r}}function yo(r){const{x:a,y:l,width:o,height:c}=r;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function ux(r,a,l){let{reference:o,floating:c}=r;const u=or(a),m=zu(a),f=Fu(m),y=Ir(a),g=u==="y",p=o.x+o.width/2-c.width/2,v=o.y+o.height/2-c.height/2,k=o[f]/2-c[f]/2;let P;switch(y){case"top":P={x:p,y:o.y-c.height};break;case"bottom":P={x:p,y:o.y+o.height};break;case"right":P={x:o.x+o.width,y:v};break;case"left":P={x:o.x-c.width,y:v};break;default:P={x:o.x,y:o.y}}switch(Va(a)){case"start":P[m]-=k*(l&&g?-1:1);break;case"end":P[m]+=k*(l&&g?-1:1);break}return P}async function v4(r,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:u,rects:m,elements:f,strategy:y}=r,{boundary:g="clippingAncestors",rootBoundary:p="viewport",elementContext:v="floating",altBoundary:k=!1,padding:P=0}=Rr(a,r),T=D0(P),N=f[k?v==="floating"?"reference":"floating":v],C=yo(await u.getClippingRect({element:(l=await(u.isElement==null?void 0:u.isElement(N)))==null||l?N:N.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(f.floating)),boundary:g,rootBoundary:p,strategy:y})),E=v==="floating"?{x:o,y:c,width:m.floating.width,height:m.floating.height}:m.reference,j=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f.floating)),R=await(u.isElement==null?void 0:u.isElement(j))?await(u.getScale==null?void 0:u.getScale(j))||{x:1,y:1}:{x:1,y:1},Q=yo(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:E,offsetParent:j,strategy:y}):E);return{top:(C.top-Q.top+T.top)/R.y,bottom:(Q.bottom-C.bottom+T.bottom)/R.y,left:(C.left-Q.left+T.left)/R.x,right:(Q.right-C.right+T.right)/R.x}}const j4=async(r,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:m}=l,f=u.filter(Boolean),y=await(m.isRTL==null?void 0:m.isRTL(a));let g=await m.getElementRects({reference:r,floating:a,strategy:c}),{x:p,y:v}=ux(g,o,y),k=o,P={},T=0;for(let N=0;N({name:"arrow",options:r,async fn(a){const{x:l,y:o,placement:c,rects:u,platform:m,elements:f,middlewareData:y}=a,{element:g,padding:p=0}=Rr(r,a)||{};if(g==null)return{};const v=D0(p),k={x:l,y:o},P=zu(c),T=Fu(P),b=await m.getDimensions(g),N=P==="y",C=N?"top":"left",E=N?"bottom":"right",j=N?"clientHeight":"clientWidth",R=u.reference[T]+u.reference[P]-k[P]-u.floating[T],Q=k[P]-u.reference[P],Z=await(m.getOffsetParent==null?void 0:m.getOffsetParent(g));let A=Z?Z[j]:0;(!A||!await(m.isElement==null?void 0:m.isElement(Z)))&&(A=f.floating[j]||u.floating[T]);const I=R/2-Q/2,w=A/2-b[T]/2-1,U=mn(v[C],w),se=mn(v[E],w),le=U,G=A-b[T]-se,re=A/2-b[T]/2+I,H=au(le,re,G),ie=!y.arrow&&Va(c)!=null&&re!==H&&u.reference[T]/2-(rere<=0)){var se,le;const re=(((se=u.flip)==null?void 0:se.index)||0)+1,H=A[re];if(H&&(!(v==="alignment"?E!==or(H):!1)||U.every(z=>or(z.placement)===E?z.overflows[0]>0:!0)))return{data:{index:re,overflows:U},reset:{placement:H}};let ie=(le=U.filter(ve=>ve.overflows[0]<=0).sort((ve,z)=>ve.overflows[1]-z.overflows[1])[0])==null?void 0:le.placement;if(!ie)switch(P){case"bestFit":{var G;const ve=(G=U.filter(z=>{if(Z){const ne=or(z.placement);return ne===E||ne==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(ne=>ne>0).reduce((ne,W)=>ne+W,0)]).sort((z,ne)=>z[1]-ne[1])[0])==null?void 0:G[0];ve&&(ie=ve);break}case"initialPlacement":ie=f;break}if(c!==ie)return{reset:{placement:ie}}}return{}}}};function hx(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function mx(r){return o4.some(a=>r[a]>=0)}const w4=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...u}=Rr(r,a);switch(c){case"referenceHidden":{const m=await o.detectOverflow(a,{...u,elementContext:"reference"}),f=hx(m,l.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:mx(f)}}}case"escaped":{const m=await o.detectOverflow(a,{...u,altBoundary:!0}),f=hx(m,l.floating);return{data:{escapedOffsets:f,escaped:mx(f)}}}default:return{}}}}},L0=new Set(["left","top"]);async function S4(r,a){const{placement:l,platform:o,elements:c}=r,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),m=Ir(l),f=Va(l),y=or(l)==="y",g=L0.has(m)?-1:1,p=u&&y?-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),y?{x:P*p,y:k*g}:{x:k*g,y:P*p}}const C4=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,o;const{x:c,y:u,placement:m,middlewareData:f}=a,y=await S4(a,r);return m===((l=f.offset)==null?void 0:l.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:c+y.x,y:u+y.y,data:{...y,placement:m}}}}},k4=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:o,placement:c,platform:u}=a,{mainAxis:m=!0,crossAxis:f=!1,limiter:y={fn:C=>{let{x:E,y:j}=C;return{x:E,y:j}}},...g}=Rr(r,a),p={x:l,y:o},v=await u.detectOverflow(a,g),k=or(Ir(c)),P=Ou(k);let T=p[P],b=p[k];if(m){const C=P==="y"?"top":"left",E=P==="y"?"bottom":"right",j=T+v[C],R=T-v[E];T=au(j,T,R)}if(f){const C=k==="y"?"top":"left",E=k==="y"?"bottom":"right",j=b+v[C],R=b-v[E];b=au(j,b,R)}const N=y.fn({...a,[P]:T,[k]:b});return{...N,data:{x:N.x-l,y:N.y-o,enabled:{[P]:m,[k]:f}}}}}},E4=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:o,placement:c,rects:u,middlewareData:m}=a,{offset:f=0,mainAxis:y=!0,crossAxis:g=!0}=Rr(r,a),p={x:l,y:o},v=or(c),k=Ou(v);let P=p[k],T=p[v];const b=Rr(f,a),N=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(y){const j=k==="y"?"height":"width",R=u.reference[k]-u.floating[j]+N.mainAxis,Q=u.reference[k]+u.reference[j]-N.mainAxis;PQ&&(P=Q)}if(g){var C,E;const j=k==="y"?"width":"height",R=L0.has(Ir(c)),Q=u.reference[v]-u.floating[j]+(R&&((C=m.offset)==null?void 0:C[v])||0)+(R?0:N.crossAxis),Z=u.reference[v]+u.reference[j]+(R?0:((E=m.offset)==null?void 0:E[v])||0)-(R?N.crossAxis:0);TZ&&(T=Z)}return{[k]:P,[v]:T}}}},P4=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,o;const{placement:c,rects:u,platform:m,elements:f}=a,{apply:y=()=>{},...g}=Rr(r,a),p=await m.detectOverflow(a,g),v=Ir(c),k=Va(c),P=or(c)==="y",{width:T,height:b}=u.floating;let N,C;v==="top"||v==="bottom"?(N=v,C=k===(await(m.isRTL==null?void 0:m.isRTL(f.floating))?"start":"end")?"left":"right"):(C=v,N=k==="end"?"top":"bottom");const E=b-p.top-p.bottom,j=T-p.left-p.right,R=mn(b-p[N],E),Q=mn(T-p[C],j),Z=!a.middlewareData.shift;let A=R,I=Q;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(I=j),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(A=E),Z&&!k){const U=ws(p.left,0),se=ws(p.right,0),le=ws(p.top,0),G=ws(p.bottom,0);P?I=T-2*(U!==0||se!==0?U+se:ws(p.left,p.right)):A=b-2*(le!==0||G!==0?le+G:ws(p.top,p.bottom))}await y({...a,availableWidth:I,availableHeight:A});const w=await m.getDimensions(f.floating);return T!==w.width||b!==w.height?{reset:{rects:!0}}:{}}}};function Io(){return typeof window<"u"}function Wa(r){return O0(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=(O0(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function O0(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 fx(r){return!Io()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Ss(r).ShadowRoot}const T4=new Set(["inline","contents"]);function Bl(r){const{overflow:a,overflowX:l,overflowY:o,display:c}=Js(r);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!T4.has(c)}const R4=new Set(["table","td","th"]);function I4(r){return R4.has(Wa(r))}const _4=[":popover-open",":modal"];function _o(r){return _4.some(a=>{try{return r.matches(a)}catch{return!1}})}const M4=["transform","translate","scale","rotate","perspective"],A4=["transform","translate","scale","rotate","perspective","filter"],D4=["paint","layout","strict","content"];function $u(r){const a=Bu(),l=Xs(r)?Js(r):r;return M4.some(o=>l[o]?l[o]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||A4.some(o=>(l.willChange||"").includes(o))||D4.some(o=>(l.contain||"").includes(o))}function L4(r){let a=fn(r);for(;dr(a)&&!La(a);){if($u(a))return a;if(_o(a))return null;a=fn(a)}return null}function Bu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const O4=new Set(["html","body","#document"]);function La(r){return O4.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 fn(r){if(Wa(r)==="html")return r;const a=r.assignedSlot||r.parentNode||fx(r)&&r.host||ur(r);return fx(a)?a.host:a}function F0(r){const a=fn(r);return La(a)?r.ownerDocument?r.ownerDocument.body:r.body:dr(a)&&Bl(a)?a:F0(a)}function Ll(r,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=F0(r),u=c===((o=r.ownerDocument)==null?void 0:o.body),m=Ss(c);if(u){const f=iu(m);return a.concat(m,m.visualViewport||[],Bl(c)?c:[],f&&l?Ll(f):[])}return a.concat(c,Ll(c,[],l))}function iu(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function z0(r){const a=Js(r);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=dr(r),u=c?r.offsetWidth:l,m=c?r.offsetHeight:o,f=po(l)!==u||po(o)!==m;return f&&(l=u,o=m),{width:l,height:o,$:f}}function Uu(r){return Xs(r)?r:r.contextElement}function Ma(r){const a=Uu(r);if(!dr(a))return cr(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=z0(a);let m=(u?po(l.width):l.width)/o,f=(u?po(l.height):l.height)/c;return(!m||!Number.isFinite(m))&&(m=1),(!f||!Number.isFinite(f))&&(f=1),{x:m,y:f}}const F4=cr(0);function $0(r){const a=Ss(r);return!Bu()||!a.visualViewport?F4:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function z4(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==Ss(r)?!1:a}function Hn(r,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),u=Uu(r);let m=cr(1);a&&(o?Xs(o)&&(m=Ma(o)):m=Ma(r));const f=z4(u,l,o)?$0(u):cr(0);let y=(c.left+f.x)/m.x,g=(c.top+f.y)/m.y,p=c.width/m.x,v=c.height/m.y;if(u){const k=Ss(u),P=o&&Xs(o)?Ss(o):o;let T=k,b=iu(T);for(;b&&o&&P!==T;){const N=Ma(b),C=b.getBoundingClientRect(),E=Js(b),j=C.left+(b.clientLeft+parseFloat(E.paddingLeft))*N.x,R=C.top+(b.clientTop+parseFloat(E.paddingTop))*N.y;y*=N.x,g*=N.y,p*=N.x,v*=N.y,y+=j,g+=R,T=Ss(b),b=iu(T)}}return yo({width:p,height:v,x:y,y:g})}function Ao(r,a){const l=Mo(r).scrollLeft;return a?a.left+l:Hn(ur(r)).left+l}function B0(r,a){const l=r.getBoundingClientRect(),o=l.left+a.scrollLeft-Ao(r,l),c=l.top+a.scrollTop;return{x:o,y:c}}function $4(r){let{elements:a,rect:l,offsetParent:o,strategy:c}=r;const u=c==="fixed",m=ur(o),f=a?_o(a.floating):!1;if(o===m||f&&u)return l;let y={scrollLeft:0,scrollTop:0},g=cr(1);const p=cr(0),v=dr(o);if((v||!v&&!u)&&((Wa(o)!=="body"||Bl(m))&&(y=Mo(o)),dr(o))){const P=Hn(o);g=Ma(o),p.x=P.x+o.clientLeft,p.y=P.y+o.clientTop}const k=m&&!v&&!u?B0(m,y):cr(0);return{width:l.width*g.x,height:l.height*g.y,x:l.x*g.x-y.scrollLeft*g.x+p.x+k.x,y:l.y*g.y-y.scrollTop*g.y+p.y+k.y}}function B4(r){return Array.from(r.getClientRects())}function U4(r){const a=ur(r),l=Mo(r),o=r.ownerDocument.body,c=ws(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),u=ws(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let m=-l.scrollLeft+Ao(r);const f=-l.scrollTop;return Js(o).direction==="rtl"&&(m+=ws(a.clientWidth,o.clientWidth)-c),{width:c,height:u,x:m,y:f}}const xx=25;function V4(r,a){const l=Ss(r),o=ur(r),c=l.visualViewport;let u=o.clientWidth,m=o.clientHeight,f=0,y=0;if(c){u=c.width,m=c.height;const p=Bu();(!p||p&&a==="fixed")&&(f=c.offsetLeft,y=c.offsetTop)}const g=Ao(o);if(g<=0){const p=o.ownerDocument,v=p.body,k=getComputedStyle(v),P=p.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,T=Math.abs(o.clientWidth-v.clientWidth-P);T<=xx&&(u-=T)}else g<=xx&&(u+=g);return{width:u,height:m,x:f,y}}const W4=new Set(["absolute","fixed"]);function H4(r,a){const l=Hn(r,!0,a==="fixed"),o=l.top+r.clientTop,c=l.left+r.clientLeft,u=dr(r)?Ma(r):cr(1),m=r.clientWidth*u.x,f=r.clientHeight*u.y,y=c*u.x,g=o*u.y;return{width:m,height:f,x:y,y:g}}function px(r,a,l){let o;if(a==="viewport")o=V4(r,l);else if(a==="document")o=U4(ur(r));else if(Xs(a))o=H4(a,l);else{const c=$0(r);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return yo(o)}function U0(r,a){const l=fn(r);return l===a||!Xs(l)||La(l)?!1:Js(l).position==="fixed"||U0(l,a)}function K4(r,a){const l=a.get(r);if(l)return l;let o=Ll(r,[],!1).filter(f=>Xs(f)&&Wa(f)!=="body"),c=null;const u=Js(r).position==="fixed";let m=u?fn(r):r;for(;Xs(m)&&!La(m);){const f=Js(m),y=$u(m);!y&&f.position==="fixed"&&(c=null),(u?!y&&!c:!y&&f.position==="static"&&!!c&&W4.has(c.position)||Bl(m)&&!y&&U0(r,m))?o=o.filter(p=>p!==m):c=f,m=fn(m)}return a.set(r,o),o}function G4(r){let{element:a,boundary:l,rootBoundary:o,strategy:c}=r;const m=[...l==="clippingAncestors"?_o(a)?[]:K4(a,this._c):[].concat(l),o],f=m[0],y=m.reduce((g,p)=>{const v=px(a,p,c);return g.top=ws(v.top,g.top),g.right=mn(v.right,g.right),g.bottom=mn(v.bottom,g.bottom),g.left=ws(v.left,g.left),g},px(a,f,c));return{width:y.right-y.left,height:y.bottom-y.top,x:y.left,y:y.top}}function Y4(r){const{width:a,height:l}=z0(r);return{width:a,height:l}}function Q4(r,a,l){const o=dr(a),c=ur(a),u=l==="fixed",m=Hn(r,!0,u,a);let f={scrollLeft:0,scrollTop:0};const y=cr(0);function g(){y.x=Ao(c)}if(o||!o&&!u)if((Wa(a)!=="body"||Bl(c))&&(f=Mo(a)),o){const P=Hn(a,!0,u,a);y.x=P.x+a.clientLeft,y.y=P.y+a.clientTop}else c&&g();u&&!o&&c&&g();const p=c&&!o&&!u?B0(c,f):cr(0),v=m.left+f.scrollLeft-y.x-p.x,k=m.top+f.scrollTop-y.y-p.y;return{x:v,y:k,width:m.width,height:m.height}}function zd(r){return Js(r).position==="static"}function gx(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 V0(r,a){const l=Ss(r);if(_o(r))return l;if(!dr(r)){let c=fn(r);for(;c&&!La(c);){if(Xs(c)&&!zd(c))return c;c=fn(c)}return l}let o=gx(r,a);for(;o&&I4(o)&&zd(o);)o=gx(o,a);return o&&La(o)&&zd(o)&&!$u(o)?l:o||L4(r)||l}const q4=async function(r){const a=this.getOffsetParent||V0,l=this.getDimensions,o=await l(r.floating);return{reference:Q4(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function X4(r){return Js(r).direction==="rtl"}const J4={convertOffsetParentRelativeRectToViewportRelativeRect:$4,getDocumentElement:ur,getClippingRect:G4,getOffsetParent:V0,getElementRects:q4,getClientRects:B4,getDimensions:Y4,getScale:Ma,isElement:Xs,isRTL:X4};function W0(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function Z4(r,a){let l=null,o;const c=ur(r);function u(){var f;clearTimeout(o),(f=l)==null||f.disconnect(),l=null}function m(f,y){f===void 0&&(f=!1),y===void 0&&(y=1),u();const g=r.getBoundingClientRect(),{left:p,top:v,width:k,height:P}=g;if(f||a(),!k||!P)return;const T=ro(v),b=ro(c.clientWidth-(p+k)),N=ro(c.clientHeight-(v+P)),C=ro(p),j={rootMargin:-T+"px "+-b+"px "+-N+"px "+-C+"px",threshold:ws(0,mn(1,y))||1};let R=!0;function Q(Z){const A=Z[0].intersectionRatio;if(A!==y){if(!R)return m();A?m(!1,A):o=setTimeout(()=>{m(!1,1e-7)},1e3)}A===1&&!W0(g,r.getBoundingClientRect())&&m(),R=!1}try{l=new IntersectionObserver(Q,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(Q,j)}l.observe(r)}return m(!0),u}function eS(r,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:y=!1}=o,g=Uu(r),p=c||u?[...g?Ll(g):[],...Ll(a)]:[];p.forEach(C=>{c&&C.addEventListener("scroll",l,{passive:!0}),u&&C.addEventListener("resize",l)});const v=g&&f?Z4(g,l):null;let k=-1,P=null;m&&(P=new ResizeObserver(C=>{let[E]=C;E&&E.target===g&&P&&(P.unobserve(a),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var j;(j=P)==null||j.observe(a)})),l()}),g&&!y&&P.observe(g),P.observe(a));let T,b=y?Hn(r):null;y&&N();function N(){const C=Hn(r);b&&!W0(b,C)&&l(),b=C,T=requestAnimationFrame(N)}return l(),()=>{var C;p.forEach(E=>{c&&E.removeEventListener("scroll",l),u&&E.removeEventListener("resize",l)}),v==null||v(),(C=P)==null||C.disconnect(),P=null,y&&cancelAnimationFrame(T)}}const tS=C4,sS=k4,rS=N4,nS=P4,aS=w4,yx=b4,lS=E4,iS=(r,a,l)=>{const o=new Map,c={platform:J4,...l},u={...c.platform,_c:o};return j4(r,a,{...c,platform:u})};var oS=typeof document<"u",cS=function(){},lo=oS?h.useLayoutEffect:cS;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,o,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!vo(r[o],a[o]))return!1;return!0}if(c=Object.keys(r),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const u=c[o];if(!(u==="_owner"&&r.$$typeof)&&!vo(r[u],a[u]))return!1}return!0}return r!==r&&a!==a}function H0(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function vx(r,a){const l=H0(r);return Math.round(a*l)/l}function $d(r){const a=h.useRef(r);return lo(()=>{a.current=r}),a}function dS(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:m}={},transform:f=!0,whileElementsMounted:y,open:g}=r,[p,v]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[k,P]=h.useState(o);vo(k,o)||P(o);const[T,b]=h.useState(null),[N,C]=h.useState(null),E=h.useCallback(z=>{z!==Z.current&&(Z.current=z,b(z))},[]),j=h.useCallback(z=>{z!==A.current&&(A.current=z,C(z))},[]),R=u||T,Q=m||N,Z=h.useRef(null),A=h.useRef(null),I=h.useRef(p),w=y!=null,U=$d(y),se=$d(c),le=$d(g),G=h.useCallback(()=>{if(!Z.current||!A.current)return;const z={placement:a,strategy:l,middleware:k};se.current&&(z.platform=se.current),iS(Z.current,A.current,z).then(ne=>{const W={...ne,isPositioned:le.current!==!1};re.current&&!vo(I.current,W)&&(I.current=W,Ol.flushSync(()=>{v(W)}))})},[k,a,l,se,le]);lo(()=>{g===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,v(z=>({...z,isPositioned:!1})))},[g]);const re=h.useRef(!1);lo(()=>(re.current=!0,()=>{re.current=!1}),[]),lo(()=>{if(R&&(Z.current=R),Q&&(A.current=Q),R&&Q){if(U.current)return U.current(R,Q,G);G()}},[R,Q,G,U,w]);const H=h.useMemo(()=>({reference:Z,floating:A,setReference:E,setFloating:j}),[E,j]),ie=h.useMemo(()=>({reference:R,floating:Q}),[R,Q]),ve=h.useMemo(()=>{const z={position:l,left:0,top:0};if(!ie.floating)return z;const ne=vx(ie.floating,p.x),W=vx(ie.floating,p.y);return f?{...z,transform:"translate("+ne+"px, "+W+"px)",...H0(ie.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:ne,top:W}},[l,f,ie.floating,p.x,p.y]);return h.useMemo(()=>({...p,update:G,refs:H,elements:ie,floatingStyles:ve}),[p,G,H,ie,ve])}const uS=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:o,padding:c}=typeof r=="function"?r(l):r;return o&&a(o)?o.current!=null?yx({element:o.current,padding:c}).fn(l):{}:o?yx({element:o,padding:c}).fn(l):{}}}},hS=(r,a)=>({...tS(r),options:[r,a]}),mS=(r,a)=>({...sS(r),options:[r,a]}),fS=(r,a)=>({...lS(r),options:[r,a]}),xS=(r,a)=>({...rS(r),options:[r,a]}),pS=(r,a)=>({...nS(r),options:[r,a]}),gS=(r,a)=>({...aS(r),options:[r,a]}),yS=(r,a)=>({...uS(r),options:[r,a]});var vS="Arrow",K0=h.forwardRef((r,a)=>{const{children:l,width:o=10,height:c=5,...u}=r;return e.jsx(Xe.svg,{...u,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});K0.displayName=vS;var jS=K0,Vu="Popper",[G0,Y0]=yn(Vu),[bS,Q0]=G0(Vu),q0=r=>{const{__scopePopper:a,children:l}=r,[o,c]=h.useState(null);return e.jsx(bS,{scope:a,anchor:o,onAnchorChange:c,children:l})};q0.displayName=Vu;var X0="PopperAnchor",J0=h.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:o,...c}=r,u=Q0(X0,l),m=h.useRef(null),f=at(a,m),y=h.useRef(null);return h.useEffect(()=>{const g=y.current;y.current=(o==null?void 0:o.current)||m.current,g!==y.current&&u.onAnchorChange(y.current)}),o?null:e.jsx(Xe.div,{...c,ref:f})});J0.displayName=X0;var Wu="PopperContent",[NS,wS]=G0(Wu),Z0=h.forwardRef((r,a)=>{var Y,ge,Se,D,fe,ke;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:u="center",alignOffset:m=0,arrowPadding:f=0,avoidCollisions:y=!0,collisionBoundary:g=[],collisionPadding:p=0,sticky:v="partial",hideWhenDetached:k=!1,updatePositionStrategy:P="optimized",onPlaced:T,...b}=r,N=Q0(Wu,l),[C,E]=h.useState(null),j=at(a,Ve=>E(Ve)),[R,Q]=h.useState(null),Z=Du(R),A=(Z==null?void 0:Z.width)??0,I=(Z==null?void 0:Z.height)??0,w=o+(u!=="center"?"-"+u:""),U=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},se=Array.isArray(g)?g:[g],le=se.length>0,G={padding:U,boundary:se.filter(CS),altBoundary:le},{refs:re,floatingStyles:H,placement:ie,isPositioned:ve,middlewareData:z}=dS({strategy:"fixed",placement:w,whileElementsMounted:(...Ve)=>eS(...Ve,{animationFrame:P==="always"}),elements:{reference:N.anchor},middleware:[hS({mainAxis:c+I,alignmentAxis:m}),y&&mS({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?fS():void 0,...G}),y&&xS({...G}),pS({...G,apply:({elements:Ve,rects:We,availableWidth:Ke,availableHeight:tt})=>{const{width:ze,height:he}=We.reference,xe=Ve.floating.style;xe.setProperty("--radix-popper-available-width",`${Ke}px`),xe.setProperty("--radix-popper-available-height",`${tt}px`),xe.setProperty("--radix-popper-anchor-width",`${ze}px`),xe.setProperty("--radix-popper-anchor-height",`${he}px`)}}),R&&yS({element:R,padding:f}),kS({arrowWidth:A,arrowHeight:I}),k&&gS({strategy:"referenceHidden",...G})]}),[ne,W]=sg(ie),M=hn(T);Zt(()=>{ve&&(M==null||M())},[ve,M]);const O=(Y=z.arrow)==null?void 0:Y.x,L=(ge=z.arrow)==null?void 0:ge.y,X=((Se=z.arrow)==null?void 0:Se.centerOffset)!==0,[K,de]=h.useState();return Zt(()=>{C&&de(window.getComputedStyle(C).zIndex)},[C]),e.jsx("div",{ref:re.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ve?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(D=z.transformOrigin)==null?void 0:D.x,(fe=z.transformOrigin)==null?void 0:fe.y].join(" "),...((ke=z.hide)==null?void 0:ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:e.jsx(NS,{scope:l,placedSide:ne,onArrowChange:Q,arrowX:O,arrowY:L,shouldHideArrow:X,children:e.jsx(Xe.div,{"data-side":ne,"data-align":W,...b,ref:j,style:{...b.style,animation:ve?void 0:"none"}})})})});Z0.displayName=Wu;var eg="PopperArrow",SS={top:"bottom",right:"left",bottom:"top",left:"right"},tg=h.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,u=wS(eg,o),m=SS[u.placedSide];return e.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:e.jsx(jS,{...c,ref:l,style:{...c.style,display:"block"}})})});tg.displayName=eg;function CS(r){return r!==null}var kS=r=>({name:"transformOrigin",options:r,fn(a){var N,C,E;const{placement:l,rects:o,middlewareData:c}=a,m=((N=c.arrow)==null?void 0:N.centerOffset)!==0,f=m?0:r.arrowWidth,y=m?0:r.arrowHeight,[g,p]=sg(l),v={start:"0%",center:"50%",end:"100%"}[p],k=(((C=c.arrow)==null?void 0:C.x)??0)+f/2,P=(((E=c.arrow)==null?void 0:E.y)??0)+y/2;let T="",b="";return g==="bottom"?(T=m?v:`${k}px`,b=`${-y}px`):g==="top"?(T=m?v:`${k}px`,b=`${o.floating.height+y}px`):g==="right"?(T=`${-y}px`,b=m?v:`${P}px`):g==="left"&&(T=`${o.floating.width+y}px`,b=m?v:`${P}px`),{data:{x:T,y:b}}}});function sg(r){const[a,l="center"]=r.split("-");return[a,l]}var ES=q0,PS=J0,TS=Z0,RS=tg,rg=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),IS="VisuallyHidden",_S=h.forwardRef((r,a)=>e.jsx(Xe.span,{...r,ref:a,style:{...rg,...r.style}}));_S.displayName=IS;var MS=[" ","Enter","ArrowUp","ArrowDown"],AS=[" ","Enter"],Kn="Select",[Do,Lo,DS]=_u(Kn),[Ha]=yn(Kn,[DS,Y0]),Oo=Y0(),[LS,vn]=Ha(Kn),[OS,FS]=Ha(Kn),ng=r=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:u,value:m,defaultValue:f,onValueChange:y,dir:g,name:p,autoComplete:v,disabled:k,required:P,form:T}=r,b=Oo(a),[N,C]=h.useState(null),[E,j]=h.useState(null),[R,Q]=h.useState(!1),Z=Eo(g),[A,I]=Vn({prop:o,defaultProp:c??!1,onChange:u,caller:Kn}),[w,U]=Vn({prop:m,defaultProp:f,onChange:y,caller:Kn}),se=h.useRef(null),le=N?T||!!N.closest("form"):!0,[G,re]=h.useState(new Set),H=Array.from(G).map(ie=>ie.props.value).join(";");return e.jsx(ES,{...b,children:e.jsxs(LS,{required:P,scope:a,trigger:N,onTriggerChange:C,valueNode:E,onValueNodeChange:j,valueNodeHasChildren:R,onValueNodeHasChildrenChange:Q,contentId:dn(),value:w,onValueChange:U,open:A,onOpenChange:I,dir:Z,triggerPointerDownPosRef:se,disabled:k,children:[e.jsx(Do.Provider,{scope:a,children:e.jsx(OS,{scope:r.__scopeSelect,onNativeOptionAdd:h.useCallback(ie=>{re(ve=>new Set(ve).add(ie))},[]),onNativeOptionRemove:h.useCallback(ie=>{re(ve=>{const z=new Set(ve);return z.delete(ie),z})},[]),children:l})}),le?e.jsxs(kg,{"aria-hidden":!0,required:P,tabIndex:-1,name:p,autoComplete:v,value:w,onChange:ie=>U(ie.target.value),disabled:k,form:T,children:[w===void 0?e.jsx("option",{value:""}):null,Array.from(G)]},H):null]})})};ng.displayName=Kn;var ag="SelectTrigger",lg=h.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=r,u=Oo(l),m=vn(ag,l),f=m.disabled||o,y=at(a,m.onTriggerChange),g=Lo(l),p=h.useRef("touch"),[v,k,P]=Pg(b=>{const N=g().filter(j=>!j.disabled),C=N.find(j=>j.value===m.value),E=Tg(N,b,C);E!==void 0&&m.onValueChange(E.value)}),T=b=>{f||(m.onOpenChange(!0),P()),b&&(m.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return e.jsx(PS,{asChild:!0,...u,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":Eg(m.value)?"":void 0,...c,ref:y,onClick:Ge(c.onClick,b=>{b.currentTarget.focus(),p.current!=="mouse"&&T(b)}),onPointerDown:Ge(c.onPointerDown,b=>{p.current=b.pointerType;const N=b.target;N.hasPointerCapture(b.pointerId)&&N.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(T(b),b.preventDefault())}),onKeyDown:Ge(c.onKeyDown,b=>{const N=v.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&k(b.key),!(N&&b.key===" ")&&MS.includes(b.key)&&(T(),b.preventDefault())})})})});lg.displayName=ag;var ig="SelectValue",og=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,children:u,placeholder:m="",...f}=r,y=vn(ig,l),{onValueNodeHasChildrenChange:g}=y,p=u!==void 0,v=at(a,y.onValueNodeChange);return Zt(()=>{g(p)},[g,p]),e.jsx(Xe.span,{...f,ref:v,style:{pointerEvents:"none"},children:Eg(y.value)?e.jsx(e.Fragment,{children:m}):u})});og.displayName=ig;var zS="SelectIcon",cg=h.forwardRef((r,a)=>{const{__scopeSelect:l,children:o,...c}=r;return e.jsx(Xe.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});cg.displayName=zS;var $S="SelectPortal",dg=r=>e.jsx(ku,{asChild:!0,...r});dg.displayName=$S;var Gn="SelectContent",ug=h.forwardRef((r,a)=>{const l=vn(Gn,r.__scopeSelect),[o,c]=h.useState();if(Zt(()=>{c(new DocumentFragment)},[]),!l.open){const u=o;return u?Ol.createPortal(e.jsx(hg,{scope:r.__scopeSelect,children:e.jsx(Do.Slot,{scope:r.__scopeSelect,children:e.jsx("div",{children:r.children})})}),u):null}return e.jsx(mg,{...r,ref:a})});ug.displayName=Gn;var Ys=10,[hg,jn]=Ha(Gn),BS="SelectContentImpl",US=Dl("SelectContent.RemoveScroll"),mg=h.forwardRef((r,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:u,onPointerDownOutside:m,side:f,sideOffset:y,align:g,alignOffset:p,arrowPadding:v,collisionBoundary:k,collisionPadding:P,sticky:T,hideWhenDetached:b,avoidCollisions:N,...C}=r,E=vn(Gn,l),[j,R]=h.useState(null),[Q,Z]=h.useState(null),A=at(a,Y=>R(Y)),[I,w]=h.useState(null),[U,se]=h.useState(null),le=Lo(l),[G,re]=h.useState(!1),H=h.useRef(!1);h.useEffect(()=>{if(j)return Tp(j)},[j]),jp();const ie=h.useCallback(Y=>{const[ge,...Se]=le().map(ke=>ke.ref.current),[D]=Se.slice(-1),fe=document.activeElement;for(const ke of Y)if(ke===fe||(ke==null||ke.scrollIntoView({block:"nearest"}),ke===ge&&Q&&(Q.scrollTop=0),ke===D&&Q&&(Q.scrollTop=Q.scrollHeight),ke==null||ke.focus(),document.activeElement!==fe))return},[le,Q]),ve=h.useCallback(()=>ie([I,j]),[ie,I,j]);h.useEffect(()=>{G&&ve()},[G,ve]);const{onOpenChange:z,triggerPointerDownPosRef:ne}=E;h.useEffect(()=>{if(j){let Y={x:0,y:0};const ge=D=>{var fe,ke;Y={x:Math.abs(Math.round(D.pageX)-(((fe=ne.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(D.pageY)-(((ke=ne.current)==null?void 0:ke.y)??0))}},Se=D=>{Y.x<=10&&Y.y<=10?D.preventDefault():j.contains(D.target)||z(!1),document.removeEventListener("pointermove",ge),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",Se,{capture:!0})}}},[j,z,ne]),h.useEffect(()=>{const Y=()=>z(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[z]);const[W,M]=Pg(Y=>{const ge=le().filter(fe=>!fe.disabled),Se=ge.find(fe=>fe.ref.current===document.activeElement),D=Tg(ge,Y,Se);D&&setTimeout(()=>D.ref.current.focus())}),O=h.useCallback((Y,ge,Se)=>{const D=!H.current&&!Se;(E.value!==void 0&&E.value===ge||D)&&(w(Y),D&&(H.current=!0))},[E.value]),L=h.useCallback(()=>j==null?void 0:j.focus(),[j]),X=h.useCallback((Y,ge,Se)=>{const D=!H.current&&!Se;(E.value!==void 0&&E.value===ge||D)&&se(Y)},[E.value]),K=o==="popper"?ou:fg,de=K===ou?{side:f,sideOffset:y,align:g,alignOffset:p,arrowPadding:v,collisionBoundary:k,collisionPadding:P,sticky:T,hideWhenDetached:b,avoidCollisions:N}:{};return e.jsx(hg,{scope:l,content:j,viewport:Q,onViewportChange:Z,itemRefCallback:O,selectedItem:I,onItemLeave:L,itemTextRefCallback:X,focusSelectedItem:ve,selectedItemText:U,position:o,isPositioned:G,searchRef:W,children:e.jsx(Eu,{as:US,allowPinchZoom:!0,children:e.jsx(Cu,{asChild:!0,trapped:E.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Ge(c,Y=>{var ge;(ge=E.trigger)==null||ge.focus({preventScroll:!0}),Y.preventDefault()}),children:e.jsx(Su,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:e.jsx(K,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:Y=>Y.preventDefault(),...C,...de,onPlaced:()=>re(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:Ge(C.onKeyDown,Y=>{const ge=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!ge&&Y.key.length===1&&M(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let D=le().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const fe=Y.target,ke=D.indexOf(fe);D=D.slice(ke+1)}setTimeout(()=>ie(D)),Y.preventDefault()}})})})})})})});mg.displayName=BS;var VS="SelectItemAlignedPosition",fg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=r,u=vn(Gn,l),m=jn(Gn,l),[f,y]=h.useState(null),[g,p]=h.useState(null),v=at(a,A=>p(A)),k=Lo(l),P=h.useRef(!1),T=h.useRef(!0),{viewport:b,selectedItem:N,selectedItemText:C,focusSelectedItem:E}=m,j=h.useCallback(()=>{if(u.trigger&&u.valueNode&&f&&g&&b&&N&&C){const A=u.trigger.getBoundingClientRect(),I=g.getBoundingClientRect(),w=u.valueNode.getBoundingClientRect(),U=C.getBoundingClientRect();if(u.dir!=="rtl"){const fe=U.left-I.left,ke=w.left-fe,Ve=A.left-ke,We=A.width+Ve,Ke=Math.max(We,I.width),tt=window.innerWidth-Ys,ze=xo(ke,[Ys,Math.max(Ys,tt-Ke)]);f.style.minWidth=We+"px",f.style.left=ze+"px"}else{const fe=I.right-U.right,ke=window.innerWidth-w.right-fe,Ve=window.innerWidth-A.right-ke,We=A.width+Ve,Ke=Math.max(We,I.width),tt=window.innerWidth-Ys,ze=xo(ke,[Ys,Math.max(Ys,tt-Ke)]);f.style.minWidth=We+"px",f.style.right=ze+"px"}const se=k(),le=window.innerHeight-Ys*2,G=b.scrollHeight,re=window.getComputedStyle(g),H=parseInt(re.borderTopWidth,10),ie=parseInt(re.paddingTop,10),ve=parseInt(re.borderBottomWidth,10),z=parseInt(re.paddingBottom,10),ne=H+ie+G+z+ve,W=Math.min(N.offsetHeight*5,ne),M=window.getComputedStyle(b),O=parseInt(M.paddingTop,10),L=parseInt(M.paddingBottom,10),X=A.top+A.height/2-Ys,K=le-X,de=N.offsetHeight/2,Y=N.offsetTop+de,ge=H+ie+Y,Se=ne-ge;if(ge<=X){const fe=se.length>0&&N===se[se.length-1].ref.current;f.style.bottom="0px";const ke=g.clientHeight-b.offsetTop-b.offsetHeight,Ve=Math.max(K,de+(fe?L:0)+ke+ve),We=ge+Ve;f.style.height=We+"px"}else{const fe=se.length>0&&N===se[0].ref.current;f.style.top="0px";const Ve=Math.max(X,H+b.offsetTop+(fe?O:0)+de)+Se;f.style.height=Ve+"px",b.scrollTop=ge-X+b.offsetTop}f.style.margin=`${Ys}px 0`,f.style.minHeight=W+"px",f.style.maxHeight=le+"px",o==null||o(),requestAnimationFrame(()=>P.current=!0)}},[k,u.trigger,u.valueNode,f,g,b,N,C,u.dir,o]);Zt(()=>j(),[j]);const[R,Q]=h.useState();Zt(()=>{g&&Q(window.getComputedStyle(g).zIndex)},[g]);const Z=h.useCallback(A=>{A&&T.current===!0&&(j(),E==null||E(),T.current=!1)},[j,E]);return e.jsx(HS,{scope:l,contentWrapper:f,shouldExpandOnScrollRef:P,onScrollButtonChange:Z,children:e.jsx("div",{ref:y,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}})})})});fg.displayName=VS;var WS="SelectPopperPosition",ou=h.forwardRef((r,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=Ys,...u}=r,m=Oo(l);return e.jsx(TS,{...m,...u,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ou.displayName=WS;var[HS,Hu]=Ha(Gn,{}),cu="SelectViewport",xg=h.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:o,...c}=r,u=jn(cu,l),m=Hu(cu,l),f=at(a,u.onViewportChange),y=h.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),e.jsx(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,g=>{const p=g.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:k}=m;if(k!=null&&k.current&&v){const P=Math.abs(y.current-p.scrollTop);if(P>0){const T=window.innerHeight-Ys*2,b=parseFloat(v.style.minHeight),N=parseFloat(v.style.height),C=Math.max(b,N);if(C0?R:0,v.style.justifyContent="flex-end")}}}y.current=p.scrollTop})})})]})});xg.displayName=cu;var pg="SelectGroup",[KS,GS]=Ha(pg),YS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=dn();return e.jsx(KS,{scope:l,id:c,children:e.jsx(Xe.div,{role:"group","aria-labelledby":c,...o,ref:a})})});YS.displayName=pg;var gg="SelectLabel",QS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=GS(gg,l);return e.jsx(Xe.div,{id:c.id,...o,ref:a})});QS.displayName=gg;var jo="SelectItem",[qS,yg]=Ha(jo),vg=h.forwardRef((r,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:u,...m}=r,f=vn(jo,l),y=jn(jo,l),g=f.value===o,[p,v]=h.useState(u??""),[k,P]=h.useState(!1),T=at(a,E=>{var j;return(j=y.itemRefCallback)==null?void 0:j.call(y,E,o,c)}),b=dn(),N=h.useRef("touch"),C=()=>{c||(f.onValueChange(o),f.onOpenChange(!1))};if(o==="")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(qS,{scope:l,value:o,disabled:c,textId:b,isSelected:g,onItemTextChange:h.useCallback(E=>{v(j=>j||((E==null?void 0:E.textContent)??"").trim())},[]),children:e.jsx(Do.ItemSlot,{scope:l,value:o,disabled:c,textValue:p,children:e.jsx(Xe.div,{role:"option","aria-labelledby":b,"data-highlighted":k?"":void 0,"aria-selected":g&&k,"data-state":g?"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,()=>{N.current!=="mouse"&&C()}),onPointerUp:Ge(m.onPointerUp,()=>{N.current==="mouse"&&C()}),onPointerDown:Ge(m.onPointerDown,E=>{N.current=E.pointerType}),onPointerMove:Ge(m.onPointerMove,E=>{var j;N.current=E.pointerType,c?(j=y.onItemLeave)==null||j.call(y):N.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ge(m.onPointerLeave,E=>{var j;E.currentTarget===document.activeElement&&((j=y.onItemLeave)==null||j.call(y))}),onKeyDown:Ge(m.onKeyDown,E=>{var R;((R=y.searchRef)==null?void 0:R.current)!==""&&E.key===" "||(AS.includes(E.key)&&C(),E.key===" "&&E.preventDefault())})})})})});vg.displayName=jo;var Tl="SelectItemText",jg=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,...u}=r,m=vn(Tl,l),f=jn(Tl,l),y=yg(Tl,l),g=FS(Tl,l),[p,v]=h.useState(null),k=at(a,C=>v(C),y.onItemTextChange,C=>{var E;return(E=f.itemTextRefCallback)==null?void 0:E.call(f,C,y.value,y.disabled)}),P=p==null?void 0:p.textContent,T=h.useMemo(()=>e.jsx("option",{value:y.value,disabled:y.disabled,children:P},y.value),[y.disabled,y.value,P]),{onNativeOptionAdd:b,onNativeOptionRemove:N}=g;return Zt(()=>(b(T),()=>N(T)),[b,N,T]),e.jsxs(e.Fragment,{children:[e.jsx(Xe.span,{id:y.textId,...u,ref:k}),y.isSelected&&m.valueNode&&!m.valueNodeHasChildren?Ol.createPortal(u.children,m.valueNode):null]})});jg.displayName=Tl;var bg="SelectItemIndicator",Ng=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return yg(bg,l).isSelected?e.jsx(Xe.span,{"aria-hidden":!0,...o,ref:a}):null});Ng.displayName=bg;var du="SelectScrollUpButton",wg=h.forwardRef((r,a)=>{const l=jn(du,r.__scopeSelect),o=Hu(du,r.__scopeSelect),[c,u]=h.useState(!1),m=at(a,o.onScrollButtonChange);return Zt(()=>{if(l.viewport&&l.isPositioned){let f=function(){const g=y.scrollTop>0;u(g)};const y=l.viewport;return f(),y.addEventListener("scroll",f),()=>y.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(Cg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:y}=l;f&&y&&(f.scrollTop=f.scrollTop-y.offsetHeight)}}):null});wg.displayName=du;var uu="SelectScrollDownButton",Sg=h.forwardRef((r,a)=>{const l=jn(uu,r.__scopeSelect),o=Hu(uu,r.__scopeSelect),[c,u]=h.useState(!1),m=at(a,o.onScrollButtonChange);return Zt(()=>{if(l.viewport&&l.isPositioned){let f=function(){const g=y.scrollHeight-y.clientHeight,p=Math.ceil(y.scrollTop)y.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(Cg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:y}=l;f&&y&&(f.scrollTop=f.scrollTop+y.offsetHeight)}}):null});Sg.displayName=uu;var Cg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=r,u=jn("SelectScrollButton",l),m=h.useRef(null),f=Lo(l),y=h.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return h.useEffect(()=>()=>y(),[y]),Zt(()=>{var p;const g=f().find(v=>v.ref.current===document.activeElement);(p=g==null?void 0:g.ref.current)==null||p.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(o,50))}),onPointerMove:Ge(c.onPointerMove,()=>{var g;(g=u.onItemLeave)==null||g.call(u),m.current===null&&(m.current=window.setInterval(o,50))}),onPointerLeave:Ge(c.onPointerLeave,()=>{y()})})}),XS="SelectSeparator",JS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return e.jsx(Xe.div,{"aria-hidden":!0,...o,ref:a})});JS.displayName=XS;var hu="SelectArrow",ZS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=Oo(l),u=vn(hu,l),m=jn(hu,l);return u.open&&m.position==="popper"?e.jsx(RS,{...c,...o,ref:a}):null});ZS.displayName=hu;var eC="SelectBubbleInput",kg=h.forwardRef(({__scopeSelect:r,value:a,...l},o)=>{const c=h.useRef(null),u=at(o,c),m=Au(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const y=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(y,"value").set;if(m!==a&&p){const v=new Event("change",{bubbles:!0});p.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(Xe.select,{...l,style:{...rg,...l.style},ref:u,defaultValue:a})});kg.displayName=eC;function Eg(r){return r===""||r===void 0}function Pg(r){const a=hn(r),l=h.useRef(""),o=h.useRef(0),c=h.useCallback(m=>{const f=l.current+m;a(f),(function y(g){l.current=g,window.clearTimeout(o.current),g!==""&&(o.current=window.setTimeout(()=>y(""),1e3))})(f)},[a]),u=h.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,u]}function Tg(r,a,l){const c=a.length>1&&Array.from(a).every(g=>g===a[0])?a[0]:a,u=l?r.indexOf(l):-1;let m=tC(r,Math.max(u,0));c.length===1&&(m=m.filter(g=>g!==l));const y=m.find(g=>g.textValue.toLowerCase().startsWith(c.toLowerCase()));return y!==l?y:void 0}function tC(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var sC=ng,Rg=lg,rC=og,nC=cg,aC=dg,Ig=ug,lC=xg,_g=vg,iC=jg,oC=Ng,cC=wg,dC=Sg;const El=sC,Pl=rC,Ea=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(Rg,{ref:o,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(nC,{asChild:!0,children:e.jsx(Ml,{className:"h-4 w-4 opacity-50"})})]}));Ea.displayName=Rg.displayName;const Pa=h.forwardRef(({className:r,children:a,position:l="popper",...o},c)=>e.jsx(aC,{children:e.jsxs(Ig,{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,...o,children:[e.jsx(cC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Wx,{className:"h-4 w-4"})}),e.jsx(lC,{className:"p-1",children:a}),e.jsx(dC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Ml,{className:"h-4 w-4"})})]})}));Pa.displayName=Ig.displayName;const lr=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(_g,{ref:o,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(oC,{children:e.jsx(wo,{className:"h-4 w-4"})})}),e.jsx(iC,{children:a})]}));lr.displayName=_g.displayName;const uC=["一","二","三","四","五","六","七","八","九","十"];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 hC({parts:r,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:u,onAddSectionInPart:m,onAddChapterInPart:f,onDeleteChapter:y,onEditPart:g,onDeletePart:p,onEditChapter:v,selectedSectionIds:k=[],onToggleSectionSelect:P,onShowSectionOrders:T}){const[b,N]=h.useState(null),[C,E]=h.useState(null),j=(w,U)=>(b==null?void 0:b.type)===w&&(b==null?void 0:b.id)===U,R=(w,U)=>(C==null?void 0:C.type)===w&&(C==null?void 0:C.id)===U,Q=h.useCallback(()=>{const w=[];for(const U of r)for(const se of U.chapters)for(const le of se.sections)w.push({id:le.id,partId:U.id,partTitle:U.title,chapterId:se.id,chapterTitle:se.title});return w},[r]),Z=h.useCallback(async(w,U,se,le)=>{var ve;w.preventDefault(),w.stopPropagation();const G=w.dataTransfer.getData("text/plain"),re=Bd(G);if(!re||re.type===U&&re.id===se)return;const H=Q(),ie=new Map(H.map(z=>[z.id,z]));if(re.type==="part"&&U==="part"){const z=r.map(L=>L.id),ne=z.indexOf(re.id),W=z.indexOf(se);if(ne===-1||W===-1)return;const M=[...z];M.splice(ne,1),M.splice(neK.id===L);if(X)for(const K of X.chapters)for(const de of K.sections){const Y=ie.get(de.id);Y&&O.push(Y)}}await o(O);return}if(re.type==="chapter"&&(U==="chapter"||U==="section"||U==="part")){const z=r.find(Y=>Y.chapters.some(ge=>ge.id===re.id)),ne=z==null?void 0:z.chapters.find(Y=>Y.id===re.id);if(!z||!ne)return;let W,M,O=null;if(U==="section"){const Y=ie.get(se);if(!Y)return;W=Y.partId,M=Y.partTitle,O=se}else if(U==="chapter"){const Y=r.find(D=>D.chapters.some(fe=>fe.id===se)),ge=Y==null?void 0:Y.chapters.find(D=>D.id===se);if(!Y||!ge)return;W=Y.id,M=Y.title;const Se=H.filter(D=>D.chapterId===se).pop();O=(Se==null?void 0:Se.id)??null}else{const Y=r.find(Se=>Se.id===se);if(!Y||!Y.chapters[0])return;W=Y.id,M=Y.title;const ge=H.filter(Se=>Se.partId===Y.id&&Se.chapterId===Y.chapters[0].id);O=((ve=ge[ge.length-1])==null?void 0:ve.id)??null}const L=ne.sections.map(Y=>Y.id),X=H.filter(Y=>!L.includes(Y.id));let K=X.length;if(O){const Y=X.findIndex(ge=>ge.id===O);Y>=0&&(K=Y+1)}const de=L.map(Y=>({...ie.get(Y),partId:W,partTitle:M,chapterId:ne.id,chapterTitle:ne.title}));await o([...X.slice(0,K),...de,...X.slice(K)]);return}if(re.type==="section"&&(U==="section"||U==="chapter"||U==="part")){if(!le)return;const{partId:z,partTitle:ne,chapterId:W,chapterTitle:M}=le;let O;if(U==="section")O=H.findIndex(ge=>ge.id===se);else if(U==="chapter"){const ge=H.filter(Se=>Se.chapterId===se).pop();O=ge?H.findIndex(Se=>Se.id===ge.id)+1:H.length}else{const ge=r.find(fe=>fe.id===se);if(!(ge!=null&&ge.chapters[0]))return;const Se=H.filter(fe=>fe.partId===ge.id&&fe.chapterId===ge.chapters[0].id),D=Se[Se.length-1];O=D?H.findIndex(fe=>fe.id===D.id)+1:0}const L=H.findIndex(ge=>ge.id===re.id);if(L===-1)return;const X=H.filter(ge=>ge.id!==re.id),K=L({onDragEnter:le=>{le.preventDefault(),le.stopPropagation(),le.dataTransfer.dropEffect="move",E({type:w,id:U})},onDragOver:le=>{le.preventDefault(),le.stopPropagation(),le.dataTransfer.dropEffect="move",E({type:w,id:U})},onDragLeave:()=>E(null),onDrop:le=>{E(null);const G=Bd(le.dataTransfer.getData("text/plain"));if(G&&!(w==="section"&&G.type==="section"&&G.id===U))if(w==="part")if(G.type==="part")Z(le,"part",U);else{const re=r.find(ie=>ie.id===U);(re==null?void 0:re.chapters[0])&&se&&Z(le,"part",U,se)}else w==="chapter"&&se?(G.type==="section"||G.type==="chapter")&&Z(le,"chapter",U,se):w==="section"&&se&&Z(le,"section",U,se)}}),I=w=>uC[w]??String(w+1);return e.jsx("div",{className:"space-y-3",children:r.map((w,U)=>{var ne,W,M,O;const se=w.title==="序言"||w.title.includes("序言"),le=w.title==="尾声"||w.title.includes("尾声"),G=w.title==="附录"||w.title.includes("附录"),re=R("part",w.id),H=a.includes(w.id),ie=w.chapters.length,ve=w.chapters.reduce((L,X)=>L+X.sections.length,0);if(se&&w.chapters.length===1&&w.chapters[0].sections.length===1){const L=w.chapters[0].sections[0],X=R("section",L.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:"+L.id),de.dataTransfer.effectAllowed="move",N({type:"section",id:L.id})},onDragEnd:()=>{N(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...A("section",L.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(L.id),onChange:()=>P(L.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(qs,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[w.chapters[0].title," | ",L.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[L.price===0||L.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",L.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",L.clickCount??0," · 付款 ",L.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(L.hotScore??0).toFixed(1)," · 第",L.hotRank&&L.hotRank>0?L.hotRank:"-","名"]}),T&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(L),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),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(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(L),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 L=R("part",w.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${L?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,...A("part",w.id,{partId:w.id,partTitle:w.title,chapterId:((ne=w.chapters[0])==null?void 0:ne.id)??"",chapterTitle:((W=w.chapters[0])==null?void 0:W.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","part:"+w.id),X.dataTransfer.effectAllowed="move",N({type:"part",id:w.id})},onDragEnd:()=>{N(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(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:["共 ",ve," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:X=>X.stopPropagation(),onClick:X=>X.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"})}),g&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),p&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>p(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:[ie,"章"]}),H?e.jsx(Ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(sn,{className:"w-5 h-5 text-gray-500"})]})]}),H&&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(X=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:X.title}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:K=>K.stopPropagation(),children:[v&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>v(w,X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(ht,{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"})}),y&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>y(w,X),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:X.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:Y=>{Y.stopPropagation(),Y.dataTransfer.setData("text/plain","section:"+K.id),Y.dataTransfer.effectAllowed="move",N({type:"section",id:K.id})},onDragEnd:()=>{N(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]":""}`,...A("section",K.id,{partId:w.id,partTitle:w.title,chapterId:X.id,chapterTitle:X.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Sr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:Y=>Y.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked: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(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(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)})})]},X.id))})]},w.id)}if(G)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((L,X)=>L.sections.length>0?L.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:Y=>{Y.stopPropagation(),Y.dataTransfer.setData("text/plain","section:"+K.id),Y.dataTransfer.effectAllowed="move",N({type:"section",id:K.id})},onDragEnd:()=>{N(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]":""}`,...A("section",K.id,{partId:w.id,partTitle:w.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Sr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:Y=>Y.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked: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:["附录",X+1," | ",L.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(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>u(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:["附录",X+1," | ",L.title,"(空)"]}),e.jsx(sn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},L.id))})]},w.id);if(le&&w.chapters.length===1&&w.chapters[0].sections.length===1){const L=w.chapters[0].sections[0],X=R("section",L.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:"+L.id),de.dataTransfer.effectAllowed="move",N({type:"section",id:L.id})},onDragEnd:()=>{N(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",L.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...A("section",L.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(L.id),onChange:()=>P(L.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(qs,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[w.chapters[0].title," | ",L.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:de=>de.stopPropagation(),onClick:de=>de.stopPropagation(),children:[L.price===0||L.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",L.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",L.clickCount??0," · 付款 ",L.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(L.hotScore??0).toFixed(1)," · 第",L.hotRank&&L.hotRank>0?L.hotRank:"-","名"]}),T&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(L),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(L),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(L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(L),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 le?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(L=>L.sections.map(X=>{const K=R("section",X.id);return e.jsxs("div",{draggable:!0,onDragStart:de=>{de.stopPropagation(),de.dataTransfer.setData("text/plain","section:"+X.id),de.dataTransfer.effectAllowed="move",N({type:"section",id:X.id})},onDragEnd:()=>{N(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",X.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...A("section",X.id,{partId:w.id,partTitle:w.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(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(X.id),onChange:()=>P(X.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300",children:[L.title," | ",X.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",X.clickCount??0," · 付款 ",X.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(X.hotScore??0).toFixed(1)," · 第",X.hotRank&&X.hotRank>0?X.hotRank:"-","名"]}),T&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(X),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),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(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(X),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Ht,{className:"w-3.5 h-3.5"})})]})]})]},X.id)}))})]},w.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${re?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...A("part",w.id,{partId:w.id,partTitle:w.title,chapterId:((M=w.chapters[0])==null?void 0:M.id)??"",chapterTitle:((O=w.chapters[0])==null?void 0:O.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:L=>{L.stopPropagation(),L.dataTransfer.setData("text/plain","part:"+w.id),L.dataTransfer.effectAllowed="move",N({type:"part",id:w.id})},onDragEnd:()=>{N(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(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(U)}),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:["共 ",ve," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:L=>L.stopPropagation(),onClick:L=>L.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"})}),g&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(w),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),p&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>p(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:[ie,"章"]}),H?e.jsx(Ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(sn,{className:"w-5 h-5 text-gray-500"})]})]}),H&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:w.chapters.map(L=>{const X=R("chapter",L.id);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","chapter:"+L.id),K.dataTransfer.effectAllowed="move",N({type:"chapter",id:L.id})},onDragEnd:()=>{N(null),E(null)},onDragEnter:K=>{K.preventDefault(),K.stopPropagation(),K.dataTransfer.dropEffect="move",E({type:"chapter",id:L.id})},onDragOver:K=>{K.preventDefault(),K.stopPropagation(),K.dataTransfer.dropEffect="move",E({type:"chapter",id:L.id})},onDragLeave:()=>E(null),onDrop:K=>{E(null);const de=Bd(K.dataTransfer.getData("text/plain"));if(!de)return;const Y={partId:w.id,partTitle:w.title,chapterId:L.id,chapterTitle:L.title};(de.type==="section"||de.type==="chapter")&&Z(K,"chapter",L.id,Y)},className:`flex-1 min-w-0 py-2 px-2 rounded cursor-grab active:cursor-grabbing select-none -mx-2 transition-all duration-200 flex items-center gap-2 ${X?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",L.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:L.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,L),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(ht,{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"})}),y&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>y(w,L),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:L.sections.map(K=>{const de=R("section",K.id);return e.jsxs("div",{draggable:!0,onDragStart:Y=>{Y.stopPropagation(),Y.dataTransfer.setData("text/plain","section:"+K.id),Y.dataTransfer.effectAllowed="move",N({type:"section",id:K.id})},onDragEnd:()=>{N(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"}`,...A("section",K.id,{partId:w.id,partTitle:w.title,chapterId:L.id,chapterTitle:L.title}),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:Y=>Y.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked: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:Y=>Y.stopPropagation(),onClick:Y=>Y.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(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(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)})})]},L.id)})})]},w.id)})})}function mC(r){const a=new Map;for(const f of r){const y=f.partId||"part-1",g=f.partTitle||"未分类",p=f.chapterId||"chapter-1",v=f.chapterTitle||"未分类";a.has(y)||a.set(y,{id:y,title:g,chapters:new Map});const k=a.get(y);k.chapters.has(p)||k.chapters.set(p,{id:p,title:v,sections:[]}),k.chapters.get(p).sections.push({id:f.id,title:f.title,price:f.price??1,filePath:f.filePath,isFree:f.isFree,isNew:f.isNew,clickCount:f.clickCount??0,payCount:f.payCount??0,hotScore:f.hotScore??0,hotRank:f.hotRank??0})}const l="part-2026-daily",o="2026每日派对干货";Array.from(a.values()).some(f=>f.title===o||f.title.includes(o))||a.set(l,{id:l,title:o,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:o,sections:[]}]])});const u=Array.from(a.values()).map(f=>({...f,chapters:Array.from(f.chapters.values())})),m=f=>f.includes("序言")?0:f.includes(o)?1.5:f.includes("附录")?2:f.includes("尾声")?3:1;return u.sort((f,y)=>{const g=m(f.title),p=m(y.title);return g!==p?g-p:0})}function fC(){var $s,ea,ts;const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState([]),[m,f]=h.useState(null),[y,g]=h.useState(!1),[p,v]=h.useState(!1),[k,P]=h.useState(!1),[T,b]=h.useState(""),[N,C]=h.useState([]),[E,j]=h.useState(!1),[R,Q]=h.useState(!1),Z=h.useRef(null),[A,I]=h.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[w,U]=h.useState(null),[se,le]=h.useState(!1),[G,re]=h.useState(!1),[H,ie]=h.useState(null),[ve,z]=h.useState(!1),[ne,W]=h.useState([]),[M,O]=h.useState(!1),[L,X]=h.useState(""),[K,de]=h.useState(""),[Y,ge]=h.useState(!1),[Se,D]=h.useState(""),[fe,ke]=h.useState(!1),[Ve,We]=h.useState(null),[Ke,tt]=h.useState(!1),[ze,he]=h.useState(!1),[xe,ft]=h.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[es,hr]=h.useState(!1),[bn,As]=h.useState(!1),Bt=mC(r),Mr=r.length,ct=async()=>{o(!0);try{const F=await $e("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray(F==null?void 0:F.sections)?F.sections:[])}catch(F){console.error(F),a([])}finally{o(!1)}};h.useEffect(()=>{ct()},[]);const gs=F=>{u(ce=>ce.includes(F)?ce.filter(Ce=>Ce!==F):[...ce,F])},Nn=h.useCallback(F=>{const ce=r,Ce=F.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:F}).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 F=>{if(confirm(`确定要删除章节「${F.title}」吗?此操作不可恢复。`))try{const ce=await Tr(`/api/db/book?id=${encodeURIComponent(F.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 F=await $e("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),ce=F&&F.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(()=>{ze&&Cs()},[ze,Cs]);const Yn=async()=>{const{readWeight:F,recencyWeight:ce,payWeight:Ce}=xe,Ee=F+ce+Ce;if(Math.abs(Ee-1)>.001){alert("三个权重之和必须等于 1");return}As(!0);try{const xt=await mt("/api/db/config",{key:"article_ranking_weights",value:{readWeight:F,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 F=>{We({section:F,orders:[]}),tt(!0);try{const ce=await $e(`/api/db/book?action=section-orders&id=${encodeURIComponent(F.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 F=>{v(!0);try{const ce=await $e(`/api/db/book?action=read&id=${encodeURIComponent(F.id)}`);if(ce!=null&&ce.success&&ce.section){const Ce=ce.section;f({id:F.id,title:ce.section.title??F.title,price:ce.section.price??F.price,content:ce.section.content??"",filePath:F.filePath,isFree:F.isFree||F.price===0,isNew:Ce.isNew??F.isNew})}else f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree,isNew:F.isNew}),ce&&!ce.success&&alert("无法读取文件内容: "+(ce.error||"未知错误"))}catch(ce){console.error(ce),f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree})}finally{v(!1)}},wn=async()=>{var F;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+.*${(F=m.title)==null?void 0:F.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(!A.id||!A.title){alert("请填写章节ID和标题");return}P(!0);try{const F=await vt("/api/db/book",{id:A.id,title:A.title,price:A.price,content:A.content,partId:A.partId,chapterId:A.chapterId,saveToFile:!1});F&&F.success!==!1?(alert(`章节创建成功: ${A.title}`),g(!1),I({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),ct()):alert("创建失败: "+(F&&typeof F=="object"&&"error"in F?F.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{P(!1)}},ys=F=>{I(ce=>{var Ce;return{...ce,partId:F.id,chapterId:((Ce=F.chapters[0])==null?void 0:Ce.id)??"chapter-1"}}),g(!0)},Ds=F=>{U({id:F.id,title:F.title})},Ls=async()=>{var F;if((F=w==null?void 0:w.title)!=null&&F.trim()){le(!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?(U(null),ct()):alert("更新篇名失败: "+(Ce&&typeof Ce=="object"&&"error"in Ce?Ce.error:"未知错误"))}catch(ce){console.error(ce),alert("更新篇名失败")}finally{le(!1)}}},Sn=F=>{const ce=F.chapters.length+1,Ce=`chapter-${F.id}-${ce}-${Date.now()}`;I({id:`${ce}.1`,title:"新章节",price:1,partId:F.id,chapterId:Ce,content:""}),g(!0)},Es=(F,ce)=>{ie({part:F,chapter:ce,title:ce.title})},Os=async()=>{var F;if((F=H==null?void 0:H.title)!=null&&F.trim()){z(!0);try{const ce=r.map(Ee=>({id:Ee.id,partId:Ee.partId||H.part.id,partTitle:Ee.partId===H.part.id?H.part.title:Ee.partTitle||"",chapterId:Ee.chapterId||H.chapter.id,chapterTitle:Ee.partId===H.part.id&&Ee.chapterId===H.chapter.id?H.title.trim():Ee.chapterTitle||""})),Ce=await vt("/api/db/book",{action:"reorder",items:ce});Ce&&Ce.success!==!1?(ie(null),ct()):alert("保存失败: "+(Ce&&typeof Ce=="object"&&"error"in Ce?Ce.error:"未知错误"))}catch(ce){console.error(ce),alert("保存失败")}finally{z(!1)}}},Fs=async(F,ce)=>{const Ce=ce.sections.map(Ee=>Ee.id);if(Ce.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${F.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 F=`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:F,partTitle:Se.trim(),chapterId:ce,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Ee&&Ee.success!==!1?(alert(`篇「${Se}」创建成功,请编辑占位节`),re(!1),D(""),ct()):alert("创建失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{ke(!1)}},Xn=async()=>{if(ne.length===0){alert("请先勾选要移动的章节");return}const F=Bt.find(Ce=>Ce.id===L),ce=F==null?void 0:F.chapters.find(Ce=>Ce.id===K);if(!F||!ce||!L||!K){alert("请选择目标篇和章");return}ge(!0);try{const Ce=()=>{const nt=new Set(ne),as=r.map(Pt=>({id:Pt.id,partId:Pt.partId||"",partTitle:Pt.partTitle||"",chapterId:Pt.chapterId||"",chapterTitle:Pt.chapterTitle||""})),En=as.filter(Pt=>nt.has(Pt.id)).map(Pt=>({...Pt,partId:L,partTitle:F.title||L,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 $=er[Pt];if($.partId===L&&$.chapterId===K){xr=Pt+1;break}}return[...er.slice(0,xr),...En,...er.slice(xr)]},Ee=async()=>{const nt=Ce(),as=await vt("/api/db/book",{action:"reorder",items:nt});return as&&as.success!==!1?(alert(`已移动 ${ne.length} 节到「${F.title}」-「${ce.title}」`),O(!1),W([]),await ct(),!0):!1},xt={action:"move-sections",sectionIds:ne,targetPartId:L,targetChapterId:K,targetPartTitle:F.title||L,targetChapterTitle:ce.title||K},ns=await vt("/api/db/book",xt);if(ns&&ns.success!==!1)alert(`已移动 ${ns.count??ne.length} 节到「${F.title}」-「${ce.title}」`),O(!1),W([]),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{ge(!1)}},Jn=F=>{W(ce=>ce.includes(F)?ce.filter(Ce=>Ce!==F):[...ce,F])},Zn=async F=>{const ce=r.filter(Ce=>Ce.partId===F.id).map(Ce=>Ce.id);if(ce.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${F.title}」整篇吗?将删除共 ${ce.length} 节内容,此操作不可恢复。`))try{for(const Ce of ce)await Tr(`/api/db/book?id=${encodeURIComponent(Ce)}`);ct()}catch(Ce){console.error(Ce),alert("删除失败")}},Cn=async F=>{var Ce,Ee;const ce=(Ce=F.target.files)==null?void 0:Ce[0];if(ce){Q(!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{U(!1),V.current&&(V.current.value="")}}},En=async()=>{var F;if(T.trim()){j(!0);try{const oe=await $e(`/api/search?q=${encodeURIComponent(T)}`);oe!=null&&oe.success&&((F=oe.data)!=null&&F.results)?w(oe.data.results):(w([]),oe&&!oe.success&&alert("搜索失败: "+oe.error))}catch(oe){console.error(oe),w([]),alert("搜索失败")}finally{j(!1)}}},zs=Bt.find(F=>F.id===I.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(Z,{onClick:()=>he(!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(Z,{onClick:()=>{const F=typeof window<"u"?`${window.location.origin}/api-doc`:"";F&&window.open(F,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Pr,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(Ct,{open:y,onOpenChange:g,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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:I.id,onChange:F=>R({...I,id:F.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:I.price,onChange:F=>R({...I,price:Number(F.target.value)})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题 *"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:I.title,onChange:F=>R({...I,title:F.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属篇"}),e.jsxs(kl,{value:I.partId,onValueChange:F=>R({...I,partId:F,chapterId:"chapter-1"}),children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(El,{})}),e.jsxs(Pa,{className:"bg-[#0f2137] border-gray-700",children:[Bt.map(F=>e.jsx(lr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.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(kl,{value:I.chapterId,onValueChange:F=>R({...I,chapterId:F}),children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(El,{})}),e.jsxs(Pa,{className:"bg-[#0f2137] border-gray-700",children:[Ar.map(F=>e.jsx(lr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.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(hn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:I.content,onChange:F=>R({...I,content:F.target.value})})]})]}),e.jsxs(Dt,{children:[e.jsx(Z,{variant:"outline",onClick:()=>g(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:fr,disabled:C||!I.id||!I.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?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:!!E,onOpenChange:F=>!F&&Y(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(ht,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),E&&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(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:E.title,onChange:F=>Y({...E,title:F.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(Z,{variant:"outline",onClick:()=>Y(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Ls,disabled:ne||!(($s=E==null?void 0:E.title)!=null&&$s.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ne?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(Ct,{open:!!H,onOpenChange:F=>!F&&ie(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(ht,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),H&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节名称(如:第8章|底层结构)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:H.title,onChange:F=>ie({...H,title:F.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(Dt,{children:[e.jsx(Z,{variant:"outline",onClick:()=>ie(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Os,disabled:ve||!((ea=H==null?void 0:H.title)!=null&&ea.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ve?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(Ct,{open:A,onOpenChange:F=>{var oe;if(O(F),F&&Bt.length>0){const Ce=Bt[0];J(Ce.id),de(((oe=Ce.chapters[0])==null?void 0:oe.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:ce.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标篇"}),e.jsxs(kl,{value:L,onValueChange:F=>{var Ce;J(F);const oe=Bt.find(Ee=>Ee.id===F);de(((Ce=oe==null?void 0:oe.chapters[0])==null?void 0:Ce.id)??"")},children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(El,{placeholder:"选择篇"})}),e.jsx(Pa,{className:"bg-[#0f2137] border-gray-700",children:Bt.map(F=>e.jsx(lr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标章"}),e.jsxs(kl,{value:G,onValueChange:de,children:[e.jsx(Ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(El,{placeholder:"选择章"})}),e.jsx(Pa,{className:"bg-[#0f2137] border-gray-700",children:(((ts=Bt.find(F=>F.id===L))==null?void 0:ts.chapters)??[]).map(F=>e.jsx(lr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]})]}),e.jsxs(Dt,{children:[e.jsx(Z,{variant:"outline",onClick:()=>O(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Xn,disabled:Q||ce.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:F=>!F&&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(F=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.userId??F.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",F.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:F.payTime??F.createdAt??"-"})]},F.id??F.orderSn??""))})]}):null})]})}),e.jsx(Ct,{open:ze,onOpenChange:he,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(le,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:xe.readWeight,onChange:F=>ft(oe=>({...oe,readWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"新度权重"}),e.jsx(le,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:xe.recencyWeight,onChange:F=>ft(oe=>({...oe,recencyWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"付款权重"}),e.jsx(le,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:xe.payWeight,onChange:F=>ft(oe=>({...oe,payWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(xe.readWeight+xe.recencyWeight+xe.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(Z,{onClick:Yn,disabled:Nn||Math.abs(xe.readWeight+xe.recencyWeight+xe.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:Nn?"保存中...":"保存权重"})]})]})]})}),e.jsx(Ct,{open:q,onOpenChange:se,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(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:Se,onChange:F=>D(F.target.value),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(Z,{variant:"outline",onClick:()=>{se(!1),D("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:qn,disabled:fe||!Se.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:fe?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(ht,{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(le,{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(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:m.isFree?0:m.price,onChange:F=>f({...m,price:Number(F.target.value),isFree:Number(F.target.value)===0}),disabled:m.isFree})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(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=>f({...m,isFree:F.target.checked,price:F.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(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=>f({...m,isNew:F.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.title,onChange:F=>f({...m,title:F.target.value})})]}),m.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"文件路径"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:m.filePath,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:V,type:"file",accept:"image/*",onChange:kn,className:"hidden"}),e.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>{var F;return(F=V.current)==null?void 0:F.click()},disabled:_,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[_?e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(qx,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),p?e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(hn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[400px] font-mono text-sm placeholder:text-gray-500",placeholder:"此处输入章节内容,支持Markdown格式...",value:m.content,onChange:F=>f({...m,content:F.target.value})})]})]}),e.jsxs(Dt,{className:"shrink-0 px-6 py-4 border-t border-gray-700/50",children:[e.jsxs(Z,{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(Z,{onClick:Sn,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),e.jsxs($l,{defaultValue:"chapters",className:"space-y-6",children:[e.jsxs($a,{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(Z,{onClick:()=>g(!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(Z,{onClick:()=>se(!0),className:"flex-1 min-w-[120px] bg-amber-500/10 hover:bg-amber-500/20 text-amber-400 border border-amber-500/30",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"新建篇"]}),e.jsxs(Z,{variant:"outline",onClick:()=>O(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",ce.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(hC,{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:ce,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(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:T,onChange:F=>b(F.target.value),onKeyDown:F=>F.key==="Enter"&&En()}),e.jsx(Z,{onClick:En,disabled:k||!T.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:k?e.jsx(Be,{className:"w-4 h-4 animate-spin"}):e.jsx(cn,{className:"w-4 h-4"})})]}),N.length>0&&e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",N.length," 个结果"]}),N.map(F=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>ks({id:F.id,title:F.title,price:F.price??1,filePath:""}),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:F.id}),e.jsx("span",{className:"text-white",children:F.title})]}),e.jsx(Le,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:F.matchType==="title"?"标题匹配":"内容匹配"})]}),F.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:F.snippet}),(F.partTitle||F.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[F.partTitle," · ",F.chapterTitle]})]},F.id))]})]})]})}),e.jsx(Ot,{value:"hooks",className:"space-y-4",children:e.jsxs(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(kl,{defaultValue:"3",children:[e.jsx(Ea,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(El,{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(hn,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),e.jsx(Z,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}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 bx(r){return Array.isArray(r)?r.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):kr.highlights}function xC(){const[r,a]=h.useState(kr),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(!1),y=h.useRef(null);h.useEffect(()=>{$e("/api/admin/author-settings").then(w=>{const k=w==null?void 0:w.data;k&&typeof k=="object"&&a({name:String(k.name??kr.name),avatar:String(k.avatar??kr.avatar),avatarImg:String(k.avatarImg??""),title:String(k.title??kr.title),bio:String(k.bio??kr.bio),stats:jx(k.stats).length?jx(k.stats):kr.stats,highlights:bx(k.highlights).length?bx(k.highlights):kr.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const g=async()=>{d(!0);try{const w={name:r.name,avatar:r.avatar||"K",avatarImg:r.avatarImg,title:r.title,bio:r.bio,stats:r.stats.filter(_=>_.label||_.value),highlights:r.highlights.filter(Boolean)},k=await mt("/api/admin/author-settings",w);if(!k||k.success===!1){alert("保存失败: "+(k&&typeof k=="object"&&"error"in k?k.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(w){console.error(w),alert("保存失败: "+(w instanceof Error?w.message:String(w)))}finally{d(!1)}},p=async w=>{var j;const k=(j=w.target.files)==null?void 0:j[0];if(k){f(!0);try{const _=new FormData;_.append("file",k),_.append("folder","avatars");const U=bu(),V={};U&&(V.Authorization=`Bearer ${U}`);const R=await(await fetch(Aa("/api/upload"),{method:"POST",body:_,credentials:"include",headers:V})).json();R!=null&&R.success&&(R!=null&&R.url)?a(E=>({...E,avatarImg:R.url})):alert("上传失败: "+((R==null?void 0:R.error)||"未知错误"))}catch(_){console.error(_),alert("上传失败")}finally{f(!1),y.current&&(y.current.value="")}}},v=()=>a(w=>({...w,stats:[...w.stats,{label:"",value:""}]})),C=w=>a(k=>({...k,stats:k.stats.filter((j,_)=>_!==w)})),P=(w,k,j)=>a(_=>({..._,stats:_.stats.map((U,V)=>V===w?{...U,[k]:j}:U)})),T=()=>a(w=>({...w,highlights:[...w.highlights,""]})),b=w=>a(k=>({...k,highlights:k.highlights.filter((j,_)=>_!==w)})),N=(w,k)=>a(j=>({...j,highlights:j.highlights.map((_,U)=>U===w?k:_)}));return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Ra,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),e.jsxs(Z,{onClick:g,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{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(Ra,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),e.jsx(jt,{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(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.name,onChange:w=>a(k=>({...k,name:w.target.value})),placeholder:"卡若"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:r.avatar,onChange:w=>a(k=>({...k,avatar:w.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(qx,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:r.avatarImg,onChange:w=>a(k=>({...k,avatarImg:w.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),e.jsx("input",{ref:y,type:"file",accept:"image/*",className:"hidden",onChange:p}),e.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:m,onClick:()=>{var w;return(w=y.current)==null?void 0:w.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:Aa(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(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.title,onChange:w=>a(k=>({...k,title:w.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"个人简介"}),e.jsx(hn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:r.bio,onChange:w=>a(k=>({...k,bio:w.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(jt,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),e.jsxs(we,{className:"space-y-3",children:[r.stats.map((w,k)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:w.label,onChange:j=>P(k,"label",j.target.value),placeholder:"标签"}),e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:w.value,onChange:j=>P(k,"value",j.target.value),placeholder:"数值"}),e.jsx(Z,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>C(k),children:e.jsx(ms,{className:"w-4 h-4"})})]},k)),e.jsxs(Z,{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(jt,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),e.jsxs(we,{className:"space-y-3",children:[r.highlights.map((w,k)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:w,onChange:j=>N(k,j.target.value),placeholder:"5年私域运营经验"}),e.jsx(Z,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>b(k),children:e.jsx(ms,{className:"w-4 h-4"})})]},k)),e.jsxs(Z,{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 pC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m]=h.useState(10),[f,y]=h.useState(0),[g,p]=h.useState(""),v=Iu(g,300),[C,P]=h.useState(!0),[T,b]=h.useState(null),[N,w]=h.useState(!1),[k,j]=h.useState(null),[_,U]=h.useState(""),[V,I]=h.useState(""),[R,E]=h.useState(""),[Y,ne]=h.useState("admin"),[ae,q]=h.useState("active"),[se,H]=h.useState(!1);async function ie(){var O;P(!0),b(null);try{const L=new URLSearchParams({page:String(c),pageSize:String(m)});v.trim()&&L.set("search",v.trim());const J=await $e(`/api/admin/users?${L}`);J!=null&&J.success?(a(J.records||[]),o(J.total??0),y(J.totalPages??0)):b(J.error||"加载失败")}catch(L){const J=L;b(J.status===403?"无权限访问":((O=J==null?void 0:J.data)==null?void 0:O.error)||"加载失败"),a([])}finally{P(!1)}}h.useEffect(()=>{ie()},[c,m,v]);const ve=()=>{j(null),U(""),I(""),E(""),ne("admin"),q("active"),w(!0)},B=O=>{j(O),U(O.username),I(""),E(O.name||""),ne(O.role==="super_admin"?"super_admin":"admin"),q(O.status==="disabled"?"disabled":"active"),w(!0)},ce=async()=>{var O;if(!_.trim()){b("用户名不能为空");return}if(!k&&!V){b("新建时密码必填,至少 6 位");return}if(V&&V.length<6){b("密码至少 6 位");return}b(null),H(!0);try{if(k){const L=await vt("/api/admin/users",{id:k.id,password:V||void 0,name:R.trim(),role:Y,status:ae});L!=null&&L.success?(w(!1),ie()):b((L==null?void 0:L.error)||"保存失败")}else{const L=await mt("/api/admin/users",{username:_.trim(),password:V,name:R.trim(),role:Y});L!=null&&L.success?(w(!1),ie()):b((L==null?void 0:L.error)||"保存失败")}}catch(L){const J=L;b(((O=J==null?void 0:J.data)==null?void 0:O.error)||"保存失败")}finally{H(!1)}},K=async O=>{var L;if(confirm("确定删除该管理员?"))try{const J=await Tr(`/api/admin/users?id=${O}`);J!=null&&J.success?ie():b((J==null?void 0:J.error)||"删除失败")}catch(J){const G=J;b(((L=G==null?void 0:G.data)==null?void 0:L.error)||"删除失败")}},A=O=>{if(!O)return"-";try{const L=new Date(O);return isNaN(L.getTime())?O:L.toLocaleString("zh-CN")}catch{return O}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(vu,{className:"w-5 h-5 text-[#38bdac]"}),"管理员用户"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"后台登录账号管理,仅超级管理员可操作"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(le,{placeholder:"搜索用户名/昵称",value:g,onChange:O=>p(O.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(Z,{variant:"outline",size:"sm",onClick:ie,disabled:C,className:"border-gray-600 text-gray-300",children:e.jsx(Be,{className:`w-4 h-4 ${C?"animate-spin":""}`})}),e.jsxs(Z,{onClick:ve,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:()=>b(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:C?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs(fs,{children:[e.jsx(xs,{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(ps,{children:[r.map(O=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:O.id}),e.jsx(pe,{className:"text-white font-medium",children:O.username}),e.jsx(pe,{className:"text-gray-400",children:O.name||"-"}),e.jsx(pe,{children:e.jsx(Le,{variant:"outline",className:O.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:O.role==="super_admin"?"超级管理员":"管理员"})}),e.jsx(pe,{children:e.jsx(Le,{variant:"outline",className:O.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:O.status==="active"?"正常":"已禁用"})}),e.jsx(pe,{className:"text-gray-500 text-sm",children:A(O.createdAt)}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>B(O),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>K(O.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]},O.id)),r.length===0&&!C&&e.jsx(et,{children:e.jsx(pe,{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:N,onOpenChange:w,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:k?"编辑管理员":"新增管理员"})}),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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:_,onChange:O=>U(O.target.value),disabled:!!k}),k&&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:k?"新密码(留空不改)":"密码"}),e.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:k?"留空表示不修改":"至少 6 位",value:V,onChange:O=>I(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:R,onChange:O=>E(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:Y,onChange:O=>ne(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"admin",children:"管理员"}),e.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),k&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"状态"}),e.jsxs("select",{value:ae,onChange:O=>q(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"active",children:"正常"}),e.jsx("option",{value:"disabled",children:"禁用"})]})]})]}),e.jsxs(Dt,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>w(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(ms,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:ce,disabled:se,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),se?"保存中...":"保存"]})]})]})})]})}const gC={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},yC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},vC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...yC}},jC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},bC=["system","author","admin"];function NC(){const[r,a]=Ux(),l=r.get("tab")??"system",o=bC.includes(l)?l:"system",[c,d]=h.useState(vC),[m,f]=h.useState(jC),[y,g]=h.useState(gC),[p,v]=h.useState(!1),[C,P]=h.useState(!0),[T,b]=h.useState(!1),[N,w]=h.useState(""),[k,j]=h.useState(""),[_,U]=h.useState(!1),[V,I]=h.useState(!1),R=(q,se,H=!1)=>{w(q),j(se),U(H),b(!0)};h.useEffect(()=>{(async()=>{try{const se=await $e("/api/admin/settings");if(!se||se.success===!1)return;if(se.featureConfig&&Object.keys(se.featureConfig).length&&f(H=>({...H,...se.featureConfig})),se.mpConfig&&typeof se.mpConfig=="object"&&g(H=>({...H,...se.mpConfig})),se.siteSettings&&typeof se.siteSettings=="object"){const H=se.siteSettings;d(ie=>({...ie,...typeof H.sectionPrice=="number"&&{sectionPrice:H.sectionPrice},...typeof H.baseBookPrice=="number"&&{baseBookPrice:H.baseBookPrice},...typeof H.distributorShare=="number"&&{distributorShare:H.distributorShare},...H.authorInfo&&typeof H.authorInfo=="object"&&{authorInfo:{...ie.authorInfo,...H.authorInfo}}}))}}catch(se){console.error("Load settings error:",se)}finally{P(!1)}})()},[]);const E=async(q,se)=>{I(!0);try{const H=await mt("/api/admin/settings",{featureConfig:q});if(!H||H.success===!1){se(),R("保存失败",(H==null?void 0:H.error)??"未知错误",!0);return}R("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(H){console.error("Save feature config error:",H),se(),R("保存失败",H instanceof Error?H.message:String(H),!0)}finally{I(!1)}},Y=(q,se)=>{const H=m,ie={...H,[q]:se};f(ie),E(ie,()=>f(H))},ne=async()=>{v(!0);try{const q=await mt("/api/admin/settings",{featureConfig:m,siteSettings:{sectionPrice:c.sectionPrice,baseBookPrice:c.baseBookPrice,distributorShare:c.distributorShare,authorInfo:c.authorInfo},mpConfig:{...y,appId:y.appId||"",withdrawSubscribeTmplId:y.withdrawSubscribeTmplId||"",mchId:y.mchId||"",minWithdraw:typeof y.minWithdraw=="number"?y.minWithdraw:10}});if(!q||q.success===!1){R("保存失败",(q==null?void 0:q.error)??"未知错误",!0);return}R("已保存","设置已保存成功。")}catch(q){console.error("Save settings error:",q),R("保存失败",q instanceof Error?q.message:String(q),!0)}finally{v(!1)}},ae=q=>{a(q==="system"?{}:{tab:q})};return C?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),o==="system"&&e.jsxs(Z,{onClick:ne,disabled:p,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),p?"保存中...":"保存设置"]})]}),e.jsxs($l,{value:o,onValueChange:ae,className:"w-full",children:[e.jsxs($a,{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(dn,{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(vu,{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(jt,{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(le,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.name??"",onChange:q=>d(se=>({...se,authorInfo:{...se.authorInfo,name:q.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(le,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:c.authorInfo.startDate??"",onChange:q=>d(se=>({...se,authorInfo:{...se.authorInfo,startDate:q.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(le,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:c.authorInfo.liveTime??"",onChange:q=>d(se=>({...se,authorInfo:{...se.authorInfo,liveTime:q.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(Xx,{className:"w-3 h-3"}),"直播平台"]}),e.jsx(le,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:c.authorInfo.platform??"",onChange:q=>d(se=>({...se,authorInfo:{...se.authorInfo,platform:q.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(le,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.description??"",onChange:q=>d(se=>({...se,authorInfo:{...se.authorInfo,description:q.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),e.jsx(hn,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:c.authorInfo.bio??"",onChange:q=>d(se=>({...se,authorInfo:{...se.authorInfo,bio:q.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(jt,{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(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.sectionPrice,onChange:q=>d(se=>({...se,sectionPrice:Number.parseFloat(q.target.value)||1}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"整本价格 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.baseBookPrice,onChange:q=>d(se=>({...se,baseBookPrice:Number.parseFloat(q.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(jt,{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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:y.appId??"",onChange:q=>g(se=>({...se,appId:q.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提现订阅模板 ID"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:y.withdrawSubscribeTmplId??"",onChange:q=>g(se=>({...se,withdrawSubscribeTmplId:q.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"微信支付商户号"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:y.mchId??"",onChange:q=>g(se=>({...se,mchId:q.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最低提现金额 (元)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:y.minWithdraw??10,onChange:q=>g(se=>({...se,minWithdraw:Number.parseFloat(q.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(dn,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),e.jsx(jt,{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(Yt,{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:V,onCheckedChange:q=>Y("matchEnabled",q)})]}),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(yb,{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:V,onCheckedChange:q=>Y("referralEnabled",q)})]}),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:V,onCheckedChange:q=>Y("searchEnabled",q)})]}),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(dn,{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:V,onCheckedChange:q=>Y("aboutEnabled",q)})]})]}),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(xC,{})}),e.jsx(Ot,{value:"admin",className:"mt-0",children:e.jsx(pC,{})})]}),e.jsx(Ct,{open:T,onOpenChange:b,children:e.jsxs(Nt,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[e.jsxs(kt,{children:[e.jsx(Et,{className:_?"text-red-400":"text-[#38bdac]",children:N}),e.jsx(u2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:k})]}),e.jsx(Dt,{className:"mt-4",children:e.jsx(Z,{onClick:()=>b(!1),className:_?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const Nx={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 wC(){const[r,a]=h.useState(!1),[l,o]=h.useState(Nx),[c,d]=h.useState(""),m=async()=>{a(!0);try{const w=await $e("/api/config");w!=null&&w.paymentMethods&&o({...Nx,...w.paymentMethods})}catch(w){console.error(w)}finally{a(!1)}};h.useEffect(()=>{m()},[]);const f=async()=>{a(!0);try{await mt("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(w){console.error("保存失败:",w),alert("保存失败: "+(w instanceof Error?w.message:String(w)))}finally{a(!1)}},y=(w,k)=>{navigator.clipboard.writeText(w),d(k),setTimeout(()=>d(""),2e3)},g=(w,k)=>{o(j=>({...j,wechat:{...j.wechat,[w]:k}}))},p=(w,k)=>{o(j=>({...j,alipay:{...j.alipay,[w]:k}}))},v=(w,k)=>{o(j=>({...j,usdt:{...j.usdt,[w]:k}}))},C=(w,k)=>{o(j=>({...j,paypal:{...j.paypal,[w]:k}}))},P=l.wechat,T=l.alipay,b=l.usdt,N=l.paypal;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),e.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{variant:"outline",onClick: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(Z,{onClick:f,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{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(Hx,{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($a,{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(zf,{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(Of,{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(jt,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(ot,{checked:!!P.enabled,onCheckedChange:w=>g("enabled",w)})]}),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(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:w=>g("websiteAppId",w.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"商户号"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.merchantId??""),onChange:w=>g("merchantId",w.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(Un,{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(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(P.qrCode??""),onChange:w=>g("qrCode",w.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),e.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[e.jsx(te,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),e.jsx(le,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(P.groupQrCode??""),onChange:w=>g("groupQrCode",w.target.value)}),e.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),e.jsx(Ot,{value:"alipay",className:"space-y-4",children:e.jsxs(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(zf,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(jt,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(ot,{checked:!!T.enabled,onCheckedChange:w=>p("enabled",w)})]}),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(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.partnerId??""),onChange:w=>p("partnerId",w.target.value)}),e.jsx(Z,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>y(String(T.partnerId??""),"pid"),children:c==="pid"?e.jsx(wo,{className:"w-4 h-4 text-green-500"}):e.jsx(Gx,{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(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.securityKey??""),onChange:w=>p("securityKey",w.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(Un,{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(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(T.qrCode??""),onChange:w=>p("qrCode",w.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),e.jsx(Ot,{value:"usdt",className:"space-y-4",children:e.jsxs(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(Of,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(jt,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(ot,{checked:!!b.enabled,onCheckedChange:w=>v("enabled",w)})]}),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(b.network??"TRC20"),onChange:w=>v("network",w.target.value),children:[e.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),e.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),e.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"收款地址"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(b.address??""),onChange:w=>v("address",w.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:w=>v("exchangeRate",Number.parseFloat(w.target.value)||7.2)})]})]})]})}),e.jsx(Ot,{value:"paypal",className:"space-y-4",children:e.jsxs(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(jt,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(ot,{checked:!!N.enabled,onCheckedChange:w=>C("enabled",w)})]}),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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(N.email??""),onChange:w=>C("email",w.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(N.exchangeRate)??7.2,onChange:w=>C("exchangeRate",Number(w.target.value)||7.2)})]})]})]})})]})]})}const SC={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},CC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},kC={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function EC(){const[r,a]=h.useState({siteConfig:{...SC},menuConfig:{...CC},pageConfig:{...kC}}),[l,o]=h.useState(!1),[c,d]=h.useState(!1);h.useEffect(()=>{$e("/api/config").then(p=>{p!=null&&p.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...p.siteConfig}})),p!=null&&p.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...p.menuConfig}})),p!=null&&p.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...p.pageConfig}}))}).catch(console.error)},[]);const m=async()=>{d(!0);try{await mt("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await mt("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await mt("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(p){console.error(p),alert("保存失败: "+(p instanceof Error?p.message:String(p)))}finally{d(!1)}},f=r.siteConfig,y=r.menuConfig,g=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(Z,{onClick:m,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[e.jsx(Mt,{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(jt,{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(le,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteName??"",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:p.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),e.jsx(le,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteTitle??"",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:p.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),e.jsx(le,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteDescription??"",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:p.target.value}}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),e.jsx(le,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:f.logo??"",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:p.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),e.jsx(le,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:f.favicon??"",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:p.target.value}}))})]})]})]})]}),e.jsxs(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(Gb,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),e.jsx(jt,{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(le,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:f.primaryColor??"#00CED1",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:p.target.value}}))}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:f.primaryColor??"#00CED1",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:p.target.value}}))})]})]}),e.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:f.primaryColor??"#00CED1"},children:"预览"})]})})]}),e.jsxs(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(Ub,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),e.jsx(jt,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),e.jsx(we,{className:"space-y-4",children:Object.entries(y).map(([p,v])=>e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx(ot,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[p]:{...v,enabled:C}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:p}),e.jsx(le,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[p]:{...v,label:C.target.value}}}))})]}),e.jsx("span",{className:`text-sm ${v!=null&&v.enabled?"text-green-400":"text-gray-500"}`,children:v!=null&&v.enabled?"显示":"隐藏"})]},p))})]}),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(Yx,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),e.jsx(jt,{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(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.homeTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:p.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首页副标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.homeSubtitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:p.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目录页标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.chaptersTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:p.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配页标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.matchTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:p.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"我的页标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.myTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:p.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"关于作者标题"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.aboutTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:p.target.value}}))})]})]})]})]})]})]})}function PC(){const[r,a]=h.useState(""),[l,o]=h.useState(""),[c,d]=h.useState(""),[m,f]=h.useState({}),y=async()=>{var P,T,b,N;try{const w=await $e("/api/config"),k=(T=(P=w==null?void 0:w.liveQRCodes)==null?void 0:P[0])==null?void 0:T.urls;Array.isArray(k)&&a(k.join(` -`));const j=(N=(b=w==null?void 0:w.paymentMethods)==null?void 0:b.wechat)==null?void 0:N.groupQrCode;j&&o(j),f({paymentMethods:w==null?void 0:w.paymentMethods,liveQRCodes:w==null?void 0:w.liveQRCodes})}catch(w){console.error(w)}};h.useEffect(()=>{y()},[]);const g=(P,T)=>{navigator.clipboard.writeText(P),d(T),setTimeout(()=>d(""),2e3)},p=async()=>{try{const P=r.split(` -`).map(b=>b.trim()).filter(Boolean),T=[...m.liveQRCodes||[]];T[0]?T[0].urls=P:T.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await mt("/api/db/config",{key:"live_qr_codes",value:T,description:"群活码配置"}),alert("群活码配置已保存!"),await y()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},v=async()=>{var P;try{await mt("/api/db/config",{key:"payment_methods",value:{...m.paymentMethods||{},wechat:{...((P=m.paymentMethods)==null?void 0:P.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await y()}catch(T){console.error(T),alert("保存失败: "+(T instanceof Error?T.message:String(T)))}},C=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Hx,{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(Uf,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),e.jsx(jt,{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(Bf,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(le,{placeholder:"https://cli.im/xxxxx 或 https://weixin.qq.com/g/...",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",value:l,onChange:P=>o(P.target.value)}),e.jsx(Z,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>g(l,"group"),children:c==="group"?e.jsx(wo,{className:"w-4 h-4 text-green-500"}):e.jsx(Gx,{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(Un,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{onClick:v,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[e.jsx(uo,{className:"w-4 h-4 mr-2"}),"保存配置"]}),e.jsxs(Z,{onClick:C,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[e.jsx(Un,{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(Uf,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),e.jsx(jt,{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(Bf,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),e.jsx(hn,{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(Z,{onClick:p,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 wx={matchTypes:[{id:"partner",label:"创业合伙",matchLabel:"创业伙伴",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"导师顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},TC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function RC(){const[r,a]=h.useState(wx),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(!1),[y,g]=h.useState(null),[p,v]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await $e("/api/db/config/full?key=match_config"),_=(j==null?void 0:j.data)??(j==null?void 0:j.config);_&&a({...wx,..._})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};h.useEffect(()=>{C()},[]);const P=async()=>{d(!0);try{const j=await mt("/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=>{g(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)},b=()=>{g(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},N=()=>{if(!p.id||!p.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(y){const _=j.findIndex(U=>U.id===y.id);_!==-1&&(j[_]={...p})}else{if(j.some(_=>_.id===p.id)){alert("类型ID已存在");return}j.push({...p})}a({...r,matchTypes:j}),f(!1)},w=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(_=>_.id!==j)})},k=j=>{a({...r,matchTypes:r.matchTypes.map(_=>_.id===j?{..._,enabled:!_.enabled}:_)})};return e.jsxs("div",{className:"p-8 w-full space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(dn,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),e.jsxs(Z,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{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(jt,{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(le,{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(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange: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(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(le,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange: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(ot,{checked:r.settings.enableFreeMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enableFreeMatches:j}})}),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:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),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(Yt,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),e.jsx(jt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(Z,{onClick:b,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(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(ps,{children:r.matchTypes.map(j=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white font-medium",children:j.label}),e.jsx(pe,{className:"text-gray-300",children:j.matchLabel}),e.jsx(pe,{children:e.jsxs(Le,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(pe,{children:j.matchFromDB?e.jsx(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(pe,{children:e.jsx(ot,{checked:j.enabled,onCheckedChange:()=>k(j.id)})}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>w(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Ht,{className:"w-4 h-4"})})]})})]},j.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:[y?e.jsx(ht,{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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:p.id,onChange:j=>v({...p,id:j.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:TC.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${p.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...p,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:p.label,onChange:j=>v({...p,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:p.matchLabel,onChange:j=>v({...p,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:p.price,onChange:j=>v({...p,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(ot,{checked:p.matchFromDB,onCheckedChange:j=>v({...p,matchFromDB:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:p.showJoinAfterMatch,onCheckedChange:j=>v({...p,showJoinAfterMatch:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:p.enabled,onCheckedChange:j=>v({...p,enabled:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Dt,{children:[e.jsx(Z,{variant:"outline",onClick:()=>f(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(Z,{onClick:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const Sx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function IC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[y,g]=h.useState(""),[p,v]=h.useState(!0),[C,P]=h.useState(null);async function T(){v(!0),P(null);try{const N=new URLSearchParams({page:String(c),pageSize:String(m)});y&&N.set("matchType",y);const w=await $e(`/api/db/match-records?${N}`);w!=null&&w.success?(a(w.records||[]),o(w.total??0)):P("加载匹配记录失败")}catch(N){console.error("加载匹配记录失败",N),P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{T()},[c,y]);const b=Math.ceil(l/m)||1;return e.jsxs("div",{className:"p-8 w-full",children:[C&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:y,onChange:N=>{g(N.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(Sx).map(([N,w])=>e.jsx("option",{value:N,children:w},N))]}),e.jsxs("button",{type:"button",onClick:T,disabled:p,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx(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(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(ps,{children:[r.map(N=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[N.userAvatar?e.jsx("img",{src:N.userAvatar,alt:"",className:"w-full h-full object-cover",onError:w=>{w.currentTarget.style.display="none";const k=w.currentTarget.nextElementSibling;k&&k.classList.remove("hidden")}}):null,e.jsx("span",{className:N.userAvatar?"hidden":"",children:(N.userNickname||N.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:N.userNickname||N.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[N.userId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[N.matchedUserAvatar?e.jsx("img",{src:N.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:w=>{w.currentTarget.style.display="none";const k=w.currentTarget.nextElementSibling;k&&k.classList.remove("hidden")}}):null,e.jsx("span",{className:N.matchedUserAvatar?"hidden":"",children:(N.matchedNickname||N.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:N.matchedNickname||N.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[N.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Sx[N.matchType]||N.matchType})}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[N.phone&&e.jsxs("div",{children:["📱 ",N.phone]}),N.wechatId&&e.jsxs("div",{children:["💬 ",N.wechatId]}),!N.phone&&!N.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:N.createdAt?new Date(N.createdAt).toLocaleString():"-"})]},N.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:b,total:l,pageSize:m,onPageChange:d,onPageSizeChange:N=>{f(N),d(1)}})]})})})]})}function _C(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(null),[y,g]=h.useState(""),[p,v]=h.useState(0),[C,P]=h.useState(!1);async function T(){o(!0);try{const j=await $e("/api/db/vip-roles");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load roles error:",j)}finally{o(!1)}}h.useEffect(()=>{T()},[]);const b=()=>{f(null),g(""),v(r.length>0?Math.max(...r.map(j=>j.sort))+1:0),d(!0)},N=j=>{f(j),g(j.name),v(j.sort),d(!0)},w=async()=>{if(!y.trim()){alert("角色名称不能为空");return}P(!0);try{if(m){const j=await vt("/api/db/vip-roles",{id:m.id,name:y.trim(),sort:p});j!=null&&j.success?(d(!1),T()):alert("更新失败: "+(j==null?void 0:j.error))}else{const j=await mt("/api/db/vip-roles",{name:y.trim(),sort:p});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)}},k=async j=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const _=await Tr(`/api/db/vip-roles?id=${j}`);_!=null&&_.success?T():alert("删除失败: "+(_==null?void 0:_.error))}catch(_){console.error("Delete error:",_),alert("删除失败")}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(nn,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),e.jsxs(Z,{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: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(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(ps,{children:[r.map(j=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white",children:j.name}),e.jsx(pe,{className:"text-gray-400",children:j.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>N(j),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>k(j.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]},j.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:y,onChange:j=>g(j.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p,onChange:j=>v(parseInt(j.target.value,10)||0)})]})]}),e.jsxs(Dt,{children:[e.jsxs(Z,{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(Z,{onClick:w,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存"]})]})]})})]})}function Mg({embedded:r=!1}){const[a,l]=h.useState([]),[o,c]=h.useState(!0),[d,m]=h.useState(!1),[f,y]=h.useState(null),[g,p]=h.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[v,C]=h.useState(!1),[P,T]=h.useState(!1),b=h.useRef(null),N=async R=>{var Y;const E=(Y=R.target.files)==null?void 0:Y[0];if(E){T(!0);try{const ne=new FormData;ne.append("file",E),ne.append("folder","mentors");const ae=bu(),q={};ae&&(q.Authorization=`Bearer ${ae}`);const H=await(await fetch(Aa("/api/upload"),{method:"POST",body:ne,credentials:"include",headers:q})).json();H!=null&&H.success&&(H!=null&&H.url)?p(ie=>({...ie,avatar:H.url})):alert("上传失败: "+((H==null?void 0:H.error)||"未知错误"))}catch(ne){console.error(ne),alert("上传失败")}finally{T(!1),b.current&&(b.current.value="")}}};async function w(){c(!0);try{const R=await $e("/api/db/mentors");R!=null&&R.success&&R.data&&l(R.data)}catch(R){console.error("Load mentors error:",R)}finally{c(!1)}}h.useEffect(()=>{w()},[]);const k=()=>{p({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:a.length>0?Math.max(...a.map(R=>R.sort))+1:0,enabled:!0})},j=()=>{y(null),k(),m(!0)},_=R=>{y(R),p({name:R.name,avatar:R.avatar||"",intro:R.intro||"",tags:R.tags||"",priceSingle:R.priceSingle!=null?String(R.priceSingle):"",priceHalfYear:R.priceHalfYear!=null?String(R.priceHalfYear):"",priceYear:R.priceYear!=null?String(R.priceYear):"",quote:R.quote||"",whyFind:R.whyFind||"",offering:R.offering||"",judgmentStyle:R.judgmentStyle||"",sort:R.sort,enabled:R.enabled??!0}),m(!0)},U=async()=>{if(!g.name.trim()){alert("导师姓名不能为空");return}C(!0);try{const R=Y=>Y===""?void 0:parseFloat(Y),E={name:g.name.trim(),avatar:g.avatar.trim()||void 0,intro:g.intro.trim()||void 0,tags:g.tags.trim()||void 0,priceSingle:R(g.priceSingle),priceHalfYear:R(g.priceHalfYear),priceYear:R(g.priceYear),quote:g.quote.trim()||void 0,whyFind:g.whyFind.trim()||void 0,offering:g.offering.trim()||void 0,judgmentStyle:g.judgmentStyle.trim()||void 0,sort:g.sort,enabled:g.enabled};if(f){const Y=await vt("/api/db/mentors",{id:f.id,...E});Y!=null&&Y.success?(m(!1),w()):alert("更新失败: "+(Y==null?void 0:Y.error))}else{const Y=await mt("/api/db/mentors",E);Y!=null&&Y.success?(m(!1),w()):alert("新增失败: "+(Y==null?void 0:Y.error))}}catch(R){console.error("Save error:",R),alert("保存失败")}finally{C(!1)}},V=async R=>{if(confirm("确定删除该导师?"))try{const E=await Tr(`/api/db/mentors?id=${R}`);E!=null&&E.success?w():alert("删除失败: "+(E==null?void 0:E.error))}catch(E){console.error("Delete error:",E),alert("删除失败")}},I=R=>R!=null?`¥${R}`:"-";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(Z,{onClick:j,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:o?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(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(ps,{children:[a.map(R=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:R.id}),e.jsx(pe,{className:"text-white",children:R.name}),e.jsx(pe,{className:"text-gray-400 max-w-[200px] truncate",children:R.intro||"-"}),e.jsx(pe,{className:"text-gray-400",children:I(R.priceSingle)}),e.jsx(pe,{className:"text-gray-400",children:I(R.priceHalfYear)}),e.jsx(pe,{className:"text-gray-400",children:I(R.priceYear)}),e.jsx(pe,{className:"text-gray-400",children:R.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>_(R),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>V(R.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]},R.id)),a.length===0&&e.jsx(et,{children:e.jsx(pe,{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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:g.name,onChange:R=>p(E=>({...E,name:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:g.sort,onChange:R=>p(E=>({...E,sort:parseInt(R.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(le,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:g.avatar,onChange:R=>p(E=>({...E,avatar:R.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:b,type:"file",accept:"image/*",className:"hidden",onChange:N}),e.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:P,onClick:()=>{var R;return(R=b.current)==null?void 0:R.click()},children:[e.jsx(uo,{className:"w-4 h-4 mr-2"}),P?"上传中...":"上传"]})]}),g.avatar&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:g.avatar.startsWith("http")?g.avatar:Aa(g.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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:g.intro,onChange:R=>p(E=>({...E,intro:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:g.tags,onChange:R=>p(E=>({...E,tags:R.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(le,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:g.priceSingle,onChange:R=>p(E=>({...E,priceSingle:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),e.jsx(le,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:g.priceHalfYear,onChange:R=>p(E=>({...E,priceHalfYear:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),e.jsx(le,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:g.priceYear,onChange:R=>p(E=>({...E,priceYear:R.target.value}))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"引言"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:g.quote,onChange:R=>p(E=>({...E,quote:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"为什么找(文本)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:g.whyFind,onChange:R=>p(E=>({...E,whyFind:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提供什么(文本)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:g.offering,onChange:R=>p(E=>({...E,offering:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:g.judgmentStyle,onChange:R=>p(E=>({...E,judgmentStyle:R.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:g.enabled,onChange:R=>p(E=>({...E,enabled:R.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(Z,{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(Z,{onClick:U,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})})]})}function MC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState("");async function m(){o(!0);try{const g=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",p=await $e(g);p!=null&&p.success&&p.data&&a(p.data)}catch(g){console.error("Load consultations error:",g)}finally{o(!1)}}h.useEffect(()=>{m()},[c]);const f={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},y={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:g=>d(g.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(([g,p])=>e.jsx("option",{value:g,children:p},g))]}),e.jsxs(Z,{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(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(ps,{children:[r.map(g=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:g.id}),e.jsx(pe,{className:"text-gray-400",children:g.userId}),e.jsx(pe,{className:"text-gray-400",children:g.mentorId}),e.jsx(pe,{className:"text-gray-400",children:y[g.consultationType]||g.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",g.amount]}),e.jsx(pe,{className:"text-gray-400",children:f[g.status]||g.status}),e.jsx(pe,{className:"text-gray-500 text-sm",children:g.createdAt})]},g.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const Tl={poolSource:["vip"],requirePhone:!0,requireNickname:!0,requireAvatar:!1,requireBusiness:!1},Cx={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:Tl},AC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function DC(){const r=yn(),[a,l]=h.useState(Cx),[o,c]=h.useState(!0),[d,m]=h.useState(!1),[f,y]=h.useState(!1),[g,p]=h.useState(null),[v,C]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),[P,T]=h.useState(null),[b,N]=h.useState(!1),w=async()=>{N(!0);try{const E=await $e("/api/db/match-pool-counts");E!=null&&E.success&&E.data&&T(E.data)}catch(E){console.error("加载池子人数失败:",E)}finally{N(!1)}},k=async()=>{c(!0);try{const E=await $e("/api/db/config/full?key=match_config"),Y=(E==null?void 0:E.data)??(E==null?void 0:E.config);if(Y){let ne=Y.poolSettings??Tl;ne.poolSource&&!Array.isArray(ne.poolSource)&&(ne={...ne,poolSource:[ne.poolSource]}),l({...Cx,...Y,poolSettings:ne})}}catch(E){console.error("加载匹配配置失败:",E)}finally{c(!1)}};h.useEffect(()=>{k(),w()},[]);const j=async()=>{m(!0);try{const E=await mt("/api/db/config",{key:"match_config",value:a,description:"匹配功能配置"});alert((E==null?void 0:E.success)!==!1?"配置保存成功!":"保存失败: "+((E==null?void 0:E.error)||"未知错误"))}catch(E){console.error(E),alert("保存失败")}finally{m(!1)}},_=E=>{p(E),C({...E}),y(!0)},U=()=>{p(null),C({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),y(!0)},V=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const E=[...a.matchTypes];if(g){const Y=E.findIndex(ne=>ne.id===g.id);Y!==-1&&(E[Y]={...v})}else{if(E.some(Y=>Y.id===v.id)){alert("类型ID已存在");return}E.push({...v})}l({...a,matchTypes:E}),y(!1)},I=E=>{confirm("确定要删除这个匹配类型吗?")&&l({...a,matchTypes:a.matchTypes.filter(Y=>Y.id!==E)})},R=E=>{l({...a,matchTypes:a.matchTypes.map(Y=>Y.id===E?{...Y,enabled:!Y.enabled}:Y)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsxs(Z,{variant:"outline",onClick:k,disabled:o,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 ${o?"animate-spin":""}`})," 刷新"]}),e.jsxs(Z,{onClick:j,disabled:d,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{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(jt,{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(E=>{const Y=a.poolSettings??Tl,ae=(Array.isArray(Y.poolSource)?Y.poolSource:[Y.poolSource]).includes(E.value),q=P==null?void 0:P[E.countKey],se=()=>{const H=Array.isArray(Y.poolSource)?[...Y.poolSource]:[Y.poolSource],ie=ae?H.filter(ve=>ve!==E.value):[...H,E.value];ie.length===0&&ie.push(E.value),l({...a,poolSettings:{...Y,poolSource:ie}})};return e.jsxs("button",{type:"button",onClick:se,className:`p-4 rounded-lg border text-left transition-all ${ae?"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 ${ae?"border-[#38bdac] bg-[#38bdac] text-white":"border-gray-600"}`,children:ae&&"✓"}),e.jsx("span",{className:"text-xl",children:E.icon}),e.jsx("span",{className:`text-sm font-medium ${ae?"text-[#38bdac]":"text-gray-300"}`,children:E.label})]}),e.jsxs("span",{className:"text-lg font-bold text-white",children:[b?"...":q??"-",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:E.desc}),e.jsx("span",{role:"link",tabIndex:0,onClick:H=>{H.stopPropagation(),r(`/users?pool=${E.value}`)},onKeyDown:H=>{H.key==="Enter"&&(H.stopPropagation(),r(`/users?pool=${E.value}`))},className:"text-[#38bdac] text-xs mt-2 inline-block hover:underline cursor-pointer",children:"查看用户列表 →"})]},E.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(E=>{const ne=(a.poolSettings??Tl)[E.key];return e.jsxs("div",{className:"flex items-center gap-3 bg-[#0a1628] rounded-lg p-3",children:[e.jsx(ot,{checked:ne,onCheckedChange:ae=>l({...a,poolSettings:{...a.poolSettings??Tl,[E.key]:ae}})}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{children:E.icon}),e.jsx(te,{className:"text-gray-300 text-sm",children:E.label})]})]},E.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(jt,{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(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.freeMatchLimit,onChange:E=>l({...a,freeMatchLimit:parseInt(E.target.value,10)||0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:a.matchPrice,onChange:E=>l({...a,matchPrice:parseFloat(E.target.value)||1})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(le,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:a.settings.maxMatchesPerDay,onChange:E=>l({...a,settings:{...a.settings,maxMatchesPerDay:parseInt(E.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:E=>l({...a,settings:{...a.settings,enableFreeMatches:E}})}),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:E=>l({...a,settings:{...a.settings,enablePaidMatches:E}})}),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(Yt,{className:"w-5 h-5 text-[#38bdac]"})," 匹配类型管理"]}),e.jsx(jt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(Z,{onClick:U,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(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(ps,{children:a.matchTypes.map(E=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:E.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:E.id}),e.jsx(pe,{className:"text-white font-medium",children:E.label}),e.jsx(pe,{className:"text-gray-300",children:E.matchLabel}),e.jsx(pe,{children:e.jsxs(Le,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",E.price]})}),e.jsx(pe,{children:E.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(pe,{children:e.jsx(ot,{checked:E.enabled,onCheckedChange:()=>R(E.id)})}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>_(E),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>I(E.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Ht,{className:"w-4 h-4"})})]})})]},E.id))})]})})]}),e.jsx(Ct,{open:f,onOpenChange:y,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:[g?e.jsx(ht,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Rt,{className:"w-5 h-5 text-[#38bdac]"}),g?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:v.id,onChange:E=>C({...v,id:E.target.value}),disabled:!!g})]}),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:AC.map(E=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${v.icon===E?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>C({...v,icon:E}),children:E},E))})]})]}),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(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:v.label,onChange:E=>C({...v,label:E.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:v.matchLabel,onChange:E=>C({...v,matchLabel:E.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:v.price,onChange:E=>C({...v,price:parseFloat(E.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:E=>C({...v,matchFromDB:E})}),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:E=>C({...v,showJoinAfterMatch:E})}),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:E=>C({...v,enabled:E})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Dt,{children:[e.jsx(Z,{variant:"outline",onClick:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(Z,{onClick:V,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const kx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function LC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[y,g]=h.useState(""),[p,v]=h.useState(!0),[C,P]=h.useState(null),[T,b]=h.useState(null);async function N(){v(!0),P(null);try{const j=new URLSearchParams({page:String(c),pageSize:String(m)});y&&j.set("matchType",y);const _=await $e(`/api/db/match-records?${j}`);_!=null&&_.success?(a(_.records||[]),o(_.total??0)):P("加载匹配记录失败")}catch{P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{N()},[c,y]);const w=Math.ceil(l/m)||1,k=({userId:j,nickname:_,avatar:U})=>e.jsxs("div",{className:"flex items-center gap-3 cursor-pointer group",onClick:()=>b(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:[U?e.jsx("img",{src:U,alt:"",className:"w-full h-full object-cover",onError:V=>{V.currentTarget.style.display="none"}}):null,e.jsx("span",{className:U?"hidden":"",children:(_||j||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white group-hover:text-[#38bdac] transition-colors",children:_||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:[C&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("p",{className:"text-gray-400",children:["共 ",l," 条匹配记录 · 点击用户名查看详情"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:y,onChange:j=>{g(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(kx).map(([j,_])=>e.jsx("option",{value:j,children:_},j))]}),e.jsxs("button",{type:"button",onClick:N,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(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(ps,{children:[r.map(j=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx(k,{userId:j.userId,nickname:j.userNickname,avatar:j.userAvatar})}),e.jsx(pe,{children:j.matchedUserId?e.jsx(k,{userId:j.matchedUserId,nickname:j.matchedNickname,avatar:j.matchedUserAvatar}):e.jsx("span",{className:"text-gray-500",children:"—"})}),e.jsx(pe,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:kx[j.matchType]||j.matchType})}),e.jsxs(pe,{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(pe,{className:"text-gray-400",children:j.createdAt?new Date(j.createdAt).toLocaleString():"-"})]},j.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:w,total:l,pageSize:m,onPageChange:d,onPageSizeChange:j=>{f(j),d(1)}})]})})}),e.jsx(v0,{open:!!T,onClose:()=>b(null),userId:T,onUserUpdated:N})]})}function OC(){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(LC,{}),r==="pool"&&e.jsx(DC,{})]})}const Ex={investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function FC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[y,g]=h.useState(!0),[p,v]=h.useState("investor"),[C,P]=h.useState(null);async function T(){g(!0);try{const k=new URLSearchParams({page:String(c),pageSize:String(m),matchType:p}),j=await $e(`/api/db/match-records?${k}`);j!=null&&j.success&&(a(j.records||[]),o(j.total??0))}catch(k){console.error(k)}finally{g(!1)}}h.useEffect(()=>{T()},[c,p]);const b=async k=>{if(!k.phone&&!k.wechatId){alert("该记录无联系方式,无法推送到存客宝");return}P(k.id);try{const j=await mt("/api/ckb/join",{type:k.matchType||"investor",phone:k.phone||"",wechat:k.wechatId||"",userId:k.userId,name:k.userNickname||""});alert((j==null?void 0:j.message)||(j!=null&&j.success?"推送成功":"推送失败"))}catch(j){alert("推送失败: "+(j instanceof Error?j.message:"网络错误"))}finally{P(null)}},N=Math.ceil(l/m)||1,w=k=>!!(k.phone||k.wechatId);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400",children:"点击获客:有人填写手机号/微信号的直接显示,可一键推送到存客宝"}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["共 ",l," 条记录 — 有联系方式的可触发存客宝添加好友"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:p,onChange:k=>{v(k.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:Object.entries(Ex).map(([k,j])=>e.jsx("option",{value:k,children:j},k))}),e.jsxs(Z,{onClick:T,disabled:y,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 ${y?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:y?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(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(ps,{children:[r.map(k=>{var j,_;return e.jsxs(et,{className:`border-gray-700/50 ${w(k)?"hover:bg-[#0a1628]":"opacity-60"}`,children:[e.jsx(pe,{className:"text-white",children:k.userNickname||((j=k.userId)==null?void 0:j.slice(0,12))}),e.jsx(pe,{className:"text-white",children:k.matchedNickname||((_=k.matchedUserId)==null?void 0:_.slice(0,12))}),e.jsx(pe,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Ex[k.matchType]||k.matchType})}),e.jsxs(pe,{className:"text-sm",children:[k.phone&&e.jsxs("div",{className:"text-green-400",children:["📱 ",k.phone]}),k.wechatId&&e.jsxs("div",{className:"text-blue-400",children:["💬 ",k.wechatId]}),!k.phone&&!k.wechatId&&e.jsx("span",{className:"text-gray-600",children:"无联系方式"})]}),e.jsx(pe,{className:"text-gray-400 text-sm",children:k.createdAt?new Date(k.createdAt).toLocaleString():"-"}),e.jsx(pe,{className:"text-right",children:w(k)?e.jsxs(Z,{size:"sm",onClick:()=>b(k),disabled:C===k.id,className:"bg-[#38bdac] hover:bg-[#2da396] text-white text-xs h-7 px-3",children:[e.jsx(aN,{className:"w-3 h-3 mr-1"}),C===k.id?"推送中...":"推送CKB"]}):e.jsx("span",{className:"text-gray-600 text-xs",children:"—"})})]},k.id)}),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:6,className:"text-center py-12 text-gray-500",children:"暂无记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:N,total:l,pageSize:m,onPageChange:d,onPageSizeChange:k=>{f(k),d(1)}})]})})})]})}const Px={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},zC={single:"单次",half_year:"半年",year:"年度"};function $C(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState("");async function m(){o(!0);try{const f=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",y=await $e(f);y!=null&&y.success&&y.data&&a(y.data)}catch(f){console.error(f)}finally{o(!1)}}return h.useEffect(()=>{m()},[c]),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("p",{className:"text-gray-400",children:"导师咨询预约记录"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:f=>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(Px).map(([f,y])=>e.jsx("option",{value:f,children:y},f))]}),e.jsxs(Z,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(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(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(ps,{children:[r.map(f=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:f.id}),e.jsx(pe,{className:"text-gray-400",children:f.userId}),e.jsx(pe,{className:"text-gray-400",children:f.mentorId}),e.jsx(pe,{className:"text-gray-400",children:zC[f.consultationType]||f.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",f.amount]}),e.jsx(pe,{className:"text-gray-400",children:Px[f.status]||f.status}),e.jsx(pe,{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(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function BC(){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($C,{}),r==="manage"&&e.jsx("div",{className:"-mx-8",children:e.jsx(Mg,{embedded:!0})})]})}function UC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[y,g]=h.useState(!0);async function p(){g(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"team"}),P=await $e(`/api/db/match-records?${C}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(C){console.error(C)}finally{g(!1)}}h.useEffect(()=>{p()},[c]);const v=Math.ceil(l/m)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["团队招募匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户通过「团队招募」提交联系方式到存客宝"})]}),e.jsxs("button",{type:"button",onClick:p,disabled:y,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 ${y?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:y?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(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(ps,{children:[r.map(C=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(pe,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{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:C=>{f(C),d(1)}})]})})})]})}const Tx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},Rx={partner:"⭐",investor:"👥",mentor:"❤️",team:"🎮"};function VC({onSwitchTab:r}={}){const a=yn(),[l,o]=h.useState(null),[c,d]=h.useState(null),[m,f]=h.useState(!0),y=h.useCallback(async()=>{var p,v;f(!0);try{const[C,P]=await Promise.allSettled([$e("/api/db/match-records?stats=true"),$e("/api/db/ckb-plan-stats")]);if(C.status==="fulfilled"&&((p=C.value)!=null&&p.success)&&C.value.data){let T=C.value.data;if(T.totalMatches>0&&(!T.uniqueUsers||T.uniqueUsers===0))try{const b=await $e("/api/db/match-records?page=1&pageSize=200");if(b!=null&&b.success&&b.records){const N=new Set(b.records.map(w=>w.userId).filter(Boolean));T={...T,uniqueUsers:N.size}}}catch{}o(T)}P.status==="fulfilled"&&((v=P.value)!=null&&v.success)&&P.value.data&&d(P.value.data)}catch(C){console.error("加载统计失败:",C)}finally{f(!1)}},[]);h.useEffect(()=>{y()},[y]);const g=p=>m?"—":String(p??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(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(l==null?void 0:l.totalMatches)}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-3 flex items-center gap-1",children:[e.jsx(Un,{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(l==null?void 0:l.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:()=>a("/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(l==null?void 0:l.uniqueUsers)}),e.jsxs("p",{className:"text-blue-400/60 text-xs mt-3 flex items-center gap-1",children:[e.jsx(Un,{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:m?"—":l!=null&&l.uniqueUsers?(l.totalMatches/l.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.jsxs("p",{className:"text-3xl font-bold text-white",children:["¥",g(l==null?void 0:l.matchRevenue)]})]})}),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(l==null?void 0:l.paidMatchCount)})]})})]})]}),(l==null?void 0:l.byType)&&l.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:l.byType.map(p=>{const v=l.totalMatches>0?p.count/l.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:Rx[p.matchType]||"📊"}),e.jsx("span",{className:"text-gray-300 font-medium",children:Tx[p.matchType]||p.matchType})]}),e.jsx("p",{className:"text-3xl font-bold text-white mb-2",children:p.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(v,100)}%`}})}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1.5",children:[v.toFixed(1),"%"]})]},p.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"})," 存客宝获客数据"]}),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-5 mb-6",children:[e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20",children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"CKB 已提交线索"}),e.jsx("p",{className:"text-3xl font-bold text-white",children:m?"—":(c==null?void 0:c.ckbTotal)??0})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20",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:m?"—":(c==null?void 0:c.withContact)??0})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20",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:m?"—":c!=null&&c.ckbTotal?(c.withContact/c.ckbTotal*100).toFixed(0)+"%":"0%"})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20",children:e.jsxs(we,{className:"p-6",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"API 连接"}),e.jsx("p",{className:"text-sm font-mono text-gray-400 mt-1 truncate",children:(c==null?void 0:c.ckbApiUrl)||"ckbapi.quwanzhi.com"}),e.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Key: ",(c==null?void 0:c.ckbApiKey)||"..."]})]})})]}),(c==null?void 0:c.byType)&&c.byType.length>0&&e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-6",children:c.byType.map(p=>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:Rx[p.matchType]||"📋"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:Tx[p.matchType]||p.matchType}),e.jsx("p",{className:"text-xl font-bold text-white",children:p.total})]})]},p.matchType))})]})]})}const WC=["partner","investor","mentor","team"];function HC(){const[r,a]=h.useState("13800000000"),[l,o]=h.useState(""),[c,d]=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"}]),m=g=>{const p=r.trim(),v=l.trim();return g<=3?{type:WC[g],phone:p||void 0,wechat:v||void 0,userId:"admin_test",name:"后台测试"}:g===4?{matchType:"partner",phone:p||void 0,wechat:v||void 0,userId:"admin_test",nickname:"后台测试",matchedUser:{id:"test",nickname:"测试",matchScore:88}}:g===5?{phone:p||void 0,wechatId:v||void 0,userId:"admin_test",name:"后台测试"}:{}},f=async g=>{const p=c[g];if(p.method==="POST"&&!r.trim()&&!l.trim()){alert("请填写测试手机号");return}const v=[...c];v[g]={...p,status:"testing",message:void 0,responseTime:void 0},d(v);const C=performance.now();try{const P=p.method==="GET"?await $e(p.endpoint):await mt(p.endpoint,m(g)),T=Math.round(performance.now()-C),b=(P==null?void 0:P.message)||"",N=(P==null?void 0:P.success)===!0||b.includes("已存在")||b.includes("已加入")||b.includes("已提交"),w=[...c];w[g]={...p,status:N?"success":"error",message:b||(N?"正常":"异常"),responseTime:T},d(w)}catch(P){const T=Math.round(performance.now()-C),b=[...c];b[g]={...p,status:"error",message:P instanceof Error?P.message:"失败",responseTime:T},d(b)}},y=async()=>{if(!r.trim()&&!l.trim()){alert("请填写测试手机号");return}for(let g=0;ga(g.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(le,{className:"bg-[#0a1628] border-gray-700 text-white h-8 text-sm mt-0.5",value:l,onChange:g=>o(g.target.value)})]})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2",children:c.map((g,p)=>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:[g.status==="idle"&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-600 shrink-0"}),g.status==="testing"&&e.jsx(Be,{className:"w-3 h-3 text-yellow-400 animate-spin shrink-0"}),g.status==="success"&&e.jsx(Gd,{className:"w-3 h-3 text-green-400 shrink-0"}),g.status==="error"&&e.jsx(Kx,{className:"w-3 h-3 text-red-400 shrink-0"}),e.jsx("span",{className:"text-white text-xs truncate",children:g.label})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[g.responseTime!==void 0&&e.jsxs("span",{className:"text-gray-600 text-[10px]",children:[g.responseTime,"ms"]}),e.jsx("button",{type:"button",onClick:()=>f(p),disabled:g.status==="testing",className:"text-orange-400/60 hover:text-orange-400 text-[10px] disabled:opacity-50",children:"测试"})]})]},`${g.endpoint}-${p}`))}),e.jsxs("div",{className:"flex gap-3 mt-3 text-xs",children:[e.jsxs("a",{href:"https://ckbapi.quwanzhi.com/v1/api/scenarios",target:"_blank",rel:"noreferrer",className:"text-gray-500 hover:text-orange-400 flex items-center gap-1",children:[e.jsx(Yx,{className:"w-3 h-3"})," 场景获客API"]}),e.jsx("span",{className:"text-gray-700",children:"|"}),e.jsx("span",{className:"text-gray-600",children:"Key: fyngh-ec..."})]})]})})}const KC=[{id:"stats",label:"数据统计",icon:Yj},{id:"partner",label:"找伙伴",icon:Yt},{id:"resource",label:"资源对接",icon:kb},{id:"mentor",label:"导师预约",icon:wb},{id:"team",label:"团队招募",icon:Xd}];function GC(){const[r,a]=h.useState("stats"),[l,o]=h.useState(!1);return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex items-start justify-between 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(Yt,{className:"w-6 h-6 text-[#38bdac]"}),"找伙伴"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"数据统计、匹配池与记录、资源对接、导师预约、团队招募"})]}),e.jsxs(Z,{onClick:()=>o(!l),variant:l?"default":"outline",className:l?"bg-orange-500 hover:bg-orange-600 text-white":"border-orange-500/50 text-orange-400 hover:bg-orange-500/10 bg-transparent",children:[e.jsx(Pr,{className:"w-4 h-4 mr-2"}),"存客宝",e.jsx(dn,{className:"w-3.5 h-3.5 ml-1"})]})]}),l&&e.jsx(HC,{}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:KC.map(c=>{const d=r===c.id;return e.jsxs("button",{type:"button",onClick:()=>a(c.id),className:`flex items-center gap-2 px-5 py-2.5 rounded-md text-sm font-medium transition-all ${d?"bg-[#38bdac] text-white shadow-lg":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:[e.jsx(c.icon,{className:"w-4 h-4"}),c.label]},c.id)})}),r==="stats"&&e.jsx(VC,{onSwitchTab:c=>a(c)}),r==="partner"&&e.jsx(OC,{}),r==="resource"&&e.jsx(FC,{}),r==="mentor"&&e.jsx(BC,{}),r==="team"&&e.jsx(UC,{})]})}function YC(){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 QC(){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(eb,{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(Z,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:e.jsxs(Kd,{to:"/",children:[e.jsx(Pb,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function qC(){return e.jsxs(Cj,{children:[e.jsx(yt,{path:"/login",element:e.jsx(Cw,{})}),e.jsxs(yt,{path:"/",element:e.jsx(PN,{}),children:[e.jsx(yt,{index:!0,element:e.jsx(Sd,{to:"/dashboard",replace:!0})}),e.jsx(yt,{path:"dashboard",element:e.jsx(Ew,{})}),e.jsx(yt,{path:"orders",element:e.jsx(h2,{})}),e.jsx(yt,{path:"users",element:e.jsx(F2,{})}),e.jsx(yt,{path:"distribution",element:e.jsx(l4,{})}),e.jsx(yt,{path:"withdrawals",element:e.jsx(i4,{})}),e.jsx(yt,{path:"content",element:e.jsx(fC,{})}),e.jsx(yt,{path:"referral-settings",element:e.jsx(A0,{})}),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(_C,{})}),e.jsx(yt,{path:"mentors",element:e.jsx(Mg,{})}),e.jsx(yt,{path:"mentor-consultations",element:e.jsx(MC,{})}),e.jsx(yt,{path:"settings",element:e.jsx(NC,{})}),e.jsx(yt,{path:"payment",element:e.jsx(wC,{})}),e.jsx(yt,{path:"site",element:e.jsx(EC,{})}),e.jsx(yt,{path:"qrcodes",element:e.jsx(PC,{})}),e.jsx(yt,{path:"find-partner",element:e.jsx(GC,{})}),e.jsx(yt,{path:"match",element:e.jsx(RC,{})}),e.jsx(yt,{path:"match-records",element:e.jsx(IC,{})}),e.jsx(yt,{path:"api-doc",element:e.jsx(YC,{})})]}),e.jsx(yt,{path:"*",element:e.jsx(QC,{})})]})}Tv.createRoot(document.getElementById("root")).render(e.jsx(h.StrictMode,{children:e.jsx(Mj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(qC,{})})})); +`+as}),alert(`图片上传成功: ${nt.data.url}`)}else alert("上传失败: "+((nt==null?void 0:nt.error)||"未知错误"))}catch(xt){console.error(xt),alert("上传失败")}finally{Q(!1),Z.current&&(Z.current.value="")}}},kn=async()=>{var F;if(T.trim()){j(!0);try{const ce=await $e(`/api/search?q=${encodeURIComponent(T)}`);ce!=null&&ce.success&&((F=ce.data)!=null&&F.results)?C(ce.data.results):(C([]),ce&&!ce.success&&alert("搜索失败: "+ce.error))}catch(ce){console.error(ce),C([]),alert("搜索失败")}finally{j(!1)}}},zs=Bt.find(F=>F.id===A.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:()=>he(!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 F=typeof window<"u"?`${window.location.origin}/api-doc`:"";F&&window.open(F,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Pr,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(Ct,{open:y,onOpenChange:g,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:A.id,onChange:F=>I({...A,id:F.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:A.price,onChange:F=>I({...A,price:Number(F.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:A.title,onChange:F=>I({...A,title:F.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属篇"}),e.jsxs(El,{value:A.partId,onValueChange:F=>I({...A,partId:F,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(F=>e.jsx(lr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.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:A.chapterId,onValueChange:F=>I({...A,chapterId:F}),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(F=>e.jsx(lr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.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:A.content,onChange:F=>I({...A,content:F.target.value})})]})]}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>g(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:fr,disabled:k||!A.id||!A.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:F=>!F&&U(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(ht,{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:F=>U({...w,title:F.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>U(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(Mt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(Ct,{open:!!H,onOpenChange:F=>!F&&ie(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(ht,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),H&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节名称(如:第8章|底层结构)"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:H.title,onChange:F=>ie({...H,title:F.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>ie(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:Os,disabled:ve||!((ea=H==null?void 0:H.title)!=null&&ea.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ve?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(Ct,{open:M,onOpenChange:F=>{var ce;if(O(F),F&&Bt.length>0){const Ce=Bt[0];X(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:ne.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标篇"}),e.jsxs(El,{value:L,onValueChange:F=>{var Ce;X(F);const ce=Bt.find(Ee=>Ee.id===F);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(F=>e.jsx(lr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(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(F=>F.id===L))==null?void 0:ts.chapters)??[]).map(F=>e.jsx(lr,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]})]}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>O(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:Xn,disabled:Y||ne.length===0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:Y?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"移动中..."]}):"确认移动"})]})]})}),e.jsx(Ct,{open:!!Ve,onOpenChange:F=>!F&&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(F=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.userId??F.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",F.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:F.payTime??F.createdAt??"-"})]},F.id??F.orderSn??""))})]}):null})]})}),e.jsx(Ct,{open:ze,onOpenChange:he,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:xe.readWeight,onChange:F=>ft(ce=>({...ce,readWeight:Math.max(0,Math.min(1,parseFloat(F.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:xe.recencyWeight,onChange:F=>ft(ce=>({...ce,recencyWeight:Math.max(0,Math.min(1,parseFloat(F.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:xe.payWeight,onChange:F=>ft(ce=>({...ce,payWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(xe.readWeight+xe.recencyWeight+xe.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:bn||Math.abs(xe.readWeight+xe.recencyWeight+xe.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:bn?"保存中...":"保存权重"})]})]})]})}),e.jsx(Ct,{open:G,onOpenChange:re,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=>D(F.target.value),placeholder:"输入篇名"})]})}),e.jsxs(Dt,{children:[e.jsx(J,{variant:"outline",onClick:()=>{re(!1),D("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:qn,disabled:fe||!Se.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:fe?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(ht,{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=>f({...m,price:Number(F.target.value),isFree:Number(F.target.value)===0}),disabled:m.isFree})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(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=>f({...m,isFree:F.target.checked,price:F.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(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=>f({...m,isNew:F.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.title,onChange:F=>f({...m,title:F.target.value})})]}),m.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(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:Z,type:"file",accept:"image/*",onChange:Cn,className:"hidden"}),e.jsxs(J,{variant:"outline",size:"sm",onClick:()=>{var F;return(F=Z.current)==null?void 0:F.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(qx,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),p?e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[e.jsx(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=>f({...m,content:F.target.value})})]})]}),e.jsxs(Dt,{className:"shrink-0 px-6 py-4 border-t border-gray-700/50",children:[e.jsxs(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:wn,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(Mt,{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:()=>g(!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:()=>re(!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:()=>O(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",ne.length," 节)"]})]}),l?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(hC,{parts:Bt,expandedParts:c,onTogglePart:gs,onReorder:Nn,onReadSection:ks,onDeleteSection:mr,onAddSectionInPart:ys,onAddChapterInPart:Sn,onDeleteChapter:Fs,onEditPart:Ds,onDeletePart:Zn,onEditChapter:Es,selectedSectionIds:ne,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:F=>b(F.target.value),onKeyDown:F=>F.key==="Enter"&&kn()}),e.jsx(J,{onClick:kn,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"})})]}),N.length>0&&e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",N.length," 个结果"]}),N.map(F=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>ks({id:F.id,title:F.title,price:F.price??1,filePath:""}),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:F.id}),e.jsx("span",{className:"text-white",children:F.title})]}),e.jsx(Le,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:F.matchType==="title"?"标题匹配":"内容匹配"})]}),F.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:F.snippet}),(F.partTitle||F.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[F.partTitle," · ",F.chapterTitle]})]},F.id))]})]})]})}),e.jsx(Ot,{value:"hooks",className:"space-y-4",children:e.jsxs(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 bx(r){return Array.isArray(r)?r.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):kr.highlights}function xC(){const[r,a]=h.useState(kr),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[m,f]=h.useState(!1),y=h.useRef(null);h.useEffect(()=>{$e("/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:bx(E.highlights).length?bx(E.highlights):kr.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const g=async()=>{u(!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 mt("/api/admin/author-settings",C);if(!E||E.success===!1){alert("保存失败: "+(E&&typeof E=="object"&&"error"in E?E.error:""));return}u(!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{u(!1)}},p=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 Q=bu(),Z={};Q&&(Z.Authorization=`Bearer ${Q}`);const I=await(await fetch(Da("/api/upload"),{method:"POST",body:R,credentials:"include",headers:Z})).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),y.current&&(y.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((Q,Z)=>Z===C?{...Q,[E]:j}:Q)})),T=()=>a(C=>({...C,highlights:[...C.highlights,""]})),b=C=>a(E=>({...E,highlights:E.highlights.filter((j,R)=>R!==C)})),N=(C,E)=>a(j=>({...j,highlights:j.highlights.map((R,Q)=>Q===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:g,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{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(jt,{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(qx,{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:y,type:"file",accept:"image/*",className:"hidden",onChange:p}),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=y.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(jt,{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:j=>P(E,"label",j.target.value),placeholder:"标签"}),e.jsx(oe,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:C.value,onChange:j=>P(E,"value",j.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(jt,{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:j=>N(E,j.target.value),placeholder:"5年私域运营经验"}),e.jsx(J,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>b(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 pC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m]=h.useState(10),[f,y]=h.useState(0),[g,p]=h.useState(""),v=Iu(g,300),[k,P]=h.useState(!0),[T,b]=h.useState(null),[N,C]=h.useState(!1),[E,j]=h.useState(null),[R,Q]=h.useState(""),[Z,A]=h.useState(""),[I,w]=h.useState(""),[U,se]=h.useState("admin"),[le,G]=h.useState("active"),[re,H]=h.useState(!1);async function ie(){var O;P(!0),b(null);try{const L=new URLSearchParams({page:String(c),pageSize:String(m)});v.trim()&&L.set("search",v.trim());const X=await $e(`/api/admin/users?${L}`);X!=null&&X.success?(a(X.records||[]),o(X.total??0),y(X.totalPages??0)):b(X.error||"加载失败")}catch(L){const X=L;b(X.status===403?"无权限访问":((O=X==null?void 0:X.data)==null?void 0:O.error)||"加载失败"),a([])}finally{P(!1)}}h.useEffect(()=>{ie()},[c,m,v]);const ve=()=>{j(null),Q(""),A(""),w(""),se("admin"),G("active"),C(!0)},z=O=>{j(O),Q(O.username),A(""),w(O.name||""),se(O.role==="super_admin"?"super_admin":"admin"),G(O.status==="disabled"?"disabled":"active"),C(!0)},ne=async()=>{var O;if(!R.trim()){b("用户名不能为空");return}if(!E&&!Z){b("新建时密码必填,至少 6 位");return}if(Z&&Z.length<6){b("密码至少 6 位");return}b(null),H(!0);try{if(E){const L=await vt("/api/admin/users",{id:E.id,password:Z||void 0,name:I.trim(),role:U,status:le});L!=null&&L.success?(C(!1),ie()):b((L==null?void 0:L.error)||"保存失败")}else{const L=await mt("/api/admin/users",{username:R.trim(),password:Z,name:I.trim(),role:U});L!=null&&L.success?(C(!1),ie()):b((L==null?void 0:L.error)||"保存失败")}}catch(L){const X=L;b(((O=X==null?void 0:X.data)==null?void 0:O.error)||"保存失败")}finally{H(!1)}},W=async O=>{var L;if(confirm("确定删除该管理员?"))try{const X=await Tr(`/api/admin/users?id=${O}`);X!=null&&X.success?ie():b((X==null?void 0:X.error)||"删除失败")}catch(X){const K=X;b(((L=K==null?void 0:K.data)==null?void 0:L.error)||"删除失败")}},M=O=>{if(!O)return"-";try{const L=new Date(O);return isNaN(L.getTime())?O:L.toLocaleString("zh-CN")}catch{return O}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(vu,{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:g,onChange:O=>p(O.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(J,{variant:"outline",size:"sm",onClick:ie,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:ve,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:()=>b(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(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(ps,{children:[r.map(O=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:O.id}),e.jsx(pe,{className:"text-white font-medium",children:O.username}),e.jsx(pe,{className:"text-gray-400",children:O.name||"-"}),e.jsx(pe,{children:e.jsx(Le,{variant:"outline",className:O.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:O.role==="super_admin"?"超级管理员":"管理员"})}),e.jsx(pe,{children:e.jsx(Le,{variant:"outline",className:O.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:O.status==="active"?"正常":"已禁用"})}),e.jsx(pe,{className:"text-gray-500 text-sm",children:M(O.createdAt)}),e.jsxs(pe,{className:"text-right",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>z(O),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>W(O.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]},O.id)),r.length===0&&!k&&e.jsx(et,{children:e.jsx(pe,{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:u})})]})})}),e.jsx(Ct,{open:N,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:O=>Q(O.target.value),disabled:!!E}),E&&e.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:E?"新密码(留空不改)":"密码"}),e.jsx(oe,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:E?"留空表示不修改":"至少 6 位",value:Z,onChange:O=>A(O.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:O=>w(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:U,onChange:O=>se(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"admin",children:"管理员"}),e.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),E&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"状态"}),e.jsxs("select",{value:le,onChange:O=>G(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"active",children:"正常"}),e.jsx("option",{value:"disabled",children:"禁用"})]})]})]}),e.jsxs(Dt,{children:[e.jsxs(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:ne,disabled:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),re?"保存中...":"保存"]})]})]})})]})}const gC={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},yC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},vC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...yC}},jC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},bC=["system","author","admin"];function NC(){const[r,a]=Ux(),l=r.get("tab")??"system",o=bC.includes(l)?l:"system",[c,u]=h.useState(vC),[m,f]=h.useState(jC),[y,g]=h.useState(gC),[p,v]=h.useState(!1),[k,P]=h.useState(!0),[T,b]=h.useState(!1),[N,C]=h.useState(""),[E,j]=h.useState(""),[R,Q]=h.useState(!1),[Z,A]=h.useState(!1),I=(G,re,H=!1)=>{C(G),j(re),Q(H),b(!0)};h.useEffect(()=>{(async()=>{try{const re=await $e("/api/admin/settings");if(!re||re.success===!1)return;if(re.featureConfig&&Object.keys(re.featureConfig).length&&f(H=>({...H,...re.featureConfig})),re.mpConfig&&typeof re.mpConfig=="object"&&g(H=>({...H,...re.mpConfig})),re.siteSettings&&typeof re.siteSettings=="object"){const H=re.siteSettings;u(ie=>({...ie,...typeof H.sectionPrice=="number"&&{sectionPrice:H.sectionPrice},...typeof H.baseBookPrice=="number"&&{baseBookPrice:H.baseBookPrice},...typeof H.distributorShare=="number"&&{distributorShare:H.distributorShare},...H.authorInfo&&typeof H.authorInfo=="object"&&{authorInfo:{...ie.authorInfo,...H.authorInfo}}}))}}catch(re){console.error("Load settings error:",re)}finally{P(!1)}})()},[]);const w=async(G,re)=>{A(!0);try{const H=await mt("/api/admin/settings",{featureConfig:G});if(!H||H.success===!1){re(),I("保存失败",(H==null?void 0:H.error)??"未知错误",!0);return}I("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(H){console.error("Save feature config error:",H),re(),I("保存失败",H instanceof Error?H.message:String(H),!0)}finally{A(!1)}},U=(G,re)=>{const H=m,ie={...H,[G]:re};f(ie),w(ie,()=>f(H))},se=async()=>{v(!0);try{const G=await mt("/api/admin/settings",{featureConfig:m,siteSettings:{sectionPrice:c.sectionPrice,baseBookPrice:c.baseBookPrice,distributorShare:c.distributorShare,authorInfo:c.authorInfo},mpConfig:{...y,appId:y.appId||"",withdrawSubscribeTmplId:y.withdrawSubscribeTmplId||"",mchId:y.mchId||"",minWithdraw:typeof y.minWithdraw=="number"?y.minWithdraw:10}});if(!G||G.success===!1){I("保存失败",(G==null?void 0:G.error)??"未知错误",!0);return}I("已保存","设置已保存成功。")}catch(G){console.error("Save settings error:",G),I("保存失败",G instanceof Error?G.message:String(G),!0)}finally{v(!1)}},le=G=>{a(G==="system"?{}:{tab:G})};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:"配置全站基础参数与开关"})]}),o==="system"&&e.jsxs(J,{onClick:se,disabled:p,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),p?"保存中...":"保存设置"]})]}),e.jsxs($l,{value:o,onValueChange:le,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(Bn,{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(vu,{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(jt,{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:G=>u(re=>({...re,authorInfo:{...re.authorInfo,name:G.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:G=>u(re=>({...re,authorInfo:{...re.authorInfo,startDate:G.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:G=>u(re=>({...re,authorInfo:{...re.authorInfo,liveTime:G.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(Xx,{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:G=>u(re=>({...re,authorInfo:{...re.authorInfo,platform:G.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:G=>u(re=>({...re,authorInfo:{...re.authorInfo,description:G.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:G=>u(re=>({...re,authorInfo:{...re.authorInfo,bio:G.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(jt,{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:G=>u(re=>({...re,sectionPrice:Number.parseFloat(G.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:G=>u(re=>({...re,baseBookPrice:Number.parseFloat(G.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(jt,{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:y.appId??"",onChange:G=>g(re=>({...re,appId:G.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:y.withdrawSubscribeTmplId??"",onChange:G=>g(re=>({...re,withdrawSubscribeTmplId: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",placeholder:"1318592501",value:y.mchId??"",onChange:G=>g(re=>({...re,mchId:G.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.minWithdraw??10,onChange:G=>g(re=>({...re,minWithdraw:Number.parseFloat(G.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(Bn,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),e.jsx(jt,{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:Z,onCheckedChange:G=>U("matchEnabled",G)})]}),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(yb,{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:Z,onCheckedChange:G=>U("referralEnabled",G)})]}),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:Z,onCheckedChange:G=>U("searchEnabled",G)})]}),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(Bn,{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:Z,onCheckedChange:G=>U("aboutEnabled",G)})]})]}),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(xC,{})}),e.jsx(Ot,{value:"admin",className:"mt-0",children:e.jsx(pC,{})})]}),e.jsx(Ct,{open:T,onOpenChange:b,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:N}),e.jsx(u2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:E})]}),e.jsx(Dt,{className:"mt-4",children:e.jsx(J,{onClick:()=>b(!1),className:R?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const Nx={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 wC(){const[r,a]=h.useState(!1),[l,o]=h.useState(Nx),[c,u]=h.useState(""),m=async()=>{a(!0);try{const C=await $e("/api/config");C!=null&&C.paymentMethods&&o({...Nx,...C.paymentMethods})}catch(C){console.error(C)}finally{a(!1)}};h.useEffect(()=>{m()},[]);const f=async()=>{a(!0);try{await mt("/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)}},y=(C,E)=>{navigator.clipboard.writeText(C),u(E),setTimeout(()=>u(""),2e3)},g=(C,E)=>{o(j=>({...j,wechat:{...j.wechat,[C]:E}}))},p=(C,E)=>{o(j=>({...j,alipay:{...j.alipay,[C]:E}}))},v=(C,E)=>{o(j=>({...j,usdt:{...j.usdt,[C]:E}}))},k=(C,E)=>{o(j=>({...j,paypal:{...j.paypal,[C]:E}}))},P=l.wechat,T=l.alipay,b=l.usdt,N=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(Mt,{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(Hx,{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(zf,{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(Of,{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(jt,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(ot,{checked:!!P.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:"网站AppID"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:C=>g("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=>g("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(Un,{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=>g("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=>g("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(zf,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(jt,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(ot,{checked:!!T.enabled,onCheckedChange:C=>p("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=>p("partnerId",C.target.value)}),e.jsx(J,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>y(String(T.partnerId??""),"pid"),children:c==="pid"?e.jsx(wo,{className:"w-4 h-4 text-green-500"}):e.jsx(Gx,{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=>p("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(Un,{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=>p("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(Of,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(jt,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(ot,{checked:!!b.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(b.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(b.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(b.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(jt,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(ot,{checked:!!N.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(N.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(N.exchangeRate)??7.2,onChange:C=>k("exchangeRate",Number(C.target.value)||7.2)})]})]})]})})]})]})}const SC={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},CC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},kC={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function EC(){const[r,a]=h.useState({siteConfig:{...SC},menuConfig:{...CC},pageConfig:{...kC}}),[l,o]=h.useState(!1),[c,u]=h.useState(!1);h.useEffect(()=>{$e("/api/config").then(p=>{p!=null&&p.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...p.siteConfig}})),p!=null&&p.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...p.menuConfig}})),p!=null&&p.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...p.pageConfig}}))}).catch(console.error)},[]);const m=async()=>{u(!0);try{await mt("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await mt("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await mt("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(p){console.error(p),alert("保存失败: "+(p instanceof Error?p.message:String(p)))}finally{u(!1)}},f=r.siteConfig,y=r.menuConfig,g=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(Mt,{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(jt,{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:p=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:p.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:p=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:p.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:p=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:p.target.value}}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(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:p=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:p.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:p=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:p.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(Gb,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),e.jsx(jt,{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:p=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:p.target.value}}))}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:f.primaryColor??"#00CED1",onChange:p=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:p.target.value}}))})]})]}),e.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:f.primaryColor??"#00CED1"},children:"预览"})]})})]}),e.jsxs(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(Ub,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),e.jsx(jt,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),e.jsx(we,{className:"space-y-4",children:Object.entries(y).map(([p,v])=>e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx(ot,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:k=>a(P=>({...P,menuConfig:{...P.menuConfig,[p]:{...v,enabled:k}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:p}),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,[p]:{...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?"显示":"隐藏"})]},p))})]}),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(Yx,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),e.jsx(jt,{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:g.homeTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:p.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:g.homeSubtitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:p.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目录页标题"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.chaptersTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:p.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:g.matchTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:p.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"我的页标题"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.myTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:p.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:g.aboutTitle??"",onChange:p=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:p.target.value}}))})]})]})]})]})]})]})}function PC(){const[r,a]=h.useState(""),[l,o]=h.useState(""),[c,u]=h.useState(""),[m,f]=h.useState({}),y=async()=>{var P,T,b,N;try{const C=await $e("/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=(N=(b=C==null?void 0:C.paymentMethods)==null?void 0:b.wechat)==null?void 0:N.groupQrCode;j&&o(j),f({paymentMethods:C==null?void 0:C.paymentMethods,liveQRCodes:C==null?void 0:C.liveQRCodes})}catch(C){console.error(C)}};h.useEffect(()=>{y()},[]);const g=(P,T)=>{navigator.clipboard.writeText(P),u(T),setTimeout(()=>u(""),2e3)},p=async()=>{try{const P=r.split(` +`).map(b=>b.trim()).filter(Boolean),T=[...m.liveQRCodes||[]];T[0]?T[0].urls=P:T.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await mt("/api/db/config",{key:"live_qr_codes",value:T,description:"群活码配置"}),alert("群活码配置已保存!"),await y()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},v=async()=>{var P;try{await mt("/api/db/config",{key:"payment_methods",value:{...m.paymentMethods||{},wechat:{...((P=m.paymentMethods)==null?void 0:P.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await y()}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(Hx,{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(Uf,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),e.jsx(jt,{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(Bf,{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=>o(P.target.value)}),e.jsx(J,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>g(l,"group"),children:c==="group"?e.jsx(wo,{className:"w-4 h-4 text-green-500"}):e.jsx(Gx,{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(Un,{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(Un,{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(Uf,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),e.jsx(jt,{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(Bf,{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:p,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 wx={matchTypes:[{id:"partner",label:"创业合伙",matchLabel:"创业伙伴",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"导师顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},TC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function RC(){const[r,a]=h.useState(wx),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[m,f]=h.useState(!1),[y,g]=h.useState(null),[p,v]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),k=async()=>{o(!0);try{const j=await $e("/api/db/config/full?key=match_config"),R=(j==null?void 0:j.data)??(j==null?void 0:j.config);R&&a({...wx,...R})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};h.useEffect(()=>{k()},[]);const P=async()=>{u(!0);try{const j=await mt("/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{u(!1)}},T=j=>{g(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)},b=()=>{g(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},N=()=>{if(!p.id||!p.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(y){const R=j.findIndex(Q=>Q.id===y.id);R!==-1&&(j[R]={...p})}else{if(j.some(R=>R.id===p.id)){alert("类型ID已存在");return}j.push({...p})}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(Bn,{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(Mt,{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(jt,{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: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(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: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(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: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(ot,{checked:r.settings.enableFreeMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enableFreeMatches:j}})}),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:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),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(jt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(J,{onClick:b,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(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(ps,{children:r.matchTypes.map(j=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white font-medium",children:j.label}),e.jsx(pe,{className:"text-gray-300",children:j.matchLabel}),e.jsx(pe,{children:e.jsxs(Le,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(pe,{children:j.matchFromDB?e.jsx(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(pe,{children:e.jsx(ot,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>T(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>C(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Ht,{className:"w-4 h-4"})})]})})]},j.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:[y?e.jsx(ht,{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:p.id,onChange:j=>v({...p,id:j.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:TC.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${p.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...p,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(oe,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:p.label,onChange:j=>v({...p,label:j.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:p.matchLabel,onChange:j=>v({...p,matchLabel:j.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:p.price,onChange:j=>v({...p,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(ot,{checked:p.matchFromDB,onCheckedChange:j=>v({...p,matchFromDB:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:p.showJoinAfterMatch,onCheckedChange:j=>v({...p,showJoinAfterMatch:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ot,{checked:p.enabled,onCheckedChange:j=>v({...p,enabled:j})}),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:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const Sx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function IC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[y,g]=h.useState(""),[p,v]=h.useState(!0),[k,P]=h.useState(null);async function T(){v(!0),P(null);try{const N=new URLSearchParams({page:String(c),pageSize:String(m)});y&&N.set("matchType",y);const C=await $e(`/api/db/match-records?${N}`);C!=null&&C.success?(a(C.records||[]),o(C.total??0)):P("加载匹配记录失败")}catch(N){console.error("加载匹配记录失败",N),P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{T()},[c,y]);const b=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:y,onChange:N=>{g(N.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(Sx).map(([N,C])=>e.jsx("option",{value:N,children:C},N))]}),e.jsxs("button",{type:"button",onClick:T,disabled:p,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx(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(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(ps,{children:[r.map(N=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[N.userAvatar?e.jsx("img",{src:N.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:N.userAvatar?"hidden":"",children:(N.userNickname||N.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:N.userNickname||N.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[N.userId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[N.matchedUserAvatar?e.jsx("img",{src:N.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:N.matchedUserAvatar?"hidden":"",children:(N.matchedNickname||N.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:N.matchedNickname||N.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[N.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Sx[N.matchType]||N.matchType})}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[N.phone&&e.jsxs("div",{children:["📱 ",N.phone]}),N.wechatId&&e.jsxs("div",{children:["💬 ",N.wechatId]}),!N.phone&&!N.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:N.createdAt?new Date(N.createdAt).toLocaleString():"-"})]},N.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:b,total:l,pageSize:m,onPageChange:u,onPageSizeChange:N=>{f(N),u(1)}})]})})})]})}function _C(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[m,f]=h.useState(null),[y,g]=h.useState(""),[p,v]=h.useState(0),[k,P]=h.useState(!1);async function T(){o(!0);try{const j=await $e("/api/db/vip-roles");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load roles error:",j)}finally{o(!1)}}h.useEffect(()=>{T()},[]);const b=()=>{f(null),g(""),v(r.length>0?Math.max(...r.map(j=>j.sort))+1:0),u(!0)},N=j=>{f(j),g(j.name),v(j.sort),u(!0)},C=async()=>{if(!y.trim()){alert("角色名称不能为空");return}P(!0);try{if(m){const j=await vt("/api/db/vip-roles",{id:m.id,name:y.trim(),sort:p});j!=null&&j.success?(u(!1),T()):alert("更新失败: "+(j==null?void 0:j.error))}else{const j=await mt("/api/db/vip-roles",{name:y.trim(),sort:p});j!=null&&j.success?(u(!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 Tr(`/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(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: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: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(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(ps,{children:[r.map(j=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white",children:j.name}),e.jsx(pe,{className:"text-gray-400",children:j.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>N(j),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>E(j.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Ht,{className:"w-4 h-4"})})]})]},j.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),e.jsx(Ct,{open:c,onOpenChange:u,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:y,onChange:j=>g(j.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,onChange:j=>v(parseInt(j.target.value,10)||0)})]})]}),e.jsxs(Dt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>u(!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(Mt,{className:"w-4 h-4 mr-2"}),k?"保存中...":"保存"]})]})]})})]})}function Mg({embedded:r=!1}){const[a,l]=h.useState([]),[o,c]=h.useState(!0),[u,m]=h.useState(!1),[f,y]=h.useState(null),[g,p]=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),b=h.useRef(null),N=async I=>{var U;const w=(U=I.target.files)==null?void 0:U[0];if(w){T(!0);try{const se=new FormData;se.append("file",w),se.append("folder","mentors");const le=bu(),G={};le&&(G.Authorization=`Bearer ${le}`);const H=await(await fetch(Da("/api/upload"),{method:"POST",body:se,credentials:"include",headers:G})).json();H!=null&&H.success&&(H!=null&&H.url)?p(ie=>({...ie,avatar:H.url})):alert("上传失败: "+((H==null?void 0:H.error)||"未知错误"))}catch(se){console.error(se),alert("上传失败")}finally{T(!1),b.current&&(b.current.value="")}}};async function C(){c(!0);try{const I=await $e("/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=()=>{p({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=()=>{y(null),E(),m(!0)},R=I=>{y(I),p({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)},Q=async()=>{if(!g.name.trim()){alert("导师姓名不能为空");return}k(!0);try{const I=U=>U===""?void 0:parseFloat(U),w={name:g.name.trim(),avatar:g.avatar.trim()||void 0,intro:g.intro.trim()||void 0,tags:g.tags.trim()||void 0,priceSingle:I(g.priceSingle),priceHalfYear:I(g.priceHalfYear),priceYear:I(g.priceYear),quote:g.quote.trim()||void 0,whyFind:g.whyFind.trim()||void 0,offering:g.offering.trim()||void 0,judgmentStyle:g.judgmentStyle.trim()||void 0,sort:g.sort,enabled:g.enabled};if(f){const U=await vt("/api/db/mentors",{id:f.id,...w});U!=null&&U.success?(m(!1),C()):alert("更新失败: "+(U==null?void 0:U.error))}else{const U=await mt("/api/db/mentors",w);U!=null&&U.success?(m(!1),C()):alert("新增失败: "+(U==null?void 0:U.error))}}catch(I){console.error("Save error:",I),alert("保存失败")}finally{k(!1)}},Z=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("删除失败")}},A=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:j,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:o?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(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(ps,{children:[a.map(I=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:I.id}),e.jsx(pe,{className:"text-white",children:I.name}),e.jsx(pe,{className:"text-gray-400 max-w-[200px] truncate",children:I.intro||"-"}),e.jsx(pe,{className:"text-gray-400",children:A(I.priceSingle)}),e.jsx(pe,{className:"text-gray-400",children:A(I.priceHalfYear)}),e.jsx(pe,{className:"text-gray-400",children:A(I.priceYear)}),e.jsx(pe,{className:"text-gray-400",children:I.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>R(I),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>Z(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(pe,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),e.jsx(Ct,{open:u,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:g.name,onChange:I=>p(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:g.sort,onChange:I=>p(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:g.avatar,onChange:I=>p(w=>({...w,avatar:I.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:b,type:"file",accept:"image/*",className:"hidden",onChange:N}),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=b.current)==null?void 0:I.click()},children:[e.jsx(uo,{className:"w-4 h-4 mr-2"}),P?"上传中...":"上传"]})]}),g.avatar&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:g.avatar.startsWith("http")?g.avatar:Da(g.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:g.intro,onChange:I=>p(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:g.tags,onChange:I=>p(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:g.priceSingle,onChange:I=>p(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:g.priceHalfYear,onChange:I=>p(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:g.priceYear,onChange:I=>p(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:g.quote,onChange:I=>p(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:g.whyFind,onChange:I=>p(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:g.offering,onChange:I=>p(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:g.judgmentStyle,onChange:I=>p(w=>({...w,judgmentStyle:I.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:g.enabled,onChange:I=>p(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:Q,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})})]})}function MC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState("");async function m(){o(!0);try{const g=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",p=await $e(g);p!=null&&p.success&&p.data&&a(p.data)}catch(g){console.error("Load consultations error:",g)}finally{o(!1)}}h.useEffect(()=>{m()},[c]);const f={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},y={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:g=>u(g.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(([g,p])=>e.jsx("option",{value:g,children:p},g))]}),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(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(ps,{children:[r.map(g=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:g.id}),e.jsx(pe,{className:"text-gray-400",children:g.userId}),e.jsx(pe,{className:"text-gray-400",children:g.mentorId}),e.jsx(pe,{className:"text-gray-400",children:y[g.consultationType]||g.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",g.amount]}),e.jsx(pe,{className:"text-gray-400",children:f[g.status]||g.status}),e.jsx(pe,{className:"text-gray-500 text-sm",children:g.createdAt})]},g.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const Rl={poolSource:["vip"],requirePhone:!0,requireNickname:!0,requireAvatar:!1,requireBusiness:!1},Cx={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},AC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function DC(){const r=gn(),[a,l]=h.useState(Cx),[o,c]=h.useState(!0),[u,m]=h.useState(!1),[f,y]=h.useState(!1),[g,p]=h.useState(null),[v,k]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),[P,T]=h.useState(null),[b,N]=h.useState(!1),C=async()=>{N(!0);try{const w=await $e("/api/db/match-pool-counts");w!=null&&w.success&&w.data&&T(w.data)}catch(w){console.error("加载池子人数失败:",w)}finally{N(!1)}},E=async()=>{c(!0);try{const w=await $e("/api/db/config/full?key=match_config"),U=(w==null?void 0:w.data)??(w==null?void 0:w.config);if(U){let se=U.poolSettings??Rl;se.poolSource&&!Array.isArray(se.poolSource)&&(se={...se,poolSource:[se.poolSource]}),l({...Cx,...U,poolSettings:se})}}catch(w){console.error("加载匹配配置失败:",w)}finally{c(!1)}};h.useEffect(()=>{E(),C()},[]);const j=async()=>{m(!0);try{const w=await mt("/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=>{p(w),k({...w}),y(!0)},Q=()=>{p(null),k({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),y(!0)},Z=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const w=[...a.matchTypes];if(g){const U=w.findIndex(se=>se.id===g.id);U!==-1&&(w[U]={...v})}else{if(w.some(U=>U.id===v.id)){alert("类型ID已存在");return}w.push({...v})}l({...a,matchTypes:w}),y(!1)},A=w=>{confirm("确定要删除这个匹配类型吗?")&&l({...a,matchTypes:a.matchTypes.filter(U=>U.id!==w)})},I=w=>{l({...a,matchTypes:a.matchTypes.map(U=>U.id===w?{...U,enabled:!U.enabled}:U)})};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:o,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 ${o?"animate-spin":""}`})," 刷新"]}),e.jsxs(J,{onClick:j,disabled:u,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"})," ",u?"保存中...":"保存配置"]})]}),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(jt,{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 U=a.poolSettings??Rl,le=(Array.isArray(U.poolSource)?U.poolSource:[U.poolSource]).includes(w.value),G=P==null?void 0:P[w.countKey],re=()=>{const H=Array.isArray(U.poolSource)?[...U.poolSource]:[U.poolSource],ie=le?H.filter(ve=>ve!==w.value):[...H,w.value];ie.length===0&&ie.push(w.value),l({...a,poolSettings:{...U,poolSource:ie}})};return e.jsxs("button",{type:"button",onClick:re,className:`p-4 rounded-lg border text-left transition-all ${le?"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 ${le?"border-[#38bdac] bg-[#38bdac] text-white":"border-gray-600"}`,children:le&&"✓"}),e.jsx("span",{className:"text-xl",children:w.icon}),e.jsx("span",{className:`text-sm font-medium ${le?"text-[#38bdac]":"text-gray-300"}`,children:w.label})]}),e.jsxs("span",{className:"text-lg font-bold text-white",children:[b?"...":G??"-",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:H=>{H.stopPropagation(),r(`/users?pool=${w.value}`)},onKeyDown:H=>{H.key==="Enter"&&(H.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:le=>l({...a,poolSettings:{...a.poolSettings??Rl,[w.key]:le}})}),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(jt,{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(jt,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(J,{onClick:Q,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(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(ps,{children:a.matchTypes.map(w=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:w.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:w.id}),e.jsx(pe,{className:"text-white font-medium",children:w.label}),e.jsx(pe,{className:"text-gray-300",children:w.matchLabel}),e.jsx(pe,{children:e.jsxs(Le,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",w.price]})}),e.jsx(pe,{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(pe,{children:e.jsx(ot,{checked:w.enabled,onCheckedChange:()=>I(w.id)})}),e.jsx(pe,{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(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>A(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:y,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:[g?e.jsx(ht,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Rt,{className:"w-5 h-5 text-[#38bdac]"}),g?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(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:!!g})]}),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:AC.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:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(J,{onClick:Z,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Mt,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const kx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function LC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[y,g]=h.useState(""),[p,v]=h.useState(!0),[k,P]=h.useState(null),[T,b]=h.useState(null);async function N(){v(!0),P(null);try{const j=new URLSearchParams({page:String(c),pageSize:String(m)});y&&j.set("matchType",y);const R=await $e(`/api/db/match-records?${j}`);R!=null&&R.success?(a(R.records||[]),o(R.total??0)):P("加载匹配记录失败")}catch{P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{N()},[c,y]);const C=Math.ceil(l/m)||1,E=({userId:j,nickname:R,avatar:Q})=>e.jsxs("div",{className:"flex items-center gap-3 cursor-pointer group",onClick:()=>b(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:[Q?e.jsx("img",{src:Q,alt:"",className:"w-full h-full object-cover",onError:Z=>{Z.currentTarget.style.display="none"}}):null,e.jsx("span",{className:Q?"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:y,onChange:j=>{g(j.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(kx).map(([j,R])=>e.jsx("option",{value:j,children:R},j))]}),e.jsxs("button",{type:"button",onClick:N,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(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(ps,{children:[r.map(j=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx(E,{userId:j.userId,nickname:j.userNickname,avatar:j.userAvatar})}),e.jsx(pe,{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(pe,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:kx[j.matchType]||j.matchType})}),e.jsxs(pe,{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(pe,{className:"text-gray-400",children:j.createdAt?new Date(j.createdAt).toLocaleString():"-"})]},j.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:C,total:l,pageSize:m,onPageChange:u,onPageSizeChange:j=>{f(j),u(1)}})]})})}),e.jsx(v0,{open:!!T,onClose:()=>b(null),userId:T,onUserUpdated:N})]})}function OC(){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(LC,{}),r==="pool"&&e.jsx(DC,{})]})}const Ex={investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function FC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[y,g]=h.useState(!0),[p,v]=h.useState("investor"),[k,P]=h.useState(null);async function T(){g(!0);try{const E=new URLSearchParams({page:String(c),pageSize:String(m),matchType:p}),j=await $e(`/api/db/match-records?${E}`);j!=null&&j.success&&(a(j.records||[]),o(j.total??0))}catch(E){console.error(E)}finally{g(!1)}}h.useEffect(()=>{T()},[c,p]);const b=async E=>{if(!E.phone&&!E.wechatId){alert("该记录无联系方式,无法推送到存客宝");return}P(E.id);try{const j=await mt("/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)}},N=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:p,onChange:E=>{v(E.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:Object.entries(Ex).map(([E,j])=>e.jsx("option",{value:E,children:j},E))}),e.jsxs(J,{onClick:T,disabled:y,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 ${y?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:y?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(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(ps,{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(pe,{className:"text-white",children:E.userNickname||((j=E.userId)==null?void 0:j.slice(0,12))}),e.jsx(pe,{className:"text-white",children:E.matchedNickname||((R=E.matchedUserId)==null?void 0:R.slice(0,12))}),e.jsx(pe,{children:e.jsx(Le,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Ex[E.matchType]||E.matchType})}),e.jsxs(pe,{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(pe,{className:"text-gray-400 text-sm",children:E.createdAt?new Date(E.createdAt).toLocaleString():"-"}),e.jsx(pe,{className:"text-right",children:C(E)?e.jsxs(J,{size:"sm",onClick:()=>b(E),disabled:k===E.id,className:"bg-[#38bdac] hover:bg-[#2da396] text-white text-xs h-7 px-3",children:[e.jsx(aN,{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(pe,{colSpan:6,className:"text-center py-12 text-gray-500",children:"暂无记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:N,total:l,pageSize:m,onPageChange:u,onPageSizeChange:E=>{f(E),u(1)}})]})})})]})}const Px={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},zC={single:"单次",half_year:"半年",year:"年度"};function $C(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState("");async function m(){o(!0);try{const f=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",y=await $e(f);y!=null&&y.success&&y.data&&a(y.data)}catch(f){console.error(f)}finally{o(!1)}}return h.useEffect(()=>{m()},[c]),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("p",{className:"text-gray-400",children:"导师咨询预约记录"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:f=>u(f.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(Px).map(([f,y])=>e.jsx("option",{value:f,children:y},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(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(ps,{children:[r.map(f=>e.jsxs(et,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:f.id}),e.jsx(pe,{className:"text-gray-400",children:f.userId}),e.jsx(pe,{className:"text-gray-400",children:f.mentorId}),e.jsx(pe,{className:"text-gray-400",children:zC[f.consultationType]||f.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",f.amount]}),e.jsx(pe,{className:"text-gray-400",children:Px[f.status]||f.status}),e.jsx(pe,{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(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function BC(){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($C,{}),r==="manage"&&e.jsx("div",{className:"-mx-8",children:e.jsx(Mg,{embedded:!0})})]})}function UC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[m,f]=h.useState(10),[y,g]=h.useState(!0);async function p(){g(!0);try{const k=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"team"}),P=await $e(`/api/db/match-records?${k}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(k){console.error(k)}finally{g(!1)}}h.useEffect(()=>{p()},[c]);const v=Math.ceil(l/m)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["团队招募匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户通过「团队招募」提交联系方式到存客宝"})]}),e.jsxs("button",{type:"button",onClick:p,disabled:y,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 ${y?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:y?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(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(ps,{children:[r.map(k=>e.jsxs(et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{className:"text-white",children:k.userNickname||k.userId}),e.jsx(pe,{className:"text-white",children:k.matchedNickname||k.matchedUserId}),e.jsxs(pe,{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(pe,{className:"text-gray-400",children:k.createdAt?new Date(k.createdAt).toLocaleString():"-"})]},k.id)),r.length===0&&e.jsx(et,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无团队招募记录"})})]})]}),e.jsx(Qs,{page:c,totalPages:v,total:l,pageSize:m,onPageChange:u,onPageSizeChange:k=>{f(k),u(1)}})]})})})]})}const Tx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},Rx={partner:"⭐",investor:"👥",mentor:"❤️",team:"🎮"};function VC({onSwitchTab:r}={}){const a=gn(),[l,o]=h.useState(null),[c,u]=h.useState(null),[m,f]=h.useState(!0),y=h.useCallback(async()=>{var p,v;f(!0);try{const[k,P]=await Promise.allSettled([$e("/api/db/match-records?stats=true"),$e("/api/db/ckb-plan-stats")]);if(k.status==="fulfilled"&&((p=k.value)!=null&&p.success)&&k.value.data){let T=k.value.data;if(T.totalMatches>0&&(!T.uniqueUsers||T.uniqueUsers===0))try{const b=await $e("/api/db/match-records?page=1&pageSize=200");if(b!=null&&b.success&&b.records){const N=new Set(b.records.map(C=>C.userId).filter(Boolean));T={...T,uniqueUsers:N.size}}}catch{}o(T)}P.status==="fulfilled"&&((v=P.value)!=null&&v.success)&&P.value.data&&u(P.value.data)}catch(k){console.error("加载统计失败:",k)}finally{f(!1)}},[]);h.useEffect(()=>{y()},[y]);const g=p=>m?"—":String(p??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(l==null?void 0:l.totalMatches)}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-3 flex items-center gap-1",children:[e.jsx(Un,{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(l==null?void 0:l.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:()=>a("/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(l==null?void 0:l.uniqueUsers)}),e.jsxs("p",{className:"text-blue-400/60 text-xs mt-3 flex items-center gap-1",children:[e.jsx(Un,{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:m?"—":l!=null&&l.uniqueUsers?(l.totalMatches/l.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.jsxs("p",{className:"text-3xl font-bold text-white",children:["¥",g(l==null?void 0:l.matchRevenue)]})]})}),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(l==null?void 0:l.paidMatchCount)})]})})]})]}),(l==null?void 0:l.byType)&&l.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:l.byType.map(p=>{const v=l.totalMatches>0?p.count/l.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:Rx[p.matchType]||"📊"}),e.jsx("span",{className:"text-gray-300 font-medium",children:Tx[p.matchType]||p.matchType})]}),e.jsx("p",{className:"text-3xl font-bold text-white mb-2",children:p.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(v,100)}%`}})}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1.5",children:[v.toFixed(1),"%"]})]},p.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",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:m?"—":(c==null?void 0:c.ckbTotal)??0})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20",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:m?"—":(c==null?void 0:c.withContact)??0})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-orange-500/20 cursor-pointer hover:border-orange-500/50 transition-colors",onClick:()=>r==null?void 0:r("ckb"),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 文档"})]})})]}),(c==null?void 0:c.byType)&&c.byType.length>0&&e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-6",children:c.byType.map(p=>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:Rx[p.matchType]||"📋"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-xs",children:Tx[p.matchType]||p.matchType}),e.jsx("p",{className:"text-xl font-bold text-white",children:p.total})]})]},p.matchType))})]})]})}const WC=["partner","investor","mentor","team"];function HC(){const[r,a]=h.useState("13800000000"),[l,o]=h.useState(""),[c,u]=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"}]),m=g=>{const p=r.trim(),v=l.trim();return g<=3?{type:WC[g],phone:p||void 0,wechat:v||void 0,userId:"admin_test",name:"后台测试"}:g===4?{matchType:"partner",phone:p||void 0,wechat:v||void 0,userId:"admin_test",nickname:"后台测试",matchedUser:{id:"test",nickname:"测试",matchScore:88}}:g===5?{phone:p||void 0,wechatId:v||void 0,userId:"admin_test",name:"后台测试"}:{}},f=async g=>{const p=c[g];if(p.method==="POST"&&!r.trim()&&!l.trim()){alert("请填写测试手机号");return}const v=[...c];v[g]={...p,status:"testing",message:void 0,responseTime:void 0},u(v);const k=performance.now();try{const P=p.method==="GET"?await $e(p.endpoint):await mt(p.endpoint,m(g)),T=Math.round(performance.now()-k),b=(P==null?void 0:P.message)||"",N=(P==null?void 0:P.success)===!0||b.includes("已存在")||b.includes("已加入")||b.includes("已提交"),C=[...c];C[g]={...p,status:N?"success":"error",message:b||(N?"正常":"异常"),responseTime:T},u(C)}catch(P){const T=Math.round(performance.now()-k),b=[...c];b[g]={...p,status:"error",message:P instanceof Error?P.message:"失败",responseTime:T},u(b)}},y=async()=>{if(!r.trim()&&!l.trim()){alert("请填写测试手机号");return}for(let g=0;ga(g.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:l,onChange:g=>o(g.target.value)})]})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-2",children:c.map((g,p)=>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:[g.status==="idle"&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-600 shrink-0"}),g.status==="testing"&&e.jsx(Be,{className:"w-3 h-3 text-yellow-400 animate-spin shrink-0"}),g.status==="success"&&e.jsx(Gd,{className:"w-3 h-3 text-green-400 shrink-0"}),g.status==="error"&&e.jsx(Kx,{className:"w-3 h-3 text-red-400 shrink-0"}),e.jsx("span",{className:"text-white text-xs truncate",children:g.label})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[g.responseTime!==void 0&&e.jsxs("span",{className:"text-gray-600 text-[10px]",children:[g.responseTime,"ms"]}),e.jsx("button",{type:"button",onClick:()=>f(p),disabled:g.status==="testing",className:"text-orange-400/60 hover:text-orange-400 text-[10px] disabled:opacity-50",children:"测试"})]})]},`${g.endpoint}-${p}`))}),e.jsxs("div",{className:"flex gap-3 mt-3 text-xs",children:[e.jsxs("a",{href:"https://ckbapi.quwanzhi.com/v1/api/scenarios",target:"_blank",rel:"noreferrer",className:"text-gray-500 hover:text-orange-400 flex items-center gap-1",children:[e.jsx(Yx,{className:"w-3 h-3"})," 场景获客API"]}),e.jsx("span",{className:"text-gray-700",children:"|"}),e.jsx("span",{className:"text-gray-600",children:"Key: fyngh-ec..."})]})]})})}const KC=[{id:"stats",label:"数据统计",icon:Yj},{id:"partner",label:"找伙伴",icon:Kt},{id:"resource",label:"资源对接",icon:kb},{id:"mentor",label:"导师预约",icon:wb},{id:"team",label:"团队招募",icon:Xd},{id:"ckb",label:"存客宝",icon:Pr}];function GC(){const[r,a]=h.useState("stats");return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Kt,{className:"w-6 h-6 text-[#38bdac]"}),"找伙伴"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"数据统计、匹配池与记录、资源对接、导师预约、团队招募、存客宝"})]}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:KC.map(l=>{const o=r===l.id,c=l.id==="ckb";return e.jsxs("button",{type:"button",onClick:()=>a(l.id),className:`flex items-center gap-2 px-5 py-2.5 rounded-md text-sm font-medium transition-all ${o?c?"bg-orange-500 text-white shadow-lg":"bg-[#38bdac] text-white shadow-lg":c?"text-orange-400/70 hover:text-orange-400 hover:bg-orange-500/10":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:[e.jsx(l.icon,{className:"w-4 h-4"}),l.label]},l.id)})}),r==="stats"&&e.jsx(VC,{onSwitchTab:l=>a(l)}),r==="partner"&&e.jsx(OC,{}),r==="resource"&&e.jsx(FC,{}),r==="mentor"&&e.jsx(BC,{}),r==="team"&&e.jsx(UC,{}),r==="ckb"&&e.jsx(HC,{})]})}function YC(){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 QC(){const r=pn();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(eb,{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(Kd,{to:"/",children:[e.jsx(Pb,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function qC(){return e.jsxs(Cj,{children:[e.jsx(yt,{path:"/login",element:e.jsx(Cw,{})}),e.jsxs(yt,{path:"/",element:e.jsx(PN,{}),children:[e.jsx(yt,{index:!0,element:e.jsx(Sd,{to:"/dashboard",replace:!0})}),e.jsx(yt,{path:"dashboard",element:e.jsx(Ew,{})}),e.jsx(yt,{path:"orders",element:e.jsx(h2,{})}),e.jsx(yt,{path:"users",element:e.jsx(F2,{})}),e.jsx(yt,{path:"distribution",element:e.jsx(l4,{})}),e.jsx(yt,{path:"withdrawals",element:e.jsx(i4,{})}),e.jsx(yt,{path:"content",element:e.jsx(fC,{})}),e.jsx(yt,{path:"referral-settings",element:e.jsx(A0,{})}),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(_C,{})}),e.jsx(yt,{path:"mentors",element:e.jsx(Mg,{})}),e.jsx(yt,{path:"mentor-consultations",element:e.jsx(MC,{})}),e.jsx(yt,{path:"settings",element:e.jsx(NC,{})}),e.jsx(yt,{path:"payment",element:e.jsx(wC,{})}),e.jsx(yt,{path:"site",element:e.jsx(EC,{})}),e.jsx(yt,{path:"qrcodes",element:e.jsx(PC,{})}),e.jsx(yt,{path:"find-partner",element:e.jsx(GC,{})}),e.jsx(yt,{path:"match",element:e.jsx(RC,{})}),e.jsx(yt,{path:"match-records",element:e.jsx(IC,{})}),e.jsx(yt,{path:"api-doc",element:e.jsx(YC,{})})]}),e.jsx(yt,{path:"*",element:e.jsx(QC,{})})]})}Tv.createRoot(document.getElementById("root")).render(e.jsx(h.StrictMode,{children:e.jsx(Mj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(qC,{})})})); diff --git a/soul-admin/dist/index.html b/soul-admin/dist/index.html index f98400cd..de821650 100644 --- a/soul-admin/dist/index.html +++ b/soul-admin/dist/index.html @@ -4,8 +4,8 @@ 管理后台 - Soul创业派对 - - + +
diff --git a/开发文档/1、需求/修改/20260308找伙伴9md copy b/开发文档/1、需求/修改/20260308找伙伴9md copy new file mode 100644 index 00000000..befef6b2 --- /dev/null +++ b/开发文档/1、需求/修改/20260308找伙伴9md copy @@ -0,0 +1,25 @@ + + +收复所有的错误,深度的理解,修复所有的错误,确保没有错误的运行 + + + +功能六 +![](images/2026-03-08-16-36-11.png)那个首页的找伙伴里面的创业合伙人这个功能显示的是找伙伴的这个功能,并且这些在这个标签的名字在后台都是可以设置的,设置他们名称这个是叫找伙伴的功能,图标跟名字都可以在后台配置。把这个名字帮我改一下,并且这个选项跟后台的找伙伴的功能的选项是一定要是相呼应的,点击就要确定好,你深度的帮我理解和检查清楚这个,帮我解决这些所有的问题 + +功能五 +![](images/2026-03-08-16-34-58.png)的这几个选项都要可以添加的乘客宝的一个获客数据,就是不要写乘客宝,就是一个那个 AI 获客数据,那第一个的话是那个 AI 那个7KB 去掉就是已提交线索,就是三个,第二个有联系方式的就是三个。第一个的话是 AI 添加的程度,那点击进去的话就是看到 AI 添加的一个成功率以及回复率的这一些功能。然后把这个联系方式比例去掉,API 连接的这一个说明文档得可以点开,并且可以编辑这个 API 连接的这个文档。 + +功能四 +![](images/2026-03-08-16-33-49.png)把这个匹配收收益,匹配收益这个也帮我把这个同时也在首页的数据概览上里面显示。 + +功能三 +这个后台各个的匹配记录帮我测试清楚,并且看一下后台真正的匹配的这些匹配记录,刚刚有匹配的记录之后,帮我加到这个匹配记录团队,招募也好,导师预约也好,资源对接也好,匹配记录务必不要显示的人人零条,务必要有相应的那个数据显示出来。也帮我测试一下那个,帮我加几个电话号码进去。 + +功能二 存客宝 +image.png![](images/2026-03-08-16-32-02.png)所有的那个相应的接口跟功能跟场景获客的一个成功率的所有的东西不单单是测试,然后它也是一个独立的页面,不用,不是展开页。宝的描述跟需求,帮我把这个页面完善一下。阅读关于淳刻薄的所有描述跟需求,我们对话当中 + + +功能一 +![](images/2026-03-08-16-30-11.png) +![](images/2026-03-08-16-31-01.png)小伙伴的这个页面的话,匹配记录加载失败,加载有问题,帮我处理一下这个加载失败的这一个问题。那个皮,那个匹配词设置的话,那个匹配词的选择,这个完善资料的用户点击进去只有3个人的,实际只有3个人,但点击进去有很多他是全部用户的一个列表,这个帮我解读一下。 \ No newline at end of file