PageSourceSearch

https://paper2gal.com/assets/CommunityPage-B9QgmaFk.js

js paper2gal.com collected 2026-10-09 22:39:42 UTC 27,787 bytes, 3 lines download raw bytes

1import{r as d,j as e}from"./react-vendor-CHQL15iE.js";import{u as fe,g as ge,l as je,T as ve,E as we,j as Ne,F as ye}from"./main-Dck1T9BT.js";import{C as ke}from"./CharacterCard-CKFcZsFo.js";import{L as Se,r as K,a as Z}from"./gameCharacterLayout-CKtvG8H9.js";import{g as Ce}from"./publicIdentity-C99q7MBr.js";import{ae as Q,P as ee,d as $e,S as I,c as te,R as Ie,aJ as Te,X as se,J as Ae,aK as Ee,aL as Re,o as Me}from"./lucide-BFLOpGdB.js";import"./pdfjs-ji3DqnKJ.js";import"./markdown-W-rE_H7s.js";import"./katex-math-BxKHCrdI.js";const D=20,ae=j=>ye.map(({urlField:n,label:u})=>({key:n,label:u,imageUrl:j[n]})).filter(n=>typeof n.imageUrl=="string"&&n.imageUrl.trim());function Oe(j,n){if(n<=1)return[1];if(n<=7)return Array.from({length:n},(h,s)=>s+1);const u=Math.max(2,j-1),k=Math.min(n-1,j+1),g=[1];u>2&&g.push("ellipsis");for(let h=u;h<=k;h+=1)g.push(h);return k<n-1&&g.push("ellipsis"),g.push(n),g}const Je=({onClose:j,user:n,customCharacters:u,onBorrowSuccess:k,language:g,onLogout:h})=>{const s=ve[g],a=fe(),[c,F]=d.useState("EXPLORE"),[T,A]=d.useState([]),[S,_]=d.useState(!0),[b,E]=d.useState(1),[v,re]=d.useState(0),[R,le]=d.useState(""),[M,oe]=d.useState("ALL"),[O,ie]=d.useState("recommended"),[w,ne]=d.useState(!1),[de,C]=d.useState(!1),[P,V]=d.useState(""),[f,$]=d.useState({type:"OC",description:""}),[J,Y]=d.useState(!1),[ce,z]=d.useState(!1),[r,xe]=d.useState(null),{showAlert:x,showConfirm:X}=ge(),me=a?{paddingTop:"max(0px, env(safe-area-inset-top))",paddingRight:"max(0px, env(safe-area-inset-right))",paddingBottom:"max(0px, env(safe-area-inset-bottom))",paddingLeft:"max(0px, env(safe-area-inset-left))"}:void 0,q=a?{paddingTop:"max(0.5rem, env(safe-area-inset-top))",paddingRight:"max(0.5rem, env(safe-area-inset-right))",paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))",paddingLeft:"max(0.5rem, env(safe-area-inset-left))"}:void 0;d.useEffect(()=>{const t=setTimeout(()=>{E(1),N(1,!1)},300);return()=>clearTimeout(t)},[c,M,R,O,w]);const N=async(t,l)=>{_(!0);try{const o=localStorage.getItem("p2g_token"),i=c==="MY_SUBMISSIONS"?"/api/community/mine":"/api/community/list",m=c==="MY_SUBMISSIONS"?i:`${i}?page=${t}&pageSize=20&q=${encodeURIComponent(R)}&type=${M}&sort=${O}&hasVoice=${w?"1":"0"}`,p={};o&&(p.Authorization=`Bearer ${o}`);const B=await je(m,{headers:p});if(B.status===401){h();return}if(B.ok){const U=await B.json();c==="MY_SUBMISSIONS"?A(U):(l||A(U.characters),re(U.total||0))}}catch(o){console.error("Failed to fetch community chars",o)}finally{_(!1)}},y=Math.max(1,Math.ceil(v/D)),pe=d.useMemo(()=>c==="EXPLORE"&&v>0?Oe(b,y):[],[c,v,b,y]),L=t=>{if(c!=="EXPLORE")return;const l=Math.max(1,Math.ceil(v/D));t<1||t>l||(E(t),N(t,!1),window.scrollTo({top:0,behavior:"smooth"}))},ue=async()=>{if(!P||!f.description){x(s.fillAllFields||"Please select a character and fill description.",{variant:"warning"});return}const t=u.find(l=>l.id===P);if(!t||!t.dbId){x(s.onlyCloudSyncedCharacters,{variant:"error"});return}Y(!0);try{const l=localStorage.getItem("p2g_token"),o=await fetch("/api/community/submit",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l}`},body:JSON.stringify({characterDbId:t.dbId,type:f.type,description:f.description,layout:K(Z(t.id),t.layout)})});if(o.ok)x(s.submissionSuccess,{variant:"success"}),C(!1),$({type:"OC",description:""}),V(""),c==="MY_SUBMISSIONS"&&N(1,!1);else{const i=await o.json();if(o.status===401){h();return}throw new Error(s.submissionFailed||i.error)}}catch(l){x(l.message,{variant:"error"})}finally{Y(!1)}},G=async t=>{if(!n){x(s.loginRequired,{variant:"info"});return}try{const l=localStorage.getItem("p2g_token"),o=await fetch(`/api/community/borrow/${t}`,{method:"POST",headers:{Authorization:`Bearer ${l}`}});if(o.ok){const i=await o.json();k(i),A(m=>m.map(p=>p.id===t?{...p,borrowCount:(p.borrowCount||0)+1}:p)),x(s.borrowSuccess||"Character borrowed successfully!",{variant:"success"})}else{if(o.status===401){h();return}const i=await o.json();throw new Error(i.error||s.submissionFailed)}}catch(l){x(l.message,{variant:"error"})}},he=async t=>{if(await X(s.deleteSubmissionConfirm||"Are you sure to recall this submission?"))try{const o=localStorage.getItem("p2g_token"),i=await fetch("/api/community/recall",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify({id:t})});if(i.ok)x(s.recallSuccess||"Recall successful!",{variant:"success"}),E(1),N(1,!1);else{if(i.status===401){h();return}const m=await i.json();throw new Error(m.error||"Recall failed")}}catch(o){x(o.message,{variant:"error"})}},be=async t=>{if(await X(s.updateSubmissionConfirm||"Submit updated version to workshop? It will need re-approval before going live."))try{const o=localStorage.getItem("p2g_token"),i=u.find(p=>p.dbId===t),m=await fetch("/api/community/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify({characterDbId:t,layout:K(Z((i==null?void 0:i.id)||t),i==null?void 0:i.layout)})});if(m.ok)x(s.updateSubmissionSuccess||"Update submitted! Waiting for review.",{variant:"success"}),N(1,!1);else{if(m.status===401){h();return}const p=await m.json();throw new Error(p.error||"Update failed")}}catch(o){x(o.message,{variant:"error"})}},H=d.useMemo(()=>w?T.filter(t=>!!t.hasVoice):T,[T,w]),W=t=>{const l=["from-pink-100","from-blue-100","from-purple-100","from-green-100","from-amber-100"];let o=0;for(let i=0;i<t.length;i++)o=t.charCodeAt(i)+((o<<5)-o);return l[Math.abs(o)%l.length]};return e.jsxs("div",{className:"absolute inset-0 bg-slate-50 flex flex-col z-[70] overflow-hidden overscroll-y-contain box-border",style:me,children:[e.jsxs("div",{className:"bg-white sticky top-0 z-[80] shadow-sm border-b px-4 md:px-6 py-3 md:py-4 flex items-center justify-between shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:j,className:"p-2 hover:bg-slate-100 rounded-full transition-colors",children:e.jsx(Q,{className:"text-slate-600"})}),e.jsx("h1",{className:"text-xl font-bold text-slate-800",children:s.communityPageTitle})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex bg-slate-100 rounded-lg p-1",children:[e.jsx("button",{onClick:()=>F("EXPLORE"),className:`px-4 py-1.5 rounded-md text-sm font-medium transition-all ${c==="EXPLORE"?"bg-white shadow-sm text-pink-600":"text-slate-500 hover:text-slate-700"}`,children:s.exploreTab}),n&&e.jsx("button",{onClick:()=>F("MY_SUBMISSIONS"),className:`px-4 py-1.5 rounded-md text-sm font-medium transition-all ${c==="MY_SUBMISSIONS"?"bg-white shadow-sm text-pink-600":"text-slate-500 hover:text-slate-700"}`,children:s.mySubmissionsTab})]}),n&&e.jsxs("button",{onClick:()=>C(!0),className:"bg-pink-500 hover:bg-pink-600 text-white px-4 py-2 rounded-lg flex items-center gap-2 font-medium shadow-sm transition-colors",children:[e.jsx(ee,{size:18}),s.uploadToCommunity]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4 md:p-8 custom-scrollbar overscroll-y-contain",style:{WebkitOverflowScrolling:"touch",touchAction:"auto"},children:e.jsxs("div",{className:"max-w-7xl mx-auto w-full",children:[e.jsxs("div",{className:"flex flex-col md:flex-row gap-4 justify-between items-center mb-6",children:[e.jsxs("div",{className:"relative w-full md:w-96",children:[e.jsx($e,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:18}),e.jsx("input",{type:"text",placeholder:s.searchPlaceholder,className:"w-full pl-10 pr-4 py-2 rounded-xl border-slate-200 focus:ring-2 focus:ring-pink-200 focus:border-pink-300 transition-all outline-none text-sm",value:R,onChange:t=>le(t.target.value)})]}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-3 md:gap-4 items-center",children:[e.jsxs("div",{className:"flex gap-2",children:[["ALL","OC","FANART"].map(t=>e.jsx("button",{onClick:()=>oe(t),className:`px-3 py-1.5 rounded-full text-[11px] md:text-xs font-bold border transition-all ${M===t?"bg-slate-800 text-white border-slate-800":"bg-white text-slate-500 border-slate-200 hover:border-slate-300"}`,children:t==="ALL"?s.allTypes:t==="OC"?s.originalChar:s.fanartChar},t)),e.jsx("button",{onClick:()=>ne(t=>!t),className:`px-3 py-1.5 rounded-full text-[11px] md:text-xs font-bold border transition-all ${w?"bg-violet-600 text-white border-violet-600":"bg-white text-slate-500 border-slate-200 hover:border-slate-300"}`,children:s.voiceOnlyFilter||s.charVoiceBadge||"Voice"})]}),e.jsx("div",{className:"h-4 w-px bg-slate-200 hidden md:block"}),e.jsxs("div",{className:"relative w-full md:w-auto",children:[e.jsxs("select",{value:O,onChange:t=>ie(t.target.value),className:"w-full appearance-none bg-slate-100 text-slate-600 text-[11px] md:text-xs font-bold py-2 pl-3 pr-8 rounded-lg border-none outline-none focus:ring-2 focus:ring-pink-200 cursor-pointer hover:bg-slate-200 transition-colors",children:[e.jsx("option",{value:"recommended",children:s.sortRecommended||"Recommended"}),e.jsx("option",{value:"hot",children:s.sortHot||"Popular"}),e.jsx("option",{value:"new",children:s.sortNew||"Newest"})]}),e.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-slate-500",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]})]}),e.jsxs("div",{className:"mb-8 bg-amber-50 border-2 border-amber-100 rounded-2xl p-4 md:p-6 shadow-sm flex flex-col md:flex-row items-center gap-4 md:gap-6 group animate-in slide-in-from-top-4 duration-500",children:[e.jsx("div",{className:"w-12 h-12 bg-white rounded-xl shadow-sm flex items-center justify-center text-amber-500 shrink-0 transform group-hover:rotate-6 transition-transform",children:e.jsx(I,{size:a?20:28})}),e.jsxs("div",{className:"flex-1 text-center md:text-left",children:[e.jsx("h3",{className:"text-sm md:text-base font-black text-amber-800 mb-1",children:s.workshopDisclaimerTitle}),e.jsx("p",{className:"text-[11px] md:text-xs text-amber-700 font-medium leading-relaxed opacity-80",children:s.workshopDisclaimerText.split(`
2`)[0]})]})]}),S?e.jsxs("div",{role:"status","aria-label":s.loadingCommunity,children:[e.jsx("p",{className:"sr-only",children:s.loadingCommunity}),e.jsx("div",{"aria-hidden":"true",className:a?"grid grid-cols-5 ga
2p-1":"grid grid-cols-4 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-5 xl:grid-cols-5 gap-1.5 md:gap-6",children:Array.from({length:D},(t,l)=>e.jsxs("div",{"data-community-skeleton":!0,className:`relative aspect-[3/4] overflow-hidden border border-pink-100 bg-white shadow-sm animate-pulse motion-reduce:animate-none ${a?"rounded-xl":"rounded-2xl"}`,children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-slate-200 via-slate-100 to-pink-50"}),e.jsxs("div",{className:`absolute inset-x-0 bottom-0 bg-white ${a?"p-1.5 space-y-1.5":"p-3 md:p-4 space-y-3"}`,children:[e.jsx("div",{className:"h-2 md:h-4 w-3/5 rounded-full bg-slate-200"}),e.jsxs("div",{className:"flex items-center justify-between gap-1",children:[e.jsx("div",{className:"h-1.5 md:h-2.5 w-2/5 rounded-full bg-slate-100"}),e.jsx("div",{className:"h-3 md:h-7 w-1/3 rounded-lg bg-pink-50"})]})]})]},l))})]}):H.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-slate-400 bg-white rounded-2xl border border-dashed border-slate-200",children:[e.jsx(te,{className:"mb-2 opacity-50",size:32}),e.jsx("p",{children:s.noCharactersFound})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a?"grid grid-cols-5 gap-1":"grid grid-cols-4 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-5 xl:grid-cols-5 gap-1.5 md:gap-6",children:H.map(t=>{const l=n&&t.uploaderId===n.id,o=u.some(m=>m.dbId===t.id),i=o&&!l;return e.jsxs("div",{className:`flex flex-col h-full bg-white overflow-hidden border border-slate-100 shadow-sm hover:shadow-md transition-shadow ${a?"rounded-xl":"rounded-2xl"}`,children:[e.jsx("div",{className:"aspect-[3/4] w-full relative shrink-0",children:e.jsx(ke,{id:t.characterId,name:t.name,imgSrc:t.avatarUrl,colorClass:W(t.characterId),isCustom:!0,isSelected:!1,onSelect:()=>{xe(t),z(!0)},isShared:!0,isBorrowed:i,borrowCount:t.borrowCount,hasVoice:t.hasVoice,t:s,communityType:t.type,uploaderName:t.uploaderName||t.uploaderId.substring(0,8),uploaderMembershipActive:t.uploaderMembershipActive,uploaderUnlimitedMembership:t.uploaderUnlimitedMembership,uploaderPublicBadgeId:t.uploaderPublicBadgeId,onBorrow:!o&&!l?()=>G(t.id):void 0,hasFullExpressions:t.hasFullExpressions,compactCommunityMeta:a})}),c==="MY_SUBMISSIONS"&&e.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1 md:gap-1.5 p-1.5 md:p-3 min-h-[100px] md:min-h-[140px] max-h-[160px] bg-slate-50/50",children:[e.jsx("span",{className:`px-2 py-0.5 rounded-full text-[9px] md:text-[11px] font-black uppercase tracking-wider shrink-0 ${t.status==="APPROVED"?"bg-green-100 text-green-600":t.status==="REJECTED"?"bg-red-100 text-red-600":"bg-yellow-100 text-yellow-600"}`,children:t.status==="APPROVED"?s.submissionApproved:t.status==="REJECTED"?s.submissionRejected:s.submissionPending}),t.status==="APPROVED"&&t.hasUnsyncedChanges&&e.jsxs("button",{onClick:()=>be(t.id),className:"flex items-center gap-1 px-2.5 py-1 rounded-full text-[11px] font-bold bg-blue-50 text-blue-600 hover:bg-blue-100 border border-blue-100 transition-colors shrink-0",children:[e.jsx(Ie,{size:10}),s.submitUpdate||"Submit Update"]}),e.jsx("button",{onClick:()=>he(t.id),className:"text-[11px] text-slate-400 hover:text-red-500 font-bold underline transition-colors shrink-0",children:s.deleteSubmission}),t.status==="REJECTED"&&t.rejectionReason&&e.jsxs("div",{className:"mt-1 w-full flex-1 overflow-y-auto custom-scrollbar bg-white/80 border border-red-50 p-2 rounded-xl",children:[e.jsxs("p",{className:"text-[10px] font-black text-red-400 uppercase tracking-tighter mb-1 flex items-center gap-1",children:[e.jsx(I,{size:10}),s.adminReviewNote]}),e.jsx("p",{className:"text-[11px] text-red-600 leading-snug break-words font-medium",children:t.rejectionReason})]})]})]},t.id)})}),c==="EXPLORE"&&v>0&&y>1&&e.jsxs("div",{className:"mt-8 md:mt-12 flex flex-col items-center gap-3 md:gap-4 pb-8 px-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-1.5 md:gap-2 max-w-full",children:[e.jsxs("button",{type:"button",onClick:()=>L(b-1),disabled:b===1||S,className:"p-2 md:p-2.5 bg-white border-2 border-slate-100 rounded-xl text-slate-400 hover:text-pink-500 hover:border-pink-100 disabled:opacity-30 disabled:hover:text-slate-400 disabled:hover:border-slate-100 transition-all flex items-center gap-1 shadow-sm shrink-0","aria-label":s.prevPage,children:[e.jsx(Q,{size:a?16:18}),e.jsx("span",{className:"hidden sm:inline text-xs font-black uppercase tracking-widest",children:s.prevPage})]}),pe.map((t,l)=>t==="ellipsis"?e.jsx("span",{className:"px-1 md:px-2 text-slate-300 font-bold select-none","aria-hidden":!0,
2children:"…"},`e-${l}`):e.jsx("button",{type:"button",onClick:()=>L(t),disabled:S||t===b,className:`min-w-[2.25rem] md:min-w-[2.5rem] h-9 md:h-10 px-2 rounded-xl text-sm font-black border-2 transition-all shrink-0 ${t===b?"bg-pink-500 text-white border-pink-500 shadow-md cursor-default":"bg-white text-slate-600 border-slate-100 hover:border-pink-200 hover:text-pink-600 disabled:opacity-50"}`,children:t},t)),e.jsxs("button",{type:"button",onClick:()=>L(b+1),disabled:b>=y||S,className:"p-2 md:p-2.5 bg-white border-2 border-slate-100 rounded-xl text-slate-400 hover:text-pink-500 hover:border-pink-100 disabled:opacity-30 disabled:hover:text-slate-400 disabled:hover:border-slate-100 transition-all flex items-center gap-1 shadow-sm shrink-0","aria-label":s.nextPage,children:[e.jsx("span",{className:"hidden sm:inline text-xs font-black uppercase tracking-widest",children:s.nextPage}),e.jsx(Te,{size:a?16:18})]})]}),e.jsxs("p",{className:"text-[10px] md:text-xs font-bold text-slate-400 tabular-nums",children:[s.page," ",b," / ",y,e.jsx("span",{className:"text-slate-300 mx-1",children:"·"}),v]})]})]}),e.jsxs("div",{className:"mt-8 md:mt-10 rounded-2xl border border-red-100 bg-red-50/70 p-4 md:p-5 text-center",children:[e.jsx("p",{className:"text-xs md:text-sm font-bold text-red-700",children:s.workshopTakedownContactTitle||"角色删除/侵权下架联系"}),e.jsxs("p",{className:"mt-1 text-[11px] md:text-xs text-red-600 font-medium",children:[s.workshopTakedownContactDesc||"若您认为创意工坊中的角色内容涉及侵权或需删除,请联系:",e.jsx("a",{href:"mailto:[email protected]",className:"ml-1 underline font-bold text-red-700 hover:text-red-800",children:"[email protected]"})]})]})]})}),de&&e.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/50 backdrop-blur-sm p-1.5 md:p-4",style:q,children:e.jsxs("div",{className:`bg-white shadow-xl mx-auto overflow-hidden animate-in fade-in zoom-in-95 duration-200 flex flex-col ${a?"mobile-landscape-modal min-h-0 rounded-[18px] border-[2px]":"w-full max-w-lg rounded-2xl"}`,children:[e.jsxs("div",{className:"p-4 border-b flex justify-between items-center bg-slate-50 shrink-0",children:[e.jsx("h2",{className:"font-bold text-lg text-slate-800",children:s.uploadTitle}),e.jsxs("button",{onClick:()=>C(!1),className:"p-2 hover:bg-slate-100 rounded-full transition-colors text-slate-400 hover:text-slate-600",children:[e.jsx("span",{className:"sr-only",children:s.cancel}),e.jsx(se,{size:20})]})]}),e.jsxs("div",{className:`space-y-4 overflow-y-auto custom-scrollbar ${a?"p-4 flex-1":"p-6"}`,children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:s.selectCharacter}),e.jsxs("select",{className:"w-full p-2 border rounded-lg bg-slate-50",value:P,onChange:t=>V(t.target.value),children:[e.jsx("option",{value:"",children:s.chooseFromYourCharacters}),u.filter(t=>t.dbId&&!t.isBorrowed).map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:s.onlyCloudSyncedCharacters})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:s.charType}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"radio",name:"ctype",checked:f.type==="OC",onChange:()=>$({...f,type:"OC"}),className:"text-pink-500 focus:ring-pink-500"}),e.jsx("span",{children:s.originalChar})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"radio",name:"ctype",checked:f.type==="FANART",onChange:()=>$({...f,type:"FANART"}),className:"text-pink-500 focus:ring-pink-500"}),e.jsx("span",{children:s.fanartChar})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:s.charDesc}),e.jsx("textarea",{className:"w-full p-3 border rounded-lg h-32 resize-none focus:ring-2 focus:ring-pink-200 outline-none",placeholder:s.charDescPlaceholder,value:f.description,onChange:t=>$({...f,description:t.target.value})})]}),e.jsxs("div",{className:"bg-amber-50 p-4 rounded-xl flex flex-col gap-2 text-[10px] md:text-xs text-amber-800 border border-amber-100 shadow-inner",children:[e.jsxs("div",{className:"flex items-center gap-2 font-black uppercase tracking-wider text-amber-600",children:[e.jsx(I,{size:14}),s.workshopDisclaimerTitle]}),e.jsx("div",{className:"space-y-1.5 opacity-90 leading-relaxed max-h-32 overflow-y-auto pr-2 custom-scrollbar",children:s.workshopDisclaimerText.split(`
3`).map((t,l)=>e.jsx("p",{children:t},l))})]})]}),e.jsxs("div",{className:`border-t bg-slate-50 flex gap-3 ${a?"p-3":"p-4 justify-end"}`,children:[e.jsx("button",{onClick:()=>C(!1),className:`px-4 py-2 text-slate-600 hover:bg-slate-200 rounded-lg transition-colors ${a?"flex-1 text-center":""}`,children:s.cancel}),e.jsxs("button",{onClick:ue,disabled:J,className:`px-6 py-2 bg-pink-500 text-white rounded-lg hover:bg-pink-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2 ${a?"flex-1 justify-center":""}`,children:[J&&e.jsx(Ae,{className:"animate-spin",size:16}),s.submit]})]})]})}),ce&&r&&e.jsx("div",{className:`fixed inset-0 z-[100] flex items-center justify-center bg-black/50 backdrop-blur-sm animate-fade-in ${a?"p-1.5":"p-4"}`,style:q,children:e.jsxs("div",{className:`bg-white shadow-xl w-full mx-auto overflow-hidden flex flex-col ${a?"h-full max-h-full min-h-0 w-full rounded-[18px] border-[2px]":"max-w-5xl rounded-2xl max-h-[90vh]"}`,children:[e.jsxs("div",{className:`${a?"p-3":"p-4"} border-b flex justify-between items-center bg-slate-50 shrink-0`,children:[e.jsxs("h2",{className:`${a?"text-sm":"text-xl"} font-bold flex items-center gap-2 min-w-0`,children:[e.jsx("span",{className:`${a?"px-1.5 py-0.5 text-[10px]":"px-2 py-0.5 text-[10px]"} rounded uppercase font-black tracking-wider text-white ${r.type==="OC"?"bg-amber-500":"bg-rose-500"}`,children:r.type==="FANART"?s.fanartBadge||s.fanartChar||"Fanart":s.originalBadge||"OC"}),e.jsx("span",{className:"truncate",children:r.name})]}),e.jsx("button",{onClick:()=>z(!1),className:`${a?"p-1.5":"p-2"} hover:bg-slate-200 rounded-full transition-colors text-slate-500`,children:e.jsx(se,{size:a?18:20})})]}),e.jsx("div",{className:`flex-1 overflow-y-auto custom-scrollbar ${a?"p-3":"p-6"}`,children:e.jsxs("div",{className:`flex ${a?"flex-col gap-3":"flex-col md:flex-row gap-6"}`,children:[e.jsxs("div",{className:`w-full md:w-1/3 ${a?"flex items-start gap-3":"flex flex-col gap-4"}`,children:[e.jsx("div",{className:`aspect-[3/4] rounded-xl overflow-hidden border-2 border-slate-100 shadow-sm bg-gradient-to-t ${W(r.characterId)} relative ${a?"w-[96px] shrink-0 rounded-lg":""}`,children:r.renderMode==="live2d"&&r.live2d?e.jsx(Se,{emotion:we.NEUTRAL,config:Ne({...r,dbId:r.id})}):e.jsx("img",{src:r.avatarUrl,alt:r.name,className:"w-full h-full object-contain"})}),e.jsxs("div",{className:`${a?"flex-1 space-y-2":"space-y-4"}`,children:[r.hasFullExpressions&&e.jsxs("div",{className:`${a?"px-2 py-1 text-[11px]":"px-3 py-2 text-xs"} bg-green-50 text-green-700 rounded-lg font-bold text-center border border-green-100 flex items-center justify-center gap-1`,children:[e.jsx(te,{size:a?10:12}),s.fullExpr]}),e.jsxs("div",{className:`bg-slate-50 rounded-lg border border-slate-100 ${a?"p-2.5":"p-3"}`,children:[e.jsx("div",{className:"flex justify-between items-center mb-2",children:e.jsx("span",{className:`${a?"text-[11px]":"text-xs"} text-slate-400 font-bold uppercase`,children:s.stats})}),e.jsxs("div",{className:`grid grid-cols-2 ${a?"gap-1.5":"gap-2"}`,children:[e.jsxs("div",{className:`text-center bg-white rounded border border-slate-100 ${a?"p-1.5":"p-2"}`,children:[e.jsx("div",{className:`${a?"text-[11px]":"text-xs"} text-slate-400`,children:s.borrowed}),e.jsx("div",{className:`font-mono font-bold text-slate-700 ${a?"text-sm":""}`,children:r.borrowCount||0})]}),e.jsxs("div",{className:`text-center bg-white rounded border border-slate-100 ${a?"p-1.5":"p-2"}`,children:[e.jsx("div",{className:`${a?"text-[11px]":"text-xs"} text-slate-400`,children:s.uploader}),e.jsx("div",{className:"flex min-w-0 flex-col items-center gap-1",children:e.jsx("div",{className:`max-w-full truncate font-mono font-bold ${Ce(r.uploaderMembershipActive,"text-slate-700",r.uploaderPublicBadgeId,r.uploaderUnlimitedMembership)} ${a?"text-[11px]":"text-[10px]"}`,title:r.uploaderName,children:r.uploaderName||"Unknown"})})]})]})]})]})]}
3),e.jsxs("div",{className:`flex-1 ${a?"space-y-3":"space-y-4"}`,children:[ae(r).length>0&&e.jsx("div",{className:`grid ${a?"grid-cols-4 gap-1.5":"grid-cols-4 gap-3"}`,children:ae(r).map(({key:t,label:l,imageUrl:o})=>e.jsxs("div",{className:`border border-slate-100 bg-slate-50/70 overflow-hidden ${a?"rounded-lg":"rounded-xl"}`,children:[e.jsx("div",{className:`${a?"aspect-square":"aspect-[3/4]"} bg-white flex items-center justify-center`,children:e.jsx("img",{src:o,alt:`${r.name} ${l}`,className:"w-full h-full object-contain"})}),e.jsx("div",{className:`${a?"px-1 py-1 text-[9px]":"px-3 py-2 text-xs"} font-bold text-slate-600 text-center border-t border-slate-100 bg-white`,children:l})]},t))}),e.jsxs("div",{children:[e.jsxs("h3",{className:`${a?"text-xs":"text-sm"} font-bold text-slate-900 mb-1 flex items-center gap-2`,children:[e.jsx(Ee,{size:a?13:14,className:"text-blue-500"}),s.intro]}),e.jsxs("p",{className:`${a?"text-xs p-2.5 max-h-36 overflow-y-auto custom-scrollbar":"text-sm p-3 italic"} whitespace-pre-wrap break-words text-slate-600 bg-slate-50 rounded-lg border border-slate-100 leading-relaxed`,children:['"',r.description,'"']})]}),r.status==="REJECTED"&&r.rejectionReason&&e.jsxs("div",{className:`bg-red-50 border-2 border-red-100 rounded-xl shadow-sm animate-in zoom-in-95 ${a?"p-3":"p-4"}`,children:[e.jsxs("h3",{className:`${a?"text-xs":"text-sm"} font-bold text-red-600 mb-2 flex items-center gap-2`,children:[e.jsx(I,{size:a?14:16}),s.adminReviewNote]}),e.jsx("p",{className:`${a?"text-xs p-2.5":"text-sm p-3"} text-red-500 font-medium leading-relaxed bg-white/50 rounded-lg border border-red-50`,children:r.rejectionReason})]}),e.jsxs("div",{className:`bg-slate-50 border border-slate-100 rounded-xl ${a?"p-3":"p-4"}`,children:[e.jsxs("h3",{className:`${a?"text-xs":"text-sm"} font-bold text-slate-900 mb-3 flex items-center gap-2`,children:[e.jsx(Re,{size:a?13:14,className:"text-pink-500"}),s.cgPreview||"CG 预览"]}),Array.isArray(r.cgImages)&&r.cgImages.length>0?e.jsx("div",{className:`grid ${a?"grid-cols-2 gap-2":"grid-cols-3 gap-3"}`,children:r.cgImages.map((t,l)=>e.jsx("div",{className:"aspect-[4/3] rounded-lg overflow-hidden border border-slate-100 bg-white",children:e.jsx("img",{src:t,alt:`${r.name} CG ${l+1}`,className:"w-full h-full object-cover"})},`${t}-${l}`))}):e.jsx("div",{className:"rounded-lg border border-dashed border-slate-200 bg-white px-4 py-6 text-center text-slate-400 text-xs font-medium",children:s.noCgPreview||"暂无 CG 图"})]}),e.jsxs("div",{className:`bg-slate-50 border border-slate-100 rounded-xl ${a?"p-3":"p-4"}`,children:[e.jsxs("h3",{className:`${a?"text-xs":"text-sm"} font-bold text-slate-900 mb-3 flex items-center gap-2`,children:[e.jsx(Me,{size:a?13:14,className:"text-emerald-500"}),s.voicePreview||"语音试听"]}),r.voiceRefAudioUrl?e.jsxs("div",{className:"space-y-3",children:[r.voiceRefText&&e.jsx("p",{className:`${a?"text-xs p-2.5":"text-sm p-3"} text-slate-600 bg-white rounded-lg border border-slate-100 leading-relaxed`,children:r.voiceRefText}),e.jsx("audio",{controls:!0,preload:"none",src:r.voiceRefAudioUrl,className:"w-full"})]}):e.jsx("div",{className:"rounded-lg border border-dashed border-slate-200 bg-white px-4 py-6 text-center text-slate-400 text-xs font-medium",children:s.noVoicePreview||"暂无可试听语音"})]}),e.jsxs("div",{className:`${a?"pt-3 mt-3":"pt-4 mt-4"} border-t border-slate-100`,children:[!u.some(t=>t.dbId===r.id)&&(n==null?void 0:n.id)!==r.uploaderId?e.jsxs("button",{onClick:()=>{G(r.id),z(!1)},className:`w-full ${a?"py-2.5 text-sm":"py-3"} bg-slate-900 hover:bg-black text-white rounded-xl font-bold shadow-lg shadow-purple-200 transition-all flex items-center justify-center gap-2`,children:[e.jsx(ee,{size:a?16:18}),s.borrowAndAdd]}):e.jsx("button",{disabled:!0,className:`w-full ${a?"py-2.5 text-sm":"py-3"} bg-slate-100 text-slate-400 rounded-xl font-bold flex items-center justify-center gap-2 cursor-not-allowed`,children:(n==null?void 0:n.id)===r.uploaderId?s.owned:s.alreadyInLibrary}),e.jsx("p",{className:`text-center text-slate-400 mt-2 ${a?"text-[11px]":"text-xs"}`,children:s.addingCharacterHint})]})]})]})})]})})]})};export{Je as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.