2 lines
9.4 KiB
JavaScript
2 lines
9.4 KiB
JavaScript
|
|
import{r as c,j as e,g as w,h as q,i as Z,a as z}from"./index-CEeZxcxj.js";const U="_container_101xd_1",Y="_frame_101xd_20",J="_squareLayout_101xd_26",X="_squarePanel_101xd_35",ee="_viewportPanel_101xd_44",te="_contentPanel_101xd_50",se="_panelBody_101xd_56",ne="_copy_101xd_66",ie="_muted_101xd_73",ae="_badge_101xd_77",ce="_choiceButton_101xd_89",re="_completeButton_101xd_90",oe="_sliderSection_101xd_112",le="_sliderHeader_101xd_118",de="_sliderLabel_101xd_125",ue="_sliderValue_101xd_132",xe="_valueInfinity_101xd_138",he="_slider_101xd_112",me="_sliderInfinity_101xd_170",fe="_sliderHint_101xd_184",pe="_statsOverlay_101xd_189",_e="_stat_101xd_189",ge="_statLabel_101xd_208",ye="_statValue_101xd_217",je="_statInfinity_101xd_223",ve="_warning_101xd_227",be="_warningText_101xd_233",Se="_warningQuestion_101xd_234",we="_warningChoices_101xd_245",Ne="_choiceInfinity_101xd_257",Me="_choiceFinite_101xd_265",Ie="_resultStats_101xd_273",Re="_resultRow_101xd_280",$e="_resultMessage_101xd_298",Ce="_resultSuccess_101xd_309",Le="_resultAccent_101xd_313",t={container:U,frame:Y,squareLayout:J,squarePanel:X,viewportPanel:ee,contentPanel:te,panelBody:se,copy:ne,muted:ie,badge:ae,choiceButton:ce,completeButton:re,sliderSection:oe,sliderHeader:le,sliderLabel:de,sliderValue:ue,valueInfinity:xe,slider:he,sliderInfinity:me,sliderHint:fe,statsOverlay:pe,stat:_e,statLabel:ge,statValue:ye,statInfinity:je,warning:ve,warningText:be,warningQuestion:Se,warningChoices:we,choiceInfinity:Ne,choiceFinite:Me,resultStats:Ie,resultRow:Re,resultMessage:$e,resultSuccess:Ce,resultAccent:Le},L=5,p=41;function Fe(d){const r=Math.min(Math.max(d,L),p);return r%2===0?r+1:r}function A(d){const r=[],i=d,x=2/i;for(let u=0;u<i;u++)for(let m=0;m<i;m++)for(let a=0;a<i;a++){const g=-1+x*(u+.5),s=-1+x*(m+.5),_=-1+x*(a+.5),f=Math.sqrt(g*g+s*s+_*_),N=x*1.2;f<=1&&f>1-N&&r.push(g,s,_)}return{positions:r,count:r.length/3}}function Pe({resolution:d,isInfinity:r}){const o=c.useRef(null),i=c.useMemo(()=>new Z,[]),{positions:x,count:u,cubeSize:m}=c.useMemo(()=>{const s=Math.min(d,p),_=A(s),f=2/s*.85;return{positions:_.positions,count:_.count,cubeSize:f}},[d]);c.useEffect(()=>{if(!(!o.current||u===0)){for(let s=0;s<u;s++)i.position.set(x[s*3],x[s*3+1],x[s*3+2]),i.scale.setScalar(m),i.updateMatrix(),o.current.setMatrixAt(s,i.matrix);o.current.instanceMatrix.needsUpdate=!0,o.current.count=u}},[x,u,m,i]),z(s=>{o.current&&(o.current.rotation.y=s.clock.elapsedTime*.2)});const a=r?"#ef4444":"#818cf8";return e.jsxs("instancedMesh",{ref:o,args:[void 0,void 0,1e4],frustumCulled:!1,children:[e.jsx("boxGeometry",{args:[1,1,1]}),e.jsx("meshStandardMaterial",{color:a,emissive:a,emissiveIntensity:.05,roughness:.4,metalness:.3})]})}function C({resolution:d,isInfinity:r}){return e.jsxs(e.Fragment,{children:[e.jsx("ambientLight",{intensity:.3}),e.jsx("directionalLight",{position:[5,8,5],intensity:1.2,castShadow:!0}),e.jsx("directionalLight",{position:[-3,-2,-4],intensity:.4,color:"#22d3ee"}),e.jsx("pointLight",{position:[0,5,0],intensity:.5}),e.jsx(Pe,{resolution:d,isInfinity:r}),e.jsx(q,{enableZoom:!0,enablePan:!1,autoRotate:!1,minDistance:2,maxDistance:6})]})}function Be(){const d=c.useRef(null);return z(r=>{d.current&&(d.current.rotation.y=r.clock.elapsedTime*.3)}),e.jsxs("mesh",{ref:d,children:[e.jsx("sphereGeometry",{args:[1,128,128]}),e.jsx("meshStandardMaterial",{color:"#22d3ee",emissive:"#22d3ee",emissiveIntensity:.08,roughness:.15,metalness:.9,envMapIntensity:1})]})}function ke(){return e.jsxs(e.Fragment,{children:[e.jsx("ambientLight",{intensity:.3}),e.jsx("directionalLight",{position:[5,8,5],intensity:1.5}),e.jsx("directionalLight",{position:[-4,-2,-3],intensity:.5,color:"#6366f1"}),e.jsx("pointLight",{position:[0,3,3],intensity:.8,color:"#ffffff"}),e.jsx(Be,{}),e.jsx(q,{enableZoom:!1,enablePan:!1,autoRotate:!0,autoRotateSpeed:1.5})]})}function qe({config:d,onComplete:r,onProgress:o,theme:i,className:x}){const[u,m]=c.useState("exploring"),[a,g]=c.useState(L),[s,_]=c.useState(null),[f,N]=c.useState(!1),F=c.useRef(null),[y,O]=c.useState({stacked:!1,panelSize:320,gap:16,padding:16}),S=a>=p,P=
|