PageSourceSearch

https://nyanza.ai/assets/MindBrain-CFlJqJeH.js

js nyanza.ai collected 2026-10-02 01:11:45 UTC 12,820 bytes, 28 lines download raw bytes

1import{r as m,j as s,e as ct}from"./react-TITiJaTY.js";import{C as lt,E as ut,B as ft,c as J,e as Q,f as q,S as pt,N as Y,A as Z,g as tt,u as dt,d as mt,M as ht}from"./three-tOwceFWS.js";import{bx as Mt,by as bt,r as it,al as xt,bz as gt}from"./App-Dli7sJFM.js";import{I as vt}from"./shared-lite-BOZiOCY1.js";import"./index-D0VpW5-F.js";import"./memory-BnxUEnat.js";import"./llm-CdWZ4qgd.js";import"./podcastDeviceState-B0NlAIS7.js";import"./motion-DheP8iPc.js";const H=ht.lerp,yt=()=>{var e;return typeof window<"u"&&!!((e=window.matchMedia)!=null&&e.call(window,"(prefers-reduced-motion: reduce)").matches)};function wt(){try{const e=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl")))}catch{return!1}}function jt(){const e=document.createElement("canvas");e.width=e.height=64;const u=e.getContext("2d"),o=u.createRadialGradient(32,32,0,32,32,32);o.addColorStop(0,"rgba(255,255,255,1)"),o.addColorStop(.25,"rgba(255,255,255,0.5)"),o.addColorStop(1,"rgba(255,255,255,0)"),u.fillStyle=o,u.fillRect(0,0,64,64);const a=new mt(e);return a.needsUpdate=!0,a}const at=2;function kt(e,u,o){let h=1+.11*(.5*Math.sin(e*6.5+o*4+Math.sin(u*4.5)*1.5)+.3*Math.sin(u*8-e*4+Math.sin(o*6)*1.2)+.18*Math.sin(o*11+u*6)+.09*Math.sin(e*19+o*15));const B=Math.exp(-(e*e)/.012)*Math.max(0,u+.05);h-=.17*Math.min(1,B*1.4);let b=e*.92*h,M=u*.78*h,v=o*1.3*h;const E=Math.max(-1,Math.min(1,v/1.45));b*=1-.17*Math.max(0,E)+.1*Math.max(0,-E),M<0&&(M*=.85);const T=Math.max(0,Math.min(1,(.12-M)/.5))*Math.max(0,Math.min(1,v/.9));b+=(b>=0?1:-1)*T*.16,M-=T*.1;const l=Math.max(0,Math.min(1,(v/1.45+1)/2));return{x:b,y:M,z:v,ap:l}}function Ct(e,u,o){const h=1+.16*(.55*Math.sin(e*16+o*13)+.45*Math.sin(u*15-e*10)+.2*Math.sin(o*20));return{x:e*.46*h,y:u*.3*h-.58,z:o*.4*h-1,ap:.05}}function ot(e,u){const o=e%8===3,a=1-e/(u-1)*2,h=Math.sqrt(Math.max(0,1-a*a)),B=e*2.39996,b=Math.cos(B)*h,M=a,v=Math.sin(B)*h;return o?Ct(b,M,v):kt(b,M,v)}const et={h:0,s:0,l:0},st=e=>(e.getHSL(et),e.setHSL(et.h,Math.min(1,et.s*1.15),Math.min(.4,Math.max(.2,et.l*.5))),e),St=`
2attribute vec3 aColor; attribute float aSeed; attribute float aReveal;
3uniform float uTime; uniform vec3 uSpark; uniform float uPix; uniform float uBright; uniform float uGrow;
4varying vec3 vC; varying float vB; varying float vVis;
5void main(){
6  vC = aColor;
7  float vis = smoothstep(aReveal - 0.12, aReveal + 0.02, uGrow);   // particle materializes as growth passes its threshold
8  vVis = vis;
9  float tw = 0.5 + 0.5 * sin(uTime * 2.0 + aSeed * 6.2831);
10  float d = distance(position, uSpark);
11  float sp = smoothstep(0.6, 0.0, d);
12  vB = (0.30 + tw * 0.36 + sp * 1.5) * uBright;
13  vec4 mv = modelViewMatrix * vec4(position, 1.0);
14  gl_PointSize = (uPix * (1.0 + sp * 1.7) * (0.35 + 0.65 * vis)) / (-mv.z);
15  gl_Position = projectionMatrix * mv;
16}`,At=`
17uniform float uInk;
18varying vec3 vC; varying float vB; varying float vVis;
19void main(){
20  vec2 c = gl_PointCoord - 0.5; float r = length(c);
21  if (r > 0.5) discard;
22  float a = smoothstep(0.5, 0.0, r);
23  // uInk=1 (light theme): brightness must NOT double as transparency - lift the tint
24  // and alpha floors so the inked dots stay solid, with vB left as a subtle shimmer.
25  float tint = mix(vB, clamp(0.6 + vB * 0.4, 0.0, 1.0), uInk);
26  float cover = mix(min(1.2, vB), clamp(0.5 + vB * 0.6, 0.0, 1.0), uInk);
27  gl_FragColor = vec4(vC * tint, a * cover * vVis);
28}`,V=5200,_=80,rt=52;function It({layers:e,active:u,accent:o,light:a,evolve:h,growth:B,bloomRef:b,freshness:M=1}){const v=it(),E=m.useRef(),T=m.useRef(),l=Math.max(1,e.length),j=m.useMemo(jt,[]),L=typeof window<"u"?Math.min(window.devicePixelRatio||1,1.7):1.4,z=m.useMemo(()=>{var P;const y=new Float32Array(V*3),k=new Float32Array(V*3),w=new Float32Array(V),C=new Float32Array(V),i=new Float32Array(V),c=new J,U=new J(o).lerp(new J(a?"#7a2410":"#ffffff"),.62),W=Math.floor(V*.15),F=V-W;for(let t=0;t<F;t++){const r=ot(t,F);y[t*3]=r.x,y[t*3+1]=r.y,y[t*3+2]=r.z,C[t]=r.ap;const d=Math.min(l-1,Math.floor(r.ap*l));c.set(((P=e[d])==null?void 0:P.color)||o);const g=Math.min(1,Math.sqrt(r.x*r.x+r.y*r.y+r.z*r.z)/1.45),G=Math.pow(1-g,1.4)*.8;c.lerp(U,G),a?st(c):c.multiplyScalar(1+G*.6),k[t*3]=c.r,k[t*3+1]=c.g,k[t*3+2]=c.b,w[t]=Math.random(),i[t]=Math.min(.985,g*.82+Math.random()*.22)}for(let t=F;t<V;t++){const r=.6*Math.cbrt(Math.random()),d=Math.random()*Math.PI*2,g=M
28ath.acos(2*Math.random()-1);y[t*3]=r*Math.sin(g)*Math.cos(d),y[t*3+1]=r*Math.sin(g)*Math.sin(d)*.8,y[t*3+2]=r*Math.cos(g),C[t]=.5;const G=1-r/.6;c.copy(U),a?st(c):c.multiplyScalar(1.2+G*1),k[t*3]=c.r,k[t*3+1]=c.g,k[t*3+2]=c.b,w[t]=Math.random(),i[t]=Math.random()*.12}const R=new Q;return R.setAttribute("position",new q(y,3)),R.setAttribute("aColor",new q(k,3)),R.setAttribute("aSeed",new q(w,1)),R.setAttribute("aReveal",new q(i,1)),{geo:R,pos:y,ap:C}},[e,l,o,a]),A=m.useMemo(()=>new pt({uniforms:{uTime:{value:0},uSpark:{value:new tt},uPix:{value:22*L},uBright:{value:1},uInk:{value:a?1:0},uGrow:{value:h?0:1}},vertexShader:St,fragmentShader:At,transparent:!0,depthWrite:!1,blending:a?Y:Z}),[a,L,h]),I=m.useMemo(()=>{var P;const y=new Float32Array(_*3),k=new Float32Array(_*3),w=new Float32Array(_*3),C=[],i=new J;for(let t=0;t<_;t++){const r=ot(t,_),d=Math.min(l-1,Math.floor(r.ap*l));i.set(((P=e[d])==null?void 0:P.color)||o),a&&st(i),y[t*3]=r.x,y[t*3+1]=r.y,y[t*3+2]=r.z,k[t*3]=i.r,k[t*3+1]=i.g,k[t*3+2]=i.b,w[t*3]=i.r,w[t*3+1]=i.g,w[t*3+2]=i.b,C.push({p:new tt(r.x,r.y,r.z),li:d,energy:0})}const c=C.map(()=>[]),U=[],W={};for(let t=0;t<_;t++){const r=[];for(let d=0;d<_;d++)d!==t&&r.push([C[t].p.distanceToSquared(C[d].p),d]);r.sort((d,g)=>d[0]-g[0]);for(let d=0;d<3;d++){const g=r[d][1],G=Math.min(t,g)+"_"+Math.max(t,g);if(!W[G]){W[G]=1;const D=C[t].p,X=C[g].p;U.push(D.x,D.y,D.z,X.x,X.y,X.z)}c[t].indexOf(g)<0&&c[t].push(g),c[g].indexOf(t)<0&&c[g].push(t)}}const F=new Q;F.setAttribute("position",new q(y,3)),F.setAttribute("color",new q(w,3));const R=new Q;return R.setAttribute("position",new q(new Float32Array(U),3)),{nodes:C,adj:c,geo:F,lgeo:R,base:k,col:w}},[e,l,o,a]),N=m.useMemo(()=>{const y=new Float32Array(rt*3).fill(-100),k=new Q;k.setAttribute("position",new q(y,3));const w=[...Array(rt)].map((C,i)=>({on:!1,a:0,b:0,t:0,sp:1,depth:0,i}));return{pos:y,geo:k,slots:w}},[I]),S=m.useMemo(()=>new tt,[]),$=m.useMemo(()=>new tt,[]),K=m.useRef(0),nt=m.useRef(0);return dt((y,k)=>{const w=Math.min(k,.05),C=y.clock.elapsedTime,i=B==null?void 0:B.current;let c=1;if(i){if(h&&!i.done){i.start||(i.start=C);const n=Math.min(1,(C-i.start)/7);if(i.p=n*n*(3-2*n),n>=1){i.done=!0,i.flash=1,i.burstId=(i.burstId||0)+1;let p=0;for(const f of N.slots){if(p>=30)break;if(!f.on){const x=Math.random()*_|0,O=I.adj[x];O.length&&(f.on=!0,f.a=x,f.b=O[Math.random()*O.length|0],f.t=0,f.sp=1.7+Math.random()*1.3,f.depth=0,p++)}}}}i.flash=Math.max(0,i.flash-w*.85),c=i.p}const U=1,W=i?i.flash:0,F=a?.85+.15*M:.55+.45*M;A.uniforms.uTime.value=C,A.uniforms.uGrow.value=c,A.uniforms.uBright.value=(U*(.12+.88*c)+W*.9)*F,b!=null&&b.current&&(b.current.intensity=(H(.12,a?.28:.85,c)+W*.8)*(a?1:F)),T.current&&(T.current.opacity=H(.008,a?.28:.16,c));const R=E.current;if(R&&(R.rotation.y+=w*.17,R.scale.setScalar(at*(.99+Math.sin(C*1.3)*.012))),S.lerp($,.05),A.uniforms.uSpark.value.copy(S),K.current+=w,S.distanceToSquared($)<.04||K.current>1.8){K.current=0;const n=e.findIndex(f=>f.key===u);let p=-1;if(n>=0&&Math.random()<.7)for(let f=0;f<14;f++){const x=Math.random()*V|0;if(Math.min(l-1,Math.floor(z.ap[x]*l))===n){p=x;break}}p<0&&(p=Math.random()*V|0),$.set(z.pos[p*3],z.pos[p*3+1],z.pos[p*3+2])}const P=I.nodes,t=I.adj,r=(n,p,f)=>{for(const x of N.slots)if(!x.on){x.on=!0,x.a=n,x.b=p,x.t=0,x.sp=1.7+Math.random()*.7,x.depth=f;return}};nt.current+=w;const d=H(2.6,.42,c);for(;nt.current>d;){if(nt.current-=d,c<.12)continue;const n=Math.random()*_|0,p=t[n];for(let f=0;f<Math.min(2,p.length);f++)r(n,p[f],0)}for(const n of N.slots){if(!n.on)continue;n.t+=w*n.sp;const p=P[n.a].p,f=P[n.b].p;if(N.pos[n.i*3]=H(p.x,f.x,n.t),N.pos[n.i*3+1]=H(p.y,f.y,n.t),N.pos[n.i*3+2]=H(p.z,f.z,n.t),n.t>=1&&(P[n.b].energy=1,n.on=!1,N.pos[n.i*3]=-100,N.pos[n.i*3+1]=-100,N.pos[n.i*3+2]=-100,n.depth<4)){const x=t[n.b].filter(O=>O!==n.a);for(let O=0;O<x.length&&O<3;O++)Math.random()<.5&&r(n.b,x[O],n.depth+1)}}N.geo.attributes.position.needsUpdate=!0;const g=e.findIndex(n=>n.key===u),G=I.col,D=I.base,X=(.22+.78*c)*(a?1:F);for(let n=0;n<P.length;n++){const p=P[n];p.energy=Math.max(0,p.energy-w*1.4);const f=g<0?1:p.li===g?1.3:.5,x=(.55+p.energy*.95)*f*X;G[n*3]=D[n*3]*x,G[n*3+1]=D[n*3+1]*x,G[n*3+2]=D[n*3+2]*x}I.geo.attributes.color.needsUpdate=!0}),s.jsx(s.Fragment,{children:s.jsxs("group",{ref:E,scale:at,rotation:[-.28,0,0],children:[s.jsx("points",{geometry:z.geo,material:A,frustumCulled:!1}),s.jsx("lineSegments",{geometry:I.lgeo,frustumCulled:!1,children:s.jsx("lineBasicMaterial",{ref:T,color:a?v.violet:v.violetSoft,transparent:!0,opacity:a?.28:.16,blending:a?Y:Z,depthWrite:!1})}),s.jsx("points",{geometry:I.geo,frustumCulled:!1,children:s.jsx("pointsMaterial",{map:j,size:.14,sizeAttenuation:!0,vertexColors:!0,transparent:!0,depthWrite:!1,blending:a?Y:Z})}),s.jsx("points",{geometry:N.geo,frustumCulled:!1,children:s.jsx("pointsMaterial",{map:j,color:v.peach,size:.16,sizeAttenuation:!0,transparent:!0,depthWrite:!1,blending:a?Y:Z})})]})})}function Nt({evolve:e,strength:u,growth:o,wrapRef:a,active:h}){const[B,b]=m.useState(e?0:u),[M,v]=m.useState(null),E=m.useRef(0);m.useEffect(()=>{if(!e||!h)return;const l=setInterval(()=>{var L;const j=o.current;if(b(Math.round(((j==null?void 0:j.p)??1)*100)),j&&j.burstId&&j.burstId!==E.current){E.current=j.burstId;const z=((L=a.current)==null?void 0:L.querySelector(".pbrain-stage"))||a.current,A=z==null?void 0:z.getBoundingClientRect();A&&v({id:j.burstId,x:A.left+A.width/2,y:A.top+A.height/2})}},50);return()=>clearInterval(l)},[e,h,o,a]),m.useEffect(()=>{if(!M)return;const l=setTimeout(()=>v(null),1900);return()=>clearTimeout(l)},[M]);const T=()=>{var l;e&&(o.current={p:0,flash:0,done:!1,start:0,burstId:((l=o.current)==null?void 0:l.burstId)||0},b(0))};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`pbrain-core-label${e?" is-evolve":""}`,title:e?"Replay evolution":void 0,...e?{onClick:T,role:"button",tabIndex:0,"aria-label":"Replay the persona evolution",onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),T())}}:{},children:[s.jsxs("strong",{className:"tnum",children:[e?B:u,"%"]}),s.jsx("span",{children:"persona"})]}),M&&ct.createPortal(s.jsxs("div",{className:"pbrain-shock","aria-hidden":"true",style:{left:`${M.x}px`,top:`${M.y}px`},children:[s.jsx("div",{className:"pbrain-shock-ring"}),s.jsx("div",{className:"pbrain-shock-ring r2"}),s.jsx("div",{className:"pbrain-shock-ring r3"})]},M.id),document.body)]})}function Vt({layers:e=[],active:u,onSelect:o,name:a="",strength:h=0,accent:B,evolve:b=!1,freshness:M=1}){const v=m.useRef(),[E,T]=m.useState(!1),[l]=m.useState(()=>Mt()||yt()||!wt()),j=bt()==="light",L=it(),z=B||L.accent,A=m.useRef(),I=m.useRef(null);I.current||(I.current={p:b?0:1,flash:0,done:!b,start:0,burstId:0}
28),m.useEffect(()=>{if(l)return;const S=v.current;if(!S)return;const $=new IntersectionObserver(([K])=>T(K.isIntersecting),{rootMargin:"200px 0px"});return $.observe(S),()=>$.disconnect()},[l]);const N=s.jsx(gt,{layers:e,active:u,onSelect:o,name:a,strength:h});return l?N:s.jsxs("div",{className:"pbrain",ref:v,children:[s.jsxs("div",{className:"pbrain-stage",children:[E?s.jsx(xt,{fallback:N,children:s.jsxs(lt,{className:"pbrain-canvas",dpr:[1,1.7],gl:{antialias:!0,alpha:!0},camera:{position:[0,.4,6.2],fov:44},onCreated:({camera:S})=>S.lookAt(0,0,0),children:[s.jsx("ambientLight",{intensity:.4}),s.jsx("pointLight",{position:[3,3,4],intensity:.4,color:"#fff0e6"}),s.jsx("pointLight",{position:[-4,-1,-2],intensity:.28,color:L.violet}),s.jsx(It,{layers:e,active:u,accent:z,light:j,evolve:b,growth:I,bloomRef:A,freshness:Number.isFinite(+M)?Math.max(0,Math.min(1,+M)):1}),s.jsx(ut,{disableNormalPass:!0,children:s.jsx(ft,{ref:A,intensity:j?.28:.85,luminanceThreshold:j?.84:.4,luminanceSmoothing:j?.6:.85,mipmapBlur:!0,radius:j?.42:.62})})]})}):s.jsx("div",{className:"pbrain-ph"}),s.jsx(Nt,{evolve:b,strength:h,growth:I,wrapRef:v,active:E})]}),s.jsx("div",{className:"pbrain-legend",children:e.map(S=>s.jsxs("button",{className:`pbrain-chip ${u===S.key?"on":""}`,style:{"--c":S.color},onClick:()=>o==null?void 0:o(S.key),children:[s.jsx("span",{className:"pbrain-chip-dot"}),s.jsx(vt,{name:S.icon,size:13}),s.jsx("span",{className:"pbrain-chip-name",children:S.name}),s.jsxs("span",{className:"pbrain-chip-cov tnum",children:[S.cov,"%"]})]},S.key))}),s.jsx("p",{className:"pbrain-hint",children:"A living model of you · the mind firing across six memory layers - click one to focus it."})]})}export{Vt 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.