exports.id=149,exports.ids=[149],exports.modules={7776:(e,t,r)=>{"use strict";r.d(t,{V:()=>u,p:()=>c});var a=r(997),i=r(6689),s=r(3756),n=r(7653),o=r(6989),d=r(1352);let l=(0,i.createContext)(void 0),c=()=>{let e=(0,i.useContext)(l);if(!e)throw Error("useToast must be used within ToastProvider");return e},u=({children:e})=>{let[t,r]=(0,i.useState)([]),c=(0,i.useCallback)((e,t)=>{let a=Math.random().toString(36).substring(7),i={id:a,message:e,type:t};r(e=>[...e,i]),setTimeout(()=>{r(e=>e.filter(e=>e.id!==a))},5e3)},[]),u=(0,i.useCallback)(e=>c(e,"success"),[c]),m=(0,i.useCallback)(e=>c(e,"error"),[c]),p=(0,i.useCallback)(e=>c(e,"info"),[c]),g=e=>{r(t=>t.filter(t=>t.id!==e))};return(0,a.jsxs)(l.Provider,{value:{showToast:c,success:u,error:m,info:p},children:[e,a.jsx("div",{className:"fixed top-4 right-4 z-[9999] space-y-2",children:t.map(e=>(0,a.jsxs)("div",{className:`
              flex items-center gap-3 min-w-[300px] max-w-md p-4 rounded-lg 
              backdrop-blur-md border shadow-lg
              animate-in slide-in-from-right duration-300
              ${"success"===e.type?"bg-green-900/90 border-green-500 text-green-100":""}
              ${"error"===e.type?"bg-red-900/90 border-red-500 text-red-100":""}
              ${"info"===e.type?"bg-blue-900/90 border-blue-500 text-blue-100":""}
            `,children:["success"===e.type&&a.jsx(s.Z,{className:"w-5 h-5 flex-shrink-0"}),"error"===e.type&&a.jsx(n.Z,{className:"w-5 h-5 flex-shrink-0"}),"info"===e.type&&a.jsx(o.Z,{className:"w-5 h-5 flex-shrink-0"}),a.jsx("p",{className:"flex-1 text-sm font-mono",children:e.message}),a.jsx("button",{onClick:()=>g(e.id),className:"flex-shrink-0 hover:opacity-70 transition-opacity",children:a.jsx(d.Z,{className:"w-4 h-4"})})]},e.id))})]})}},1484:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var a=r(997);r(6764);var i=r(968),s=r.n(i),n=r(7776);function o({Component:e,pageProps:t}){return(0,a.jsxs)(n.V,{children:[(0,a.jsxs)(s(),{children:[a.jsx("title",{children:"NEXUS_MAT.OS"}),a.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1"})]}),a.jsx(e,{...t})]})}},6100:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var a=r(997),i=r(6859),s=r.n(i);class n extends s(){render(){return(0,a.jsxs)(i.Html,{lang:"zh-CN",children:[a.jsx(i.Head,{}),(0,a.jsxs)("body",{children:[a.jsx(i.Main,{}),a.jsx(i.NextScript,{})]})]})}}},3982:(e,t,r)=>{"use strict";r.d(t,{D:()=>m,i:()=>n});var a=r(3789);let i="NEXUS_DATA_MODE",s=()=>localStorage.getItem(i)||"MOCK",n=e=>{localStorage.setItem(i,e),window.location.reload()},o={id:"u_001",username:"Neo_Architect",avatarUrl:"https://picsum.photos/seed/neo/200/200",role:a.i.CREATOR,status:"ACTIVE",createdAt:new Date(2023,10,15).toISOString(),lastLogin:new Date().toISOString()},d=[o,{id:"u_002",username:"Visual_Drift",avatarUrl:"https://picsum.photos/seed/drift/200/200",role:a.i.CREATOR,status:"ACTIVE",createdAt:new Date(2023,11,1).toISOString(),lastLogin:new Date().toISOString()},{id:"u_003",username:"Poly_Master",avatarUrl:"https://picsum.photos/seed/poly/200/200",role:a.i.USER,status:"FLAGGED",createdAt:new Date(2024,0,10).toISOString(),lastLogin:new Date().toISOString()},{id:"u_004",username:"Script_Kiddie",avatarUrl:"https://picsum.photos/seed/kiddie/200/200",role:a.i.USER,status:"BANNED",createdAt:new Date(2024,1,20).toISOString(),lastLogin:new Date(2024,2,1).toISOString()}],l=[{id:"m_001",title:"Cyberpunk HUD Interface React",description:"A complete React component set for building sci-fi interfaces. Includes glitch effects and holographic transitions.",type:a.x.CODE,codeSnippet:`const CyberButton = ({ children }) => (
  <button className="border border-neon-500 text-neon-500 hover:bg-neon-500 hover:text-black transition-all duration-300 uppercase tracking-widest px-6 py-2">
    {children}
  </button>
);`,language:"tsx",author:o,stats:{views:1204,downloads:450,favorites:89},tags:["react","ui","cyberpunk","animation"],createdAt:new Date(Date.now()-1728e5).toISOString(),comments:[]},{id:"m_002",title:"Neon City Ambience Loop",description:"4K loop of a futuristic city rain scene. Perfect for background assets.",type:a.x.VIDEO,contentUrl:"https://media.w3.org/2010/05/sintel/trailer.mp4",author:d[1],stats:{views:5320,downloads:1200,favorites:432},tags:["video","loop","background","4k"],createdAt:new Date(Date.now()-432e6).toISOString(),comments:[{id:"c_1",content:"The lighting on this is insane!",author:o,createdAt:new Date().toISOString()}]},{id:"m_003",title:"Industrial 3D Assets Pack",description:"Low-poly mechanical parts for game dev. GLB format + Textures.",type:a.x.ASSET_ZIP,contentUrl:"#",author:d[2],stats:{views:800,downloads:120,favorites:45},tags:["3d","blender","game-assets"],createdAt:new Date(Date.now()-864e5).toISOString(),comments:[]}];if(l.length<40){let e=l.length,t=[a.x.CODE,a.x.ASSET_ZIP,a.x.VIDEO];for(let r=e;r<40;r++){let e=`m_${(r+1).toString().padStart(3,"0")}`,i=d[r%d.length],s=t[r%t.length],n=new Date(Date.now()-r%10*864e5).toISOString(),o={views:Math.floor(1e3*Math.random()),downloads:Math.floor(200*Math.random()),favorites:Math.floor(50*Math.random())},c={id:e,title:s===a.x.CODE?`Test Code Snippet #${r+1}`:s===a.x.ASSET_ZIP?`Assets Pack #${r+1}`:`Demo Video #${r+1}`,description:"Auto-generated demo material.",type:s,author:i,stats:o,tags:s===a.x.CODE?["test","code"]:s===a.x.ASSET_ZIP?["assets"]:["video"],createdAt:n,comments:[]};s===a.x.CODE?l.push({...c,codeSnippet:`function test${r}(){return ${r};}`,language:"ts"}):s===a.x.ASSET_ZIP?l.push({...c,contentUrl:"#"}):l.push({...c,contentUrl:"https://media.w3.org/2010/05/sintel/trailer.mp4"})}}let c={dbHost:"127.0.0.1",dbPort:"3306",dbUser:"root",dbPass:"admin123",dbName:"nexus_db",maintenanceMode:!1,maxUploadMB:3};async function u(e,t){try{let r=await fetch(`/api/v1${e}`,{...t,headers:{"Content-Type":"application/json",...t?.headers}}),a=await r.json();if(!r.ok)throw Error(a.error||r.statusText||"Request failed");return a.data}catch(e){throw console.error("API Call Failed:",e),e}}let m={getMode:s,setApiMode:n,getCurrentUser:async()=>{if("REAL"===s())try{return await u("/auth/me")}catch(e){return console.log("User not authenticated"),null}return new Promise(e=>setTimeout(()=>e(o),500))},updateUserProfile:async(e,t)=>"REAL"===s()?u("/users/me",{method:"PATCH",body:JSON.stringify(t)}):new Promise(r=>{o.id===e&&(t.username&&(o.username=t.username),t.avatarUrl&&(o.avatarUrl=t.avatarUrl)),setTimeout(()=>r({...o}),800)}),getMaterials:async(e=1,t=20,r,a)=>{let i=new URLSearchParams({page:String(e),limit:String(t)});if(r&&"ALL"!==r&&i.append("type",String(r)),a&&a.trim()&&i.append("q",a.trim()),"REAL"===s())return u(`/materials?${i.toString()}`);let n=r&&"ALL"!==r?l.filter(e=>e.type===r):l;if(a&&a.trim()){let e=a.trim().toLowerCase();n=n.filter(t=>{let r=t.title.toLowerCase().includes(e),a=t.description.toLowerCase().includes(e),i=t.tags.some(t=>t.toLowerCase().includes(e));return r||a||i})}let o=(e-1)*t,d=n.slice(o,o+t),c=n.length,m=e*t<c;return new Promise(r=>setTimeout(()=>r({items:d,total:c,page:e,limit:t,hasNext:m}),400))},getUserMaterials:async(e=1,t=20)=>{if("REAL"===s())return u(`/users/me/materials?page=${e}&limit=${t}`);let r=l.filter(e=>e.author.id===o.id),a=(e-1)*t,i=r.slice(a,a+t),n=r.length,d=e*t<n;return new Promise(r=>setTimeout(()=>r({items:i,total:n,page:e,limit:t,hasNext:d}),300))},getUserFavorites:async(e=1,t=20)=>{if("REAL"===s())return u(`/users/me/favorites?page=${e}&limit=${t}`);let r=l.filter(e=>e.stats.favorites>0),a=(e-1)*t,i=r.slice(a,a+t),n=r.length,o=e*t<n;return new Promise(r=>setTimeout(()=>r({items:i,total:n,page:e,limit:t,hasNext:o}),300))},getMaterialById:async e=>"REAL"===s()?u(`/materials/${e}`):new Promise(t=>{let r=l.find(t=>t.id===e);setTimeout(()=>t(r),400)}),createMaterial:async e=>"REAL"===s()?u("/materials",{method:"POST",body:JSON.stringify(e)}):new Promise(t=>{let r={id:`m_${Date.now()}`,title:e.title||"Untitled",description:e.description||"",type:e.type||a.x.CODE,codeSnippet:e.codeSnippet,contentUrl:e.contentUrl,language:e.language||"text",author:o,stats:{views:0,downloads:0,favorites:0},tags:e.tags||[],createdAt:new Date().toISOString(),comments:[]};l.unshift(r),setTimeout(()=>t(r),1e3)}),deleteMaterial:async e=>{if("REAL"===s())return await u(`/materials/${e}`,{method:"DELETE"}),!0;let t=l.findIndex(t=>t.id===e);return t>-1&&(l.splice(t,1),!0)},addComment:async(e,t)=>{if("REAL"===s())return u(`/materials/${e}/comments`,{method:"POST",body:JSON.stringify({content:t})});let r=l.find(t=>t.id===e);if(!r)throw Error("Material not found");let a={id:`c_${Date.now()}`,content:t,author:o,createdAt:new Date().toISOString()};return r.comments.push(a),a},toggleFavorite:async e=>{if("REAL"===s())return(await u(`/materials/${e}/favorite`,{method:"POST"})).favorites;let t=l.find(t=>t.id===e);return t?(t.stats.favorites+=1,t.stats.favorites):0},uploadZip:async(e,t)=>{let r=new FormData;r.append("file",e),t?.title&&r.append("title",t.title),t?.description&&r.append("description",t.description),t?.tags&&r.append("tags",t.tags.join(","));let a=await fetch("/api/v1/materials/upload-zip",{method:"POST",body:r});if(!(a.headers.get("content-type")||"").includes("application/json"))throw Error(await a.text()||`Upload failed (${a.status})`);let i=await a.json();if(!a.ok||!i.success)throw Error(i.error||`Upload failed (${a.status})`);return i.data},uploadVideo:async(e,t)=>{let r=new FormData;r.append("file",e),t?.title&&r.append("title",t.title),t?.description&&r.append("description",t.description),t?.tags&&r.append("tags",t.tags.join(","));let a=await fetch("/api/v1/materials/upload-video",{method:"POST",body:r});if(!(a.headers.get("content-type")||"").includes("application/json"))throw Error(await a.text()||`Upload failed (${a.status})`);let i=await a.json();if(!a.ok||!i.success)throw Error(i.error||`Upload failed (${a.status})`);return i.data},verifyAdmin:async(e,t)=>new Promise(r=>{setTimeout(()=>{r("admin"===e&&"wx1998WX"===t)},1e3)}),getAllUsers:async()=>"REAL"===s()?u("/admin/users"):new Promise(e=>setTimeout(()=>e(d),600)),updateUserRole:async(e,t)=>{if("REAL"===s())return u(`/admin/users/${e}/role`,{method:"POST",body:JSON.stringify({role:t})});let r=d.find(t=>t.id===e);if(!r)throw Error("User not found");return r.role=t,new Promise(e=>setTimeout(()=>e({...r}),400))},getSystemConfig:async()=>"REAL"===s()?u("/admin/config"):c,updateSystemConfig:async e=>{if("REAL"===s()){await u("/admin/config",{method:"PUT",body:JSON.stringify({maxUploadMB:e.maxUploadMB})});return}return c=e,new Promise(e=>setTimeout(e,1500))},toggleUserStatus:async e=>{if("REAL"===s())return u(`/admin/users/${e}/toggle-status`,{method:"POST"});let t=d.find(t=>t.id===e);if(t)return t.status="ACTIVE"===t.status?"BANNED":"ACTIVE",t}}},3789:(e,t,r)=>{"use strict";var a,i;r.d(t,{i:()=>a,x:()=>i}),function(e){e.USER="USER",e.ADMIN="ADMIN",e.CREATOR="CREATOR",e.MANAGER="MANAGER"}(a||(a={})),function(e){e.CODE="CODE",e.ASSET_ZIP="ASSET_ZIP",e.VIDEO="VIDEO"}(i||(i={}))},6764:()=>{}};