brainsmatics 1.0.84 → 1.0.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{deflate-d2aaf32a.mjs → deflate-4178908c.mjs} +1 -1
- package/dist/{deflate-5ab4997b.js → deflate-e58b5c61.js} +1 -1
- package/dist/{index-6bd63f48.js → index-5176e4cb.js} +3 -3
- package/dist/{index-7cb674fd.mjs → index-e2ef48ce.mjs} +5 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{lerc-17348c6b.mjs → lerc-041700a9.mjs} +1 -1
- package/dist/{lerc-9b834f36.js → lerc-b5fe725c.js} +1 -1
- package/package.json +1 -1
|
@@ -4467,7 +4467,7 @@ echarts.use([`+B+"]);":"Unknown series "+k))}return}if(f==="tooltip"){if(x){proc
|
|
|
4467
4467
|
}
|
|
4468
4468
|
`,transparent:!1,depthWrite:!1,depthTest:!1}),Ut=new Yf(Ze,Pt);Ut.translateX(fe),Ut.translateY(ot),Ut.translateZ(ce),Ut.myMeshType="neuronSphere",Ut.name=`${Be}-${vt.line[0].start_name}`,Ut.userData.color="#1771FF",Ut.myMeshType="neuronSphere",Ut.name=`${Be}-${vt.line[0].start_name}`,Ut.userData.color="#1771FF",er(Ut),$e.add(Ut),$e.name=`swcPointGroup${Be}`,Ct.current.push($e),Ae.current.add($e);let an=1;for(let wt=0;wt<vt.line.length;wt++){let jt=[],qn=[vt.position[0].x,vt.position[0].y,vt.position[0].z];for(let Tn=vt.line[wt].start;Tn<=vt.line[wt].end;Tn++){Tn===vt.line[wt].start&&(qn=[vt.position[Tn].x,vt.position[Tn].y,vt.position[Tn].z]);let An=vt.position[Tn].x,Wr=vt.position[Tn].y,Qr=vt.position[Tn].z;(Math.sqrt((An-qn[0])*(An-qn[0])+(Wr-qn[1])*(Wr-qn[1])+(Qr-qn[2])*(Qr-qn[2]))>an||Tn===vt.line[wt].end||Tn===vt.line[wt].start)&&(jt.push(new Ie(An,Wr,Qr)),qn=[An,Wr,Qr])}let pr=new Pa(new ea().setFromPoints(jt),new Af({color:tt}));pr.myMeshType="SWC",Ue.add(pr)}Ue.scale.set(sa.current,sa.current,sa.current),Ue.translateX(fe),Ue.translateY(ot),Ue.translateZ(ce),Ue.name=Be,Ue.myMeshType="SWC",oe.current[Be]=Ue,Ae.current.add(oe.current[Be]),rt&&rt()})},yr=function(at){return at.replace("/","_").replace(" ","_")},zr=(at,Le,Be)=>{var rt;Be.color=Le;let tt=Ae.current.children.find(dt=>dt.name==Be.name);if(s=="vessel")i.current[Be.name]&&tt&&tt.traverse(function(dt){(dt instanceof Pa||dt instanceof rr)&&dt.material.color.set(Be.color)});else if(s=="fbx"){if(ji.current[Be.name]&&tt){let dt;if(Be.color.includes("rgba")){const $e=Be.color.lastIndexOf(",");dt=Be.color.slice($e+1,-1)}const vt=new li(Be.color);let ot=new URL(window.location.href),fe=new URLSearchParams(ot.search),ce=fe.get("fbxColor"),Ue={};ce&&(Ue=JSON.parse(ce)),Ue[`${Be.name}`]=Be.color,fe.set("fbxColor",JSON.stringify(Ue)),ot.search=fe.toString(),window.history.replaceState({},"",ot),tt.traverse(function($e){$e instanceof rr&&($e.material.color.set(vt),dt&&($e.material.transparent=!0,$e.material.opacity=dt))})}}else if(s=="soma")ie.current.includes(Be.name)&&tt&&tt.traverse(function(dt){dt instanceof Yf&&(dt.material.uniforms.color.value=rn(Be.color))});else if(s=="swc"){const dt=new li(Be.color);let vt;if(Be.color.includes("rgba")){const ce=Be.color.lastIndexOf(",");vt=parseFloat(Be.color.slice(ce+1,-1))}if(oe.current[Be.name]&&tt){let ce=new URL(window.location.href),Ue=new URLSearchParams(ce.search);$t.current[Be.name]=Be.color.replace("#","!"),Ue.set("neuronsColor",encodeURIComponent(JSON.stringify($t.current))),ce.search=Ue.toString(),window.history.replaceState({},"",ce),tt.traverse(function($e){$e instanceof Pa&&($e.material.color.set(dt),vt&&($e.material.transparent=!0,$e.material.opacity=vt,$e.material.needsUpdate=!0))})}Ae.current.traverse(ce=>{ce.myMeshType==="neuronSphere"&&ce.userData.type=="end"&&Be.name===ce.name.split("-")[0]&&(ce.material.uniforms.color.value=dt,ce.userData.color=at,vt&&(ce.material.uniforms.opacity.value=vt))});let[ot,fe]=or(st.current,Be.name);for(let ce in fe){let Ue=ce;ce.indexOf("_")>-1&&(Ue=ce.split("_")[0]);let $e=(rt=st.current[`${Ue}`])==null?void 0:rt.find(Ze=>Ze.name===Be.name);$e&&($e.color=dt)}Ae.current.traverse(ce=>{if(ce.name==="lineNameMesh"&&ce.userData.type=="end"&&Be.name===ce.userData.wholeName.split("-")[0]){let Ue=Be.color;ce.material.color.set(Ue),ce.userData.initColor=Ue}})}},tr=C.useCallback((at,Le,Be,tt,rt)=>{at.stopPropagation();let dt=new URL(window.location.href),vt=new URLSearchParams(dt.search),ot=Le,fe=ZX(ot,xe.current),Ue=Zp(ot,xe.current).children,$e=B+"/data/"+Q.current+"/"+yr(ot)+".FBX";for(var Ze=0;Ze<fe.length;Ze++){if(on(fe[Ze],!0),Se.includes(fe[Ze])){We(Ut=>Ut.filter(an=>an!==fe[Ze]));const Pt=JSON.stringify(Se.filter(Ut=>Ut!==fe[Ze]));vt.set("regionsExpanded",Pt)}ie.current=ie.current.filter(Pt=>Pt!==fe[Ze])}if(Se.includes(ot)){We(Ut=>Ut.filter(an=>an!==ot));const Pt=JSON.stringify(Se.filter(Ut=>Ut!==ot));vt.set("regionsExpanded",Pt),ie.current.includes(ot)||ie.current.push(ot),ji.current[ot]?(Ae.current.remove(ji.current[ot]),ji.current[ot].children[0].material.color.set(tt),Ae.current.add(ji.current[ot]),np.current&&(Ae.current.remove(ma.current[ot]),ma.current[ot].children[0].material.color.set(tt),Ae.current.add(ma.current[ot]))):Qu($e,ot,tt,.6,parseInt(rt));for(var Ze=0;Ze<Ue.length;Ze++)ie.current=ie.current.filter(an=>an!==Ue[Ze].name),on(Ue[Ze].name,!0),ct.current=0,delete ee.current[Ue[Ze].name]}else{const Pt=document.getElementById("spinner"),Ut=JSON.stringify([...Se,ot]);vt.set("regionsExpanded",Ut),We(an=>[...an,ot]),Pt&&(Pt.style.display="block"),ji.current[ot]?(Ae.current.remove(ji.current[ot]),ji.current[ot].children[0].material.color.set("#DBDBDB"),Ae.current.add(ji.current[ot]),np.current&&(Ae.current.remove(ma.current[ot]),ma.current[ot].children[0].material.color.set("#DBDBDB"),Ae.current.add(ma.current[ot]))):Qu($e,ot,"#DBDBDB",.6,parseInt(rt)),ie.current=ie.current.filter(an=>an!==ot);for(var Ze=0;Ze<Ue.length;Ze++)if(Ue[Ze]["3D"]){let wt=parseInt(Ue[Ze].z),jt=Ue[Ze].color,qn=B+"/data/"+Q.current+"/"+yr(Ue[Ze].name)+".FBX";ie.current.push(Ue[Ze].name),zi(qn,Ue[Ze].name,jt,.6,wt,function(){Pt&&(Pt.style.display="none")})}}m(ie.current);const pt=JSON.stringify(ie.current);vt.set("regionsChecked",pt),dt.search=vt.toString(),window.history.replaceState({},"",dt)},[g,f,Se]),Lr=(at,Le,Be)=>{if(Le===ie.current[0]&&b)return;const tt=ie.current.indexOf(Le);if(tt!==-1){b&&(at.target.style.color="black"),m(ot=>ot.filter(fe=>fe!==Le)),ie.current.splice(tt,1);let rt=new URL(window.location.href),dt=new URLSearchParams(rt.search);const vt=JSON.stringify(ie.current);s==="fbx"?dt.set("regionsChecked",vt):s==="vessel"&&dt.set("vesselsChecked",vt),rt.search=dt.toString(),window.history.replaceState({},"",rt),on(Le,!0)}else{b&&(at.target.style.color="red"),ie.current.push(Le),m([...ie.current]);let rt=new URL(window.location.href),dt=new URLSearchParams(rt.search);const vt=JSON.stringify(ie.current);s==="fbx"?dt.set("regionsChecked",vt):s==="vessel"&&dt.set("vesselsChecked",vt),rt.search=dt.toString(),window.history.replaceState({},"",rt);let ot=B+"/data/FBX/"+Le+".FBX";Qu(ot,Le,Be,.8,0)}if(x){const rt=x.current.indexOf(Le);rt>-1?x.current.splice(rt,1):x.current.push(Le)}},Dr=C.useMemo(()=>{var rt,dt;let at=q&&q.split(" ")[0]||"",Le=typeof te=="string"?te.split(" ")[0]:"",Be=["MO","MOs","MOp","CP","Isocortex"];if(s=="swc"){let vt=[],ot=[];if(w&&Le){let fe=((rt=w[Le])==null?void 0:rt.axon)||[];vt=[...vt,...fe]}if(w&&at){let fe=((dt=w[at])==null?void 0:dt.soma)||[];ot=[...ot,...fe]}if(Le&&at){let fe=new Set(vt),ce=new Set(ot);nt.current=[...fe].filter(Ue=>ce.has(Ue))}else Le?nt.current=vt:at&&(nt.current=ot)}const tt=vt=>vt&&vt.map((ot,fe)=>{vB.push(ot),ot.nameflag?ot.key=ot.nameflag:ot.key=ot.name;let ce=ot.name;if(localStorage.getItem("lang")=="zh_cn"&&ot.cname&&(ce=ot.cname),s==="vessel"){const Pt=d1(ot.key,n);Pt[Pt.length-1]}if(ot.path||(s==="vessel"?ot.path=B+"/data/Vessel/":s==="fbx"&&(ot.path=B+"/data/FBX/")),Jhe){let Pt=JSON.parse(Jhe),an=Object.keys(Pt).find(wt=>wt===ot.name);an&&(ot.color=Pt[an])}const Ue=ke.reduce((Pt,Ut)=>{const[an,wt]=Ut.split(":");return Pt[an]=wt,Pt},{}),$e=(Pt,Ut)=>Pt in Ue?Ue[Pt]===Ut[Pt]:!0;let Ze;const pt=te&&ot["3D"]&&ce.toLowerCase().indexOf(te.toLowerCase())!==-1||b&&ie.current.slice(1).includes(ce)||s=="vessel"&&te&&ce.toLowerCase().indexOf(te.toLowerCase())!==-1;if(s==="fbx"||s==="vessel")return Ze=C.createElement("span",{style:{display:"flex",alignItems:"center"},onClick:Pt=>Pt.stopPropagation()},C.createElement(eb,{format:"rgb",defaultValue:ot.color,onChange:(Pt,Ut)=>zr(Pt,Ut,ot)}),C.createElement(ki,{placement:"right",title:ot.fullname},C.createElement("div",{onClick:Pt=>Lr(Pt,ot.key,ot.color),style:pt?{color:"red",whiteSpace:"nowrap"}:{color:"black",whiteSpace:"nowrap"}},ce)),Cn.includes(ot.name)?C.createElement(ki,{placement:"right",title:p("5000.6041")||"新标注"},C.createElement("svg",{className:"svgleft",width:"20px",height:"20px",viewBox:"0 0 200 200",version:"1.1",style:{marginLeft:"8px"},xmlns:"http://www.w3.org/2000/svg"},C.createElement("g",{id:"#1296dbff"},C.createElement("path",{fill:"#1296db",opacity:"1.00",d:" M 12.39 0.00 L 187.60 0.00 C 193.55 1.76 198.40 6.33 200.00 12.39 L 200.00 197.03 C 197.21 200.36 192.66 199.74 189.30 197.68 C 160.70 182.89 131.92 168.44 103.27 153.76 C 100.74 151.94 97.96 153.23 95.58 154.56 C 79.92 162.65 64.11 170.45 48.45 178.54 C 34.57 185.85 20.35 192.53 6.55 200.00 L 4.06 200.00 C 2.44 198.91 1.07 197.50 0.00 195.87 L 0.00 12.40 C 1.80 6.43 6.41 1.77 12.39 0.00 M 68.04 50.93 C 67.96 68.97 68.00 87.02 68.01 105.06 C 67.45 108.62 71.21 112.26 74.72 110.75 C 77.57 109.92 78.36 106.64 78.30 104.03 C 78.31 90.37 78.34 76.71 78.25 63.05 C 93.63 78.23 108.28 94.13 123.37 109.59 C 124.85 111.28 127.53 111.57 129.39 110.34 C 131.68 109.12 132.04 106.39 132.00 104.06 C 131.96 86.01 132.08 67.96 131.94 49.91 C 132.41 46.10 127.58 43.22 124.42 45.37 C 121.60 46.80 121.73 50.30 121.67 53.00 C 121.74 66.29 121.62 79.57 121.76 92.85 C 107.86 78.88 94.47 64.40 80.64 50.36 C 78.20 48.09 75.99 44.09 72.08 44.90 C 69.30 45.36 67.87 48.32 68.04 50.93 Z"})))):null,F!=null&&F.includes("neurons")&&Be.includes(ot.name)&&(k=="task3D"||k=="3Dneurons")?C.createElement(ki,{placement:"right",title:p("5000.6040")||"投射丰富"},C.createElement("svg",{width:"20px",height:"20px",viewBox:"0 0 200 200",style:{marginLeft:"5px"},version:"1.1",xmlns:"http://www.w3.org/2000/svg",onClick:()=>{R==null||R.current.tabChange(7),setTimeout(()=>{P&&P(ot.name)},50)}},C.createElement("g",{id:"#1296dbff"},C.createElement("path",{fill:"#1296db",opacity:"1.00",d:" M 161.22 29.23 C 170.61 22.47 184.66 24.19 192.68 32.31 C 197.08 36.53 199.12 42.53 200.00 48.42 L 200.00 51.57 C 199.07 58.41 196.19 65.28 190.43 69.42 C 182.96 75.76 171.77 76.37 163.24 71.84 C 157.18 68.92 153.36 63.05 150.76 57.07 C 143.17 57.08 135.57 56.74 127.99 57.09 C 125.64 57.08 124.07 59.04 122.49 60.48 C 109.60 73.80 96.19 86.60 83.39 100.00 C 96.19 113.40 109.60 126.20 122.49 139.52 C 124.07 140.96 125.64 142.92 127.98 142.91 C 135.58 143.26 143.19 142.92 150.80 142.94 C 152.36 139.60 153.87 136.15 156.39 133.41 C 161.32 127.99 168.67 124.81 176.01 125.13 C 183.62 125.37 191.06 129.33 195.32 135.66 C 200.14 142.64 201.01 152.08 197.83 159.90 C 193.64 169.75 182.73 176.08 172.08 174.81 C 162.13 173.99 153.99 166.24 150.70 157.12 C 141.45 156.77 132.19 157.20 122.94 156.99 C 119.96 157.25 117.95 154.84 116.03 152.98 C 102.37 138.97 88.30 125.36 74.64 111.35 C 72.74 109.58 70.92 107.06 68.05 107.07 C 61.80 106.71 55.54 107.06 49.29 107.12 C 46.34 115.79 38.83 122.99 29.63 124.43 C 19.13 126.37 7.56 120.75 2.99 111.02 C -1.82 101.38 0.34 88.66 8.45 81.45 C 16.25 74.63 28.64 72.73 37.60 78.39 C 43.12 81.56 46.99 86.86 49.37 92.67 C 55.88 92.61 62.41 93.06 68.91 92.61 C 70.92 92.57 72.27 90.88 73.65 89.65 C 87.81 75.15 102.36 61.03 116.53 46.53 C 118.28 44.79 120.23 42.76 122.94 43.01 C 132.21 42.82 141.49 43.18 150.76 42.93 C 153.10 37.64 156.28 32.47 161.22 29.23 Z"})))):null,C.createElement("div",{ref:fe==0?u:null,style:{width:20,height:20,marginLeft:8}},ot.children&&y&&(k=="task3D"||k=="3Dlabel")?C.createElement(ki,{placement:"right",title:Se.includes(ot.key)?"Assemle":"Expand"},Se.includes(ot.key)?C.createElement("svg",{width:"20px",height:"20px",viewBox:"0 0 128 128",version:"1.1",xmlns:"http://www.w3.org/2000/svg",onClick:Pt=>tr(Pt,ot.key,`${ot.key}`,ot.color,ot.z)},C.createElement("g",{id:"#1296dbff"},C.createElement("path",{fill:"#1296db",opacity:"1.00",d:" M 63.29 5.38 C 64.77 5.01 66.21 5.93 67.59 6.37 C 76.47 10.42 84.89 15.45 93.99 19.03 C 96.79 20.32 100.17 21.53 101.43 24.64 C 103.43 28.57 100.65 33.35 96.69 34.67 C 89.18 37.63 82.15 41.64 74.68 44.70 C 70.42 46.40 65.85 50.45 61.12 47.92 C 51.83 43.67 42.87 38.75 33.64 34.38 C 30.76 33.08 27.65 31.24 27.03 27.85 C 26.96 24.60 28.32 20.85 31.64 19.65 C 42.33 15.22 52.50 9.55 63.29 5.38 Z"}),C.createElement("path",{fill:"#1296db",opacity:"1.00",d:" M 15.39 56.26 C 17.98 55.30 20.40 57.34 22.69 58.29 C 30.72 62.68 39.29 66.09 47.05 70.95 C 50.29 72.73 50.08 76.80 50.06 79.98 C 49.82 91.26 50.26 102.56 49.87 113.83 C 48.69 117.23 44.23 120.17 40.62 118.42 C 31.59 115.01 22.81 110.92 14.00 106.99 C 9.42 104.95 9.09 99.37 8.97 95.04 C 9.05 85.36 8.92 75.67 9.02 66.00 C 8.93 61.81 11.32 57.64 15.39 56.26 Z"}),C.createElement("path",{fill:"#1296db",opacity:"1.00",d:" M 109.45 56.37 C 113.43 54.97 117.33 58.88 118.67 62.35 C 119.44 66.85 118.87 71.46 119.00 76.00 C 118.77 84.93 119.77 94.00 117.79 102.80 C 117.39 105.12 115.10 106.29 113.17 107.17 C 105.54 110.54 97.93 113.93 90.31 117.31 C 88.05 118.18 85.69 119.33 83.20 118.99 C 80.27 117.96 77.59 115.38 77.99 112.02 C 77.99 100.34 77.98 88.66 78.00 76.98 C 77.80 73.81 79.74 70.88 82.64 69.66 C 91.60 65.29 100.43 60.62 109.45 56.37 Z"})),C.createElement("g",{id:"#8da6d9ff"},C.createElement("path",{fill:"#8da6d9",opacity:"1.00",d:" M 10.48 33.45 C 14.12 32.46 17.23 35.20 20.36 36.61 C 22.35 38.00 25.96 38.81 25.77 41.84 C 25.91 43.53 23.62 44.66 22.18 43.98 C 18.23 42.43 14.41 40.41 10.91 38.01 C 9.31 36.99 10.24 34.90 10.48 33.45 Z"}),C.createElement("path",{fill:"#8da6d9",opacity:"1.00",d:" M 113.64 33.62 C 114.86 32.90 116.24 33.28 117.54 33.44 C 117.65 34.89 118.71 37.04 117.12 38.02 C 113.32 40.46 109.32 42.77 105.00 44.17 C 102.38 44.63 101.22 40.71 103.32 39.38 C 106.46 36.98 110.08 35.28 113.64 33.62 Z"}),C.createElement("path",{fill:"#8da6d9",opacity:"1.00",d:" M 32.35 44.38 C 36.95 44.43 40.98 47.92 44.91 50.13 C 47.61 51.34 45.87 56.15 43.02 55.20 C 38.83 53.64 34.78 51.46 31.23 48.74 C 29.51 47.51 30.52 44.85 32.35 44.38 Z"}),C.createElement("path",{fill:"#8da6d9",opacity:"1.00",d:" M 83.15 50.18 C 86.59 47.86 90.26 45.76 94.16 44.30 C 96.46 43.58 97.45 46.12 97.82 47.88 C 94.55 50.84 90.52 52.76 86.56 54.60 C 85.18 55.35 83.62 54.93 82.16 54.82 C 82.08 53.21 81.21 51.03 83.15 50.18 Z"}),C.createElement("path",{fill:"#8da6d9",opacity:"1.00",d:" M 51.49 55.43 C 56.19 54.55 59.78 58.65 64.01 59.97 C 68.18 58.57 71.82 54.46 76.48 55.50 C 76.69 56.83 77.25 58.23 76.74 59.58 C 73.79 61.91 70.21 63.25 67.06 65.27 C 66.80 69.37 67.00 73.50 66.42 77.57 C 64.81 77.78 63.19 77.76 61.59 77.55 C 61.00 73.47 61.20 69.34 60.94 65.24 C 57.78 63.24 54.16 61.96 51.27 59.56 C 50.53 58.23 51.26 56.78 51.49 55.43 Z"}),C.createElement("path",{fill:"#8da6d9",opacity:"1.00",d:" M 61.61 84.44 C 63.20 84.05 64.82 84.09 66.42 84.44 C 67.10 89.77 67.19 95.20 66.42 100.53 C 64.82 101.13 63.15 101.18 61.52 100.63 C 60.93 95.26 60.78 89.80 61.61 84.44 Z"}),C.createElement("path",{fill:"#8da6d9",opacity:"1.00",d:" M 61.65 108.59 C 62.39 106.51 65.30 107.03 66.52 108.37 C 67.25 112.72 67.03 117.20 66.40 121.55 C 64.81 122.00 63.19 122.00 61.60 121.55 C 61.04 117.28 60.56 112.81 61.65 108.59 Z"}))):C.createElement("svg",{width:"20px",height:"20px",viewBox:"0 0 128 128",version:"1.1",xmlns:"http://www.w3.org/2000/svg",onClick:Pt=>tr(Pt,ot.key,`${ot.key}`,ot.color,ot.z)},C.createElement("g",{id:"#1296dbff"},C.createElement("path",{fill:"#1296db",opacity:"1.00",d:" M 61.53 12.67 C 65.46 11.54 69.30 13.51 72.75 15.18 C 79.87 18.83 87.26 21.90 94.40 25.50 C 98.14 27.43 102.24 28.74 105.61 31.32 C 108.79 33.88 107.69 39.53 104.04 41.12 C 97.03 44.96 89.48 47.73 82.40 51.44 C 77.12 53.83 71.95 56.48 66.60 58.70 C 63.66 60.17 60.60 58.42 57.90 57.25 C 46.68 51.71 35.19 46.70 23.99 41.12 C 19.70 39.29 19.26 32.55 23.58 30.52 C 32.09 25.74 41.21 22.17 49.92 17.78 C 53.73 15.95 57.45 13.86 61.53 12.67 Z"}),C.createElement("path",{fill:"#1296db",opacity:"1.00",d:" M 19.32 48.10 C 22.27 47.30 25.07 49.17 27.71 50.24 C 36.66 54.75 45.89 58.69 54.87 63.12 C 56.99 64.25 59.54 65.55 60.07 68.13 C 60.64 70.71 60.51 73.37 60.53 76.00 C 60.40 86.34 60.51 96.69 60.51 107.03 C 60.44 109.78 60.34 113.19 57.72 114.82 C 54.77 117.03 51.17 114.98 48.27 113.77 C 39.28 109.37 30.16 105.24 21.11 100.97 C 19.03 99.85 16.43 98.92 15.46 96.58 C 14.66 93.80 14.87 90.85 14.82 87.99 C 14.97 77.31 14.77 66.62 14.88 55.94 C 14.74 52.76 16.06 49.18 19.32 48.10 Z"}),C.createElement("path",{fill:"#1296db",opacity:"1.00",d:" M 105.40 48.21 C 108.42 46.98 112.09 49.16 112.66 52.32 C 113.43 56.16 113.11 60.11 113.15 64.00 C 113.03 73.34 113.25 82.69 113.10 92.04 C 113.14 95.16 112.21 98.70 109.04 100.01 C 99.09 104.78 89.00 109.29 79.06 114.12 C 76.54 115.15 73.59 116.72 70.92 115.21 C 67.85 113.76 67.50 110.02 67.50 107.03 C 67.51 95.68 67.56 84.34 67.48 72.99 C 67.64 70.22 67.28 66.64 70.01 64.96 C 74.57 61.94 79.73 60.01 84.64 57.66 C 91.64 54.70 98.21 50.72 105.40 48.21 Z"})))):null)),ot.title=Ze,ot.key=ot.name,ot["3D"]==!1&&(ot.disabled=!0),b||Se.includes(ot.name)?ot.disableCheckbox=!0:ot.disableCheckbox=!1,ot.children&&(ot.children=tt(ot.children)),ot;if(s=="swc"){if(Le||at)return nt.current&&nt.current.includes(ce)&&$e("strain",ot)&&$e("age",ot)&&$e("weight",ot)&&$e("gender",ot)&&$e("injected_viruses",ot)&&$e("imaging_system",ot)&&$e("species",ot)?(ot.title=ot.name,ot.key=ot.name,ot.color=ot.color?ot.color:"#045404",!Un||ot.show?ot:null):null}else{const Pt=te&&ce.toLowerCase().indexOf(te.toLowerCase())!==-1;return Ze=C.createElement(ki,{placement:"right",title:ot.fullname},C.createElement("span",{style:{display:"flex",alignItems:"center"},onClick:Ut=>Ut.stopPropagation()},ot.children&&s=="swc"?null:C.createElement(eb,{disabled:s=="swc",format:"rgb",defaultValue:s=="swc"?"#045404":ot.color,onChange:(Ut,an)=>zr(Ut,an,ot)}),C.createElement("div",{style:Pt?{color:"red"}:{}},ce))),ot.title=Ze,ot.key=ot.name,ot.children&&(ot.children=tt(ot.children)),ot}});return tt(n).filter(Boolean)},[te,n,q,Se,b,y,A,be,ke,w,Un,k]),Qn=new c9;C.useEffect(()=>{Qn.load("/staticresource/fonts/helvetiker_bold.typeface.json",at=>{})},[]);const Pr=(at,Le)=>{m(vt=>[...vt,at]),ie.current.push(at);let Be=new URL(window.location.href),tt=new URLSearchParams(Be.search);const rt=JSON.stringify(ie.current);tt.set("neuronsChecked",rt),Be.search=tt.toString(),window.history.replaceState({},"",Be);let dt=Zi(Dr,at);fetch(dt.path).then(vt=>vt.json()).then(vt=>{qt(vt)}),oe.current[at]?(Dt({name:at,color:Le}),bt(!0)):jr(dt.path,6,at,dt.color,function(){Zt(at,dt.color),Dt({name:at,color:Le}),bt(!0)})},$i=[{title:"Name",dataIndex:"name"},{title:"Color",dataIndex:"Picker",width:50,render:(at,Le)=>($t[Le.name]&&(Le.color=$t[Le.name]),C.createElement(eb,{disabled:!Le.show,format:"rgb",defaultValue:Le.color?Le.color:"#045404",onChange:(Be,tt)=>zr(Be,tt,Le)}))},{title:"Ana.",dataIndex:"Ana",align:"center",render:(at,Le)=>C.createElement(ki,{placement:"right",title:p("5000.7008")||"分析"},C.createElement("svg",{width:"20px",height:"20px",viewBox:"0 0 200 200",version:"1.1",xmlns:"http://www.w3.org/2000/svg",cursor:"pointer",pointerEvents:Le.show?"auto":"none",onClick:Be=>{Pr(Le.name,Le.color)}},C.createElement("g",{id:"#515151ff"},C.createElement("path",{fill:"#515151",opacity:"1.00",d:" M 93.31 23.38 C 99.84 22.59 106.48 23.11 113.05 23.06 C 116.47 22.96 118.74 26.28 119.64 29.16 C 119.69 72.38 119.68 115.62 119.65 158.85 C 118.76 161.25 117.05 164.47 114.01 164.31 C 107.36 164.33 100.70 164.43 94.05 164.27 C 90.19 163.42 89.10 158.51 89.04 155.07 C 88.96 114.37 88.99 73.66 89.03 32.95 C 88.88 29.39 89.91 25.14 93.31 23.38 Z"}),C.createElement("path",{fill:"#515151",opacity:"1.00",d:" M 154.30 33.38 C 160.49 32.55 166.82 33.20 173.07 33.01 C 177.49 32.53 180.75 36.93 180.68 41.00 C 180.64 79.96 180.71 118.92 180.65 157.87 C 180.10 160.67 178.42 164.46 175.00 164.30 C 168.35 164.35 161.68 164.43 155.03 164.26 C 150.70 163.82 149.84 158.51 149.68 155.00 C 149.66 117.67 149.67 80.35 149.67 43.02 C 149.50 39.30 150.67 35.07 154.30 33.38 Z"}),C.createElement("path",{fill:"#515151",opacity:"1.00",d:" M 31.38 68.42 C 36.43 66.93 41.81 67.98 47.00 67.67 C 50.60 67.83 55.31 66.86 57.74 70.26 C 59.28 71.73 58.83 74.05 59.00 75.97 C 58.96 103.34 59.07 130.71 58.95 158.08 C 59.30 161.45 56.33 164.46 52.99 164.32 C 46.66 164.36 40.33 164.36 34.01 164.32 C 30.72 164.36 27.65 161.48 28.05 158.09 C 27.95 130.37 28.00 102.64 28.03 74.92 C 27.75 72.28 28.89 69.58 31.38 68.42 Z"}),C.createElement("path",{fill:"#515151",opacity:"1.00",d:" M 7.94 174.89 C 8.70 174.83 10.24 174.70 11.01 174.64 C 47.00 174.68 83.00 174.65 119.00 174.66 C 146.00 174.78 173.01 174.42 200.00 174.84 L 200.00 184.15 C 198.66 184.25 197.33 184.31 196.00 184.35 C 134.33 184.34 72.67 184.34 11.01 184.35 C 10.24 184.29 8.70 184.17 7.94 184.11 C 7.49 181.06 7.48 177.94 7.94 174.89 Z"}))))},{title:"Path",dataIndex:"img",align:"center",width:50,render:(at,Le)=>C.createElement(ki,{placement:"right",title:p("5000.6003")||"投射路径"},C.createElement("svg",{width:"20px",height:"20px",viewBox:"0 0 200 200",version:"1.1",xmlns:"http://www.w3.org/2000/svg",cursor:"pointer",pointerEvents:Le.show?"auto":"none",onClick:Be=>{hr(Le.name)}},C.createElement("g",{id:"#1296dbff"},C.createElement("path",{fill:_&&Le.name in _.current?"#1296db":"#515151",opacity:"1.00",d:" M 49.85 22.81 C 59.71 14.23 76.52 14.87 85.29 24.74 C 87.48 27.08 88.68 30.09 90.41 32.73 C 91.80 33.49 93.46 33.21 94.98 33.33 C 111.66 33.26 128.35 33.27 145.03 33.31 C 156.32 33.34 168.08 37.82 175.15 46.90 C 184.45 58.34 185.39 75.18 179.31 88.32 C 175.60 95.86 169.21 102.22 161.27 105.20 C 155.18 107.71 148.53 108.28 142.00 108.29 C 112.98 108.27 83.95 108.30 54.93 108.29 C 47.32 108.11 39.18 111.60 35.74 118.72 C 31.96 126.77 32.58 137.41 38.92 144.04 C 43.19 148.73 49.91 149.96 55.98 150.00 C 72.33 150.03 88.68 149.95 105.04 150.04 C 106.56 150.01 108.10 150.00 109.60 149.65 C 111.78 145.95 113.50 141.75 117.13 139.15 C 126.54 131.15 141.94 131.52 150.80 140.19 C 153.70 142.84 155.15 146.56 157.28 149.78 C 164.10 150.58 171.02 149.34 177.82 150.39 C 184.67 152.33 185.10 163.99 178.15 166.09 C 171.31 167.70 164.18 165.87 157.29 167.06 C 155.14 170.31 153.62 174.04 150.68 176.70 C 140.24 186.50 121.13 185.09 112.96 173.05 C 111.06 170.87 110.76 166.29 107.04 166.72 C 93.69 166.66 80.35 166.74 67.00 166.71 C 57.97 166.58 48.53 167.54 39.99 163.97 C 31.40 160.72 23.97 154.20 20.28 145.72 C 13.84 131.17 16.41 112.32 28.35 101.31 C 36.18 93.81 47.48 91.52 58.00 91.71 C 87.34 91.67 116.69 91.78 146.03 91.68 C 153.59 91.69 161.48 87.76 164.60 80.60 C 168.03 72.44 167.24 61.77 160.57 55.44 C 156.20 51.22 149.90 49.98 144.02 50.00 C 128.01 49.96 112.00 50.06 95.99 49.95 C 94.12 49.98 92.23 49.93 90.41 50.34 C 88.22 54.05 86.50 58.25 82.87 60.85 C 73.46 68.85 58.08 68.47 49.22 59.81 C 46.25 57.21 44.85 53.43 42.73 50.21 C 35.91 49.42 28.99 50.67 22.20 49.60 C 15.26 47.64 14.91 36.10 21.94 33.95 C 28.72 32.23 35.86 34.16 42.71 32.94 C 44.97 29.49 46.61 25.52 49.85 22.81 M 63.32 34.12 C 56.99 36.45 57.07 46.16 62.70 49.22 C 65.17 50.16 68.00 50.11 70.52 49.39 C 73.84 47.68 75.46 43.66 74.83 40.07 C 74.41 34.85 67.77 32.10 63.32 34.12 M 130.37 150.45 C 125.27 151.88 123.75 158.64 126.14 162.91 C 128.25 166.43 133.18 167.23 136.81 165.90 C 141.61 164.64 142.31 158.29 140.69 154.36 C 139.16 150.30 134.12 149.42 130.37 150.45 Z"}))))},{title:"Src.",dataIndex:"source",align:"center",width:50,render:(at,Le)=>{const Be=Le.type;return C.createElement(ki,{placement:"right",title:p("5000.6038",{name:Be})||'数据来源"'+Be+'"'},C.createElement("a",{href:Le.url,target:"_blank"},C.createElement("img",{src:Le.image,width:"20px",height:"20px"})))}}],Wi=at=>{for(var Le=window.location.search.substring(1),Be=Le.split("&"),tt=0;tt<Be.length;tt++){var rt=Be[tt].split("=");if(rt[0]==at)return rt[1]}return!1},Ni=(at,Le)=>{let tt=Zp(th(at,Le),Le).children;for(var rt=[],dt=0;dt<tt.length;dt++)tt[dt]["3D"]&&rt.push(tt[dt].name);return rt},Xi=()=>{const at=Object.keys(ee.current);Object.keys(ee.current).length!==0&&xa(at,ee.current,.2,0,void 0,!0)};C.useEffect(()=>{Xi()},[f]);const zi=(at,Le,Be,tt,rt,dt)=>{var vt=new fo;if(vt.setFromAxisAngle(new Ie(1,0,0),Math.PI/2),!ji.current[Le]){var ot=new u9;tt=tt||.1,ot.load(at,function(fe){fe.scale.set(sa.current,sa.current,sa.current),fe.applyQuaternion(vt),rt&&fe.translateY(rt*sa.current*.1),fe.children[0].material.transparent=!0,fe.children[0].material.opacity=tt,fe.children[0].material.depthTest=!1,fe.children[0].material.color.set(Be);let ce=fe.clone();if(Le!="Brain"){var Ue=new _i,$e=new Ie(1,0,0);Ue.set(1-2*$e.x*$e.x,-2*$e.x*$e.y,-2*$e.x*$e.z,0,-2*$e.x*$e.y,1-2*$e.y*$e.y,-2*$e.y*$e.z,0,-2*$e.x*$e.z,-2*$e.y*$e.z,1-2*$e.z*$e.z,0,0,0,0,1),ce.applyMatrix4(Ue),ce.translateX(-uo.current),ce.translateY(to.current),ce.translateZ(-qa.current),ce.name=Le,ce.myMeshType="FBX",ce.children[0].name=Le,ce.children[0].myMeshType="FBX",ma.current[Le]=ce,np.current&&Ae.current.add(ce)}fe.translateX(uo.current),fe.translateY(to.current),fe.translateZ(-qa.current),fe.name=Le,fe.myMeshType="FBX",fe.children[0].name=Le,fe.children[0].myMeshType="FBX",ji.current[Le]=fe,Ae.current.add(ji.current[Le]);var Ze=new Ie,pt=new vs().setFromObject(fe);pt.getCenter(Ze);var Pt=new Ie;pt.getSize(Pt);var Ut=Pt.x*Pt.y*Pt.z;u1.current[Le]=[Ze,Ut];for(var an=d1(Le,xe.current),wt=0;wt<an.length;wt++)if(o!=null&&o.current&&ee.current[an[wt]])if(ye.current||pe.current){fe.translateOnAxis(ee==null?void 0:ee.current[an[wt]].axis,o.current*(ee==null?void 0:ee.current[an[wt]].length));var jt=ee==null?void 0:ee.current[an[wt]].axis.clone();jt.x=jt.x*-1,ce.translateOnAxis(jt,o.current*(ee==null?void 0:ee.current[an[wt]].length))}else{var jt=ee[an[wt]].axis.clone();jt.x=jt.x*-1,ce.translateOnAxis(jt,o.current*(ee==null?void 0:ee.current[an[wt]].length)),fe.translateOnAxis(ee==null?void 0:ee.current[an[wt]].axis,o.current*(ee==null?void 0:ee.current[an[wt]].length))}ji.current[Le]=fe;let qn=Ni(Le,xe.current);for(var pr=!0,Tn=0;Tn<qn.length;Tn++)qn[Tn]in ji.current||(pr=!1);if(pr){for(var An=0,Tn=0;Tn<qn.length;Tn++){var Wr=qn[Tn];if(!ye.current)if(pe.current){let Kt=new Ie(0,0,5);ee.current[Wr]={axis:u1.current[Wr][0].clone().sub(Kt).applyAxisAngle(new Ie(1,0,0),-1*Math.PI/2).normalize(),length:Math.cbrt(u1.current[Wr][1])}}else re.current;An=An+ee.current[Wr].length}if(!(pe.current||ye.current))for(Tn=0;Tn<qn.length;Tn++)ee.current[qn[Tn]].length=ee.current[qn[Tn]].length/An*qn.length;var Qr=setInterval(function(){if(o!=null&&o.current&&ct.current<(o==null?void 0:o.current)){ct.current=ct.current+.2;let fn;ct.current>(o==null?void 0:o.current)&&(fn=(o==null?void 0:o.current)-ct.current+.2,ct.current=o.current),xa(qn,ee.current,.2,0,fn)}else ct.current=0,clearInterval(Qr)},20)}dt&&dt()})}},xa=(at,Le,Be,tt,rt,dt=!1)=>{var vt,ot;if(ye.current||pe.current)var fe=.2;else var fe=Be;for(var ce in at){var Ue=at[ce];vt=ji.current[Ue],ot=ma.current[Ue];var $e=Le[Ue].axis,Ze=$e.clone();Ze.x=Ze.x*-1;var pt=Le[Ue].length;if(dt&&o){ji.current[at[ce]].locationLength=o==null?void 0:o.current,ji.current[at[ce]].position.set(0,0,0),ji.current[at[ce]].translateX(uo.current),ji.current[at[ce]].translateY(to.current),ji.current[at[ce]].translateZ(-qa.current),ji.current[at[ce]].translateOnAxis($e,(o==null?void 0:o.current)*pt),ma.current[at[ce]].position.set(0,0,0),ma.current[at[ce]].translateX(-uo.current),ma.current[at[ce]].translateY(to.current),ma.current[at[ce]].translateZ(-qa.current),ma.current[at[ce]].locationLength=o==null?void 0:o.current,ma.current[at[ce]].translateOnAxis(Ze,(o==null?void 0:o.current)*pt);continue}switch(tt){case 0:rt?(ji.current[at[ce]].translateOnAxis($e,rt*pt),ma.current[at[ce]].translateOnAxis(Ze,rt*pt)):(ji.current[at[ce]].translateOnAxis($e,fe*pt),ma.current[at[ce]].translateOnAxis(Ze,fe*pt));break;case 1:fe<=0?(vt.translateOnAxis($e,-1*Math.sqrt(Math.abs(fe*pt))),ot.translateOnAxis(Ze,-1*Math.sqrt(Math.abs(fe*pt)))):(vt.translateOnAxis($e,Math.sqrt(fe*pt)),ot.translateOnAxis(Ze,Math.sqrt(fe*pt)));break;case 2:fe<=0?(vt.translateOnAxis($e,-1*Math.pow(fe,2)*pt),ot.translateOnAxis(Ze,-1*Math.pow(fe,2)*pt)):(vt.translateOnAxis($e,Math.pow(fe,2)*pt),ot.translateOnAxis(Ze,Math.pow(fe,2)*pt));break}}},mo=at=>{for(let Le=0;Le<at.length;Le++){const Be=at[Le],{key:tt,cname:rt}=Be;localStorage.getItem("lang")=="zh_cn"&&rt?ge.current.push({key:tt,title:rt}):ge.current.push({key:tt,title:tt}),Be.children&&mo(Be.children)}},Oa=at=>{const{value:Le}=at.target;if(Le!=""){Pe.current=!1,vB=[];const Be=ge.current.map(rt=>rt.title.toLowerCase().indexOf(Le.toLowerCase())>-1?th(rt.key,n):null).filter((rt,dt,vt)=>!!(rt&&vt.indexOf(rt)===dt));let tt=[];for(let rt in Be){let dt=Be[rt];if(dt){let vt=d1(dt,n);Le.length===1?(vt.length>2&&(vt=vt.slice(vt.length-3,vt.length)),tt.push(...vt)):tt.push(dt,...vt)}}tt.filter((rt,dt,vt)=>!!(rt&&vt.indexOf(rt)===dt)),j(tt),Z(!0),se(Le)}else j(Ee.current),se(""),Pe.current=!0},qr=(at,Le)=>(...tt)=>{clearTimeout(Y.current),Y.current=setTimeout(()=>{at(...tt)},Le)},ai=qr(Oa,50),Ta=at=>{j(at),vB=[],Z(!1)},Zt=(at,Le)=>{oe.current[at]&&oe.current[at].children[0].material.color.set(Le)},Et=C.useCallback((at,Le,Be,tt)=>{let rt=at,dt="",vt;if(s!=="swc"){if(rt=Le.node.name,dt=Le.node.path,vt=Le.node.color,rt===ie.current[0]&&S===2)return;if(x){const pt=x.current.indexOf(rt);pt>-1?x.current.splice(pt,1):ie.current.length!==0&&x.current.push(rt)}let fe=g.findIndex(pt=>pt==rt),ce=JSON.parse(JSON.stringify(g));fe>-1?ce.splice(fe,1):ce.push(rt),m(ce),ie.current=ce;let Ue=new URL(window.location.href),$e=new URLSearchParams(Ue.search);const Ze=JSON.stringify(ce);s==="fbx"?$e.set("regionsChecked",Ze):s==="vessel"&&$e.set("vesselsChecked",Ze),Ue.search=$e.toString(),window.history.replaceState({},"",Ue)}const ot=document.getElementById("spinner");switch(s){case"vessel":{rt=="Unnamed vein"&&(rt="Unnamed_Vein");let fe=dt+rt+".js";Le.checked?(F0=!0,ot&&(ot.style.display="block"),lr(fe,8,vt,rt,function(){ot&&(ot.style.display="none")})):(F0=!1,ot&&(ot.style.display="none"),Vn(rt));break}case"swc":{if(Be){if(tt){let fe=Le.map((ce,Ue)=>new Promise(($e,Ze)=>{if(Le)if(oe.current[ce.name])$e("");else{if(m(pt=>[...pt,ce.name]),Ue===Le.length-1){let pt=new URL(window.location.href),Pt=new URLSearchParams(pt.search),Ut=Le.map(jt=>jt.name);ie.current.push(...Ut);const an=[...g,...Ut],wt=JSON.stringify(an);Pt.set("neuronsChecked",wt),pt.search=Pt.toString(),window.history.replaceState({},"",pt)}ot&&(ot.style.display="block"),jr(ce.path,6,ce.name,ce.color,function(){Zt(ce.name,"#045404"),$e("")})}else{F0=!1,kr(ce.name);let pt=new URL(window.location.href),Pt=new URLSearchParams(pt.search);const an=JSON.stringify([]);Pt.set("neuronsChecked",an),pt.search=Pt.toString(),window.history.replaceState({},"",pt),$e("")}}));Promise.all(fe).then(()=>{ot&&(ot.style.display="none")})}else if(!oe.current[at.name]){ie.current.push(at.name),ot&&(ot.style.display="block"),m($e=>[...$e,at.name]);let fe=new URL(window.location.href),ce=new URLSearchParams(fe.search);const Ue=JSON.stringify(ie.current);ce.set("neuronsChecked",Ue),fe.search=ce.toString(),window.history.replaceState({},"",fe),jr(at.path,6,at.name,at.color,function(){Zt(at.name,"#045404"),ot&&(ot.style.display="none"),setTimeout(()=>{z&&z("欢迎来和我一起探索更多<strong>"+at.name+"</strong>脑区相关内容")},5e3)})}}else if(tt)Le.forEach((fe,ce)=>{if(Le){if(m(Ue=>Ue.filter($e=>$e!==fe.name)),ie.current=ie.current.filter(Ue=>Ue!==fe.name),kr(fe.name),ce===Le.length-1){let Ue=new URL(window.location.href),$e=new URLSearchParams(Ue.search);const Ze=JSON.stringify(ie.current);$e.set("neuronsChecked",Ze),Ue.search=$e.toString(),window.history.replaceState({},"",Ue)}if(_&&fe.name in _.current){de(Ue=>Ue.filter($e=>$e!==fe.name));for(let Ue in _.current[fe.name])Ae.current.remove(_.current[fe.name][Ue]);delete _.current[fe.name]}}});else{if(_&&at.name in _.current){de($e=>$e.filter(Ze=>Ze!==at.name));for(let $e in _.current[at.name])Ae.current.remove(_.current[at.name][$e]);delete _.current[at.name]}kr(at.name),ie.current=ie.current.filter($e=>$e!==at.name),m($e=>$e.filter(Ze=>Ze!==at.name));let fe=new URL(window.location.href),ce=new URLSearchParams(fe.search);const Ue=JSON.stringify(ie.current);ce.set("neuronsChecked",Ue),fe.search=ce.toString(),window.history.replaceState({},"",fe)}break}case"soma":{XX(rt,Dr).forEach(ce=>{Le.checked?(F0=!0,oe.current[rt]||(h!=null&&h.current?kn(dt,ce.color,rt):kn(B+"/data/json/"+rt,ce.color,rt))):(F0=!1,kr(rt))});break}case"fbx":{let fe=parseInt(Le.node.z),ce=B+"/data/FBX/"+yr(rt)+".FBX";Le.checked?(ot&&(ot.style.display="block"),Qu(ce,rt,vt,.8,fe,"FBX",function(){ot&&(ot.style.display="none"),setTimeout(()=>{z&&z("欢迎来和我一起探索更多 <strong>"+rt+"</strong> 脑区相关内容")},5e3)})):on(rt)}}},[g]),mn=()=>{if(xe.current.length>0&&s!=="swc"&&g.length>0&&(s==="fbx"||s==="vessel"))return new Promise((at,Le)=>{const Be=document.getElementById("spinner");let tt=0;for(let rt=0;rt<g.length;rt++){let dt=Zp(g[rt],xe.current);if(dt){let vt={node:{...dt,checked:!0}};if(s==="fbx"){let ot=B+"/data/FBX/"+yr(dt.key)+".FBX";Qu(ot,dt.key,dt.color,.8,dt.z,"FBX",function(){Be&&Wn.current===!0&&(Be.style.display="none"),tt+=1,tt===g.length&&at("")})}else if(s==="vessel"){let ot=dt.name,fe=vt.node.path;ot=="Unnamed vein"&&(ot="Unnamed_Vein");let ce=fe+ot+".js";F0=!0,Be&&(Be.style.display="block"),lr(ce,8,dt.color,ot,function(){Be&&Wn.current===!0&&(Be.style.display="none"),tt+=1,tt===g.length&&at("")})}}}}).then(at=>{if(Whe){let Le=JSON.parse(Whe);for(let Be=0;Be<Le.length;Be++){let tt=Zp(Le[Be],xe.current);tt&&tr({stopPropagation:()=>{}},tt.key,`${tt.key}`,tt.color,tt.z)}}})},xt=()=>{if(gB&&JSON.parse(gB).length!=0){Wn.current=!1;const at=document.getElementById("spinner"),Le=JSON.parse(gB);let Be=0;at&&(at.style.display="block");for(let tt=0;tt<Le.length;tt++){tt!==Le.length-1&&at&&(at.style.display="block");let rt=n.find(dt=>dt.name===Le[tt]);rt&&($t.current[Le[tt]]?rt.color=$t.current[Le[tt]].replace("!","#"):rt.color="#045404",jr(rt.path,6,rt.name,rt.color,function(){if(Zt(rt.name,rt.color),Xhe){const dt=JSON.parse(Xhe);for(let vt=0;vt<dt.length;vt++)rt.name==dt[vt]&&hr(rt.name)}Be++,Be===Le.length&&at&&(at.style.display="none",Wn.current=!0)}))}}};C.useEffect(()=>{!Xt.current&&n&&n.length>0&&(xt(),mn(),Xt.current=!0)},[n]);const on=(at,Le=!1)=>{ji.current[at]&&(Ae.current.remove(ji.current[at]),ji.current[at].children[0].geometry.dispose(),Le&&delete ji.current[at]),ma.current[at]&&(Ae.current.remove(ma.current[at]),ma.current[at].children[0].geometry.dispose(),Le&&delete ma.current[at]),ee.current[at]&&Le&&delete ee.current[at]},or=(at,Le)=>{const Be={},tt={};for(const rt in at){const dt=at[rt];for(const vt of dt)if(vt.name==Le){if(vt.color==="#1771FF"){Be[rt]={point:vt.point,color:vt.color,type:vt.type};break}if(vt.color==="#A7B5A1"){Be[rt]={point:vt.point,color:vt.color,type:vt.type};break}Be[rt]={point:vt.point,color:vt.color,type:vt.type}}}for(const rt in at){const dt=at[rt];for(const vt of dt)if(vt.name==Le){if(vt.type=="cell"){tt[rt]={point:vt.point,color:vt.color,type:vt.type};break}vt.type==="end"&&(vt.point[0]<570?tt[rt]={point:vt.point,color:vt.color,type:vt.type}:tt[rt+"_111"]={point:vt.point,color:vt.color,type:vt.type}),!tt[rt]&&!tt[rt+"_111"]&&vt.point[0]<570&&(tt[rt]={point:vt.point,color:vt.color,type:vt.type})}}return[Be,tt]},Yr=(at,Le)=>{if(Object.keys(at).length>0){const Be=Ai.current.position;let tt=Ae.current.getObjectByName("DR-anterior"),rt=0;tt&&(rt=Be.distanceTo(tt.position));for(let dt in at){let{point:vt,color:ot,type:fe}=at[dt];vPt.load(B+"/fonts/helvetiker_bold.typeface.json",function(ce){const Ue=new jX(dt.replace("_111",""),{font:ce,size:.3,height:.01}),$e=new Rl({color:ot,specular:0,shininess:0}),Ze=new rr(Ue,$e),pt=rt<6?.2:rt<9?.3:.5;Ze.scale.set(pt,pt,pt),Ze.position.set(vt[0]*.01,vt[1]*.01,vt[2]*.01),Ze.name="lineNameMesh",Ze.userData.name=dt.replace("_111",""),Ze.userData.wholeName=`${Le}-${dt.replace("_111","")}`,Ze.userData.initColor=ot,Ze.userData.type=fe,Ze.translateY(qa.current),Ze.translateZ(to.current),Ze.translateX(uo.current),Ue.center(),_!=null&&_.current&&_.current[Le].push(Ze),Ae.current.add(Ze)})}}else setTimeout(()=>{const[Be,tt]=or(st.current,Le);Yr(tt,Le)},100)},hr=(at,Le,Be)=>{let tt=new URL(window.location.href),rt=new URLSearchParams(tt.search),dt,vt;if(Be?[dt,vt]=or(Be,at):[dt,vt]=or(st.current,at),_!=null&&_.current){const ot=document.getElementById("spinner");if(at in _.current){for(let ce in _.current[at])de(Ue=>Ue.filter($e=>$e!==at)),Ae.current.remove(_.current[at][ce]);const fe=be.filter(ce=>ce!==at);rt.set("neuronsText",JSON.stringify(fe)),delete _.current[at]}else{if(_.current[at]=[],de(fe=>[...fe,at]),rt.set("neuronsText",JSON.stringify([...be,at])),!(at in oe.current)){m(Ue=>[...Ue,at]),ie.current=[...ie.current,at];const fe=JSON.stringify(ie.current);rt.set("neuronsChecked",fe);let ce=Zi(Dr,at);if(ot&&(ot.style.display="block"),!oe.current[at]){let Ue=ce.color;ce.path&&Ue&&jr(ce.path,6,at,Ue,function(){Ue&&Zt(at,Ue),ot&&(ot.style.display="none")})}}Yr(vt,at)}tt.search=rt.toString(),window.history.replaceState({},"",tt)}},kr=at=>{oe.current[at]&&(Ae.current.remove(oe.current[at]),oe.current[at]=null,delete oe.current[at]);const Le=Ae.current.getObjectByName(`swcPointGroup${at}`);Le&&Ae.current.remove(Le)},Pn=at=>at.map(Le=>({value:Le.name+" "+Le.fullname,title:C.createElement(ki,{placement:"right",title:Le.fullname},C.createElement("div",{style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",lineHeight:"2.4"}},Le.name," ",Le.fullname)),children:Le.children?Pn(Le.children):void 0})),Vn=at=>{Ae.current.remove(rm),Ae.current.remove(fu),i.current[at]&&(Ae.current.remove(i.current[at].contentobj),i.current[at].contentobj.traverse(function(Le){Le.type=="Mesh"&&(Le.geometry.dispose(),Le.geometry=null)}),i.current[at].contentmaterial.dispose(),i.current[at].contentmaterial=null,i.current[at]=null,delete i.current[at])},lr=(at,Le,Be,tt,rt)=>{i.current[tt]?(Ae.current.add(i.current[tt].obj),rt&&rt()):fetch(at).then(dt=>dt.json()).then(dt=>{var vt=new Fu,ot=new s9({color:Be}),fe=!1;dt.line.length>1e4&&(fe=!0);let ce=1;for(let $e=0;$e<dt.line.length;$e++)dt.line[$e].layer>ce&&(ce=dt.line[$e].layer);ce++;for(let $e=0;$e<dt.line.length;$e++){let Ze=(ce-dt.line[$e].layer)*20/ce,pt=0,Pt=[];for(let Tn=dt.line[$e].start;Tn<=dt.line[$e].end;Tn++){let An=dt.position[Tn].x,Wr=dt.position[Tn].y,Qr=dt.position[Tn].z;pt++,Pt.push(new Ie(An,Wr,Qr))}let Ut=new FX(Pt);pt=fe?Math.ceil(pt/5):pt;const an=new zT,wt=new rr(new o9(Ut,pt,Ze,Le,!1),ot);wt.scale.set(1,1,1),an.addLevel(wt,0);const jt=80,qn=[Pt[0]];for(let Tn=1;Tn<Pt.length;Tn++){const An=qn[qn.length-1],Wr=Pt[Tn];(An.distanceTo(Wr)>jt||Tn===Pt.length-1)&&qn.push(Wr)}const pr=new Pa(new ea().setFromPoints(qn),new Af({color:Be}));pr.scale.set(1,1,1),an.addLevel(pr,10),an.name=tt,an.myMeshType="Vessel",an.autoUpdate=!1,vt.add(an)}vt.scale.set(sa.current*.1,sa.current*.1,sa.current*.1),vt.translateX(uo.current),vt.translateY(qa.current),vt.translateZ(to.current),vt.name=tt,vt.myMeshType="Vessel",Ae.current.add(vt);let Ue={contentobj:vt,contentmaterial:ot};i.current[tt]=Ue,rt&&rt()})},rn=at=>{at=at.replace("#","");const Le=parseInt(at.slice(0,2),16),Be=parseInt(at.slice(2,4),16),tt=parseInt(at.slice(4,6),16),rt=Le/255,dt=Be/255,vt=tt/255;return new Ie(rt,dt,vt)},kn=(at,Le,Be,tt)=>{fetch(at).then(rt=>rt.json()).then(rt=>{let dt=new Yf,vt=new ea,ot=[];for(let ce=0;ce<rt.position.length;ce++){let Ue=rt.position[ce].split(","),$e=Ue[0],Ze=Ue[1],pt=Ue[2];ot.push($e*sa.current*.099,Ze*sa.current*.099,pt*sa.current*.099)}vt.setAttribute("position",new Ra(ot,3)),rn(Le);let fe=new r9({size:ve.current/100,color:new li(Le)});dt=new Yf(vt,fe),dt.translateX(uo.current),dt.translateY(qa.current),dt.translateZ(to.current-.45),dt.name=Be,oe.current[Be]=dt,Ae.current.add(dt)}),tt&&tt()},nr=at=>{ut.current=!0;let Le=new URL(window.location.href),Be=new URLSearchParams(Le.search);Be.set("neuronsProjects",JSON.stringify(at)),Le.search=Be.toString(),window.history.replaceState({},"",Le),at!=""?se(at):(se(at),j(Ee.current))},br=qr(nr,50),Ur=at=>{ut.current=!0;let Le=new URL(window.location.href),Be=new URLSearchParams(Le.search);Be.set("neuronsSomaLocates",JSON.stringify(at)),Le.search=Be.toString(),window.history.replaceState({},"",Le),at!=""?ne(at):(ne(at),j(Ee.current))},ni=qr(Ur,50),Jr=()=>{let at=[ji.current,ma.current,ee.current];for(let rt of at)for(let dt in rt)dt!="Brain"&&on(dt,!0);de([]),Object.keys(oe.current).forEach(rt=>{for(let dt in _==null?void 0:_.current[rt])Ae.current.remove(_==null?void 0:_.current[rt][dt]);kr(rt)}),Object.keys(i.current).forEach(rt=>{Vn(rt)}),m([]),_&&(_.current={}),ie.current=[];let Le=new URL(window.location.href),Be=new URLSearchParams(Le.search);const tt=JSON.stringify(ie.current);s==="fbx"?Be.set("regionsChecked",tt):s==="vessel"?Be.set("vesselsChecked",tt):s==="swc"&&(Be.set("neuronsChecked",tt),Be.set("neuronsText",tt)),Le.search=Be.toString(),window.history.replaceState({},"",Le)},gi=(at,Le)=>{let Be=0;for(const tt of at.toLowerCase())if(tt===Le[Be]&&(Be++,Be===Le.length))return!0;return!1},ja=at=>{if(at){const Le=at.toLowerCase(),Be=De.current.map(tt=>{const rt=tt.name&&tt.name.toLowerCase()===Le,dt=tt.fullname&&gi(tt.fullname,Le);return{...tt,matchPriority:rt?1:dt?2:3}}).filter(tt=>tt.matchPriority<3).sort((tt,rt)=>tt.matchPriority-rt.matchPriority).map(tt=>({value:`${tt.name} ${tt.fullname}`,label:`${tt.name} ${tt.fullname}`}));Me(Be)}else Me([])};C.useEffect(()=>{ut.current&&(q?it.current&&it.current.focus():Ne.current&&Ne.current.focus())},[q]),C.useEffect(()=>{ut.current&&(te?Ke.current&&Ke.current.focus():ft.current&&ft.current.focus())},[te]);const Zi=(at,Le)=>{let Be=null,tt=null;for(let rt=0;rt<at.length;rt++)if(at[rt].name==Le)return Be=at[rt].path,tt=at[rt].color,{path:Be,color:tt};return{path:Be,color:tt}},qo={emptyText:C.createElement(cm,{description:C.createElement("div",{style:{color:"#ccc"}},"Neurons that meet the filter criteria entered in the input boxes above will be displayed here.")})},io={selectedRowKeys:g,onSelectAll:(at,Le,Be)=>{Et(Le,Be,at,!0)},onSelect:(at,Le,Be)=>{Et(at,Be,Le,!1)},getCheckboxProps:at=>({name:at.name})},za=at=>{let Le=new URL(window.location.href),Be=new URLSearchParams(Le.search);const tt=JSON.stringify(at);Be.set("neuronsFilterInfo",tt),Le.search=Be.toString(),window.history.replaceState({},"",Le),ht(at)},zn=at=>{At(at)};return C.createElement("div",{ref:c,style:{transition:"all ease-in 0.5s"}},s==="swc"?C.createElement(C.Fragment,null,q?C.createElement(O4,{ref:it,style:{width:"100%",marginBottom:8},options:ue,placeholder:p("5000.5040")||"Input the region that soma locates",onSearch:ja,onChange:ni,value:q}):C.createElement(nb,{ref:Ne,showSearch:!0,style:{width:"100%",marginBottom:8},value:q,dropdownStyle:{maxHeight:400,overflow:"hidden"},placeholder:p("5000.5040")||"Input the region that soma locates",allowClear:!0,treeDefaultExpandAll:!1,onChange:Ur,onSearch:Ur,treeData:Pn(r)}),te?C.createElement(O4,{ref:Ke,style:{width:"100%",marginBottom:8},options:ue,placeholder:p("5000.5041")||"Input the region that neuron projects",onSearch:ja,onChange:br,value:te}):C.createElement(nb,{showSearch:!0,ref:ft,style:{width:"100%"},value:te,dropdownStyle:{maxHeight:400,overflow:"hidden",marginBottom:8},placeholder:p("5000.5041")||"Input the region that neuron projects",allowClear:!0,treeDefaultExpandAll:!1,onChange:nr,onSearch:nr,treeData:Pn(r)}),H&&C.createElement(C.Fragment,null,C.createElement(nb,{treeData:ze,value:ke,onChange:za,treeCheckable:!0,placeholder:"Filter by data information",style:{width:"100%",marginTop:8}}),C.createElement(Ho,{style:{marginTop:"5px"}},C.createElement(_1,{onChange:at=>{In(at.target.checked)}},p("7000.7025")||"只展示可用神经元"),C.createElement(Ho,{style:{fontStyle:"italic",marginTop:"5px"}},p("7000.7026")||"点击Color按钮,修改神经元颜色;点击Ana.按钮,显示神经元投射路径分析结果;点击Path按钮,在主界面显示神经元经过的脑结构;Src按钮展示了神经元数据的来源"))),C.createElement("div",null,C.createElement(Us,{className:"Echart",open:et,onOk:()=>{bt(!1)},onCancel:()=>{bt(!1)},width:"auto",footer:null},C.createElement(Om,{activeKey:Ge,onChange:zn},C.createElement(pB,{tab:p("5000.7009")||"神经元末梢分布",key:"1"},Gt&&C.createElement(Ri,null,"Isocortex"),C.createElement(yl,{ref:Nt,className:"Isocortex",Name:"Isocortex",t:p,data_change:It,data_c:st.current,col:["RSPv_","FRP_","MOp_","MOs_","SSp_","SSp-n_","SSp-bfd_","SSp-ll_","SSp-m_","SSp-ul_","SSp-tr_","SSp-un_","SSs_","GU_","VISC_","AUDd_","AUDp_","AUDpo_","AUDv_","VISal_","VISam_","VISl_","VISp_","VISpl_","VISpm_","VISli_","VISpor_","ACAd_","ACAv_","PL_","ILA_","ORB_","AId_","AIp_","AIv_","RSPagl_","RSPd_","PTLp_","TEa_","PERI_","ECT_"],row:["1","2/3","5","6a","6b"]}),Lt&&C.createElement(Ri,null,"HPF"),C.createElement(yl,{ref:xr[0],className:"HPF",Name:"HPF",t:p,data_change:It,data_c:st.current,col:["CA1_","CA1_dd","CA1_d","CA1_i","CA1_v","CA1_vv","CA2_dd","CA2_d","CA2_i","CA2_v","CA2_vv","CA3_dd","CA3_d","CA3_i","CA3_v","CA3_vv"],row:["so","sp","slu","sr","slm"]}),C.createElement(yl,{ref:xr[1],className:"HPF",Name:"HPF",t:p,data_change:It,data_c:st.current,col:["DG_d","DG_i","DG_V"],row:["mo","sg","po"]}),C.createElement(yl,{ref:xr[2],className:"HPF",Name:"HPF",t:p,data_change:It,data_c:st.current,col:["SUBd_1","SUBv_1","SUBd_2","SUBv_2","SUBd_3","SUBv_3","SUBd_4","SUBv_4","SUBd_","SUBv_"],row:["sp","sr","m"]}),dn&&C.createElement(Ri,null,"CNU"),C.createElement(yl,{ref:Ir,className:"CNU",Name:"CNU",t:p,data_change:It,data_c:st.current,col:["CP_","ACBv_","ACBd_","FS_","OTisl_","OTislm_","OT1","OT2","OT3","LSc","LSr_","SF","SH","AAA","BA","CEAc","CEAm","IA","MEAad","MEAav","MEApd","MEApv","GPe","GPi","SI","MA","NDB","TRS","PALc","BSTse","BAC"],row:["_"]}),cr&&C.createElement(Ri,null,"OLF"),C.createElement(yl,{ref:Zn[0],className:"OLF",Name:"OLF",t:p,data_change:It,data_c:st.current,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["gr","mi","ipl","opl","gl"]}),C.createElement(yl,{ref:Zn[1],className:"OLF",Name:"OLF",t:p,data_change:It,data_c:st.current,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["1","2","3","4","5","6a","2/3"]}),Mr&&C.createElement(Ri,null,"TH"),C.createElement(yl,{ref:Ft,className:"TH",Name:"TH",t:p,data_change:It,data_c:st.current,col:["VAL","VM","VPL","VPLpc","VPM","VPMpc","PoT","SPFm","SPFp","SPA","PP","MGd","MGv","MGm","LGdsh","LGdco","LGdip","LP","PO","POL","SGN","Eth","REth","AV","AMd","AMv","AD","IAM","IAD","LD","IMD","MDc","MDl","MDm","SMT","PR","PVT","PT","RE","Xi","RH","CM","PCN","CL","PF","PIL","RT","IGL","IntG","LGvl","LGvm","SubG","MH","LH","PIN"],row:["_"]}),Fn&&C.createElement(Ri,null,"HY"),C.createElement(yl,{ref:kt,className:"HY",Name:"HY",t:p,data_change:It,data_c:st.current,col:["SO","NC","PVHam","PVHmm","PVHpmm","PVHpml","PVHap","PVHmpd","PVHpv","PVa","PVi","ARH","ADP","AHA","AVP","DMHa","DMHp","DMHv","MEPO","MPO","OV","PD","PS","PSCH","PVp","PVpo","SBPV","SCH","SFO","VMPO","VLPO","AVPV","AHNa","AHNc","AHNd","AHNp","LM","MMme","MMl","MMm","MMp","MMd","SUMm","SUMl","TMd","TMv","MPNc","MPNl","MPNm","PMd","PMv","PVHdp","PVHf","PVHlp","PVHmpv","VMHa","VMHc","VMHdm","VMHvl","PH","LHA","LPO","PST","PSTN","RCH","PeF","STN","TU","A13","FF","ZIr","ZIc","ZId","ZIv","ME"],row:["_"]}),Bn&&C.createElement(Ri,null,"MB"),C.createElement(yl,{ref:zt,className:"MB",Name:"MB",t:p,data_change:It,data_c:st.current,col:["SCop","SCsg","SCzo","ICc","ICd","ICe","NB","SAG","PBG","MEV","SCO","SNr","VTA","RR","MRNm","MRNmg","MRNp","SCdg","SCdw","SCiw","SCig-a","SCig-b","SCig-c","PRC","INC","ND","Su3","PAGdm","PAGl","PAGvl","PAGdl","PAGvm","APN","MPT","NOT","NPC","OP","PPT","RPF","InCo","CUN","RN","III","MA3","EW","IV","PA4","VTN","AT","LT","DT","MT","SNl","SNc","PPN","IF","IPR","IPC","IPA","IPL","IPI","IPDM","IPDL","IPRL","RL","CLI","DR"],row:["_"]}),gn&&C.createElement(Ri,null,"HB"),C.createElement(yl,{ref:Vt,className:"HB",Name:"HB",t:p,data_change:It,data_c:st.current,col:["NLLd","NLLh","NLLv","PSV","KF","PBlc","PBld","PBle","PBls","PBlv","PBme","PBmm","PBmv","POR","SOCm","SOCl","B","DTN","LTN","PDTg","PCG","PG","PRNc","PRNv","SG","SSN","SUT","TRN","V","P5","Acs5","PC5","I5","CSl","CSm","LC","LDT","NI","PRNr","RPO","SLC","SLD","AP","CNlam","CNspg","DCO","VCO","CU","GR","ECU","NTB","NTSce","NTSco","NTSge","NTSl","NTSm","SPVC","SPVI","SPVOcdm","SPVOmdmd","SPVOmdmv","SPVOrdm","SPVOvl","Pa5","z","VI","ACVI","VII","ACVII","EV","AMBd","AMBv","DMX","ECO","GRN","ICB","IO","LRNm","LRNp","ISN","LIN","IRN","MARN","MDRNd","MDRNv","PARN","PAS","PGRNd","PGRNl","NIS","NR","PRP","PMR","PPYd","PPYs","LAV","MV","SPIV","SUV","XII","x","y","RM","RPA","RO"],row:["_"]}),xn&&C.createElement(Ri,null,"CB"),C.createElement(yl,{ref:nn[0],className:"CB",Name:"CB",t:p,data_change:It,data_c:st.current,col:["LING_","LING_","CENT2_","CENT2_","CENT3_","CENT3_","CUL4/5_","CUL4/5_","DEC_","DEC_","FOTU_","FOTU_","PYR_","PYR_","UVU_","UVU_","NOD_","NOD_","SIM_","SIM_","ANcr1_","ANcr1_","ANcr2_","ANcr2_","PRM_","PRM_","COPY_","COPY_","PFL_","PFL_","FL_","FL_","IP","DN"],row:["gr","mo"]}),C.createElement(yl,{ref:nn[1],className:"CB",Name:"CB",t:p,data_change:It,data_c:st.current,col:["FN","IP","DN","VeCB"],row:["_"]})),C.createElement(pB,{tab:p("5000.7011")||"神经元投射模式",key:"2"},r?C.createElement(xAe,{data:Rt,fbxTreeDatas:r}):null),C.createElement(pB,{tab:p("5000.7012")||"投射长度分布",key:"3"},Gt&&C.createElement(Ri,null,"Isocortex"),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["RSPv_","FRP_","MOp_","MOs_","SSp_","SSp-n_","SSp-bfd_","SSp-ll_","SSp-m_","SSp-ul_","SSp-tr_","SSp-un_","SSs_","GU_","VISC_","AUDd_","AUDp_","AUDpo_","AUDv_","VISal_","VISam_","VISl_","VISp_","VISpl_","VISpm_","VISli_","VISpor_","ACAd_","ACAv_","PL_","ILA_","ORB_","AId_","AIp_","AIv_","RSPagl_","RSPd_","PTLp_","TEa_","PERI_","ECT_"],row:["1","2/3","5","6a","6b"]}),Lt&&C.createElement(Ri,null,"HPF"),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["CA1_d","CA1_i","CA1_v","CA1_","CA3_dd","CA3_d","CA3_i","CA3_v","CA3_vv","CA2_"],row:["so","sp","slu","sr","slm"]}),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["DG_d","DG_i","DG_V"],row:["mo","sg","po"]}),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["SUBd_1","SUBv_1","SUBd_2","SUBv_2","SUBd_3","SUBv_3","SUBd_4","SUBv_4","SUBd_","SUBv_"],row:["sp","sr","m"]}),dn&&C.createElement(Ri,null,"CNU"),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["CP_","ACBv_","ACBd_","FS_","OTisl_","OTislm_","OT1","OT2","OT3","LSc","LSr_","SF","SH","AAA","BA","CEAc","CEAm","IA","MEAad","MEAav","MEApd","MEApv","GPe","GPi","SI","MA","NDB","TRS","PALc","BSTse","BAC"],row:["_"]}),cr&&C.createElement(Ri,null,"OLF"),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["gr","mi","ipl","opl","gl"]}),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["1","2","3","4","5","6a","2/3"]}),Mr&&C.createElement(Ri,null,"TH"),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["VAL","VM","VPL","VPLpc","VPM","VPMpc","PoT","SPFm","SPFp","SPA","PP","MGd","MGv","MGm","LGdsh","LGdco","LGdip","LP","PO","POL","SGN","Eth","REth","AV","AMd","AMv","AD","IAM","IAD","LD","IMD","MDc","MDl","MDm","SMT","PR","PVT","PT","RE","Xi","RH","CM","PCN","CL","PF","PIL","RT","IGL","IntG","LGvl","LGvm","SubG","MH","LH","PIN"],row:["_"]}),Fn&&C.createElement(Ri,null,"HY"),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["SO","NC","PVHam","PVHmm","PVHpmm","PVHpml","PVHap","PVHmpd","PVHpv","PVa","PVi","ARH","ADP","AHA","AVP","DMHa","DMHp","DMHv","MEPO","MPO","OV","PD","PS","PSCH","PVp","PVpo","SBPV","SCH","SFO","VMPO","VLPO","AVPV","AHNa","AHNc","AHNd","AHNp","LM","MMme","MMl","MMm","MMp","MMd","SUMm","SUMl","TMd","TMv","MPNc","MPNl","MPNm","PMd","PMv","PVHdp","PVHf","PVHlp","PVHmpv","VMHa","VMHc","VMHdm","VMHvl","PH","LHA","LPO","PST","PSTN","RCH","PeF","STN","TU","A13","FF","ZIr","ZIc","ZId","ZIv","ME"],row:["_"]}),Bn&&C.createElement(Ri,null,"MB"),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["SCop","SCsg","SCzo","ICc","ICd","ICe","NB","SAG","PBG","MEV","SCO","SNr","VTA","RR","MRNm","MRNmg","MRNp","SCdg","SCdw","SCiw","SCig-a","SCig-b","SCig-c","PRC","INC","ND","Su3","PAGdm","PAGl","PAGvl","PAGdl","PAGvm","APN","MPT","NOT","NPC","OP","PPT","RPF","InCo","CUN","RN","III","MA3","EW","IV","PA4","VTN","AT","LT","DT","MT","SNl","SNc","PPN","IF","IPR","IPC","IPA","IPL","IPI","IPDM","IPDL","IPRL","RL","CLI","DR"],row:["_"]}),gn&&C.createElement(Ri,null,"HB"),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["NLLd","NLLh","NLLv","PSV","KF","PBlc","PBld","PBle","PBls","PBlv","PBme","PBmm","PBmv","POR","SOCm","SOCl","B","DTN","LTN","PDTg","PCG","PG","PRNc","PRNv","SG","SSN","SUT","TRN","V","P5","Acs5","PC5","I5","CSl","CSm","LC","LDT","NI","PRNr","RPO","SLC","SLD","AP","CNlam","CNspg","DCO","VCO","CU","GR","ECU","NTB","NTSce","NTSco","NTSge","NTSl","NTSm","SPVC","SPVI","SPVOcdm","SPVOmdmd","SPVOmdmv","SPVOrdm","SPVOvl","Pa5","z","VI","ACVI","VII","ACVII","EV","AMBd","AMBv","DMX","ECO","GRN","ICB","IO","LRNm","LRNp","ISN","LIN","IRN","MARN","MDRNd","MDRNv","PARN","PAS","PGRNd","PGRNl","NIS","NR","PRP","PMR","PPYd","PPYs","LAV","MV","SPIV","SUV","XII","x","y","RM","RPA","RO"],row:["_"]}),xn&&C.createElement(Ri,null,"CB"),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["LING_","LING_","CENT2_","CENT2_","CENT3_","CENT3_","CUL4/5_","CUL4/5_","DEC_","DEC_","FOTU_","FOTU_","PYR_","PYR_","UVU_","UVU_","NOD_","NOD_","SIM_","SIM_","ANcr1_","ANcr1_","ANcr2_","ANcr2_","PRM_","PRM_","COPY_","COPY_","PFL_","PFL_","FL_","FL_","IP","DN"],row:["gr","mo"]}),C.createElement(bl,{t:p,data_change:It,data_c:Rt,col:["FN","IP","DN","VeCB"],row:["_"]})))),C.createElement(ZO,{className:"SwcTable",rowSelection:io,columns:$i,dataSource:Dr,locale:qo}))):C.createElement(C.Fragment,null,C.createElement(pPt,{style:{marginBottom:8},placeholder:"Search",onChange:ai,onKeyPress:at=>{at.stopPropagation()}}),C.createElement(ww,{showLine:!0,onExpand:Ta,defaultExpandParent:!0,expandedKeys:V,onCheck:Et,checkable:!0,selectable:!1,treeData:Dr,checkedKeys:g,checkStrictly:!0,autoExpandParent:W,style:{paddingLeft:"2px"}})))});let yPt=new URL(window.location.href),bPt=new URLSearchParams(yPt.search),Qhe=bPt.get("brainContourOpacity");const xPt=t=>{const{regionData:e}=t,[n,r]=C.useState(!1);return C.useEffect(()=>{let i=Qhe?JSON.parse(Qhe):.3;z0({filepath:e+"/data/FBX/outline.FBX",index:"Brain",color:"0xcccccc",opacity:i,offsetZ:0,R:1,callback:function(){r(!1)}})},[]),C.createElement("div",{id:"spinner",style:{position:"absolute",zIndex:999,left:0,top:0,width:"100%",height:"100%",display:`${n?"block":"none"}`,opacity:.7,backgroundColor:"#ffffff"}},C.createElement("div",{style:{position:"absolute",zIndex:999,left:"50%",top:"50%",fontWeight:"bold",textAlign:"center"}},C.createElement(FO,{spinning:!0,size:"large"}),C.createElement("br",null),"Loading....wait..."))};(function(t){if(t.TextEncoder&&t.TextDecoder)return!1;function e(r="utf-8"){if(r!=="utf-8")throw new RangeError(`Failed to construct 'TextEncoder': The encoding label provided ('${r}') is invalid.`)}Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(r,i={stream:!1}){if(i.stream)throw new Error("Failed to encode: the 'stream' option is unsupported.");let a=0;const o=r.length;let s=0,c=Math.max(32,o+(o>>1)+7),u=new Uint8Array(c>>3<<3);for(;a<o;){let d=r.charCodeAt(a++);if(d>=55296&&d<=56319){if(a<o){const f=r.charCodeAt(a);(f&64512)===56320&&(++a,d=((d&1023)<<10)+(f&1023)+65536)}if(d>=55296&&d<=56319)continue}if(s+4>u.length){c+=8,c*=1+a/r.length*2,c=c>>3<<3;const f=new Uint8Array(c);f.set(u),u=f}if(d&4294967168)if(!(d&4294965248))u[s++]=d>>6&31|192;else if(!(d&4294901760))u[s++]=d>>12&15|224,u[s++]=d>>6&63|128;else if(!(d&4292870144))u[s++]=d>>18&7|240,u[s++]=d>>12&63|128,u[s++]=d>>6&63|128;else continue;else{u[s++]=d;continue}u[s++]=d&63|128}return u.slice(0,s)};function n(r="utf-8",i={fatal:!1}){if(r!=="utf-8")throw new RangeError(`Failed to construct 'TextDecoder': The encoding label provided ('${r}') is invalid.`);if(i.fatal)throw new Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(r,i={stream:!1}){if(i.stream)throw new Error("Failed to decode: the 'stream' option is unsupported.");const a=new Uint8Array(r);let o=0;const s=a.length,c=[];for(;o<s;){const u=a[o++];if(u===0)break;if(!(u&128))c.push(u);else if((u&224)===192){const d=a[o++]&63;c.push((u&31)<<6|d)}else if((u&240)===224){const d=a[o++]&63,f=a[o++]&63;c.push((u&31)<<12|d<<6|f)}else if((u&248)===240){const d=a[o++]&63,f=a[o++]&63,h=a[o++]&63;let p=(u&7)<<18|d<<12|f<<6|h;p>65535&&(p-=65536,c.push(p>>>10&1023|55296),p=56320|p&1023),c.push(p)}}return String.fromCharCode.apply(null,c)},t.TextEncoder=e,t.TextDecoder=n})(typeof window<"u"?window:typeof self<"u"?self:globalThis);function epe(t,e="utf8"){return new TextDecoder(e).decode(t)}const CPt=new TextEncoder;function SPt(t){return CPt.encode(t)}const wPt=1024*8,EPt=(()=>{const t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),mB={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class Q9{constructor(e=wPt,n={}){let r=!1;typeof e=="number"?e=new ArrayBuffer(e):(r=!0,this.lastWrittenByte=e.byteLength);const i=n.offset?n.offset>>>0:0,a=e.byteLength-i;let o=i;(ArrayBuffer.isView(e)||e instanceof Q9)&&(e.byteLength!==e.buffer.byteLength&&(o=e.byteOffset+i),e=e.buffer),r?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=e,this.length=a,this.byteLength=a,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const r=(this.offset+e)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,n){const r=mB[n].BYTES_PER_ELEMENT*e,i=this.byteOffset+this.offset,a=this.buffer.slice(i,i+r);if(this.littleEndian===EPt&&n!=="uint8"&&n!=="int8"){const s=new Uint8Array(this.buffer.slice(i,i+r));s.reverse();const c=new mB[n](s.buffer);return this.offset+=r,c.reverse(),c}const o=new mB[n](a);return this.offset+=r,o}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let n="";for(let r=0;r<e;r++)n+=this.readChar();return n}readUtf8(e=1){return epe(this.readBytes(e))}decodeText(e=1,n="utf-8"){return epe(this.readBytes(e),n)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let n=0;n<e.length;n++)this._data.setUint8(this.offset++,e[n]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let n=0;n<e.length;n++)this.writeUint8(e.charCodeAt(n));return this}writeUtf8(e){return this.writeBytes(SPt(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function _Pt(t){if(t.compression!==1)throw new Error("missing mandatory StripByteCounts field in compressed image");const e=t.rowsPerStrip*t.width*t.samplesPerPixel*(t.bitsPerSample/8);return new Array(t.stripOffsets.length).fill(e)}function TPt(t,e,n){let r=0;for(;r<t.length;){for(let i=n;i<e*n;i+=n)for(let a=0;a<n;a++)t[r+i+a]=t[r+i+a]+t[r+i-(n-a)]&255;r+=e*n}}function IPt(t,e,n){let r=0;for(;r<t.length;){for(let i=n;i<e*n;i+=n)for(let a=0;a<n;a++)t[r+i+a]=t[r+i+a]+t[r+i-(n-a)]&65535;r+=e*n}}const DG={33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",36864:"ExifVersion",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBiasValue",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",37396:"SubjectArea",37500:"MakerNote",37510:"UserComment",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42240:"Gamma"},CAe={};for(const t in DG)CAe[DG[t]]=Number(t);const APt=Object.freeze(Object.defineProperty({__proto__:null,tagsById:DG,tagsByName:CAe},Symbol.toStringTag,{value:"Module"})),kG={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},SAe={};for(const t in kG)SAe[kG[t]]=Number(t);const MPt=Object.freeze(Object.defineProperty({__proto__:null,tagsById:kG,tagsByName:SAe},Symbol.toStringTag,{value:"Module"})),UG={254:"NewSubfileType",255:"SubfileType",256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:"Threshholding",264:"CellWidth",265:"CellLength",266:"FillOrder",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",288:"FreeOffsets",289:"FreeByteCounts",290:"GrayResponseUnit",291:"GrayResponseCurve",296:"ResolutionUnit",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",320:"ColorMap",338:"ExtraSamples",33432:"Copyright",269:"DocumentName",285:"PageName",286:"XPosition",287:"YPosition",292:"T4Options",293:"T6Options",297:"PageNumber",301:"TransferFunction",317:"Predictor",318:"WhitePoint",319:"PrimaryChromaticities",321:"HalftoneHints",322:"TileWidth",323:"TileLength",324:"TileOffsets",325:"TileByteCounts",326:"BadFaxLines",327:"CleanFaxData",328:"ConsecutiveBadFaxLines",330:"SubIFDs",332:"InkSet",333:"InkNames",334:"NumberOfInks",336:"DotRange",337:"TargetPrinter",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",342:"TransferRange",343:"ClipPath",344:"XClipPathUnits",345:"YClipPathUnits",346:"Indexed",347:"JPEGTables",351:"OPIProxy",400:"GlobalParametersIFD",401:"ProfileType",402:"FaxProfile",403:"CodingMethods",404:"VersionYear",405:"ModeNumber",433:"Decode",434:"DefaultImageColor",512:"JPEGProc",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",515:"JPEGRestartInterval",517:"JPEGLosslessPredictors",518:"JPEGPointTransforms",519:"JPEGQTables",520:"JPEGDCTables",521:"JPEGACTables",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite",559:"StripRowCounts",700:"XMP",32781:"ImageID",34732:"ImageLayer",32932:"WangAnnotatio",33445:"MDFileTag",33446:"MDScalePixel",33447:"MDColorTable",33448:"MDLabName",33449:"MDSampleInfo",33450:"MDPrepDate",33451:"MDPrepTime",33452:"MDFileUnits",33550:"ModelPixelScaleTag",33723:"IPTC",33918:"INGRPacketDataTag",33919:"INGRFlagRegisters",33920:"IrasBTransformationMatrix",33922:"ModelTiepointTag",34264:"ModelTransformationTag",34377:"Photoshop",34665:"ExifIFD",34675:"ICCProfile",34735:"GeoKeyDirectoryTag",34736:"GeoDoubleParamsTag",34737:"GeoAsciiParamsTag",34853:"GPSIFD",34908:"HylaFAXFaxRecvParams",34909:"HylaFAXFaxSubAddress",34910:"HylaFAXFaxRecvTime",37724:"ImageSourceData",40965:"InteroperabilityIFD",42112:"GDAL_METADATA",42113:"GDAL_NODATA",50215:"OceScanjobDescription",50216:"OceApplicationSelector",50217:"OceIdentificationNumber",50218:"OceImageLogicCharacteristics",50706:"DNGVersion",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50710:"CFAPlaneColor",50711:"CFALayout",50712:"LinearizationTable",50713:"BlackLevelRepeatDim",50714:"BlackLevel",50715:"BlackLevelDeltaH",50716:"BlackLevelDeltaV",50717:"WhiteLevel",50718:"DefaultScale",50719:"DefaultCropOrigin",50720:"DefaultCropSize",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50733:"BayerGreenSplit",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"LensInfo",50737:"ChromaBlurRadius",50738:"AntiAliasStrength",50740:"DNGPrivateData",50741:"MakerNoteSafety",50778:"CalibrationIlluminant1",50779:"CalibrationIlluminant2",50780:"BestQualityScale",50784:"AliasLayerMetadata"},wAe={};for(const t in UG)wAe[UG[t]]=Number(t);const LPt=Object.freeze(Object.defineProperty({__proto__:null,tagsById:UG,tagsByName:wAe},Symbol.toStringTag,{value:"Module"})),tpe={standard:LPt,exif:APt,gps:MPt};class EAe{constructor(e){if(!e)throw new Error("missing kind");this.data=new Uint8Array,this.fields=new Map,this.kind=e,this._hasMap=!1,this._map={}}get(e){if(typeof e=="number")return this.fields.get(e);if(typeof e=="string")return this.fields.get(tpe[this.kind].tagsByName[e]);throw new Error("expected a number or string")}get map(){if(!this._hasMap){const e=tpe[this.kind].tagsById;for(const n of this.fields.keys())e[n]&&(this._map[e[n]]=this.fields.get(n));this._hasMap=!0}return this._map}}const _Ae=new Map([[1,[1,npe]],[2,[1,PPt]],[3,[2,NPt]],[4,[4,DPt]],[5,[8,kPt]],[6,[1,UPt]],[7,[1,npe]],[8,[2,FPt]],[9,[4,BPt]],[10,[8,VPt]],[11,[4,$Pt]],[12,[8,zPt]]]);function RPt(t,e){const n=_Ae.get(t);if(!n)throw new Error(`type not found: ${t}`);return n[0]*e}function OPt(t,e,n){const r=_Ae.get(e);if(!r)throw new Error(`type not found: ${e}`);return r[1](t,n)}function npe(t,e){if(e===1)return t.readUint8();const n=new Uint8Array(e);for(let r=0;r<e;r++)n[r]=t.readUint8();return n}function PPt(t,e){const n=[];let r="";for(let i=0;i<e;i++){const a=String.fromCharCode(t.readUint8());a==="\0"?(n.push(r),r=""):r+=a}return n.length===1?n[0]:n}function NPt(t,e){if(e===1)return t.readUint16();const n=new Uint16Array(e);for(let r=0;r<e;r++)n[r]=t.readUint16();return n}function DPt(t,e){if(e===1)return t.readUint32();const n=new Uint32Array(e);for(let r=0;r<e;r++)n[r]=t.readUint32();return n}function kPt(t,e){if(e===1)return t.readUint32()/t.readUint32();const n=new Array(e);for(let r=0;r<e;r++)n[r]=t.readUint32()/t.readUint32();return n}function UPt(t,e){if(e===1)return t.readInt8();const n=new Int8Array(e);for(let r=0;r<e;r++)n[r]=t.readInt8();return n}function FPt(t,e){if(e===1)return t.readInt16();const n=new Int16Array(e);for(let r=0;r<e;r++)n[r]=t.readInt16();return n}function BPt(t,e){if(e===1)return t.readInt32();const n=new Int32Array(e);for(let r=0;r<e;r++)n[r]=t.readInt32();return n}function VPt(t,e){if(e===1)return t.readInt32()/t.readInt32();const n=new Array(e);for(let r=0;r<e;r++)n[r]=t.readInt32()/t.readInt32();return n}function $Pt(t,e){if(e===1)return t.readFloat32();const n=new Float32Array(e);for(let r=0;r<e;r++)n[r]=t.readFloat32();return n}function zPt(t,e){if(e===1)return t.readFloat64();const n=new Float64Array(e);for(let r=0;r<e;r++)n[r]=t.readFloat64();return n}const HPt=256,rpe=257,ipe=258,ape=9;let G2=[];function GPt(){if(G2.length===0){for(let e=0;e<256;e++)G2.push([e]);const t=[];for(let e=256;e<4096;e++)G2.push(t)}}const jPt=[511,1023,2047,4095],WPt=[0,0,0,0,0,0,0,0,0,511,1023,2047,4095];class XPt{constructor(e){this.nextData=0,this.nextBits=0,this.bytePointer=0,this.tableLength=ipe,this.currentBitLength=ape,this.stripArray=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.outData=new Q9(e.byteLength),this.initializeTable()}decode(){let e=0,n=0;for(;(e=this.getNextCode())!==rpe;)if(e===HPt){if(this.initializeTable(),e=this.getNextCode(),e===rpe)break;this.writeString(this.stringFromCode(e)),n=e}else if(this.isInTable(e))this.writeString(this.stringFromCode(e)),this.addStringToTable(this.stringFromCode(n).concat(this.stringFromCode(e)[0])),n=e;else{const i=this.stringFromCode(n).concat(this.stringFromCode(n)[0]);this.writeString(i),this.addStringToTable(i),n=e}const r=this.outData.toArray();return new DataView(r.buffer,r.byteOffset,r.byteLength)}initializeTable(){GPt(),this.tableLength=ipe,this.currentBitLength=ape}writeString(e){this.outData.writeBytes(e)}stringFromCode(e){return G2[e]}isInTable(e){return e<this.tableLength}addStringToTable(e){if(G2[this.tableLength++]=e,G2.length>4096)throw G2=[],new Error("LZW decoding error. Please open an issue at https://github.com/image-js/tiff/issues/new/choose (include a test image).");this.tableLength===WPt[this.currentBitLength]&&this.currentBitLength++}getNextCode(){this.nextData=this.nextData<<8|this.stripArray[this.bytePointer++]&255,this.nextBits+=8,this.nextBits<this.currentBitLength&&(this.nextData=this.nextData<<8|this.stripArray[this.bytePointer++]&255,this.nextBits+=8);const e=this.nextData>>this.nextBits-this.currentBitLength&jPt[this.currentBitLength-9];return this.nextBits-=this.currentBitLength,this.bytePointer>this.stripArray.length?257:e}}function ZPt(t){return new XPt(t).decode()}const KPt=/^(\d{4}):(\d{2}):(\d{2}) (\d{2}):(\d{2}):(\d{2})$/;class ope extends EAe{constructor(){super("standard")}get size(){return this.width*this.height}get width(){return this.imageWidth}get height(){return this.imageLength}get components(){return this.samplesPerPixel}get date(){const e=new Date,n=KPt.exec(this.dateTime);if(n===null)throw new Error(`invalid dateTime: ${this.dateTime}`);return e.setFullYear(Number(n[1]),Number(n[2])-1,Number(n[3])),e.setHours(Number(n[4]),Number(n[5]),Number(n[6])),e}get newSubfileType(){return this.get("NewSubfileType")}get imageWidth(){return this.get("ImageWidth")}get imageLength(){return this.get("ImageLength")}get bitsPerSample(){const e=this.get("BitsPerSample");return e&&typeof e!="number"?e[0]:e}get alpha(){const e=this.extraSamples;return e?e[0]!==0:!1}get associatedAlpha(){const e=this.extraSamples;return e?e[0]===1:!1}get extraSamples(){return J8(this.get("ExtraSamples"))}get compression(){return this.get("Compression")||1}get type(){return this.get("PhotometricInterpretation")}get fillOrder(){return this.get("FillOrder")||1}get documentName(){return this.get("DocumentName")}get imageDescription(){return this.get("ImageDescription")}get stripOffsets(){return J8(this.get("StripOffsets"))}get orientation(){return this.get("Orientation")}get samplesPerPixel(){return this.get("SamplesPerPixel")||1}get rowsPerStrip(){return this.get("RowsPerStrip")}get stripByteCounts(){return J8(this.get("StripByteCounts"))}get minSampleValue(){return this.get("MinSampleValue")||0}get maxSampleValue(){return this.get("MaxSampleValue")||2**this.bitsPerSample-1}get xResolution(){return this.get("XResolution")}get yResolution(){return this.get("YResolution")}get planarConfiguration(){return this.get("PlanarConfiguration")||1}get resolutionUnit(){return this.get("ResolutionUnit")||2}get dateTime(){return this.get("DateTime")}get predictor(){return this.get("Predictor")||1}get sampleFormat(){return J8(this.get("SampleFormat")||1)[0]}get sMinSampleValue(){return this.get("SMinSampleValue")||this.minSampleValue}get sMaxSampleValue(){return this.get("SMaxSampleValue")||this.maxSampleValue}get palette(){const e=2**this.bitsPerSample,n=this.get("ColorMap");if(!n)return;if(n.length!==3*e)throw new Error(`ColorMap size must be ${e}`);const r=[];for(let i=0;i<e;i++)r.push([n[i],n[i+e],n[i+2*e]]);return r}}function J8(t){return typeof t=="number"?[t]:t}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const YPt=4,spe=0,lpe=1,qPt=2;function VE(t){let e=t.length;for(;--e>=0;)t[e]=0}const JPt=0,TAe=1,QPt=2,eNt=3,tNt=258,oY=29,yI=256,p5=yI+1+oY,ow=30,sY=19,IAe=2*p5+1,j2=15,yB=16,nNt=7,lY=256,AAe=16,MAe=17,LAe=18,FG=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),wL=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),rNt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),RAe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iNt=512,sm=new Array((p5+2)*2);VE(sm);const l4=new Array(ow*2);VE(l4);const v5=new Array(iNt);VE(v5);const g5=new Array(tNt-eNt+1);VE(g5);const cY=new Array(oY);VE(cY);const pR=new Array(ow);VE(pR);function bB(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let OAe,PAe,NAe;function xB(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const DAe=t=>t<256?v5[t]:v5[256+(t>>>7)],m5=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},If=(t,e,n)=>{t.bi_valid>yB-n?(t.bi_buf|=e<<t.bi_valid&65535,m5(t,t.bi_buf),t.bi_buf=e>>yB-t.bi_valid,t.bi_valid+=n-yB):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},eg=(t,e,n)=>{If(t,n[e*2],n[e*2+1])},kAe=(t,e)=>{let n=0;do n|=t&1,t>>>=1,n<<=1;while(--e>0);return n>>>1},aNt=t=>{t.bi_valid===16?(m5(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},oNt=(t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,c=e.stat_desc.max_length;let u,d,f,h,p,v,y=0;for(h=0;h<=j2;h++)t.bl_count[h]=0;for(n[t.heap[t.heap_max]*2+1]=0,u=t.heap_max+1;u<IAe;u++)d=t.heap[u],h=n[n[d*2+1]*2+1]+1,h>c&&(h=c,y++),n[d*2+1]=h,!(d>r)&&(t.bl_count[h]++,p=0,d>=s&&(p=o[d-s]),v=n[d*2],t.opt_len+=v*(h+p),a&&(t.static_len+=v*(i[d*2+1]+p)));if(y!==0){do{for(h=c-1;t.bl_count[h]===0;)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[c]--,y-=2}while(y>0);for(h=c;h!==0;h--)for(d=t.bl_count[h];d!==0;)f=t.heap[--u],!(f>r)&&(n[f*2+1]!==h&&(t.opt_len+=(h-n[f*2+1])*n[f*2],n[f*2+1]=h),d--)}},UAe=(t,e,n)=>{const r=new Array(j2+1);let i=0,a,o;for(a=1;a<=j2;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=kAe(r[s]++,s))}},sNt=()=>{let t,e,n,r,i;const a=new Array(j2+1);for(n=0,r=0;r<oY-1;r++)for(cY[r]=n,t=0;t<1<<FG[r];t++)g5[n++]=r;for(g5[n-1]=r,i=0,r=0;r<16;r++)for(pR[r]=i,t=0;t<1<<wL[r];t++)v5[i++]=r;for(i>>=7;r<ow;r++)for(pR[r]=i<<7,t=0;t<1<<wL[r]-7;t++)v5[256+i++]=r;for(e=0;e<=j2;e++)a[e]=0;for(t=0;t<=143;)sm[t*2+1]=8,t++,a[8]++;for(;t<=255;)sm[t*2+1]=9,t++,a[9]++;for(;t<=279;)sm[t*2+1]=7,t++,a[7]++;for(;t<=287;)sm[t*2+1]=8,t++,a[8]++;for(UAe(sm,p5+1,a),t=0;t<ow;t++)l4[t*2+1]=5,l4[t*2]=kAe(t,5);OAe=new bB(sm,FG,yI+1,p5,j2),PAe=new bB(l4,wL,0,ow,j2),NAe=new bB(new Array(0),rNt,0,sY,nNt)},FAe=t=>{let e;for(e=0;e<p5;e++)t.dyn_ltree[e*2]=0;for(e=0;e<ow;e++)t.dyn_dtree[e*2]=0;for(e=0;e<sY;e++)t.bl_tree[e*2]=0;t.dyn_ltree[lY*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},BAe=t=>{t.bi_valid>8?m5(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},cpe=(t,e,n,r)=>{const i=e*2,a=n*2;return t[i]<t[a]||t[i]===t[a]&&r[e]<=r[n]},CB=(t,e,n)=>{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i<t.heap_len&&cpe(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!cpe(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r},upe=(t,e,n)=>{let r,i,a=0,o,s;if(t.sym_next!==0)do r=t.pending_buf[t.sym_buf+a++]&255,r+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],r===0?eg(t,i,e):(o=g5[i],eg(t,o+yI+1,e),s=FG[o],s!==0&&(i-=cY[o],If(t,i,s)),r--,o=DAe(r),eg(t,o,n),s=wL[o],s!==0&&(r-=pR[o],If(t,r,s)));while(a<t.sym_next);eg(t,lY,e)},BG=(t,e)=>{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems;let o,s,c=-1,u;for(t.heap_len=0,t.heap_max=IAe,o=0;o<a;o++)n[o*2]!==0?(t.heap[++t.heap_len]=c=o,t.depth[o]=0):n[o*2+1]=0;for(;t.heap_len<2;)u=t.heap[++t.heap_len]=c<2?++c:0,n[u*2]=1,t.depth[u]=0,t.opt_len--,i&&(t.static_len-=r[u*2+1]);for(e.max_code=c,o=t.heap_len>>1;o>=1;o--)CB(t,n,o);u=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],CB(t,n,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,n[u*2]=n[o*2]+n[s*2],t.depth[u]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,n[o*2+1]=n[s*2+1]=u,t.heap[1]=u++,CB(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],oNt(t,e),UAe(n,c,t.bl_count)},dpe=(t,e,n)=>{let r,i=-1,a,o=e[0*2+1],s=0,c=7,u=4;for(o===0&&(c=138,u=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=e[(r+1)*2+1],!(++s<c&&a===o)&&(s<u?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[AAe*2]++):s<=10?t.bl_tree[MAe*2]++:t.bl_tree[LAe*2]++,s=0,i=a,o===0?(c=138,u=3):a===o?(c=6,u=3):(c=7,u=4))},fpe=(t,e,n)=>{let r,i=-1,a,o=e[0*2+1],s=0,c=7,u=4;for(o===0&&(c=138,u=3),r=0;r<=n;r++)if(a=o,o=e[(r+1)*2+1],!(++s<c&&a===o)){if(s<u)do eg(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(eg(t,a,t.bl_tree),s--),eg(t,AAe,t.bl_tree),If(t,s-3,2)):s<=10?(eg(t,MAe,t.bl_tree),If(t,s-3,3)):(eg(t,LAe,t.bl_tree),If(t,s-11,7));s=0,i=a,o===0?(c=138,u=3):a===o?(c=6,u=3):(c=7,u=4)}},lNt=t=>{let e;for(dpe(t,t.dyn_ltree,t.l_desc.max_code),dpe(t,t.dyn_dtree,t.d_desc.max_code),BG(t,t.bl_desc),e=sY-1;e>=3&&t.bl_tree[RAe[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},cNt=(t,e,n,r)=>{let i;for(If(t,e-257,5),If(t,n-1,5),If(t,r-4,4),i=0;i<r;i++)If(t,t.bl_tree[RAe[i]*2+1],3);fpe(t,t.dyn_ltree,e-1),fpe(t,t.dyn_dtree,n-1)},uNt=t=>{let e=4093624447,n;for(n=0;n<=31;n++,e>>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return spe;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return lpe;for(n=32;n<yI;n++)if(t.dyn_ltree[n*2]!==0)return lpe;return spe};let hpe=!1;const dNt=t=>{hpe||(sNt(),hpe=!0),t.l_desc=new xB(t.dyn_ltree,OAe),t.d_desc=new xB(t.dyn_dtree,PAe),t.bl_desc=new xB(t.bl_tree,NAe),t.bi_buf=0,t.bi_valid=0,FAe(t)},VAe=(t,e,n,r)=>{If(t,(JPt<<1)+(r?1:0),3),BAe(t),m5(t,n),m5(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},fNt=t=>{If(t,TAe<<1,3),eg(t,lY,sm),aNt(t)},hNt=(t,e,n,r)=>{let i,a,o=0;t.level>0?(t.strm.data_type===qPt&&(t.strm.data_type=uNt(t)),BG(t,t.l_desc),BG(t,t.d_desc),o=lNt(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&e!==-1?VAe(t,e,n,r):t.strategy===YPt||a===i?(If(t,(TAe<<1)+(r?1:0),3),upe(t,sm,l4)):(If(t,(QPt<<1)+(r?1:0),3),cNt(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),upe(t,t.dyn_ltree,t.dyn_dtree)),FAe(t),r&&BAe(t)},pNt=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(g5[n]+yI+1)*2]++,t.dyn_dtree[DAe(e)*2]++),t.sym_next===t.sym_end);var vNt=dNt,gNt=VAe,mNt=hNt,yNt=pNt,bNt=fNt,xNt={_tr_init:vNt,_tr_stored_block:gNt,_tr_flush_block:mNt,_tr_tally:yNt,_tr_align:bNt};const CNt=(t,e,n,r)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+e[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0};var y5=CNt;const SNt=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},wNt=new Uint32Array(SNt()),ENt=(t,e,n,r)=>{const i=wNt,a=r+n;t^=-1;for(let o=r;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1};var Pu=ENt,Hw={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},bI={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:_Nt,_tr_stored_block:VG,_tr_flush_block:TNt,_tr_tally:v1,_tr_align:INt}=xNt,{Z_NO_FLUSH:g1,Z_PARTIAL_FLUSH:ANt,Z_FULL_FLUSH:MNt,Z_FINISH:qh,Z_BLOCK:ppe,Z_OK:qu,Z_STREAM_END:vpe,Z_STREAM_ERROR:ug,Z_DATA_ERROR:LNt,Z_BUF_ERROR:SB,Z_DEFAULT_COMPRESSION:RNt,Z_FILTERED:ONt,Z_HUFFMAN_ONLY:Q8,Z_RLE:PNt,Z_FIXED:NNt,Z_DEFAULT_STRATEGY:DNt,Z_UNKNOWN:kNt,Z_DEFLATED:eP}=bI,UNt=9,FNt=15,BNt=8,VNt=29,$Nt=256,$G=$Nt+1+VNt,zNt=30,HNt=19,GNt=2*$G+1,jNt=15,Ko=3,a1=258,dg=a1+Ko+1,WNt=32,Gw=42,uY=57,zG=69,HG=73,GG=91,jG=103,W2=113,wT=666,qd=1,$E=2,$b=3,zE=4,XNt=3,X2=(t,e)=>(t.msg=Hw[e],e),gpe=t=>t*2-(t>4?9:0),H0=t=>{let e=t.length;for(;--e>=0;)t[e]=0},ZNt=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do n=t.head[--r],t.head[r]=n>=i?n-i:0;while(--e);e=i,r=e;do n=t.prev[--r],t.prev[r]=n>=i?n-i:0;while(--e)};let KNt=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask,m1=KNt;const Xf=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))},rh=(t,e)=>{TNt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Xf(t.strm)},ps=(t,e)=>{t.pending_buf[t.pending++]=e},D_=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},WG=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),t.state.wrap===1?t.adler=y5(t.adler,e,i,n):t.state.wrap===2&&(t.adler=Pu(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},$Ae=(t,e)=>{let n=t.max_chain_length,r=t.strstart,i,a,o=t.prev_length,s=t.nice_match;const c=t.strstart>t.w_size-dg?t.strstart-(t.w_size-dg):0,u=t.window,d=t.w_mask,f=t.prev,h=t.strstart+a1;let p=u[r+o-1],v=u[r+o];t.prev_length>=t.good_match&&(n>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(u[i+o]!==v||u[i+o-1]!==p||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<h);if(a=a1-(h-r),r=h-a1,a>o){if(t.match_start=e,o=a,a>=s)break;p=u[r+o-1],v=u[r+o]}}while((e=f[e&d])>c&&--n!==0);return o<=t.lookahead?o:t.lookahead},jw=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-dg)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),ZNt(t),r+=e),t.strm.avail_in===0)break;if(n=WG(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=Ko)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=m1(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=m1(t,t.ins_h,t.window[i+Ko-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<Ko)););}while(t.lookahead<dg&&t.strm.avail_in!==0)},zAe=(t,e)=>{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r,i,a,o=0,s=t.strm.avail_in;do{if(r=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,r>i+t.strm.avail_in&&(r=i+t.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&e!==qh||e===g1||r!==i+t.strm.avail_in)))break;o=e===qh&&r===i+t.strm.avail_in?1:0,VG(t,0,0,o),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,Xf(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(WG(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?zE:e!==g1&&e!==qh&&t.strm.avail_in===0&&t.strstart===t.block_start?$E:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(WG(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,n=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=n||(i||e===qh)&&e!==g1&&t.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=e===qh&&t.strm.avail_in===0&&r===i?1:0,VG(t,t.block_start,r,o),t.block_start+=r,Xf(t.strm)),o?$b:qd)},wB=(t,e)=>{let n,r;for(;;){if(t.lookahead<dg){if(jw(t),t.lookahead<dg&&e===g1)return qd;if(t.lookahead===0)break}if(n=0,t.lookahead>=Ko&&(t.ins_h=m1(t,t.ins_h,t.window[t.strstart+Ko-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),n!==0&&t.strstart-n<=t.w_size-dg&&(t.match_length=$Ae(t,n)),t.match_length>=Ko)if(r=v1(t,t.strstart-t.match_start,t.match_length-Ko),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Ko){t.match_length--;do t.strstart++,t.ins_h=m1(t,t.ins_h,t.window[t.strstart+Ko-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=m1(t,t.ins_h,t.window[t.strstart+1]);else r=v1(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(rh(t,!1),t.strm.avail_out===0))return qd}return t.insert=t.strstart<Ko-1?t.strstart:Ko-1,e===qh?(rh(t,!0),t.strm.avail_out===0?$b:zE):t.sym_next&&(rh(t,!1),t.strm.avail_out===0)?qd:$E},NC=(t,e)=>{let n,r,i;for(;;){if(t.lookahead<dg){if(jw(t),t.lookahead<dg&&e===g1)return qd;if(t.lookahead===0)break}if(n=0,t.lookahead>=Ko&&(t.ins_h=m1(t,t.ins_h,t.window[t.strstart+Ko-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Ko-1,n!==0&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-dg&&(t.match_length=$Ae(t,n),t.match_length<=5&&(t.strategy===ONt||t.match_length===Ko&&t.strstart-t.match_start>4096)&&(t.match_length=Ko-1)),t.prev_length>=Ko&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Ko,r=v1(t,t.strstart-1-t.prev_match,t.prev_length-Ko),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=m1(t,t.ins_h,t.window[t.strstart+Ko-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Ko-1,t.strstart++,r&&(rh(t,!1),t.strm.avail_out===0))return qd}else if(t.match_available){if(r=v1(t,0,t.window[t.strstart-1]),r&&rh(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return qd}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=v1(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Ko-1?t.strstart:Ko-1,e===qh?(rh(t,!0),t.strm.avail_out===0?$b:zE):t.sym_next&&(rh(t,!1),t.strm.avail_out===0)?qd:$E},YNt=(t,e)=>{let n,r,i,a;const o=t.window;for(;;){if(t.lookahead<=a1){if(jw(t),t.lookahead<=a1&&e===g1)return qd;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Ko&&t.strstart>0&&(i=t.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=t.strstart+a1;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);t.match_length=a1-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Ko?(n=v1(t,1,t.match_length-Ko),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=v1(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(rh(t,!1),t.strm.avail_out===0))return qd}return t.insert=0,e===qh?(rh(t,!0),t.strm.avail_out===0?$b:zE):t.sym_next&&(rh(t,!1),t.strm.avail_out===0)?qd:$E},qNt=(t,e)=>{let n;for(;;){if(t.lookahead===0&&(jw(t),t.lookahead===0)){if(e===g1)return qd;break}if(t.match_length=0,n=v1(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(rh(t,!1),t.strm.avail_out===0))return qd}return t.insert=0,e===qh?(rh(t,!0),t.strm.avail_out===0?$b:zE):t.sym_next&&(rh(t,!1),t.strm.avail_out===0)?qd:$E};function Fv(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const ET=[new Fv(0,0,0,0,zAe),new Fv(4,4,8,4,wB),new Fv(4,5,16,8,wB),new Fv(4,6,32,32,wB),new Fv(4,4,16,16,NC),new Fv(8,16,32,32,NC),new Fv(8,16,128,128,NC),new Fv(8,32,128,256,NC),new Fv(32,128,258,1024,NC),new Fv(32,258,258,4096,NC)],JNt=t=>{t.window_size=2*t.w_size,H0(t.head),t.max_lazy_match=ET[t.level].max_lazy,t.good_match=ET[t.level].good_length,t.nice_match=ET[t.level].nice_length,t.max_chain_length=ET[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Ko-1,t.match_available=0,t.ins_h=0};function QNt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=eP,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(GNt*2),this.dyn_dtree=new Uint16Array((2*zNt+1)*2),this.bl_tree=new Uint16Array((2*HNt+1)*2),H0(this.dyn_ltree),H0(this.dyn_dtree),H0(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(jNt+1),this.heap=new Uint16Array(2*$G+1),H0(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*$G+1),H0(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const xI=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==Gw&&e.status!==uY&&e.status!==zG&&e.status!==HG&&e.status!==GG&&e.status!==jG&&e.status!==W2&&e.status!==wT?1:0},HAe=t=>{if(xI(t))return X2(t,ug);t.total_in=t.total_out=0,t.data_type=kNt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?uY:e.wrap?Gw:W2,t.adler=e.wrap===2?0:1,e.last_flush=-2,_Nt(e),qu},GAe=t=>{const e=HAe(t);return e===qu&&JNt(t.state),e},eDt=(t,e)=>xI(t)||t.state.wrap!==2?ug:(t.state.gzhead=e,qu),jAe=(t,e,n,r,i,a)=>{if(!t)return ug;let o=1;if(e===RNt&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>UNt||n!==eP||r<8||r>15||e<0||e>9||a<0||a>NNt||r===8&&o!==1)return X2(t,ug);r===8&&(r=9);const s=new QNt;return t.state=s,s.strm=t,s.status=Gw,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Ko-1)/Ko),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=n,GAe(t)},tDt=(t,e)=>jAe(t,e,eP,FNt,BNt,DNt),nDt=(t,e)=>{if(xI(t)||e>ppe||e<0)return t?X2(t,ug):ug;const n=t.state;if(!t.output||t.avail_in!==0&&!t.input||n.status===wT&&e!==qh)return X2(t,t.avail_out===0?SB:ug);const r=n.last_flush;if(n.last_flush=e,n.pending!==0){if(Xf(t),t.avail_out===0)return n.last_flush=-1,qu}else if(t.avail_in===0&&gpe(e)<=gpe(r)&&e!==qh)return X2(t,SB);if(n.status===wT&&t.avail_in!==0)return X2(t,SB);if(n.status===Gw&&n.wrap===0&&(n.status=W2),n.status===Gw){let i=eP+(n.w_bits-8<<4)<<8,a=-1;if(n.strategy>=Q8||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=WNt),i+=31-i%31,D_(n,i),n.strstart!==0&&(D_(n,t.adler>>>16),D_(n,t.adler&65535)),t.adler=1,n.status=W2,Xf(t),n.pending!==0)return n.last_flush=-1,qu}if(n.status===uY){if(t.adler=0,ps(n,31),ps(n,139),ps(n,8),n.gzhead)ps(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),ps(n,n.gzhead.time&255),ps(n,n.gzhead.time>>8&255),ps(n,n.gzhead.time>>16&255),ps(n,n.gzhead.time>>24&255),ps(n,n.level===9?2:n.strategy>=Q8||n.level<2?4:0),ps(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(ps(n,n.gzhead.extra.length&255),ps(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=Pu(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=zG;else if(ps(n,0),ps(n,0),ps(n,0),ps(n,0),ps(n,0),ps(n,n.level===9?2:n.strategy>=Q8||n.level<2?4:0),ps(n,XNt),n.status=W2,Xf(t),n.pending!==0)return n.last_flush=-1,qu}if(n.status===zG){if(n.gzhead.extra){let i=n.pending,a=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+a>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(t.adler=Pu(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,Xf(t),n.pending!==0)return n.last_flush=-1,qu;i=0,a-=s}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending+=a,n.gzhead.hcrc&&n.pending>i&&(t.adler=Pu(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=HG}if(n.status===HG){if(n.gzhead.name){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=Pu(t.adler,n.pending_buf,n.pending-i,i)),Xf(t),n.pending!==0)return n.last_flush=-1,qu;i=0}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,ps(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=Pu(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=GG}if(n.status===GG){if(n.gzhead.comment){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=Pu(t.adler,n.pending_buf,n.pending-i,i)),Xf(t),n.pending!==0)return n.last_flush=-1,qu;i=0}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,ps(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=Pu(t.adler,n.pending_buf,n.pending-i,i))}n.status=jG}if(n.status===jG){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Xf(t),n.pending!==0))return n.last_flush=-1,qu;ps(n,t.adler&255),ps(n,t.adler>>8&255),t.adler=0}if(n.status=W2,Xf(t),n.pending!==0)return n.last_flush=-1,qu}if(t.avail_in!==0||n.lookahead!==0||e!==g1&&n.status!==wT){let i=n.level===0?zAe(n,e):n.strategy===Q8?qNt(n,e):n.strategy===PNt?YNt(n,e):ET[n.level].func(n,e);if((i===$b||i===zE)&&(n.status=wT),i===qd||i===$b)return t.avail_out===0&&(n.last_flush=-1),qu;if(i===$E&&(e===ANt?INt(n):e!==ppe&&(VG(n,0,0,!1),e===MNt&&(H0(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Xf(t),t.avail_out===0))return n.last_flush=-1,qu}return e!==qh?qu:n.wrap<=0?vpe:(n.wrap===2?(ps(n,t.adler&255),ps(n,t.adler>>8&255),ps(n,t.adler>>16&255),ps(n,t.adler>>24&255),ps(n,t.total_in&255),ps(n,t.total_in>>8&255),ps(n,t.total_in>>16&255),ps(n,t.total_in>>24&255)):(D_(n,t.adler>>>16),D_(n,t.adler&65535)),Xf(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?qu:vpe)},rDt=t=>{if(xI(t))return ug;const e=t.state.status;return t.state=null,e===W2?X2(t,LNt):qu},iDt=(t,e)=>{let n=e.length;if(xI(t))return ug;const r=t.state,i=r.wrap;if(i===2||i===1&&r.status!==Gw||r.lookahead)return ug;if(i===1&&(t.adler=y5(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){i===0&&(H0(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(e.subarray(n-r.w_size,n),0),e=c,n=r.w_size}const a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,jw(r);r.lookahead>=Ko;){let c=r.strstart,u=r.lookahead-(Ko-1);do r.ins_h=m1(r,r.ins_h,r.window[c+Ko-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--u);r.strstart=c,r.lookahead=Ko-1,jw(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Ko-1,r.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,r.wrap=i,qu};var aDt=tDt,oDt=jAe,sDt=GAe,lDt=HAe,cDt=eDt,uDt=nDt,dDt=rDt,fDt=iDt,hDt="pako deflate (from Nodeca project)",c4={deflateInit:aDt,deflateInit2:oDt,deflateReset:sDt,deflateResetKeep:lDt,deflateSetHeader:cDt,deflate:uDt,deflateEnd:dDt,deflateSetDictionary:fDt,deflateInfo:hDt};const pDt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var vDt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)pDt(n,r)&&(t[r]=n[r])}}return t},gDt=t=>{let e=0;for(let r=0,i=t.length;r<i;r++)e+=t[r].length;const n=new Uint8Array(e);for(let r=0,i=0,a=t.length;r<a;r++){let o=t[r];n.set(o,i),i+=o.length}return n},tP={assign:vDt,flattenChunks:gDt};let WAe=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{WAe=!1}const b5=new Uint8Array(256);for(let t=0;t<256;t++)b5[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;b5[254]=b5[254]=1;var mDt=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,i,a,o=t.length,s=0;for(i=0;i<o;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?e[a++]=n:n<2048?(e[a++]=192|n>>>6,e[a++]=128|n&63):n<65536?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|n&63):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|n&63);return e};const yDt=(t,e)=>{if(e<65534&&t.subarray&&WAe)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n};var bDt=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,i;const a=new Array(n*2);for(i=0,r=0;r<n;){let o=t[r++];if(o<128){a[i++]=o;continue}let s=b5[o];if(s>4){a[i++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<n;)o=o<<6|t[r++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return yDt(a,i)},xDt=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+b5[t[n]]>e?n:e},x5={string2buf:mDt,buf2string:bDt,utf8border:xDt};function CDt(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var XAe=CDt;const ZAe=Object.prototype.toString,{Z_NO_FLUSH:SDt,Z_SYNC_FLUSH:wDt,Z_FULL_FLUSH:EDt,Z_FINISH:_Dt,Z_OK:vR,Z_STREAM_END:TDt,Z_DEFAULT_COMPRESSION:IDt,Z_DEFAULT_STRATEGY:ADt,Z_DEFLATED:MDt}=bI;function dY(t){this.options=tP.assign({level:IDt,method:MDt,chunkSize:16384,windowBits:15,memLevel:8,strategy:ADt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new XAe,this.strm.avail_out=0;let n=c4.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==vR)throw new Error(Hw[n]);if(e.header&&c4.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=x5.string2buf(e.dictionary):ZAe.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,n=c4.deflateSetDictionary(this.strm,r),n!==vR)throw new Error(Hw[n]);this._dict_set=!0}}dY.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?_Dt:SDt,typeof t=="string"?n.input=x5.string2buf(t):ZAe.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===wDt||a===EDt)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=c4.deflate(n,a),i===TDt)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=c4.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===vR;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};dY.prototype.onData=function(t){this.chunks.push(t)};dY.prototype.onEnd=function(t){t===vR&&(this.result=tP.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const eM=16209,LDt=16191;var RDt=function(e,n){let r,i,a,o,s,c,u,d,f,h,p,v,y,g,m,b,x,S,w,_,A,P,R,N;const k=e.state;r=e.next_in,R=e.input,i=r+(e.avail_in-5),a=e.next_out,N=e.output,o=a-(n-e.avail_out),s=a+(e.avail_out-257),c=k.dmax,u=k.wsize,d=k.whave,f=k.wnext,h=k.window,p=k.hold,v=k.bits,y=k.lencode,g=k.distcode,m=(1<<k.lenbits)-1,b=(1<<k.distbits)-1;e:do{v<15&&(p+=R[r++]<<v,v+=8,p+=R[r++]<<v,v+=8),x=y[p&m];t:for(;;){if(S=x>>>24,p>>>=S,v-=S,S=x>>>16&255,S===0)N[a++]=x&65535;else if(S&16){w=x&65535,S&=15,S&&(v<S&&(p+=R[r++]<<v,v+=8),w+=p&(1<<S)-1,p>>>=S,v-=S),v<15&&(p+=R[r++]<<v,v+=8,p+=R[r++]<<v,v+=8),x=g[p&b];n:for(;;){if(S=x>>>24,p>>>=S,v-=S,S=x>>>16&255,S&16){if(_=x&65535,S&=15,v<S&&(p+=R[r++]<<v,v+=8,v<S&&(p+=R[r++]<<v,v+=8)),_+=p&(1<<S)-1,_>c){e.msg="invalid distance too far back",k.mode=eM;break e}if(p>>>=S,v-=S,S=a-o,_>S){if(S=_-S,S>d&&k.sane){e.msg="invalid distance too far back",k.mode=eM;break e}if(A=0,P=h,f===0){if(A+=u-S,S<w){w-=S;do N[a++]=h[A++];while(--S);A=a-_,P=N}}else if(f<S){if(A+=u+f-S,S-=f,S<w){w-=S;do N[a++]=h[A++];while(--S);if(A=0,f<w){S=f,w-=S;do N[a++]=h[A++];while(--S);A=a-_,P=N}}}else if(A+=f-S,S<w){w-=S;do N[a++]=h[A++];while(--S);A=a-_,P=N}for(;w>2;)N[a++]=P[A++],N[a++]=P[A++],N[a++]=P[A++],w-=3;w&&(N[a++]=P[A++],w>1&&(N[a++]=P[A++]))}else{A=a-_;do N[a++]=N[A++],N[a++]=N[A++],N[a++]=N[A++],w-=3;while(w>2);w&&(N[a++]=N[A++],w>1&&(N[a++]=N[A++]))}}else if(S&64){e.msg="invalid distance code",k.mode=eM;break e}else{x=g[(x&65535)+(p&(1<<S)-1)];continue n}break}}else if(S&64)if(S&32){k.mode=LDt;break e}else{e.msg="invalid literal/length code",k.mode=eM;break e}else{x=y[(x&65535)+(p&(1<<S)-1)];continue t}break}}while(r<i&&a<s);w=v>>3,r-=w,v-=w<<3,p&=(1<<v)-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=a<s?257+(s-a):257-(a-s),k.hold=p,k.bits=v};const DC=15,mpe=852,ype=592,bpe=0,EB=1,xpe=2,ODt=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),PDt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),NDt=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),DDt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),kDt=(t,e,n,r,i,a,o,s)=>{const c=s.bits;let u=0,d=0,f=0,h=0,p=0,v=0,y=0,g=0,m=0,b=0,x,S,w,_,A,P=null,R;const N=new Uint16Array(DC+1),k=new Uint16Array(DC+1);let B=null,H,F,G;for(u=0;u<=DC;u++)N[u]=0;for(d=0;d<r;d++)N[e[n+d]]++;for(p=c,h=DC;h>=1&&N[h]===0;h--);if(p>h&&(p=h),h===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(f=1;f<h&&N[f]===0;f++);for(p<f&&(p=f),g=1,u=1;u<=DC;u++)if(g<<=1,g-=N[u],g<0)return-1;if(g>0&&(t===bpe||h!==1))return-1;for(k[1]=0,u=1;u<DC;u++)k[u+1]=k[u]+N[u];for(d=0;d<r;d++)e[n+d]!==0&&(o[k[e[n+d]]++]=d);if(t===bpe?(P=B=o,R=20):t===EB?(P=ODt,B=PDt,R=257):(P=NDt,B=DDt,R=0),b=0,d=0,u=f,A=a,v=p,y=0,w=-1,m=1<<p,_=m-1,t===EB&&m>mpe||t===xpe&&m>ype)return 1;for(;;){H=u-y,o[d]+1<R?(F=0,G=o[d]):o[d]>=R?(F=B[o[d]-R],G=P[o[d]-R]):(F=32+64,G=0),x=1<<u-y,S=1<<v,f=S;do S-=x,i[A+(b>>y)+S]=H<<24|F<<16|G|0;while(S!==0);for(x=1<<u-1;b&x;)x>>=1;if(x!==0?(b&=x-1,b+=x):b=0,d++,--N[u]===0){if(u===h)break;u=e[n+o[d]]}if(u>p&&(b&_)!==w){for(y===0&&(y=p),A+=f,v=u-y,g=1<<v;v+y<h&&(g-=N[v+y],!(g<=0));)v++,g<<=1;if(m+=1<<v,t===EB&&m>mpe||t===xpe&&m>ype)return 1;w=b&_,i[w]=p<<24|v<<16|A-a|0}}return b!==0&&(i[A+b]=u-y<<24|64<<16|0),s.bits=p,0};var u4=kDt;const UDt=0,KAe=1,YAe=2,{Z_FINISH:Cpe,Z_BLOCK:FDt,Z_TREES:tM,Z_OK:zb,Z_STREAM_END:BDt,Z_NEED_DICT:VDt,Z_STREAM_ERROR:up,Z_DATA_ERROR:qAe,Z_MEM_ERROR:JAe,Z_BUF_ERROR:$Dt,Z_DEFLATED:Spe}=bI,nP=16180,wpe=16181,Epe=16182,_pe=16183,Tpe=16184,Ipe=16185,Ape=16186,Mpe=16187,Lpe=16188,Rpe=16189,gR=16190,jg=16191,_B=16192,Ope=16193,TB=16194,Ppe=16195,Npe=16196,Dpe=16197,kpe=16198,nM=16199,rM=16200,Upe=16201,Fpe=16202,Bpe=16203,Vpe=16204,$pe=16205,IB=16206,zpe=16207,Hpe=16208,Ul=16209,QAe=16210,e6e=16211,zDt=852,HDt=592,GDt=15,jDt=GDt,Gpe=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function WDt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const lx=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<nP||e.mode>e6e?1:0},t6e=t=>{if(lx(t))return up;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=nP,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(zDt),e.distcode=e.distdyn=new Int32Array(HDt),e.sane=1,e.back=-1,zb},n6e=t=>{if(lx(t))return up;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,t6e(t)},r6e=(t,e)=>{let n;if(lx(t))return up;const r=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?up:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,n6e(t))},i6e=(t,e)=>{if(!t)return up;const n=new WDt;t.state=n,n.strm=t,n.window=null,n.mode=nP;const r=r6e(t,e);return r!==zb&&(t.state=null),r},XDt=t=>i6e(t,jDt);let jpe=!0,AB,MB;const ZDt=t=>{if(jpe){AB=new Int32Array(512),MB=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(u4(KAe,t.lens,0,288,AB,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;u4(YAe,t.lens,0,32,MB,0,t.work,{bits:5}),jpe=!1}t.lencode=AB,t.lenbits=9,t.distcode=MB,t.distbits=5},a6e=(t,e,n,r)=>{let i;const a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(e.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(e.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(e.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},KDt=(t,e)=>{let n,r,i,a,o,s,c,u,d,f,h,p,v,y,g=0,m,b,x,S,w,_,A,P;const R=new Uint8Array(4);let N,k;const B=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(lx(t)||!t.output||!t.input&&t.avail_in!==0)return up;n=t.state,n.mode===jg&&(n.mode=_B),o=t.next_out,i=t.output,c=t.avail_out,a=t.next_in,r=t.input,s=t.avail_in,u=n.hold,d=n.bits,f=s,h=c,P=zb;e:for(;;)switch(n.mode){case nP:if(n.wrap===0){n.mode=_B;break}for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,R[0]=u&255,R[1]=u>>>8&255,n.check=Pu(n.check,R,2,0),u=0,d=0,n.mode=wpe;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){t.msg="incorrect header check",n.mode=Ul;break}if((u&15)!==Spe){t.msg="unknown compression method",n.mode=Ul;break}if(u>>>=4,d-=4,A=(u&15)+8,n.wbits===0&&(n.wbits=A),A>15||A>n.wbits){t.msg="invalid window size",n.mode=Ul;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=u&512?Rpe:jg,u=0,d=0;break;case wpe:for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.flags=u,(n.flags&255)!==Spe){t.msg="unknown compression method",n.mode=Ul;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=Ul;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,n.check=Pu(n.check,R,2,0)),u=0,d=0,n.mode=Epe;case Epe:for(;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,R[2]=u>>>16&255,R[3]=u>>>24&255,n.check=Pu(n.check,R,4,0)),u=0,d=0,n.mode=_pe;case _pe:for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,n.check=Pu(n.check,R,2,0)),u=0,d=0,n.mode=Tpe;case Tpe:if(n.flags&1024){for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,n.check=Pu(n.check,R,2,0)),u=0,d=0}else n.head&&(n.head.extra=null);n.mode=Ipe;case Ipe:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(A=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+p),A)),n.flags&512&&n.wrap&4&&(n.check=Pu(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break e;n.length=0,n.mode=Ape;case Ape:if(n.flags&2048){if(s===0)break e;p=0;do A=r[a+p++],n.head&&A&&n.length<65536&&(n.head.name+=String.fromCharCode(A));while(A&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=Pu(n.check,r,p,a)),s-=p,a+=p,A)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=Mpe;case Mpe:if(n.flags&4096){if(s===0)break e;p=0;do A=r[a+p++],n.head&&A&&n.length<65536&&(n.head.comment+=String.fromCharCode(A));while(A&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=Pu(n.check,r,p,a)),s-=p,a+=p,A)break e}else n.head&&(n.head.comment=null);n.mode=Lpe;case Lpe:if(n.flags&512){for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.wrap&4&&u!==(n.check&65535)){t.msg="header crc mismatch",n.mode=Ul;break}u=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=jg;break;case Rpe:for(;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}t.adler=n.check=Gpe(u),u=0,d=0,n.mode=gR;case gR:if(n.havedict===0)return t.next_out=o,t.avail_out=c,t.next_in=a,t.avail_in=s,n.hold=u,n.bits=d,VDt;t.adler=n.check=1,n.mode=jg;case jg:if(e===FDt||e===tM)break e;case _B:if(n.last){u>>>=d&7,d-=d&7,n.mode=IB;break}for(;d<3;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}switch(n.last=u&1,u>>>=1,d-=1,u&3){case 0:n.mode=Ope;break;case 1:if(ZDt(n),n.mode=nM,e===tM){u>>>=2,d-=2;break e}break;case 2:n.mode=Npe;break;case 3:t.msg="invalid block type",n.mode=Ul}u>>>=2,d-=2;break;case Ope:for(u>>>=d&7,d-=d&7;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){t.msg="invalid stored block lengths",n.mode=Ul;break}if(n.length=u&65535,u=0,d=0,n.mode=TB,e===tM)break e;case TB:n.mode=Ppe;case Ppe:if(p=n.length,p){if(p>s&&(p=s),p>c&&(p=c),p===0)break e;i.set(r.subarray(a,a+p),o),s-=p,a+=p,c-=p,o+=p,n.length-=p;break}n.mode=jg;break;case Npe:for(;d<14;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.nlen=(u&31)+257,u>>>=5,d-=5,n.ndist=(u&31)+1,u>>>=5,d-=5,n.ncode=(u&15)+4,u>>>=4,d-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=Ul;break}n.have=0,n.mode=Dpe;case Dpe:for(;n.have<n.ncode;){for(;d<3;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.lens[B[n.have++]]=u&7,u>>>=3,d-=3}for(;n.have<19;)n.lens[B[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,N={bits:n.lenbits},P=u4(UDt,n.lens,0,19,n.lencode,0,n.work,N),n.lenbits=N.bits,P){t.msg="invalid code lengths set",n.mode=Ul;break}n.have=0,n.mode=kpe;case kpe:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[u&(1<<n.lenbits)-1],m=g>>>24,b=g>>>16&255,x=g&65535,!(m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(x<16)u>>>=m,d-=m,n.lens[n.have++]=x;else{if(x===16){for(k=m+2;d<k;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(u>>>=m,d-=m,n.have===0){t.msg="invalid bit length repeat",n.mode=Ul;break}A=n.lens[n.have-1],p=3+(u&3),u>>>=2,d-=2}else if(x===17){for(k=m+3;d<k;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=m,d-=m,A=0,p=3+(u&7),u>>>=3,d-=3}else{for(k=m+7;d<k;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=m,d-=m,A=0,p=11+(u&127),u>>>=7,d-=7}if(n.have+p>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=Ul;break}for(;p--;)n.lens[n.have++]=A}}if(n.mode===Ul)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=Ul;break}if(n.lenbits=9,N={bits:n.lenbits},P=u4(KAe,n.lens,0,n.nlen,n.lencode,0,n.work,N),n.lenbits=N.bits,P){t.msg="invalid literal/lengths set",n.mode=Ul;break}if(n.distbits=6,n.distcode=n.distdyn,N={bits:n.distbits},P=u4(YAe,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,N),n.distbits=N.bits,P){t.msg="invalid distances set",n.mode=Ul;break}if(n.mode=nM,e===tM)break e;case nM:n.mode=rM;case rM:if(s>=6&&c>=258){t.next_out=o,t.avail_out=c,t.next_in=a,t.avail_in=s,n.hold=u,n.bits=d,RDt(t,h),o=t.next_out,i=t.output,c=t.avail_out,a=t.next_in,r=t.input,s=t.avail_in,u=n.hold,d=n.bits,n.mode===jg&&(n.back=-1);break}for(n.back=0;g=n.lencode[u&(1<<n.lenbits)-1],m=g>>>24,b=g>>>16&255,x=g&65535,!(m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(b&&!(b&240)){for(S=m,w=b,_=x;g=n.lencode[_+((u&(1<<S+w)-1)>>S)],m=g>>>24,b=g>>>16&255,x=g&65535,!(S+m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=S,d-=S,n.back+=S}if(u>>>=m,d-=m,n.back+=m,n.length=x,b===0){n.mode=$pe;break}if(b&32){n.back=-1,n.mode=jg;break}if(b&64){t.msg="invalid literal/length code",n.mode=Ul;break}n.extra=b&15,n.mode=Upe;case Upe:if(n.extra){for(k=n.extra;d<k;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Fpe;case Fpe:for(;g=n.distcode[u&(1<<n.distbits)-1],m=g>>>24,b=g>>>16&255,x=g&65535,!(m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(!(b&240)){for(S=m,w=b,_=x;g=n.distcode[_+((u&(1<<S+w)-1)>>S)],m=g>>>24,b=g>>>16&255,x=g&65535,!(S+m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=S,d-=S,n.back+=S}if(u>>>=m,d-=m,n.back+=m,b&64){t.msg="invalid distance code",n.mode=Ul;break}n.offset=x,n.extra=b&15,n.mode=Bpe;case Bpe:if(n.extra){for(k=n.extra;d<k;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=Ul;break}n.mode=Vpe;case Vpe:if(c===0)break e;if(p=h-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=Ul;break}p>n.wnext?(p-=n.wnext,v=n.wsize-p):v=n.wnext-p,p>n.length&&(p=n.length),y=n.window}else y=i,v=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=y[v++];while(--p);n.length===0&&(n.mode=rM);break;case $pe:if(c===0)break e;i[o++]=n.length,c--,n.mode=rM;break;case IB:if(n.wrap){for(;d<32;){if(s===0)break e;s--,u|=r[a++]<<d,d+=8}if(h-=c,t.total_out+=h,n.total+=h,n.wrap&4&&h&&(t.adler=n.check=n.flags?Pu(n.check,i,h,o-h):y5(n.check,i,h,o-h)),h=c,n.wrap&4&&(n.flags?u:Gpe(u))!==n.check){t.msg="incorrect data check",n.mode=Ul;break}u=0,d=0}n.mode=zpe;case zpe:if(n.wrap&&n.flags){for(;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.wrap&4&&u!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=Ul;break}u=0,d=0}n.mode=Hpe;case Hpe:P=BDt;break e;case Ul:P=qAe;break e;case QAe:return JAe;case e6e:default:return up}return t.next_out=o,t.avail_out=c,t.next_in=a,t.avail_in=s,n.hold=u,n.bits=d,(n.wsize||h!==t.avail_out&&n.mode<Ul&&(n.mode<IB||e!==Cpe))&&a6e(t,t.output,t.next_out,h-t.avail_out),f-=t.avail_in,h-=t.avail_out,t.total_in+=f,t.total_out+=h,n.total+=h,n.wrap&4&&h&&(t.adler=n.check=n.flags?Pu(n.check,i,h,t.next_out-h):y5(n.check,i,h,t.next_out-h)),t.data_type=n.bits+(n.last?64:0)+(n.mode===jg?128:0)+(n.mode===nM||n.mode===TB?256:0),(f===0&&h===0||e===Cpe)&&P===zb&&(P=$Dt),P},YDt=t=>{if(lx(t))return up;let e=t.state;return e.window&&(e.window=null),t.state=null,zb},qDt=(t,e)=>{if(lx(t))return up;const n=t.state;return n.wrap&2?(n.head=e,e.done=!1,zb):up},JDt=(t,e)=>{const n=e.length;let r,i,a;return lx(t)||(r=t.state,r.wrap!==0&&r.mode!==gR)?up:r.mode===gR&&(i=1,i=y5(i,e,n,0),i!==r.check)?qAe:(a=a6e(t,e,n,n),a?(r.mode=QAe,JAe):(r.havedict=1,zb))};var QDt=n6e,ekt=r6e,tkt=t6e,nkt=XDt,rkt=i6e,ikt=KDt,akt=YDt,okt=qDt,skt=JDt,lkt="pako inflate (from Nodeca project)",lm={inflateReset:QDt,inflateReset2:ekt,inflateResetKeep:tkt,inflateInit:nkt,inflateInit2:rkt,inflate:ikt,inflateEnd:akt,inflateGetHeader:okt,inflateSetDictionary:skt,inflateInfo:lkt};function ckt(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var ukt=ckt;const o6e=Object.prototype.toString,{Z_NO_FLUSH:dkt,Z_FINISH:fkt,Z_OK:C5,Z_STREAM_END:LB,Z_NEED_DICT:RB,Z_STREAM_ERROR:hkt,Z_DATA_ERROR:Wpe,Z_MEM_ERROR:pkt}=bI;function CI(t){this.options=tP.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new XAe,this.strm.avail_out=0;let n=lm.inflateInit2(this.strm,e.windowBits);if(n!==C5)throw new Error(Hw[n]);if(this.header=new ukt,lm.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=x5.string2buf(e.dictionary):o6e.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=lm.inflateSetDictionary(this.strm,e.dictionary),n!==C5)))throw new Error(Hw[n])}CI.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?fkt:dkt,o6e.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=lm.inflate(n,o),a===RB&&i&&(a=lm.inflateSetDictionary(n,i),a===C5?a=lm.inflate(n,o):a===Wpe&&(a=RB));n.avail_in>0&&a===LB&&n.state.wrap>0&&t[n.next_in]!==0;)lm.inflateReset(n),a=lm.inflate(n,o);switch(a){case hkt:case Wpe:case RB:case pkt:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||a===LB))if(this.options.to==="string"){let c=x5.utf8border(n.output,n.next_out),u=n.next_out-c,d=x5.buf2string(n.output,c);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(c,c+u),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===C5&&s===0)){if(a===LB)return a=lm.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};CI.prototype.onData=function(t){this.chunks.push(t)};CI.prototype.onEnd=function(t){t===C5&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=tP.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function fY(t,e){const n=new CI(e);if(n.push(t),n.err)throw n.msg||Hw[n.err];return n.result}function vkt(t,e){return e=e||{},e.raw=!0,fY(t,e)}var gkt=CI,mkt=fY,ykt=vkt,bkt=fY,xkt=bI,Ckt={Inflate:gkt,inflate:mkt,inflateRaw:ykt,ungzip:bkt,constants:xkt};const{Inflate:Qzt,inflate:Skt,inflateRaw:eHt,ungzip:tHt}=Ckt;var s6e=Skt;function wkt(t){const e=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n=s6e(e);return new DataView(n.buffer,n.byteOffset,n.byteLength)}const Ekt={ignoreImageData:!1};class l6e extends Q9{constructor(e){super(e),this._nextIFD=0}get isMultiPage(){let e=0;for(this.decodeHeader();this._nextIFD;)if(e++,this.decodeIFD({ignoreImageData:!0},!0),e===2)return!0;if(e===1)return!1;throw em("ifdCount",e)}get pageCount(){let e=0;for(this.decodeHeader();this._nextIFD;)e++,this.decodeIFD({ignoreImageData:!0},!0);if(e>0)return e;throw em("ifdCount",e)}decode(e={}){const{pages:n}=e;Mkt(n);const r=n?Math.max(...n):1/0;e={...Ekt,...e};const i=[];this.decodeHeader();let a=0;for(;this._nextIFD;){if(n){if(n.includes(a)?i.push(this.decodeIFD(e,!0)):this.decodeIFD({ignoreImageData:!0},!0),a===r)break}else i.push(this.decodeIFD(e,!0));a++}if(a<r&&r!==1/0)throw new RangeError(`Index ${r} is out of bounds. The stack only contains ${a} images.`);return i}decodeHeader(){const e=this.readUint16();if(e===18761)this.setLittleEndian();else if(e===19789)this.setBigEndian();else throw new Error(`invalid byte order: 0x${e.toString(16)}`);if(this.readUint16()!==42)throw new Error("not a TIFF file");this._nextIFD=this.readUint32()}decodeIFD(e,n){this.seek(this._nextIFD);let r;if(n)r=new ope;else{if(!e.kind)throw new Error("kind is missing");r=new EAe(e.kind)}const i=this.readUint16();for(let a=0;a<i;a++)this.decodeIFDEntry(r);if(!e.ignoreImageData){if(!(r instanceof ope))throw new Error("must be a tiff ifd");this.decodeImageData(r)}return this._nextIFD=this.readUint32(),r}decodeIFDEntry(e){const n=this.offset,r=this.readUint16(),i=this.readUint16(),a=this.readUint32();if(i<1||i>12){this.skip(4);return}RPt(i,a)>4&&this.seek(this.readUint32());const s=OPt(this,i,a);if(e.fields.set(r,s),r===34665||r===34853){const c=this.offset;let u="exif";r===34665?u="exif":r===34853&&(u="gps"),this._nextIFD=s,e[u]=this.decodeIFD({kind:u,ignoreImageData:!0},!1),this.offset=c}this.seek(n),this.skip(12)}decodeImageData(e){const n=e.orientation;if(n&&n!==1)throw em("orientation",n);switch(e.type){case 0:case 1:case 2:case 3:this.readStripData(e);break;default:throw em("image type",e.type)}if(this.applyPredictor(e),this.convertAlpha(e),e.type===0){const i=2**e.bitsPerSample-1;for(let a=0;a<e.data.length;a++)e.data[a]=i-e.data[a]}}readStripData(e){const n=e.width,r=e.height,i=e.bitsPerSample,a=e.sampleFormat,o=n*r*e.samplesPerPixel,s=_kt(o,i,a),u=e.rowsPerStrip*n*e.samplesPerPixel,d=e.stripOffsets,f=e.stripByteCounts||_Pt(e);let h=o,p=0;for(let v=0;v<d.length;v++){const y=new DataView(this.buffer,this.byteOffset+d[v],f[v]),g=h>u?u:h;h-=g;let m=y;switch(e.compression){case 1:break;case 5:{m=ZPt(y);break}case 8:{m=wkt(y);break}case 2:throw em("Compression","CCITT Group 3");case 32773:throw em("Compression","PackBits");default:throw em("Compression",e.compression)}p=this.fillUncompressed(i,a,s,m,p,g)}e.data=s}fillUncompressed(e,n,r,i,a,o){if(e===8)return Tkt(r,i,a,o);if(e===16)return Ikt(r,i,a,o,this.isLittleEndian());if(e===32&&n===3)return Akt(r,i,a,o,this.isLittleEndian());throw em("bitDepth",e)}applyPredictor(e){const n=e.bitsPerSample;switch(e.predictor){case 1:break;case 2:{if(n===8)TPt(e.data,e.width,e.components);else if(n===16)IPt(e.data,e.width,e.components);else throw new Error(`Horizontal differencing is only supported for images with a bit depth of ${n}`);break}default:throw new Error(`invalid predictor: ${e.predictor}`)}}convertAlpha(e){if(e.alpha&&e.associatedAlpha){const{data:n,components:r,maxSampleValue:i}=e;for(let a=0;a<n.length;a+=r){const o=n[a+r-1];for(let s=0;s<r-1;s++)n[a+s]=Math.round(n[a+s]*i/o)}}}}function _kt(t,e,n){if(e===8)return new Uint8Array(t);if(e===16)return new Uint16Array(t);if(e===32&&n===3)return new Float32Array(t);throw em("bit depth / sample format",`${e} / ${n}`)}function Tkt(t,e,n,r){for(let i=0;i<r;i++)t[n++]=e.getUint8(i);return n}function Ikt(t,e,n,r,i){for(let a=0;a<r*2;a+=2)t[n++]=e.getUint16(a,i);return n}function Akt(t,e,n,r,i){for(let a=0;a<r*4;a+=4)t[n++]=e.getFloat32(a,i);return n}function em(t,e){return new Error(`Unsupported ${t}: ${e}`)}function Mkt(t){if(t){for(const e of t)if(e<0||!Number.isInteger(e))throw new RangeError(`Index ${e} is invalid. Must be a positive integer.`)}}function OB(t,e){return new l6e(t).decode(e)}function Xpe(t){return new l6e(t).pageCount}function cd(t){return(e,...n)=>Lkt(t,e,n)}function HE(t,e){return cd(c6e(t,e).get)}const{apply:Lkt,construct:nHt,defineProperty:rHt,get:iHt,getOwnPropertyDescriptor:c6e,getPrototypeOf:hY,has:aHt,ownKeys:Rkt,set:oHt,setPrototypeOf:sHt}=Reflect,{iterator:SI,species:lHt,toStringTag:Okt,for:cHt}=Symbol,Pkt=Object,{create:pY,defineProperty:Nkt,freeze:uHt,is:dHt}=Pkt,Dkt=Array,kkt=Dkt.prototype,u6e=kkt[SI],Ukt=cd(u6e),d6e=ArrayBuffer,Fkt=d6e.prototype;HE(Fkt,"byteLength");const Zpe=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;Zpe&&HE(Zpe.prototype,"byteLength");const f6e=hY(Uint8Array);f6e.from;const df=f6e.prototype;df[SI];cd(df.keys);cd(df.values);cd(df.entries);cd(df.set);cd(df.reverse);cd(df.fill);cd(df.copyWithin);cd(df.sort);cd(df.slice);cd(df.subarray);HE(df,"buffer");HE(df,"byteOffset");HE(df,"length");HE(df,Okt);const Bkt=Uint8Array,h6e=Uint16Array,vY=Uint32Array,Vkt=Float32Array,S5=hY([][SI]()),p6e=cd(S5.next),$kt=cd(function*(){}().next),zkt=hY(S5),Hkt=DataView.prototype,Gkt=cd(Hkt.getUint16),gY=WeakMap,v6e=gY.prototype,g6e=cd(v6e.get),jkt=cd(v6e.set),m6e=new gY,Wkt=pY(null,{next:{value:function(){const e=g6e(m6e,this);return p6e(e)}},[SI]:{value:function(){return this}}});function Xkt(t){if(t[SI]===u6e&&S5.next===p6e)return t;const e=pY(Wkt);return jkt(m6e,e,Ukt(t)),e}const Zkt=new gY,Kkt=pY(zkt,{next:{value:function(){const e=g6e(Zkt,this);return $kt(e)},writable:!0,configurable:!0}});for(const t of Rkt(S5))t!=="next"&&Nkt(Kkt,t,c6e(S5,t));const y6e=new d6e(4),Ykt=new Vkt(y6e),qkt=new vY(y6e),Bv=new h6e(512),Vv=new Bkt(512);for(let t=0;t<256;++t){const e=t-127;e<-24?(Bv[t]=0,Bv[t|256]=32768,Vv[t]=24,Vv[t|256]=24):e<-14?(Bv[t]=1024>>-e-14,Bv[t|256]=1024>>-e-14|32768,Vv[t]=-e-1,Vv[t|256]=-e-1):e<=15?(Bv[t]=e+15<<10,Bv[t|256]=e+15<<10|32768,Vv[t]=13,Vv[t|256]=13):e<128?(Bv[t]=31744,Bv[t|256]=64512,Vv[t]=24,Vv[t|256]=24):(Bv[t]=31744,Bv[t|256]=64512,Vv[t]=13,Vv[t|256]=13)}const mY=new vY(2048);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;!(e&8388608);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,mY[t]=e|n}for(let t=1024;t<2048;++t)mY[t]=939524096+(t-1024<<13);const GE=new vY(64);for(let t=1;t<31;++t)GE[t]=t<<23;GE[31]=1199570944;GE[32]=2147483648;for(let t=33;t<63;++t)GE[t]=2147483648+(t-32<<23);GE[63]=3347054592;const b6e=new h6e(64);for(let t=1;t<64;++t)t!==32&&(b6e[t]=1024);function Jkt(t){const e=t>>10;return qkt[0]=mY[b6e[e]+(t&1023)]+GE[e],Ykt[0]}function x6e(t,e,...n){return Jkt(Gkt(t,e,...Xkt(n)))}var sw={},Qkt={get exports(){return sw},set exports(t){sw=t}};function C6e(t,e,n){const r=n&&n.debug||!1;r&&console.log("[xml-utils] getting "+e+" in "+t);const i=typeof t=="object"?t.outer:t,a=i.slice(0,i.indexOf(">")+1),o=['"',"'"];for(let s=0;s<o.length;s++){const c=o[s],u=e+"\\="+c+"([^"+c+"]*)"+c;r&&console.log("[xml-utils] pattern:",u);const f=new RegExp(u).exec(a);if(r&&console.log("[xml-utils] match:",f),f)return f[1]}}Qkt.exports=C6e;sw.default=C6e;var mR={},eUt={get exports(){return mR},set exports(t){mR=t}},yR={},tUt={get exports(){return yR},set exports(t){yR=t}},bR={},nUt={get exports(){return bR},set exports(t){bR=t}};function S6e(t,e,n){const i=new RegExp(e).exec(t.slice(n));return i?n+i.index:-1}nUt.exports=S6e;bR.default=S6e;var xR={},rUt={get exports(){return xR},set exports(t){xR=t}};function w6e(t,e,n){const i=new RegExp(e).exec(t.slice(n));return i?n+i.index+i[0].length-1:-1}rUt.exports=w6e;xR.default=w6e;var CR={},iUt={get exports(){return CR},set exports(t){CR=t}};function E6e(t,e){const n=new RegExp(e,"g"),r=t.match(n);return r?r.length:0}iUt.exports=E6e;CR.default=E6e;const aUt=bR,PB=xR,Kpe=CR;function _6e(t,e,n){const r=n&&n.debug||!1,i=!(n&&typeof n.nested===!1),a=n&&n.startIndex||0;r&&console.log("[xml-utils] starting findTagByName with",e," and ",n);const o=aUt(t,`<${e}[
|
|
4469
4469
|
>/]`,a);if(r&&console.log("[xml-utils] start:",o),o===-1)return;const s=t.slice(o+e.length);let c=PB(s,"^[^<]*[ /]>",0);const u=c!==-1&&s[c-1]==="/";if(r&&console.log("[xml-utils] selfClosing:",u),u===!1)if(i){let p=0,v=1,y=0;for(;(c=PB(s,"[ /]"+e+">",p))!==-1;){const g=s.substring(p,c+1);if(v+=Kpe(g,"<"+e+`[
|
|
4470
|
-
>]`),y+=Kpe(g,"</"+e+">"),y>=v)break;p=c}}else c=PB(s,"[ /]"+e+">",0);const d=o+e.length+c+1;if(r&&console.log("[xml-utils] end:",d),d===-1)return;const f=t.slice(o,d);let h;return u?h=null:h=f.slice(f.indexOf(">")+1,f.lastIndexOf("<")),{inner:h,outer:f,start:o,end:d}}tUt.exports=_6e;yR.default=_6e;const oUt=yR;function T6e(t,e,n){const r=[],i=n&&n.debug||!1,a=n&&typeof n.nested=="boolean"?n.nested:!0;let o=n&&n.startIndex||0,s;for(;s=oUt(t,e,{debug:i,startIndex:o});)a?o=s.start+1+e.length:o=s.end,r.push(s);return i&&console.log("findTagsByName found",r.length,"tags"),r}eUt.exports=T6e;mR.default=T6e;const d4={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Wv={};for(const t in d4)d4.hasOwnProperty(t)&&(Wv[d4[t]]=parseInt(t,10));const sUt=[Wv.BitsPerSample,Wv.ExtraSamples,Wv.SampleFormat,Wv.StripByteCounts,Wv.StripOffsets,Wv.StripRowCounts,Wv.TileByteCounts,Wv.TileOffsets,Wv.SubIFDs],NB={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},ao={};for(const t in NB)NB.hasOwnProperty(t)&&(ao[NB[t]]=parseInt(t,10));const Hf={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},lUt={Unspecified:0,Assocalpha:1,Unassalpha:2},cUt={Version:0,AddCompression:1},uUt={None:0,Deflate:1,Zstandard:2},dUt={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function fUt(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3);let a;for(let o=0,s=0;o<t.length;++o,s+=3)a=256-t[o]/e*256,i[s]=a,i[s+1]=a,i[s+2]=a;return i}function hUt(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3);let a;for(let o=0,s=0;o<t.length;++o,s+=3)a=t[o]/e*256,i[s]=a,i[s+1]=a,i[s+2]=a;return i}function pUt(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3),a=e.length/3,o=e.length/3*2;for(let s=0,c=0;s<t.length;++s,c+=3){const u=t[s];i[c]=e[u]/65536*256,i[c+1]=e[u+a]/65536*256,i[c+2]=e[u+o]/65536*256}return i}function vUt(t){const{width:e,height:n}=t,r=new Uint8Array(e*n*3);for(let i=0,a=0;i<t.length;i+=4,a+=3){const o=t[i],s=t[i+1],c=t[i+2],u=t[i+3];r[a]=255*((255-o)/256)*((255-u)/256),r[a+1]=255*((255-s)/256)*((255-u)/256),r[a+2]=255*((255-c)/256)*((255-u)/256)}return r}function gUt(t){const{width:e,height:n}=t,r=new Uint8ClampedArray(e*n*3);for(let i=0,a=0;i<t.length;i+=3,a+=3){const o=t[i],s=t[i+1],c=t[i+2];r[a]=o+1.402*(c-128),r[a+1]=o-.34414*(s-128)-.71414*(c-128),r[a+2]=o+1.772*(s-128)}return r}const mUt=.95047,yUt=1,bUt=1.08883;function xUt(t){const{width:e,height:n}=t,r=new Uint8Array(e*n*3);for(let i=0,a=0;i<t.length;i+=3,a+=3){const o=t[i+0],s=t[i+1]<<24>>24,c=t[i+2]<<24>>24;let u=(o+16)/116,d=s/500+u,f=u-c/200,h,p,v;d=mUt*(d*d*d>.008856?d*d*d:(d-16/116)/7.787),u=yUt*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),f=bUt*(f*f*f>.008856?f*f*f:(f-16/116)/7.787),h=d*3.2406+u*-1.5372+f*-.4986,p=d*-.9689+u*1.8758+f*.0415,v=d*.0557+u*-.204+f*1.057,h=h>.0031308?1.055*h**(1/2.4)-.055:12.92*h,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,v=v>.0031308?1.055*v**(1/2.4)-.055:12.92*v,r[a]=Math.max(0,Math.min(1,h))*255,r[a+1]=Math.max(0,Math.min(1,p))*255,r[a+2]=Math.max(0,Math.min(1,v))*255}return r}const I6e=new Map;function Y1(t,e){Array.isArray(t)||(t=[t]),t.forEach(n=>I6e.set(n,e))}async function CUt(t){const e=I6e.get(t.Compression);if(!e)throw new Error(`Unknown compression method identifier: ${t.Compression}`);const n=await e();return new n(t)}Y1([void 0,1],()=>Promise.resolve().then(()=>require("./raw-9c0f4034.js")).then(t=>t.default));Y1(5,()=>Promise.resolve().then(()=>require("./lzw-f00e8c8c.js")).then(t=>t.default));Y1(6,()=>{throw new Error("old style JPEG compression is not supported.")});Y1(7,()=>Promise.resolve().then(()=>require("./jpeg-f3c7cefc.js")).then(t=>t.default));Y1([8,32946],()=>Promise.resolve().then(()=>require("./deflate-5ab4997b.js")).then(t=>t.default));Y1(32773,()=>Promise.resolve().then(()=>require("./packbits-58fd9c05.js")).then(t=>t.default));Y1(34887,()=>Promise.resolve().then(()=>require("./lerc-9b834f36.js")).then(async t=>(await t.zstd.init(),t)).then(t=>t.default));Y1(50001,()=>Promise.resolve().then(()=>require("./webimage-bc81928d.js")).then(t=>t.default));function rP(t,e,n,r=1){return new(Object.getPrototypeOf(t)).constructor(e*n*r)}function SUt(t,e,n,r,i){const a=e/r,o=n/i;return t.map(s=>{const c=rP(s,r,i);for(let u=0;u<i;++u){const d=Math.min(Math.round(o*u),n-1);for(let f=0;f<r;++f){const h=Math.min(Math.round(a*f),e-1),p=s[d*e+h];c[u*r+f]=p}}return c})}function lw(t,e,n){return(1-n)*t+n*e}function wUt(t,e,n,r,i){const a=e/r,o=n/i;return t.map(s=>{const c=rP(s,r,i);for(let u=0;u<i;++u){const d=o*u,f=Math.floor(d),h=Math.min(Math.ceil(d),n-1);for(let p=0;p<r;++p){const v=a*p,y=v%1,g=Math.floor(v),m=Math.min(Math.ceil(v),e-1),b=s[f*e+g],x=s[f*e+m],S=s[h*e+g],w=s[h*e+m],_=lw(lw(b,x,y),lw(S,w,y),d%1);c[u*r+p]=_}}return c})}function EUt(t,e,n,r,i,a="nearest"){switch(a.toLowerCase()){case"nearest":return SUt(t,e,n,r,i);case"bilinear":case"linear":return wUt(t,e,n,r,i);default:throw new Error(`Unsupported resampling method: '${a}'`)}}function _Ut(t,e,n,r,i,a){const o=e/r,s=n/i,c=rP(t,r,i,a);for(let u=0;u<i;++u){const d=Math.min(Math.round(s*u),n-1);for(let f=0;f<r;++f){const h=Math.min(Math.round(o*f),e-1);for(let p=0;p<a;++p){const v=t[d*e*a+h*a+p];c[u*r*a+f*a+p]=v}}}return c}function TUt(t,e,n,r,i,a){const o=e/r,s=n/i,c=rP(t,r,i,a);for(let u=0;u<i;++u){const d=s*u,f=Math.floor(d),h=Math.min(Math.ceil(d),n-1);for(let p=0;p<r;++p){const v=o*p,y=v%1,g=Math.floor(v),m=Math.min(Math.ceil(v),e-1);for(let b=0;b<a;++b){const x=t[f*e*a+g*a+b],S=t[f*e*a+m*a+b],w=t[h*e*a+g*a+b],_=t[h*e*a+m*a+b],A=lw(lw(x,S,y),lw(w,_,y),d%1);c[u*r*a+p*a+b]=A}}}return c}function IUt(t,e,n,r,i,a,o="nearest"){switch(o.toLowerCase()){case"nearest":return _Ut(t,e,n,r,i,a);case"bilinear":case"linear":return TUt(t,e,n,r,i,a);default:throw new Error(`Unsupported resampling method: '${o}'`)}}function AUt(t,e,n){let r=0;for(let i=e;i<n;++i)r+=t[i];return r}function XG(t,e,n){switch(t){case 1:if(e<=8)return new Uint8Array(n);if(e<=16)return new Uint16Array(n);if(e<=32)return new Uint32Array(n);break;case 2:if(e===8)return new Int8Array(n);if(e===16)return new Int16Array(n);if(e===32)return new Int32Array(n);break;case 3:switch(e){case 16:case 32:return new Float32Array(n);case 64:return new Float64Array(n)}break}throw Error("Unsupported data format/bitsPerSample")}function MUt(t,e){return(t===1||t===2)&&e<=32&&e%8===0?!1:!(t===3&&(e===16||e===32||e===64))}function LUt(t,e,n,r,i,a,o){const s=new DataView(t),c=n===2?o*a:o*a*r,u=n===2?1:r,d=XG(e,i,c),f=parseInt("1".repeat(i),2);if(e===1){let h;n===1?h=r*i:h=i;let p=a*h;p&7&&(p=p+7&-8);for(let v=0;v<o;++v){const y=v*p;for(let g=0;g<a;++g){const m=y+g*u*i;for(let b=0;b<u;++b){const x=m+b*i,S=(v*a+g)*u+b,w=Math.floor(x/8),_=x%8;if(_+i<=8)d[S]=s.getUint8(w)>>8-i-_&f;else if(_+i<=16)d[S]=s.getUint16(w)>>16-i-_&f;else if(_+i<=24){const A=s.getUint16(w)<<8|s.getUint8(w+2);d[S]=A>>24-i-_&f}else d[S]=s.getUint32(w)>>32-i-_&f}}}}return d.buffer}class RUt{constructor(e,n,r,i,a,o){this.fileDirectory=e,this.geoKeys=n,this.dataView=r,this.littleEndian=i,this.tiles=a?{}:null,this.isTiled=!e.StripOffsets;const s=e.PlanarConfiguration;if(this.planarConfiguration=typeof s>"u"?1:s,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}getBytesPerPixel(){let e=0;for(let n=0;n<this.fileDirectory.BitsPerSample.length;++n)e+=this.getSampleByteSize(n);return e}getSampleByteSize(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${e} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}getReaderForSample(e){const n=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,r=this.fileDirectory.BitsPerSample[e];switch(n){case 1:if(r<=8)return DataView.prototype.getUint8;if(r<=16)return DataView.prototype.getUint16;if(r<=32)return DataView.prototype.getUint32;break;case 2:if(r<=8)return DataView.prototype.getInt8;if(r<=16)return DataView.prototype.getInt16;if(r<=32)return DataView.prototype.getInt32;break;case 3:switch(r){case 16:return function(i,a){return x6e(this,i,a)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(e=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}getBitsPerSample(e=0){return this.fileDirectory.BitsPerSample[e]}getArrayForSample(e,n){const r=this.getSampleFormat(e),i=this.getBitsPerSample(e);return XG(r,i,n)}async getTileOrStrip(e,n,r,i,a){const o=Math.ceil(this.getWidth()/this.getTileWidth()),s=Math.ceil(this.getHeight()/this.getTileHeight());let c;const{tiles:u}=this;this.planarConfiguration===1?c=n*o+e:this.planarConfiguration===2&&(c=r*o*s+n*o+e);let d,f;this.isTiled?(d=this.fileDirectory.TileOffsets[c],f=this.fileDirectory.TileByteCounts[c]):(d=this.fileDirectory.StripOffsets[c],f=this.fileDirectory.StripByteCounts[c]);const h=(await this.source.fetch([{offset:d,length:f}],a))[0];let p;return u===null||!u[c]?(p=(async()=>{let v=await i.decode(this.fileDirectory,h);const y=this.getSampleFormat(),g=this.getBitsPerSample();return MUt(y,g)&&(v=LUt(v,y,this.planarConfiguration,this.getSamplesPerPixel(),g,this.getTileWidth(),this.getBlockHeight(n))),v})(),u!==null&&(u[c]=p)):p=u[c],{x:e,y:n,sample:r,data:await p}}async _readRaster(e,n,r,i,a,o,s,c,u){const d=this.getTileWidth(),f=this.getTileHeight(),h=this.getWidth(),p=this.getHeight(),v=Math.max(Math.floor(e[0]/d),0),y=Math.min(Math.ceil(e[2]/d),Math.ceil(h/d)),g=Math.max(Math.floor(e[1]/f),0),m=Math.min(Math.ceil(e[3]/f),Math.ceil(p/f)),b=e[2]-e[0];let x=this.getBytesPerPixel();const S=[],w=[];for(let P=0;P<n.length;++P)this.planarConfiguration===1?S.push(AUt(this.fileDirectory.BitsPerSample,0,n[P])/8):S.push(0),w.push(this.getReaderForSample(n[P]));const _=[],{littleEndian:A}=this;for(let P=g;P<m;++P)for(let R=v;R<y;++R){let N;this.planarConfiguration===1&&(N=this.getTileOrStrip(R,P,0,a,u));for(let k=0;k<n.length;++k){const B=k,H=n[k];this.planarConfiguration===2&&(x=this.getSampleByteSize(H),N=this.getTileOrStrip(R,P,H,a,u));const F=N.then(G=>{const z=G.data,V=new DataView(z),j=this.getBlockHeight(G.y),Y=G.y*f,W=G.x*d,Z=Y+j,te=(G.x+1)*d,se=w[B],q=Math.min(j,j-(Z-e[3]),p-Y),ne=Math.min(d,d-(te-e[2]),h-W);for(let oe=Math.max(0,e[1]-Y);oe<q;++oe)for(let ie=Math.max(0,e[0]-W);ie<ne;++ie){const ee=(oe*d+ie)*x,ye=se.call(V,ee+S[B],A);let ve;i?(ve=(oe+Y-e[1])*b*n.length+(ie+W-e[0])*n.length+B,r[ve]=ye):(ve=(oe+Y-e[1])*b+ie+W-e[0],r[B][ve]=ye)}});_.push(F)}}if(await Promise.all(_),o&&e[2]-e[0]!==o||s&&e[3]-e[1]!==s){let P;return i?P=IUt(r,e[2]-e[0],e[3]-e[1],o,s,n.length,c):P=EUt(r,e[2]-e[0],e[3]-e[1],o,s,c),P.width=o,P.height=s,P}return r.width=o||e[2]-e[0],r.height=s||e[3]-e[1],r}async readRasters({window:e,samples:n=[],interleave:r,pool:i=null,width:a,height:o,resampleMethod:s,fillValue:c,signal:u}={}){const d=e||[0,0,this.getWidth(),this.getHeight()];if(d[0]>d[2]||d[1]>d[3])throw new Error("Invalid subsets");const f=d[2]-d[0],h=d[3]-d[1],p=f*h,v=this.getSamplesPerPixel();if(!n||!n.length)for(let b=0;b<v;++b)n.push(b);else for(let b=0;b<n.length;++b)if(n[b]>=v)return Promise.reject(new RangeError(`Invalid sample index '${n[b]}'.`));let y;if(r){const b=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,x=Math.max.apply(null,this.fileDirectory.BitsPerSample);y=XG(b,x,p*n.length),c&&y.fill(c)}else{y=[];for(let b=0;b<n.length;++b){const x=this.getArrayForSample(n[b],p);Array.isArray(c)&&b<c.length?x.fill(c[b]):c&&!Array.isArray(c)&&x.fill(c),y.push(x)}}const g=i||await CUt(this.fileDirectory);return await this._readRaster(d,n,y,r,g,a,o,s,u)}async readRGB({window:e,interleave:n=!0,pool:r=null,width:i,height:a,resampleMethod:o,enableAlpha:s=!1,signal:c}={}){const u=e||[0,0,this.getWidth(),this.getHeight()];if(u[0]>u[2]||u[1]>u[3])throw new Error("Invalid subsets");const d=this.fileDirectory.PhotometricInterpretation;if(d===Hf.RGB){let m=[0,1,2];if(this.fileDirectory.ExtraSamples!==lUt.Unspecified&&s){m=[];for(let b=0;b<this.fileDirectory.BitsPerSample.length;b+=1)m.push(b)}return this.readRasters({window:e,interleave:n,samples:m,pool:r,width:i,height:a,resampleMethod:o,signal:c})}let f;switch(d){case Hf.WhiteIsZero:case Hf.BlackIsZero:case Hf.Palette:f=[0];break;case Hf.CMYK:f=[0,1,2,3];break;case Hf.YCbCr:case Hf.CIELab:f=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const h={window:u,interleave:!0,samples:f,pool:r,width:i,height:a,resampleMethod:o,signal:c},{fileDirectory:p}=this,v=await this.readRasters(h),y=2**this.fileDirectory.BitsPerSample[0];let g;switch(d){case Hf.WhiteIsZero:g=fUt(v,y);break;case Hf.BlackIsZero:g=hUt(v,y);break;case Hf.Palette:g=pUt(v,p.ColorMap);break;case Hf.CMYK:g=vUt(v);break;case Hf.YCbCr:g=gUt(v);break;case Hf.CIELab:g=xUt(v);break;default:throw new Error("Unsupported photometric interpretation.")}if(!n){const m=new Uint8Array(g.length/3),b=new Uint8Array(g.length/3),x=new Uint8Array(g.length/3);for(let S=0,w=0;S<g.length;S+=3,++w)m[w]=g[S],b[w]=g[S+1],x[w]=g[S+2];g=[m,b,x]}return g.width=v.width,g.height=v.height,g}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const e=[];for(let n=0;n<this.fileDirectory.ModelTiepoint.length;n+=6)e.push({i:this.fileDirectory.ModelTiepoint[n],j:this.fileDirectory.ModelTiepoint[n+1],k:this.fileDirectory.ModelTiepoint[n+2],x:this.fileDirectory.ModelTiepoint[n+3],y:this.fileDirectory.ModelTiepoint[n+4],z:this.fileDirectory.ModelTiepoint[n+5]});return e}getGDALMetadata(e=null){const n={};if(!this.fileDirectory.GDAL_METADATA)return null;const r=this.fileDirectory.GDAL_METADATA;let i=mR(r,"Item");e===null?i=i.filter(a=>sw(a,"sample")===void 0):i=i.filter(a=>Number(sw(a,"sample"))===e);for(let a=0;a<i.length;++a){const o=i[a];n[sw(o,"name")]=o.inner}return n}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}getOrigin(){const e=this.fileDirectory.ModelTiepoint,n=this.fileDirectory.ModelTransformation;if(e&&e.length===6)return[e[3],e[4],e[5]];if(n)return[n[3],n[7],n[11]];throw new Error("The image does not have an affine transformation.")}getResolution(e=null){const n=this.fileDirectory.ModelPixelScale,r=this.fileDirectory.ModelTransformation;if(n)return[n[0],-n[1],n[2]];if(r)return r[1]===0&&r[4]===0?[r[0],-r[5],r[10]]:[Math.sqrt(r[0]*r[0]+r[4]*r[4]),-Math.sqrt(r[1]*r[1]+r[5]*r[5]),r[10]];if(e){const[i,a,o]=e.getResolution();return[i*e.getWidth()/this.getWidth(),a*e.getHeight()/this.getHeight(),o*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return this.geoKeys.GTRasterTypeGeoKey===1}getBoundingBox(e=!1){const n=this.getHeight(),r=this.getWidth();if(this.fileDirectory.ModelTransformation&&!e){const[i,a,o,s,c,u,d,f]=this.fileDirectory.ModelTransformation,p=[[0,0],[0,n],[r,0],[r,n]].map(([g,m])=>[s+i*g+a*m,f+c*g+u*m]),v=p.map(g=>g[0]),y=p.map(g=>g[1]);return[Math.min(...v),Math.min(...y),Math.max(...v),Math.max(...y)]}else{const i=this.getOrigin(),a=this.getResolution(),o=i[0],s=i[1],c=o+a[0]*r,u=s+a[1]*n;return[Math.min(o,c),Math.min(s,u),Math.max(o,c),Math.max(s,u)]}}}const OUt=RUt;class PUt{constructor(e){this._dataView=new DataView(e)}get buffer(){return this._dataView.buffer}getUint64(e,n){const r=this.getUint32(e,n),i=this.getUint32(e+4,n);let a;if(n){if(a=r+2**32*i,!Number.isSafeInteger(a))throw new Error(`${a} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return a}if(a=2**32*r+i,!Number.isSafeInteger(a))throw new Error(`${a} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return a}getInt64(e,n){let r=0;const i=(this._dataView.getUint8(e+(n?7:0))&128)>0;let a=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(e+(n?o:7-o));i&&(a?s!==0&&(s=~(s-1)&255,a=!1):s=~s&255),r+=s*256**o}return i&&(r=-r),r}getUint8(e,n){return this._dataView.getUint8(e,n)}getInt8(e,n){return this._dataView.getInt8(e,n)}getUint16(e,n){return this._dataView.getUint16(e,n)}getInt16(e,n){return this._dataView.getInt16(e,n)}getUint32(e,n){return this._dataView.getUint32(e,n)}getInt32(e,n){return this._dataView.getInt32(e,n)}getFloat16(e,n){return x6e(this._dataView,e,n)}getFloat32(e,n){return this._dataView.getFloat32(e,n)}getFloat64(e,n){return this._dataView.getFloat64(e,n)}}class NUt{constructor(e,n,r,i){this._dataView=new DataView(e),this._sliceOffset=n,this._littleEndian=r,this._bigTiff=i}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(e,n){return this.sliceOffset<=e&&this.sliceTop>=e+n}readUint8(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}readInt8(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}readUint16(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}readInt16(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}readUint32(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}readInt32(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}readFloat32(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}readFloat64(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}readUint64(e){const n=this.readUint32(e),r=this.readUint32(e+4);let i;if(this._littleEndian){if(i=n+2**32*r,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}if(i=2**32*n+r,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}readInt64(e){let n=0;const r=(this._dataView.getUint8(e+(this._littleEndian?7:0))&128)>0;let i=!0;for(let a=0;a<8;a++){let o=this._dataView.getUint8(e+(this._littleEndian?a:7-a));r&&(i?o!==0&&(o=~(o-1)&255,i=!1):o=~o&255),n+=o*256**a}return r&&(n=-n),n}readOffset(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}}class DUt{async fetch(e,n=void 0){return Promise.all(e.map(r=>this.fetchSlice(r,n)))}async fetchSlice(e){throw new Error(`fetching of slice ${e} not possible, not implemented`)}get fileSize(){return null}async close(){}}class yY extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,yY),this.name="AbortError"}}class kUt extends DUt{constructor(e){super(),this.arrayBuffer=e}fetchSlice(e,n){if(n&&n.aborted)throw new yY("Request aborted");return this.arrayBuffer.slice(e.offset,e.offset+e.length)}}function UUt(t){return new kUt(t)}function ZG(t){switch(t){case ao.BYTE:case ao.ASCII:case ao.SBYTE:case ao.UNDEFINED:return 1;case ao.SHORT:case ao.SSHORT:return 2;case ao.LONG:case ao.SLONG:case ao.FLOAT:case ao.IFD:return 4;case ao.RATIONAL:case ao.SRATIONAL:case ao.DOUBLE:case ao.LONG8:case ao.SLONG8:case ao.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${t}`)}}function FUt(t){const e=t.GeoKeyDirectory;if(!e)return null;const n={};for(let r=4;r<=e[3]*4;r+=4){const i=dUt[e[r]],a=e[r+1]?d4[e[r+1]]:null,o=e[r+2],s=e[r+3];let c=null;if(!a)c=s;else{if(c=t[a],typeof c>"u"||c===null)throw new Error(`Could not get value of geoKey '${i}'.`);typeof c=="string"?c=c.substring(s,s+o-1):c.subarray&&(c=c.subarray(s,s+o),o===1&&(c=c[0]))}n[i]=c}return n}function kC(t,e,n,r){let i=null,a=null;const o=ZG(e);switch(e){case ao.BYTE:case ao.ASCII:case ao.UNDEFINED:i=new Uint8Array(n),a=t.readUint8;break;case ao.SBYTE:i=new Int8Array(n),a=t.readInt8;break;case ao.SHORT:i=new Uint16Array(n),a=t.readUint16;break;case ao.SSHORT:i=new Int16Array(n),a=t.readInt16;break;case ao.LONG:case ao.IFD:i=new Uint32Array(n),a=t.readUint32;break;case ao.SLONG:i=new Int32Array(n),a=t.readInt32;break;case ao.LONG8:case ao.IFD8:i=new Array(n),a=t.readUint64;break;case ao.SLONG8:i=new Array(n),a=t.readInt64;break;case ao.RATIONAL:i=new Uint32Array(n*2),a=t.readUint32;break;case ao.SRATIONAL:i=new Int32Array(n*2),a=t.readInt32;break;case ao.FLOAT:i=new Float32Array(n),a=t.readFloat32;break;case ao.DOUBLE:i=new Float64Array(n),a=t.readFloat64;break;default:throw new RangeError(`Invalid field type: ${e}`)}if(e===ao.RATIONAL||e===ao.SRATIONAL)for(let s=0;s<n;s+=2)i[s]=a.call(t,r+s*o),i[s+1]=a.call(t,r+(s*o+4));else for(let s=0;s<n;++s)i[s]=a.call(t,r+s*o);return e===ao.ASCII?new TextDecoder("utf-8").decode(i):i}class BUt{constructor(e,n,r){this.fileDirectory=e,this.geoKeyDirectory=n,this.nextIFDByteOffset=r}}class iM extends Error{constructor(e){super(`No image at index ${e}`),this.index=e}}class VUt{async readRasters(e={}){const{window:n,width:r,height:i}=e;let{resX:a,resY:o,bbox:s}=e;const c=await this.getImage();let u=c;const d=await this.getImageCount(),f=c.getBoundingBox();if(n&&s)throw new Error('Both "bbox" and "window" passed.');if(r||i){if(n){const[v,y]=c.getOrigin(),[g,m]=c.getResolution();s=[v+n[0]*g,y+n[1]*m,v+n[2]*g,y+n[3]*m]}const p=s||f;if(r){if(a)throw new Error("Both width and resX passed");a=(p[2]-p[0])/r}if(i){if(o)throw new Error("Both width and resY passed");o=(p[3]-p[1])/i}}if(a||o){const p=[];for(let v=0;v<d;++v){const y=await this.getImage(v),{SubfileType:g,NewSubfileType:m}=y.fileDirectory;(v===0||g===2||m&1)&&p.push(y)}p.sort((v,y)=>v.getWidth()-y.getWidth());for(let v=0;v<p.length;++v){const y=p[v],g=(f[2]-f[0])/y.getWidth(),m=(f[3]-f[1])/y.getHeight();if(u=y,a&&a>g||o&&o>m)break}}let h=n;if(s){const[p,v]=c.getOrigin(),[y,g]=u.getResolution(c);h=[Math.round((s[0]-p)/y),Math.round((s[1]-v)/g),Math.round((s[2]-p)/y),Math.round((s[3]-v)/g)],h=[Math.min(h[0],h[2]),Math.min(h[1],h[3]),Math.max(h[0],h[2]),Math.max(h[1],h[3])]}return u.readRasters({...e,window:h})}}class bY extends VUt{constructor(e,n,r,i,a={}){super(),this.source=e,this.littleEndian=n,this.bigTiff=r,this.firstIFDOffset=i,this.cache=a.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(e,n){const r=this.bigTiff?4048:1024;return new NUt((await this.source.fetch([{offset:e,length:typeof n<"u"?n:r}]))[0],e,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(e){const n=this.bigTiff?20:12,r=this.bigTiff?8:2;let i=await this.getSlice(e);const a=this.bigTiff?i.readUint64(e):i.readUint16(e),o=a*n+(this.bigTiff?16:6);i.covers(e,o)||(i=await this.getSlice(e,o));const s={};let c=e+(this.bigTiff?8:2);for(let f=0;f<a;c+=n,++f){const h=i.readUint16(c),p=i.readUint16(c+2),v=this.bigTiff?i.readUint64(c+4):i.readUint32(c+4);let y,g;const m=ZG(p),b=c+(this.bigTiff?12:8);if(m*v<=(this.bigTiff?8:4))y=kC(i,p,v,b);else{const x=i.readOffset(b),S=ZG(p)*v;if(i.covers(x,S))y=kC(i,p,v,x);else{const w=await this.getSlice(x,S);y=kC(w,p,v,x)}}v===1&&sUt.indexOf(h)===-1&&!(p===ao.RATIONAL||p===ao.SRATIONAL)?g=y[0]:g=y,s[d4[h]]=g}const u=FUt(s),d=i.readOffset(e+r+n*a);return new BUt(s,u,d)}async requestIFD(e){if(this.ifdRequests[e])return this.ifdRequests[e];if(e===0)return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[e];if(!this.ifdRequests[e-1])try{this.ifdRequests[e-1]=this.requestIFD(e-1)}catch(n){throw n instanceof iM?new iM(e):n}return this.ifdRequests[e]=(async()=>{const n=await this.ifdRequests[e-1];if(n.nextIFDByteOffset===0)throw new iM(e);return this.parseFileDirectoryAt(n.nextIFDByteOffset)})(),this.ifdRequests[e]}async getImage(e=0){const n=await this.requestIFD(e);return new OUt(n.fileDirectory,n.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let e=0,n=!0;for(;n;)try{await this.requestIFD(e),++e}catch(r){if(r instanceof iM)n=!1;else throw r}return e}async getGhostValues(){const e=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const n="GDAL_STRUCTURAL_METADATA_SIZE=",r=n.length+100;let i=await this.getSlice(e,r);if(n===kC(i,ao.ASCII,n.length,e)){const o=kC(i,ao.ASCII,r,e).split(`
|
|
4470
|
+
>]`),y+=Kpe(g,"</"+e+">"),y>=v)break;p=c}}else c=PB(s,"[ /]"+e+">",0);const d=o+e.length+c+1;if(r&&console.log("[xml-utils] end:",d),d===-1)return;const f=t.slice(o,d);let h;return u?h=null:h=f.slice(f.indexOf(">")+1,f.lastIndexOf("<")),{inner:h,outer:f,start:o,end:d}}tUt.exports=_6e;yR.default=_6e;const oUt=yR;function T6e(t,e,n){const r=[],i=n&&n.debug||!1,a=n&&typeof n.nested=="boolean"?n.nested:!0;let o=n&&n.startIndex||0,s;for(;s=oUt(t,e,{debug:i,startIndex:o});)a?o=s.start+1+e.length:o=s.end,r.push(s);return i&&console.log("findTagsByName found",r.length,"tags"),r}eUt.exports=T6e;mR.default=T6e;const d4={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Wv={};for(const t in d4)d4.hasOwnProperty(t)&&(Wv[d4[t]]=parseInt(t,10));const sUt=[Wv.BitsPerSample,Wv.ExtraSamples,Wv.SampleFormat,Wv.StripByteCounts,Wv.StripOffsets,Wv.StripRowCounts,Wv.TileByteCounts,Wv.TileOffsets,Wv.SubIFDs],NB={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},ao={};for(const t in NB)NB.hasOwnProperty(t)&&(ao[NB[t]]=parseInt(t,10));const Hf={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},lUt={Unspecified:0,Assocalpha:1,Unassalpha:2},cUt={Version:0,AddCompression:1},uUt={None:0,Deflate:1,Zstandard:2},dUt={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function fUt(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3);let a;for(let o=0,s=0;o<t.length;++o,s+=3)a=256-t[o]/e*256,i[s]=a,i[s+1]=a,i[s+2]=a;return i}function hUt(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3);let a;for(let o=0,s=0;o<t.length;++o,s+=3)a=t[o]/e*256,i[s]=a,i[s+1]=a,i[s+2]=a;return i}function pUt(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3),a=e.length/3,o=e.length/3*2;for(let s=0,c=0;s<t.length;++s,c+=3){const u=t[s];i[c]=e[u]/65536*256,i[c+1]=e[u+a]/65536*256,i[c+2]=e[u+o]/65536*256}return i}function vUt(t){const{width:e,height:n}=t,r=new Uint8Array(e*n*3);for(let i=0,a=0;i<t.length;i+=4,a+=3){const o=t[i],s=t[i+1],c=t[i+2],u=t[i+3];r[a]=255*((255-o)/256)*((255-u)/256),r[a+1]=255*((255-s)/256)*((255-u)/256),r[a+2]=255*((255-c)/256)*((255-u)/256)}return r}function gUt(t){const{width:e,height:n}=t,r=new Uint8ClampedArray(e*n*3);for(let i=0,a=0;i<t.length;i+=3,a+=3){const o=t[i],s=t[i+1],c=t[i+2];r[a]=o+1.402*(c-128),r[a+1]=o-.34414*(s-128)-.71414*(c-128),r[a+2]=o+1.772*(s-128)}return r}const mUt=.95047,yUt=1,bUt=1.08883;function xUt(t){const{width:e,height:n}=t,r=new Uint8Array(e*n*3);for(let i=0,a=0;i<t.length;i+=3,a+=3){const o=t[i+0],s=t[i+1]<<24>>24,c=t[i+2]<<24>>24;let u=(o+16)/116,d=s/500+u,f=u-c/200,h,p,v;d=mUt*(d*d*d>.008856?d*d*d:(d-16/116)/7.787),u=yUt*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),f=bUt*(f*f*f>.008856?f*f*f:(f-16/116)/7.787),h=d*3.2406+u*-1.5372+f*-.4986,p=d*-.9689+u*1.8758+f*.0415,v=d*.0557+u*-.204+f*1.057,h=h>.0031308?1.055*h**(1/2.4)-.055:12.92*h,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,v=v>.0031308?1.055*v**(1/2.4)-.055:12.92*v,r[a]=Math.max(0,Math.min(1,h))*255,r[a+1]=Math.max(0,Math.min(1,p))*255,r[a+2]=Math.max(0,Math.min(1,v))*255}return r}const I6e=new Map;function Y1(t,e){Array.isArray(t)||(t=[t]),t.forEach(n=>I6e.set(n,e))}async function CUt(t){const e=I6e.get(t.Compression);if(!e)throw new Error(`Unknown compression method identifier: ${t.Compression}`);const n=await e();return new n(t)}Y1([void 0,1],()=>Promise.resolve().then(()=>require("./raw-9c0f4034.js")).then(t=>t.default));Y1(5,()=>Promise.resolve().then(()=>require("./lzw-f00e8c8c.js")).then(t=>t.default));Y1(6,()=>{throw new Error("old style JPEG compression is not supported.")});Y1(7,()=>Promise.resolve().then(()=>require("./jpeg-f3c7cefc.js")).then(t=>t.default));Y1([8,32946],()=>Promise.resolve().then(()=>require("./deflate-e58b5c61.js")).then(t=>t.default));Y1(32773,()=>Promise.resolve().then(()=>require("./packbits-58fd9c05.js")).then(t=>t.default));Y1(34887,()=>Promise.resolve().then(()=>require("./lerc-b5fe725c.js")).then(async t=>(await t.zstd.init(),t)).then(t=>t.default));Y1(50001,()=>Promise.resolve().then(()=>require("./webimage-bc81928d.js")).then(t=>t.default));function rP(t,e,n,r=1){return new(Object.getPrototypeOf(t)).constructor(e*n*r)}function SUt(t,e,n,r,i){const a=e/r,o=n/i;return t.map(s=>{const c=rP(s,r,i);for(let u=0;u<i;++u){const d=Math.min(Math.round(o*u),n-1);for(let f=0;f<r;++f){const h=Math.min(Math.round(a*f),e-1),p=s[d*e+h];c[u*r+f]=p}}return c})}function lw(t,e,n){return(1-n)*t+n*e}function wUt(t,e,n,r,i){const a=e/r,o=n/i;return t.map(s=>{const c=rP(s,r,i);for(let u=0;u<i;++u){const d=o*u,f=Math.floor(d),h=Math.min(Math.ceil(d),n-1);for(let p=0;p<r;++p){const v=a*p,y=v%1,g=Math.floor(v),m=Math.min(Math.ceil(v),e-1),b=s[f*e+g],x=s[f*e+m],S=s[h*e+g],w=s[h*e+m],_=lw(lw(b,x,y),lw(S,w,y),d%1);c[u*r+p]=_}}return c})}function EUt(t,e,n,r,i,a="nearest"){switch(a.toLowerCase()){case"nearest":return SUt(t,e,n,r,i);case"bilinear":case"linear":return wUt(t,e,n,r,i);default:throw new Error(`Unsupported resampling method: '${a}'`)}}function _Ut(t,e,n,r,i,a){const o=e/r,s=n/i,c=rP(t,r,i,a);for(let u=0;u<i;++u){const d=Math.min(Math.round(s*u),n-1);for(let f=0;f<r;++f){const h=Math.min(Math.round(o*f),e-1);for(let p=0;p<a;++p){const v=t[d*e*a+h*a+p];c[u*r*a+f*a+p]=v}}}return c}function TUt(t,e,n,r,i,a){const o=e/r,s=n/i,c=rP(t,r,i,a);for(let u=0;u<i;++u){const d=s*u,f=Math.floor(d),h=Math.min(Math.ceil(d),n-1);for(let p=0;p<r;++p){const v=o*p,y=v%1,g=Math.floor(v),m=Math.min(Math.ceil(v),e-1);for(let b=0;b<a;++b){const x=t[f*e*a+g*a+b],S=t[f*e*a+m*a+b],w=t[h*e*a+g*a+b],_=t[h*e*a+m*a+b],A=lw(lw(x,S,y),lw(w,_,y),d%1);c[u*r*a+p*a+b]=A}}}return c}function IUt(t,e,n,r,i,a,o="nearest"){switch(o.toLowerCase()){case"nearest":return _Ut(t,e,n,r,i,a);case"bilinear":case"linear":return TUt(t,e,n,r,i,a);default:throw new Error(`Unsupported resampling method: '${o}'`)}}function AUt(t,e,n){let r=0;for(let i=e;i<n;++i)r+=t[i];return r}function XG(t,e,n){switch(t){case 1:if(e<=8)return new Uint8Array(n);if(e<=16)return new Uint16Array(n);if(e<=32)return new Uint32Array(n);break;case 2:if(e===8)return new Int8Array(n);if(e===16)return new Int16Array(n);if(e===32)return new Int32Array(n);break;case 3:switch(e){case 16:case 32:return new Float32Array(n);case 64:return new Float64Array(n)}break}throw Error("Unsupported data format/bitsPerSample")}function MUt(t,e){return(t===1||t===2)&&e<=32&&e%8===0?!1:!(t===3&&(e===16||e===32||e===64))}function LUt(t,e,n,r,i,a,o){const s=new DataView(t),c=n===2?o*a:o*a*r,u=n===2?1:r,d=XG(e,i,c),f=parseInt("1".repeat(i),2);if(e===1){let h;n===1?h=r*i:h=i;let p=a*h;p&7&&(p=p+7&-8);for(let v=0;v<o;++v){const y=v*p;for(let g=0;g<a;++g){const m=y+g*u*i;for(let b=0;b<u;++b){const x=m+b*i,S=(v*a+g)*u+b,w=Math.floor(x/8),_=x%8;if(_+i<=8)d[S]=s.getUint8(w)>>8-i-_&f;else if(_+i<=16)d[S]=s.getUint16(w)>>16-i-_&f;else if(_+i<=24){const A=s.getUint16(w)<<8|s.getUint8(w+2);d[S]=A>>24-i-_&f}else d[S]=s.getUint32(w)>>32-i-_&f}}}}return d.buffer}class RUt{constructor(e,n,r,i,a,o){this.fileDirectory=e,this.geoKeys=n,this.dataView=r,this.littleEndian=i,this.tiles=a?{}:null,this.isTiled=!e.StripOffsets;const s=e.PlanarConfiguration;if(this.planarConfiguration=typeof s>"u"?1:s,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}getBytesPerPixel(){let e=0;for(let n=0;n<this.fileDirectory.BitsPerSample.length;++n)e+=this.getSampleByteSize(n);return e}getSampleByteSize(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${e} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}getReaderForSample(e){const n=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,r=this.fileDirectory.BitsPerSample[e];switch(n){case 1:if(r<=8)return DataView.prototype.getUint8;if(r<=16)return DataView.prototype.getUint16;if(r<=32)return DataView.prototype.getUint32;break;case 2:if(r<=8)return DataView.prototype.getInt8;if(r<=16)return DataView.prototype.getInt16;if(r<=32)return DataView.prototype.getInt32;break;case 3:switch(r){case 16:return function(i,a){return x6e(this,i,a)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(e=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}getBitsPerSample(e=0){return this.fileDirectory.BitsPerSample[e]}getArrayForSample(e,n){const r=this.getSampleFormat(e),i=this.getBitsPerSample(e);return XG(r,i,n)}async getTileOrStrip(e,n,r,i,a){const o=Math.ceil(this.getWidth()/this.getTileWidth()),s=Math.ceil(this.getHeight()/this.getTileHeight());let c;const{tiles:u}=this;this.planarConfiguration===1?c=n*o+e:this.planarConfiguration===2&&(c=r*o*s+n*o+e);let d,f;this.isTiled?(d=this.fileDirectory.TileOffsets[c],f=this.fileDirectory.TileByteCounts[c]):(d=this.fileDirectory.StripOffsets[c],f=this.fileDirectory.StripByteCounts[c]);const h=(await this.source.fetch([{offset:d,length:f}],a))[0];let p;return u===null||!u[c]?(p=(async()=>{let v=await i.decode(this.fileDirectory,h);const y=this.getSampleFormat(),g=this.getBitsPerSample();return MUt(y,g)&&(v=LUt(v,y,this.planarConfiguration,this.getSamplesPerPixel(),g,this.getTileWidth(),this.getBlockHeight(n))),v})(),u!==null&&(u[c]=p)):p=u[c],{x:e,y:n,sample:r,data:await p}}async _readRaster(e,n,r,i,a,o,s,c,u){const d=this.getTileWidth(),f=this.getTileHeight(),h=this.getWidth(),p=this.getHeight(),v=Math.max(Math.floor(e[0]/d),0),y=Math.min(Math.ceil(e[2]/d),Math.ceil(h/d)),g=Math.max(Math.floor(e[1]/f),0),m=Math.min(Math.ceil(e[3]/f),Math.ceil(p/f)),b=e[2]-e[0];let x=this.getBytesPerPixel();const S=[],w=[];for(let P=0;P<n.length;++P)this.planarConfiguration===1?S.push(AUt(this.fileDirectory.BitsPerSample,0,n[P])/8):S.push(0),w.push(this.getReaderForSample(n[P]));const _=[],{littleEndian:A}=this;for(let P=g;P<m;++P)for(let R=v;R<y;++R){let N;this.planarConfiguration===1&&(N=this.getTileOrStrip(R,P,0,a,u));for(let k=0;k<n.length;++k){const B=k,H=n[k];this.planarConfiguration===2&&(x=this.getSampleByteSize(H),N=this.getTileOrStrip(R,P,H,a,u));const F=N.then(G=>{const z=G.data,V=new DataView(z),j=this.getBlockHeight(G.y),Y=G.y*f,W=G.x*d,Z=Y+j,te=(G.x+1)*d,se=w[B],q=Math.min(j,j-(Z-e[3]),p-Y),ne=Math.min(d,d-(te-e[2]),h-W);for(let oe=Math.max(0,e[1]-Y);oe<q;++oe)for(let ie=Math.max(0,e[0]-W);ie<ne;++ie){const ee=(oe*d+ie)*x,ye=se.call(V,ee+S[B],A);let ve;i?(ve=(oe+Y-e[1])*b*n.length+(ie+W-e[0])*n.length+B,r[ve]=ye):(ve=(oe+Y-e[1])*b+ie+W-e[0],r[B][ve]=ye)}});_.push(F)}}if(await Promise.all(_),o&&e[2]-e[0]!==o||s&&e[3]-e[1]!==s){let P;return i?P=IUt(r,e[2]-e[0],e[3]-e[1],o,s,n.length,c):P=EUt(r,e[2]-e[0],e[3]-e[1],o,s,c),P.width=o,P.height=s,P}return r.width=o||e[2]-e[0],r.height=s||e[3]-e[1],r}async readRasters({window:e,samples:n=[],interleave:r,pool:i=null,width:a,height:o,resampleMethod:s,fillValue:c,signal:u}={}){const d=e||[0,0,this.getWidth(),this.getHeight()];if(d[0]>d[2]||d[1]>d[3])throw new Error("Invalid subsets");const f=d[2]-d[0],h=d[3]-d[1],p=f*h,v=this.getSamplesPerPixel();if(!n||!n.length)for(let b=0;b<v;++b)n.push(b);else for(let b=0;b<n.length;++b)if(n[b]>=v)return Promise.reject(new RangeError(`Invalid sample index '${n[b]}'.`));let y;if(r){const b=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,x=Math.max.apply(null,this.fileDirectory.BitsPerSample);y=XG(b,x,p*n.length),c&&y.fill(c)}else{y=[];for(let b=0;b<n.length;++b){const x=this.getArrayForSample(n[b],p);Array.isArray(c)&&b<c.length?x.fill(c[b]):c&&!Array.isArray(c)&&x.fill(c),y.push(x)}}const g=i||await CUt(this.fileDirectory);return await this._readRaster(d,n,y,r,g,a,o,s,u)}async readRGB({window:e,interleave:n=!0,pool:r=null,width:i,height:a,resampleMethod:o,enableAlpha:s=!1,signal:c}={}){const u=e||[0,0,this.getWidth(),this.getHeight()];if(u[0]>u[2]||u[1]>u[3])throw new Error("Invalid subsets");const d=this.fileDirectory.PhotometricInterpretation;if(d===Hf.RGB){let m=[0,1,2];if(this.fileDirectory.ExtraSamples!==lUt.Unspecified&&s){m=[];for(let b=0;b<this.fileDirectory.BitsPerSample.length;b+=1)m.push(b)}return this.readRasters({window:e,interleave:n,samples:m,pool:r,width:i,height:a,resampleMethod:o,signal:c})}let f;switch(d){case Hf.WhiteIsZero:case Hf.BlackIsZero:case Hf.Palette:f=[0];break;case Hf.CMYK:f=[0,1,2,3];break;case Hf.YCbCr:case Hf.CIELab:f=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const h={window:u,interleave:!0,samples:f,pool:r,width:i,height:a,resampleMethod:o,signal:c},{fileDirectory:p}=this,v=await this.readRasters(h),y=2**this.fileDirectory.BitsPerSample[0];let g;switch(d){case Hf.WhiteIsZero:g=fUt(v,y);break;case Hf.BlackIsZero:g=hUt(v,y);break;case Hf.Palette:g=pUt(v,p.ColorMap);break;case Hf.CMYK:g=vUt(v);break;case Hf.YCbCr:g=gUt(v);break;case Hf.CIELab:g=xUt(v);break;default:throw new Error("Unsupported photometric interpretation.")}if(!n){const m=new Uint8Array(g.length/3),b=new Uint8Array(g.length/3),x=new Uint8Array(g.length/3);for(let S=0,w=0;S<g.length;S+=3,++w)m[w]=g[S],b[w]=g[S+1],x[w]=g[S+2];g=[m,b,x]}return g.width=v.width,g.height=v.height,g}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const e=[];for(let n=0;n<this.fileDirectory.ModelTiepoint.length;n+=6)e.push({i:this.fileDirectory.ModelTiepoint[n],j:this.fileDirectory.ModelTiepoint[n+1],k:this.fileDirectory.ModelTiepoint[n+2],x:this.fileDirectory.ModelTiepoint[n+3],y:this.fileDirectory.ModelTiepoint[n+4],z:this.fileDirectory.ModelTiepoint[n+5]});return e}getGDALMetadata(e=null){const n={};if(!this.fileDirectory.GDAL_METADATA)return null;const r=this.fileDirectory.GDAL_METADATA;let i=mR(r,"Item");e===null?i=i.filter(a=>sw(a,"sample")===void 0):i=i.filter(a=>Number(sw(a,"sample"))===e);for(let a=0;a<i.length;++a){const o=i[a];n[sw(o,"name")]=o.inner}return n}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}getOrigin(){const e=this.fileDirectory.ModelTiepoint,n=this.fileDirectory.ModelTransformation;if(e&&e.length===6)return[e[3],e[4],e[5]];if(n)return[n[3],n[7],n[11]];throw new Error("The image does not have an affine transformation.")}getResolution(e=null){const n=this.fileDirectory.ModelPixelScale,r=this.fileDirectory.ModelTransformation;if(n)return[n[0],-n[1],n[2]];if(r)return r[1]===0&&r[4]===0?[r[0],-r[5],r[10]]:[Math.sqrt(r[0]*r[0]+r[4]*r[4]),-Math.sqrt(r[1]*r[1]+r[5]*r[5]),r[10]];if(e){const[i,a,o]=e.getResolution();return[i*e.getWidth()/this.getWidth(),a*e.getHeight()/this.getHeight(),o*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return this.geoKeys.GTRasterTypeGeoKey===1}getBoundingBox(e=!1){const n=this.getHeight(),r=this.getWidth();if(this.fileDirectory.ModelTransformation&&!e){const[i,a,o,s,c,u,d,f]=this.fileDirectory.ModelTransformation,p=[[0,0],[0,n],[r,0],[r,n]].map(([g,m])=>[s+i*g+a*m,f+c*g+u*m]),v=p.map(g=>g[0]),y=p.map(g=>g[1]);return[Math.min(...v),Math.min(...y),Math.max(...v),Math.max(...y)]}else{const i=this.getOrigin(),a=this.getResolution(),o=i[0],s=i[1],c=o+a[0]*r,u=s+a[1]*n;return[Math.min(o,c),Math.min(s,u),Math.max(o,c),Math.max(s,u)]}}}const OUt=RUt;class PUt{constructor(e){this._dataView=new DataView(e)}get buffer(){return this._dataView.buffer}getUint64(e,n){const r=this.getUint32(e,n),i=this.getUint32(e+4,n);let a;if(n){if(a=r+2**32*i,!Number.isSafeInteger(a))throw new Error(`${a} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return a}if(a=2**32*r+i,!Number.isSafeInteger(a))throw new Error(`${a} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return a}getInt64(e,n){let r=0;const i=(this._dataView.getUint8(e+(n?7:0))&128)>0;let a=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(e+(n?o:7-o));i&&(a?s!==0&&(s=~(s-1)&255,a=!1):s=~s&255),r+=s*256**o}return i&&(r=-r),r}getUint8(e,n){return this._dataView.getUint8(e,n)}getInt8(e,n){return this._dataView.getInt8(e,n)}getUint16(e,n){return this._dataView.getUint16(e,n)}getInt16(e,n){return this._dataView.getInt16(e,n)}getUint32(e,n){return this._dataView.getUint32(e,n)}getInt32(e,n){return this._dataView.getInt32(e,n)}getFloat16(e,n){return x6e(this._dataView,e,n)}getFloat32(e,n){return this._dataView.getFloat32(e,n)}getFloat64(e,n){return this._dataView.getFloat64(e,n)}}class NUt{constructor(e,n,r,i){this._dataView=new DataView(e),this._sliceOffset=n,this._littleEndian=r,this._bigTiff=i}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(e,n){return this.sliceOffset<=e&&this.sliceTop>=e+n}readUint8(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}readInt8(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}readUint16(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}readInt16(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}readUint32(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}readInt32(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}readFloat32(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}readFloat64(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}readUint64(e){const n=this.readUint32(e),r=this.readUint32(e+4);let i;if(this._littleEndian){if(i=n+2**32*r,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}if(i=2**32*n+r,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}readInt64(e){let n=0;const r=(this._dataView.getUint8(e+(this._littleEndian?7:0))&128)>0;let i=!0;for(let a=0;a<8;a++){let o=this._dataView.getUint8(e+(this._littleEndian?a:7-a));r&&(i?o!==0&&(o=~(o-1)&255,i=!1):o=~o&255),n+=o*256**a}return r&&(n=-n),n}readOffset(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}}class DUt{async fetch(e,n=void 0){return Promise.all(e.map(r=>this.fetchSlice(r,n)))}async fetchSlice(e){throw new Error(`fetching of slice ${e} not possible, not implemented`)}get fileSize(){return null}async close(){}}class yY extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,yY),this.name="AbortError"}}class kUt extends DUt{constructor(e){super(),this.arrayBuffer=e}fetchSlice(e,n){if(n&&n.aborted)throw new yY("Request aborted");return this.arrayBuffer.slice(e.offset,e.offset+e.length)}}function UUt(t){return new kUt(t)}function ZG(t){switch(t){case ao.BYTE:case ao.ASCII:case ao.SBYTE:case ao.UNDEFINED:return 1;case ao.SHORT:case ao.SSHORT:return 2;case ao.LONG:case ao.SLONG:case ao.FLOAT:case ao.IFD:return 4;case ao.RATIONAL:case ao.SRATIONAL:case ao.DOUBLE:case ao.LONG8:case ao.SLONG8:case ao.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${t}`)}}function FUt(t){const e=t.GeoKeyDirectory;if(!e)return null;const n={};for(let r=4;r<=e[3]*4;r+=4){const i=dUt[e[r]],a=e[r+1]?d4[e[r+1]]:null,o=e[r+2],s=e[r+3];let c=null;if(!a)c=s;else{if(c=t[a],typeof c>"u"||c===null)throw new Error(`Could not get value of geoKey '${i}'.`);typeof c=="string"?c=c.substring(s,s+o-1):c.subarray&&(c=c.subarray(s,s+o),o===1&&(c=c[0]))}n[i]=c}return n}function kC(t,e,n,r){let i=null,a=null;const o=ZG(e);switch(e){case ao.BYTE:case ao.ASCII:case ao.UNDEFINED:i=new Uint8Array(n),a=t.readUint8;break;case ao.SBYTE:i=new Int8Array(n),a=t.readInt8;break;case ao.SHORT:i=new Uint16Array(n),a=t.readUint16;break;case ao.SSHORT:i=new Int16Array(n),a=t.readInt16;break;case ao.LONG:case ao.IFD:i=new Uint32Array(n),a=t.readUint32;break;case ao.SLONG:i=new Int32Array(n),a=t.readInt32;break;case ao.LONG8:case ao.IFD8:i=new Array(n),a=t.readUint64;break;case ao.SLONG8:i=new Array(n),a=t.readInt64;break;case ao.RATIONAL:i=new Uint32Array(n*2),a=t.readUint32;break;case ao.SRATIONAL:i=new Int32Array(n*2),a=t.readInt32;break;case ao.FLOAT:i=new Float32Array(n),a=t.readFloat32;break;case ao.DOUBLE:i=new Float64Array(n),a=t.readFloat64;break;default:throw new RangeError(`Invalid field type: ${e}`)}if(e===ao.RATIONAL||e===ao.SRATIONAL)for(let s=0;s<n;s+=2)i[s]=a.call(t,r+s*o),i[s+1]=a.call(t,r+(s*o+4));else for(let s=0;s<n;++s)i[s]=a.call(t,r+s*o);return e===ao.ASCII?new TextDecoder("utf-8").decode(i):i}class BUt{constructor(e,n,r){this.fileDirectory=e,this.geoKeyDirectory=n,this.nextIFDByteOffset=r}}class iM extends Error{constructor(e){super(`No image at index ${e}`),this.index=e}}class VUt{async readRasters(e={}){const{window:n,width:r,height:i}=e;let{resX:a,resY:o,bbox:s}=e;const c=await this.getImage();let u=c;const d=await this.getImageCount(),f=c.getBoundingBox();if(n&&s)throw new Error('Both "bbox" and "window" passed.');if(r||i){if(n){const[v,y]=c.getOrigin(),[g,m]=c.getResolution();s=[v+n[0]*g,y+n[1]*m,v+n[2]*g,y+n[3]*m]}const p=s||f;if(r){if(a)throw new Error("Both width and resX passed");a=(p[2]-p[0])/r}if(i){if(o)throw new Error("Both width and resY passed");o=(p[3]-p[1])/i}}if(a||o){const p=[];for(let v=0;v<d;++v){const y=await this.getImage(v),{SubfileType:g,NewSubfileType:m}=y.fileDirectory;(v===0||g===2||m&1)&&p.push(y)}p.sort((v,y)=>v.getWidth()-y.getWidth());for(let v=0;v<p.length;++v){const y=p[v],g=(f[2]-f[0])/y.getWidth(),m=(f[3]-f[1])/y.getHeight();if(u=y,a&&a>g||o&&o>m)break}}let h=n;if(s){const[p,v]=c.getOrigin(),[y,g]=u.getResolution(c);h=[Math.round((s[0]-p)/y),Math.round((s[1]-v)/g),Math.round((s[2]-p)/y),Math.round((s[3]-v)/g)],h=[Math.min(h[0],h[2]),Math.min(h[1],h[3]),Math.max(h[0],h[2]),Math.max(h[1],h[3])]}return u.readRasters({...e,window:h})}}class bY extends VUt{constructor(e,n,r,i,a={}){super(),this.source=e,this.littleEndian=n,this.bigTiff=r,this.firstIFDOffset=i,this.cache=a.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(e,n){const r=this.bigTiff?4048:1024;return new NUt((await this.source.fetch([{offset:e,length:typeof n<"u"?n:r}]))[0],e,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(e){const n=this.bigTiff?20:12,r=this.bigTiff?8:2;let i=await this.getSlice(e);const a=this.bigTiff?i.readUint64(e):i.readUint16(e),o=a*n+(this.bigTiff?16:6);i.covers(e,o)||(i=await this.getSlice(e,o));const s={};let c=e+(this.bigTiff?8:2);for(let f=0;f<a;c+=n,++f){const h=i.readUint16(c),p=i.readUint16(c+2),v=this.bigTiff?i.readUint64(c+4):i.readUint32(c+4);let y,g;const m=ZG(p),b=c+(this.bigTiff?12:8);if(m*v<=(this.bigTiff?8:4))y=kC(i,p,v,b);else{const x=i.readOffset(b),S=ZG(p)*v;if(i.covers(x,S))y=kC(i,p,v,x);else{const w=await this.getSlice(x,S);y=kC(w,p,v,x)}}v===1&&sUt.indexOf(h)===-1&&!(p===ao.RATIONAL||p===ao.SRATIONAL)?g=y[0]:g=y,s[d4[h]]=g}const u=FUt(s),d=i.readOffset(e+r+n*a);return new BUt(s,u,d)}async requestIFD(e){if(this.ifdRequests[e])return this.ifdRequests[e];if(e===0)return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[e];if(!this.ifdRequests[e-1])try{this.ifdRequests[e-1]=this.requestIFD(e-1)}catch(n){throw n instanceof iM?new iM(e):n}return this.ifdRequests[e]=(async()=>{const n=await this.ifdRequests[e-1];if(n.nextIFDByteOffset===0)throw new iM(e);return this.parseFileDirectoryAt(n.nextIFDByteOffset)})(),this.ifdRequests[e]}async getImage(e=0){const n=await this.requestIFD(e);return new OUt(n.fileDirectory,n.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let e=0,n=!0;for(;n;)try{await this.requestIFD(e),++e}catch(r){if(r instanceof iM)n=!1;else throw r}return e}async getGhostValues(){const e=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const n="GDAL_STRUCTURAL_METADATA_SIZE=",r=n.length+100;let i=await this.getSlice(e,r);if(n===kC(i,ao.ASCII,n.length,e)){const o=kC(i,ao.ASCII,r,e).split(`
|
|
4471
4471
|
`)[0],s=Number(o.split("=")[1].split(" ")[0])+o.length;s>r&&(i=await this.getSlice(e,s));const c=kC(i,ao.ASCII,s,e);this.ghostValues={},c.split(`
|
|
4472
4472
|
`).filter(u=>u.length>0).map(u=>u.split("=")).forEach(([u,d])=>{this.ghostValues[u]=d})}return this.ghostValues}static async fromSource(e,n,r){const i=(await e.fetch([{offset:0,length:1024}],r))[0],a=new PUt(i),o=a.getUint16(0,0);let s;if(o===18761)s=!0;else if(o===19789)s=!1;else throw new TypeError("Invalid byte order value.");const c=a.getUint16(2,s);let u;if(c===42)u=!1;else if(c===43){if(u=!0,a.getUint16(4,s)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const d=u?a.getUint64(8,s):a.getUint32(4,s);return new bY(e,s,u,d,n)}close(){return typeof this.source.close=="function"?this.source.close():!1}}async function Ype(t,e){return bY.fromSource(UUt(t),e)}const $Ut=({axon_check:t,fbxTreeDatas:e,setLeftMenuTabIndex:n,swcRef:r,setIsChartOpen:i,setEchartValue:a,setChartValue:o,reset:s})=>{const c=C.useRef(null),u=C.useRef(null),[d,f]=C.useState(!1),[h,p]=C.useState(""),[v,y]=C.useState(""),[g,m]=C.useState({x:0,y:0}),b=C.useRef([]),x=C.useRef([]),S=C.useRef(null),w=C.useRef(null),[_,A]=C.useState(!0),P=C.useRef("#000"),[R,N]=C.useState(["Isocortex","OLF","HPF","CTXsp","STR","PAL","IB","MB","HB","CB","VS","fiber tract"]),[k,B]=C.useState({nodes:[],links:[],categories:[]});let H=C.useRef(null),F=!1;const G=(Z,te)=>{N(se=>[...se.filter(q=>!Z.includes(q)),...te])};C.useEffect(()=>{N(["Isocortex","OLF","HPF","CTXsp","STR","PAL","IB","MB","HB","CB","VS","fiber tract"])},[s]);const z=(Z,te)=>te.map(se=>{const q=Z.find(oe=>oe.id===se.source),ne=Z.find(oe=>oe.id===se.target);return{...se,lineStyle:{color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:ne.itemStyle.color},{offset:1,color:q.itemStyle.color}]},width:1,curveness:.3}}});C.useEffect(()=>{V(R)},[R]);const V=Z=>{fetch("/app-api/d-api/connectivity",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:Z})}).then(te=>te.json()).then(te=>{te.code==200?B(te.node):Ec.error(te.message)})};C.useEffect(()=>{u.current=V7(c.current),u.current.clear();const Z=()=>u.current.getOption().series[0].data,te={tooltip:{formatter:ie=>{var ee,ye;return ie.dataType==="node"?`${ie.data.fullname} (${ie.data.name})<br>Downstream: ${((ee=t[ie.data.name].down)==null?void 0:ee.length)??0} projection neuron(s)<br>Upstream: projected by ${((ye=t[ie.data.name].up)==null?void 0:ye.length)??0} neuron(s)`:(ie.dataType,"")}},animationDurationUpdate:1500,animationEasingUpdate:"quinticInOut",series:[{name:"Les Miserables",type:"graph",layout:"circular",circular:{rotateLabel:!0},data:k.nodes,links:z(k.nodes,k.links),categories:k.categories,roam:!0,label:{show:!0,position:"right",formatter:"{b}",textStyle:{fontSize:20}},lineStyle:{color:"source",curveness:.3}}]};function se(ie){if(ie.event.event.preventDefault(),ie.dataType=="node"){const ee=q(ie.data.name,e);let ye=j(ee);ye&&G(ye,[ee.name])}if(ie.dataType=="edge"){const ee=Z().find(ve=>ve.id===ie.data.source),ye=Z().find(ve=>ve.id===ie.data.target);b.current=t[ee.name].soma.filter(function(ve){return t[ye.name].axon.indexOf(ve)>-1}),x.current=t[ye.name].soma.filter(function(ve){return t[ee.name].axon.indexOf(ve)>-1}),p(ee.name),y(ye.name),m({x:ie.event.event.clientX+2,y:ie.event.event.clientY}),f(!0),P.current=ie.data.lineStyle.color.colorStops[0].color}}const q=(ie,ee)=>{let ye="";for(let ve=0;ve<ee.length;ve++){const pe=ee[ve];if(pe.children){if(pe.children.some(re=>re.name===ie)){ye=pe;break}else if(q(ie,pe.children)){ye=q(ie,pe.children);break}}}return ye},ne=ie=>{clearTimeout(H.current),F=!0,a(ie.data.name),o(ie.data.name),i(!1)},oe=ie=>{H.current=setTimeout(()=>{if(!F){const ee=Y(ie.data.name,e);if(ee){let ye=[];"children"in ee?(ee.children.forEach(ve=>{ye.push(ve.name)}),G([ie.data.name],ye)):Ec.error("No child node")}}F=!1},300)};return u.current.setOption(te),u.current.on("click",oe),u.current.on("dblclick",ne),u.current.on("contextmenu",se),()=>{u.current.off("click",oe),u.current.off("dblclick",ne),u.current.off("contextmenu",se)}},[e,k]);const j=Z=>{const te=[],se=q=>{te.push(q.name),q.children&&q.children.forEach(ne=>se(ne))};return se(Z),te},Y=(Z,te)=>{let se=[],q=!1,ne;for(let oe=0;oe<te.length;oe++)se.push(te[oe]);for(;se.length>0&&!q;){let oe=se.pop();if(oe.name==Z){q=!0,ne=oe;break}else if(oe.children)for(let ie=0;ie<oe.children.length;ie++)se.push(oe.children[ie])}return ne},W=[{key:"1",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Z=>{n(3),r.current.setSearchValue(v),r.current.setSomaValue(h),f(!1),i(!1)}},h," →",v,": ",b.current.length," projection neruon(s)")},{key:"2",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Z=>{n(3),r.current.setSearchValue(h),r.current.setSomaValue(v),f(!1),i(!1)}},v," →",h,": ",x.current.length," projection neruon(s)")}];return C.createElement(C.Fragment,null,C.createElement("div",{style:{overflow:"hidden",position:"absolute",width:"500px",height:"200px"}},C.createElement("div",{ref:S,style:{zIndex:9,position:"absolute",backgroundColor:"#f1f1f180",borderTopRightRadius:"5px",borderTopLeftRadius:"5px",borderBottomRightRadius:"5px",transform:_?"translateY(0)":"translateY(-99%)",transition:"transform 0.3s ease-in-out",padding:"5px"}},C.createElement("p",{style:{paddingLeft:"10px",paddingRight:"10px"}},"- Mouse-over a node to see upstream and downstream neuron numbers",C.createElement("br",null),"- Left-click a node to expand its children structures",C.createElement("br",null),"- Righ-click a node to collapse to its parent structure",C.createElement("br",null),"- Double-click a node to visualize all its projections in the main window",C.createElement("br",null),"- Righ-click a line to see the projections between two connected nodes",C.createElement("br",null),"- Left-click the popup menu of the line to inquire the projection neurons"),C.createElement("a",{style:{zIndex:9,position:"absolute",bottom:"-28px",left:0,display:"flex"},onClick:()=>{A(!_)}},C.createElement("div",{style:{width:"90px",height:"28px",display:"flex",justifyContent:"center",borderBottomRightRadius:"5px",borderBottomLeftRadius:"5px",backgroundColor:"#f1f1f180"}},C.createElement("div",{style:{display:"flex",alignItems:"center",color:"#000"}},"Help ",C.createElement("div",{ref:w,style:{width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent",borderBottom:_?"10px solid #000":0,borderTop:_?0:"10px solid #000"}})))))),C.createElement(qb,{menu:{items:W},open:d,overlayStyle:{position:"absolute",left:g.x,top:g.y,width:"auto",minWidth:"auto",border:`2px solid ${P}`},overlayClassName:"pipeline_dropdown"},C.createElement("div",{ref:c,style:{width:"100%",height:"calc(100vh - 75px)"},onMouseEnter:()=>{f(!1)}})))};class zUt{constructor(e,n,r,i,a,o,s){kf(this,"name");kf(this,"branches");kf(this,"indices");kf(this,"points");kf(this,"numSoma");kf(this,"vao");kf(this,"vbo");kf(this,"ebo");kf(this,"viewType",0);this.name=n,this.branches=[],this.indices=[],this.points=[],this.numSoma=0,this.vao=null,this.vbo=null,this.ebo=null,o&&(this.viewType=o);for(var c=null,u=e.split(`
|
|
4473
4473
|
`),d=0;d<u.length;++d)if(u[d][0]!="#"){if(u[d].length==0&&c!=null){c.count=this.indices.length-c.start,this.branches.push(c),c=null;continue}var f=u[d].trim().split(" "),h=parseInt(f[0]);if(i!=null)if(a!=null)var p=parseFloat(f[2])+parseFloat(a[0])-parseFloat(i[0]),v=parseFloat(f[3])+parseFloat(a[2])-parseFloat(i[2]),y=parseFloat(f[4])+parseFloat(a[4])-parseFloat(i[4]);else var p=parseFloat(f[2])+parseFloat(r[0])-parseFloat(i[0]),v=parseFloat(f[3])+parseFloat(r[2])-parseFloat(i[2]),y=parseFloat(f[4])+parseFloat(r[4])-parseFloat(i[4]);else if(a!=null)var p=parseFloat(f[2])+parseFloat(a[0])-parseFloat(r[0]),v=parseFloat(f[3])+parseFloat(a[2])-parseFloat(r[2]),y=parseFloat(f[4])+parseFloat(a[4])-parseFloat(r[4]);else if(o)var p=parseFloat(f[2])+parseFloat(r[0])-s[0],v=parseFloat(f[3])+parseFloat(r[2])-s[2],y=parseFloat(f[4])+parseFloat(r[4])-s[4];else var p=parseFloat(f[2]),v=parseFloat(f[3]),y=parseFloat(f[4]);var g=parseInt(f[6]);h==1?(c={start:0},this.indices.push(0),this.numSoma=1):g!=h-1||g==-1?(c.count=this.indices.length-c.start,this.branches.push(c),c={start:this.indices.length},g!=-1?this.indices.push(g-1):this.numSoma+=1,this.indices.push(this.points.length/3)):this.indices.push(this.points.length/3),this.points.push(p),this.points.push(v),this.points.push(y)}c&&(c.count=this.indices.length-c.start,this.branches.push(c))}}ba([v5e,ZIe,Q5e,A4e]);const Wg=Om.TabPane,{TextArea:qpe}=Xc,HUt=`
|
|
@@ -4594,7 +4594,7 @@ void main(){
|
|
|
4594
4594
|
// color = vec4(0.0,0.0,0.0,1.f);
|
|
4595
4595
|
// };
|
|
4596
4596
|
}
|
|
4597
|
-
`;let jUt=new URL(window.location.href),ud=new URLSearchParams(jUt.search),Jpe=ud.get("leftHemisphereVisibility"),Qpe=ud.get("coordinateVisibility"),eve=ud.get("datumMarkVisibility"),tve=ud.get("cranialVisibility"),nve=ud.get("gridVisibility"),rve=ud.get("terminalVisibility"),ive=ud.get("branchingVisibility"),ave=ud.get("branchingColor"),ove=ud.get("brainContourVisibility"),sve=ud.get("brainContourOpacity"),SR=ud.get("otherAtlases"),wR=ud.get("atlasReslicingInfo"),ER=ud.get("sectionPointPosition"),lve=ud.get("echart_Value"),DB=ud.get("tiffDataPath"),cve=ud.get("tiffInfo"),aM=ud.get("swcUrl");class WUt extends Mc{constructor(n,r,i,a){super();kf(this,"_renderer");kf(this,"webglTexture",null);kf(this,"_size");this._renderer=n,this._size=r,this.image={width:r,height:i,depth:a,data:null},this.type=bm,this.format=AX,this.minFilter=ku,this.magFilter=ku,this.needsUpdate=!0,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}update(){if(!this.webglTexture)return;const n=this._renderer.getContext();if(!n.getExtension("EXT_color_buffer_float"))throw"Floating point textures not supported";this._renderer.state.bindTexture(n.TEXTURE_3D,this.webglTexture),this.version++,this._updateVersion++}}const XUt={leftHemisphereVisibility:Jpe?JSON.parse(Jpe):!1,coordinateVisibility:Qpe?JSON.parse(Qpe):!0,datumMarkVisibility:eve?JSON.parse(eve):!0,cranialVisibility:tve?JSON.parse(tve):!1,gridVisibility:nve?JSON.parse(nve):!0,terminalVisibility:rve?JSON.parse(rve):!0,branchingVisibility:ive?JSON.parse(ive):!0,branchingColor:ave||"#A7B5A1",brainContourVisibility:ove?JSON.parse(ove):!0,brainContourOpacity:sve?JSON.parse(sve):.3,otherAtlases:SR||"None",atlasReslicingInfo:wR?JSON.parse(wR):{},sectionPointPosition:ER?JSON.parse(ER):{}},ZUt=(t,e)=>{let n=new URL(window.location.href),r=new URLSearchParams(n.search),i=e;typeof e!="string"&&(i=JSON.stringify(i)),r.set(t,i),n.search=r.toString(),window.history.replaceState({},"",n)},KUt={set:function(t,e,n){return t[e]=n,ZUt(e,n),!0}},La=new Proxy(XUt,KUt),A6e=C.forwardRef((t,e)=>{const{regionData:n,setoffset_factor:r,offset_factor_R:i,t:a,hrefStr:o,leftTreeRef:s,angleRef:c,jiaoduRef:u,mouseflag:d,renderer:f,controls:h,menutagShow:p,setMenuTag:v,startselect:y,linemeshs_jing:g,points:m,points2:b,activetabIndex:x,material:S,setShowimage:w,childRef:_,checkItems:A,setoutflag:P,fetchCoordinateFunc:R,setendPoint:N,clickPoint:k,outflagRef:B,axis_font:H,setdatum:F,modeChoose:G,setShowModeChoose:z,virusModeValue:V,setShowTabNums:j,pipelineClickEvent:Y,automaticGroup:W,focusVirusLineItem:Z,setMenuTagShow:te,responsefunc:se,mode:q,setCheckItems:ne,setLeftMenuTabIndex:oe,updatePage:ie,swcItem:ee,axon_check:ye,swcnameMesh:ve,setMode:pe,vesselRef:re,swcRef:xe,vesselStr:Q,lableStr:be,setShowSettingModal:de,showSettingModal:Ee,fbxTreeDatas:De,composer:He,setEchartValue:Pe,echartValue:Se,sectionsInfoRef:We,sectionsInfo:ge,setSectionsInfo:ue,gray_value:Me,setLuguchecked:it,Luguchecked:Ne,datum:Ke,setGridShow:ft,PointShow:ct,nodeStr:ut,lefttab:Ct,righttab:st,atlasData:ke,flowObjectsRef:ht,setTip:nt,tip:et}=t,[bt,ze]=C.useState(!1),[Mt,It]=C.useState(!1),[Dt,Lt]=C.useState(!1),[Bt,Gt]=C.useState(!1),[un,xn]=C.useState(!1),[wn,Fn]=C.useState(!1),[en,Mr]=C.useState(!1),[_n,gn]=C.useState(!1),[Rn,dn]=C.useState(La.atlasReslicingInfo.angleX||120),[Xn,cr]=C.useState(La.atlasReslicingInfo.angleY||320),[Or,Bn]=C.useState(La.atlasReslicingInfo.angleZ||270),[ar,Ge]=C.useState(La.atlasReslicingInfo.positionX||0),[At,Nt]=C.useState(La.atlasReslicingInfo.positionY||0),[Ft,kt]=C.useState(La.atlasReslicingInfo.positionZ||0),[zt,Vt]=C.useState(La.atlasReslicingInfo.translateX||!0),[Xt,Dn]=C.useState(La.atlasReslicingInfo.translateY||!0),[$t,Rt]=C.useState(La.atlasReslicingInfo.translateZ||!0),[qt,Un]=C.useState(La.atlasReslicingInfo.rotate||!0),[In,xr]=C.useState(La.atlasReslicingInfo.ButtonDisabled||!0),[Ir,Zn]=C.useState(!1),[nn,Wn]=C.useState(!1),[Cn,Sn]=C.useState(!1),[On,er]=C.useState(!1),[jr,yr]=C.useState(a("5000.0006")||"显示数据块"),[zr,tr]=C.useState(1),[Lr,Dr]=C.useState(1),[Qn,Pr]=C.useState([]),[$i,Wi]=C.useState([]),[Ni,Xi]=C.useState(!1),[zi,xa]=C.useState({}),[mo,Oa]=C.useState(!1),[qr,ai]=C.useState(""),[Ta,Zt]=C.useState("Config_DAPI.ini"),[Et,mn]=C.useState("applySTAM2CCF"),[xt,on]=C.useState(0),[or,Yr]=C.useState(!1),[hr,kr]=C.useState(!1),[Pn,Vn]=C.useState(!1),[lr,rn]=C.useState(!0),[kn,nr]=C.useState(2),[br,Ur]=C.useState(!1),[ni,Jr]=C.useState({}),gi=C.useRef(La.atlasReslicingInfo.direction1||4),ja=C.useRef(null),Zi=C.useRef(null),[qo,io]=C.useState(!1),za=C.useRef(null),zn=C.useRef(window.location.href.split("/")[2]),at=C.useRef(new JS(Ai.current,f==null?void 0:f.domElement)),Le=C.useRef(0),Be=C.useRef(0),tt=C.useRef(new rr),rt=C.useRef(new Ie),dt=C.useRef(new Ie),vt=C.useRef(new rr),ot=C.useRef(new Ie(1,0,0)),fe=C.useRef(new rr),ce=C.useRef(null),Ue=C.useRef(new Dz),$e=C.useRef(null),Ze=C.useRef([]),pt=C.useRef(null),Pt=C.useRef(new rr),Ut=C.useRef(new Fu),[an,wt]=C.useState(La.otherAtlases),jt={min:new Ie(59.74305725097656,69.15838623046875,.9565062522888184),max:new Ie(1081.3045654296875,800.6698608398438,1400.156005859375)},[qn,pr]=C.useState([]),Tn=C.useRef({}),An=C.useRef(!1),Wr=C.useRef([0,0]),Qr=C.useRef([0,0]),fn=C.useRef(""),Kt=C.useRef(!1),[ui,_r]=C.useState(!1),[ei,Fo]=C.useState(!1),[Ca,Da]=C.useState(0),[di,ti]=C.useState(0),[da,bs]=C.useState([]),[Ia,Jo]=C.useState([]),xs=C.useRef(null),Cs=C.useRef(null),[Vs,yo]=C.useState(""),[Qa,qs]=C.useState(null),[ns,rs]=C.useState(lve||""),[sr,bo]=C.useState(!1);C.useState("");const Ss=C.useRef(""),[Tl,$s]=C.useState(La.leftHemisphereVisibility),Wa=C.useRef([]);C.useRef([]);const[Bo,xo]=C.useState(!1),[Mo,Lo]=C.useState(!1),ol=C.useRef(!0),pl=C.useRef(!0),ka=C.useRef(""),Oo=C.useRef({target:h.current.target.clone(),position:h.current.object.position.clone(),up:h.current.object.up.clone(),enabled:h.current.enabled}),[hs,Hl]=C.useState(0),[Js,Gl]=C.useState(!0),jl=C.useRef(!0),Wl=C.useRef(null),is=C.useRef(new rr),[vl,gl]=C.useState(La.brainContourVisibility),[Nl,Nc]=C.useState(["Task1","Task2"]),[cs,dc]=C.useState(["Task1"]),[Wo,ws]=C.useState([{key:"Task1",fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""},{key:"Task2",fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""}]),Es=C.useRef([{key:"tags1",fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""},{key:"tags2",fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""}]),Dc=C.useRef(null),iu=C.useRef(null),[wu,fc]=C.useState(La.coordinateVisibility),[Qs,au]=C.useState(La.brainContourOpacity),[hc,Eu]=C.useState(La.atlasReslicingInfo.direction1||4),[Pd,kc]=C.useState({}),[ou,Ql]=C.useState({}),[zu,Dl]=C.useState({});C.useRef();const su=C.useRef([]),_s=C.useRef({brightness:.95,darkness:0,opacity:1,opacity2:1,color:{r:0,g:0,b:0},color2:{r:255,g:255,b:255}}),ec=C.useRef(new Set),zs=C.useRef(0);C.useImperativeHandle(e,()=>({tabChange:Qo,setYinDaoOpen1:ze,setYinDaoOpen2:It,setYinDaoOpen3:Lt,setYinDaoOpen4:Gt,setYinDaoOpen5:xn,setYinDaoOpen6:Fn,setYinDaoOpen7:Mr,setDontShowAgain:Gl})),C.useEffect(()=>{su.current=De},[De]);const _u=Te=>{ec.current.delete(Te.key)},pc=Te=>{if(Te.stopPropagation(),ec.current.add(Te.key),ec.current.has("Alt")&&(ec.current.has("c")||ec.current.has("C")))try{const qe=f.domElement.toDataURL("image/png"),Je=document.createElement("a");Je.href=qe,Je.download="scene.png",Je.click(),ec.current=new Set}catch(qe){console.error("Error downloading canvas:",qe),alert("抱歉,无法下载画布。请查看控制台获取更多信息。")}};C.useEffect(()=>{fetch(n+"/data/json/name.json").then(Je=>Je.json()).then(Je=>{bs(Je)}),fetch(n+"/data/TreeData/nuclear.json").then(Je=>Je.json()).then(Je=>{Jo(Je)});const Te=new hu(.05,32,32),qe=new Rl({color:392960,transparent:!0});if(is.current=new rr(Te,qe),is.current.name="sectionSphere",ER){let Je=JSON.parse(ER);is.current.position.set(Je.x,Je.y,Je.z)}return La.cranialVisibility&&DI(!0),DB&&YE(),aM&&J1(),document.addEventListener("keydown",pc),document.addEventListener("keyup",_u),window.addEventListener("beforeunload",tl),()=>{document.removeEventListener("keydown",pc),document.removeEventListener("keyup",_u),window.removeEventListener("beforeunload",tl)}},[]),C.useEffect(()=>{fetch("/staticresource/data/SWC/swc_foler/15257/BIL_15257_1.js").then(Te=>Te.json()).then(Te=>{Ql(Te)}).catch(Te=>{console.error("Fetch error:",Te)})},[]);const Aa=(Te,qe)=>Js?C.createElement("div",{style:{position:"absolute",top:"4px",right:"50px"}},C.createElement(_1,{defaultChecked:!1,onChange:Je=>{Je.target.checked?localStorage.setItem(Te,"true"):localStorage.setItem(Te,"false"),qe()},style:{marginTop:"10px"}},"Don't show again")):null,Xl=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Assem")||localStorage.getItem("Assem")==="false"?Aa("Assem",function(){}):null,C.createElement("div",null,a("8000.0001")||"如①所示,在主窗口左侧的是数据面板,用户可以在该选项卡下选择STAM的解剖命名树,配准到STAM上的完整脑血管图谱和神经元数据。用户也可以切换两个不同版本的命名系统。"),C.createElement("div",null,a("8000.0002")||"如②所示,主窗口中可以加载脑区、核团的三维模型。"),C.createElement("div",null,a("8000.0003")||"如③所示,用户可以切换不同的模式或者功能模块")),cover:C.createElement("video",{src:`${n}/guide/topo.mp4`,controls:!0,style:{height:600}}),placement:"center",style:{width:"min-content"},target:pt.current},{title:a("8000.0032")||"解剖结构、脑血管和神经元查询",cover:C.createElement("img",{src:`${n}/guide/gif_batch/topo/out_topo1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Assem")||localStorage.getItem("Assem")==="false"?Aa("Assem",function(){}):null,a("8000.0004")||"Regions选项卡包含的是STAM的解剖命名树,用户可以在该选项卡下的复选框中选择任意数量的感兴趣结构,在主窗口中可视化;Vessels选项卡包含了一套配准到STAM上的完整脑血管图谱,用户可以在此选择感兴趣的血管分支;Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。用户也可以选择切换到Brain maps 4.0 ontology,该命名树中的结构同样可以被检索、选中并可视化。"),target:s.current,placement:"right"},{title:a("8000.0033")||"可视化解剖子结构并切换坐标原点",cover:C.createElement("img",{src:`${n}/guide/gif_batch/topo/out_topo2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Assem")||localStorage.getItem("Assem")==="false"?Aa("Assem",function(){}):null,a("8000.0005")||"用户可以点击Regions选项卡下的解剖命名树中蓝色的方块图标,此时主窗口中会以组装的形式可视化用户点击结构的所有子结构,同时展开幅度可在右侧面板设置。默认情况下,该坐标系统以Bregma点作为原点。户也可以将坐标原点切换为STAM的其它任意19个颅骨或颅内基准点,主窗口中可视化对象的坐标值将根据新的原点重新计算。右击任意基准点,可以保存以基准点为坐标原点的STAM标签图像。"),placement:"center",target:pt.current},{title:a("8000.0034")||"可视化功能设置",cover:C.createElement("img",{src:`${n}/guide/gif_batch/topo/out_topo3.gif`}),description:C.createElement("div",null,!localStorage.getItem("Assem")||localStorage.getItem("Assem")==="false"?Aa("Assem",function(){}):null,a("8000.0006")||"用户可以在页面底部切换到setting选项卡。Left hemisphere开关决定是否展示左半脑,默认为Off。Coordinate开关决定是否在主窗口中显示坐标数值,默认为On。Datum Marks开关决定是否在主窗口中显示基准点,默认为On。Cranial开关决定是否在主窗口中显示颅骨的三维轮廓,默认为Off。"),target:document.getElementsByClassName("bottom_tabs_outer_div")[0]}],el=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Virtual")||localStorage.getItem("Virtual")==="false"?Aa("Virtual",function(){}):null,a("8000.0007")||"我们提供了虚拟手术导航服务,用户可以通过交互操作,模拟向小鼠脑注射病毒的立体定位手术过程。STAM会根据用户操作,返回注射位点与作为坐标原点的颅骨或颅内基准点之间的距离和注射角度信息。"),cover:C.createElement("video",{src:`${n}/guide/surgery.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0035")||"自动导航模式",cover:C.createElement("img",{src:`${n}/guide/gif_batch/surgery/out_surgery1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Virtual")||localStorage.getItem("Virtual")==="false"?Aa("Virtual",function(){}):null,a("8000.0008")||"首先选择要注射的脑区。接下来在脑区上选择注射靶点。用户继续点击Select target按钮,注射脑区的三维模型表面会出现一个跟随鼠标移动的绿点。然后,点击Auto进入自动模式,左侧数据面板中的Structure for injecting选项卡变为Regions to avoid。用户点击需要避开脑区、核团的名称,被选中的文字会变为高亮的红色,同时这些结构的三维轮廓也会显示在主窗口中。接下来点击右侧面板中的Intellectual planning按钮,等待若干秒后,STAM会返回一条从注射靶点出发、并且避开所有用户选中脑区、核团的路径。"),target:s.current,placement:"right"},{title:a("8000.0036")||"手动导航模式",cover:C.createElement("img",{src:`${n}/guide/gif_batch/surgery/out_surgery2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Virtual")||localStorage.getItem("Virtual")==="false"?Aa("Virtual",function(){}):null,a("8000.0009")||"用户点击Manually进入手动规划模式,此时用户标记的注射靶点变为蓝色圆点,并出现一条从注射靶点出发、连接到鼠标当前的位置的红色虚射线,该射线与STAM外轮廓的交点(即注射位点)会被标记为绿色。当用户找到合适的注射路径后,可点击鼠标左键标记,被标记的路径会在主窗口中形成一条蓝色实线,注射位点则被标记为蓝色圆锥,且该路径所穿过的脑区、核团名称也会按照其空间位置排列在实线上。在右侧面板中,会出现该注射路径与三个标准解剖方向的夹角、注射靶点,以及注射位点的信息。用户点击右侧面板上的Reset按钮,即可重新开始整个注射手术流程。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"}],Li=[{title:a("5000.5084")||"步骤一",description:a("5000.5082")||"请选择注射模式,如果选择自动模式,点击左侧细胞名称选择细胞核进行旁路",target:za.current}],sl=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Reg")||localStorage.getItem("Reg")==="false"?Aa("Reg",function(){}):null,a("8000.0011")||"如①所示,用户可上传PI或DAPI染色的单张脑片图像,该服务将通过约1分钟的服务器端计算,从STAM中重切出一张与用户上传的脑片位置最接近的图谱切面,并根据计算出来的角度和位置显示在主窗口中。"),cover:C.createElement("video",{src:`${n}/guide/registration.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0037")||"上传脑片图像并计算或下载配准结果",cover:C.createElement("img",{src:`${n}/guide/gif_batch/registration/out_reg1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Reg")||localStorage.getItem("Reg")==="false"?Aa("Reg",function(){}):null,a("8000.0012")||"用户可以从本地上传待配准的tif/tiff格式的二维脑片图像。然后选择上传图像的类型。接着点击Calculate the corresponding plane from the atlas按钮组中的Start按钮,等待后台返回计算结果。计算完成后,Start按钮下方会出现计算结果的预览图,可左键单击放大查看。Start按钮右侧的Save按钮此时也变为可点击,用户单击该按钮,可以将计算结果下载到本地。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"},{title:a("8000.0038")||"页面跳转功能",cover:C.createElement("img",{src:`${n}/guide/gif_batch/registration/out_reg2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Reg")||localStorage.getItem("Reg")==="false"?Aa("Reg",function(){}):null,a("8000.0013")||"在主窗口右击相应的脑区、核团,可以跳转到任意剖面可视化和脑解剖知识库页面。"),placement:"center",target:pt.current}],Uc=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Down")||localStorage.getItem("Down")==="false"?Aa("Down",function(){}):null,a("8000.0014")||"如①和②所示,用户可以在STAM所在的三维空间中选取任意感兴趣范围,并以不同的采样倍数下载自己选取范围内的原始图像。"),cover:C.createElement("video",{src:`${n}/guide/datasharing.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0047")||"平移模式选择原始图像数据的范围",cover:C.createElement("img",{src:`${n}/guide/gif_batch/datasharing/out_sharing1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Down")||localStorage.getItem("Down")==="false"?Aa("Down",function(){}):null,a("8000.0015")||"用户可以点击“Select the range”按钮,然后主窗口中出现一个橙色线条的方框。用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制方框在各个方向上的平移,当某个方向的箭头被用户选中时,该箭头会变为高亮的黄色。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"},{title:a("8000.0039")||"缩放模式选择原始图像数据的范围并预览图像",cover:C.createElement("img",{src:`${n}/guide/gif_batch/datasharing/out_sharing2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Down")||localStorage.getItem("Down")==="false"?Aa("Down",function(){}):null,a("8000.0016")||"用户也可以通过按下键盘上的“A”,将范围选取操作从平移模式切换为缩放模式。此时方框的箭头会变为方块,拖动方块,就可以改变方框的大小。经过上述操作明确了待下载数据的空间范围后,可以点击“预览下载图像”按钮,通过体绘制,在主窗口中对该范围内的图像进行可视化,"),placement:"center",target:pt.current},{title:a("8000.0040")||"选择数据的采样倍数并下载",cover:C.createElement("img",{src:`${n}/guide/gif_batch/datasharing/out_sharing3.gif`}),description:C.createElement("div",null,!localStorage.getItem("Down")||localStorage.getItem("Down")==="false"?Aa("Down",function(){}):null,a("8000.0017")||"拖动“Set the downsampling rate”滑动条,用户可以选择待下载数据的采样倍数;具体的倍数值可通过滑块上方的黑色背景提示文字查看。当数据量没有超过1 GB时,点击Downloading按钮可直接下载;当超过该数值,点击Downloading按钮会唤起用户终端的邮箱管理工具(如Outlook等),并自动将待下载范围和采样倍数信息填入邮件中,此时用户点击邮件发送按钮,即可向STAM网站发送数据下载申请。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"}],Tu=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Map")||localStorage.getItem("Map")==="false"?Aa("Map",function(){}):null,a("8000.0018")||"我们支持用户上传此前已经配准到Common Coordinate Framework(CCF)的三维图像数据和神经元完整形态数据,并将其映射到STAM上,并直接在三维空间中进行可视化;我们也支持反向映射,即将已经配准到STAM的同类型数据映射到CCF上。"),cover:C.createElement("video",{src:`${n}/guide/mapping.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0041")||"上传三维图像数据并计算",cover:C.createElement("img",{src:`${n}/guide/gif_batch/mapping/out_mapping1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Map")||localStorage.getItem("Map")==="false"?Aa("Map",function(){}):null,a("8000.0019")||"用户点击右侧面板的Upload按钮,上传已配准到CCF或者STAM的三维图像数据或神经元形态学数据。上传结束后,在Select the direction of conversion单选框中,确定数据的映射方向是从STAM到CCF还是反过来。此后点击Start按钮,STAM的服务器端开始计算,Start按钮变为等待状态。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"},{title:a("8000.0042")||"计算完成后预览或下载结果",cover:C.createElement("img",{src:`${n}/guide/gif_batch/mapping/out_mapping2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Map")||localStorage.getItem("Map")==="false"?Aa("Map",function(){}):null,a("8000.0020")||"等待约10分钟后,STAM的服务器端完成计算并返回结果。此时Save按钮和View result按钮均变为可点击状态。点击Save按钮,可以将计算结果下载到本地;点击View result按钮,可以在主窗口中预览计算结果。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"}],Fc=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Res")||localStorage.getItem("Res")==="false"?Aa("Res",function(){}):null,C.createElement("div",null,a("8000.0021")||"我们提供了沿任意角度可视化脑图谱切面的服务。用户可以查看感兴趣的STAM任意位置和角度的切面,浏览该切面上的脑区、核团标注,并由该图谱切面跳转到STAM任意切面服务所提供的各向同性1微米分辨率切面。"),C.createElement("div",null,a("8000.0022")||"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同。位于正中区域的是主窗口。"),C.createElement("div",null,a("8000.0023")||"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。具体的平移、旋转数值可通过滑块上方的黑色背景提示文字查看。")),cover:C.createElement("video",{src:`${n}/guide/reslicing.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0043")||"平移或旋转图谱切面",cover:C.createElement("img",{src:`${n}/guide/gif_batch/reslicing/out_reslicing1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Res")||localStorage.getItem("Res")==="false"?Aa("Res",function(){}):null,a("8000.0024")||"用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制图谱切面的平移。用户也可以通过按下键盘上的“R”,将范围选取操作从平移模式切换为旋转模式。此时箭头会变为球形,沿球形拖动,就可以控制图谱切面的旋转。"),placement:"center",target:pt.current},{title:a("8000.0044")||"下载高分辨率的STAM图谱3D标签图像",cover:C.createElement("img",{src:`${n}/guide/gif_batch/reslicing/out_reslicing2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Res")||localStorage.getItem("Res")==="false"?Aa("Res",function(){}):null,a("8000.0025")||"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。点击viewer higher resolution image按钮可以跳转到任意剖面可视化界面。点击Requesting STAM labels按钮,填入许可证即可下载各向同性10微米分辨率的STAM图谱3D标签图像。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"}],Hu=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Neu")||localStorage.getItem("Neu")==="false"?Aa("Neu",function(){}):null,C.createElement("div",null,a("8000.0026")||"我们提供全脑的胞体或投射靶区的神经环路数据可视化服务。用户可以选择感兴趣的任意胞体或投射靶区在脑区、核团的神经环路数据,并查看数据对应的脑区、核团标注。"),C.createElement("div",null,a("8000.0027")||"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同,其中Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。"),C.createElement("div",null,a("8000.0028")||"如②所示,用户可以在搜索框中搜索感兴趣脑区、核团。"),C.createElement("div",null,a("8000.0029")||"如③所示,这是一个由若干个脑区、核团子结构组成的神经环路连接示意图。")),cover:C.createElement("video",{src:`${n}/guide/neuronal.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0045")||"查看神经环路连接示意图并交互",cover:C.createElement("img",{src:`${n}/guide/gif_batch/neuronal/out_neuronal1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Neu")||localStorage.getItem("Neu")==="false"?Aa("Neu",function(){}):null,a("8000.0030")||"用户可以点击“whole-brain connectivity diagram”按钮或在搜索框中搜索感兴趣脑区、核团,即可弹出由若干个脑区、核团子结构组成的神经环路连接示意图。不同圆点表示不同的脑区、核团结构,圆点旁边显示的是脑区、核团的名称。用户可以将鼠标移动到圆点、脑区或核团的名称上,左击或右击圆点。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"},{title:a("8000.0046")||"显示用户指定脑区上下游连接关系",cover:C.createElement("img",{src:`${n}/guide/gif_batch/neuronal/out_neuronal1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Neu")||localStorage.getItem("Neu")==="false"?Aa("Neu",function(){}):null,a("8000.0031")||"双击任意一个代表某个脑区、核团结构的圆点,神经环路连接示意图窗口隐藏,回到主窗口页面,显示该结构的上下游连接关系。在Upstream窗口中展示了投射到选中脑区、核团的神经环路,在Downstream窗口中展示了选中脑区、核团的投射靶区。用户可以用复选框选择任意数量的感兴趣神经元,在主窗口中可视化。"),target:s.current,placement:"right"}];C.useEffect(()=>{const Te=$o("index"),qe=$o("type"),Je=$o("structure");(qe||Te)&&setTimeout(()=>{switch(Te=="Assembling"?(!localStorage.getItem("Assem")||localStorage.getItem("Assem")==="false")&&ze(!0):Te=="Virtual_Inject"?(!localStorage.getItem("Virtual")||localStorage.getItem("Virtual")==="false")&&It(!0):Te=="Slicing"?(!localStorage.getItem("Res")||localStorage.getItem("Res")==="false")&&Fn(!0):Te=="Mapping"?(!localStorage.getItem("Map")||localStorage.getItem("Map")==="false")&&Fn(!0):Te=="Downloading"?(!localStorage.getItem("Down")||localStorage.getItem("Down")==="false")&&xn(!0):Te=="Neuronal"?(!localStorage.getItem("Neu")||localStorage.getItem("Neu")==="false")&&Mr(!0):Te=="Registration"&&(!localStorage.getItem("Reg")||localStorage.getItem("Reg")==="false")&&Gt(!0),qe){case"simple":document.title="STAM-SimpleViewer",pe(0);case"normal":Qo(1,!0),document.title="STAM-NormalViewer";break;case"virtual":document.title="STAM-Surgery",Qo(2,!0);break;case"slicing":Qo(3,!0),document.title="STAM-Reslicing";break;case"registration":Qo(4,!0),document.title="STAM-Registration";break;case"downloading":Qo(5,!0),document.title="STAM-Downloading";break;case"mapping":Qo(6,!0),document.title="STAM-AtlasMapping";break;case"circuits":Qo(7,!0),document.title="STAM-NeuronalCircuits",setTimeout(()=>{Je&&(rs(Je),Pe(Je))},500);break;case"other":Qo(8,!0),document.title="STAM-OtherAtlas";break;case"setting":Qo(9,!0),document.title="STAM-ViewSetting";break}},500)},[]),C.useEffect(()=>{Le.current=(f==null?void 0:f.domElement.clientWidth)-1,Be.current=(f==null?void 0:f.domElement.clientHeight)-1;let Te=-(jt.min.x+jt.max.x)*sa.current/2,qe=jt.max.clone().multiplyScalar(sa.current).add(new Ie(Te,qa.current,to.current)),Je=jt.min.clone().multiplyScalar(sa.current).add(new Ie(Te,qa.current,to.current));rt.current=qe,dt.current=Je;let gt=new Rl({visible:!1});if(vt.current=new rr(new Ws(rt.current.x-dt.current.x,rt.current.y-dt.current.y,rt.current.z-dt.current.z),gt),vt.current.position.set((rt.current.x+dt.current.x)/2,(rt.current.y+dt.current.y)/2,(rt.current.z+dt.current.z)/2),Km(),SR){let St=SR;St=="CCF"&&z0({filepath:n+"/data/FBX/outline-CCF.FBX",index:"outline",color:"#327DFF",opacity:.3,offsetZ:0,R:.01,callback:function(){}},Ut),St=="WHS"&&z0({filepath:n+"/data/FBX/outline-WHS.FBX",index:"outline",color:"#327DFF",opacity:.3,offsetZ:0,R:.01,callback:function(){}},Ut)}},[]),C.useEffect(()=>{Le.current=(f==null?void 0:f.domElement.clientWidth)-1,Be.current=(f==null?void 0:f.domElement.clientHeight)-1},[f==null?void 0:f.domElement.clientWidth]),C.useEffect(()=>{const Te=new vs;Te.expandByObject(fe.current);const qe=R.current(Te.min.clone()),Je=R.current(Te.max.clone());let gt=new Bp(yn(650,620,`${qe.x.toFixed(2)},${qe.y.toFixed(2)},${qe.z.toFixed(2)}`,"#ccc")),St=new Uh(new Zf({map:gt}));St.name="startText";let Qt=new Bp(yn(650,620,`${Je.x.toFixed(2)},${Je.y.toFixed(2)},${Je.z.toFixed(2)}`,"#ccc")),Yt=new Uh(new Zf({map:Qt}));Yt.name="endText",St.position.set(Te.min.x,Te.min.y+.2,Te.min.z),Yt.position.set(Te.max.x,Te.max.y+.6,Te.max.z);let hn=Ae.current.getObjectByName("startText"),ln=Ae.current.getObjectByName("endText");hn&&ln&&(Ae.current.remove(hn,ln),Ae.current.add(St,Yt))},[ie]),C.useEffect(()=>{var ur,Yn;let Te={},qe=[],Je=[],gt={},St=[],Qt=[],Yt,hn=new URL(window.location.href),ln=new URLSearchParams(hn.search);if(ye&&De.length>0){if(Yt=Se&&Bc(De,Se),Se==""){_.current.removeFBX(Ss.current,!0);const Br=_.current.checkedKeys.current.findIndex(Gn=>Gn===Ss.current);Br>-1&&_.current.checkedKeys.current.splice(Br,1),Se==""&&(Ss.current="");const Sr=JSON.stringify(_.current.checkedKeys.current);ln.set("regionsChecked",Sr),hn.search=ln.toString(),window.history.replaceState({},"",hn)}if(Se!=""){if(Yt==null&&Se)if(Se=="fiber tract fiber tracts")Yt="fiber tract";else{let Br=Se.match(/^[\w\/]+/);Yt=Br?Br[0]:""}if(Yt){let Br=((ur=ye[Yt])==null?void 0:ur.soma)||[];St=St.concat(Br);let Sr=((Yn=ye[Yt])==null?void 0:Yn.axon)||[];Qt=Qt.concat(Sr),St=Array.from(new Set(St)),Qt=Array.from(new Set(Qt)),Qt&&Qt.forEach(bi=>{var Ua,es,Zr;for(const Ki in ye)(es=(Ua=ye[Ki])==null?void 0:Ua.soma)!=null&&es.includes(bi)&&((Zr=ye[Ki])==null?void 0:Zr.id)==1&&(Ki in Te?Te[Ki].includes(bi)||Te[Ki].push(bi):Te[Ki]=[bi])}),St&&St.forEach(bi=>{var Ua,es,Zr;for(const Ki in ye)(es=(Ua=ye[Ki])==null?void 0:Ua.axon)!=null&&es.includes(bi)&&((Zr=ye[Ki])==null?void 0:Zr.id)==1&&(Ki in gt?gt[Ki].includes(bi)||gt[Ki].push(bi):gt[Ki]=[bi])});for(let bi in gt)if(bi!=Yt){let Ua=Vo(De,bi.replace("_","/"));Ua&&Je.push({name:bi.replace("_","/"),itemStyle:{color:Ua.color},lineStyle:{color:"#ccc"},value:gt[bi].length})}for(let bi in Te)if(bi!=Yt){let Ua=Vo(De,bi.replace("_","/"));Ua&&qe.push({name:bi.replace("_","/"),itemStyle:{color:Ua.color},lineStyle:{color:"#ccc"},value:Te[bi].length})}bo(!0);let Gn=Vo(De,Yt.replace("_","/"));const dr=[{name:Yt.replace("_","/"),itemStyle:{color:Gn&&Gn.color},lineStyle:{color:"#ccc"},children:qe}],Kn=[{name:Yt.replace("_","/"),itemStyle:{color:Gn&&Gn.color},lineStyle:{color:"#ccc"},children:Je}];if(Ss.current!=Yt){_.current.removeFBX(Ss.current,!0);const bi=_.current.checkedKeys.current.findIndex(Zr=>Zr===Ss.current);bi>-1&&_.current.checkedKeys.current.splice(bi,1);const Ua=Vo(_.current.treeDatas,Yt.replace("_","/"));let es=n+"/data/FBX/"+Yt+".FBX";Ua&&Qu(es,Yt,Ua.color,.8,0,"FBX"),_.current.checkedKeys.current.push(Yt),ne(_.current.checkedKeys.current),Ss.current=Yt,ln.set("echart_Value",Se||""),hn.search=ln.toString(),window.history.replaceState({},"",hn)}const ta={series:[{type:"tree",top:"1%",bottom:"1%",symbolSize:7,emphasis:{focus:"ancestor",lineStyle:{color:"#000"}},expandAndCollapse:!0,animationDuration:550,animationDurationUpdate:750}]};if(xs.current&&Cs.current){Cs.current.style.height=Je.length*2*10+"px",xs.current.style.height=qe.length*2*10+"px";const bi=V7(xs.current);bi.setOption({...ta,tooltip:{trigger:"item",triggerOn:"mousemove",position:function(hi,mc,hd,ic,mh){const Nd=hi[0],gx=hi[1];return[Nd+10,gx]},formatter:function(hi){const mc=Yt==hi.name?"":hi.name+"->",hd=hi.value?", "+hi.value+" neurons":"";return`${mc}${Yt}${hd}`}},series:[{...ta.series[0],left:"30%",right:"30%",label:{position:"right",verticalAlign:"middle",align:"left"},leaves:{label:{position:"left",verticalAlign:"middle",align:"right"}},orient:"RL",data:dr}]});const Ua=V7(Cs.current);Ua.setOption({...ta,tooltip:{trigger:"item",triggerOn:"mousemove",position:function(hi,mc,hd,ic,mh){const Nd=hi[0],gx=hi[1],FI=mh.contentSize[0];return[Nd-FI-10,gx]},formatter:function(hi){const mc=Yt==hi.name?"":"->"+hi.name+", "+hi.value+" neurons";return`${Yt}${mc}`}},series:[{...ta.series[0],left:"20%",right:"40%",label:{position:"left",verticalAlign:"middle",align:"right"},leaves:{label:{position:"right",verticalAlign:"middle",align:"left"}},orient:"LR",data:Kn}]});const es=()=>{bi.resize(),Ua.resize()},Zr=hi=>{if(oe(Ct.indexOf("neurons")+1),xe.current.ProcessedData.current=!1,hi.data&&hi.data.name){xe.current.setSearchValue(Yt.replace("_","/")),xe.current.setSomaValue(hi.data.name.replace("_","/"));const mc=vc(dr[0],hi.data.name);bi.setOption({series:[{data:[mc]}]}),Ua.setOption({series:[{data:Kn}]})}},Ki=hi=>{if(oe(Ct.indexOf("neurons")+1),xe.current.ProcessedData.current=!1,hi.data&&hi.data.name){xe.current.setSearchValue(hi.data.name.replace("_","/")),xe.current.setSomaValue(Yt.replace("_","/"));const mc=vc(Kn[0],hi.data.name);Ua.setOption({series:[{data:[mc]}]}),bi.setOption({series:[{data:dr}]})}};return window.addEventListener("resize",es),bi.on("click",Zr),Ua.on("click",Ki),dr[0].children[0]&&Zr({data:{name:dr[0].children[0].name}}),Dl({Upstream:qe,Downstream:Je}),()=>{bi.off("click",Zr),Ua.off("click",Ki),window.removeEventListener("resize",es),bi.dispose(),Ua.dispose()}}}}else bo(!1),Cs.current&&xs.current&&(Cs.current.style.height="0px",xs.current.style.height="0px"),Dl({})}},[Se,De,ye]),C.useEffect(()=>{const Te=$o("index"),qe=$o("type"),Je=(Te||qe)&&pl.current;if(q===2)pl.current?(Qo(2,!0,!Je),pl.current=!1):Qo(2),rn(!0),h.current.noRotate=!0,h.current.noPan=!0,f.domElement.addEventListener("mousedown",Xo),f.domElement.addEventListener("mousemove",Cp),f.domElement.addEventListener("mouseup",qE),j(1);else{Ae.current.rotation.set(0,0,0),h.current.noRotate=!1,h.current.noPan=!1,f.domElement.removeEventListener("mousedown",Xo),f.domElement.removeEventListener("mousemove",Cp),f.domElement.removeEventListener("mouseup",qE),j(3),Sv(),pl.current?(Qo(1,!0,!Je),pl.current=!1):Qo(1),z(!1);const gt=Ae.current.getObjectByName("targetPoint");gt&&Ae.current.remove(gt)}},[q]),C.useEffect(()=>{Qn.length>0&&io(!0)},[Qn]);const tc=Te=>{const{positionx:qe,positiony:Je,positionz:gt}=Te;let St=new URL(window.location.href),Yt=new URLSearchParams(St.search).get("atlasReslicingInfo"),hn={};Yt&&(hn=JSON.parse(Yt)),Ge(qe),Nt(Je),kt(gt),hn.positionX=qe,hn.positionY=Je,hn.positionZ=gt;let ln=new Ie(qe,Je,gt);La.atlasReslicingInfo=hn,La.sectionPointPosition=ln,is.current&&is.current.position.set(ln.x,ln.y,ln.z)},Gu=Te=>{Dr(Te)},Qo=(Te,qe=!1,Je=!0)=>{if(Ae.current.remove(is.current),tr(Te),ue({}),it(0),q===0&&Te=="1"?rc("0",Je,qe):rc(Te,Je,qe),qe||(Te=="7"||Te=="3"?QE(!0):QE(!1)),x&&(x.current=Te),Te!==2){const ta=Ae.current.getObjectByName("syrings");ta&&Ae.current.remove(ta),z(!1),qe||D()}if(Te==2){Ai.current.position.set(18,-10,-10),Ai.current.rotation.set(2.9896,0,0),h.current.reset(),h.current.target.set(0,0,0),h.current.object.position.set(18,-10,-10),h.current.object.up.set(0,-1,0),h.current.update(),Ai.current.updateMatrixWorld();const ta=JSON.stringify({cameraPosition:Ai.current.position,cameraRotation:Ai.current.rotation}),bi=JSON.stringify({controlsTarget:h.current.target,controlsPosition:h.current.object.position,controlsUp:h.current.object.up});let Ua=new URL(window.location.href),es=new URLSearchParams(Ua.search);es.set("cameraInfo",ta),es.set("controllerInfo",bi),Ua.search=es.toString(),window.history.replaceState({},"",Ua)}Km(),Pr([]),Zt("Config_DAPI.ini"),$e.current=null,xa({}),qe||re.current&&xe.current&&_.current&&(re.current.removeALL(),xe.current.removeALL(),_.current.removeALL()),Te==1?w(!0):w(!1),Zi.current&&(Zi.current.textContent=a("4000.0208")||"选择靶点"),c!=null&&c.current&&(c.current=""),u.current&&(u.current=""),y.current=!1,d.current=!1;const gt=Ae.current.getObjectByName("sphereBig"),St=Ae.current.getObjectByName("sphereMiddelClick"),Qt=Ae.current.getObjectByName("dashedLine"),Yt=Ae.current.getObjectByName("Line"),hn=Ae.current.getObjectByName("transformControls"),ln=Ae.current.getObjectByName("sectionSphere"),ur=Ae.current.getObjectByName("correspondingPlaneDataSwc"),Yn=[];Ae.current.traverse(ta=>{ta.userData.isAtlasMapping==="true"&&Yn.push(ta)}),Yn.forEach(ta=>{Ae.current.remove(ta)}),ur&&Ae.current.remove(ur),ln&&Ae.current.remove(ln),hn&&Ae.current.remove(hn),m.current=[],b.current=[],Qt&&Ae.current.remove(Qt),Yt&&Ae.current.remove(Yt),gt&&Ae.current.remove(gt),St&&Ae.current.remove(St);const Br=Ae.current.children.filter(ta=>ta.userData.name==="registrationPng");Br&&Ae.current.remove(...Br),B.current=!1,P(!1);const Sr=Ae.current.getObjectByName("HorizontalView"),Gn=Ae.current.getObjectByName("SagittalView"),dr=Ae.current.getObjectByName("arbitrarySlice"),Kn=Ae.current.getObjectByName("CoronalView");Te!=3&&(Sr&&(Ae.current.remove(Sr),Wn(!1)),Gn&&(Ae.current.remove(Gn),Zn(!1)),dr&&(Ae.current.remove(dr),er(!1)),Kn&&(Ae.current.remove(Kn),Sn(!1))),Te==3&&setTimeout(()=>{mi(gi.current,qe)},10),fx()},lu=Te=>{r(Te),i.current=Te},vc=(Te,qe)=>{const Je=JSON.parse(JSON.stringify(Te)),gt=St=>{St.name===qe?St.lineStyle.color="#000":St.lineStyle.color="#ccc",St.children&&St.children.forEach(Qt=>{gt(Qt)})};return gt(Je),Je},Bc=(Te,qe)=>{for(let Je of Te){if(Je.name.toLowerCase()===qe.toLowerCase()||Je.fullname.toLowerCase()===qe.toLowerCase())return Je.name;if(Je.children){const gt=Bc(Je.children,qe);if(gt)return gt}}return null},ju=()=>{y.current=!y.current,d.current=!1,g.current&&Ae.current.remove(g.current)},E=()=>{if(Zi.current)if(Zi.current.textContent==(a("4000.0208")||"选择靶点"))Zi.current.textContent=a("4000.0242")||"清除靶点";else if(Zi.current.textContent===(a("4000.0126")||"重置"))on(0),V.current="",Zi.current.textContent=a("4000.0208")||"选择靶点",z(!1),D(),j(1);else{Zi.current.textContent=a("4000.0208")||"选择靶点",m.current=[],b.current=[],z(!1);const Te=Ae.current.getObjectByName("dashedLine"),qe=Ae.current.getObjectByName("sphereBig"),Je=Ae.current.getObjectByName("sphereMiddelClick"),gt=Ae.current.getObjectByName("targetPoint");Te&&qe&&Ae.current.remove(Te,qe),Je&&Ae.current.remove(Je),gt&&Ae.current.remove(gt),d.current=!1}ju()};C.useEffect(()=>{G&&xt==0&&gn(!0),xt!=0&&G&&Zi&&(Zi.current.textContent=a("4000.0126")||"重置")},[G]);const D=()=>{m.current=[],b.current=[];const Te=Ae.current.getObjectByName("dashedLine"),qe=Ae.current.getObjectByName("sphereBig"),Je=Ae.current.getObjectByName("sphereMiddelClick"),gt=Ae.current.getObjectByName("targetPoint");Te&&qe&&Ae.current.remove(Te,qe),Je&&Ae.current.remove(Je),gt&&Ae.current.remove(gt),Sv(),P(!1),W.current=[],y.current=!0,d.current=!1,B.current=!1,_.current.removeALL(),g.current&&Ae.current.remove(g.current),oe(1),c!=null&&c.current&&(c.current=""),u.current&&(u.current="")};function X(){if(!ka.current||!ka.current.startsWith("data:image/png;base64,")){alert("Please enter a valid Base64 encoded PNG string (e.g., data:image/png;base64,...).");return}const Te=document.createElement("a");Te.href=ka.current,Te.download="downloaded_image.png";const qe=document.createElement("a");qe.href="/staticresource/data/json/rgb_value.zip",qe.download="rgb_value.zip",document.body.appendChild(qe),document.body.appendChild(Te),qe.click(),setTimeout(()=>{Te.click()},200),document.body.removeChild(qe),document.body.removeChild(Te)}const le=(Te,qe)=>{clearTimeout(Wl.current),Wl.current=setTimeout(()=>{const Je=Ae.current.getObjectByName("Brain");let gt=new fo;gt.setFromAxisAngle(new Ie(1,0,0),Math.PI/2);let St=new Ie,Qt=new Rb;if(qe)if(Je&&(St=qe.position.clone().applyMatrix4(Je.matrixWorld.clone().invert()).applyQuaternion(gt)),Te==1)fetch("/app-api/c-api/slicing",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({x:0,y:0,z:St.z})}).then(Yt=>Yt.ok?Yt.json():Us.error({title:Yt.message})).then(Yt=>{const hn=Yt.base64;ka.current=hn;let ln=Qt.load(hn);ln.center.set(.5,.5),ln.rotation=Math.PI,qe.material.map=ln});else if(Te==2)fetch("/app-api/c-api/slicing",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({x:St.x,y:0,z:0})}).then(Yt=>Yt.ok?Yt.json():Us.error({title:Yt.message})).then(Yt=>{const hn=Yt.base64;let ln=Qt.load(hn);const Yn=qe.geometry.attributes.uv.array,Br=Gn=>{Yn[Gn+0]=1,Yn[Gn+1]=0,Yn[Gn+2]=1,Yn[Gn+3]=1,Yn[Gn+4]=0,Yn[Gn+5]=0,Yn[Gn+6]=0,Yn[Gn+7]=1},Sr=Gn=>{Yn[Gn+0]=1,Yn[Gn+1]=1,Yn[Gn+2]=1,Yn[Gn+3]=0,Yn[Gn+4]=0,Yn[Gn+5]=1,Yn[Gn+6]=0,Yn[Gn+7]=0};Br(0),Sr(8),qe.geometry.attributes.uv.needsUpdate=!0,qe.material.map=ln});else if(Te==3)fetch("/app-api/c-api/slicing",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({x:0,y:St.y,z:0})}).then(Yt=>(Yt.ok,Yt.json())).then(Yt=>{if(Yt.message){Us.error({content:Yt.message});return}const hn=Yt.base64;ka.current=hn;let ln=Qt.load(hn);const Yn=qe.geometry.attributes.uv.array;(Sr=>{Yn[Sr+0]=1,Yn[Sr+1]=0,Yn[Sr+2]=0,Yn[Sr+3]=0,Yn[Sr+4]=1,Yn[Sr+5]=1,Yn[Sr+6]=0,Yn[Sr+7]=1})(24),qe.geometry.attributes.uv.needsUpdate=!0,qe.material.map=ln});else{const Yt=qe.rotation.x/Math.PI*180,hn=qe.rotation.y/Math.PI*180,ln=qe.rotation.z/Math.PI*180;fetch("/app-api/c-api/slicing",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({angles:[Yt,hn,ln],center:[St.x,St.y,St.z]})}).then(ur=>ur.ok?ur.json():Us.error({title:ur.message})).then(ur=>{const Yn=ur.base64;ka.current=Yn;let Br=Qt.load(Yn);const Gn=qe.geometry.attributes.uv.array;(Kn=>{Gn[Kn+0]=0,Gn[Kn+1]=0,Gn[Kn+2]=1,Gn[Kn+3]=0,Gn[Kn+4]=0,Gn[Kn+5]=1,Gn[Kn+6]=1,Gn[Kn+7]=1})(24),qe.geometry.attributes.uv.needsUpdate=!0,qe.material.map=Br})}},100)},Ce=(Te,qe)=>{let Je,gt=0,St=new URL(window.location.href),Yt=new URLSearchParams(St.search).get("atlasReslicingInfo"),hn={};Yt&&(hn=JSON.parse(Yt)),gi.current==1?(Ae.current.children.forEach(function(ln,ur){qe==3&&ln.name=="CoronalView"&&(gt=ur)}),Je=new Ie(0,0,Te),Ae.current.children[gt].position.setZ(Je.z),le(gi.current,Ae.current.children[gt])):gi.current==2?(Ae.current.children.forEach(function(ln,ur){qe==1&&ln.name=="SagittalView"&&(gt=ur)}),Je=new Ie(Te,0,0),Ae.current.children[gt].position.setX(Je.x),le(gi.current,Ae.current.children[gt])):gi.current==3?(Ae.current.children.forEach(function(ln,ur){qe==2&&ln.name=="HorizontalView"&&(gt=ur)}),Je=new Ie(0,Te,0),Ae.current.children[gt].position.setY(Je.y),le(gi.current,Ae.current.children[gt])):gi.current==4&&(Ae.current.children.forEach(function(ln,ur){ln.name=="arbitrarySlice"&&(gt=ur)}),qe==3&&(kt(Te),hn.positionZ=Te,La.atlasReslicingInfo=hn,Je=new Ie(ar,At,Te),Ae.current.children[gt].position.setZ(Je.z)),qe==2&&(Nt(Te),hn.positionY=Te,La.atlasReslicingInfo=hn,Je=new Ie(Ft,Te,Ft),Ae.current.children[gt].position.setY(Je.y)),qe==1&&(Ge(Te),hn.positionX=Te,La.atlasReslicingInfo=hn,Je=new Ie(Te,At,Ft),Ae.current.children[gt].position.setX(Je.x)),le(gi.current,Ae.current.children[gt]))},Ye=Te=>{let qe=new URL(window.location.href),gt=new URLSearchParams(qe.search).get("atlasReslicingInfo"),St={};gt&&(St=JSON.parse(gt)),gi.current==2&&(Ge(Te),Nt(-5.33),kt(-8),Ce(Te,1),St.positionX=Te,St.positionY=-5.33,St.positionZ=-8,La.atlasReslicingInfo=St),gi.current==4&&Ce(Te,1)},Ot=Te=>{let qe=new URL(window.location.href),gt=new URLSearchParams(qe.search).get("atlasReslicingInfo"),St={};gt&&(St=JSON.parse(gt)),gi.current==3&&(Nt(Te),kt(-8),Ge(-5.17),St.positionX=-5.17,St.positionY=Te,St.positionZ=-8,La.atlasReslicingInfo=St,Ce(Te,2)),gi.current==4&&Ce(Te,2)},tn=Te=>{let qe=new URL(window.location.href),gt=new URLSearchParams(qe.search).get("atlasReslicingInfo"),St={};gt&&(St=JSON.parse(gt)),gi.current==1&&(kt(Te),Ge(-5.17),Nt(-5.33),Ce(Te,3),St.positionX=-5.17,St.positionY=-5.33,St.positionZ=Te,La.atlasReslicingInfo=St),gi.current==4&&Ce(Te,3)},pn=(Te,qe)=>{let Je=0,gt=new URL(window.location.href),Qt=new URLSearchParams(gt.search).get("atlasReslicingInfo"),Yt={};Qt&&(Yt=JSON.parse(Qt)),Ae.current.children.forEach(function(Br,Sr){Br.name=="arbitrarySlice"&&(Je=Sr)});let hn=Ae.current.children[Je];hn.rotation.set(hn.userData.initRotation.x,hn.userData.initRotation.y,hn.userData.initRotation.z);let ln=0,ur=0,Yn=0;qe==1&&(dn(Te),Yt.angleX=Te,La.atlasReslicingInfo=Yt,ln=Te*Math.PI/180,ur=Xn*Math.PI/180,Yn=Or*Math.PI/180),qe==2&&(cr(Te),Yt.angleY=Te,La.atlasReslicingInfo=Yt,ln=Rn*Math.PI/180,ur=Te*Math.PI/180,Yn=Or*Math.PI/180),qe==3&&(Bn(Te),Yt.angleZ=Te,La.atlasReslicingInfo=Yt,ln=Rn*Math.PI/180,ur=Xn*Math.PI/180,Yn=Te*Math.PI/180),hn.rotation.x=ln,hn.rotation.y=ur,hn.rotation.z=Yn,Ae.current.children.forEach(function(Br,Sr){Br.name=="arbitrarySlice"&&(Je=Sr)}),le(gi.current,Ae.current.children[Je])},Jn=(Te,qe=!1)=>{let Je;const gt=Te||o;if(gi.current==4||qe)setTimeout(()=>{let St="atlas.brainsmatics.org",Qt=[],Yt=parseInt(((Ft+8)/14*14e3).toString()),hn=parseInt(((At+5.33)/7.37*9e3).toString());qe?(Qt[0]=90+zi.angles[0],Qt[1]=zi.angles[1],Qt[2]=zi.angles[2],Yt=zi.tx*14e3,hn=450):(Qt[0]=Rn,Qt[1]=Xn,Qt[2]=Or);let ln=parseInt(((ar+5.17)/10.34*11400).toString()),ur=ke||"http://"+St,Yn="http://"+St+'/program/frontend/#!{"dimensions":{"x":[0.000001,"m"],"y":[0.000001,"m"],"z":[0.000001,"m"]},"position":['+ln+","+hn+","+Yt+'],"crossSectionOrientation":[0.7071067690849304,0,0,-0.7071067690849304],"crossSectionScale":19.05662684586283,"projectionOrientation":[0.10079027712345123,0.01086505874991417,-0.5527856945991516,-0.827134370803833],"projectionScale":74319.80669416502,"projectionDepth":-49.99956451007631,"layers":[{"type":"image","source":{"url":"precomputed://'+ur+'/data/RGB_raw","transform":{"outputDimensions":{"x":[0.000001,"m"],"y":[0.000001,"m"],"z":[0.000001,"m"],"c^":[1,""]},"inputDimensions":{"x":[0.000001,"m"],"y":[0.000001,"m"],"z":[0.000001,"m"],"c^":[1,""]}}},"tab":"rendering","shader":"#uicontrol invlerp normalized\\nvoid main() {\\n emitRGB(vec3(toNormalized(getDataValue(0)),\\n toNormalized(getDataValue(1)),\\n toNormalized(getDataValue(2))));\\n}\\n","channelDimensions":{"c^":[1,""]},"name":"raw"},{"type":"segmentation","source":{"url":"precomputed://'+ur+'/data/seg_half","transform":{"outputDimensions":{"x":[0.000001,"m"],"y":[0.000001,"m"],"z":[0.000001,"m"]},"inputDimensions":{"x":[0.00001,"m"],"y":[0.00001,"m"],"z":[0.00001,"m"]}}},"tab":"segments","segments":["10","100","1000","1002","1004","1005","1006","1007","1008","1009","1010","1011","1012","1013","1014","1015","1016","1017","1018","1019","1020","1021","1022","1023","1024","1025","1026","1100","104","105","106","107","108","11","110","111","112","113","114","115","117","118","119","12","120","122","123","124","125","126","129","13","130","131","134","138","14","141","142","143","146","147","149","15","150","152","154","156","159","16","160","162","164","165","166","167","168","170","172","173","174","176","177","178","179","18","180","181","182","183","186","189","19","190","192","193","194","195","196","199","2","20","201","202","203","204","206","207","208","21","212","215","216","217","219","22","220","221","223","224","225","228","229","23","230","231","232","234","235","236","237","238","239","24","241","242","243","245","246","247","248","25","250","251","253","254","256","257","259","26","260","265","266","267","268","27","271","272","273","275","276","279","28","280","282","283","284","287","29","291","293","294","295","296","297","298","3","30","300","303","304","305","306","31","311","312","313","315","319","32","320","321","322","323","324","325","326","329","33","330","331","332","333","335","336","337","338","34","340","341","342","343","344","347","348","349","35","350","351","352","354","355","356","357","359","36","361","362","365","366","367","368","369","37","371","372","373","374","375","376","377","378","38","380","385","386","387","389","39","390","391","392","393","394","395","397","399","4","40","401","402","405","407","409","41","412","413","414","415","416","417","419","42","422","423","424","426","427","428","43","430","432","435","438","439","44","440","441","442","443","444","445","446","449","45","450","451","452","453","454","456","458","459","46","460","461","462","463","464","465","466","467","47","470","473","474","475","476","478","479","48","480","481","484","485","486","487","488","49","490","491","493","494","497","498","499","5","50","500","501","503","504","505","507","508","51","510","511","512","513","514","516","517","518","519","52","520","528","529","53","533","535","536","537","538","539","54","540","541","542","544","545","546","548","549","55","550","553","554","555","556","557","559","56","561","562","563","565","568","57","570","571","572","573","574","575","576","578","579","58","581","582","584","586","59","591","593","594","595","597","599","6","60","601","602","604","606","61","611","612","613","614","615","616","617","618","619","62","620","621","622","623","624","625","627","628","629","63","631","632","635","637","638","639","64","641","642","643","644","645","646","647","648","65","650","652","653","656","657","658","660","661","662","665","666","667","67","671","672","673","674","677","678","679","68","680","681","682","683","684","686","687","688","690","693","695","696","697","698","699","7","701","702","704","706","707","708","709","710","711","712","713","716","717","72","720","721","722","724","725","727","729","731","733","734","735","736","737","74","740","744","746","748","749","750","752","754","755","757","758","759","76","760","762","763","764","765","767","768","769","770","771","772","773","774","775","776","778","779","78","780","783","784","785","787","789","790","791","793","796","797","798","799","8","80","803","804","808","809","81","810","812","816","818","819","82","821","823","824","826","827","829","83","830","831","832","834","835","837","839","84","840","841","842","843","844","846","849","850","851","855","856","857","858","86","861","863","864","865","867","868","869","87","870","871","872","874","875","876","877","878","879","88","880","881","883","885","888","889","89","892","893","894","895","896","898","899","9","90","901","902","906","908","909","91","911","913","915","916","917","919","92","920","921","925","926","927","928","929","93","931","934","935","936","937","938","940","941","942","944","945","946","951","953","954","955","956","957","959","96","963","964","965","966","969","97","970","971","972","973","977","978","980","981","982","983","989","99","991","992","993","995","996","997","998","999"],"segmentQuery":"<id","segmentColors":{"2":"#777b7b","3":"#777979","4":"#848989","5":"#8e9494","6":"#8c9191","7":"#778383","8":"#778181","9":"#93a2a2","10":"#5e6767","11":"#93c1c1","12":"#6b7474","13":"#93c0c0","14":"#8eacac","15":"#727979","16":"#91afaf","18":"#93b4b4","19":"#729c9c","20":"#212d2d","21":"#304242","22":"#2d3e3e","23":"#2b3232","24":"#1e2929","25":"#707676","26":"#7c8383","27":"#89bbbb","28":"#608383","29":"#7c9d9d","30":"#777d7d","31":"#7a8080","32":"#778080","33":"#7f8585","34":"#6d8a8a","35":"#829d9d","36":"#545d5d","37":"#93a4a4","38":"#4c5454","39":"#474f4f","40":"#8cbebe","41":"#7a9a9a","42":"#93b8b8","43":"#84a0a0","44":"#93a1a1","45":"#93baba","46":"#84b4b4","47":"#6d9595","48":"#82b0b0","49":"#6b9191","50":"#7fadad","51":"#87a3a3","52":"#636c6c","53":"#596363","54":"#334545","55":"#2b3b3b","56":"#666f6f","57":"#476161","58":"#939898","59":"#637e7e","60":"#7aa0a0","61":"#7fa5a5","62":"#444d4d","63":"#f2bb3a","64":"#77d1ff","65":"#3ddeff","67":"#2cc15e","68":"#ffd877","72":"#ffbfad","74":"#e5d60b","76":"#40c3dd","78":"#f7e1af","80":"#3bdddd","81":"#a0dfff","82":"#d67259","83":"#ffab93","84":"#f2c04b","86":"#91503f","87":"#3cabc1","88":"#3db4cc","89":"#f7d585","90":"#723f32","91":"#ffb49e","92":"#f4cf53","93":"#ffbf0f","96":"#f2dca7","97":"#e2d92f","99":"#f4d05a","100":"#399eb2","104":"#4dcc77","105":"#f7da96","106":"#d35dac","107":"#ffd15e","108":"#3cd1d1","110":"#55ccb8","111":"#3aa2b7","112":"#bc782f","113":"#8cccc1","114":"#f7d68a","115":"#82ccbf","117":"#6acc8a","118":"#b2af07","119":"#ffd044","120":"#75d1ff","122":"#ef8064","123":"#37dbfc","124":"#c6499d","125":"#66cbff","126":"#ffc32d","129":"#66ccbb","130":"#f7dea3","131":"#fc957b","134":"#ffb5a0","138":"#84493a","141":"#8accc1","142":"#e5d609","143":"#45d9f7","146":"#d8cb17","147":"#f2dca4","149":"#d1ca06","150":"#ce8333","152":"#67afa3","154":"#f2bd43","156":"#ffcf3f","159":"#f79279","160":"#f29d43","162":"#e5d604","164":"#b2af01","165":"#75e5e5","166":"#ffc83f","167":"#ffbdaa","168":"#74c4ed","170":"#ccc50c","172":"#ffa78e","173":"#42cae5","174":"#a2dcf9","176":"#af702b","177":"#965342","178":"#f4bc04","179":"#51cc7a","180":"#d68733","181":"#3ac4e0","182":"#ffc021","183":"#f7d483","186":"#f2dda9","189":"#3eb766","190":"#72ccbd","192":"#f4927a","193":"#f7dc9e","194":"#d1ca04","195":"#fc976c","196":"#fc67ca","199":"#52e5e5","201":"#ffd366","202":"#ffca2d","203":"#ed9436","204":"#ffe7a0","206":"#74ccbd","207":"#33cc66","208":"#36d9f9","212":"#71e2e2","215":"#edd39c","216":"#d38634","217":"#ed9b44","219":"#ccc345","220":"#60e5e5","221":"#c96b54","223":"#ccc62a","224":"#34d0ef","225":"#ffd454","228":"#ea9a44","229":"#f4cf55","230":"#3bcece","231":"#a85c4a","232":"#ffad96","234":"#ffd97a","235":"#ffda7f","236":"#ffc61c","237":"#c6c00d","238":"#f2b935","239":"#ffc107","241":"#ffdf89","242":"#64e5e5","243":"#edca80","245":"#ccc863","246":"#ea7d62","247":"#c9489e","248":"#3fdbdb","250":"#edd5a3","251":"#2bc45e","253":"#ffca44","254":"#f7d380","256":"#ffc832","257":"#f7e0aa","259":"#ffd351","260":"#6bb6db","265":"#d8cb15","266":"#37cc68","267":"#378c9e","268":"#38c9b1","271":"#6bbaad","272":"#39c2dd","273":"#ffc32b","275":"#37ccb3","276":"#3fc1db","279":"#eab94f","280":"#eab84b","282":"#d37158","283":"#38c4c4","284":"#ffdb82","287":"#f7d588","291":"#f9be48","293":"#f49369","294":"#d149a3","295":"#f4cc49","296":"#63a096","297":"#ffe69e","298":"#ff9b70","300":"#f7a27e","303":"#f7a042","304":"#ccc241","305":"#88ccc0","306":"#eaba52","311":"#34ceed","312":"#d8cc1e","313":"#91daff","315":"#f9c04d","319":"#ff996d","320":"#4be5e5","321":"#ffcdbf","322":"#ddd75a","323":"#ffd263","324":"#e0785e","325":"#70e0e0","326":"#ffcf42","329":"#a4defc","330":"#69b2a6","331":"#67a1bf","332":"#57cc7e","333":"#ffbf11","335":"#ea8e77","336":"#ffc73a","337":"#76c9f2","338":"#7f4638","340":"#c16953","341":"#46defc","342":"#f7e1ad","343":"#68aed1","344":"#ff9367","347":"#c4be0d","348":"#6ab7aa","349":"#ffb805","350":"#639bb7","351":"#38bcff","352":"#ed63bf","354":"#f2bc3e","355":"#ffd154","356":"#f2da9d","357":"#e5d606","359":"#9bddff","361":"#ffc311","362":"#ffbb11","365":"#ffa58e","366":"#ffbe1c","367":"#ffb807","368":"#34c8e5","369":"#c1bb0d","371":"#ffbe0c","372":"#a3e0ff","373":"#774234","374":"#3995a8","375":"#d849a9","376":"#3daf63","377":"#ffe8a3","378":"#41cc6f","380":"#ffc823","385":"#ccc751","386":"#5bcc81","387":"#ccc85f","389":"#41bfd8","390":"#36bca6","391":"#edce8b","392":"#54e5e5","393":"#3baa60","394":"#36a9e2","395":"#ef9637","397":"#ffc72d","399":"#68a89d","401":"#ffcc4c","402":"#fc50c3","405":"#3a9aad","407":"#d17057","409":"#77e5e5","412":"#7ee5e5","413":"#b2af05","414":"#67acce","415":"#f2bf48","416":"#c66c55","417":"#5fccb9","419":"#69bfb0","422":"#f265c3","423":"#ffb90a","424":"#41bf6b","426":"#e861bb","427":"#56c6ff","428":"#80ccbf","430":"#389e5a","432":"#ffda7c","435":"#53ccb7","438":"#57e5e5","439":"#f9c252","440":"#ffc416","441":"#ffd259","442":"#6cccbc","443":"#ffa991","444":"#74c4ef","445":"#eadf07","446":"#ffc023","449":"#f7e3b4","450":"#4fcc79","451":"#ffb6a0","452":"#f99c39","453":"#75caf4","454":"#a55b48","456":"#99dcff","458":"#ff976b","459":"#3fcc6e","460":"#ffbd19","461":"#ccc62c","462":"#35d4f4","463":"#76ccbd","464":"#ffd04f","465":"#ccc861","466":"#3aa35d","467":"#ba7b37","470":"#ffe08c","473":"#ff916d","474":"#37bfa8","475":"#efab0b","476":"#ffa187","478":"#66a59b","479":"#efa802","480":"#754033","481":"#ccc859","484":"#6accbb","485":"#3cad62","486":"#f79b38","487":"#b2af08","488":"#f4cb44","490":"#edcf90","491":"#ffcc35","493":"#ccc855","494":"#43cc70","497":"#ea9335","498":"#44e5e5","499":"#edcc84","500":"#ffa791","501":"#39a0b5","503":"#c9c30c","504":"#ffa389","505":"#ffc430","507":"#f9a47f","508":"#63ccba","510":"#f2dfae","511":"#ffd56b","512":"#a35a47","513":"#e89843","514":"#ffd7cc","516":"#5be5e5","517":"#6bc689","518":"#ffc20c","519":"#ccc85d","520":"#3db6ce","528":"#f2da9f","529":"#ffd051","533":"#35cc67","535":"#dd765d","536":"#39a05c","537":"#f2be46","538":"#3fbad3","539":"#77cef9","540":"#3dbeff","541":"#ed9078","542":"#c14799","544":"#9b5544","545":"#8c4d3d","546":"#ffc10a","548":"#f4be0c","549":"#f7e2b2","550":"#3fbfff","553":"#edd49e","554":"#bf6852","555":"#55cc7d","556":"#368a9b","557":"#bc6651","559":"#ffcd4f","561":"#35cae8","562":"#efa907","563":"#ccc347","565":"#3dd3d3","568":"#59ccb8","570":"#ffce54","571":"#39c0db","572":"#e2da31","573":"#f2bb3c","574":"#93dbff","575":"#824739","576":"#e89135","578":"#82e5e5","579":"#68ccff","581":"#ffd256","582":"#ffdf87","584":"#45dbf9","586":"#e08d35","591":"#ffbc05","593":"#ff906b","594":"#84d6ff","595":"#41c16c","597":"#f24fbc","599":"#ddd75f","601":"#ffe18e","602":"#7be5e5","604":"#36c1aa","606":"#ff8e68","611":"#368ea0","612":"#5bc8ff","613":"#79e5e5","614":"#3ba55f","615":"#a5e1ff","616":"#d64aa7","617":"#ffc61e","618":"#3de5e5","619":"#e24ab0","620":"#c6833b","621":"#edcb82","622":"#59c7ff","623":"#3db565","624":"#f9bb3e","625":"#2bbc5b","627":"#ffcb30","628":"#f9a143","629":"#ffc228","631":"#edcd89","632":"#d8cc1c","635":"#efac0e","637":"#7fd4ff","638":"#35d2f2","639":"#ffcd3a","641":"#ffd9ce","642":"#ffbf1e","643":"#eab84d","644":"#ffc9ba","645":"#41ccb4","646":"#f9ba3b","647":"#cec80c","648":"#f4bd09","650":"#3cb1c9","652":"#ffc528","653":"#ce4aa2","656":"#f4bd07","657":"#5dad78","658":"#ff8c66","660":"#ffbba8","661":"#79d0fc","662":"#ffd559","665":"#ffe69b","666":"#ffd456","667":"#ffca47","671":"#f9c14f","672":"#7a4335","673":"#ffbd0a","674":"#ffde84","677":"#f4ca3f","678":"#659fbc","679":"#3ba5ba","680":"#ffa787","681":"#e87c61","682":"#e8a310","683":"#ffc730","684":"#f9bd45","686":"#ba4693","687":"#ba762e","688":"#eade02","690":"#fc9d37","693":"#e8a412","695":"#eadf04","696":"#f4c93d","697":"#ed7f63","698":"#efaa09","699":"#ffcfc1","701":"#ccc349","702":"#ed4eb8","704":"#ffd35b","706":"#2cc960","707":"#d85fb0","708":"#f4c835","709":"#935141","710":"#3fccb4","711":"#ffce3d","712":"#c46a54","713":"#41c5e0","716":"#8cd8ff","717":"#f765c6","720":"#38bed8","721":"#b2af00","722":"#2bbf5d","724":"#b74792","725":"#f2ba37","727":"#37c6af","729":"#f4cd4b","731":"#3fdfff","733":"#67bcae","734":"#43cce8","735":"#49c2ff","736":"#3bcccc","737":"#f2d896","740":"#f4c93a","744":"#edd5a1","746":"#ffc3b2","748":"#4fbff7","749":"#f2d99b","750":"#3cadc4","752":"#84ccc0","754":"#c67e31","755":"#f4cc46","757":"#f29179","758":"#379b59","759":"#ffa382","760":"#f2deab","762":"#ffe8a5","763":"#ddd75d","764":"#bf792f","765":"#f4bc02","767":"#42c0ff","768":"#e58d77","769":"#ffc535","770":"#62e5e5","771":"#5dcc82","772":"#3ca7bc","773":"#f4d15d","774":"#ffc519","775":"#e84cb4","776":"#45cc72","778":"#6cb8dd","779":"#dd8c35","780":"#edd093","783":"#ffc532","784":"#ffb9a5","785":"#ffd65b","787":"#3dccb4","789":"#80e5e5","790":"#649dba","791":"#f49f44","793":"#67afd3","796":"#40e5e5","797":"#f7dda0","798":"#47ccb5","799":"#ccc857","803":"#45ccb5","804":"#ffbd07","808":"#b2458e","809":"#dd4bad","810":"#a8e2ff","812":"#ffa37c","816":"#40bc69","818":"#6eccbc","819":"#68b1d6","821":"#d88934","823":"#44d7f4","824":"#cc5ba6","826":"#4fc4ff","827":"#3ed6d6","829":"#eabb54","830":"#f9b939","831":"#ffc005","832":"#ffd775","834":"#d18534","835":"#ffd260","837":"#c47d31","839":"#39bfbf","840":"#ffcd51","841":"#ffdd82","842":"#bf4897","843":"#e5d602","844":"#49e5e5","846":"#f74fbf","849":"#e88d76","850":"#f4a07c","851":"#ffaf99","855":"#ffc928","856":"#63cbff","857":"#f4d058","858":"#c45aa1","861":"#30cc64","863":"#c95ca5","864":"#ffd059","865":"#47cc73","867":"#f9b834","868":"#edc97b","869":"#ffca2b","870":"#f4c838","871":"#ffc942","872":"#3cb263","874":"#ffb29b","875":"#ffbd16","876":"#f2d898","877":"#ccc62e","878":"#ffd468","879":"#ccc243","880":"#e25fb7","881":"#ffd1c4","883":"#f9937a","885":"#f29837","888":"#e2da34","889":"#379957","892":"#e2795f","893":"#5faf79","894":"#ffc721","895":"#ffc30f","896":"#65a398","898":"#efa904","899":"#4fccb7","901":"#2bc65f","902":"#ffc83d","906":"#5bccb9","908":"#eab748","909":"#ffb39e","911":"#8e4e3e","913":"#ff9f84","915":"#89d7ff","916":"#edd29a","917":"#6ccc8c","919":"#f2c04d","920":"#3dcc6c","921":"#44d1ed","925":"#ce6e56","926":"#d15eaa","927":"#e59744","928":"#fca580","929":"#39c6c6","931":"#6cc98b","934":"#41c8e2","935":"#6bcdff","936":"#ffd147","937":"#874a3b","938":"#5ec9ff","940":"#f49938","941":"#3fba68","942":"#e060b5","944":"#edc97d","945":"#7cccbe","946":"#5caa76","951":"#a05846","953":"#ffc1af","954":"#ffa57f","955":"#ffa58c","956":"#ffc62b","957":"#ffcf56","959":"#50c3fc","963":"#f7dfa8","964":"#db755c","965":"#82d5ff","966":"#ffd34f","969":"#3db0c6","970":"#38bcbc","971":"#54e2ff","972":"#44c0ff","973":"#f7db99","977":"#ffc5b5","978":"#ffba0c","980":"#ffbb0f","981":"#cc8233","982":"#ccc23f","983":"#ffcc32","989":"#ffc935","991":"#db8a34","992":"#ffa584","993":"#f9bd43","995":"#edcf8e","996":"#37baba","997":"#66aacc","998":"#43ccb5","999":"#3eb8d1","1000":"#db5eb1","1002":"#3de2e2","1004":"#37ade8","1005":"#36c4ac","1006":"#d8cc1a","1007":"#54c6ff","1008":"#aa5e4b","1009":"#ef8f77","1010":"#4fc1f9","1011":"#1c2626","1012":"#a5e1ff","1013":"#a5e1ff","1014":"#a5e1ff","1015":"#a5e1ff","1016":"#47cc74","1017":"#47cc75","1018":"#47cc76","1019":"#47cc77","1020":"#47cc78","1021":"#f99c40","1022":"#f99c41","1023":"#ff9368","1024":"#8b51ff","1025":"#8d54ff","1026":"#894fff","1100":"#3ce0e0"},"name":"seg2"}],"showDefaultAnnotations":false,"sliceAngleRotaX":"'+Qt[0]+'","sliceAngleRotaY":"'+Qt[1]+'","sliceAngleRotaZ":"'+Qt[2]+'","selectedLayer":{"visible":true,"layer":"seg2"},"crossSectionBackgroundColor":"#ffffff","projectionBackgroundColor":"#ffffff","layout":"hzkdPanel"}';window.open(Yn,"_blank")},300);else if(gi.current==1)Je=parseInt(((Ft+8)/13.9919970598834*700).toString()),window.open("http://"+zn.current+"/STAM/reference/index.html?lang=en_us&3Dname="+gt+"&inp="+Je+"§ion=coronal");else if(gi.current==2){let St=ar;ar<0&&(St=-ar),Je=parseInt((St/5.17*256).toString()),ar==0&&(Je=1),window.open("http://"+zn.current+"/STAM/reference/index.html?lang=en_us&3Dname="+gt+"&inp="+Je+"§ion=sagittal")}else gi.current==3&&(Je=parseInt(((At+5.33)/7.37*367).toString()),window.open("http://"+zn.current+"/STAM/reference/index.html?lang=en_us&3Dname="+gt+"&inp="+Je+"§ion=horizontal"))},Fr=(Te,qe,Je,gt,St,Qt,Yt,hn,ln,ur,Yn)=>{let Br=new URL(window.location.href),Gn=new URLSearchParams(Br.search).get("atlasReslicingInfo"),dr={};Gn&&(dr=JSON.parse(Gn)),dr.angleX=Te,dr.angleY=qe,dr.angleZ=Je,dr.positionZ=Qt,dr.positionX=gt,dr.positionY=St,dr.translateX=Yt,dr.translateY=hn,dr.translateZ=ln,dr.ButtonDisabled=Yn,dr.rotate=ur,dr.direction1=gi.current,La.atlasReslicingInfo=dr,dn(Te),cr(qe),Bn(Je),kt(Qt),Ge(gt),Nt(St),Vt(Yt),Dn(hn),Rt(ln),Un(ur),xr(Yn)},mi=(Te,qe=!1)=>{Ae.current.remove(is.current);let Je=is.current.position;if(qe&&wR){let St=JSON.parse(wR);Je=new Ie(St.positionX,St.positionY,St.positionZ)}let gt=Te;if(Eu(gt),gt==1){at.current.enabled=!1,Ae.current.remove(at.current),Hl(0),gi.current=1,Fr(90,0,0,-5.17,-5.33,Je.z,!0,!0,!1,!0,!1);const St=Ae.current.getObjectByName("HorizontalView"),Qt=Ae.current.getObjectByName("SagittalView"),Yt=Ae.current.getObjectByName("arbitrarySlice"),hn=Ae.current.getObjectByName("CoronalView");St&&(St.position.y=Je.y,Ae.current.remove(St),Wn(!1)),Qt&&(Qt.position.x=Je.x,Ae.current.remove(Qt),Zn(!1)),Yt&&(Yt.position.set(Je.x,Je.y,Je.z),Ae.current.remove(Yt),er(!1)),hn?(hn.position.z=Je.z,Ae.current.remove(hn),Sn(!1)):Sn(!0)}else if(gt==2){Hl(0),at.current.enabled=!1,Ae.current.remove(at.current),Fr(90,270,0,Je.x,-5.33,-8,!1,!0,!0,!0,!1),gi.current=2;const St=Ae.current.getObjectByName("HorizontalView"),Qt=Ae.current.getObjectByName("SagittalView"),Yt=Ae.current.getObjectByName("arbitrarySlice"),hn=Ae.current.getObjectByName("CoronalView");Qt?(Qt.position.x=Je.x,Ae.current.remove(Qt),Zn(!1)):Zn(!0),St&&(St.position.y=Je.y,Ae.current.remove(St),Wn(!1)),hn&&(hn.position.z=Je.z,Ae.current.remove(hn),Sn(!1)),Yt&&(Yt.position.set(Je.x,Je.y,Je.z),Ae.current.remove(Yt),er(!1))}else if(gt==3){at.current.enabled=!1,Ae.current.remove(at.current),Fr(360,0,0,-5.17,Je.y,-8,!0,!1,!0,!0,!1),gi.current=3,Hl(0);const St=Ae.current.getObjectByName("HorizontalView"),Qt=Ae.current.getObjectByName("SagittalView"),Yt=Ae.current.getObjectByName("arbitrarySlice"),hn=Ae.current.getObjectByName("CoronalView");Qt&&(Qt.position.x=Je.x,Ae.current.remove(Qt),Zn(!1)),hn&&(hn.position.z=Je.z,Ae.current.remove(hn),Sn(!1)),Yt&&(Yt.position.set(Je.x,Je.y,Je.z),Ae.current.remove(Yt),er(!1)),St?(St.position.y=Je.y,Ae.current.remove(St),Wn(!1)):Wn(!0)}else if(gt==4){gi.current=4,Ae.current.remove(at.current),Fr(120,320,270,Je.x,Je.y,Je.z,!1,!1,!1,!1,!1);const St=Ae.current.getObjectByName("HorizontalView"),Qt=Ae.current.getObjectByName("SagittalView"),Yt=Ae.current.getObjectByName("arbitrarySlice"),hn=Ae.current.getObjectByName("CoronalView");Qt&&(Qt.position.x=Je.x,Ae.current.remove(Qt),Zn(!1)),hn&&(hn.position.z=Je.z,Ae.current.remove(hn),Sn(!1)),St&&(St.position.y=Je.y,Ae.current.remove(St),Wn(!1)),Yt?(Yt.position.set(Je.x,Je.y,Je.z),Ae.current.remove(Yt),er(!1)):er(!0)}},Ji=Te=>{var qe=d1(Te,su.current);if(A.includes(Te)){_.current.removeFBX(Te,!0);const Je=_.current.checkedKeys.current.findIndex(Yt=>Yt===Te);Je>-1&&_.current.checkedKeys.current.splice(Je,1),ne(_.current.checkedKeys.current);let gt=new URL(window.location.href),St=new URLSearchParams(gt.search);const Qt=JSON.stringify(_.current.checkedKeys.current);St.set("regionsChecked",Qt),gt.search=St.toString(),window.history.replaceState({},"",gt),_&&_.current.checkedKeys.current.length==0?_.current.setExpandedKeys(_.current.defexpandedKeys.current):qe.forEach(Yt=>{_.current.setExpandedKeys(hn=>hn.filter(ln=>ln!==Yt))})}else if(Te){let Je=Te.replace("/","_");const gt=_.current.fetchColor(Te);if(gt){let St=n+"/data/FBX/"+Je+".FBX";Qu(St,Te,gt,.8,0,"FBX"),_.current.checkedKeys.current.push(Te);const Qt=Array.from(new Set([..._.current.expandedKeys,...qe]));_.current.setExpandedKeys(Qt),ne(_.current.checkedKeys.current);let Yt=new URL(window.location.href),hn=new URLSearchParams(Yt.search);const ln=JSON.stringify(_.current.checkedKeys.current);hn.set("regionsChecked",ln),Yt.search=hn.toString(),window.history.replaceState({},"",Yt)}}Jr({})},as=Te=>{var Je;if(A.includes(Te)){_.current.removeFBX(Te,!0);const gt=_.current.checkedKeys.current.findIndex(hn=>hn===Te);gt>-1&&_.current.checkedKeys.current.splice(gt,1),ne(_.current.checkedKeys.current);let St=new URL(window.location.href),Qt=new URLSearchParams(St.search);const Yt=JSON.stringify(_.current.checkedKeys.current);Qt.set("regionsChecked",Yt),St.search=Qt.toString(),window.history.replaceState({},"",St)}else if(Te){const gt=_.current.fetchColor(Te.replace("_","/"));let St=n+"/data/FBX/"+Te.replace("/","_")+".FBX";Qu(St,Te,gt,.8,0),_.current.checkedKeys.current.push(Te),ne(_.current.checkedKeys.current);let Qt=new URL(window.location.href),Yt=new URLSearchParams(Qt.search);const hn=JSON.stringify(_.current.checkedKeys.current);Yt.set("regionsChecked",hn),Qt.search=Yt.toString(),window.history.replaceState({},"",Qt)}const qe=W.current.findIndex(gt=>gt===Te);qe>-1?W.current.splice(qe,1):W.current.push(Te),(Je=f.domElement)==null||Je.addEventListener("mousemove",se.current,!1)},Co=Te=>{if(Te in xe.current.neurons_line.current){xe.current.removeSWCAll(Te),xe.current.setCheckItems(St=>St.filter(Qt=>Qt!==Te)),xe.current.setPathOpen(St=>St.filter(Qt=>Qt!==Te));let qe=new URL(window.location.href),Je=new URLSearchParams(qe.search);const gt=JSON.stringify(xe.current.checkItems.filter(St=>St!==Te));if(Je.set("neuronsChecked",gt),qe.search=Je.toString(),window.history.replaceState({},"",qe),Te in ve.current){for(let St in ve.current[Te])Ae.current.remove(ve.current[Te][St]);delete ve.current[Te]}}},Hs=()=>{if(!Kt.current){Fo(!0);return}const Te=document.createElement("a");Te.href=n+"/zip/9.8.label.zip",Te.download="9.8.label.zip",Te.click();let qe=new URL(window.location.href),gt=new URLSearchParams(qe.search).get("type");const St=window.location.origin+window.location.pathname+`?type=${gt}`;fetch("/app-api/java-api/brainsweb-service/record/list",{method:"post",body:JSON.stringify({href:St,time:0,key:fn.current})}).then(Qt=>Qt.json()).then(Qt=>{})},Vo=(Te,qe)=>{for(let Je of Te){if(Je.name.toLowerCase()===qe.toLowerCase())return{color:Je.color,path:Je.path,fullname:Je.fullname};if(Je.children){const gt=Vo(Je.children,qe);if(gt)return gt}}return null},Il=(Te,qe)=>{for(let Je of Te){if(Je.name.toLowerCase()===qe.toLowerCase()&&!Je.children)return{color:Je.color,path:Je.path};if(Je.children){const gt=Il(Je.children,qe);if(gt)return gt}}return null},ll=(Te,qe)=>{const Je=[];for(const gt in Te)Te[gt].includes(qe)&&Je.push(gt);return Je},cu=(Te,qe=[])=>{if(Array.isArray(Te))for(let Je of Te)cu(Je,qe);if(typeof Te=="object")if(Te.hasOwnProperty("children"))cu(Te.children,qe);else return Te.name&&qe.push(Te.name),Te.name},uu=(Te,qe,Je=[])=>{if(Array.isArray(Te))for(let gt of Te)uu(gt,qe,Je);typeof Te=="object"&&(Te.hasOwnProperty("children")&&uu(Te.children,qe,Je),Te.name===qe&&(Te.hasOwnProperty("children")?cu(Te.children,Je):Te.name&&Je.push(Te.name)))},gc=Te=>{if(Te in re.current.vesselObj.current){re.current.setCheckItems(St=>St.filter(Qt=>Qt!==Te)),re.current.removeVessel(Te);let qe=new URL(window.location.href),Je=new URLSearchParams(qe.search);const gt=JSON.stringify(re.current.checkItems.filter(St=>St!==Te));Je.set("vesselsChecked",gt),qe.search=Je.toString(),window.history.replaceState({},"",qe)}},cl=Te=>()=>{rs(Te),Pe(Te)};function Zl(Te,qe){return[...new Set([...Te,...qe])]}const Po=Te=>{const qe=[],Je=[];if(re.current&&_.current){const gt=re.current,St=_.current;uu(gt.treeDatas,Te,qe);const Qt=Wa.current.indexOf(Te);if(Qt!==-1){Wa.current.splice(Qt,1),qe.forEach(Yn=>{Je.push(ll(da,Yn))});const Yt=Je.reduce((Yn,Br)=>Zl(Yn,Br),[]);let hn=A;Yt.forEach(Yn=>{Il(St.treeDatas,Yn)!=null&&(hn=hn.filter(Sr=>Sr!==Yn),St.removeFBX(Yn,!0))}),ne(hn);let ln=new URL(window.location.href),ur=new URLSearchParams(ln.search);ur.set("regionsChecked",JSON.stringify(hn)),ln.search=ur.toString(),window.history.replaceState({},"",ln),Wa.current.length===0&&St.setExpandedKeys(St.defexpandedKeys.current)}else{Wa.current.push(Te),qe.forEach(Br=>{Je.push(ll(da,Br))});const Yt=Je.reduce((Br,Sr)=>Zl(Br,Sr),[]),hn=Array.from(new Set([...St.expandedKeys,...Yt]));St.setExpandedKeys(hn);let ln=[...A];Yt.forEach(Br=>{const Sr=Il(St.treeDatas,Br);if(Sr!=null){const Gn=`${n}/data/FBX/${Br}.FBX`;ln.push(Br),St.LoadFBX(Gn,Br,Sr.color,.8,0)}}),ne(ln);let ur=new URL(window.location.href),Yn=new URLSearchParams(ur.search);Yn.set("regionsChecked",JSON.stringify(ln)),ur.search=Yn.toString(),window.history.replaceState({},"",ur)}}},nc=(Te,qe)=>{for(let Je in Te)if(Te[Je].name===qe){if(Te[Je]["2D"])return qe;{const gt=du(qe,Ia);return nc(Ia,gt)}}else if(Te[Je].children){const gt=nc(Te[Je].children,qe);if(gt)return gt}return null},dd=C.useMemo(()=>(zr==3||zr==4)&&!(Z||be)?[zr==3&&hc!=1?{key:"3",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{mi(1),te(!0)}},a("5000.6025")||"切换到冠状面")}:null,zr==3&&hc!=2?{key:"4",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{mi(2),te(!0)}},a("5000.6026")||"切换到矢状面")}:null,zr==3&&hc!=3?{key:"5",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{mi(3),te(!0)}},a("5000.6027")||"切换到水平面")}:null,zr==3&&hc!=4?{key:"6",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{mi(4),te(!0)}},a("5000.6028")||"切换到任意面")}:null,ge.brains?{key:"1",label:C.createElement("a",{target:"_blank",type:"primary",onClick:()=>{Jn(ge.brains,zr==4),te(!0)}},a("5000.6018")||"查看更高分辨率图像")}:null,ge.brains?{key:"2",label:C.createElement("a",{target:"_blank",onClick:()=>{Ji(ge.brains),te(!0)}},_.current.checkedKeys.current.includes(ge.brains)?a("5000.6023",{name:ge.brains})||`隐藏${ge.brains}的三维形貌`:a("5000.6024",{name:ge.brains})||`显示${ge.brains}的三维形貌`)}:null]:Z||be?[Z?{key:"1",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:()=>{as(Z),te(!0)}},_.current.checkedKeys.current.includes(Z)?a("5000.5056")||"隐藏核团":a("5000.5057")||"显示核团")}:null,zr!=7&&(st.length==0||st.includes("neurons"))&&be?{key:"3",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{Qo(7),te(!0),setTimeout(()=>{rs(Z),Pe(Z),z(!1),on(0)},50)}},a("5000.6015")||"查询位于或投射到该结构的神经元")}:null,be?{key:"6",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{const Te=Ae.current.getObjectByName(be);if(Te){const qe=new vs().setFromObject(Te),Je=new Ie;qe.getCenter(Je),h.current.target.copy(Je),te(!0)}}},a("7000.7019")||"设置为焦点")}:null,be&&zr==5?{key:"5",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{const Te=new vs,qe=Ae.current.getObjectByName(be);if(qe){Te.expandByObject(qe.clone());let Je=Te.min,gt=Te.max,St=new Ie;Te.getCenter(St);const Qt=gt.x-Je.x,Yt=gt.y-Je.y,hn=gt.z-Je.z;fe.current.scale.x=Qt,fe.current.scale.y=Yt,fe.current.scale.z=hn,fe.current.position.set(St.x,St.y,St.z);const ln=fe.current.geometry.clone();ln.scale(fe.current.scale.x,fe.current.scale.y,fe.current.scale.z),ln.translate(St.x,St.y,St.z);const ur=new z6(ln);Ue.current.geometry=ur,Ae.current.remove(Pt.current);const Yn=a("5000.0006")||"显示数据块";if(jr===Yn){yr(a("5000.0007")||"隐藏数据块"),at.current=new JS(Ai.current,f==null?void 0:f.domElement),at.current.setMode("translate"),at.current.enabled=!0,at.current.visible=!0,at.current.name="transformControls",at.current.attach(fe.current),Ae.current.add(fe.current,at.current,Ue.current),Jm(),document.addEventListener("keypress",va);const Br=new vs;Br.expandByObject(fe.current);const Sr=R.current(Br.min.clone()),Gn=R.current(Br.max.clone());let dr=new Bp(yn(650,620,`${Sr.x.toFixed(2)},${Sr.y.toFixed(2)},${Sr.z.toFixed(2)}`,"#ccc")),Kn=new Uh(new Zf({map:dr}));Kn.name="startText";let ta=new Bp(yn(650,620,`${Gn.x.toFixed(2)},${Gn.y.toFixed(2)},${Gn.z.toFixed(2)}`,"#ccc")),bi=new Uh(new Zf({map:ta}));bi.name="endText",Kn.position.set(Br.min.x,Br.min.y+.2,Br.min.z),bi.position.set(Br.max.x,Br.max.y+.6,Br.max.z);const Ua=Ae.current.getObjectByName("startText"),es=Ae.current.getObjectByName("endText");Ua&&es&&Ae.current.remove(Ua,es),Ae.current.add(Pt.current,Kn,bi)}te(!0),Jr({})}}},a("5000.6022",{lableStr:be})||"设置 "+be+" 的包围盒为下载范围")}:null].filter(Te=>Te!==null):ee?[{key:"1",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{xe.current.showSwctext(ee),te(!0)}},ee in ve.current?a("5000.5060")||"隐藏文字":a("5000.5061")||"显示文字")},{key:"2",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{Co(ee),te(!0)}},a("5000.6004")||"隐藏该神经元")}]:Q?[{key:"1",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{Po(Q),te(!0)}},Wa.current.includes(Q)?a("5000.0209")||"Hide Label":a("5000.0208")||"Show Label")},{key:"2",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{gc(Q),te(!0)}},a("5000.6021")||"隐藏该分支")}]:ut.Lable?[{key:"1",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{if(ut.name){const Te=Ae.current.getObjectByName(ut.name);if(Te){const qe=new vs().setFromObject(Te),Je=new Ie;qe.getCenter(Je),h.current.target.copy(Je),te(!0)}}}},a("7000.7019")||"设置为焦点")},{key:"2",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{ut.Lable&&as(ut.Lable),te(!0)}},_.current.checkedKeys.current.includes(ut.Lable)?a("5000.6023",{name:ut.Lable})||`隐藏${ut.Lable}的三维形貌`:a("5000.6024",{name:ut.Lable})||`显示${ut.Lable}的三维形貌`)}]:[],[Z,Q,ee,be,zr,Vs,ge,Qa,ut]),$o=Te=>{Te=Te.replace(/[\[\]]/g,"\\$&");var qe=new RegExp("[?&]"+Te+"(=([^&#]*)|&|#|$)"),Je=qe.exec(window.location.href);return Je?Je[2]?decodeURIComponent(Je[2].replace(/\+/g," ")):"":null},du=(Te,qe)=>{let Je="";for(let gt in qe){const St=qe[gt];if(St.children){if(St.children.some(Qt=>Qt.name===Te)){Je=St.name;break}else if(du(Te,St.children)){Je=du(Te,St.children);break}}}return Je},tl=()=>{let Te=new URL(window.location.href),qe=new URLSearchParams(Te.search);const Je=Math.ceil((performance.now()-zs.current)/1e3)-1;zs.current=performance.now();let gt=qe.get("type");if(gt){const St=window.location.origin+window.location.pathname+`?type=${gt}`;fetch("/app-api/java-api/brainsweb-service/record/list",{method:"post",body:JSON.stringify({href:St,time:Je})}).then(Qt=>Qt.json()).then(Qt=>{})}},lo=(Te,qe,Je)=>{let gt=new URL(window.location.href),St=new URLSearchParams(gt.search);const Qt=Math.ceil((performance.now()-zs.current)/1e3)-1;let Yt=St.get(Te);if(Yt&&!Je){zs.current=performance.now();const ln=window.location.origin+window.location.pathname+`?${Te}=${Yt}`;fetch("/app-api/java-api/brainsweb-service/record/list",{method:"post",body:JSON.stringify({href:ln,time:Qt})}).then(ur=>ur.json()).then(ur=>{})}St.set(Te,qe),gt.search=St.toString(),window.history.replaceState({},"",gt);const hn=window.location.origin+window.location.pathname+`?${Te}=${qe}`;fetch("/app-api/java-api/brainsweb-service/record/list",{method:"post",body:JSON.stringify({href:hn,time:0})}).then(ln=>ln.json()).then(ln=>{})},rc=(Te,qe,Je)=>{if(qe)switch(parseInt(Te)){case 0:document.title="STAM-SimpleViewer",lo("type","simple",Je);break;case 1:document.title="STAM-NormalViewer",lo("type","normal",Je);break;case 2:document.title="STAM-Surgery",lo("type","virtual",Je);break;case 3:document.title="STAM-Reslicing",lo("type","slicing",Je);break;case 4:document.title="STAM-Registration",lo("type","registration",Je);break;case 5:document.title="STAM-Downloading",lo("type","downloading",Je);break;case 6:document.title="STAM-AtlasMapping",lo("type","mapping",Je);break;case 7:document.title="STAM-Connectivity",lo("type","circuits",Je);break;case 8:document.title="STAM-OtherAtlas",lo("type","other",Je);break;case 9:document.title="STAM-ViewSetting",lo("type","setting",Je);break}};C.useEffect(()=>{ge.brains&&qs(nc(Ia,ge.brains))},[ge]),C.useEffect(()=>{be&&yo(nc(Ia,be)),v(dd),ol.current=p},[p,Z,A,Q,be,ee,zr,Se,ge,Qa,ut]);const fd=async Te=>{ai(Te.url||Te.preview),Oa(!0)},Vc=(Te,qe)=>{const Je=new FormData;Je.append("file",Te.file),fetch("/app-api/up-api/update",{method:"post",body:Je}).then(gt=>gt.json()).then(gt=>{if(gt.code===200)if(Ec.success("update success"),qe===2){const St=Wo.findIndex(Qt=>Qt.key===cs[0]);if(St>-1){let Qt=JSON.parse(JSON.stringify(Es.current)),Yt=Qt[St];Yt.fileList2=[{url:"data:image/png;base64,"+gt.base64_url}],ws(Qt),Es.current=Qt}}else{const St=Wo.findIndex(Qt=>Qt.key===cs[0]);if(St>-1){let Qt=JSON.parse(JSON.stringify(Es.current)),Yt=Qt[St];Yt.fileList=[{url:"data:image/png;base64,"+gt.base64_url}],Yt.correspondingPlaneData={},Yt.filename=gt.path,ws(Qt);const hn=Ae.current.children.filter(ln=>ln.userData.name==="registrationPng");hn&&Ae.current.remove(...hn),Es.current=Qt}$e.current=gt.path}else gt.message&&Us.error({content:gt.message})})},bp=async(Te,qe)=>{const Je=Te.type==="image/tiff"||Te.type==="image/tif",gt=Te.name.endsWith(".swc");let St,Qt;return await new Promise(hn=>{if(Je){const ln=new FileReader;ln.readAsArrayBuffer(Te),ln.onload=async ur=>{var Yn;if((Yn=ur.target)!=null&&Yn.result){const Br=ur.target.result;if(Br instanceof ArrayBuffer){const Gn=await(await Ype(Br)).getImage(),dr=Gn.getWidth(),Kn=Gn.getHeight();if(!qe){const ta=Wo.findIndex(bi=>bi.key===cs[0]);if(ta>-1){let bi=JSON.parse(JSON.stringify(Wo)),Ua=bi[ta];Ua.firstRegistrationImg={width:dr,height:Kn},ws(bi),Es.current=bi}}if(qe===2){const ta=Wo.findIndex(bi=>bi.key===cs[0]);if(ta>-1){const{firstRegistrationImg:bi}=Wo[ta];(bi.width!==dr||Kn!==bi.height)&&(Ec.error("The size of the second TIFF image needs to be consistent with the first one!"),hn(!1))}}hn(!0)}}}}else hn(!0)}).then(hn=>hn?(zr==6?(St=Je||gt,Qt="You can only upload tif or swc files!"):(St=Je,Qt="You can only upload tif files!"),St||Ec.error(Qt),St):!1)},Tg=(Te,qe)=>{const Je=new FormData;Je.append("file",Te.file),fetch("/app-api/d-api/upload",{method:"post",body:Je}).then(gt=>gt.json()).then(gt=>{gt.code===200?(Ec.success("update success"),qe===2?Wi([{url:"data:image/png;base64,"+gt.base64_url}]):(Pr([{url:"data:image/png;base64,"+gt.base64_url}]),xa({}),$e.current=gt.path)):gt.message&&Us.error({content:a("5000.0003")||"上传失败,请联系管理员"})})},$c=()=>{const Te=Ae.current.getObjectByName("Brain");if(Te)if(Vn(Je=>!Je),zi.file[1].indexOf(".js")>-1)fetch("/app-api/d-api/dowload/"+zi.file[1]).then(Je=>Je.json()).then(Je=>{let gt=new vo;const St=new Fu,Qt=zi.file[1];let Yt={};const hn=[];Ae.current.traverse(Sr=>{Sr.userData.isAtlasMapping==="true"&&hn.push(Sr)}),hn.forEach(Sr=>{Ae.current.remove(Sr)}),Je.line.forEach((Sr,Gn)=>{var dr=Je.position[Sr.end],Kn=Je.position[Sr.start],ta=new rr(new hu(.01,32,32),new _d({color:"#A7B5A1",transparent:!0}));ta.position.set(dr.x*.01,dr.y*.01,dr.z*.01);var bi=new rr(new hu(.01,32,32),new _d({color:"#00ffff",transparent:!0}));bi.position.set(Kn.x*.01,Kn.y*.01,Kn.z*.01),ta.translateX(uo.current),ta.translateY(qa.current),ta.translateZ(to.current),bi.translateX(uo.current),bi.translateY(qa.current),bi.translateZ(to.current),ta.myMeshType="neuronSphere",ta.name=`${Qt}/${Sr.end_name}`,ta.userData.color="#A7B5A1",bi.myMeshType="neuronSphere",bi.name=`${Qt}/${Sr.start_name}`,bi.userData.color="#00ffff",St.add(ta),St.add(bi),Sr.start_name&&(Yt.hasOwnProperty(Sr.start_name)?Yt[`${Sr.start_name}`].push({name:Qt,point:[Kn.x,Kn.y,Kn.z],color:"#00ffff"}):(Yt[`${Sr.start_name}`]=[],Yt[`${Sr.start_name}`].push({name:Qt,point:[Kn.x,Kn.y,Kn.z],color:Gn===0?"#1771FF":"#00ffff"}))),Sr.end_name&&(Yt.hasOwnProperty(Sr.end_name)?Yt[`${Sr.end_name}`].push({name:Qt,point:[dr.x,dr.y,dr.z],color:"#A7B5A1"}):(Yt[`${Sr.end_name}`]=[],Yt[`${Sr.end_name}`].push({name:Qt,point:[dr.x,dr.y,dr.z],color:"#A7B5A1"})))});let ln=new rr(new hu(.02,32,32),new _d({color:"#1771FF",transparent:!0}));ln.position.set(Je.position[0].x*.01,Je.position[0].y*.01,Je.position[0].z*.01),ln.translateX(uo.current),ln.translateY(qa.current),ln.translateZ(to.current),St.add(ln),St.name=`swcPointGroup${Qt}`,St.userData.isAtlasMapping="true";const ur={};for(const Sr in Yt){const Gn=Yt[Sr];for(const dr of Gn)if(dr.name==Qt){if(dr.color==="#1771FF"){ur[Sr]={point:dr.point,color:dr.color};break}if(dr.color==="#A7B5A1"){ur[Sr]={point:dr.point,color:dr.color};break}ur[Sr]={point:dr.point,color:dr.color}}}for(let Sr in ur){const{point:Gn,color:dr}=ur[Sr];var Yn=new Bp(yn(400,300,Sr.replace("_","/"),dr));let Kn=new Uh(new Zf({map:Yn,transparent:!0,alphaTest:.5}));Kn.scale.set(.5,.5,.5),Kn.position.set(Gn[0]*.01,Gn[1]*.01,Gn[2]*.01),Kn.translateX(uo.current),Kn.name="lineNameMesh",Kn.userData.name=Sr.replace("_","/"),Kn.userData.wholeName=`${Qt}-${Sr}`,Kn.userData.isAtlasMapping="true",Kn.userData.initColor=dr,Kn.translateY(qa.current),Kn.translateZ(to.current),Ae.current.add(Kn)}Ae.current.add(St);for(let Sr=0;Sr<Je.line.length;Sr++){let Gn=[];for(let Kn=Je.line[Sr].start;Kn<=Je.line[Sr].end;Kn++){let ta=Je.position[Kn].x,bi=Je.position[Kn].y,Ua=Je.position[Kn].z;Gn.push(new Ie(ta,bi,Ua))}let dr=new Pa(new ea().setFromPoints(Gn),new Af({color:"green"}));gt.add(dr),Vn(!1)}gt.scale.set(sa.current,sa.current,sa.current),gt.translateX(uo.current),gt.translateY(qa.current),gt.translateZ(to.current),gt.name="correspondingPlaneDataSwc";const Br=Ae.current.getObjectByName("correspondingPlaneDataSwc");Br&&Ae.current.remove(Br),Ae.current.add(gt)});else{var qe=new fo;qe.setFromAxisAngle(new Ie(1,0,0),Math.PI/2);const Je=(Te==null?void 0:Te.children[0]).geometry.boundingBox.min,gt=(Te==null?void 0:Te.children[0]).geometry.boundingBox.max,St={bwidth:0,bheight:2.6,bdepth:0,ewidth:gt.x-Je.x,eheight:gt.y-Je.y,edepth:gt.z-Je.z,owidth:gt.x-Je.x,oheight:gt.y-Je.y,odepth:gt.z-Je.z};new Ie(.010276870727539578,-5.650856788169461,-.9944386664650411);let Qt=new Ie(-5.097530670166015,-4.308416134996751,-7.990437196406743),Yt=new Ie(5.118084411621094,3.006702558657828,6.001559863476661);const hn=new vs;hn.expandByObject(Te.clone()),Qt=hn.min,Yt=hn.max;const ln=Yt.x-Qt.x,ur=Yt.y-Qt.y,Yn=Yt.z-Qt.z;fe.current.scale.set(ln,ur,Yn),fe.current.position.set(.010276870727539578,-1.6508567881694614,-.9944386664650411),Ze.current.length===0?fetch("/app-api/d-api/dowload/"+zi.file[1]).then(Br=>Br.arrayBuffer()).then(Br=>{const Sr=new Uint8Array(Br);let Gn=OB(Sr),dr=Xpe(Sr);Ze.current=Gn,ri(Gn,St,dr)}):setTimeout(()=>{ri(Ze.current,St,Ze.current.length)},200)}},xp=Te=>{const qe=Wo.findIndex(Je=>Je.key===cs[0]);if(qe>-1){let Je=JSON.parse(JSON.stringify(Wo)),gt=Je[qe];gt.registrationRadioShowType=Te.target.value,ws(Je),Es.current=Je,Ae.current.getObjectByName(`png${qe}`)&&Zm(Te.target.value)}},q1=Te=>{if(Vn(!0),wt(Te.target.value),La.otherAtlases=Te.target.value,Ae.current){const qe=Ae.current.getObjectByName("outline");qe&&Ae.current.remove(qe)}Te.target.value=="CCF"&&z0({filepath:n+"/data/FBX/outline-CCF.FBX",index:"outline",color:"#327DFF",opacity:.3,offsetZ:0,R:.01,callback:function(){}},Ut),Te.target.value=="WHS"&&z0({filepath:n+"/data/FBX/outline-WHS.FBX",index:"outline",color:"#327DFF",opacity:.3,offsetZ:0,R:.01,callback:function(){}},Ut),Vn(!1)},Wt=Te=>{if(on(Te.target.value),Te.target.value===2){V.current="automatic",P(!0),B.current=!0,j(2),m.current.length>=2&&(m.current.pop(),b.current.pop());const qe=Ae.current.getObjectByName("dashedLine"),Je=Ae.current.getObjectByName("sphereBig"),gt=Ae.current.getObjectByName("sphereMiddelClick"),St=Ae.current.getObjectByName("Line");qe&&Je&&Ae.current.remove(qe,Je),gt&&Ae.current.remove(gt),St&&Ae.current.remove(St),Sv()}else V.current="manual",P(!1),B.current=!1,j(3),Sv();d&&(d.current=!0),Zi.current&&(Zi.current.textContent=a("4000.0126")||"重置")},zc=Te=>{if(Te>-1){let qe=JSON.parse(JSON.stringify(Es.current)),Je=qe[Te];Je.startButtonLoading=!0,Je.correspondingPlaneData={},ws(qe),Es.current=qe;const gt=new FormData;gt.append("file",Je.filename),gt.append("typeName",Je.radioValue.toString()),fetch("/app-api/up-api/calculate",{method:"post",body:gt}).then(St=>{if(St.ok)return St.json();throw Us.error({content:a("5000.7027")||"计算失败"}),new Error(St.statusText)}).then(St=>{const Qt=St;let Yt=JSON.parse(JSON.stringify(Es.current));const hn=Yt[Te];hn.correspondingPlaneData=Qt,hn.startButtonLoading=!1,Es.current=Yt,ws(Yt)})}},Hc=()=>{const Te=Wo.findIndex(qe=>qe.key===cs[0]);if(Te>-1){let qe=Wo[Te];const Je=document.createElement("a");Je.href="/app-api/up-api/zip/"+qe.correspondingPlaneData.url,Je.download=qe.correspondingPlaneData.url,Je.click()}},Zm=Te=>{const qe=Wo.findIndex(Yn=>Yn.key===cs[0]);if(qe>-1){const Yn=Ae.current.getObjectByName(`png${qe}`);Yn&&Ae.current.remove(Yn)}var Je=Ae.current.getObjectByName("Brain");if(Je&&qe>-1){let Yn=Wo[qe];const{correspondingPlaneData:Br,registrationRadioShowType:Sr,fileList:Gn,fileList2:dr}=Yn;var gt=new vs().setFromObject(Je),St=gt.max.y-gt.min.y,Qt=gt.max.x-gt.min.x;St=St/Math.cos(Br.angles[0]*Math.PI/180),Qt=Qt/Math.cos(Br.angles[1]*Math.PI/180);var Yt=new Z5(Qt,St,1,1),hn=new _d({side:Ef,transparent:!0,alphaTest:.1}),ln=new rr(Yt,hn);ln.name=`png${qe}`;let Kn=Sr;Te&&(Kn=Te),ln.userData.imgType=Kn,ln.userData.name="registrationPng",Ae.current.add(ln);var ur=new Rb;ln.position.set(gt.min.x+(gt.max.x-gt.min.x)/2,gt.min.y+(gt.max.y-gt.min.y)/2,(gt.max.z-gt.min.z)*Br.tx+gt.min.z),ur.load(Kn==="3"?dr[0].url:Kn==="1"?Br.base64_url:Gn[0].url,function(ta){hn.map=ta,hn.needsUpdate=!0}),ln.rotateOnAxis(new Ie(0,0,1),Math.PI),ln.rotateOnAxis(new Ie(1,0,0),Math.PI/180*-Br.angles[0]),ln.rotateOnAxis(new Ie(0,1,0),Math.PI/180*Br.angles[2]),ln.rotateOnAxis(new Ie(0,0,1),Math.PI/180*Br.angles[1]),Te!="1"&&(jl.current?ln.scale.x=1:ln.scale.x=-1)}},Km=()=>{const Te=new Ws(1,1,1),qe=new _d({color:16777215,opacity:.1,transparent:!0,depthWrite:!1}),Je=new rr(Te,qe);Ae.current.remove(fe.current,Ue.current,Pt.current),fe.current=Je.clone(),Pt.current=new rr;const gt=new z6(Te),St=new Af({color:16536881}),Qt=new Dz(gt,St);Ue.current=Qt},Xr=()=>{const Te=a("5000.0006")||"显示数据块";if(jr===Te){yr(a("5000.0007")||"隐藏数据块"),at.current=new JS(Ai.current,f==null?void 0:f.domElement),at.current.setMode("translate"),at.current.enabled=!0,at.current.visible=!0,at.current.name="transformControls",at.current.attach(fe.current),Ae.current.add(fe.current,at.current,Ue.current),Jm(),document.addEventListener("keypress",va);const qe=new vs;qe.expandByObject(fe.current);const Je=R.current(qe.min.clone()),gt=R.current(qe.max.clone());let St=new Bp(yn(650,620,`${Je.x.toFixed(2)},${Je.y.toFixed(2)},${Je.z.toFixed(2)}`,"#ccc")),Qt=new Uh(new Zf({map:St}));Qt.name="startText";let Yt=new Bp(yn(650,620,`${gt.x.toFixed(2)},${gt.y.toFixed(2)},${gt.z.toFixed(2)}`,"#ccc")),hn=new Uh(new Zf({map:Yt}));hn.name="endText",Qt.position.set(qe.min.x,qe.min.y+.2,qe.min.z),hn.position.set(qe.max.x,qe.max.y+.6,qe.max.z);const ln=Ae.current.getObjectByName("startText"),ur=Ae.current.getObjectByName("endText");ln&&ur&&Ae.current.remove(ln,ur),Ae.current.add(Pt.current,Qt,hn)}else{document.removeEventListener("keypress",va),yr(a("5000.0006")||"显示数据块"),at.current.enabled=!1,at.current.visible=!1,at.current.detach();const qe=Ae.current.getObjectByName("startText"),Je=Ae.current.getObjectByName("endText");qe&&Je&&Ae.current.remove(qe,Je),Ae.current.remove(at.current),Ae.current.remove(fe.current,Ue.current,Pt.current)}},yn=(Te,qe,Je,gt)=>{var St=document.createElement("canvas");St.width=Te,St.height=qe,St.style.border="1px solid #000";let Qt=St.getContext("2d");return Qt.font="80px Arial",Qt.fillStyle=gt,Qt.fillText(Je,40,80),St},ri=(Te,qe,Je)=>{const gt=Te[0].width/qe.owidth,St=Te[0].height/qe.oheight,Qt=Je/qe.odepth,Yt=Math.ceil(qe.bwidth*gt),hn=Math.ceil(qe.bheight*St),ln=Math.ceil(qe.bdepth*Qt),ur=Math.floor(qe.ewidth*gt),Yn=Math.floor(qe.eheight*St),Br=Math.floor(qe.edepth*Qt),Sr=ur-Yt,Gn=Yn-hn,dr=new bwe(null,Sr,Gn,Br-ln);dr.format=AX,dr.minFilter=ku,dr.magFilter=ku,dr.unpackAlignment=1,dr.needsUpdate=!0;const Kn=f.getContext(),ta=Kn.createTexture();Kn.bindTexture(Kn.TEXTURE_3D,ta),Kn.pixelStorei(Kn.UNPACK_ALIGNMENT,1),Kn.pixelStorei(Kn.UNPACK_FLIP_Y_WEBGL,0),Kn.texStorage3D(Kn.TEXTURE_3D,1,Kn.R8,Sr,Gn,Br-ln),Kn.texParameteri(Kn.TEXTURE_3D,Kn.TEXTURE_MIN_FILTER,Kn.LINEAR),Kn.texParameteri(Kn.TEXTURE_3D,Kn.TEXTURE_MAG_FILTER,Kn.LINEAR),Kn.texParameteri(Kn.TEXTURE_3D,Kn.TEXTURE_WRAP_S,Kn.CLAMP_TO_EDGE),Kn.texParameteri(Kn.TEXTURE_3D,Kn.TEXTURE_WRAP_T,Kn.CLAMP_TO_EDGE),Kn.texParameteri(Kn.TEXTURE_3D,Kn.TEXTURE_WRAP_R,Kn.CLAMP_TO_EDGE);for(let es=0;es<Te.length;es++){let Zr=[];if(es>=ln&&es<Br){for(let hi=0;hi<Te[es].data.length;hi++){let mc=hi%Te[es].width,hd=hi/Te[es].width;Yt<=mc&&mc<ur&&hd>=hn&&hd<Yn&&Zr.push(Te[es].data[hi])}const Ki=new Uint8Array(Zr);Kn.bindTexture(Kn.TEXTURE_3D,ta),Kn.bindBuffer(Kn.PIXEL_UNPACK_BUFFER,null),Kn.bindBuffer(Kn.ARRAY_BUFFER,null),Kn.texSubImage3D(Kn.TEXTURE_3D,0,0,0,es-ln,Sr,Gn,1,Kn.RED,Kn.UNSIGNED_BYTE,Ki)}}const bi=new WUt(f,Sr,Gn,Br-ln);bi.webglTexture=ta,bi.needsUpdate=!0,ce.current=bi,S.current=new ob({glslVersion:xm,uniforms:{map:{value:ce.current},cameraPos:{value:Ai.current.position},volume_dims:{value:new Ie(Sr,Gn,Je)},canvas_dims:{value:new gr(f.domElement.width,f.domElement.height)},isClicked:{value:0},steps:{value:Je},brightness:{value:_s.current.brightness},darkness:{value:_s.current.darkness},opacity:{value:_s.current.opacity},opacity2:{value:_s.current.opacity2},lowcolor:{value:new Ie(_s.current.color.r/255,_s.current.color.g/255,_s.current.color.b/255)},highcolor:{value:new Ie(_s.current.color2.r/255,_s.current.color2.g/255,_s.current.color2.b/255)}},side:Qd,vertexShader:HUt,fragmentShader:GUt}),Ae.current.remove(Pt.current);const Ua=new Ws(1,1,1);Pt.current=new rr(Ua,S.current),Pt.current.applyMatrix4(fe.current.matrixWorld),Pt.current.scale.set(fe.current.scale.x,fe.current.scale.y,fe.current.scale.z),Pt.current.position.set(fe.current.position.x,fe.current.position.y,fe.current.position.z),Ae.current.add(Pt.current),Vn(es=>!es)},Sv=()=>{const Te=[];Ae.current.traverse(qe=>{qe.name==="lineName"&&Te.push(qe)}),Te.forEach(qe=>{Ae.current.remove(qe)})},Ym=()=>{const Te=new vs;Te.expandByObject(fe.current);const qe=Ae.current.getObjectByName("Brain");if(qe){Vn(ln=>!ln);var Je=new fo;Je.setFromAxisAngle(new Ie(1,0,0),Math.PI/2);const gt=(qe==null?void 0:qe.children[0]).geometry.boundingBox.min,St=(qe==null?void 0:qe.children[0]).geometry.boundingBox.max,Qt=Te.min.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),Yt=Te.max.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),hn={bwidth:Qt.x-gt.x,bheight:Qt.y-gt.y,bdepth:Qt.z-gt.z,ewidth:Yt.x-gt.x,eheight:Yt.y-gt.y,edepth:Yt.z-gt.z,owidth:St.x-gt.x,oheight:St.y-gt.y,odepth:St.z-gt.z};Ze.current.length===0?fetch(n+"/data/TIFF/1-0.5_0.tif").then(ln=>ln.arrayBuffer()).then(ln=>{const ur=new Uint8Array(ln);let Yn=OB(ur),Br=Xpe(ur);Ze.current=Yn,ri(Yn,hn,Br)}):setTimeout(()=>{ri(Ze.current,hn,Ze.current.length)},200)}},J1=()=>{aM&&fetch(aM).then(Te=>Te.text()).then(Te=>{const qe=[0,0,0,0,0,0];let Je=new zUt(Te,aM||"",qe,void 0,void 0,3,qe);const gt=new s9({color:65280,side:Ef});let St=new vo;for(let Qt=0;Qt<Je.branches.length;Qt++){let Yt=Je.branches[Qt],hn=[];for(let Yn=Yt.start;Yn<Yt.start+Yt.count;Yn++){let Br=Je.indices[Yn],Sr=Je.points[3*Br],Gn=Je.points[3*Br+1],dr=Je.points[3*Br+2];hn.push(new Ie(Sr,Gn,dr))}const ln=new ea().setFromPoints(hn);let ur=new Pa(ln,gt);St.add(ur)}St.scale.set(sa[0],sa[1],sa[2]),St.position.set(uo.current,qa.current,to.current),St.name="swcUrlDataLine",Ae.current.add(St)})},YE=()=>{new vs().expandByObject(fe.current);const qe=Ae.current.getObjectByName("Brain");if(!cve||!DB)return;const Je=JSON.parse(cve);if(qe){Vn(ur=>!ur);const gt=Je.min,St=Je.max,Qt=Je.max_resample,Yt={bwidth:gt.x,bheight:gt.y,bdepth:gt.z,ewidth:Qt.x,eheight:Qt.y,edepth:Qt.z,owidth:Qt.x-gt.x,oheight:Qt.y-gt.y,odepth:Qt.z-gt.z},hn={x:(St.x-gt.x)*sa.current,y:(St.y-gt.y)*sa.current,z:(St.z-gt.z)*sa.current},ln={x:((St.x-gt.x)/2+gt.x)*sa.current+uo.current,y:((St.y-gt.y)/2+gt.y)*sa.current+qa.current,z:((St.z-gt.z)/2+gt.z)*sa.current+to.current};fe.current.scale.set(hn.x,hn.y,hn.z),fe.current.position.set(ln.x,ln.y,ln.z),Ze.current.length===0?fetch(DB).then(ur=>ur.arrayBuffer()).then(async ur=>{try{const Yn=await Ype(ur),Br=await Yn.getImageCount(),Sr=[];for(let dr=0;dr<Br;dr++){const Kn=await Yn.getImage(dr),ta=await Kn.readRasters(),bi=Kn.getWidth(),Ua=Kn.getHeight();Sr.push({width:bi,height:Ua,data:ta[0]})}let Gn=Br;Ze.current=Sr,ri(Ze.current,Yt,Gn)}catch(Yn){console.log("e",Yn)}}):setTimeout(()=>{ri(Ze.current,Yt,Ze.current.length)},200)}else setTimeout(()=>{YE()},1e3)};C.useEffect(()=>{ns?Dc.current&&Dc.current.focus():iu.current&&iu.current.focus()},[ns]);const Ig=Te=>Te.map(qe=>({value:qe.name+" "+qe.fullname,title:C.createElement(ki,{placement:"right",title:qe.fullname},C.createElement("div",{style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",lineHeight:"2.4"}},qe.name," ",qe.fullname)),children:qe.children?Ig(qe.children):void 0})),wv=C.useMemo(()=>{const Te=new vs;Te.expandByObject(fe.current);const qe=Ae.current.getObjectByName("Brain");if(qe){var Je=new fo;Je.setFromAxisAngle(new Ie(1,0,0),Math.PI/2);const gt=(qe==null?void 0:qe.children[0]).geometry.boundingBox.min,St=Te.min.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),Qt=Te.max.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),Yt={bwidth:St.x-gt.x,bheight:St.y-gt.y,bdepth:St.z-gt.z,ewidth:Qt.x-gt.x,eheight:Qt.y-gt.y,edepth:Qt.z-gt.z};Tn.current=Yt;const hn=(Yt.ewidth-Yt.bwidth)*1.11545988258317*(Yt.eheight-Yt.bheight)*12.31190150478796*(Yt.edepth-Yt.bdepth)*10;let ln=0;switch(kn){case 1:ln=hn*.8;break;case 2:ln=hn*.8/8;break;case 3:ln=hn*.8/8/8;break;case 4:ln=hn*.8/8/8/8;break;case 5:ln=hn*.8/8/8/8/8;break;case 6:ln=hn*.8/8/8/8/8/8;break}return jr===(a("5000.0006")||"显示数据块")?"0KB":ln>1024*1024*1024*1024?(ln/(1024*1024*1024*1024)).toFixed(2)+"TB":ln>1024*1024*1024?(ln/(1024*1024*1024)).toFixed(2)+"GB":ln>1024*1024&&ln<1024*1024*1024?(ln/(1024*1024)).toFixed(2)+"MB":ln>1024&&ln<1024*1024?(ln/1024).toFixed(2)+"KB":ln&&ln<1024?ln.toFixed(2)+"B":"0KB"}else return"0KB"},[ni,jr]),qm=()=>{if(!Kt.current){Fo(!0);return}const Te=new vs;Te.expandByObject(fe.current);const qe=Ae.current.getObjectByName("Brain");if(qe){var Je=new fo;Je.setFromAxisAngle(new Ie(1,0,0),Math.PI/2);const gt=(qe==null?void 0:qe.children[0]).geometry.boundingBox.min,St=(qe==null?void 0:qe.children[0]).geometry.boundingBox.max,Qt=Te.min.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),Yt=Te.max.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),hn={bwidth:Qt.x-gt.x,bheight:Qt.y-gt.y,bdepth:Qt.z-gt.z,ewidth:Yt.x-gt.x,eheight:Yt.y-gt.y,edepth:Yt.z-gt.z,owidth:St.x-gt.x,oheight:St.y-gt.y,odepth:St.z-gt.z,zoom:!1,level:kn};Tn.current=hn;const ln=(hn.ewidth-hn.bwidth)*1.11545988258317*(hn.eheight-hn.bheight)*12.31190150478796*(hn.edepth-hn.bdepth)*10;switch(kn){case 1:if(ln*.8>1024*1024*1024){Ur(!0);return}break;case 2:if(ln*.8/8>1024*1024*1024){Ur(!0);return}break;case 3:if(ln*.8/8/8>1024*1024*1024){Ur(!0);return}break;case 4:if(ln*.8/8/8/8>1024*1024*1024){Ur(!0);return}break;case 5:if(ln*.8/8/8/8/8>1024*1024*1024){Ur(!0);return}break;case 6:if(ln*.8/8/8/8/8/8>1024*1024*1024){Ur(!0);return}break}Xi(!0),fetch("/app-api/test-api/CutBlockTask",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(hn)}).then(ur=>ur.json()).then(ur=>{OI(ur)})}},OI=Te=>{fetch("/app-api/test-api/CutBlockTask",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:Te})}).then(qe=>{const Je=qe.headers.get("content-type");return Je?Je.includes("application/json")?qe.json():Je.includes("application/octet-stream")?qe.arrayBuffer():(Je.includes("text/html")||Je.includes("text/plain")||Je.includes("application/xml")||Je.includes("text/xml"),qe.text()):qe.text()}).then(qe=>{if(typeof qe=="string")setTimeout(()=>{OI(Te)},2e3);else{const Je=document.createElement("a"),gt=new Blob([qe]),St=window.URL.createObjectURL(gt);Je.style.display="none",Je.href=St,Je.download="temp.tiff",Je.click(),window.URL.revokeObjectURL(St),Xi(!1);let Qt=new URL(window.location.href),hn=new URLSearchParams(Qt.search).get("type");const ln=window.location.origin+window.location.pathname+`?type=${hn}`;fetch("/app-api/java-api/brainsweb-service/record/list",{method:"post",body:JSON.stringify({href:ln,time:0,key:fn.current})}).then(ur=>ur.json()).then(ur=>{})}}).catch(qe=>{Xi(!1),Us.error({title:a("5000.7026")||"请求超时,下载失败"})})},va=C.useCallback(Te=>{Te.stopPropagation(),(Te.key==="a"||Te.key==="A")&&(at.current.getMode()==="translate"?at.current.setMode("scale"):at.current.setMode("translate"))},[]),Jm=()=>{let qe=Ae.current.getObjectByName("Brain"),Je=new Ie(-5.097530670166015,-5.308416134996751,-7.990437196406743),gt=new Ie(5.118084411621094,2.006702558657828,6.001559863476661);if(qe){const hn=new vs;hn.expandByObject(qe.clone()),Je=hn.min,gt=hn.max}const St=gt.x-Je.x,Qt=gt.y-Je.y,Yt=gt.z-Je.z;at.current.addEventListener("change",()=>{const hn=fe.current.scale,ln=fe.current.position;hn.x<1&&fe.current.scale.setX(1),hn.x>St&&fe.current.scale.setX(St),hn.y<1&&fe.current.scale.setY(1),hn.y>Qt&&fe.current.scale.setY(Qt),hn.z<1&&fe.current.scale.setZ(1),hn.z>Yt&&fe.current.scale.setZ(Yt),ln.x<Je.x+fe.current.scale.x/2&&fe.current.position.setX(Je.x+fe.current.scale.x/2),ln.x>gt.x-fe.current.scale.x/2&&fe.current.position.setX(gt.x-fe.current.scale.x/2),ln.y<Je.y+fe.current.scale.y/2&&fe.current.position.setY(Je.y+fe.current.scale.y/2),ln.y>gt.y-fe.current.scale.y/2&&fe.current.position.setY(gt.y-fe.current.scale.y/2),ln.z<Je.z+fe.current.scale.z/2&&fe.current.position.setZ(Je.z+fe.current.scale.z/2),ln.z>gt.z-fe.current.scale.z/2&&fe.current.position.setZ(gt.z-fe.current.scale.z/2);const ur=fe.current.geometry.clone();ur.scale(fe.current.scale.x,fe.current.scale.y,fe.current.scale.z),ur.translate(fe.current.position.x,fe.current.position.y,fe.current.position.z);const Yn=new z6(ur);Ue.current.geometry=Yn,Jr({})}),at.current.addEventListener("dragging-changed",function(hn){hn.value?(h.current.enableRotate=!1,h.current.enabled=!1,Oo.current={target:h.current.target.clone(),position:h.current.object.position.clone(),up:h.current.object.up.clone(),enabled:h.current.enabled}):(h.current.enableRotate=!0,h.current.enabled=!0,h.current.reset(),h.current.target.copy(Oo.current.target),h.current.object.position.copy(Oo.current.position),h.current.object.up.copy(Oo.current.up),h.current.update());const ln=fe.current.geometry.clone();ln.scale(fe.current.scale.x,fe.current.scale.y,fe.current.scale.z),ln.translate(fe.current.position.x,fe.current.position.y,fe.current.position.z);const ur=new z6(ln);Ue.current.geometry=ur;const Yn=new vs;Yn.expandByObject(fe.current);const Br=R.current(Yn.min.clone()),Sr=R.current(Yn.max.clone());let Gn=new Bp(yn(650,620,`${Br.x.toFixed(2)},${Br.y.toFixed(2)},${Br.z.toFixed(2)}`,"#ccc")),dr=new Uh(new Zf({map:Gn}));dr.name="startText";let Kn=new Bp(yn(650,620,`${Sr.x.toFixed(2)},${Sr.y.toFixed(2)},${Sr.z.toFixed(2)}`,"#ccc")),ta=new Uh(new Zf({map:Kn}));ta.name="endText",dr.position.set(Yn.min.x,Yn.min.y+.2,Yn.min.z),ta.position.set(Yn.max.x,Yn.max.y+.6,Yn.max.z);const bi=Ae.current.getObjectByName("startText"),Ua=Ae.current.getObjectByName("endText");bi&&Ua&&Ae.current.remove(bi,Ua),Ae.current.add(Pt.current,dr,ta)})},fx=()=>{document.removeEventListener("keypress",va),yr(a("5000.0006")||"显示数据块"),at.current.enabled=!1,at.current.visible=!1,at.current.detach(),Ae.current.remove(at.current),Ae.current.remove(fe.current,Ue.current,Pt.current);const Te=Ae.current.getObjectByName("dashedLine");Te&&Ae.current.remove(Te);const qe=Ae.current.getObjectByName("startText"),Je=Ae.current.getObjectByName("endText");qe&&Je&&Ae.current.remove(qe,Je)},Gs=Te=>{mn(Te.target.value)},Xo=C.useCallback(Te=>{An.current=!0,Wr.current=[Te.x,Te.y],Qr.current=[Te.x,Te.y]},[]),Cp=C.useCallback(Te=>{if(An.current){const qe=[Te.x,Te.y],Je=.005,gt=qe[0]-Wr.current[0];qe[1]-Wr.current[1];const St=gt*Je,Qt=new Ie;Qt.copy(Ai.current.position).sub(h.current.target);const Yt=new cgt().setFromVector3(Qt);Yt.theta+=St,Yt.makeSafe(),Qt.setFromSpherical(Yt),Ai.current.position.copy(h.current.target).add(Qt),Ai.current.lookAt(h.current.target),Wr.current=[Te.x,Te.y]}},[]),qE=C.useCallback(Te=>{An.current=!1;const qe=[Te.x,Te.y],Je=Math.abs(qe[0]-Qr.current[0]),gt=Math.abs(qe[1]-Qr.current[1]);Je<2&><2?f.domElement.addEventListener("click",Y.current):f.domElement.removeEventListener("click",Y.current)},[]),PI=()=>{if(!localStorage.getItem("imgKey")){_r(!0);return}Yr(!0),io(!1),xa({});let Te={taskType:Et,moving_name:$e.current,key:localStorage.getItem("imgKey")};fetch("/app-api/d-api/count",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(Te)}).then(qe=>qe.ok?qe.json():(Yr(!1),qe.json().then(Je=>{throw io(!0),qe.status===401&&Us.confirm({content:Je.message,onOk(){fetch("/app-api/d-api/update_key",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:localStorage.getItem("imgKey")})}).then(gt=>gt.json())},onCancel(){}}),qe.status===429?Us.error({content:a("5000.7029")||"请求过于频繁,请稍后再试"}):Us.error({content:a("5000.7027")||"计算失败"}),new Error(Je.message||qe.statusText)}))).then(qe=>{qe.code===200&&xa(qe),Yr(!1)}).catch(qe=>{Yr(!1),console.error(qe)}).finally(()=>{Yr(!1)})},hx=()=>{const Te=document.createElement("a");Te.href="/app-api/d-api/dowload/"+zi.file[0],Te.download=zi.file[0],Te.click()},NI=Te=>{F&&F(Te),La.datumMarkVisibility=Te},px=Te=>{fc(Te),La.coordinateVisibility=Te,Te?H&&H.current.forEach(qe=>{qe.visible=!0}):H&&H.current.forEach(qe=>{qe.visible=!1})},fP=()=>{xo(!1)},JE=()=>{xo(!1)},QE=Te=>{if($s(Te),La.leftHemisphereVisibility=Te,Te){for(let qe in ma.current)ma.current[qe]&&A.includes(qe)&&Ae.current.add(ma.current[qe]);np.current=!0}else{for(let qe in ma.current)ma.current[qe]&&Ae.current.remove(ma.current[qe]);np.current=!1}},DI=Te=>{if(La.cranialVisibility=Te,kc({}),Te)z0({filepath:n+"/data/FBX/ExtractedSurface.FBX",index:"ExtractedSurface",color:"#327DFF",opacity:.3,offsetZ:0,R:.01,callback:function(){}},Ut);else if(Ae.current){const qe=Ae.current.getObjectByName("ExtractedSurface");qe&&Ae.current.remove(qe)}},e3=()=>{if(kr(!0),Vn(!0),k){const Te={flag:np.current,point:[k.current.x,k.current.y,k.current.z],fbx:W.current};fetch("/app-api/c-api/compute",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(Te)}).then(qe=>{if(qe.ok)return qe.json();throw kr(!1),Vn(!1),Us.error({content:a("5000.7028")||"没有合适的路径"}),new Error(qe.statusText)}).then(qe=>{kr(!1),Vn(!1),qe.code===200&&N?N(new Ie(qe.point[0],qe.point[1],qe.point[2])):Us.error({content:a("5000.7027")||"计算失败"})})}},vx=Te=>{Te!=null&&(rs(Te),(Te===""||Te.includes(" "))&&Pe(Te))},gh=(Te,qe)=>{let Je=0;for(const gt of Te.toLowerCase())if(gt===qe[Je]&&(Je++,Je===qe.length))return!0;return!1},t3=Te=>{if(Te){const qe=Te.toLowerCase(),Je=xe.current.defAllexpandedKeys.current.map(gt=>{const St=gt.name&>.name.toLowerCase()===qe,Qt=gt.fullname&&gh(gt.fullname,qe);return{...gt,matchPriority:St?1:Qt?2:3}}).filter(gt=>gt.matchPriority<3).sort((gt,St)=>gt.matchPriority-St.matchPriority).map(gt=>({value:`${gt.name} ${gt.fullname}`,label:`${gt.name} ${gt.fullname}`}));pr(Je)}else pr([])},kI=Te=>{const qe=new URLSearchParams;for(const Je in Te)qe.append(Je,Te[Je]);zr==3||zr==5?qe.append("aplType","2"):qe.append("aplType","1"),fetch("/app-api/java-api/brainsweb-service/apldetail/add",{method:"post",body:qe}).then(Je=>{if(Je.ok)return Je.json();throw Us.error({content:a("5000.5047")||"提交失败"}),new Error(Je.statusText)}).then(Je=>{Je.code==1?Ec.error("Repeat Email"):Ec.success(a("5000.5048")||"提交成功"),Fo(!1),ti(0),_r(!1),Da(0)})},n3=Te=>{console.log("Failed:",Te)},r3=async Te=>{let qe="";Te==="DAPI"?qe="/staticresource/data/TIFF/image_356_t.tif":Te==="PI"&&(qe="/staticresource/data/TIFF/image_570_t.tif");try{const Je=qe.split("/").pop()||"",St=await(await fetch(qe)).blob(),Qt=new File([St],Je,{type:"image/tiff"}),Yt=Wo.findIndex(Br=>Br.key===cs[0]);let ln=await new Promise(Br=>{const Sr=new FileReader;Sr.readAsArrayBuffer(St),Sr.onload=function(Gn){var dr,Kn;if((dr=Gn.target)!=null&&dr.result){const ta=new Uint8Array((Kn=Gn.target)==null?void 0:Kn.result);let bi=OB(ta);const{width:Ua,height:es}=bi[0];Br({width:Ua,height:es})}},Sr.onerror=function(Gn){console.error("failed")}});const{width:ur,height:Yn}=ln;if(Yt>-1){let Br=JSON.parse(JSON.stringify(Wo)),Sr=Br[Yt];Sr.fileList=[Qt],Sr.firstRegistrationImg={width:ur,height:Yn},ws(Br),Es.current=Br}Vc({file:Qt})}catch(Je){console.error("Error fetching file:",Je)}},UI=async Te=>{let qe="",Je="";Te==="3D"?(qe="/staticresource/data/TIFF/test.tif",Je="image/tiff"):Te==="swc"&&(qe="/staticresource/data/TIFF/fixed.swc",Je="file/swc");try{const St=await(await fetch(qe)).blob();let Qt=qe.split("/").pop();if(Qt){const Yt=new File([St],Qt,{type:Je});Pr([Yt]),Tg({file:Yt})}}catch(gt){console.error("Error fetching file:",gt)}};return C.createElement(C.Fragment,null,C.createElement(rz,{onClick:()=>{const Te=document.querySelector(".tabsCompnent .ant-tabs-content-holder");Te&&lr?(Te.style.padding="0px",Te.style.borderLeft="none"):(Te.style.padding="10px",Te.style.borderLeft="1px solid rgb(225, 218, 218)"),rn(qe=>!qe)},style:{position:"absolute",right:`${lr?"452px":"126px"}`,top:"50%",transform:`rotate(${lr?180:0}deg) translate(-50%,0)`,fontSize:28,transition:"all 0.1s",zIndex:1e3}}),C.createElement(Om,{className:"tabsCompnent",onChange:Qo,activeKey:zr.toString(),style:{position:"absolute",right:0,bottom:0,width:`${lr?"430px":"150px"}`,height:st.length!=7?"100%":"calc(100% - 42px)",userSelect:"none",borderTop:"1px solid rgb(225, 218, 218)"},tabPosition:"right",tabBarStyle:{width:150,background:"#fff",borderLeft:"1px solid #e1dada"}},st.includes("label")&&C.createElement(Wg,{tab:a("4000.0202")||"组装",key:"1",disabled:q===2},lr?C.createElement(C.Fragment,null,C.createElement("div",{style:{width:"200px",height:"100px"}},C.createElement(Ho,{ref:ja},C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:10},a("4000.0205")||"长度",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:1,max:10,onChange:lu}))))):null),st.includes("virtual")&&C.createElement(Wg,{tab:a("4000.0203")||"病毒标记",key:"2",disabled:q===1||q===0},lr?C.createElement("div",{style:{backgroundColor:"rgba(255,255,255,0.6)",borderRadius:"5px",marginTop:"5px"}},C.createElement("div",null,C.createElement(Ba,{ref:Zi,disabled:!(A.length>0),className:"ant-btn ant-btn-primary",onClick:E},a("4000.0208")||"选择靶点"),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ya.Group,{style:{display:`${G?"block":"none"}`},onChange:Wt,value:xt,ref:za},C.createElement(Ya,{value:1},a("5000.5035")||"手动"),C.createElement(Ya,{value:2},a("5000.5034")||"自动")),G?C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}):null,xt===2?C.createElement(Ba,{className:"ant-btn ant-btn-primary",loading:hr,disabled:!(A.length>0),onClick:e3},a("5000.5017")||"计算"):null),a("5000.6039")||"平颅方位",C.createElement(Ya.Group,{onChange:Te=>{it(Te.target.value),Te.target.value?Ae.current.rotation.set(-8.3/180*Math.PI,0,0):Ae.current.rotation.set(0,0,0)},style:{marginLeft:6},value:Ne},C.createElement(Ya,{value:0},a("5000.6042")||"关闭"),C.createElement(Ya,{value:1},a("5000.6043")||"启用")),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement("div",{dangerouslySetInnerHTML:{__html:c.current}}),C.createElement("div",{dangerouslySetInnerHTML:{__html:u.current}})):null),st.includes("reslicing")&&C.createElement(Wg,{tab:a("4000.0204")||"图谱切面",key:"3",disabled:q===2||q===0},lr?C.createElement(C.Fragment,null,C.createElement("div",{style:{width:"276px"}},C.createElement(Ho,null,a("7000.7024")||"控制模式",": ",C.createElement(Ya.Group,{value:hs,onChange:Te=>{Te.target.value==0?at.current.setMode("translate"):at.current.setMode("rotate"),Hl(Te.target.value)}},C.createElement(Ya,{value:0},a("7000.7022")||"平移"),C.createElement(Ya,{value:1,disabled:hc!=4},a("7000.7023")||"旋转")),C.createElement("span",{style:{fontStyle:"italic"}},a("5000.0019")||"提示:按R键进入旋转模式")),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,null,a("7000.7021")||"重切片模式",":",C.createElement("br",null),C.createElement(Ya.Group,{value:hc.toString(),onChange:Te=>mi(Number(Te.target.value))},C.createElement(Ya.Button,{value:"1",style:{padding:"0 5px"}},"Coronal"),C.createElement(Ya.Button,{value:"2",style:{padding:"0 5px"}},"Sagittal"),C.createElement(Ya.Button,{value:"3",style:{padding:"0 5px"}},"Horizontal"),C.createElement(Ya.Button,{value:"4",style:{padding:"0 5px"}},"Arbitrary"))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0210")||"平移-X",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:-5.17,max:5.17,onChange:Ye,step:.01,value:ar,disabled:zt}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250,visibility:"hidden"},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0211")||"平移-Y",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:-5.33,max:2.04,onChange:Ot,step:.01,value:At,disabled:Xt}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250,visibility:"hidden"},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0212")||"平移-Z",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:-8,max:6,onChange:tn,step:.01,value:Ft,disabled:$t}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250,visibility:"hidden"},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0213")||"角度-X",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:0,max:360,step:1,value:Rn,onChange:Te=>pn(Te,1),disabled:qt}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250,visibility:"hidden"},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0214")||"角度-Y",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:0,max:360,step:1,value:Xn,onChange:Te=>pn(Te,2),disabled:qt}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250,visibility:"hidden"},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0215")||"角度-Z",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:0,max:360,step:1,value:Or,onChange:Te=>pn(Te,3),disabled:qt})))),C.createElement(Ba,{style:{marginTop:20,marginLeft:10},type:"primary",disabled:In,onClick:()=>X()},"Download current slice"),C.createElement(Ba,{style:{marginTop:20},type:"primary",disabled:In,onClick:()=>Jn()},a("7000.0107")||"查看更高分辨率的图像"),C.createElement(Ri,{style:{margin:"10px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement("div",null,C.createElement("i",null,a("5000.6008")||"点击下方按钮,申请下载各向同性10微米分辨率的STAM图谱3D标签图像")),C.createElement(Ba,{style:{marginTop:20},type:"primary",onClick:()=>{Hs()}},a("5000.6009")||"请求STAM标签"),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0})):null),st.includes("registration")&&C.createElement(Wg,{tab:a("5000.0001")||"脑片配准",key:"4",disabled:q===2||q===0},lr?C.createElement(C.Fragment,null,Nl.map((Te,qe)=>C.createElement(C.Fragment,null,C.createElement(Qre.CheckableTag,{key:Te,checked:cs.includes(Te),onChange:()=>dc([Te])},Te))),Nl.length<10?C.createElement(Qre,{icon:C.createElement(rT,null),onClick:()=>{Nc(Te=>[...Te,`Task${Nl.length+1}`]),ws(Te=>[...Te,{key:`Task${Nl.length+1}`,fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""}]),Es.current=[...Es.current,{key:`Task${Nl.length+1}`,fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""}]}},"New task"):null,Wo.map((Te,qe)=>{if(Te.key===cs[0]){const{key:Je,fileList:gt,fileList2:St,correspondingPlaneData:Qt,registrationRadioShowType:Yt,startButtonLoading:hn}=Te;return C.createElement("div",{key:Je},C.createElement(Ho,null,C.createElement(ko,null,C.createElement("p",null,C.createElement("span",null,a("5000.6033")||"Upload slice, or use the test "),C.createElement("a",{onClick:()=>{r3("DAPI")}},"DAPI "),"&",C.createElement("a",{onClick:()=>{r3("PI")}}," PI "),a("5000.6034")||"slices:"))),C.createElement(Ho,null,C.createElement(ko,null,C.createElement(jD,{accept:"image/tiff",listType:"picture-card",fileList:gt,onPreview:fd,customRequest:Vc,beforeUpload:ln=>bp(ln),onRemove:()=>{const ln=Wo.findIndex(ur=>ur.key===cs[0]);if(ln>-1){let ur=JSON.parse(JSON.stringify(Wo)),Yn=ur[ln];Yn.fileList=[],ws(ur),Es.current=ur}}},C.createElement("button",{style:{border:0,background:"none"},type:"button"},C.createElement(rT,null),C.createElement("div",{style:{marginTop:8}},"Upload tiff"))))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,null,C.createElement("p",null,C.createElement("span",null,a("5000.7000")||"(可选) 上传第二张脑片图像,默认该图像已经配准到了第一张上传的脑片图像上")))),C.createElement(Ho,null,C.createElement(ko,null,C.createElement(jD,{accept:"image/tiff",listType:"picture-card",fileList:St,onPreview:fd,customRequest:ln=>Vc(ln,2),beforeUpload:ln=>bp(ln,2),onRemove:()=>{const ln=Wo.findIndex(ur=>ur.key===cs[0]);if(ln>-1){let ur=JSON.parse(JSON.stringify(Wo)),Yn=ur[ln];Yn.fileList2=[],ws(ur),Es.current=ur}}},C.createElement("button",{style:{border:0,background:"none"},type:"button"},C.createElement(rT,null),C.createElement("div",{style:{marginTop:8}},"Upload tiff"))))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{marginTop:5}},C.createElement(ko,null,a("7000.0106")||"计算与上传图像对应的图谱切面",":")),C.createElement(Ho,{style:{marginTop:5}},C.createElement(ko,null,C.createElement(Ba,{loading:hn,disabled:gt.length<1,onClick:()=>zc(qe)},a("7000.0108")||"开始计算"),C.createElement(Ba,{onClick:Hc,disabled:!Qt.url},a("7000.0109")||"下载保存"))),C.createElement(Ho,{style:{marginTop:5}},Qt.base64_url&&C.createElement(xD,{src:Qt.base64_url,width:100})),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{marginTop:5}},C.createElement(Ba,{onClick:()=>Zm("1"),disabled:!Qt.url},a("5000.0004")||"显示结果"),C.createElement(ko,{style:{display:"flex",alignItems:"center",marginLeft:5}})),C.createElement(Ho,null,C.createElement(Ya.Group,{onChange:xp,value:Yt},C.createElement(Ya,{value:"1"},a("5000.7001")||"atlas"),C.createElement(Ho,null,"slice: ",C.createElement(_1,{onChange:ln=>{jl.current=ln.target.checked;const ur=ln.target.checked?1:-1;Ae.current.traverse(Yn=>{Yn.userData.name==="registrationPng"&&Yn.userData.imgType!=1&&Yn.scale.set(ur,1,1)})}},a("5000.7013")||"左右翻转"),C.createElement("div",{style:{wordWrap:"break-word",width:200}},C.createElement(Ya,{value:"2"},a("5000.7002")||"first"),St.length<1?null:C.createElement(Ya,{value:"3"},a("5000.7003")||"second"))))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}))}else return null})):null),st.includes("download")&&C.createElement(Wg,{tab:a("5000.0005")||"数据下载",key:"5",disabled:q===2||q===0},lr?C.createElement(C.Fragment,null,C.createElement(Ho,null,C.createElement(ko,null,a("5000.0009")||"提示:按A键切换平移和缩放模式")),C.createElement(Ho,null,C.createElement(ko,null,C.createElement(Ba,{onClick:Xr},jr))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{marginTop:5}},C.createElement(ko,null,C.createElement(Ba,{disabled:jr===(a("5000.0006")||"选取下载范围"),onClick:Ym},a("5000.0008")||"预览图像"))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{alignItems:"center"}},C.createElement(ko,null,a("5000.0010")||"设置采样倍数",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:1,max:6,step:1,defaultValue:2,value:kn,onChange:Te=>{nr(Te),Jr({})},tooltip:{formatter:Te=>Te?Math.pow(2,Te-1):null}}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,null,C.createElement(Ba,{loading:Ni,disabled:jr===(a("5000.0006")||"选取下载范围"),onClick:qm},a("5000.0005")||"数据下载"))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,null,a("5000.5031")||"数据块大小:"),C.createElement(ko,null,wv)),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0})):null),st.includes("mapping")&&C.createElement(Wg,{tab:a("5000.5014")||"图谱映射",key:"6",disabled:q===2||q===0},lr?C.createElement(C.Fragment,null,C.createElement(Ho,null,C.createElement(ko,null,C.createElement("p",null,a("5000.6035")||"Upload 3D image or swc file already mapped to STAM or CCF, otherwise use the test ",C.createElement("a",{onClick:()=>{UI("3D")}},a("5000.6036")||"3D image")," or ",C.createElement("a",{onClick:()=>{UI("swc")}},a("5000.6037")||"swc file:"))),C.createElement(ko,null,C.createElement(jD,{listType:"picture-card",fileList:Qn,onPreview:fd,customRequest:Tg,beforeUpload:Te=>bp(Te,1),onRemove:()=>{Pr([])}},C.createElement("button",{style:{border:0,background:"none"},type:"button"},C.createElement(rT,null),C.createElement("div",{style:{marginTop:8}},"Upload"))))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{marginTop:5}},C.createElement(ko,null,a("5000.5015")||"选择转换方向",":"),C.createElement(ko,null,C.createElement(Ya.Group,{onChange:Gs,value:Et},C.createElement(Ya,{value:"applySTAM2CCF"},"STAM-",">","CCF"),C.createElement(Ya,{value:"applyCCF2STAM"},"CCF-",">","STAM")))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{marginTop:5}},C.createElement(ko,null,C.createElement(Ba,{loading:or,disabled:!qo,onClick:PI},a("7000.0108")||"开始计算"),C.createElement(Ba,{onClick:hx,disabled:!zi.file},a("7000.0109")||"下载保存"))),C.createElement(Ho,{style:{marginTop:5}},zi.base64_url&&C.createElement(xD,{src:zi.base64_url,width:100})),C.createElement(Ho,{style:{marginTop:5}},C.createElement(Ba,{onClick:$c,disabled:!(zi.file&&zi.file[1])},a("5000.0004")||"显示结果")),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement("p",null,a("7000.7014")||"您也可以在此下载",C.createElement("a",{href:`${n}/data/Fiji.zip`},"Fji")," / ",C.createElement("a",{href:n+"/data/ImageJ.zip"},"ImageJ"),C.createElement("span",null,a("7000.7015")||"的插件;您可能需要使用测试数据,请"),C.createElement("a",{href:`${n}/data/test.zip`},a("7000.7016")||"在此"),C.createElement("span",null,a("7000.7017")||"下载")," ;如果你没有申请过key可以点击",C.createElement("a",{onClick:()=>{Da(1),_r(!0)}},a("5000.5042")||"申请key"))):null),st.includes("neurons")&&C.createElement(Wg,{tab:a("5000.5052")||"神经环路",key:"7",disabled:q===2||q===0},lr?C.createElement(C.Fragment,null,C.createElement("p",null,C.createElement("span",null,a("5000.6029")||"Navigate the "),C.createElement("a",{style:{textDecoration:"underline"},onClick:()=>{xo(!0)}},a("5000.6030")||"whole-brain connectivity diagram"),C.createElement("span",null,a("5000.6031")||"consisting of single neuronal projections,or:")),ns?C.createElement(O4,{ref:Dc,style:{width:"100%"},options:qn,placeholder:a("5000.5053")||"Input the inquired structure",onSearch:t3,onChange:vx,value:ns}):C.createElement(nb,{showSearch:!0,ref:iu,style:{width:"100%"},value:ns,dropdownStyle:{maxHeight:400,overflow:"hidden"},placeholder:a("5000.5053")||"Input the inquired structure",allowClear:!0,treeDefaultExpandAll:!1,onChange:vx,onSearch:vx,treeData:Ig(De)}),C.createElement("p",{style:{fontSize:"13px",fontStyle:"italic"}},C.createElement("span",null,a("5000.6001")||"Input an inquired structure to visualize the connectivity map, for example, "),C.createElement("a",{onClick:cl("CP"),style:{textDecoration:"underline"}},"CP"),", ",C.createElement("a",{onClick:cl("PIR1"),style:{textDecoration:"underline"}},"PIR1"),", or ",C.createElement("a",{onClick:cl("Primary motor area, Layer 6a"),style:{textDecoration:"underline"}}," Primary motor area, Layer 6a")),ns?C.createElement("p",{style:{fontSize:"13px",fontStyle:"italic"}},C.createElement("a",{style:{textDecoration:"underline"},onClick:()=>{const Te=[];Te.push(ns),["Upstream","Downstream"].forEach(Qt=>{Te.push(Qt),Te.push("name,neurons"),zu[Qt].forEach(Yt=>{Te.push(`${Yt.name},"${Yt.value}"`)})});let qe=Te.join(`
|
|
4597
|
+
`;let jUt=new URL(window.location.href),ud=new URLSearchParams(jUt.search),Jpe=ud.get("leftHemisphereVisibility"),Qpe=ud.get("coordinateVisibility"),eve=ud.get("datumMarkVisibility"),tve=ud.get("cranialVisibility"),nve=ud.get("gridVisibility"),rve=ud.get("terminalVisibility"),ive=ud.get("branchingVisibility"),ave=ud.get("branchingColor"),ove=ud.get("brainContourVisibility"),sve=ud.get("brainContourOpacity"),SR=ud.get("otherAtlases"),wR=ud.get("atlasReslicingInfo"),ER=ud.get("sectionPointPosition"),lve=ud.get("echart_Value"),DB=ud.get("tiffDataPath"),cve=ud.get("tiffInfo"),aM=ud.get("swcUrl");class WUt extends Mc{constructor(n,r,i,a){super();kf(this,"_renderer");kf(this,"webglTexture",null);kf(this,"_size");this._renderer=n,this._size=r,this.image={width:r,height:i,depth:a,data:null},this.type=bm,this.format=AX,this.minFilter=ku,this.magFilter=ku,this.needsUpdate=!0,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}update(){if(!this.webglTexture)return;const n=this._renderer.getContext();if(!n.getExtension("EXT_color_buffer_float"))throw"Floating point textures not supported";this._renderer.state.bindTexture(n.TEXTURE_3D,this.webglTexture),this.version++,this._updateVersion++}}const XUt={leftHemisphereVisibility:Jpe?JSON.parse(Jpe):!1,coordinateVisibility:Qpe?JSON.parse(Qpe):!0,datumMarkVisibility:eve?JSON.parse(eve):!0,cranialVisibility:tve?JSON.parse(tve):!1,gridVisibility:nve?JSON.parse(nve):!0,terminalVisibility:rve?JSON.parse(rve):!0,branchingVisibility:ive?JSON.parse(ive):!0,branchingColor:ave||"#A7B5A1",brainContourVisibility:ove?JSON.parse(ove):!0,brainContourOpacity:sve?JSON.parse(sve):.3,otherAtlases:SR||"None",atlasReslicingInfo:wR?JSON.parse(wR):{},sectionPointPosition:ER?JSON.parse(ER):{}},ZUt=(t,e)=>{let n=new URL(window.location.href),r=new URLSearchParams(n.search),i=e;typeof e!="string"&&(i=JSON.stringify(i)),r.set(t,i),n.search=r.toString(),window.history.replaceState({},"",n)},KUt={set:function(t,e,n){return t[e]=n,ZUt(e,n),!0}},La=new Proxy(XUt,KUt),A6e=C.forwardRef((t,e)=>{const{regionData:n,setoffset_factor:r,offset_factor_R:i,t:a,hrefStr:o,leftTreeRef:s,angleRef:c,jiaoduRef:u,mouseflag:d,renderer:f,controls:h,menutagShow:p,setMenuTag:v,startselect:y,linemeshs_jing:g,points:m,points2:b,activetabIndex:x,material:S,setShowimage:w,childRef:_,checkItems:A,setoutflag:P,fetchCoordinateFunc:R,setendPoint:N,clickPoint:k,outflagRef:B,axis_font:H,setdatum:F,modeChoose:G,setShowModeChoose:z,virusModeValue:V,setShowTabNums:j,pipelineClickEvent:Y,automaticGroup:W,focusVirusLineItem:Z,setMenuTagShow:te,responsefunc:se,mode:q,setCheckItems:ne,setLeftMenuTabIndex:oe,updatePage:ie,swcItem:ee,axon_check:ye,swcnameMesh:ve,setMode:pe,vesselRef:re,swcRef:xe,vesselStr:Q,lableStr:be,setShowSettingModal:de,showSettingModal:Ee,fbxTreeDatas:De,composer:He,setEchartValue:Pe,echartValue:Se,sectionsInfoRef:We,sectionsInfo:ge,setSectionsInfo:ue,gray_value:Me,setLuguchecked:it,Luguchecked:Ne,datum:Ke,setGridShow:ft,PointShow:ct,nodeStr:ut,lefttab:Ct,righttab:st,atlasData:ke,flowObjectsRef:ht,setTip:nt,tip:et}=t,[bt,ze]=C.useState(!1),[Mt,It]=C.useState(!1),[Dt,Lt]=C.useState(!1),[Bt,Gt]=C.useState(!1),[un,xn]=C.useState(!1),[wn,Fn]=C.useState(!1),[en,Mr]=C.useState(!1),[_n,gn]=C.useState(!1),[Rn,dn]=C.useState(La.atlasReslicingInfo.angleX||120),[Xn,cr]=C.useState(La.atlasReslicingInfo.angleY||320),[Or,Bn]=C.useState(La.atlasReslicingInfo.angleZ||270),[ar,Ge]=C.useState(La.atlasReslicingInfo.positionX||0),[At,Nt]=C.useState(La.atlasReslicingInfo.positionY||0),[Ft,kt]=C.useState(La.atlasReslicingInfo.positionZ||0),[zt,Vt]=C.useState(La.atlasReslicingInfo.translateX||!0),[Xt,Dn]=C.useState(La.atlasReslicingInfo.translateY||!0),[$t,Rt]=C.useState(La.atlasReslicingInfo.translateZ||!0),[qt,Un]=C.useState(La.atlasReslicingInfo.rotate||!0),[In,xr]=C.useState(La.atlasReslicingInfo.ButtonDisabled||!0),[Ir,Zn]=C.useState(!1),[nn,Wn]=C.useState(!1),[Cn,Sn]=C.useState(!1),[On,er]=C.useState(!1),[jr,yr]=C.useState(a("5000.0006")||"显示数据块"),[zr,tr]=C.useState(1),[Lr,Dr]=C.useState(1),[Qn,Pr]=C.useState([]),[$i,Wi]=C.useState([]),[Ni,Xi]=C.useState(!1),[zi,xa]=C.useState({}),[mo,Oa]=C.useState(!1),[qr,ai]=C.useState(""),[Ta,Zt]=C.useState("Config_DAPI.ini"),[Et,mn]=C.useState("applySTAM2CCF"),[xt,on]=C.useState(0),[or,Yr]=C.useState(!1),[hr,kr]=C.useState(!1),[Pn,Vn]=C.useState(!1),[lr,rn]=C.useState(!0),[kn,nr]=C.useState(2),[br,Ur]=C.useState(!1),[ni,Jr]=C.useState({}),gi=C.useRef(La.atlasReslicingInfo.direction1||4),ja=C.useRef(null),Zi=C.useRef(null),[qo,io]=C.useState(!1),za=C.useRef(null),zn=C.useRef(window.location.href.split("/")[2]),at=C.useRef(new JS(Ai.current,f==null?void 0:f.domElement)),Le=C.useRef(0),Be=C.useRef(0),tt=C.useRef(new rr),rt=C.useRef(new Ie),dt=C.useRef(new Ie),vt=C.useRef(new rr),ot=C.useRef(new Ie(1,0,0)),fe=C.useRef(new rr),ce=C.useRef(null),Ue=C.useRef(new Dz),$e=C.useRef(null),Ze=C.useRef([]),pt=C.useRef(null),Pt=C.useRef(new rr),Ut=C.useRef(new Fu),[an,wt]=C.useState(La.otherAtlases),jt={min:new Ie(59.74305725097656,69.15838623046875,.9565062522888184),max:new Ie(1081.3045654296875,800.6698608398438,1400.156005859375)},[qn,pr]=C.useState([]),Tn=C.useRef({}),An=C.useRef(!1),Wr=C.useRef([0,0]),Qr=C.useRef([0,0]),fn=C.useRef(""),Kt=C.useRef(!1),[ui,_r]=C.useState(!1),[ei,Fo]=C.useState(!1),[Ca,Da]=C.useState(0),[di,ti]=C.useState(0),[da,bs]=C.useState([]),[Ia,Jo]=C.useState([]),xs=C.useRef(null),Cs=C.useRef(null),[Vs,yo]=C.useState(""),[Qa,qs]=C.useState(null),[ns,rs]=C.useState(lve||""),[sr,bo]=C.useState(!1);C.useState("");const Ss=C.useRef(""),[Tl,$s]=C.useState(La.leftHemisphereVisibility),Wa=C.useRef([]);C.useRef([]);const[Bo,xo]=C.useState(!1),[Mo,Lo]=C.useState(!1),ol=C.useRef(!0),pl=C.useRef(!0),ka=C.useRef(""),Oo=C.useRef({target:h.current.target.clone(),position:h.current.object.position.clone(),up:h.current.object.up.clone(),enabled:h.current.enabled}),[hs,Hl]=C.useState(0),[Js,Gl]=C.useState(!0),jl=C.useRef(!0),Wl=C.useRef(null),is=C.useRef(new rr),[vl,gl]=C.useState(La.brainContourVisibility),[Nl,Nc]=C.useState(["Task1","Task2"]),[cs,dc]=C.useState(["Task1"]),[Wo,ws]=C.useState([{key:"Task1",fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""},{key:"Task2",fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""}]),Es=C.useRef([{key:"tags1",fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""},{key:"tags2",fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""}]),Dc=C.useRef(null),iu=C.useRef(null),[wu,fc]=C.useState(La.coordinateVisibility),[Qs,au]=C.useState(La.brainContourOpacity),[hc,Eu]=C.useState(La.atlasReslicingInfo.direction1||4),[Pd,kc]=C.useState({}),[ou,Ql]=C.useState({}),[zu,Dl]=C.useState({});C.useRef();const su=C.useRef([]),_s=C.useRef({brightness:.95,darkness:0,opacity:1,opacity2:1,color:{r:0,g:0,b:0},color2:{r:255,g:255,b:255}}),ec=C.useRef(new Set),zs=C.useRef(0);C.useImperativeHandle(e,()=>({tabChange:Qo,setYinDaoOpen1:ze,setYinDaoOpen2:It,setYinDaoOpen3:Lt,setYinDaoOpen4:Gt,setYinDaoOpen5:xn,setYinDaoOpen6:Fn,setYinDaoOpen7:Mr,setDontShowAgain:Gl})),C.useEffect(()=>{su.current=De},[De]);const _u=Te=>{ec.current.delete(Te.key)},pc=Te=>{if(Te.stopPropagation(),ec.current.add(Te.key),ec.current.has("Alt")&&(ec.current.has("c")||ec.current.has("C")))try{const qe=f.domElement.toDataURL("image/png"),Je=document.createElement("a");Je.href=qe,Je.download="scene.png",Je.click(),ec.current=new Set}catch(qe){console.error("Error downloading canvas:",qe),alert("抱歉,无法下载画布。请查看控制台获取更多信息。")}};C.useEffect(()=>{fetch(n+"/data/json/name.json").then(Je=>Je.json()).then(Je=>{bs(Je)}),fetch(n+"/data/TreeData/nuclear.json").then(Je=>Je.json()).then(Je=>{Jo(Je)});const Te=new hu(.05,32,32),qe=new Rl({color:392960,transparent:!0});if(is.current=new rr(Te,qe),is.current.name="sectionSphere",ER){let Je=JSON.parse(ER);is.current.position.set(Je.x,Je.y,Je.z)}return La.cranialVisibility&&DI(!0),DB&&YE(),aM&&J1(),document.addEventListener("keydown",pc),document.addEventListener("keyup",_u),window.addEventListener("beforeunload",tl),()=>{document.removeEventListener("keydown",pc),document.removeEventListener("keyup",_u),window.removeEventListener("beforeunload",tl)}},[]),C.useEffect(()=>{fetch("/staticresource/data/SWC/swc_foler/15257/BIL_15257_1.js").then(Te=>Te.json()).then(Te=>{Ql(Te)}).catch(Te=>{console.error("Fetch error:",Te)})},[]);const Aa=(Te,qe)=>Js?C.createElement("div",{style:{position:"absolute",top:"4px",right:"50px"}},C.createElement(_1,{defaultChecked:!1,onChange:Je=>{Je.target.checked?localStorage.setItem(Te,"true"):localStorage.setItem(Te,"false"),qe()},style:{marginTop:"10px"}},"Don't show again")):null,Xl=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Assem")||localStorage.getItem("Assem")==="false"?Aa("Assem",function(){}):null,C.createElement("div",null,a("8000.0001")||"如①所示,在主窗口左侧的是数据面板,用户可以在该选项卡下选择STAM的解剖命名树,配准到STAM上的完整脑血管图谱和神经元数据。用户也可以切换两个不同版本的命名系统。"),C.createElement("div",null,a("8000.0002")||"如②所示,主窗口中可以加载脑区、核团的三维模型。"),C.createElement("div",null,a("8000.0003")||"如③所示,用户可以切换不同的模式或者功能模块")),cover:C.createElement("video",{src:`${n}/guide/topo.mp4`,controls:!0,style:{height:600}}),placement:"center",style:{width:"min-content"},target:pt.current},{title:a("8000.0032")||"解剖结构、脑血管和神经元查询",cover:C.createElement("img",{src:`${n}/guide/gif_batch/topo/out_topo1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Assem")||localStorage.getItem("Assem")==="false"?Aa("Assem",function(){}):null,a("8000.0004")||"Regions选项卡包含的是STAM的解剖命名树,用户可以在该选项卡下的复选框中选择任意数量的感兴趣结构,在主窗口中可视化;Vessels选项卡包含了一套配准到STAM上的完整脑血管图谱,用户可以在此选择感兴趣的血管分支;Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。用户也可以选择切换到Brain maps 4.0 ontology,该命名树中的结构同样可以被检索、选中并可视化。"),target:s.current,placement:"right"},{title:a("8000.0033")||"可视化解剖子结构并切换坐标原点",cover:C.createElement("img",{src:`${n}/guide/gif_batch/topo/out_topo2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Assem")||localStorage.getItem("Assem")==="false"?Aa("Assem",function(){}):null,a("8000.0005")||"用户可以点击Regions选项卡下的解剖命名树中蓝色的方块图标,此时主窗口中会以组装的形式可视化用户点击结构的所有子结构,同时展开幅度可在右侧面板设置。默认情况下,该坐标系统以Bregma点作为原点。户也可以将坐标原点切换为STAM的其它任意19个颅骨或颅内基准点,主窗口中可视化对象的坐标值将根据新的原点重新计算。右击任意基准点,可以保存以基准点为坐标原点的STAM标签图像。"),placement:"center",target:pt.current},{title:a("8000.0034")||"可视化功能设置",cover:C.createElement("img",{src:`${n}/guide/gif_batch/topo/out_topo3.gif`}),description:C.createElement("div",null,!localStorage.getItem("Assem")||localStorage.getItem("Assem")==="false"?Aa("Assem",function(){}):null,a("8000.0006")||"用户可以在页面底部切换到setting选项卡。Left hemisphere开关决定是否展示左半脑,默认为Off。Coordinate开关决定是否在主窗口中显示坐标数值,默认为On。Datum Marks开关决定是否在主窗口中显示基准点,默认为On。Cranial开关决定是否在主窗口中显示颅骨的三维轮廓,默认为Off。"),target:document.getElementsByClassName("bottom_tabs_outer_div")[0]}],el=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Virtual")||localStorage.getItem("Virtual")==="false"?Aa("Virtual",function(){}):null,a("8000.0007")||"我们提供了虚拟手术导航服务,用户可以通过交互操作,模拟向小鼠脑注射病毒的立体定位手术过程。STAM会根据用户操作,返回注射位点与作为坐标原点的颅骨或颅内基准点之间的距离和注射角度信息。"),cover:C.createElement("video",{src:`${n}/guide/surgery.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0035")||"自动导航模式",cover:C.createElement("img",{src:`${n}/guide/gif_batch/surgery/out_surgery1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Virtual")||localStorage.getItem("Virtual")==="false"?Aa("Virtual",function(){}):null,a("8000.0008")||"首先选择要注射的脑区。接下来在脑区上选择注射靶点。用户继续点击Select target按钮,注射脑区的三维模型表面会出现一个跟随鼠标移动的绿点。然后,点击Auto进入自动模式,左侧数据面板中的Structure for injecting选项卡变为Regions to avoid。用户点击需要避开脑区、核团的名称,被选中的文字会变为高亮的红色,同时这些结构的三维轮廓也会显示在主窗口中。接下来点击右侧面板中的Intellectual planning按钮,等待若干秒后,STAM会返回一条从注射靶点出发、并且避开所有用户选中脑区、核团的路径。"),target:s.current,placement:"right"},{title:a("8000.0036")||"手动导航模式",cover:C.createElement("img",{src:`${n}/guide/gif_batch/surgery/out_surgery2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Virtual")||localStorage.getItem("Virtual")==="false"?Aa("Virtual",function(){}):null,a("8000.0009")||"用户点击Manually进入手动规划模式,此时用户标记的注射靶点变为蓝色圆点,并出现一条从注射靶点出发、连接到鼠标当前的位置的红色虚射线,该射线与STAM外轮廓的交点(即注射位点)会被标记为绿色。当用户找到合适的注射路径后,可点击鼠标左键标记,被标记的路径会在主窗口中形成一条蓝色实线,注射位点则被标记为蓝色圆锥,且该路径所穿过的脑区、核团名称也会按照其空间位置排列在实线上。在右侧面板中,会出现该注射路径与三个标准解剖方向的夹角、注射靶点,以及注射位点的信息。用户点击右侧面板上的Reset按钮,即可重新开始整个注射手术流程。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"}],Li=[{title:a("5000.5084")||"步骤一",description:a("5000.5082")||"请选择注射模式,如果选择自动模式,点击左侧细胞名称选择细胞核进行旁路",target:za.current}],sl=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Reg")||localStorage.getItem("Reg")==="false"?Aa("Reg",function(){}):null,a("8000.0011")||"如①所示,用户可上传PI或DAPI染色的单张脑片图像,该服务将通过约1分钟的服务器端计算,从STAM中重切出一张与用户上传的脑片位置最接近的图谱切面,并根据计算出来的角度和位置显示在主窗口中。"),cover:C.createElement("video",{src:`${n}/guide/registration.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0037")||"上传脑片图像并计算或下载配准结果",cover:C.createElement("img",{src:`${n}/guide/gif_batch/registration/out_reg1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Reg")||localStorage.getItem("Reg")==="false"?Aa("Reg",function(){}):null,a("8000.0012")||"用户可以从本地上传待配准的tif/tiff格式的二维脑片图像。然后选择上传图像的类型。接着点击Calculate the corresponding plane from the atlas按钮组中的Start按钮,等待后台返回计算结果。计算完成后,Start按钮下方会出现计算结果的预览图,可左键单击放大查看。Start按钮右侧的Save按钮此时也变为可点击,用户单击该按钮,可以将计算结果下载到本地。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"},{title:a("8000.0038")||"页面跳转功能",cover:C.createElement("img",{src:`${n}/guide/gif_batch/registration/out_reg2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Reg")||localStorage.getItem("Reg")==="false"?Aa("Reg",function(){}):null,a("8000.0013")||"在主窗口右击相应的脑区、核团,可以跳转到任意剖面可视化和脑解剖知识库页面。"),placement:"center",target:pt.current}],Uc=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Down")||localStorage.getItem("Down")==="false"?Aa("Down",function(){}):null,a("8000.0014")||"如①和②所示,用户可以在STAM所在的三维空间中选取任意感兴趣范围,并以不同的采样倍数下载自己选取范围内的原始图像。"),cover:C.createElement("video",{src:`${n}/guide/datasharing.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0047")||"平移模式选择原始图像数据的范围",cover:C.createElement("img",{src:`${n}/guide/gif_batch/datasharing/out_sharing1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Down")||localStorage.getItem("Down")==="false"?Aa("Down",function(){}):null,a("8000.0015")||"用户可以点击“Select the range”按钮,然后主窗口中出现一个橙色线条的方框。用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制方框在各个方向上的平移,当某个方向的箭头被用户选中时,该箭头会变为高亮的黄色。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"},{title:a("8000.0039")||"缩放模式选择原始图像数据的范围并预览图像",cover:C.createElement("img",{src:`${n}/guide/gif_batch/datasharing/out_sharing2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Down")||localStorage.getItem("Down")==="false"?Aa("Down",function(){}):null,a("8000.0016")||"用户也可以通过按下键盘上的“A”,将范围选取操作从平移模式切换为缩放模式。此时方框的箭头会变为方块,拖动方块,就可以改变方框的大小。经过上述操作明确了待下载数据的空间范围后,可以点击“预览下载图像”按钮,通过体绘制,在主窗口中对该范围内的图像进行可视化,"),placement:"center",target:pt.current},{title:a("8000.0040")||"选择数据的采样倍数并下载",cover:C.createElement("img",{src:`${n}/guide/gif_batch/datasharing/out_sharing3.gif`}),description:C.createElement("div",null,!localStorage.getItem("Down")||localStorage.getItem("Down")==="false"?Aa("Down",function(){}):null,a("8000.0017")||"拖动“Set the downsampling rate”滑动条,用户可以选择待下载数据的采样倍数;具体的倍数值可通过滑块上方的黑色背景提示文字查看。当数据量没有超过1 GB时,点击Downloading按钮可直接下载;当超过该数值,点击Downloading按钮会唤起用户终端的邮箱管理工具(如Outlook等),并自动将待下载范围和采样倍数信息填入邮件中,此时用户点击邮件发送按钮,即可向STAM网站发送数据下载申请。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"}],Tu=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Map")||localStorage.getItem("Map")==="false"?Aa("Map",function(){}):null,a("8000.0018")||"我们支持用户上传此前已经配准到Common Coordinate Framework(CCF)的三维图像数据和神经元完整形态数据,并将其映射到STAM上,并直接在三维空间中进行可视化;我们也支持反向映射,即将已经配准到STAM的同类型数据映射到CCF上。"),cover:C.createElement("video",{src:`${n}/guide/mapping.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0041")||"上传三维图像数据并计算",cover:C.createElement("img",{src:`${n}/guide/gif_batch/mapping/out_mapping1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Map")||localStorage.getItem("Map")==="false"?Aa("Map",function(){}):null,a("8000.0019")||"用户点击右侧面板的Upload按钮,上传已配准到CCF或者STAM的三维图像数据或神经元形态学数据。上传结束后,在Select the direction of conversion单选框中,确定数据的映射方向是从STAM到CCF还是反过来。此后点击Start按钮,STAM的服务器端开始计算,Start按钮变为等待状态。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"},{title:a("8000.0042")||"计算完成后预览或下载结果",cover:C.createElement("img",{src:`${n}/guide/gif_batch/mapping/out_mapping2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Map")||localStorage.getItem("Map")==="false"?Aa("Map",function(){}):null,a("8000.0020")||"等待约10分钟后,STAM的服务器端完成计算并返回结果。此时Save按钮和View result按钮均变为可点击状态。点击Save按钮,可以将计算结果下载到本地;点击View result按钮,可以在主窗口中预览计算结果。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"}],Fc=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Res")||localStorage.getItem("Res")==="false"?Aa("Res",function(){}):null,C.createElement("div",null,a("8000.0021")||"我们提供了沿任意角度可视化脑图谱切面的服务。用户可以查看感兴趣的STAM任意位置和角度的切面,浏览该切面上的脑区、核团标注,并由该图谱切面跳转到STAM任意切面服务所提供的各向同性1微米分辨率切面。"),C.createElement("div",null,a("8000.0022")||"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同。位于正中区域的是主窗口。"),C.createElement("div",null,a("8000.0023")||"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。具体的平移、旋转数值可通过滑块上方的黑色背景提示文字查看。")),cover:C.createElement("video",{src:`${n}/guide/reslicing.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0043")||"平移或旋转图谱切面",cover:C.createElement("img",{src:`${n}/guide/gif_batch/reslicing/out_reslicing1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Res")||localStorage.getItem("Res")==="false"?Aa("Res",function(){}):null,a("8000.0024")||"用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制图谱切面的平移。用户也可以通过按下键盘上的“R”,将范围选取操作从平移模式切换为旋转模式。此时箭头会变为球形,沿球形拖动,就可以控制图谱切面的旋转。"),placement:"center",target:pt.current},{title:a("8000.0044")||"下载高分辨率的STAM图谱3D标签图像",cover:C.createElement("img",{src:`${n}/guide/gif_batch/reslicing/out_reslicing2.gif`}),description:C.createElement("div",null,!localStorage.getItem("Res")||localStorage.getItem("Res")==="false"?Aa("Res",function(){}):null,a("8000.0025")||"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。点击viewer higher resolution image按钮可以跳转到任意剖面可视化界面。点击Requesting STAM labels按钮,填入许可证即可下载各向同性10微米分辨率的STAM图谱3D标签图像。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"}],Hu=[{title:null,description:C.createElement("div",null,!localStorage.getItem("Neu")||localStorage.getItem("Neu")==="false"?Aa("Neu",function(){}):null,C.createElement("div",null,a("8000.0026")||"我们提供全脑的胞体或投射靶区的神经环路数据可视化服务。用户可以选择感兴趣的任意胞体或投射靶区在脑区、核团的神经环路数据,并查看数据对应的脑区、核团标注。"),C.createElement("div",null,a("8000.0027")||"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同,其中Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。"),C.createElement("div",null,a("8000.0028")||"如②所示,用户可以在搜索框中搜索感兴趣脑区、核团。"),C.createElement("div",null,a("8000.0029")||"如③所示,这是一个由若干个脑区、核团子结构组成的神经环路连接示意图。")),cover:C.createElement("video",{src:`${n}/guide/neuronal.mp4`,controls:!0,style:{height:600}}),placement:"center",target:pt.current,style:{width:"min-content"}},{title:a("8000.0045")||"查看神经环路连接示意图并交互",cover:C.createElement("img",{src:`${n}/guide/gif_batch/neuronal/out_neuronal1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Neu")||localStorage.getItem("Neu")==="false"?Aa("Neu",function(){}):null,a("8000.0030")||"用户可以点击“whole-brain connectivity diagram”按钮或在搜索框中搜索感兴趣脑区、核团,即可弹出由若干个脑区、核团子结构组成的神经环路连接示意图。不同圆点表示不同的脑区、核团结构,圆点旁边显示的是脑区、核团的名称。用户可以将鼠标移动到圆点、脑区或核团的名称上,左击或右击圆点。"),target:document.getElementsByClassName("ant-tabs-content-holder")[1],placement:"left"},{title:a("8000.0046")||"显示用户指定脑区上下游连接关系",cover:C.createElement("img",{src:`${n}/guide/gif_batch/neuronal/out_neuronal1.gif`}),description:C.createElement("div",null,!localStorage.getItem("Neu")||localStorage.getItem("Neu")==="false"?Aa("Neu",function(){}):null,a("8000.0031")||"双击任意一个代表某个脑区、核团结构的圆点,神经环路连接示意图窗口隐藏,回到主窗口页面,显示该结构的上下游连接关系。在Upstream窗口中展示了投射到选中脑区、核团的神经环路,在Downstream窗口中展示了选中脑区、核团的投射靶区。用户可以用复选框选择任意数量的感兴趣神经元,在主窗口中可视化。"),target:s.current,placement:"right"}];C.useEffect(()=>{const Te=$o("index"),qe=$o("type"),Je=$o("structure");(qe||Te)&&setTimeout(()=>{switch(Te=="Assembling"?(!localStorage.getItem("Assem")||localStorage.getItem("Assem")==="false")&&ze(!0):Te=="Virtual_Inject"?(!localStorage.getItem("Virtual")||localStorage.getItem("Virtual")==="false")&&It(!0):Te=="Slicing"?(!localStorage.getItem("Res")||localStorage.getItem("Res")==="false")&&Fn(!0):Te=="Mapping"?(!localStorage.getItem("Map")||localStorage.getItem("Map")==="false")&&Fn(!0):Te=="Downloading"?(!localStorage.getItem("Down")||localStorage.getItem("Down")==="false")&&xn(!0):Te=="Neuronal"?(!localStorage.getItem("Neu")||localStorage.getItem("Neu")==="false")&&Mr(!0):Te=="Registration"&&(!localStorage.getItem("Reg")||localStorage.getItem("Reg")==="false")&&Gt(!0),qe){case"simple":document.title="STAM-SimpleViewer",pe(0);case"normal":Qo(1,!0),document.title="STAM-NormalViewer";break;case"virtual":document.title="STAM-Surgery",Qo(2,!0);break;case"slicing":Qo(3,!0),document.title="STAM-Reslicing";break;case"registration":Qo(4,!0),document.title="STAM-Registration";break;case"downloading":Qo(5,!0),document.title="STAM-Downloading";break;case"mapping":Qo(6,!0),document.title="STAM-AtlasMapping";break;case"circuits":Qo(7,!0),document.title="STAM-NeuronalCircuits",setTimeout(()=>{Je&&(rs(Je),Pe(Je))},500);break;case"other":Qo(8,!0),document.title="STAM-OtherAtlas";break;case"setting":Qo(9,!0),document.title="STAM-ViewSetting";break}},500)},[]),C.useEffect(()=>{Le.current=(f==null?void 0:f.domElement.clientWidth)-1,Be.current=(f==null?void 0:f.domElement.clientHeight)-1;let Te=-(jt.min.x+jt.max.x)*sa.current/2,qe=jt.max.clone().multiplyScalar(sa.current).add(new Ie(Te,qa.current,to.current)),Je=jt.min.clone().multiplyScalar(sa.current).add(new Ie(Te,qa.current,to.current));rt.current=qe,dt.current=Je;let gt=new Rl({visible:!1});if(vt.current=new rr(new Ws(rt.current.x-dt.current.x,rt.current.y-dt.current.y,rt.current.z-dt.current.z),gt),vt.current.position.set((rt.current.x+dt.current.x)/2,(rt.current.y+dt.current.y)/2,(rt.current.z+dt.current.z)/2),Km(),SR){let St=SR;St=="CCF"&&z0({filepath:n+"/data/FBX/outline-CCF.FBX",index:"outline",color:"#327DFF",opacity:.3,offsetZ:0,R:.01,callback:function(){}},Ut),St=="WHS"&&z0({filepath:n+"/data/FBX/outline-WHS.FBX",index:"outline",color:"#327DFF",opacity:.3,offsetZ:0,R:.01,callback:function(){}},Ut)}},[]),C.useEffect(()=>{Le.current=(f==null?void 0:f.domElement.clientWidth)-1,Be.current=(f==null?void 0:f.domElement.clientHeight)-1},[f==null?void 0:f.domElement.clientWidth]),C.useEffect(()=>{const Te=new vs;Te.expandByObject(fe.current);const qe=R.current(Te.min.clone()),Je=R.current(Te.max.clone());let gt=new Bp(yn(650,620,`${qe.x.toFixed(2)},${qe.y.toFixed(2)},${qe.z.toFixed(2)}`,"#ccc")),St=new Uh(new Zf({map:gt}));St.name="startText";let Qt=new Bp(yn(650,620,`${Je.x.toFixed(2)},${Je.y.toFixed(2)},${Je.z.toFixed(2)}`,"#ccc")),Yt=new Uh(new Zf({map:Qt}));Yt.name="endText",St.position.set(Te.min.x,Te.min.y+.2,Te.min.z),Yt.position.set(Te.max.x,Te.max.y+.6,Te.max.z);let hn=Ae.current.getObjectByName("startText"),ln=Ae.current.getObjectByName("endText");hn&&ln&&(Ae.current.remove(hn,ln),Ae.current.add(St,Yt))},[ie]),C.useEffect(()=>{var ur,Yn;let Te={},qe=[],Je=[],gt={},St=[],Qt=[],Yt,hn=new URL(window.location.href),ln=new URLSearchParams(hn.search);if(ye&&De.length>0){if(Yt=Se&&Bc(De,Se),Se==""){_.current.removeFBX(Ss.current,!0);const Br=_.current.checkedKeys.current.findIndex(Gn=>Gn===Ss.current);Br>-1&&_.current.checkedKeys.current.splice(Br,1),Se==""&&(Ss.current="");const Sr=JSON.stringify(_.current.checkedKeys.current);ln.set("regionsChecked",Sr),hn.search=ln.toString(),window.history.replaceState({},"",hn)}if(Se!=""){if(Yt==null&&Se)if(Se=="fiber tract fiber tracts")Yt="fiber tract";else{let Br=Se.match(/^[\w\/]+/);Yt=Br?Br[0]:""}if(Yt){let Br=((ur=ye[Yt])==null?void 0:ur.soma)||[];St=St.concat(Br);let Sr=((Yn=ye[Yt])==null?void 0:Yn.axon)||[];Qt=Qt.concat(Sr),St=Array.from(new Set(St)),Qt=Array.from(new Set(Qt)),Qt&&Qt.forEach(bi=>{var Ua,es,Zr;for(const Ki in ye)(es=(Ua=ye[Ki])==null?void 0:Ua.soma)!=null&&es.includes(bi)&&((Zr=ye[Ki])==null?void 0:Zr.id)==1&&(Ki in Te?Te[Ki].includes(bi)||Te[Ki].push(bi):Te[Ki]=[bi])}),St&&St.forEach(bi=>{var Ua,es,Zr;for(const Ki in ye)(es=(Ua=ye[Ki])==null?void 0:Ua.axon)!=null&&es.includes(bi)&&((Zr=ye[Ki])==null?void 0:Zr.id)==1&&(Ki in gt?gt[Ki].includes(bi)||gt[Ki].push(bi):gt[Ki]=[bi])});for(let bi in gt)if(bi!=Yt){let Ua=Vo(De,bi.replace("_","/"));Ua&&Je.push({name:bi.replace("_","/"),itemStyle:{color:Ua.color},lineStyle:{color:"#ccc"},value:gt[bi].length})}for(let bi in Te)if(bi!=Yt){let Ua=Vo(De,bi.replace("_","/"));Ua&&qe.push({name:bi.replace("_","/"),itemStyle:{color:Ua.color},lineStyle:{color:"#ccc"},value:Te[bi].length})}bo(!0);let Gn=Vo(De,Yt.replace("_","/"));const dr=[{name:Yt.replace("_","/"),itemStyle:{color:Gn&&Gn.color},lineStyle:{color:"#ccc"},children:qe}],Kn=[{name:Yt.replace("_","/"),itemStyle:{color:Gn&&Gn.color},lineStyle:{color:"#ccc"},children:Je}];if(Ss.current!=Yt){_.current.removeFBX(Ss.current,!0);const bi=_.current.checkedKeys.current.findIndex(Zr=>Zr===Ss.current);bi>-1&&_.current.checkedKeys.current.splice(bi,1);const Ua=Vo(_.current.treeDatas,Yt.replace("_","/"));let es=n+"/data/FBX/"+Yt+".FBX";Ua&&Qu(es,Yt,Ua.color,.8,0,"FBX"),_.current.checkedKeys.current.push(Yt),ne(_.current.checkedKeys.current),Ss.current=Yt,ln.set("echart_Value",Se||""),hn.search=ln.toString(),window.history.replaceState({},"",hn)}const ta={series:[{type:"tree",top:"1%",bottom:"1%",symbolSize:7,emphasis:{focus:"ancestor",lineStyle:{color:"#000"}},expandAndCollapse:!0,animationDuration:550,animationDurationUpdate:750}]};if(xs.current&&Cs.current){Cs.current.style.height=Je.length*2*10+"px",xs.current.style.height=qe.length*2*10+"px";const bi=V7(xs.current);bi.setOption({...ta,tooltip:{trigger:"item",triggerOn:"mousemove",position:function(hi,mc,hd,ic,mh){const Nd=hi[0],gx=hi[1];return[Nd+10,gx]},formatter:function(hi){const mc=Yt==hi.name?"":hi.name+"->",hd=hi.value?", "+hi.value+" neurons":"";return`${mc}${Yt}${hd}`}},series:[{...ta.series[0],left:"30%",right:"30%",label:{position:"right",verticalAlign:"middle",align:"left"},leaves:{label:{position:"left",verticalAlign:"middle",align:"right"}},orient:"RL",data:dr}]});const Ua=V7(Cs.current);Ua.setOption({...ta,tooltip:{trigger:"item",triggerOn:"mousemove",position:function(hi,mc,hd,ic,mh){const Nd=hi[0],gx=hi[1],FI=mh.contentSize[0];return[Nd-FI-10,gx]},formatter:function(hi){const mc=Yt==hi.name?"":"->"+hi.name+", "+hi.value+" neurons";return`${Yt}${mc}`}},series:[{...ta.series[0],left:"20%",right:"40%",label:{position:"left",verticalAlign:"middle",align:"right"},leaves:{label:{position:"right",verticalAlign:"middle",align:"left"}},orient:"LR",data:Kn}]});const es=()=>{bi.resize(),Ua.resize()},Zr=hi=>{if(oe(Ct.indexOf("neurons")+1),xe.current.ProcessedData.current=!1,hi.data&&hi.data.name){xe.current.setSearchValue(Yt.replace("_","/")),xe.current.setSomaValue(hi.data.name.replace("_","/"));const mc=vc(dr[0],hi.data.name);bi.setOption({series:[{data:[mc]}]}),Ua.setOption({series:[{data:Kn}]})}},Ki=hi=>{if(oe(Ct.indexOf("neurons")+1),xe.current.ProcessedData.current=!1,hi.data&&hi.data.name){xe.current.setSearchValue(hi.data.name.replace("_","/")),xe.current.setSomaValue(Yt.replace("_","/"));const mc=vc(Kn[0],hi.data.name);Ua.setOption({series:[{data:[mc]}]}),bi.setOption({series:[{data:dr}]})}};return window.addEventListener("resize",es),bi.on("click",Zr),Ua.on("click",Ki),dr[0].children[0]&&Zr({data:{name:dr[0].children[0].name}}),Dl({Upstream:qe,Downstream:Je}),()=>{bi.off("click",Zr),Ua.off("click",Ki),window.removeEventListener("resize",es),bi.dispose(),Ua.dispose()}}}}else bo(!1),Cs.current&&xs.current&&(Cs.current.style.height="0px",xs.current.style.height="0px"),Dl({})}},[Se,De,ye]),C.useEffect(()=>{const Te=$o("index"),qe=$o("type"),Je=(Te||qe)&&pl.current;if(q===2)pl.current?(Qo(2,!0,!Je),pl.current=!1):Qo(2),rn(!0),h.current.noRotate=!0,h.current.noPan=!0,f.domElement.addEventListener("mousedown",Xo),f.domElement.addEventListener("mousemove",Cp),f.domElement.addEventListener("mouseup",qE),j(1);else{Ae.current.rotation.set(0,0,0),h.current.noRotate=!1,h.current.noPan=!1,f.domElement.removeEventListener("mousedown",Xo),f.domElement.removeEventListener("mousemove",Cp),f.domElement.removeEventListener("mouseup",qE),j(3),Sv(),pl.current?(Qo(1,!0,!Je),pl.current=!1):Qo(1),z(!1);const gt=Ae.current.getObjectByName("targetPoint");gt&&Ae.current.remove(gt)}},[q]),C.useEffect(()=>{Qn.length>0&&io(!0)},[Qn]);const tc=Te=>{const{positionx:qe,positiony:Je,positionz:gt}=Te;let St=new URL(window.location.href),Yt=new URLSearchParams(St.search).get("atlasReslicingInfo"),hn={};Yt&&(hn=JSON.parse(Yt)),Ge(qe),Nt(Je),kt(gt),hn.positionX=qe,hn.positionY=Je,hn.positionZ=gt;let ln=new Ie(qe,Je,gt);La.atlasReslicingInfo=hn,La.sectionPointPosition=ln,is.current&&is.current.position.set(ln.x,ln.y,ln.z)},Gu=Te=>{Dr(Te)},Qo=(Te,qe=!1,Je=!0)=>{if(Ae.current.remove(is.current),tr(Te),ue({}),it(0),q===0&&Te=="1"?rc("0",Je,qe):rc(Te,Je,qe),qe||(Te=="7"||Te=="3"?QE(!0):QE(!1)),x&&(x.current=Te),Te!==2){const ta=Ae.current.getObjectByName("syrings");ta&&Ae.current.remove(ta),z(!1),qe||D()}if(Te==2){Ai.current.position.set(18,-10,-10),Ai.current.rotation.set(2.9896,0,0),h.current.reset(),h.current.target.set(0,0,0),h.current.object.position.set(18,-10,-10),h.current.object.up.set(0,-1,0),h.current.update(),Ai.current.updateMatrixWorld();const ta=JSON.stringify({cameraPosition:Ai.current.position,cameraRotation:Ai.current.rotation}),bi=JSON.stringify({controlsTarget:h.current.target,controlsPosition:h.current.object.position,controlsUp:h.current.object.up});let Ua=new URL(window.location.href),es=new URLSearchParams(Ua.search);es.set("cameraInfo",ta),es.set("controllerInfo",bi),Ua.search=es.toString(),window.history.replaceState({},"",Ua)}Km(),Pr([]),Zt("Config_DAPI.ini"),$e.current=null,xa({}),qe||re.current&&xe.current&&_.current&&(re.current.removeALL(),xe.current.removeALL(),_.current.removeALL()),Te==1?w(!0):w(!1),Zi.current&&(Zi.current.textContent=a("4000.0208")||"选择靶点"),c!=null&&c.current&&(c.current=""),u.current&&(u.current=""),y.current=!1,d.current=!1;const gt=Ae.current.getObjectByName("sphereBig"),St=Ae.current.getObjectByName("sphereMiddelClick"),Qt=Ae.current.getObjectByName("dashedLine"),Yt=Ae.current.getObjectByName("Line"),hn=Ae.current.getObjectByName("transformControls"),ln=Ae.current.getObjectByName("sectionSphere"),ur=Ae.current.getObjectByName("correspondingPlaneDataSwc"),Yn=[];Ae.current.traverse(ta=>{ta.userData.isAtlasMapping==="true"&&Yn.push(ta)}),Yn.forEach(ta=>{Ae.current.remove(ta)}),ur&&Ae.current.remove(ur),ln&&Ae.current.remove(ln),hn&&Ae.current.remove(hn),m.current=[],b.current=[],Qt&&Ae.current.remove(Qt),Yt&&Ae.current.remove(Yt),gt&&Ae.current.remove(gt),St&&Ae.current.remove(St);const Br=Ae.current.children.filter(ta=>ta.userData.name==="registrationPng");Br&&Ae.current.remove(...Br),B.current=!1,P(!1);const Sr=Ae.current.getObjectByName("HorizontalView"),Gn=Ae.current.getObjectByName("SagittalView"),dr=Ae.current.getObjectByName("arbitrarySlice"),Kn=Ae.current.getObjectByName("CoronalView");Te!=3&&(Sr&&(Ae.current.remove(Sr),Wn(!1)),Gn&&(Ae.current.remove(Gn),Zn(!1)),dr&&(Ae.current.remove(dr),er(!1)),Kn&&(Ae.current.remove(Kn),Sn(!1))),Te==3&&setTimeout(()=>{mi(gi.current,qe)},10),fx()},lu=Te=>{r(Te),i.current=Te},vc=(Te,qe)=>{const Je=JSON.parse(JSON.stringify(Te)),gt=St=>{St.name===qe?St.lineStyle.color="#000":St.lineStyle.color="#ccc",St.children&&St.children.forEach(Qt=>{gt(Qt)})};return gt(Je),Je},Bc=(Te,qe)=>{for(let Je of Te){if(Je.name.toLowerCase()===qe.toLowerCase()||Je.fullname.toLowerCase()===qe.toLowerCase())return Je.name;if(Je.children){const gt=Bc(Je.children,qe);if(gt)return gt}}return null},ju=()=>{y.current=!y.current,d.current=!1,g.current&&Ae.current.remove(g.current)},E=()=>{if(Zi.current)if(Zi.current.textContent==(a("4000.0208")||"选择靶点"))Zi.current.textContent=a("4000.0242")||"清除靶点";else if(Zi.current.textContent===(a("4000.0126")||"重置"))on(0),V.current="",Zi.current.textContent=a("4000.0208")||"选择靶点",z(!1),D(),j(1);else{Zi.current.textContent=a("4000.0208")||"选择靶点",m.current=[],b.current=[],z(!1);const Te=Ae.current.getObjectByName("dashedLine"),qe=Ae.current.getObjectByName("sphereBig"),Je=Ae.current.getObjectByName("sphereMiddelClick"),gt=Ae.current.getObjectByName("targetPoint");Te&&qe&&Ae.current.remove(Te,qe),Je&&Ae.current.remove(Je),gt&&Ae.current.remove(gt),d.current=!1}ju()};C.useEffect(()=>{G&&xt==0&&gn(!0),xt!=0&&G&&Zi&&(Zi.current.textContent=a("4000.0126")||"重置")},[G]);const D=()=>{m.current=[],b.current=[];const Te=Ae.current.getObjectByName("dashedLine"),qe=Ae.current.getObjectByName("sphereBig"),Je=Ae.current.getObjectByName("sphereMiddelClick"),gt=Ae.current.getObjectByName("targetPoint");Te&&qe&&Ae.current.remove(Te,qe),Je&&Ae.current.remove(Je),gt&&Ae.current.remove(gt),Sv(),P(!1),W.current=[],y.current=!0,d.current=!1,B.current=!1,_.current.removeALL(),g.current&&Ae.current.remove(g.current),oe(1),c!=null&&c.current&&(c.current=""),u.current&&(u.current="")};function X(){if(!ka.current||!ka.current.startsWith("data:image/png;base64,")){alert("Please enter a valid Base64 encoded PNG string (e.g., data:image/png;base64,...).");return}const Te=document.createElement("a");Te.href=ka.current,Te.download="downloaded_image.png";const qe=document.createElement("a");qe.href="/staticresource/data/json/rgb_value.zip",qe.download="rgb_value.zip",document.body.appendChild(qe),document.body.appendChild(Te),qe.click(),setTimeout(()=>{Te.click()},200),document.body.removeChild(qe),document.body.removeChild(Te)}const le=(Te,qe)=>{clearTimeout(Wl.current),Wl.current=setTimeout(()=>{const Je=Ae.current.getObjectByName("Brain");let gt=new fo;gt.setFromAxisAngle(new Ie(1,0,0),Math.PI/2);let St=new Ie,Qt=new Rb;if(qe)if(Je&&(St=qe.position.clone().applyMatrix4(Je.matrixWorld.clone().invert()).applyQuaternion(gt)),Te==1)fetch("/app-api/c-api/slicing",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({x:0,y:0,z:St.z})}).then(Yt=>Yt.ok?Yt.json():Us.error({title:Yt.message})).then(Yt=>{const hn=Yt.base64;ka.current=hn;let ln=Qt.load(hn);ln.center.set(.5,.5),ln.rotation=Math.PI,qe.material.map=ln});else if(Te==2)fetch("/app-api/c-api/slicing",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({x:St.x,y:0,z:0})}).then(Yt=>Yt.ok?Yt.json():Us.error({title:Yt.message})).then(Yt=>{const hn=Yt.base64;let ln=Qt.load(hn);const Yn=qe.geometry.attributes.uv.array,Br=Gn=>{Yn[Gn+0]=1,Yn[Gn+1]=0,Yn[Gn+2]=1,Yn[Gn+3]=1,Yn[Gn+4]=0,Yn[Gn+5]=0,Yn[Gn+6]=0,Yn[Gn+7]=1},Sr=Gn=>{Yn[Gn+0]=1,Yn[Gn+1]=1,Yn[Gn+2]=1,Yn[Gn+3]=0,Yn[Gn+4]=0,Yn[Gn+5]=1,Yn[Gn+6]=0,Yn[Gn+7]=0};Br(0),Sr(8),qe.geometry.attributes.uv.needsUpdate=!0,qe.material.map=ln});else if(Te==3)fetch("/app-api/c-api/slicing",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({x:0,y:St.y,z:0})}).then(Yt=>(Yt.ok,Yt.json())).then(Yt=>{if(Yt.message){Us.error({content:Yt.message});return}const hn=Yt.base64;ka.current=hn;let ln=Qt.load(hn);const Yn=qe.geometry.attributes.uv.array;(Sr=>{Yn[Sr+0]=1,Yn[Sr+1]=0,Yn[Sr+2]=0,Yn[Sr+3]=0,Yn[Sr+4]=1,Yn[Sr+5]=1,Yn[Sr+6]=0,Yn[Sr+7]=1})(24),qe.geometry.attributes.uv.needsUpdate=!0,qe.material.map=ln});else{const Yt=qe.rotation.x/Math.PI*180,hn=qe.rotation.y/Math.PI*180,ln=qe.rotation.z/Math.PI*180;fetch("/app-api/c-api/slicing",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({angles:[Yt,hn,ln],center:[St.x,St.y,St.z]})}).then(ur=>ur.ok?ur.json():Us.error({title:ur.message})).then(ur=>{const Yn=ur.base64;ka.current=Yn;let Br=Qt.load(Yn);const Gn=qe.geometry.attributes.uv.array;(Kn=>{Gn[Kn+0]=0,Gn[Kn+1]=0,Gn[Kn+2]=1,Gn[Kn+3]=0,Gn[Kn+4]=0,Gn[Kn+5]=1,Gn[Kn+6]=1,Gn[Kn+7]=1})(24),qe.geometry.attributes.uv.needsUpdate=!0,qe.material.map=Br})}},100)},Ce=(Te,qe)=>{let Je,gt=0,St=new URL(window.location.href),Yt=new URLSearchParams(St.search).get("atlasReslicingInfo"),hn={};Yt&&(hn=JSON.parse(Yt)),gi.current==1?(Ae.current.children.forEach(function(ln,ur){qe==3&&ln.name=="CoronalView"&&(gt=ur)}),Je=new Ie(0,0,Te),Ae.current.children[gt].position.setZ(Je.z),le(gi.current,Ae.current.children[gt])):gi.current==2?(Ae.current.children.forEach(function(ln,ur){qe==1&&ln.name=="SagittalView"&&(gt=ur)}),Je=new Ie(Te,0,0),Ae.current.children[gt].position.setX(Je.x),le(gi.current,Ae.current.children[gt])):gi.current==3?(Ae.current.children.forEach(function(ln,ur){qe==2&&ln.name=="HorizontalView"&&(gt=ur)}),Je=new Ie(0,Te,0),Ae.current.children[gt].position.setY(Je.y),le(gi.current,Ae.current.children[gt])):gi.current==4&&(Ae.current.children.forEach(function(ln,ur){ln.name=="arbitrarySlice"&&(gt=ur)}),qe==3&&(kt(Te),hn.positionZ=Te,La.atlasReslicingInfo=hn,Je=new Ie(ar,At,Te),Ae.current.children[gt].position.setZ(Je.z)),qe==2&&(Nt(Te),hn.positionY=Te,La.atlasReslicingInfo=hn,Je=new Ie(Ft,Te,Ft),Ae.current.children[gt].position.setY(Je.y)),qe==1&&(Ge(Te),hn.positionX=Te,La.atlasReslicingInfo=hn,Je=new Ie(Te,At,Ft),Ae.current.children[gt].position.setX(Je.x)),le(gi.current,Ae.current.children[gt]))},Ye=Te=>{let qe=new URL(window.location.href),gt=new URLSearchParams(qe.search).get("atlasReslicingInfo"),St={};gt&&(St=JSON.parse(gt)),gi.current==2&&(Ge(Te),Nt(-5.33),kt(-8),Ce(Te,1),St.positionX=Te,St.positionY=-5.33,St.positionZ=-8,La.atlasReslicingInfo=St),gi.current==4&&Ce(Te,1)},Ot=Te=>{let qe=new URL(window.location.href),gt=new URLSearchParams(qe.search).get("atlasReslicingInfo"),St={};gt&&(St=JSON.parse(gt)),gi.current==3&&(Nt(Te),kt(-8),Ge(-5.17),St.positionX=-5.17,St.positionY=Te,St.positionZ=-8,La.atlasReslicingInfo=St,Ce(Te,2)),gi.current==4&&Ce(Te,2)},tn=Te=>{let qe=new URL(window.location.href),gt=new URLSearchParams(qe.search).get("atlasReslicingInfo"),St={};gt&&(St=JSON.parse(gt)),gi.current==1&&(kt(Te),Ge(-5.17),Nt(-5.33),Ce(Te,3),St.positionX=-5.17,St.positionY=-5.33,St.positionZ=Te,La.atlasReslicingInfo=St),gi.current==4&&Ce(Te,3)},pn=(Te,qe)=>{let Je=0,gt=new URL(window.location.href),Qt=new URLSearchParams(gt.search).get("atlasReslicingInfo"),Yt={};Qt&&(Yt=JSON.parse(Qt)),Ae.current.children.forEach(function(Br,Sr){Br.name=="arbitrarySlice"&&(Je=Sr)});let hn=Ae.current.children[Je];hn.rotation.set(hn.userData.initRotation.x,hn.userData.initRotation.y,hn.userData.initRotation.z);let ln=0,ur=0,Yn=0;qe==1&&(dn(Te),Yt.angleX=Te,La.atlasReslicingInfo=Yt,ln=Te*Math.PI/180,ur=Xn*Math.PI/180,Yn=Or*Math.PI/180),qe==2&&(cr(Te),Yt.angleY=Te,La.atlasReslicingInfo=Yt,ln=Rn*Math.PI/180,ur=Te*Math.PI/180,Yn=Or*Math.PI/180),qe==3&&(Bn(Te),Yt.angleZ=Te,La.atlasReslicingInfo=Yt,ln=Rn*Math.PI/180,ur=Xn*Math.PI/180,Yn=Te*Math.PI/180),hn.rotation.x=ln,hn.rotation.y=ur,hn.rotation.z=Yn,Ae.current.children.forEach(function(Br,Sr){Br.name=="arbitrarySlice"&&(Je=Sr)}),le(gi.current,Ae.current.children[Je])},Jn=(Te,qe=!1)=>{let Je;const gt=Te||o;if(gi.current==4||qe)setTimeout(()=>{let St="atlas.brainsmatics.org",Qt=[],Yt=parseInt(((Ft+8)/14*14e3).toString()),hn=parseInt(((At+5.33)/7.37*9e3).toString());qe?(Qt[0]=90+zi.angles[0],Qt[1]=zi.angles[1],Qt[2]=zi.angles[2],Yt=zi.tx*14e3,hn=450):(Qt[0]=Rn,Qt[1]=Xn,Qt[2]=Or);let ln=parseInt(((ar+5.17)/10.34*11400).toString()),ur=ke||"http://"+St,Yn="http://"+St+'/program/frontend/#!{"dimensions":{"x":[0.000001,"m"],"y":[0.000001,"m"],"z":[0.000001,"m"]},"position":['+ln+","+hn+","+Yt+'],"crossSectionOrientation":[0.7071067690849304,0,0,-0.7071067690849304],"crossSectionScale":19.05662684586283,"projectionOrientation":[0.10079027712345123,0.01086505874991417,-0.5527856945991516,-0.827134370803833],"projectionScale":74319.80669416502,"projectionDepth":-49.99956451007631,"layers":[{"type":"image","source":{"url":"precomputed://'+ur+'/data/RGB_raw","transform":{"outputDimensions":{"x":[0.000001,"m"],"y":[0.000001,"m"],"z":[0.000001,"m"],"c^":[1,""]},"inputDimensions":{"x":[0.000001,"m"],"y":[0.000001,"m"],"z":[0.000001,"m"],"c^":[1,""]}}},"tab":"rendering","shader":"#uicontrol invlerp normalized\\nvoid main() {\\n emitRGB(vec3(toNormalized(getDataValue(0)),\\n toNormalized(getDataValue(1)),\\n toNormalized(getDataValue(2))));\\n}\\n","channelDimensions":{"c^":[1,""]},"name":"raw"},{"type":"segmentation","source":{"url":"precomputed://'+ur+'/data/seg_half","transform":{"outputDimensions":{"x":[0.000001,"m"],"y":[0.000001,"m"],"z":[0.000001,"m"]},"inputDimensions":{"x":[0.00001,"m"],"y":[0.00001,"m"],"z":[0.00001,"m"]}}},"tab":"segments","segments":["10","100","1000","1002","1004","1005","1006","1007","1008","1009","1010","1011","1012","1013","1014","1015","1016","1017","1018","1019","1020","1021","1022","1023","1024","1025","1026","1100","104","105","106","107","108","11","110","111","112","113","114","115","117","118","119","12","120","122","123","124","125","126","129","13","130","131","134","138","14","141","142","143","146","147","149","15","150","152","154","156","159","16","160","162","164","165","166","167","168","170","172","173","174","176","177","178","179","18","180","181","182","183","186","189","19","190","192","193","194","195","196","199","2","20","201","202","203","204","206","207","208","21","212","215","216","217","219","22","220","221","223","224","225","228","229","23","230","231","232","234","235","236","237","238","239","24","241","242","243","245","246","247","248","25","250","251","253","254","256","257","259","26","260","265","266","267","268","27","271","272","273","275","276","279","28","280","282","283","284","287","29","291","293","294","295","296","297","298","3","30","300","303","304","305","306","31","311","312","313","315","319","32","320","321","322","323","324","325","326","329","33","330","331","332","333","335","336","337","338","34","340","341","342","343","344","347","348","349","35","350","351","352","354","355","356","357","359","36","361","362","365","366","367","368","369","37","371","372","373","374","375","376","377","378","38","380","385","386","387","389","39","390","391","392","393","394","395","397","399","4","40","401","402","405","407","409","41","412","413","414","415","416","417","419","42","422","423","424","426","427","428","43","430","432","435","438","439","44","440","441","442","443","444","445","446","449","45","450","451","452","453","454","456","458","459","46","460","461","462","463","464","465","466","467","47","470","473","474","475","476","478","479","48","480","481","484","485","486","487","488","49","490","491","493","494","497","498","499","5","50","500","501","503","504","505","507","508","51","510","511","512","513","514","516","517","518","519","52","520","528","529","53","533","535","536","537","538","539","54","540","541","542","544","545","546","548","549","55","550","553","554","555","556","557","559","56","561","562","563","565","568","57","570","571","572","573","574","575","576","578","579","58","581","582","584","586","59","591","593","594","595","597","599","6","60","601","602","604","606","61","611","612","613","614","615","616","617","618","619","62","620","621","622","623","624","625","627","628","629","63","631","632","635","637","638","639","64","641","642","643","644","645","646","647","648","65","650","652","653","656","657","658","660","661","662","665","666","667","67","671","672","673","674","677","678","679","68","680","681","682","683","684","686","687","688","690","693","695","696","697","698","699","7","701","702","704","706","707","708","709","710","711","712","713","716","717","72","720","721","722","724","725","727","729","731","733","734","735","736","737","74","740","744","746","748","749","750","752","754","755","757","758","759","76","760","762","763","764","765","767","768","769","770","771","772","773","774","775","776","778","779","78","780","783","784","785","787","789","790","791","793","796","797","798","799","8","80","803","804","808","809","81","810","812","816","818","819","82","821","823","824","826","827","829","83","830","831","832","834","835","837","839","84","840","841","842","843","844","846","849","850","851","855","856","857","858","86","861","863","864","865","867","868","869","87","870","871","872","874","875","876","877","878","879","88","880","881","883","885","888","889","89","892","893","894","895","896","898","899","9","90","901","902","906","908","909","91","911","913","915","916","917","919","92","920","921","925","926","927","928","929","93","931","934","935","936","937","938","940","941","942","944","945","946","951","953","954","955","956","957","959","96","963","964","965","966","969","97","970","971","972","973","977","978","980","981","982","983","989","99","991","992","993","995","996","997","998","999"],"segmentQuery":"<id","segmentColors":{"2":"#777b7b","3":"#777979","4":"#848989","5":"#8e9494","6":"#8c9191","7":"#778383","8":"#778181","9":"#93a2a2","10":"#5e6767","11":"#93c1c1","12":"#6b7474","13":"#93c0c0","14":"#8eacac","15":"#727979","16":"#91afaf","18":"#93b4b4","19":"#729c9c","20":"#212d2d","21":"#304242","22":"#2d3e3e","23":"#2b3232","24":"#1e2929","25":"#707676","26":"#7c8383","27":"#89bbbb","28":"#608383","29":"#7c9d9d","30":"#777d7d","31":"#7a8080","32":"#778080","33":"#7f8585","34":"#6d8a8a","35":"#829d9d","36":"#545d5d","37":"#93a4a4","38":"#4c5454","39":"#474f4f","40":"#8cbebe","41":"#7a9a9a","42":"#93b8b8","43":"#84a0a0","44":"#93a1a1","45":"#93baba","46":"#84b4b4","47":"#6d9595","48":"#82b0b0","49":"#6b9191","50":"#7fadad","51":"#87a3a3","52":"#636c6c","53":"#596363","54":"#334545","55":"#2b3b3b","56":"#666f6f","57":"#476161","58":"#939898","59":"#637e7e","60":"#7aa0a0","61":"#7fa5a5","62":"#444d4d","63":"#f2bb3a","64":"#77d1ff","65":"#3ddeff","67":"#2cc15e","68":"#ffd877","72":"#ffbfad","74":"#e5d60b","76":"#40c3dd","78":"#f7e1af","80":"#3bdddd","81":"#a0dfff","82":"#d67259","83":"#ffab93","84":"#f2c04b","86":"#91503f","87":"#3cabc1","88":"#3db4cc","89":"#f7d585","90":"#723f32","91":"#ffb49e","92":"#f4cf53","93":"#ffbf0f","96":"#f2dca7","97":"#e2d92f","99":"#f4d05a","100":"#399eb2","104":"#4dcc77","105":"#f7da96","106":"#d35dac","107":"#ffd15e","108":"#3cd1d1","110":"#55ccb8","111":"#3aa2b7","112":"#bc782f","113":"#8cccc1","114":"#f7d68a","115":"#82ccbf","117":"#6acc8a","118":"#b2af07","119":"#ffd044","120":"#75d1ff","122":"#ef8064","123":"#37dbfc","124":"#c6499d","125":"#66cbff","126":"#ffc32d","129":"#66ccbb","130":"#f7dea3","131":"#fc957b","134":"#ffb5a0","138":"#84493a","141":"#8accc1","142":"#e5d609","143":"#45d9f7","146":"#d8cb17","147":"#f2dca4","149":"#d1ca06","150":"#ce8333","152":"#67afa3","154":"#f2bd43","156":"#ffcf3f","159":"#f79279","160":"#f29d43","162":"#e5d604","164":"#b2af01","165":"#75e5e5","166":"#ffc83f","167":"#ffbdaa","168":"#74c4ed","170":"#ccc50c","172":"#ffa78e","173":"#42cae5","174":"#a2dcf9","176":"#af702b","177":"#965342","178":"#f4bc04","179":"#51cc7a","180":"#d68733","181":"#3ac4e0","182":"#ffc021","183":"#f7d483","186":"#f2dda9","189":"#3eb766","190":"#72ccbd","192":"#f4927a","193":"#f7dc9e","194":"#d1ca04","195":"#fc976c","196":"#fc67ca","199":"#52e5e5","201":"#ffd366","202":"#ffca2d","203":"#ed9436","204":"#ffe7a0","206":"#74ccbd","207":"#33cc66","208":"#36d9f9","212":"#71e2e2","215":"#edd39c","216":"#d38634","217":"#ed9b44","219":"#ccc345","220":"#60e5e5","221":"#c96b54","223":"#ccc62a","224":"#34d0ef","225":"#ffd454","228":"#ea9a44","229":"#f4cf55","230":"#3bcece","231":"#a85c4a","232":"#ffad96","234":"#ffd97a","235":"#ffda7f","236":"#ffc61c","237":"#c6c00d","238":"#f2b935","239":"#ffc107","241":"#ffdf89","242":"#64e5e5","243":"#edca80","245":"#ccc863","246":"#ea7d62","247":"#c9489e","248":"#3fdbdb","250":"#edd5a3","251":"#2bc45e","253":"#ffca44","254":"#f7d380","256":"#ffc832","257":"#f7e0aa","259":"#ffd351","260":"#6bb6db","265":"#d8cb15","266":"#37cc68","267":"#378c9e","268":"#38c9b1","271":"#6bbaad","272":"#39c2dd","273":"#ffc32b","275":"#37ccb3","276":"#3fc1db","279":"#eab94f","280":"#eab84b","282":"#d37158","283":"#38c4c4","284":"#ffdb82","287":"#f7d588","291":"#f9be48","293":"#f49369","294":"#d149a3","295":"#f4cc49","296":"#63a096","297":"#ffe69e","298":"#ff9b70","300":"#f7a27e","303":"#f7a042","304":"#ccc241","305":"#88ccc0","306":"#eaba52","311":"#34ceed","312":"#d8cc1e","313":"#91daff","315":"#f9c04d","319":"#ff996d","320":"#4be5e5","321":"#ffcdbf","322":"#ddd75a","323":"#ffd263","324":"#e0785e","325":"#70e0e0","326":"#ffcf42","329":"#a4defc","330":"#69b2a6","331":"#67a1bf","332":"#57cc7e","333":"#ffbf11","335":"#ea8e77","336":"#ffc73a","337":"#76c9f2","338":"#7f4638","340":"#c16953","341":"#46defc","342":"#f7e1ad","343":"#68aed1","344":"#ff9367","347":"#c4be0d","348":"#6ab7aa","349":"#ffb805","350":"#639bb7","351":"#38bcff","352":"#ed63bf","354":"#f2bc3e","355":"#ffd154","356":"#f2da9d","357":"#e5d606","359":"#9bddff","361":"#ffc311","362":"#ffbb11","365":"#ffa58e","366":"#ffbe1c","367":"#ffb807","368":"#34c8e5","369":"#c1bb0d","371":"#ffbe0c","372":"#a3e0ff","373":"#774234","374":"#3995a8","375":"#d849a9","376":"#3daf63","377":"#ffe8a3","378":"#41cc6f","380":"#ffc823","385":"#ccc751","386":"#5bcc81","387":"#ccc85f","389":"#41bfd8","390":"#36bca6","391":"#edce8b","392":"#54e5e5","393":"#3baa60","394":"#36a9e2","395":"#ef9637","397":"#ffc72d","399":"#68a89d","401":"#ffcc4c","402":"#fc50c3","405":"#3a9aad","407":"#d17057","409":"#77e5e5","412":"#7ee5e5","413":"#b2af05","414":"#67acce","415":"#f2bf48","416":"#c66c55","417":"#5fccb9","419":"#69bfb0","422":"#f265c3","423":"#ffb90a","424":"#41bf6b","426":"#e861bb","427":"#56c6ff","428":"#80ccbf","430":"#389e5a","432":"#ffda7c","435":"#53ccb7","438":"#57e5e5","439":"#f9c252","440":"#ffc416","441":"#ffd259","442":"#6cccbc","443":"#ffa991","444":"#74c4ef","445":"#eadf07","446":"#ffc023","449":"#f7e3b4","450":"#4fcc79","451":"#ffb6a0","452":"#f99c39","453":"#75caf4","454":"#a55b48","456":"#99dcff","458":"#ff976b","459":"#3fcc6e","460":"#ffbd19","461":"#ccc62c","462":"#35d4f4","463":"#76ccbd","464":"#ffd04f","465":"#ccc861","466":"#3aa35d","467":"#ba7b37","470":"#ffe08c","473":"#ff916d","474":"#37bfa8","475":"#efab0b","476":"#ffa187","478":"#66a59b","479":"#efa802","480":"#754033","481":"#ccc859","484":"#6accbb","485":"#3cad62","486":"#f79b38","487":"#b2af08","488":"#f4cb44","490":"#edcf90","491":"#ffcc35","493":"#ccc855","494":"#43cc70","497":"#ea9335","498":"#44e5e5","499":"#edcc84","500":"#ffa791","501":"#39a0b5","503":"#c9c30c","504":"#ffa389","505":"#ffc430","507":"#f9a47f","508":"#63ccba","510":"#f2dfae","511":"#ffd56b","512":"#a35a47","513":"#e89843","514":"#ffd7cc","516":"#5be5e5","517":"#6bc689","518":"#ffc20c","519":"#ccc85d","520":"#3db6ce","528":"#f2da9f","529":"#ffd051","533":"#35cc67","535":"#dd765d","536":"#39a05c","537":"#f2be46","538":"#3fbad3","539":"#77cef9","540":"#3dbeff","541":"#ed9078","542":"#c14799","544":"#9b5544","545":"#8c4d3d","546":"#ffc10a","548":"#f4be0c","549":"#f7e2b2","550":"#3fbfff","553":"#edd49e","554":"#bf6852","555":"#55cc7d","556":"#368a9b","557":"#bc6651","559":"#ffcd4f","561":"#35cae8","562":"#efa907","563":"#ccc347","565":"#3dd3d3","568":"#59ccb8","570":"#ffce54","571":"#39c0db","572":"#e2da31","573":"#f2bb3c","574":"#93dbff","575":"#824739","576":"#e89135","578":"#82e5e5","579":"#68ccff","581":"#ffd256","582":"#ffdf87","584":"#45dbf9","586":"#e08d35","591":"#ffbc05","593":"#ff906b","594":"#84d6ff","595":"#41c16c","597":"#f24fbc","599":"#ddd75f","601":"#ffe18e","602":"#7be5e5","604":"#36c1aa","606":"#ff8e68","611":"#368ea0","612":"#5bc8ff","613":"#79e5e5","614":"#3ba55f","615":"#a5e1ff","616":"#d64aa7","617":"#ffc61e","618":"#3de5e5","619":"#e24ab0","620":"#c6833b","621":"#edcb82","622":"#59c7ff","623":"#3db565","624":"#f9bb3e","625":"#2bbc5b","627":"#ffcb30","628":"#f9a143","629":"#ffc228","631":"#edcd89","632":"#d8cc1c","635":"#efac0e","637":"#7fd4ff","638":"#35d2f2","639":"#ffcd3a","641":"#ffd9ce","642":"#ffbf1e","643":"#eab84d","644":"#ffc9ba","645":"#41ccb4","646":"#f9ba3b","647":"#cec80c","648":"#f4bd09","650":"#3cb1c9","652":"#ffc528","653":"#ce4aa2","656":"#f4bd07","657":"#5dad78","658":"#ff8c66","660":"#ffbba8","661":"#79d0fc","662":"#ffd559","665":"#ffe69b","666":"#ffd456","667":"#ffca47","671":"#f9c14f","672":"#7a4335","673":"#ffbd0a","674":"#ffde84","677":"#f4ca3f","678":"#659fbc","679":"#3ba5ba","680":"#ffa787","681":"#e87c61","682":"#e8a310","683":"#ffc730","684":"#f9bd45","686":"#ba4693","687":"#ba762e","688":"#eade02","690":"#fc9d37","693":"#e8a412","695":"#eadf04","696":"#f4c93d","697":"#ed7f63","698":"#efaa09","699":"#ffcfc1","701":"#ccc349","702":"#ed4eb8","704":"#ffd35b","706":"#2cc960","707":"#d85fb0","708":"#f4c835","709":"#935141","710":"#3fccb4","711":"#ffce3d","712":"#c46a54","713":"#41c5e0","716":"#8cd8ff","717":"#f765c6","720":"#38bed8","721":"#b2af00","722":"#2bbf5d","724":"#b74792","725":"#f2ba37","727":"#37c6af","729":"#f4cd4b","731":"#3fdfff","733":"#67bcae","734":"#43cce8","735":"#49c2ff","736":"#3bcccc","737":"#f2d896","740":"#f4c93a","744":"#edd5a1","746":"#ffc3b2","748":"#4fbff7","749":"#f2d99b","750":"#3cadc4","752":"#84ccc0","754":"#c67e31","755":"#f4cc46","757":"#f29179","758":"#379b59","759":"#ffa382","760":"#f2deab","762":"#ffe8a5","763":"#ddd75d","764":"#bf792f","765":"#f4bc02","767":"#42c0ff","768":"#e58d77","769":"#ffc535","770":"#62e5e5","771":"#5dcc82","772":"#3ca7bc","773":"#f4d15d","774":"#ffc519","775":"#e84cb4","776":"#45cc72","778":"#6cb8dd","779":"#dd8c35","780":"#edd093","783":"#ffc532","784":"#ffb9a5","785":"#ffd65b","787":"#3dccb4","789":"#80e5e5","790":"#649dba","791":"#f49f44","793":"#67afd3","796":"#40e5e5","797":"#f7dda0","798":"#47ccb5","799":"#ccc857","803":"#45ccb5","804":"#ffbd07","808":"#b2458e","809":"#dd4bad","810":"#a8e2ff","812":"#ffa37c","816":"#40bc69","818":"#6eccbc","819":"#68b1d6","821":"#d88934","823":"#44d7f4","824":"#cc5ba6","826":"#4fc4ff","827":"#3ed6d6","829":"#eabb54","830":"#f9b939","831":"#ffc005","832":"#ffd775","834":"#d18534","835":"#ffd260","837":"#c47d31","839":"#39bfbf","840":"#ffcd51","841":"#ffdd82","842":"#bf4897","843":"#e5d602","844":"#49e5e5","846":"#f74fbf","849":"#e88d76","850":"#f4a07c","851":"#ffaf99","855":"#ffc928","856":"#63cbff","857":"#f4d058","858":"#c45aa1","861":"#30cc64","863":"#c95ca5","864":"#ffd059","865":"#47cc73","867":"#f9b834","868":"#edc97b","869":"#ffca2b","870":"#f4c838","871":"#ffc942","872":"#3cb263","874":"#ffb29b","875":"#ffbd16","876":"#f2d898","877":"#ccc62e","878":"#ffd468","879":"#ccc243","880":"#e25fb7","881":"#ffd1c4","883":"#f9937a","885":"#f29837","888":"#e2da34","889":"#379957","892":"#e2795f","893":"#5faf79","894":"#ffc721","895":"#ffc30f","896":"#65a398","898":"#efa904","899":"#4fccb7","901":"#2bc65f","902":"#ffc83d","906":"#5bccb9","908":"#eab748","909":"#ffb39e","911":"#8e4e3e","913":"#ff9f84","915":"#89d7ff","916":"#edd29a","917":"#6ccc8c","919":"#f2c04d","920":"#3dcc6c","921":"#44d1ed","925":"#ce6e56","926":"#d15eaa","927":"#e59744","928":"#fca580","929":"#39c6c6","931":"#6cc98b","934":"#41c8e2","935":"#6bcdff","936":"#ffd147","937":"#874a3b","938":"#5ec9ff","940":"#f49938","941":"#3fba68","942":"#e060b5","944":"#edc97d","945":"#7cccbe","946":"#5caa76","951":"#a05846","953":"#ffc1af","954":"#ffa57f","955":"#ffa58c","956":"#ffc62b","957":"#ffcf56","959":"#50c3fc","963":"#f7dfa8","964":"#db755c","965":"#82d5ff","966":"#ffd34f","969":"#3db0c6","970":"#38bcbc","971":"#54e2ff","972":"#44c0ff","973":"#f7db99","977":"#ffc5b5","978":"#ffba0c","980":"#ffbb0f","981":"#cc8233","982":"#ccc23f","983":"#ffcc32","989":"#ffc935","991":"#db8a34","992":"#ffa584","993":"#f9bd43","995":"#edcf8e","996":"#37baba","997":"#66aacc","998":"#43ccb5","999":"#3eb8d1","1000":"#db5eb1","1002":"#3de2e2","1004":"#37ade8","1005":"#36c4ac","1006":"#d8cc1a","1007":"#54c6ff","1008":"#aa5e4b","1009":"#ef8f77","1010":"#4fc1f9","1011":"#1c2626","1012":"#a5e1ff","1013":"#a5e1ff","1014":"#a5e1ff","1015":"#a5e1ff","1016":"#47cc74","1017":"#47cc75","1018":"#47cc76","1019":"#47cc77","1020":"#47cc78","1021":"#f99c40","1022":"#f99c41","1023":"#ff9368","1024":"#8b51ff","1025":"#8d54ff","1026":"#894fff","1100":"#3ce0e0"},"name":"seg2"}],"showDefaultAnnotations":false,"sliceAngleRotaX":"'+Qt[0]+'","sliceAngleRotaY":"'+Qt[1]+'","sliceAngleRotaZ":"'+Qt[2]+'","selectedLayer":{"visible":true,"layer":"seg2"},"crossSectionBackgroundColor":"#ffffff","projectionBackgroundColor":"#ffffff","layout":"hzkdPanel"}';window.open(Yn,"_blank")},300);else if(gi.current==1)Je=parseInt(((Ft+8)/13.9919970598834*700).toString()),window.open("http://"+zn.current+"/STAM/reference/index.html?lang=en_us&3Dname="+gt+"&inp="+Je+"§ion=coronal");else if(gi.current==2){let St=ar;ar<0&&(St=-ar),Je=parseInt((St/5.17*256).toString()),ar==0&&(Je=1),window.open("http://"+zn.current+"/STAM/reference/index.html?lang=en_us&3Dname="+gt+"&inp="+Je+"§ion=sagittal")}else gi.current==3&&(Je=parseInt(((At+5.33)/7.37*367).toString()),window.open("http://"+zn.current+"/STAM/reference/index.html?lang=en_us&3Dname="+gt+"&inp="+Je+"§ion=horizontal"))},Fr=(Te,qe,Je,gt,St,Qt,Yt,hn,ln,ur,Yn)=>{let Br=new URL(window.location.href),Gn=new URLSearchParams(Br.search).get("atlasReslicingInfo"),dr={};Gn&&(dr=JSON.parse(Gn)),dr.angleX=Te,dr.angleY=qe,dr.angleZ=Je,dr.positionZ=Qt,dr.positionX=gt,dr.positionY=St,dr.translateX=Yt,dr.translateY=hn,dr.translateZ=ln,dr.ButtonDisabled=Yn,dr.rotate=ur,dr.direction1=gi.current,La.atlasReslicingInfo=dr,dn(Te),cr(qe),Bn(Je),kt(Qt),Ge(gt),Nt(St),Vt(Yt),Dn(hn),Rt(ln),Un(ur),xr(Yn)},mi=(Te,qe=!1)=>{Ae.current.remove(is.current);let Je=is.current.position;if(qe&&wR){let St=JSON.parse(wR);Je=new Ie(St.positionX,St.positionY,St.positionZ)}let gt=Te;if(Eu(gt),gt==1){at.current.enabled=!1,Ae.current.remove(at.current),Hl(0),gi.current=1,Fr(90,0,0,-5.17,-5.33,Je.z,!0,!0,!1,!0,!1);const St=Ae.current.getObjectByName("HorizontalView"),Qt=Ae.current.getObjectByName("SagittalView"),Yt=Ae.current.getObjectByName("arbitrarySlice"),hn=Ae.current.getObjectByName("CoronalView");St&&(St.position.y=Je.y,Ae.current.remove(St),Wn(!1)),Qt&&(Qt.position.x=Je.x,Ae.current.remove(Qt),Zn(!1)),Yt&&(Yt.position.set(Je.x,Je.y,Je.z),Ae.current.remove(Yt),er(!1)),hn?(hn.position.z=Je.z,Ae.current.remove(hn),Sn(!1)):Sn(!0)}else if(gt==2){Hl(0),at.current.enabled=!1,Ae.current.remove(at.current),Fr(90,270,0,Je.x,-5.33,-8,!1,!0,!0,!0,!1),gi.current=2;const St=Ae.current.getObjectByName("HorizontalView"),Qt=Ae.current.getObjectByName("SagittalView"),Yt=Ae.current.getObjectByName("arbitrarySlice"),hn=Ae.current.getObjectByName("CoronalView");Qt?(Qt.position.x=Je.x,Ae.current.remove(Qt),Zn(!1)):Zn(!0),St&&(St.position.y=Je.y,Ae.current.remove(St),Wn(!1)),hn&&(hn.position.z=Je.z,Ae.current.remove(hn),Sn(!1)),Yt&&(Yt.position.set(Je.x,Je.y,Je.z),Ae.current.remove(Yt),er(!1))}else if(gt==3){at.current.enabled=!1,Ae.current.remove(at.current),Fr(360,0,0,-5.17,Je.y,-8,!0,!1,!0,!0,!1),gi.current=3,Hl(0);const St=Ae.current.getObjectByName("HorizontalView"),Qt=Ae.current.getObjectByName("SagittalView"),Yt=Ae.current.getObjectByName("arbitrarySlice"),hn=Ae.current.getObjectByName("CoronalView");Qt&&(Qt.position.x=Je.x,Ae.current.remove(Qt),Zn(!1)),hn&&(hn.position.z=Je.z,Ae.current.remove(hn),Sn(!1)),Yt&&(Yt.position.set(Je.x,Je.y,Je.z),Ae.current.remove(Yt),er(!1)),St?(St.position.y=Je.y,Ae.current.remove(St),Wn(!1)):Wn(!0)}else if(gt==4){gi.current=4,Ae.current.remove(at.current),Fr(120,320,270,Je.x,Je.y,Je.z,!1,!1,!1,!1,!1);const St=Ae.current.getObjectByName("HorizontalView"),Qt=Ae.current.getObjectByName("SagittalView"),Yt=Ae.current.getObjectByName("arbitrarySlice"),hn=Ae.current.getObjectByName("CoronalView");Qt&&(Qt.position.x=Je.x,Ae.current.remove(Qt),Zn(!1)),hn&&(hn.position.z=Je.z,Ae.current.remove(hn),Sn(!1)),St&&(St.position.y=Je.y,Ae.current.remove(St),Wn(!1)),Yt?(Yt.position.set(Je.x,Je.y,Je.z),Ae.current.remove(Yt),er(!1)):er(!0)}},Ji=Te=>{var qe=d1(Te,su.current);if(A.includes(Te)){_.current.removeFBX(Te,!0);const Je=_.current.checkedKeys.current.findIndex(Yt=>Yt===Te);Je>-1&&_.current.checkedKeys.current.splice(Je,1),ne(_.current.checkedKeys.current);let gt=new URL(window.location.href),St=new URLSearchParams(gt.search);const Qt=JSON.stringify(_.current.checkedKeys.current);St.set("regionsChecked",Qt),gt.search=St.toString(),window.history.replaceState({},"",gt),_&&_.current.checkedKeys.current.length==0?_.current.setExpandedKeys(_.current.defexpandedKeys.current):qe.forEach(Yt=>{_.current.setExpandedKeys(hn=>hn.filter(ln=>ln!==Yt))})}else if(Te){let Je=Te.replace("/","_");const gt=_.current.fetchColor(Te);if(gt){let St=n+"/data/FBX/"+Je+".FBX";Qu(St,Te,gt,.8,0,"FBX"),_.current.checkedKeys.current.push(Te);const Qt=Array.from(new Set([..._.current.expandedKeys,...qe]));_.current.setExpandedKeys(Qt),ne(_.current.checkedKeys.current);let Yt=new URL(window.location.href),hn=new URLSearchParams(Yt.search);const ln=JSON.stringify(_.current.checkedKeys.current);hn.set("regionsChecked",ln),Yt.search=hn.toString(),window.history.replaceState({},"",Yt)}}Jr({})},as=Te=>{var Je;if(A.includes(Te)){_.current.removeFBX(Te,!0);const gt=_.current.checkedKeys.current.findIndex(hn=>hn===Te);gt>-1&&_.current.checkedKeys.current.splice(gt,1),ne(_.current.checkedKeys.current);let St=new URL(window.location.href),Qt=new URLSearchParams(St.search);const Yt=JSON.stringify(_.current.checkedKeys.current);Qt.set("regionsChecked",Yt),St.search=Qt.toString(),window.history.replaceState({},"",St)}else if(Te){const gt=_.current.fetchColor(Te.replace("_","/"));let St=n+"/data/FBX/"+Te.replace("/","_")+".FBX";Qu(St,Te,gt,.8,0),_.current.checkedKeys.current.push(Te),ne(_.current.checkedKeys.current);let Qt=new URL(window.location.href),Yt=new URLSearchParams(Qt.search);const hn=JSON.stringify(_.current.checkedKeys.current);Yt.set("regionsChecked",hn),Qt.search=Yt.toString(),window.history.replaceState({},"",Qt)}const qe=W.current.findIndex(gt=>gt===Te);qe>-1?W.current.splice(qe,1):W.current.push(Te),(Je=f.domElement)==null||Je.addEventListener("mousemove",se.current,!1)},Co=Te=>{if(Te in xe.current.neurons_line.current){xe.current.removeSWCAll(Te),xe.current.setCheckItems(St=>St.filter(Qt=>Qt!==Te)),xe.current.setPathOpen(St=>St.filter(Qt=>Qt!==Te));let qe=new URL(window.location.href),Je=new URLSearchParams(qe.search);const gt=JSON.stringify(xe.current.checkItems.filter(St=>St!==Te));if(Je.set("neuronsChecked",gt),qe.search=Je.toString(),window.history.replaceState({},"",qe),Te in ve.current){for(let St in ve.current[Te])Ae.current.remove(ve.current[Te][St]);delete ve.current[Te]}}},Hs=()=>{if(!Kt.current){Fo(!0);return}const Te=document.createElement("a");Te.href=n+"/zip/9.8.label.zip",Te.download="9.8.label.zip",Te.click();let qe=new URL(window.location.href),gt=new URLSearchParams(qe.search).get("type");const St=window.location.origin+window.location.pathname+`?type=${gt}`;fetch("/app-api/java-api/brainsweb-service/record/list",{method:"post",body:JSON.stringify({href:St,time:0,key:fn.current})}).then(Qt=>Qt.json()).then(Qt=>{})},Vo=(Te,qe)=>{for(let Je of Te){if(Je.name.toLowerCase()===qe.toLowerCase())return{color:Je.color,path:Je.path,fullname:Je.fullname};if(Je.children){const gt=Vo(Je.children,qe);if(gt)return gt}}return null},Il=(Te,qe)=>{for(let Je of Te){if(Je.name.toLowerCase()===qe.toLowerCase()&&!Je.children)return{color:Je.color,path:Je.path};if(Je.children){const gt=Il(Je.children,qe);if(gt)return gt}}return null},ll=(Te,qe)=>{const Je=[];for(const gt in Te)Te[gt].includes(qe)&&Je.push(gt);return Je},cu=(Te,qe=[])=>{if(Array.isArray(Te))for(let Je of Te)cu(Je,qe);if(typeof Te=="object")if(Te.hasOwnProperty("children"))cu(Te.children,qe);else return Te.name&&qe.push(Te.name),Te.name},uu=(Te,qe,Je=[])=>{if(Array.isArray(Te))for(let gt of Te)uu(gt,qe,Je);typeof Te=="object"&&(Te.hasOwnProperty("children")&&uu(Te.children,qe,Je),Te.name===qe&&(Te.hasOwnProperty("children")?cu(Te.children,Je):Te.name&&Je.push(Te.name)))},gc=Te=>{if(Te in re.current.vesselObj.current){re.current.setCheckItems(St=>St.filter(Qt=>Qt!==Te)),re.current.removeVessel(Te);let qe=new URL(window.location.href),Je=new URLSearchParams(qe.search);const gt=JSON.stringify(re.current.checkItems.filter(St=>St!==Te));Je.set("vesselsChecked",gt),qe.search=Je.toString(),window.history.replaceState({},"",qe)}},cl=Te=>()=>{rs(Te),Pe(Te)};function Zl(Te,qe){return[...new Set([...Te,...qe])]}const Po=Te=>{const qe=[],Je=[];if(re.current&&_.current){const gt=re.current,St=_.current;uu(gt.treeDatas,Te,qe);const Qt=Wa.current.indexOf(Te);if(Qt!==-1){Wa.current.splice(Qt,1),qe.forEach(Yn=>{Je.push(ll(da,Yn))});const Yt=Je.reduce((Yn,Br)=>Zl(Yn,Br),[]);let hn=A;Yt.forEach(Yn=>{Il(St.treeDatas,Yn)!=null&&(hn=hn.filter(Sr=>Sr!==Yn),St.removeFBX(Yn,!0))}),ne(hn);let ln=new URL(window.location.href),ur=new URLSearchParams(ln.search);ur.set("regionsChecked",JSON.stringify(hn)),ln.search=ur.toString(),window.history.replaceState({},"",ln),Wa.current.length===0&&St.setExpandedKeys(St.defexpandedKeys.current)}else{Wa.current.push(Te),qe.forEach(Br=>{Je.push(ll(da,Br))});const Yt=Je.reduce((Br,Sr)=>Zl(Br,Sr),[]),hn=Array.from(new Set([...St.expandedKeys,...Yt]));St.setExpandedKeys(hn);let ln=[...A];Yt.forEach(Br=>{const Sr=Il(St.treeDatas,Br);if(Sr!=null){const Gn=`${n}/data/FBX/${Br}.FBX`;ln.push(Br),St.LoadFBX(Gn,Br,Sr.color,.8,0)}}),ne(ln);let ur=new URL(window.location.href),Yn=new URLSearchParams(ur.search);Yn.set("regionsChecked",JSON.stringify(ln)),ur.search=Yn.toString(),window.history.replaceState({},"",ur)}}},nc=(Te,qe)=>{for(let Je in Te)if(Te[Je].name===qe){if(Te[Je]["2D"])return qe;{const gt=du(qe,Ia);return nc(Ia,gt)}}else if(Te[Je].children){const gt=nc(Te[Je].children,qe);if(gt)return gt}return null},dd=C.useMemo(()=>(zr==3||zr==4)&&!(Z||be)?[zr==3&&hc!=1?{key:"3",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{mi(1),te(!0)}},a("5000.6025")||"切换到冠状面")}:null,zr==3&&hc!=2?{key:"4",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{mi(2),te(!0)}},a("5000.6026")||"切换到矢状面")}:null,zr==3&&hc!=3?{key:"5",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{mi(3),te(!0)}},a("5000.6027")||"切换到水平面")}:null,zr==3&&hc!=4?{key:"6",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{mi(4),te(!0)}},a("5000.6028")||"切换到任意面")}:null,ge.brains?{key:"1",label:C.createElement("a",{target:"_blank",type:"primary",onClick:()=>{Jn(ge.brains,zr==4),te(!0)}},a("5000.6018")||"查看更高分辨率图像")}:null,ge.brains?{key:"2",label:C.createElement("a",{target:"_blank",onClick:()=>{Ji(ge.brains),te(!0)}},_.current.checkedKeys.current.includes(ge.brains)?a("5000.6023",{name:ge.brains})||`隐藏${ge.brains}的三维形貌`:a("5000.6024",{name:ge.brains})||`显示${ge.brains}的三维形貌`)}:null]:Z||be?[Z?{key:"1",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:()=>{as(Z),te(!0)}},_.current.checkedKeys.current.includes(Z)?a("5000.5056")||"隐藏核团":a("5000.5057")||"显示核团")}:null,zr!=7&&(st.length==0||st.includes("neurons"))&&be?{key:"3",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{Qo(7),te(!0),setTimeout(()=>{rs(Z),Pe(Z),z(!1),on(0)},50)}},a("5000.6015")||"查询位于或投射到该结构的神经元")}:null,be?{key:"6",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{const Te=Ae.current.getObjectByName(be);if(Te){const qe=new vs().setFromObject(Te),Je=new Ie;qe.getCenter(Je),h.current.target.copy(Je),te(!0)}}},a("7000.7019")||"设置为焦点")}:null,be&&zr==5?{key:"5",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{const Te=new vs,qe=Ae.current.getObjectByName(be);if(qe){Te.expandByObject(qe.clone());let Je=Te.min,gt=Te.max,St=new Ie;Te.getCenter(St);const Qt=gt.x-Je.x,Yt=gt.y-Je.y,hn=gt.z-Je.z;fe.current.scale.x=Qt,fe.current.scale.y=Yt,fe.current.scale.z=hn,fe.current.position.set(St.x,St.y,St.z);const ln=fe.current.geometry.clone();ln.scale(fe.current.scale.x,fe.current.scale.y,fe.current.scale.z),ln.translate(St.x,St.y,St.z);const ur=new z6(ln);Ue.current.geometry=ur,Ae.current.remove(Pt.current);const Yn=a("5000.0006")||"显示数据块";if(jr===Yn){yr(a("5000.0007")||"隐藏数据块"),at.current=new JS(Ai.current,f==null?void 0:f.domElement),at.current.setMode("translate"),at.current.enabled=!0,at.current.visible=!0,at.current.name="transformControls",at.current.attach(fe.current),Ae.current.add(fe.current,at.current,Ue.current),Jm(),document.addEventListener("keypress",va);const Br=new vs;Br.expandByObject(fe.current);const Sr=R.current(Br.min.clone()),Gn=R.current(Br.max.clone());let dr=new Bp(yn(650,620,`${Sr.x.toFixed(2)},${Sr.y.toFixed(2)},${Sr.z.toFixed(2)}`,"#ccc")),Kn=new Uh(new Zf({map:dr}));Kn.name="startText";let ta=new Bp(yn(650,620,`${Gn.x.toFixed(2)},${Gn.y.toFixed(2)},${Gn.z.toFixed(2)}`,"#ccc")),bi=new Uh(new Zf({map:ta}));bi.name="endText",Kn.position.set(Br.min.x,Br.min.y+.2,Br.min.z),bi.position.set(Br.max.x,Br.max.y+.6,Br.max.z);const Ua=Ae.current.getObjectByName("startText"),es=Ae.current.getObjectByName("endText");Ua&&es&&Ae.current.remove(Ua,es),Ae.current.add(Pt.current,Kn,bi)}te(!0),Jr({})}}},a("5000.6022",{lableStr:be})||"设置 "+be+" 的包围盒为下载范围")}:null].filter(Te=>Te!==null):ee?[{key:"1",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{xe.current.showSwctext(ee),te(!0)}},ee in ve.current?a("5000.5060")||"隐藏文字":a("5000.5061")||"显示文字")},{key:"2",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{Co(ee),te(!0)}},a("5000.6004")||"隐藏该神经元")}]:Q?[{key:"1",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{Po(Q),te(!0)}},Wa.current.includes(Q)?a("5000.0209")||"Hide Label":a("5000.0208")||"Show Label")},{key:"2",label:C.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:Te=>{gc(Q),te(!0)}},a("5000.6021")||"隐藏该分支")}]:ut.Lable?[{key:"1",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{if(ut.name){const Te=Ae.current.getObjectByName(ut.name);if(Te){const qe=new vs().setFromObject(Te),Je=new Ie;qe.getCenter(Je),h.current.target.copy(Je),te(!0)}}}},a("7000.7019")||"设置为焦点")},{key:"2",label:C.createElement("a",{style:{width:"150px",color:"#000",textAlign:"center"},onClick:()=>{ut.Lable&&as(ut.Lable),te(!0)}},_.current.checkedKeys.current.includes(ut.Lable)?a("5000.6023",{name:ut.Lable})||`隐藏${ut.Lable}的三维形貌`:a("5000.6024",{name:ut.Lable})||`显示${ut.Lable}的三维形貌`)}]:[],[Z,Q,ee,be,zr,Vs,ge,Qa,ut]),$o=Te=>{Te=Te.replace(/[\[\]]/g,"\\$&");var qe=new RegExp("[?&]"+Te+"(=([^&#]*)|&|#|$)"),Je=qe.exec(window.location.href);return Je?Je[2]?decodeURIComponent(Je[2].replace(/\+/g," ")):"":null},du=(Te,qe)=>{let Je="";for(let gt in qe){const St=qe[gt];if(St.children){if(St.children.some(Qt=>Qt.name===Te)){Je=St.name;break}else if(du(Te,St.children)){Je=du(Te,St.children);break}}}return Je},tl=()=>{let Te=new URL(window.location.href),qe=new URLSearchParams(Te.search);const Je=Math.ceil((performance.now()-zs.current)/1e3)-1;zs.current=performance.now();let gt=qe.get("type");if(gt){const St=window.location.origin+window.location.pathname+`?type=${gt}`;fetch("/app-api/java-api/brainsweb-service/record/list",{method:"post",body:JSON.stringify({href:St,time:Je})}).then(Qt=>Qt.json()).then(Qt=>{})}},lo=(Te,qe,Je)=>{let gt=new URL(window.location.href),St=new URLSearchParams(gt.search);const Qt=Math.ceil((performance.now()-zs.current)/1e3)-1;let Yt=St.get(Te);if(Yt&&!Je){zs.current=performance.now();const ln=window.location.origin+window.location.pathname+`?${Te}=${Yt}`;fetch("/app-api/java-api/brainsweb-service/record/list",{method:"post",body:JSON.stringify({href:ln,time:Qt})}).then(ur=>ur.json()).then(ur=>{})}St.set(Te,qe),gt.search=St.toString(),window.history.replaceState({},"",gt);const hn=window.location.origin+window.location.pathname+`?${Te}=${qe}`;fetch("/app-api/java-api/brainsweb-service/record/list",{method:"post",body:JSON.stringify({href:hn,time:0})}).then(ln=>ln.json()).then(ln=>{})},rc=(Te,qe,Je)=>{if(qe)switch(parseInt(Te)){case 0:document.title="STAM-SimpleViewer",lo("type","simple",Je);break;case 1:document.title="STAM-NormalViewer",lo("type","normal",Je);break;case 2:document.title="STAM-Surgery",lo("type","virtual",Je);break;case 3:document.title="STAM-Reslicing",lo("type","slicing",Je);break;case 4:document.title="STAM-Registration",lo("type","registration",Je);break;case 5:document.title="STAM-Downloading",lo("type","downloading",Je);break;case 6:document.title="STAM-AtlasMapping",lo("type","mapping",Je);break;case 7:document.title="STAM-Connectivity",lo("type","circuits",Je);break;case 8:document.title="STAM-OtherAtlas",lo("type","other",Je);break;case 9:document.title="STAM-ViewSetting",lo("type","setting",Je);break}};C.useEffect(()=>{ge.brains&&qs(nc(Ia,ge.brains))},[ge]),C.useEffect(()=>{be&&yo(nc(Ia,be)),v(dd),ol.current=p},[p,Z,A,Q,be,ee,zr,Se,ge,Qa,ut]);const fd=async Te=>{ai(Te.url||Te.preview),Oa(!0)},Vc=(Te,qe)=>{const Je=new FormData;Je.append("file",Te.file),fetch("/app-api/up-api/update",{method:"post",body:Je}).then(gt=>gt.json()).then(gt=>{if(gt.code===200)if(Ec.success("update success"),qe===2){const St=Wo.findIndex(Qt=>Qt.key===cs[0]);if(St>-1){let Qt=JSON.parse(JSON.stringify(Es.current)),Yt=Qt[St];Yt.fileList2=[{url:"data:image/png;base64,"+gt.base64_url}],ws(Qt),Es.current=Qt}}else{const St=Wo.findIndex(Qt=>Qt.key===cs[0]);if(St>-1){let Qt=JSON.parse(JSON.stringify(Es.current)),Yt=Qt[St];Yt.fileList=[{url:"data:image/png;base64,"+gt.base64_url}],Yt.correspondingPlaneData={},Yt.filename=gt.path,ws(Qt);const hn=Ae.current.children.filter(ln=>ln.userData.name==="registrationPng");hn&&Ae.current.remove(...hn),Es.current=Qt}$e.current=gt.path}else gt.message&&Us.error({content:gt.message})})},bp=async(Te,qe)=>{const Je=Te.type==="image/tiff"||Te.type==="image/tif",gt=Te.name.endsWith(".swc");let St,Qt;return await new Promise(hn=>{if(Je){const ln=new FileReader;ln.readAsArrayBuffer(Te),ln.onload=async ur=>{var Yn;if((Yn=ur.target)!=null&&Yn.result){const Br=ur.target.result;if(Br instanceof ArrayBuffer){const Gn=await(await Ype(Br)).getImage(),dr=Gn.getWidth(),Kn=Gn.getHeight();if(!qe){const ta=Wo.findIndex(bi=>bi.key===cs[0]);if(ta>-1){let bi=JSON.parse(JSON.stringify(Wo)),Ua=bi[ta];Ua.firstRegistrationImg={width:dr,height:Kn},ws(bi),Es.current=bi}}if(qe===2){const ta=Wo.findIndex(bi=>bi.key===cs[0]);if(ta>-1){const{firstRegistrationImg:bi}=Wo[ta];(bi.width!==dr||Kn!==bi.height)&&(Ec.error("The size of the second TIFF image needs to be consistent with the first one!"),hn(!1))}}hn(!0)}}}}else hn(!0)}).then(hn=>hn?(zr==6?(St=Je||gt,Qt="You can only upload tif or swc files!"):(St=Je,Qt="You can only upload tif files!"),St||Ec.error(Qt),St):!1)},Tg=(Te,qe)=>{const Je=new FormData;Je.append("file",Te.file),fetch("/app-api/d-api/upload",{method:"post",body:Je}).then(gt=>gt.json()).then(gt=>{gt.code===200?(Ec.success("update success"),qe===2?Wi([{url:"data:image/png;base64,"+gt.base64_url}]):(Pr([{url:"data:image/png;base64,"+gt.base64_url}]),xa({}),$e.current=gt.path)):gt.message&&Us.error({content:a("5000.0003")||"上传失败,请联系管理员"})})},$c=()=>{const Te=Ae.current.getObjectByName("Brain");if(Te)if(Vn(Je=>!Je),zi.file[1].indexOf(".js")>-1)fetch("/app-api/d-api/dowload/"+zi.file[1]).then(Je=>Je.json()).then(Je=>{let gt=new vo;const St=new Fu,Qt=zi.file[1];let Yt={};const hn=[];Ae.current.traverse(Sr=>{Sr.userData.isAtlasMapping==="true"&&hn.push(Sr)}),hn.forEach(Sr=>{Ae.current.remove(Sr)}),Je.line.forEach((Sr,Gn)=>{var dr=Je.position[Sr.end],Kn=Je.position[Sr.start],ta=new rr(new hu(.01,32,32),new _d({color:"#A7B5A1",transparent:!0}));ta.position.set(dr.x*.01,dr.y*.01,dr.z*.01);var bi=new rr(new hu(.01,32,32),new _d({color:"#00ffff",transparent:!0}));bi.position.set(Kn.x*.01,Kn.y*.01,Kn.z*.01),ta.translateX(uo.current),ta.translateY(qa.current),ta.translateZ(to.current),bi.translateX(uo.current),bi.translateY(qa.current),bi.translateZ(to.current),ta.myMeshType="neuronSphere",ta.name=`${Qt}/${Sr.end_name}`,ta.userData.color="#A7B5A1",bi.myMeshType="neuronSphere",bi.name=`${Qt}/${Sr.start_name}`,bi.userData.color="#00ffff",St.add(ta),St.add(bi),Sr.start_name&&(Yt.hasOwnProperty(Sr.start_name)?Yt[`${Sr.start_name}`].push({name:Qt,point:[Kn.x,Kn.y,Kn.z],color:"#00ffff"}):(Yt[`${Sr.start_name}`]=[],Yt[`${Sr.start_name}`].push({name:Qt,point:[Kn.x,Kn.y,Kn.z],color:Gn===0?"#1771FF":"#00ffff"}))),Sr.end_name&&(Yt.hasOwnProperty(Sr.end_name)?Yt[`${Sr.end_name}`].push({name:Qt,point:[dr.x,dr.y,dr.z],color:"#A7B5A1"}):(Yt[`${Sr.end_name}`]=[],Yt[`${Sr.end_name}`].push({name:Qt,point:[dr.x,dr.y,dr.z],color:"#A7B5A1"})))});let ln=new rr(new hu(.02,32,32),new _d({color:"#1771FF",transparent:!0}));ln.position.set(Je.position[0].x*.01,Je.position[0].y*.01,Je.position[0].z*.01),ln.translateX(uo.current),ln.translateY(qa.current),ln.translateZ(to.current),St.add(ln),St.name=`swcPointGroup${Qt}`,St.userData.isAtlasMapping="true";const ur={};for(const Sr in Yt){const Gn=Yt[Sr];for(const dr of Gn)if(dr.name==Qt){if(dr.color==="#1771FF"){ur[Sr]={point:dr.point,color:dr.color};break}if(dr.color==="#A7B5A1"){ur[Sr]={point:dr.point,color:dr.color};break}ur[Sr]={point:dr.point,color:dr.color}}}for(let Sr in ur){const{point:Gn,color:dr}=ur[Sr];var Yn=new Bp(yn(400,300,Sr.replace("_","/"),dr));let Kn=new Uh(new Zf({map:Yn,transparent:!0,alphaTest:.5}));Kn.scale.set(.5,.5,.5),Kn.position.set(Gn[0]*.01,Gn[1]*.01,Gn[2]*.01),Kn.translateX(uo.current),Kn.name="lineNameMesh",Kn.userData.name=Sr.replace("_","/"),Kn.userData.wholeName=`${Qt}-${Sr}`,Kn.userData.isAtlasMapping="true",Kn.userData.initColor=dr,Kn.translateY(qa.current),Kn.translateZ(to.current),Ae.current.add(Kn)}Ae.current.add(St);for(let Sr=0;Sr<Je.line.length;Sr++){let Gn=[];for(let Kn=Je.line[Sr].start;Kn<=Je.line[Sr].end;Kn++){let ta=Je.position[Kn].x,bi=Je.position[Kn].y,Ua=Je.position[Kn].z;Gn.push(new Ie(ta,bi,Ua))}let dr=new Pa(new ea().setFromPoints(Gn),new Af({color:"green"}));gt.add(dr),Vn(!1)}gt.scale.set(sa.current,sa.current,sa.current),gt.translateX(uo.current),gt.translateY(qa.current),gt.translateZ(to.current),gt.name="correspondingPlaneDataSwc";const Br=Ae.current.getObjectByName("correspondingPlaneDataSwc");Br&&Ae.current.remove(Br),Ae.current.add(gt)});else{var qe=new fo;qe.setFromAxisAngle(new Ie(1,0,0),Math.PI/2);const Je=(Te==null?void 0:Te.children[0]).geometry.boundingBox.min,gt=(Te==null?void 0:Te.children[0]).geometry.boundingBox.max,St={bwidth:0,bheight:2.6,bdepth:0,ewidth:gt.x-Je.x,eheight:gt.y-Je.y,edepth:gt.z-Je.z,owidth:gt.x-Je.x,oheight:gt.y-Je.y,odepth:gt.z-Je.z};new Ie(.010276870727539578,-5.650856788169461,-.9944386664650411);let Qt=new Ie(-5.097530670166015,-4.308416134996751,-7.990437196406743),Yt=new Ie(5.118084411621094,3.006702558657828,6.001559863476661);const hn=new vs;hn.expandByObject(Te.clone()),Qt=hn.min,Yt=hn.max;const ln=Yt.x-Qt.x,ur=Yt.y-Qt.y,Yn=Yt.z-Qt.z;fe.current.scale.set(ln,ur,Yn),fe.current.position.set(.010276870727539578,-1.6508567881694614,-.9944386664650411),Ze.current.length===0?fetch("/app-api/d-api/dowload/"+zi.file[1]).then(Br=>Br.arrayBuffer()).then(Br=>{const Sr=new Uint8Array(Br);let Gn=OB(Sr),dr=Xpe(Sr);Ze.current=Gn,ri(Gn,St,dr)}):setTimeout(()=>{ri(Ze.current,St,Ze.current.length)},200)}},xp=Te=>{const qe=Wo.findIndex(Je=>Je.key===cs[0]);if(qe>-1){let Je=JSON.parse(JSON.stringify(Wo)),gt=Je[qe];gt.registrationRadioShowType=Te.target.value,ws(Je),Es.current=Je,Ae.current.getObjectByName(`png${qe}`)&&Zm(Te.target.value)}},q1=Te=>{if(Vn(!0),wt(Te.target.value),La.otherAtlases=Te.target.value,Ae.current){const qe=Ae.current.getObjectByName("outline");qe&&Ae.current.remove(qe)}Te.target.value=="CCF"&&z0({filepath:n+"/data/FBX/outline-CCF.FBX",index:"outline",color:"#327DFF",opacity:.3,offsetZ:0,R:.01,callback:function(){}},Ut),Te.target.value=="WHS"&&z0({filepath:n+"/data/FBX/outline-WHS.FBX",index:"outline",color:"#327DFF",opacity:.3,offsetZ:0,R:.01,callback:function(){}},Ut),Vn(!1)},Wt=Te=>{if(on(Te.target.value),Te.target.value===2){V.current="automatic",P(!0),B.current=!0,j(2),m.current.length>=2&&(m.current.pop(),b.current.pop());const qe=Ae.current.getObjectByName("dashedLine"),Je=Ae.current.getObjectByName("sphereBig"),gt=Ae.current.getObjectByName("sphereMiddelClick"),St=Ae.current.getObjectByName("Line");qe&&Je&&Ae.current.remove(qe,Je),gt&&Ae.current.remove(gt),St&&Ae.current.remove(St),Sv()}else V.current="manual",P(!1),B.current=!1,j(3),Sv();d&&(d.current=!0),Zi.current&&(Zi.current.textContent=a("4000.0126")||"重置")},zc=Te=>{if(Te>-1){let qe=JSON.parse(JSON.stringify(Es.current)),Je=qe[Te];Je.startButtonLoading=!0,Je.correspondingPlaneData={},ws(qe),Es.current=qe;const gt=new FormData;gt.append("file",Je.filename),gt.append("typeName",Je.radioValue.toString()),fetch("/app-api/up-api/calculate",{method:"post",body:gt}).then(St=>{if(St.ok)return St.json();throw Us.error({content:a("5000.7027")||"计算失败"}),new Error(St.statusText)}).then(St=>{const Qt=St;let Yt=JSON.parse(JSON.stringify(Es.current));const hn=Yt[Te];hn.correspondingPlaneData=Qt,hn.startButtonLoading=!1,Es.current=Yt,ws(Yt)})}},Hc=()=>{const Te=Wo.findIndex(qe=>qe.key===cs[0]);if(Te>-1){let qe=Wo[Te];const Je=document.createElement("a");Je.href="/app-api/up-api/zip/"+qe.correspondingPlaneData.url,Je.download=qe.correspondingPlaneData.url,Je.click()}},Zm=Te=>{const qe=Wo.findIndex(Yn=>Yn.key===cs[0]);if(qe>-1){const Yn=Ae.current.getObjectByName(`png${qe}`);Yn&&Ae.current.remove(Yn)}var Je=Ae.current.getObjectByName("Brain");if(Je&&qe>-1){let Yn=Wo[qe];const{correspondingPlaneData:Br,registrationRadioShowType:Sr,fileList:Gn,fileList2:dr}=Yn;var gt=new vs().setFromObject(Je),St=gt.max.y-gt.min.y,Qt=gt.max.x-gt.min.x;St=St/Math.cos(Br.angles[0]*Math.PI/180),Qt=Qt/Math.cos(Br.angles[1]*Math.PI/180);var Yt=new Z5(Qt,St,1,1),hn=new _d({side:Ef,transparent:!0,alphaTest:.1}),ln=new rr(Yt,hn);ln.name=`png${qe}`;let Kn=Sr;Te&&(Kn=Te),ln.userData.imgType=Kn,ln.userData.name="registrationPng",Ae.current.add(ln);var ur=new Rb;ln.position.set(gt.min.x+(gt.max.x-gt.min.x)/2,gt.min.y+(gt.max.y-gt.min.y)/2,(gt.max.z-gt.min.z)*Br.tx+gt.min.z),ur.load(Kn==="3"?dr[0].url:Kn==="1"?Br.base64_url:Gn[0].url,function(ta){hn.map=ta,hn.needsUpdate=!0}),ln.rotateOnAxis(new Ie(0,0,1),Math.PI),ln.rotateOnAxis(new Ie(1,0,0),Math.PI/180*-Br.angles[0]),ln.rotateOnAxis(new Ie(0,1,0),Math.PI/180*Br.angles[2]),ln.rotateOnAxis(new Ie(0,0,1),Math.PI/180*Br.angles[1]),Te!="1"&&(jl.current?ln.scale.x=1:ln.scale.x=-1)}},Km=()=>{const Te=new Ws(1,1,1),qe=new _d({color:16777215,opacity:.1,transparent:!0,depthWrite:!1}),Je=new rr(Te,qe);Ae.current.remove(fe.current,Ue.current,Pt.current),fe.current=Je.clone(),Pt.current=new rr;const gt=new z6(Te),St=new Af({color:16536881}),Qt=new Dz(gt,St);Ue.current=Qt},Xr=()=>{const Te=a("5000.0006")||"显示数据块";if(jr===Te){yr(a("5000.0007")||"隐藏数据块"),at.current=new JS(Ai.current,f==null?void 0:f.domElement),at.current.setMode("translate"),at.current.enabled=!0,at.current.visible=!0,at.current.name="transformControls",at.current.attach(fe.current),Ae.current.add(fe.current,at.current,Ue.current),Jm(),document.addEventListener("keypress",va);const qe=new vs;qe.expandByObject(fe.current);const Je=R.current(qe.min.clone()),gt=R.current(qe.max.clone());let St=new Bp(yn(650,620,`${Je.x.toFixed(2)},${Je.y.toFixed(2)},${Je.z.toFixed(2)}`,"#ccc")),Qt=new Uh(new Zf({map:St}));Qt.name="startText";let Yt=new Bp(yn(650,620,`${gt.x.toFixed(2)},${gt.y.toFixed(2)},${gt.z.toFixed(2)}`,"#ccc")),hn=new Uh(new Zf({map:Yt}));hn.name="endText",Qt.position.set(qe.min.x,qe.min.y+.2,qe.min.z),hn.position.set(qe.max.x,qe.max.y+.6,qe.max.z);const ln=Ae.current.getObjectByName("startText"),ur=Ae.current.getObjectByName("endText");ln&&ur&&Ae.current.remove(ln,ur),Ae.current.add(Pt.current,Qt,hn)}else{document.removeEventListener("keypress",va),yr(a("5000.0006")||"显示数据块"),at.current.enabled=!1,at.current.visible=!1,at.current.detach();const qe=Ae.current.getObjectByName("startText"),Je=Ae.current.getObjectByName("endText");qe&&Je&&Ae.current.remove(qe,Je),Ae.current.remove(at.current),Ae.current.remove(fe.current,Ue.current,Pt.current)}},yn=(Te,qe,Je,gt)=>{var St=document.createElement("canvas");St.width=Te,St.height=qe,St.style.border="1px solid #000";let Qt=St.getContext("2d");return Qt.font="80px Arial",Qt.fillStyle=gt,Qt.fillText(Je,40,80),St},ri=(Te,qe,Je)=>{const gt=Te[0].width/qe.owidth,St=Te[0].height/qe.oheight,Qt=Je/qe.odepth,Yt=Math.ceil(qe.bwidth*gt),hn=Math.ceil(qe.bheight*St),ln=Math.ceil(qe.bdepth*Qt),ur=Math.floor(qe.ewidth*gt),Yn=Math.floor(qe.eheight*St),Br=Math.floor(qe.edepth*Qt),Sr=ur-Yt,Gn=Yn-hn,dr=new bwe(null,Sr,Gn,Br-ln);dr.format=AX,dr.minFilter=ku,dr.magFilter=ku,dr.unpackAlignment=1,dr.needsUpdate=!0;const Kn=f.getContext(),ta=Kn.createTexture();Kn.bindTexture(Kn.TEXTURE_3D,ta),Kn.pixelStorei(Kn.UNPACK_ALIGNMENT,1),Kn.pixelStorei(Kn.UNPACK_FLIP_Y_WEBGL,0),Kn.texStorage3D(Kn.TEXTURE_3D,1,Kn.R8,Sr,Gn,Br-ln),Kn.texParameteri(Kn.TEXTURE_3D,Kn.TEXTURE_MIN_FILTER,Kn.LINEAR),Kn.texParameteri(Kn.TEXTURE_3D,Kn.TEXTURE_MAG_FILTER,Kn.LINEAR),Kn.texParameteri(Kn.TEXTURE_3D,Kn.TEXTURE_WRAP_S,Kn.CLAMP_TO_EDGE),Kn.texParameteri(Kn.TEXTURE_3D,Kn.TEXTURE_WRAP_T,Kn.CLAMP_TO_EDGE),Kn.texParameteri(Kn.TEXTURE_3D,Kn.TEXTURE_WRAP_R,Kn.CLAMP_TO_EDGE);for(let es=0;es<Te.length;es++){let Zr=[];if(es>=ln&&es<Br){for(let hi=0;hi<Te[es].data.length;hi++){let mc=hi%Te[es].width,hd=hi/Te[es].width;Yt<=mc&&mc<ur&&hd>=hn&&hd<Yn&&Zr.push(Te[es].data[hi])}const Ki=new Uint8Array(Zr);Kn.bindTexture(Kn.TEXTURE_3D,ta),Kn.bindBuffer(Kn.PIXEL_UNPACK_BUFFER,null),Kn.bindBuffer(Kn.ARRAY_BUFFER,null),Kn.texSubImage3D(Kn.TEXTURE_3D,0,0,0,es-ln,Sr,Gn,1,Kn.RED,Kn.UNSIGNED_BYTE,Ki)}}const bi=new WUt(f,Sr,Gn,Br-ln);bi.webglTexture=ta,bi.needsUpdate=!0,ce.current=bi,S.current=new ob({glslVersion:xm,uniforms:{map:{value:ce.current},cameraPos:{value:Ai.current.position},volume_dims:{value:new Ie(Sr,Gn,Je)},canvas_dims:{value:new gr(f.domElement.width,f.domElement.height)},isClicked:{value:0},steps:{value:Je},brightness:{value:_s.current.brightness},darkness:{value:_s.current.darkness},opacity:{value:_s.current.opacity},opacity2:{value:_s.current.opacity2},lowcolor:{value:new Ie(_s.current.color.r/255,_s.current.color.g/255,_s.current.color.b/255)},highcolor:{value:new Ie(_s.current.color2.r/255,_s.current.color2.g/255,_s.current.color2.b/255)}},side:Qd,vertexShader:HUt,fragmentShader:GUt}),Ae.current.remove(Pt.current);const Ua=new Ws(1,1,1);Pt.current=new rr(Ua,S.current),Pt.current.applyMatrix4(fe.current.matrixWorld),Pt.current.scale.set(fe.current.scale.x,fe.current.scale.y,fe.current.scale.z),Pt.current.position.set(fe.current.position.x,fe.current.position.y,fe.current.position.z),Ae.current.add(Pt.current),Vn(es=>!es)},Sv=()=>{const Te=[];Ae.current.traverse(qe=>{qe.name==="lineName"&&Te.push(qe)}),Te.forEach(qe=>{Ae.current.remove(qe)})},Ym=()=>{const Te=new vs;Te.expandByObject(fe.current);const qe=Ae.current.getObjectByName("Brain");if(qe){Vn(ln=>!ln);var Je=new fo;Je.setFromAxisAngle(new Ie(1,0,0),Math.PI/2);const gt=(qe==null?void 0:qe.children[0]).geometry.boundingBox.min,St=(qe==null?void 0:qe.children[0]).geometry.boundingBox.max,Qt=Te.min.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),Yt=Te.max.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),hn={bwidth:Qt.x-gt.x,bheight:Qt.y-gt.y,bdepth:Qt.z-gt.z,ewidth:Yt.x-gt.x,eheight:Yt.y-gt.y,edepth:Yt.z-gt.z,owidth:St.x-gt.x,oheight:St.y-gt.y,odepth:St.z-gt.z};Ze.current.length===0?fetch(n+"/data/TIFF/1-0.5_0.tif").then(ln=>ln.arrayBuffer()).then(ln=>{const ur=new Uint8Array(ln);let Yn=OB(ur),Br=Xpe(ur);Ze.current=Yn,ri(Yn,hn,Br)}):setTimeout(()=>{ri(Ze.current,hn,Ze.current.length)},200)}},J1=()=>{aM&&fetch(aM).then(Te=>Te.text()).then(Te=>{const qe=[0,0,0,0,0,0];let Je=new zUt(Te,aM||"",qe,void 0,void 0,3,qe);const gt=new s9({color:65280,side:Ef});let St=new vo;for(let Qt=0;Qt<Je.branches.length;Qt++){let Yt=Je.branches[Qt],hn=[];for(let Yn=Yt.start;Yn<Yt.start+Yt.count;Yn++){let Br=Je.indices[Yn],Sr=Je.points[3*Br],Gn=Je.points[3*Br+1],dr=Je.points[3*Br+2];hn.push(new Ie(Sr,Gn,dr))}const ln=new ea().setFromPoints(hn);let ur=new Pa(ln,gt);St.add(ur)}St.scale.set(sa[0],sa[1],sa[2]),St.position.set(uo.current,qa.current,to.current),St.name="swcUrlDataLine",Ae.current.add(St)})},YE=()=>{new vs().expandByObject(fe.current);const qe=Ae.current.getObjectByName("Brain");if(!cve||!DB)return;const Je=JSON.parse(cve);if(qe){Vn(ur=>!ur);const gt=Je.min,St=Je.max,Qt=Je.max_resample,Yt={bwidth:gt.x,bheight:gt.y,bdepth:gt.z,ewidth:Qt.x,eheight:Qt.y,edepth:Qt.z,owidth:Qt.x-gt.x,oheight:Qt.y-gt.y,odepth:Qt.z-gt.z},hn={x:(St.x-gt.x)*sa.current,y:(St.y-gt.y)*sa.current,z:(St.z-gt.z)*sa.current},ln={x:((St.x-gt.x)/2+gt.x)*sa.current+uo.current,y:((St.y-gt.y)/2+gt.y)*sa.current+qa.current,z:((St.z-gt.z)/2+gt.z)*sa.current+to.current};fe.current.scale.set(hn.x,hn.y,hn.z),fe.current.position.set(ln.x,ln.y,ln.z),Ze.current.length===0?fetch(DB).then(ur=>ur.arrayBuffer()).then(async ur=>{try{const Yn=await Ype(ur),Br=await Yn.getImageCount(),Sr=[];for(let dr=0;dr<Br;dr++){const Kn=await Yn.getImage(dr),ta=await Kn.readRasters(),bi=Kn.getWidth(),Ua=Kn.getHeight();Sr.push({width:bi,height:Ua,data:ta[0]})}let Gn=Br;Ze.current=Sr,ri(Ze.current,Yt,Gn)}catch(Yn){console.log("e",Yn)}}):setTimeout(()=>{ri(Ze.current,Yt,Ze.current.length)},200)}else setTimeout(()=>{YE()},1e3)};C.useEffect(()=>{ns?Dc.current&&Dc.current.focus():iu.current&&iu.current.focus()},[ns]);const Ig=Te=>Te.map(qe=>({value:qe.name+" "+qe.fullname,title:C.createElement(ki,{placement:"right",title:qe.fullname},C.createElement("div",{style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",lineHeight:"2.4"}},qe.name," ",qe.fullname)),children:qe.children?Ig(qe.children):void 0})),wv=C.useMemo(()=>{const Te=new vs;Te.expandByObject(fe.current);const qe=Ae.current.getObjectByName("Brain");if(qe){var Je=new fo;Je.setFromAxisAngle(new Ie(1,0,0),Math.PI/2);const gt=(qe==null?void 0:qe.children[0]).geometry.boundingBox.min,St=Te.min.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),Qt=Te.max.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),Yt={bwidth:St.x-gt.x,bheight:St.y-gt.y,bdepth:St.z-gt.z,ewidth:Qt.x-gt.x,eheight:Qt.y-gt.y,edepth:Qt.z-gt.z};Tn.current=Yt;const hn=(Yt.ewidth-Yt.bwidth)*1.11545988258317*(Yt.eheight-Yt.bheight)*12.31190150478796*(Yt.edepth-Yt.bdepth)*10;let ln=0;switch(kn){case 1:ln=hn*.8;break;case 2:ln=hn*.8/8;break;case 3:ln=hn*.8/8/8;break;case 4:ln=hn*.8/8/8/8;break;case 5:ln=hn*.8/8/8/8/8;break;case 6:ln=hn*.8/8/8/8/8/8;break}return jr===(a("5000.0006")||"显示数据块")?"0KB":ln>1024*1024*1024*1024?(ln/(1024*1024*1024*1024)).toFixed(2)+"TB":ln>1024*1024*1024?(ln/(1024*1024*1024)).toFixed(2)+"GB":ln>1024*1024&&ln<1024*1024*1024?(ln/(1024*1024)).toFixed(2)+"MB":ln>1024&&ln<1024*1024?(ln/1024).toFixed(2)+"KB":ln&&ln<1024?ln.toFixed(2)+"B":"0KB"}else return"0KB"},[ni,jr]),qm=()=>{if(!Kt.current){Fo(!0);return}const Te=new vs;Te.expandByObject(fe.current);const qe=Ae.current.getObjectByName("Brain");if(qe){var Je=new fo;Je.setFromAxisAngle(new Ie(1,0,0),Math.PI/2);const gt=(qe==null?void 0:qe.children[0]).geometry.boundingBox.min,St=(qe==null?void 0:qe.children[0]).geometry.boundingBox.max,Qt=Te.min.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),Yt=Te.max.clone().applyMatrix4(qe.matrixWorld.clone().invert()).applyQuaternion(Je),hn={bwidth:Qt.x-gt.x,bheight:Qt.y-gt.y,bdepth:Qt.z-gt.z,ewidth:Yt.x-gt.x,eheight:Yt.y-gt.y,edepth:Yt.z-gt.z,owidth:St.x-gt.x,oheight:St.y-gt.y,odepth:St.z-gt.z,zoom:!1,level:kn};Tn.current=hn;const ln=(hn.ewidth-hn.bwidth)*1.11545988258317*(hn.eheight-hn.bheight)*12.31190150478796*(hn.edepth-hn.bdepth)*10;switch(kn){case 1:if(ln*.8>1024*1024*1024){Ur(!0);return}break;case 2:if(ln*.8/8>1024*1024*1024){Ur(!0);return}break;case 3:if(ln*.8/8/8>1024*1024*1024){Ur(!0);return}break;case 4:if(ln*.8/8/8/8>1024*1024*1024){Ur(!0);return}break;case 5:if(ln*.8/8/8/8/8>1024*1024*1024){Ur(!0);return}break;case 6:if(ln*.8/8/8/8/8/8>1024*1024*1024){Ur(!0);return}break}Xi(!0),fetch("/app-api/test-api/CutBlockTask",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(hn)}).then(ur=>ur.json()).then(ur=>{OI(ur)})}},OI=Te=>{fetch("/app-api/test-api/CutBlockTask",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:Te})}).then(qe=>{const Je=qe.headers.get("content-type");return Je?Je.includes("application/json")?qe.json():Je.includes("application/octet-stream")?qe.arrayBuffer():(Je.includes("text/html")||Je.includes("text/plain")||Je.includes("application/xml")||Je.includes("text/xml"),qe.text()):qe.text()}).then(qe=>{if(typeof qe=="string")setTimeout(()=>{OI(Te)},2e3);else{const Je=document.createElement("a"),gt=new Blob([qe]),St=window.URL.createObjectURL(gt);Je.style.display="none",Je.href=St,Je.download="temp.tiff",Je.click(),window.URL.revokeObjectURL(St),Xi(!1);let Qt=new URL(window.location.href),hn=new URLSearchParams(Qt.search).get("type");const ln=window.location.origin+window.location.pathname+`?type=${hn}`;fetch("/app-api/java-api/brainsweb-service/record/list",{method:"post",body:JSON.stringify({href:ln,time:0,key:fn.current})}).then(ur=>ur.json()).then(ur=>{})}}).catch(qe=>{Xi(!1),Us.error({title:a("5000.7026")||"请求超时,下载失败"})})},va=C.useCallback(Te=>{Te.stopPropagation(),(Te.key==="a"||Te.key==="A")&&(at.current.getMode()==="translate"?at.current.setMode("scale"):at.current.setMode("translate"))},[]),Jm=()=>{let qe=Ae.current.getObjectByName("Brain"),Je=new Ie(-5.097530670166015,-5.308416134996751,-7.990437196406743),gt=new Ie(5.118084411621094,2.006702558657828,6.001559863476661);if(qe){const hn=new vs;hn.expandByObject(qe.clone()),Je=hn.min,gt=hn.max}const St=gt.x-Je.x,Qt=gt.y-Je.y,Yt=gt.z-Je.z;at.current.addEventListener("change",()=>{const hn=fe.current.scale,ln=fe.current.position;hn.x<1&&fe.current.scale.setX(1),hn.x>St&&fe.current.scale.setX(St),hn.y<1&&fe.current.scale.setY(1),hn.y>Qt&&fe.current.scale.setY(Qt),hn.z<1&&fe.current.scale.setZ(1),hn.z>Yt&&fe.current.scale.setZ(Yt),ln.x<Je.x+fe.current.scale.x/2&&fe.current.position.setX(Je.x+fe.current.scale.x/2),ln.x>gt.x-fe.current.scale.x/2&&fe.current.position.setX(gt.x-fe.current.scale.x/2),ln.y<Je.y+fe.current.scale.y/2&&fe.current.position.setY(Je.y+fe.current.scale.y/2),ln.y>gt.y-fe.current.scale.y/2&&fe.current.position.setY(gt.y-fe.current.scale.y/2),ln.z<Je.z+fe.current.scale.z/2&&fe.current.position.setZ(Je.z+fe.current.scale.z/2),ln.z>gt.z-fe.current.scale.z/2&&fe.current.position.setZ(gt.z-fe.current.scale.z/2);const ur=fe.current.geometry.clone();ur.scale(fe.current.scale.x,fe.current.scale.y,fe.current.scale.z),ur.translate(fe.current.position.x,fe.current.position.y,fe.current.position.z);const Yn=new z6(ur);Ue.current.geometry=Yn,Jr({})}),at.current.addEventListener("dragging-changed",function(hn){hn.value?(h.current.enableRotate=!1,h.current.enabled=!1,Oo.current={target:h.current.target.clone(),position:h.current.object.position.clone(),up:h.current.object.up.clone(),enabled:h.current.enabled}):(h.current.enableRotate=!0,h.current.enabled=!0,h.current.reset(),h.current.target.copy(Oo.current.target),h.current.object.position.copy(Oo.current.position),h.current.object.up.copy(Oo.current.up),h.current.update());const ln=fe.current.geometry.clone();ln.scale(fe.current.scale.x,fe.current.scale.y,fe.current.scale.z),ln.translate(fe.current.position.x,fe.current.position.y,fe.current.position.z);const ur=new z6(ln);Ue.current.geometry=ur;const Yn=new vs;Yn.expandByObject(fe.current);const Br=R.current(Yn.min.clone()),Sr=R.current(Yn.max.clone());let Gn=new Bp(yn(650,620,`${Br.x.toFixed(2)},${Br.y.toFixed(2)},${Br.z.toFixed(2)}`,"#ccc")),dr=new Uh(new Zf({map:Gn}));dr.name="startText";let Kn=new Bp(yn(650,620,`${Sr.x.toFixed(2)},${Sr.y.toFixed(2)},${Sr.z.toFixed(2)}`,"#ccc")),ta=new Uh(new Zf({map:Kn}));ta.name="endText",dr.position.set(Yn.min.x,Yn.min.y+.2,Yn.min.z),ta.position.set(Yn.max.x,Yn.max.y+.6,Yn.max.z);const bi=Ae.current.getObjectByName("startText"),Ua=Ae.current.getObjectByName("endText");bi&&Ua&&Ae.current.remove(bi,Ua),Ae.current.add(Pt.current,dr,ta)})},fx=()=>{document.removeEventListener("keypress",va),yr(a("5000.0006")||"显示数据块"),at.current.enabled=!1,at.current.visible=!1,at.current.detach(),Ae.current.remove(at.current),Ae.current.remove(fe.current,Ue.current,Pt.current);const Te=Ae.current.getObjectByName("dashedLine");Te&&Ae.current.remove(Te);const qe=Ae.current.getObjectByName("startText"),Je=Ae.current.getObjectByName("endText");qe&&Je&&Ae.current.remove(qe,Je)},Gs=Te=>{mn(Te.target.value)},Xo=C.useCallback(Te=>{An.current=!0,Wr.current=[Te.x,Te.y],Qr.current=[Te.x,Te.y]},[]),Cp=C.useCallback(Te=>{if(An.current){const qe=[Te.x,Te.y],Je=.005,gt=qe[0]-Wr.current[0];qe[1]-Wr.current[1];const St=gt*Je,Qt=new Ie;Qt.copy(Ai.current.position).sub(h.current.target);const Yt=new cgt().setFromVector3(Qt);Yt.theta+=St,Yt.makeSafe(),Qt.setFromSpherical(Yt),Ai.current.position.copy(h.current.target).add(Qt),Ai.current.lookAt(h.current.target),Wr.current=[Te.x,Te.y]}},[]),qE=C.useCallback(Te=>{An.current=!1;const qe=[Te.x,Te.y],Je=Math.abs(qe[0]-Qr.current[0]),gt=Math.abs(qe[1]-Qr.current[1]);Je<2&><2?f.domElement.addEventListener("click",Y.current):f.domElement.removeEventListener("click",Y.current)},[]),PI=()=>{if(!localStorage.getItem("imgKey")){_r(!0);return}Yr(!0),io(!1),xa({});let Te={taskType:Et,moving_name:$e.current,key:localStorage.getItem("imgKey")};fetch("/app-api/d-api/count",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(Te)}).then(qe=>qe.ok?qe.json():(Yr(!1),qe.json().then(Je=>{throw io(!0),qe.status===401&&Us.confirm({content:Je.message,onOk(){fetch("/app-api/d-api/update_key",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:localStorage.getItem("imgKey")})}).then(gt=>gt.json())},onCancel(){}}),qe.status===429?Us.error({content:a("5000.7029")||"请求过于频繁,请稍后再试"}):Us.error({content:a("5000.7027")||"计算失败"}),new Error(Je.message||qe.statusText)}))).then(qe=>{qe.code===200&&xa(qe),Yr(!1)}).catch(qe=>{Yr(!1),console.error(qe)}).finally(()=>{Yr(!1)})},hx=()=>{const Te=document.createElement("a");Te.href="/app-api/d-api/dowload/"+zi.file[0],Te.download=zi.file[0],Te.click()},NI=Te=>{F&&F(Te),La.datumMarkVisibility=Te},px=Te=>{fc(Te),La.coordinateVisibility=Te,Te?H&&H.current.forEach(qe=>{qe.visible=!0}):H&&H.current.forEach(qe=>{qe.visible=!1})},fP=()=>{xo(!1)},JE=()=>{xo(!1)},QE=Te=>{if($s(Te),La.leftHemisphereVisibility=Te,Te){for(let qe in ma.current)ma.current[qe]&&A.includes(qe)&&Ae.current.add(ma.current[qe]);np.current=!0}else{for(let qe in ma.current)ma.current[qe]&&Ae.current.remove(ma.current[qe]);np.current=!1}},DI=Te=>{if(La.cranialVisibility=Te,kc({}),Te)z0({filepath:n+"/data/FBX/ExtractedSurface.FBX",index:"ExtractedSurface",color:"#327DFF",opacity:.3,offsetZ:0,R:.01,callback:function(){}},Ut);else if(Ae.current){const qe=Ae.current.getObjectByName("ExtractedSurface");qe&&Ae.current.remove(qe)}},e3=()=>{if(kr(!0),Vn(!0),k){const Te={flag:np.current,point:[k.current.x,k.current.y,k.current.z],fbx:W.current};fetch("/app-api/c-api/compute",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(Te)}).then(qe=>{if(qe.ok)return qe.json();throw kr(!1),Vn(!1),Us.error({content:a("5000.7028")||"没有合适的路径"}),new Error(qe.statusText)}).then(qe=>{kr(!1),Vn(!1),qe.code===200&&N?N(new Ie(qe.point[0],qe.point[1],qe.point[2])):Us.error({content:a("5000.7027")||"计算失败"})})}},vx=Te=>{Te!=null&&(rs(Te),(Te===""||Te.includes(" "))&&Pe(Te))},gh=(Te,qe)=>{let Je=0;for(const gt of Te.toLowerCase())if(gt===qe[Je]&&(Je++,Je===qe.length))return!0;return!1},t3=Te=>{if(Te){const qe=Te.toLowerCase(),Je=xe.current.defAllexpandedKeys.current.map(gt=>{const St=gt.name&>.name.toLowerCase()===qe,Qt=gt.fullname&&gh(gt.fullname,qe);return{...gt,matchPriority:St?1:Qt?2:3}}).filter(gt=>gt.matchPriority<3).sort((gt,St)=>gt.matchPriority-St.matchPriority).map(gt=>({value:`${gt.name} ${gt.fullname}`,label:`${gt.name} ${gt.fullname}`}));pr(Je)}else pr([])},kI=Te=>{const qe=new URLSearchParams;for(const Je in Te)qe.append(Je,Te[Je]);zr==3||zr==5?qe.append("aplType","2"):qe.append("aplType","1"),fetch("/app-api/java-api/brainsweb-service/apldetail/add",{method:"post",body:qe}).then(Je=>{if(Je.ok)return Je.json();throw Us.error({content:a("5000.5047")||"提交失败"}),new Error(Je.statusText)}).then(Je=>{Je.code==1?Ec.error("Repeat Email"):Ec.success(a("5000.5048")||"提交成功"),Fo(!1),ti(0),_r(!1),Da(0)})},n3=Te=>{console.log("Failed:",Te)},r3=async Te=>{let qe="";Te==="DAPI"?qe="/staticresource/data/TIFF/image_356_t.tif":Te==="PI"&&(qe="/staticresource/data/TIFF/image_570_t.tif");try{const Je=qe.split("/").pop()||"",St=await(await fetch(qe)).blob(),Qt=new File([St],Je,{type:"image/tiff"}),Yt=Wo.findIndex(Br=>Br.key===cs[0]);let ln=await new Promise(Br=>{const Sr=new FileReader;Sr.readAsArrayBuffer(St),Sr.onload=function(Gn){var dr,Kn;if((dr=Gn.target)!=null&&dr.result){const ta=new Uint8Array((Kn=Gn.target)==null?void 0:Kn.result);let bi=OB(ta);const{width:Ua,height:es}=bi[0];Br({width:Ua,height:es})}},Sr.onerror=function(Gn){console.error("failed")}});const{width:ur,height:Yn}=ln;if(Yt>-1){let Br=JSON.parse(JSON.stringify(Wo)),Sr=Br[Yt];Sr.fileList=[Qt],Sr.firstRegistrationImg={width:ur,height:Yn},ws(Br),Es.current=Br}Vc({file:Qt})}catch(Je){console.error("Error fetching file:",Je)}},UI=async Te=>{let qe="",Je="";Te==="3D"?(qe="/staticresource/data/TIFF/test.tif",Je="image/tiff"):Te==="swc"&&(qe="/staticresource/data/TIFF/fixed.swc",Je="file/swc");try{const St=await(await fetch(qe)).blob();let Qt=qe.split("/").pop();if(Qt){const Yt=new File([St],Qt,{type:Je});Pr([Yt]),Tg({file:Yt})}}catch(gt){console.error("Error fetching file:",gt)}};return C.createElement(C.Fragment,null,C.createElement(rz,{onClick:()=>{const Te=document.querySelector(".tabsCompnent .ant-tabs-content-holder");Te&&lr?(Te.style.padding="0px",Te.style.borderLeft="none"):(Te.style.padding="10px",Te.style.borderLeft="1px solid rgb(225, 218, 218)"),rn(qe=>!qe)},style:{position:"absolute",right:`${lr?"452px":"126px"}`,top:"50%",transform:`rotate(${lr?180:0}deg) translate(-50%,0)`,fontSize:28,transition:"all 0.1s",zIndex:1e3}}),C.createElement(Om,{className:"tabsCompnent",onChange:Qo,activeKey:zr.toString(),style:{position:"absolute",right:0,bottom:0,width:`${lr?"430px":"150px"}`,height:st.length!=7?"100%":"calc(100% - 42px)",userSelect:"none",borderTop:"1px solid rgb(225, 218, 218)"},tabPosition:"right",tabBarStyle:{width:150,background:"#fff",borderLeft:"1px solid #e1dada"}},st.includes("label")&&C.createElement(Wg,{tab:a("4000.0202")||"组装",key:"1",disabled:q===2},lr?C.createElement(C.Fragment,null,C.createElement("div",{style:{width:"200px",height:"100px"}},C.createElement(Ho,{ref:ja},C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:10},a("4000.0205")||"长度",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:1,max:10,onChange:lu}))))):null),st.includes("virtual")&&C.createElement(Wg,{tab:a("4000.0203")||"病毒标记",key:"2",disabled:q===1||q===0},lr?C.createElement("div",{style:{backgroundColor:"rgba(255,255,255,0.6)",borderRadius:"5px",marginTop:"5px"}},C.createElement("div",null,C.createElement(Ba,{ref:Zi,disabled:!(A.length>0),className:"ant-btn ant-btn-primary",onClick:E},a("4000.0208")||"选择靶点"),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ya.Group,{style:{display:`${G?"block":"none"}`},onChange:Wt,value:xt,ref:za},C.createElement(Ya,{value:1},a("5000.5035")||"手动"),C.createElement(Ya,{value:2},a("5000.5034")||"自动")),G?C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}):null,xt===2?C.createElement(Ba,{className:"ant-btn ant-btn-primary",loading:hr,disabled:!(A.length>0),onClick:e3},a("5000.5017")||"计算"):null),a("5000.6039")||"平颅方位",C.createElement(Ya.Group,{onChange:Te=>{it(Te.target.value),Te.target.value?Ae.current.rotation.set(-8.3/180*Math.PI,0,0):Ae.current.rotation.set(0,0,0)},style:{marginLeft:6},value:Ne},C.createElement(Ya,{value:0},a("5000.6042")||"关闭"),C.createElement(Ya,{value:1},a("5000.6043")||"启用")),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement("div",{dangerouslySetInnerHTML:{__html:c.current}}),C.createElement("div",{dangerouslySetInnerHTML:{__html:u.current}})):null),st.includes("reslicing")&&C.createElement(Wg,{tab:a("4000.0204")||"图谱切面",key:"3",disabled:q===2||q===0},lr?C.createElement(C.Fragment,null,C.createElement("div",{style:{width:"276px"}},C.createElement(Ho,null,a("7000.7024")||"控制模式",": ",C.createElement(Ya.Group,{value:hs,onChange:Te=>{Te.target.value==0?at.current.setMode("translate"):at.current.setMode("rotate"),Hl(Te.target.value)}},C.createElement(Ya,{value:0},a("7000.7022")||"平移"),C.createElement(Ya,{value:1,disabled:hc!=4},a("7000.7023")||"旋转")),C.createElement("span",{style:{fontStyle:"italic"}},a("5000.0019")||"提示:按R键进入旋转模式")),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,null,a("7000.7021")||"重切片模式",":",C.createElement("br",null),C.createElement(Ya.Group,{value:hc.toString(),onChange:Te=>mi(Number(Te.target.value))},C.createElement(Ya.Button,{value:"1",style:{padding:"0 5px"}},"Coronal"),C.createElement(Ya.Button,{value:"2",style:{padding:"0 5px"}},"Sagittal"),C.createElement(Ya.Button,{value:"3",style:{padding:"0 5px"}},"Horizontal"),C.createElement(Ya.Button,{value:"4",style:{padding:"0 5px"}},"Arbitrary"))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0210")||"平移-X",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:-5.17,max:5.17,onChange:Ye,step:.01,value:ar,disabled:zt}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250,visibility:"hidden"},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0211")||"平移-Y",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:-5.33,max:2.04,onChange:Ot,step:.01,value:At,disabled:Xt}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250,visibility:"hidden"},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0212")||"平移-Z",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:-8,max:6,onChange:tn,step:.01,value:Ft,disabled:$t}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250,visibility:"hidden"},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0213")||"角度-X",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:0,max:360,step:1,value:Rn,onChange:Te=>pn(Te,1),disabled:qt}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250,visibility:"hidden"},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0214")||"角度-Y",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:0,max:360,step:1,value:Xn,onChange:Te=>pn(Te,2),disabled:qt}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250,visibility:"hidden"},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,{style:{height:"36px",lineHeight:"36px"},span:8},a("4000.0215")||"角度-Z",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:0,max:360,step:1,value:Or,onChange:Te=>pn(Te,3),disabled:qt})))),C.createElement(Ba,{style:{marginTop:20,marginLeft:10},type:"primary",disabled:In,onClick:()=>X()},"Download current slice"),C.createElement(Ba,{style:{marginTop:20},type:"primary",disabled:In,onClick:()=>Jn()},a("7000.0107")||"查看更高分辨率的图像"),C.createElement(Ri,{style:{margin:"10px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement("div",null,C.createElement("i",null,a("5000.6008")||"点击下方按钮,申请下载各向同性10微米分辨率的STAM图谱3D标签图像")),C.createElement(Ba,{style:{marginTop:20},type:"primary",onClick:()=>{Hs()}},a("5000.6009")||"请求STAM标签"),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0})):null),st.includes("registration")&&C.createElement(Wg,{tab:a("5000.0001")||"脑片配准",key:"4",disabled:q===2||q===0},lr?C.createElement(C.Fragment,null,Nl.map((Te,qe)=>C.createElement(C.Fragment,null,C.createElement(Qre.CheckableTag,{key:Te,checked:cs.includes(Te),onChange:()=>dc([Te])},Te))),Nl.length<10?C.createElement(Qre,{icon:C.createElement(rT,null),onClick:()=>{Nc(Te=>[...Te,`Task${Nl.length+1}`]),ws(Te=>[...Te,{key:`Task${Nl.length+1}`,fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""}]),Es.current=[...Es.current,{key:`Task${Nl.length+1}`,fileList:[],radioValue:"Config_DAPI.ini",fileList2:[],correspondingPlaneData:{},registrationRadioShowType:"1",firstRegistrationImg:{width:0,height:0},startButtonLoading:!1,filename:""}]}},"New task"):null,Wo.map((Te,qe)=>{if(Te.key===cs[0]){const{key:Je,fileList:gt,fileList2:St,correspondingPlaneData:Qt,registrationRadioShowType:Yt,startButtonLoading:hn}=Te;return C.createElement("div",{key:Je},C.createElement(Ho,null,C.createElement(ko,null,C.createElement("p",null,C.createElement("span",null,a("5000.6033")||"Upload slice, or use the test "),C.createElement("a",{onClick:()=>{r3("DAPI")}},"DAPI "),"&",C.createElement("a",{onClick:()=>{r3("PI")}}," PI "),a("5000.6034")||"slices:"))),C.createElement(Ho,null,C.createElement(ko,null,C.createElement(jD,{accept:"image/tiff",listType:"picture-card",fileList:gt,onPreview:fd,customRequest:Vc,beforeUpload:ln=>bp(ln),onRemove:()=>{const ln=Wo.findIndex(ur=>ur.key===cs[0]);if(ln>-1){let ur=JSON.parse(JSON.stringify(Wo)),Yn=ur[ln];Yn.fileList=[],ws(ur),Es.current=ur}}},C.createElement("button",{style:{border:0,background:"none"},type:"button"},C.createElement(rT,null),C.createElement("div",{style:{marginTop:8}},"Upload tiff"))))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,null,C.createElement("p",null,C.createElement("span",null,a("5000.7000")||"(可选) 上传第二张脑片图像,默认该图像已经配准到了第一张上传的脑片图像上")))),C.createElement(Ho,null,C.createElement(ko,null,C.createElement(jD,{accept:"image/tiff",listType:"picture-card",fileList:St,onPreview:fd,customRequest:ln=>Vc(ln,2),beforeUpload:ln=>bp(ln,2),onRemove:()=>{const ln=Wo.findIndex(ur=>ur.key===cs[0]);if(ln>-1){let ur=JSON.parse(JSON.stringify(Wo)),Yn=ur[ln];Yn.fileList2=[],ws(ur),Es.current=ur}}},C.createElement("button",{style:{border:0,background:"none"},type:"button"},C.createElement(rT,null),C.createElement("div",{style:{marginTop:8}},"Upload tiff"))))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{marginTop:5}},C.createElement(ko,null,a("7000.0106")||"计算与上传图像对应的图谱切面",":")),C.createElement(Ho,{style:{marginTop:5}},C.createElement(ko,null,C.createElement(Ba,{loading:hn,disabled:gt.length<1,onClick:()=>zc(qe)},a("7000.0108")||"开始计算"),C.createElement(Ba,{onClick:Hc,disabled:!Qt.url},a("7000.0109")||"下载保存"))),C.createElement(Ho,{style:{marginTop:5}},Qt.base64_url&&C.createElement(xD,{src:Qt.base64_url,width:100})),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{marginTop:5}},C.createElement(Ba,{onClick:()=>Zm("1"),disabled:!Qt.url},a("5000.0004")||"显示结果"),C.createElement(ko,{style:{display:"flex",alignItems:"center",marginLeft:5}})),C.createElement(Ho,null,C.createElement(Ya.Group,{onChange:xp,value:Yt},C.createElement(Ya,{value:"1"},a("5000.7001")||"atlas"),C.createElement(Ho,null,"slice: ",C.createElement(_1,{onChange:ln=>{jl.current=ln.target.checked;const ur=ln.target.checked?1:-1;Ae.current.traverse(Yn=>{Yn.userData.name==="registrationPng"&&Yn.userData.imgType!=1&&Yn.scale.set(ur,1,1)})}},a("5000.7013")||"左右翻转"),C.createElement("div",{style:{wordWrap:"break-word",width:200}},C.createElement(Ya,{value:"2"},a("5000.7002")||"first"),St.length<1?null:C.createElement(Ya,{value:"3"},a("5000.7003")||"second"))))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}))}else return null})):null),st.includes("download")&&C.createElement(Wg,{tab:a("5000.0005")||"数据下载",key:"5",disabled:q===2||q===0},lr?C.createElement(C.Fragment,null,C.createElement(Ho,null,C.createElement(ko,null,a("5000.0009")||"提示:按A键切换平移和缩放模式")),C.createElement(Ho,null,C.createElement(ko,null,C.createElement(Ba,{onClick:Xr},jr))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{marginTop:5}},C.createElement(ko,null,C.createElement(Ba,{disabled:jr===(a("5000.0006")||"选取下载范围"),onClick:Ym},a("5000.0008")||"预览图像"))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{alignItems:"center"}},C.createElement(ko,null,a("5000.0010")||"设置采样倍数",":"),C.createElement(ko,{span:12},C.createElement(Up,{min:1,max:6,step:1,defaultValue:2,value:kn,onChange:Te=>{nr(Te),Jr({})},tooltip:{formatter:Te=>Te?Math.pow(2,Te-1):null}}))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,null,C.createElement(Ba,{loading:Ni,disabled:jr===(a("5000.0006")||"选取下载范围"),onClick:qm},a("5000.0005")||"数据下载"))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,null,C.createElement(ko,null,a("5000.5031")||"数据块大小:"),C.createElement(ko,null,wv)),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0})):null),st.includes("mapping")&&C.createElement(Wg,{tab:a("5000.5014")||"图谱映射",key:"6",disabled:q===2||q===0},lr?C.createElement(C.Fragment,null,C.createElement(Ho,null,C.createElement(ko,null,C.createElement("p",null,a("5000.6035")||"Upload 3D image or swc file already mapped to STAM or CCF, otherwise use the test ",C.createElement("a",{onClick:()=>{UI("3D")}},a("5000.6036")||"3D image")," or ",C.createElement("a",{onClick:()=>{UI("swc")}},a("5000.6037")||"swc file:"))),C.createElement(ko,null,C.createElement(jD,{listType:"picture-card",fileList:Qn,onPreview:fd,customRequest:Tg,beforeUpload:Te=>bp(Te,1),onRemove:()=>{Pr([])}},C.createElement("button",{style:{border:0,background:"none"},type:"button"},C.createElement(rT,null),C.createElement("div",{style:{marginTop:8}},"Upload"))))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{marginTop:5}},C.createElement(ko,null,a("5000.5015")||"选择转换方向",":"),C.createElement(ko,null,C.createElement(Ya.Group,{onChange:Gs,value:Et},C.createElement(Ya,{value:"applySTAM2CCF"},"STAM-",">","CCF"),C.createElement(Ya,{value:"applyCCF2STAM"},"CCF-",">","STAM")))),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement(Ho,{style:{marginTop:5}},C.createElement(ko,null,C.createElement(Ba,{loading:or,disabled:!qo,onClick:PI},a("7000.0108")||"开始计算"),C.createElement(Ba,{onClick:hx,disabled:!zi.file},a("7000.0109")||"下载保存"))),C.createElement(Ho,{style:{marginTop:5}},zi.base64_url&&C.createElement(xD,{src:zi.base64_url,width:100})),C.createElement(Ho,{style:{marginTop:5}},C.createElement(Ba,{onClick:$c,disabled:!(zi.file&&zi.file[1])},a("5000.0004")||"显示结果")),C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:250},dashed:!0}),C.createElement("p",null,a("7000.7014")||"您也可以在此下载",C.createElement("a",{href:`${n}/data/Fiji.zip`},"Fji")," / ",C.createElement("a",{href:n+"/data/ImageJ.zip"},"ImageJ"),C.createElement("span",null,a("7000.7015")||"的插件;您可能需要使用测试数据,请"),C.createElement("a",{href:`${n}/data/test.zip`},a("7000.7016")||"在此"),C.createElement("span",null,a("7000.7017")||"下载")," ;",a("5000.7031")||" 如果你没有申请过key可以点击",C.createElement("a",{onClick:()=>{Da(1),_r(!0)}},a("5000.5042")||"申请key"))):null),st.includes("neurons")&&C.createElement(Wg,{tab:a("5000.5052")||"神经环路",key:"7",disabled:q===2||q===0},lr?C.createElement(C.Fragment,null,C.createElement("p",null,C.createElement("span",null,a("5000.6029")||"Navigate the "),C.createElement("a",{style:{textDecoration:"underline"},onClick:()=>{xo(!0)}},a("5000.6030")||"whole-brain connectivity diagram"),C.createElement("span",null,a("5000.6031")||"consisting of single neuronal projections,or:")),ns?C.createElement(O4,{ref:Dc,style:{width:"100%"},options:qn,placeholder:a("5000.5053")||"Input the inquired structure",onSearch:t3,onChange:vx,value:ns}):C.createElement(nb,{showSearch:!0,ref:iu,style:{width:"100%"},value:ns,dropdownStyle:{maxHeight:400,overflow:"hidden"},placeholder:a("5000.5053")||"Input the inquired structure",allowClear:!0,treeDefaultExpandAll:!1,onChange:vx,onSearch:vx,treeData:Ig(De)}),C.createElement("p",{style:{fontSize:"13px",fontStyle:"italic"}},C.createElement("span",null,a("5000.6001")||"Input an inquired structure to visualize the connectivity map, for example, "),C.createElement("a",{onClick:cl("CP"),style:{textDecoration:"underline"}},"CP"),", ",C.createElement("a",{onClick:cl("PIR1"),style:{textDecoration:"underline"}},"PIR1"),", or ",C.createElement("a",{onClick:cl("Primary motor area, Layer 6a"),style:{textDecoration:"underline"}}," Primary motor area, Layer 6a")),ns?C.createElement("p",{style:{fontSize:"13px",fontStyle:"italic"}},C.createElement("a",{style:{textDecoration:"underline"},onClick:()=>{const Te=[];Te.push(ns),["Upstream","Downstream"].forEach(Qt=>{Te.push(Qt),Te.push("name,neurons"),zu[Qt].forEach(Yt=>{Te.push(`${Yt.name},"${Yt.value}"`)})});let qe=Te.join(`
|
|
4598
4598
|
`);const Je=new Blob([qe],{type:"text/csv;charset=utf-8;"}),gt=URL.createObjectURL(Je),St=document.createElement("a");St.href=gt,St.download="neuronal_data.csv",St.click(),URL.revokeObjectURL(gt)}},a("5000.7030")||"Click here to download the queried results")):null,C.createElement(Ri,{style:{margin:"5px 0",borderColor:"rgba(5, 5, 5, .3)",minWidth:200,width:280},dashed:!0}),C.createElement("div",{style:{width:"100%",height:"calc(100vh - 330px)",overflow:"scroll",paddingTop:"10px"}},C.createElement("div",{style:sr?{border:"2px solid #e6e6e6",borderRadius:"5px",paddingLeft:"5px",paddingBottom:"5px"}:{}},sr&&C.createElement("h2",{style:{lineHeight:"3px"}},a("5000.5054")||"Upstream"),C.createElement("div",{ref:xs,style:{width:"100%"}})),C.createElement("br",null),C.createElement("div",{style:sr?{border:"2px solid #e6e6e6",borderRadius:"5px",paddingLeft:"5px",paddingBottom:"5px"}:{}},sr&&C.createElement("h2",{style:{lineHeight:"3px"}},a("5000.5055")||"Downstream"),C.createElement("div",{ref:Cs,style:{width:"100%"}})))):null)),qr&&C.createElement(xD,{wrapperStyle:{display:"none"},preview:{visible:mo,onVisibleChange:Te=>Oa(Te),afterOpenChange:Te=>!Te&&ai("")},src:qr}),C.createElement(o0,{open:bt,onClose:()=>ze(!1),steps:Xl}),C.createElement(o0,{open:Mt,onClose:()=>It(!1),steps:el,mask:!0}),C.createElement(o0,{open:Dt,onClose:()=>Lt(!1),steps:Fc,mask:!0}),C.createElement(o0,{open:Bt,onClose:()=>Gt(!1),steps:sl,mask:!0}),C.createElement(o0,{open:un,onClose:()=>xn(!1),steps:Uc,mask:!0}),C.createElement(o0,{open:wn,onClose:()=>Fn(!1),steps:Tu,mask:!0}),C.createElement(o0,{open:en,onClose:()=>Mr(!1),steps:Hu,mask:!0}),C.createElement(o0,{open:_n,onClose:()=>gn(!1),steps:Li,mask:!0}),C.createElement(_T,{direction:2,percentage:.2,pointMax:rt.current,pointMin:dt.current,color:16777215,sliceImgNum:205,slicePath:n+"/data/SLICE/",transformControls:at,controls:h,canvas_width:Le,canvas_height:Be,handleStateUpdate:tc,cube_helper:vt,renderer:f,showMesh:Ir,setAngleX:dn,setAngleY:cr,setAngleZ:Bn,gray_value:Me,slicing_url:ka,setSectionsInfo:ue,sectionsInfoRef:We,sectionPointRef:is,composer:He,menutagShowRef:ol,tabIndex:zr}),C.createElement(_T,{direction:3,percentage:.2,pointMax:rt.current,pointMin:dt.current,color:16777215,sliceImgNum:160,slicePath:n+"/data/SLICE/",transformControls:at,controls:h,canvas_width:Le,canvas_height:Be,handleStateUpdate:tc,cube_helper:vt,renderer:f,showMesh:nn,setAngleX:dn,setAngleY:cr,setAngleZ:Bn,gray_value:Me,slicing_url:ka,setSectionsInfo:ue,sectionsInfoRef:We,sectionPointRef:is,composer:He,menutagShowRef:ol,tabIndex:zr}),C.createElement(_T,{direction:1,percentage:.2,pointMax:rt.current,pointMin:dt.current,color:16777215,sliceImgNum:264,slicePath:n+"/data/SLICE/",transformControls:at,controls:h,canvas_width:Le,canvas_height:Be,handleStateUpdate:tc,cube_helper:vt,renderer:f,showMesh:Cn,setAngleX:dn,setAngleY:cr,setAngleZ:Bn,gray_value:Me,slicing_url:ka,setSectionsInfo:ue,sectionsInfoRef:We,sectionPointRef:is,composer:He,menutagShowRef:ol,tabIndex:zr}),C.createElement(_T,{direction:4,percentage:.5,pointMax:rt.current,pointMin:dt.current,slice_arbitrary:tt,color:16777215,sliceImgNum:264,slicePath:n+"/data/SLICE/",transformControls:at,controls:h,canvas_width:Le,canvas_height:Be,handleStateUpdate:tc,normalVector:ot,cube_helper:vt,renderer:f,showMesh:On,setAngleX:dn,setAngleY:cr,setAngleZ:Bn,slicing_url:ka,settransformControlsType:Hl,gray_value:Me,setSectionsInfo:ue,sectionsInfoRef:We,sectionPointRef:is,composer:He,menutagShowRef:ol,tabIndex:zr}),C.createElement("div",{id:"spinner",style:{position:"absolute",zIndex:999,left:0,top:0,width:"100%",height:"100%",display:`${Pn?"block":"none"}`,opacity:.7,backgroundColor:"#ffffff"}},C.createElement("div",{style:{position:"absolute",zIndex:999,left:"50%",top:"50%",fontWeight:"bold",textAlign:"center"}},C.createElement(FO,{spinning:!0,size:"large"}),C.createElement("br",null),"Loading....wait...")),C.createElement(Us,{open:br,centered:!0,okText:a("5000.0011")||"发送邮件",cancelText:a("5000.0112")||"取消",onOk:()=>{const Te="Request to download data blocks",qe=`startX:${(Tn.current.bwidth*1.11545988258317).toFixed(2)},startY:${(Tn.current.bheight*12.31190150478796).toFixed(2)},startZ:${(Tn.current.bdepth*10).toFixed(2)}
|
|
4599
4599
|
endX:${(Tn.current.ewidth*1.11545988258317).toFixed(2)},endY:${(Tn.current.eheight*12.31190150478796).toFixed(2)},endZ:${(Tn.current.edepth*10).toFixed(2)}
|
|
4600
4600
|
Downsampling level:${kn}
|
|
@@ -5073,7 +5073,7 @@ https://sweetalert2.github.io/#ajax-request`),LVt(t),typeof t.title=="string"&&(
|
|
|
5073
5073
|
);
|
|
5074
5074
|
|
|
5075
5075
|
}
|
|
5076
|
-
`},O$t=(...t)=>{console!=null&&console.warn&&(yb(t[0])&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t))},Lve={},tj=(...t)=>{yb(t[0])&&Lve[t[0]]||(yb(t[0])&&(Lve[t[0]]=new Date),O$t(...t))},z8e=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},nj=(t,e,n)=>{t.loadNamespaces(e,z8e(t,n))},Rve=(t,e,n,r)=>{if(yb(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return nj(t,n,r);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,z8e(t,r))},P$t=(t,e,n={})=>!e.languages||!e.languages.length?(tj("i18n.languages were undefined or empty",e.languages),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,i)=>{var a;if(((a=n.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,t))return!1}}),yb=t=>typeof t=="string",N$t=t=>typeof t=="object"&&t!==null,D$t=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,k$t={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},U$t=t=>k$t[t],F$t=t=>t.replace(D$t,U$t);let rj={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:F$t};const B$t=(t={})=>{rj={...rj,...t}},V$t=()=>rj;let H8e;const $$t=t=>{H8e=t},z$t=()=>H8e,H$t={type:"3rdParty",init(t){B$t(t.options.react),$$t(t)}},G$t=C.createContext();class j$t{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const W$t=(t,e)=>{const n=C.useRef();return C.useEffect(()=>{n.current=e?n.current:t},[t,e]),n.current},G8e=(t,e,n,r)=>t.getFixedT(e,n,r),X$t=(t,e,n,r)=>C.useCallback(G8e(t,e,n,r),[t,e,n,r]),Z$t=(t,e={})=>{var S,w,_,A;const{i18n:n}=e,{i18n:r,defaultNS:i}=C.useContext(G$t)||{},a=n||r||z$t();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new j$t),!a){tj("You will need to pass in an i18next instance by using initReactI18next");const P=(N,k)=>yb(k)?k:N$t(k)&&yb(k.defaultValue)?k.defaultValue:Array.isArray(N)?N[N.length-1]:N,R=[P,{},!1];return R.t=P,R.i18n={},R.ready=!1,R}(S=a.options.react)!=null&&S.wait&&tj("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...V$t(),...a.options.react,...e},{useSuspense:s,keyPrefix:c}=o;let u=t||i||((w=a.options)==null?void 0:w.defaultNS);u=yb(u)?[u]:u||["translation"],(A=(_=a.reportNamespaces).addUsedNamespaces)==null||A.call(_,u);const d=(a.isInitialized||a.initializedStoreOnce)&&u.every(P=>P$t(P,a,o)),f=X$t(a,e.lng||null,o.nsMode==="fallback"?u:u[0],c),h=()=>f,p=()=>G8e(a,e.lng||null,o.nsMode==="fallback"?u:u[0],c),[v,y]=C.useState(h);let g=u.join();e.lng&&(g=`${e.lng}${g}`);const m=W$t(g),b=C.useRef(!0);C.useEffect(()=>{const{bindI18n:P,bindI18nStore:R}=o;b.current=!0,!d&&!s&&(e.lng?Rve(a,e.lng,u,()=>{b.current&&y(p)}):nj(a,u,()=>{b.current&&y(p)})),d&&m&&m!==g&&b.current&&y(p);const N=()=>{b.current&&y(p)};return P&&(a==null||a.on(P,N)),R&&(a==null||a.store.on(R,N)),()=>{b.current=!1,a&&(P==null||P.split(" ").forEach(k=>a.off(k,N))),R&&a&&R.split(" ").forEach(k=>a.store.off(k,N))}},[a,g]),C.useEffect(()=>{b.current&&d&&y(h)},[a,c,d]);const x=[v,a,d];if(x.t=v,x.i18n=a,x.ready=d,d||!d&&!s)return x;throw new Promise(P=>{e.lng?Rve(a,e.lng,u,()=>P()):nj(a,u,()=>P())})},Va=t=>typeof t=="string",k_=()=>{let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n},Ove=t=>t==null?"":""+t,K$t=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},Y$t=/###/g,Pve=t=>t&&t.indexOf("###")>-1?t.replace(Y$t,"."):t,Nve=t=>!t||Va(t),f4=(t,e,n)=>{const r=Va(e)?e.split("."):e;let i=0;for(;i<r.length-1;){if(Nve(t))return{};const a=Pve(r[i]);!t[a]&&n&&(t[a]=new n),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++i}return Nve(t)?{}:{obj:t,k:Pve(r[i])}},Dve=(t,e,n)=>{const{obj:r,k:i}=f4(t,e,Object);if(r!==void 0||e.length===1){r[i]=n;return}let a=e[e.length-1],o=e.slice(0,e.length-1),s=f4(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=f4(t,o,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},q$t=(t,e,n,r)=>{const{obj:i,k:a}=f4(t,e,Object);i[a]=i[a]||[],i[a].push(n)},NR=(t,e)=>{const{obj:n,k:r}=f4(t,e);if(n)return n[r]},J$t=(t,e,n)=>{const r=NR(t,n);return r!==void 0?r:NR(e,n)},j8e=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?Va(t[r])||t[r]instanceof String||Va(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):j8e(t[r],e[r],n):t[r]=e[r]);return t},UC=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Q$t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ezt=t=>Va(t)?t.replace(/[&<>"'\/]/g,e=>Q$t[e]):t;class tzt{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const nzt=[" ",",","?","!",";"],rzt=new tzt(20),izt=(t,e,n)=>{e=e||"",n=n||"";const r=nzt.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const i=rzt.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(n);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},ij=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let i=t;for(let a=0;a<r.length;){if(!i||typeof i!="object")return;let o,s="";for(let c=a;c<r.length;++c)if(c!==a&&(s+=n),s+=r[c],o=i[s],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<r.length-1)continue;a+=c-a+1;break}i=o}return i},DR=t=>t==null?void 0:t.replace("_","-"),azt={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};class kR{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||azt,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,i){return i&&!this.debug?null:(Va(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new kR(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new kR(this.logger,e)}}var og=new kR;class dP{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[s,c]=o;for(let u=0;u<c;u++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[s,c]=o;for(let u=0;u<c;u++)s.apply(s,[e,...r])})}}class kve extends dP{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){var u,d;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,n],r&&(Array.isArray(r)?s.push(...r):Va(r)&&a?s.push(...r.split(a)):s.push(r)));const c=NR(this.data,s);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=s[0],n=s[1],r=s.slice(2).join(".")),c||!o||!Va(r)?c:ij((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[n],r,a)}addResource(e,n,r,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,n];r&&(s=s.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(s=e.split("."),i=n,n=s[1]),this.addNamespaces(n),Dve(this.data,s,i),a.silent||this.emit("added",e,n,r,i)}addResources(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in r)(Va(r[a])||Array.isArray(r[a]))&&this.addResource(e,n,a,r[a],{silent:!0});i.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,i,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[e,n];e.indexOf(".")>-1&&(s=e.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let c=NR(this.data,s)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?j8e(c,r,a):c={...c,...r},Dve(this.data,s,c),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var W8e={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,i){return t.forEach(a=>{var o;e=((o=this.processors[a])==null?void 0:o.process(e,n,r,i))??e}),e}};const Uve={};class UR extends dP{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),K$t(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=og.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return(r==null?void 0:r.res)!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!izt(e,r,i);if(o&&!s){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:Va(a)?[a]:a};const u=e.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(a=u.shift()),e=u.join(i)}return{key:e,namespaces:Va(a)?[a]:a}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(e[e.length-1],n),c=s[s.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode"){if(d){const S=n.nsSeparator||this.options.nsSeparator;return i?{res:`${c}${S}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${S}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}const f=this.resolve(e,n);let h=f==null?void 0:f.res;const p=(f==null?void 0:f.usedKey)||o,v=(f==null?void 0:f.exactUsedKey)||o,y=Object.prototype.toString.apply(h),g=["[object Number]","[object Function]","[object RegExp]"],m=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=!Va(h)&&typeof h!="boolean"&&typeof h!="number";if(b&&h&&x&&g.indexOf(y)<0&&!(Va(m)&&Array.isArray(h))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,{...n,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(f.res=S,f.usedParams=this.getUsedParamsDetails(n),f):S}if(a){const S=Array.isArray(h),w=S?[]:{},_=S?v:p;for(const A in h)if(Object.prototype.hasOwnProperty.call(h,A)){const P=`${_}${a}${A}`;w[A]=this.translate(P,{...n,joinArrays:!1,ns:s}),w[A]===P&&(w[A]=h[A])}h=w}}else if(b&&Va(m)&&Array.isArray(h))h=h.join(m),h&&(h=this.extendTranslation(h,e,n,r));else{let S=!1,w=!1;const _=n.count!==void 0&&!Va(n.count),A=UR.hasDefaultValue(n),P=_?this.pluralResolver.getSuffix(u,n.count,n):"",R=n.ordinal&&_?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",N=_&&!n.ordinal&&n.count===0,k=N&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${P}`]||n[`defaultValue${R}`]||n.defaultValue;!this.isValidLookup(h)&&A&&(S=!0,h=k),this.isValidLookup(h)||(w=!0,h=o);const H=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&w?void 0:h,F=A&&k!==h&&this.options.updateMissing;if(w||S||F){if(this.logger.log(F?"updateKey":"missingKey",u,c,o,F?k:h),a){const j=this.resolve(o,{...n,keySeparator:!1});j&&j.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let G=[];const z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&z&&z[0])for(let j=0;j<z.length;j++)G.push(z[j]);else this.options.saveMissingTo==="all"?G=this.languageUtils.toResolveHierarchy(n.lng||this.language):G.push(n.lng||this.language);const V=(j,Y,W)=>{var te;const Z=A&&W!==h?W:H;this.options.missingKeyHandler?this.options.missingKeyHandler(j,c,Y,Z,F,n):(te=this.backendConnector)!=null&&te.saveMissing&&this.backendConnector.saveMissing(j,c,Y,Z,F,n),this.emit("missingKey",j,c,Y,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&_?G.forEach(j=>{const Y=this.pluralResolver.getSuffixes(j,n);N&&n[`defaultValue${this.options.pluralSeparator}zero`]&&Y.indexOf(`${this.options.pluralSeparator}zero`)<0&&Y.push(`${this.options.pluralSeparator}zero`),Y.forEach(W=>{V([j],o+W,n[`defaultValue${W}`]||k)})}):V(G,o,k))}h=this.extendTranslation(h,e,n,f,r),w&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${c}:${o}`),(w||S)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,S?h:void 0))}return i?(f.res=h,f.usedParams=this.getUsedParamsDetails(n),f):h}extendTranslation(e,n,r,i,a){var u,d;var o=this;if((u=this.i18nFormat)!=null&&u.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=Va(e)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(f){const v=e.match(this.interpolator.nestingRegexp);h=v&&v.length}let p=r.replace&&!Va(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),e=this.interpolator.interpolate(e,p,r.lng||this.language||i.usedLng,r),f){const v=e.match(this.interpolator.nestingRegexp),y=v&&v.length;h<y&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var v=arguments.length,y=new Array(v),g=0;g<v;g++)y[g]=arguments[g];return(a==null?void 0:a[0])===y[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):o.translate(...y,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,c=Va(s)?[s]:s;return e!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(e=W8e.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,a,o,s;return Va(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),d=u.key;i=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Va(n.count),p=h&&!n.ordinal&&n.count===0,v=n.context!==void 0&&(Va(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(g=>{var m,b;this.isValidLookup(r)||(s=g,!Uve[`${y[0]}-${g}`]&&((m=this.utils)!=null&&m.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(s))&&(Uve[`${y[0]}-${g}`]=!0,this.logger.warn(`key "${i}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(x=>{var _;if(this.isValidLookup(r))return;o=x;const S=[d];if((_=this.i18nFormat)!=null&&_.addLookupKeys)this.i18nFormat.addLookupKeys(S,d,x,g,n);else{let A;h&&(A=this.pluralResolver.getSuffix(x,n.count,n));const P=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(S.push(d+A),n.ordinal&&A.indexOf(R)===0&&S.push(d+A.replace(R,this.options.pluralSeparator)),p&&S.push(d+P)),v){const N=`${d}${this.options.contextSeparator}${n.context}`;S.push(N),h&&(S.push(N+A),n.ordinal&&A.indexOf(R)===0&&S.push(N+A.replace(R,this.options.pluralSeparator)),p&&S.push(N+P))}}let w;for(;w=S.pop();)this.isValidLookup(r)||(a=w,r=this.getResource(x,g,w,n))}))})}),{res:r,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){var a;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,n,r,i):this.resourceStore.getResource(e,n,r,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!Va(e.replace);let i=r?e.replace:e;if(r&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const a of n)delete i[a]}return i}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class Fve{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=og.create("languageUtils")}getScriptPartFromCode(e){if(e=DR(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=DR(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(Va(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{this.logger.warn(`failed to format code: ${e}`)}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(a=>{if(a===i)return a;if(!(a.indexOf("-")<0&&i.indexOf("-")<0)&&(a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),Va(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),i=[],a=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return Va(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):Va(e)&&a(this.formatLanguageCode(e)),r.forEach(o=>{i.indexOf(o)<0&&a(this.formatLanguageCode(o))}),i}}const Bve={zero:0,one:1,two:2,few:3,many:4,other:5},Vve={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ozt{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=og.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=DR(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let o;try{o=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Vve;if(!e.match(/-|_/))return Vve;const c=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(c,n)}return this.pluralRulesCache[a]=o,o}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(i=>`${n}${i}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,a)=>Bve[i]-Bve[a]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const $ve=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=J$t(t,e,n);return!a&&i&&Va(n)&&(a=ij(t,n,r),a===void 0&&(a=ij(e,n,r))),a},jB=t=>t.replace(/\$/g,"$$$$");class szt{constructor(){var n;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=og.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:s,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:p,nestingSuffix:v,nestingSuffixEscaped:y,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=n!==void 0?n:ezt,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?UC(a):o||"{{",this.suffix=s?UC(s):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=h?UC(h):p||UC("$t("),this.nestingSuffix=v?UC(v):y||UC(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,i){var p;let a,o,s;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=v=>{if(v.indexOf(this.formatSeparator)<0){const b=$ve(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...i,...n,interpolationkey:v}):b}const y=v.split(this.formatSeparator),g=y.shift().trim(),m=y.join(this.formatSeparator).trim();return this.format($ve(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure),m,r,{...i,...n,interpolationkey:g})};this.resetRegExp();const d=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((p=i==null?void 0:i.interpolation)==null?void 0:p.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:v=>jB(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?jB(this.escape(v)):jB(v)}].forEach(v=>{for(s=0;a=v.regex.exec(e);){const y=a[1].trim();if(o=u(y),o===void 0)if(typeof d=="function"){const m=d(e,a,i);o=Va(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,y))o="";else if(f){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),o="";else!Va(o)&&!this.useRawValueToEscape&&(o=Ove(o));const g=v.safeValue(o);if(e=e.replace(a[0],g),f?(v.regex.lastIndex+=o.length,v.regex.lastIndex-=a[0].length):v.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,a,o;const s=(c,u)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const f=c.split(new RegExp(`${d}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);const p=h.match(/'/g),v=h.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!v||v.length%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,y),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;i=this.nestingRegexp.exec(e);){let c=[];o={...r},o=o.replace&&!Va(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(f=>f.trim());i[1]=d.shift(),c=d,u=!0}if(a=n(s.call(this,i[1].trim(),o),o),a&&i[0]===e&&!Va(a))return a;Va(a)||(a=Ove(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),u&&(a=c.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],a),this.regexp.lastIndex=0}return e}}const lzt=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(o=>{if(o){const[s,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},FC=t=>{const e={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=r+JSON.stringify(a);let s=e[o];return s||(s=t(DR(r),i),e[o]=s),s(n)}};class czt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=og.create("formatter"),this.options=e,this.formats={number:FC((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return a=>i.format(a)}),currency:FC((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>i.format(a)}),datetime:FC((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return a=>i.format(a)}),relativetime:FC((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return a=>i.format(a,r.range||"day")}),list:FC((n,r)=>{const i=new Intl.ListFormat(n,{...r});return a=>i.format(a)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=FC(n)}format(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(s=>s.indexOf(")")>-1)){const s=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,s)].join(this.formatSeparator)}return a.reduce((s,c)=>{var f;const{formatName:u,formatOptions:d}=lzt(c);if(this.formats[u]){let h=s;try{const p=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},v=p.locale||p.lng||i.locale||i.lng||r;h=this.formats[u](s,v,{...d,...i,...p})}catch(p){this.logger.warn(p)}return h}else this.logger.warn(`there was no format function for ${u}`);return s},e)}}const uzt=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class dzt extends dP{constructor(e,n,r){var a,o;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=og.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,r,i.backend,i)}queueLoad(e,n,r,i){const a={},o={},s={},c={};return e.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[h]=!0),a[h]===void 0&&(a[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(s[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const i=e.split("|"),a=i[0],o=i[1];n&&this.emit("failedLoading",a,o,n),!n&&r&&this.store.addResourceBundle(a,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const s={};this.queue.forEach(c=>{q$t(c.loaded,[a],o),uzt(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{s[u]||(s[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{s[u][f]===void 0&&(s[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,i+1,a*2,o)},a);return}o(u,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(e,n);u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}return}return c(e,n,s)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Va(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Va(n)&&(n=[n]);const a=this.queueLoad(e,n,r,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),i=r[0],a=r[1];this.read(i,a,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${n}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${n}loaded namespace ${a} for language ${i}`,s),this.loaded(e,o,s)})}saveMissing(e,n,r,i,a){var c,u,d,f,h;let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((h=this.backend)!=null&&h.create){const p={...o,isUpdate:a},v=this.backend.create.bind(this.backend);if(v.length<6)try{let y;v.length===5?y=v(e,n,r,i,p):y=v(e,n,r,i),y&&typeof y.then=="function"?y.then(g=>s(null,g)).catch(s):s(null,y)}catch(y){s(y)}else v(e,n,r,i,s,p)}!e||!e[0]||this.store.addResource(e[0],n,r,i)}}}const zve=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),Va(t[1])&&(e.defaultValue=t[1]),Va(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Hve=t=>{var e,n;return Va(t.ns)&&(t.ns=[t.ns]),Va(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Va(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},sM=()=>{},fzt=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class w5 extends dP{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Hve(e),this.services={},this.logger=og,this.modules={external:[]},fzt(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(Va(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=zve();this.options={...i,...this.options,...Hve(n)},this.options.interpolation={...i.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?og.init(a(this.modules.logger),this.options):og.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=czt;const f=new Fve(this.options);this.store=new kve(this.options.resources,this.options);const h=this.services;h.logger=og,h.resourceStore=this.store,h.languageUtils=f,h.pluralResolver=new ozt(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(h.formatter=a(d),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new szt(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new dzt(a(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(p){for(var v=arguments.length,y=new Array(v>1?v-1:0),g=1;g<v;g++)y[g-1]=arguments[g];e.emit(p,...y)}),this.modules.languageDetector&&(h.languageDetector=a(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=a(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new UR(this.services,this.options),this.translator.on("*",function(p){for(var v=arguments.length,y=new Array(v>1?v-1:0),g=1;g<v;g++)y[g-1]=arguments[g];e.emit(p,...y)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=sM),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const c=k_(),u=()=>{const d=(f,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(h),r(f,h)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),c}loadResources(e){var a,o;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sM;const i=Va(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&s.indexOf(f)<0&&s.push(f)})};i?c(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,u=>c(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(e,n,r){const i=k_();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=sM),this.services.backendConnector.reload(e,n,a=>{i.resolve(),r(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&W8e.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const i=k_();this.emit("languageChanging",e);const a=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,u)=>{u?(a(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},s=c=>{var d,f;!e&&!c&&this.services.languageDetector&&(c=[]);const u=Va(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||a(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{o(h,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),i}getFixedT(e,n,r){var i=this;const a=function(o,s){let c;if(typeof s!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];c=i.options.overloadTranslationOptionHandler([o,s].concat(d))}else c={...s};c.lng=c.lng||a.lng,c.lngs=c.lngs||a.lngs,c.ns=c.ns||a.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||a.keyPrefix);const h=i.options.keySeparator||".";let p;return c.keyPrefix&&Array.isArray(o)?p=o.map(v=>`${c.keyPrefix}${h}${v}`):p=c.keyPrefix?`${c.keyPrefix}${h}${o}`:o,i.t(p,c)};return Va(e)?a.lng=e:a.lngs=e,a.ns=n,a.keyPrefix=r,a}t(){var i;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(i=this.translator)==null?void 0:i.translate(...n)}exists(){var i;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(i=this.translator)==null?void 0:i.exists(...n)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(s,c)=>{const u=this.services.backendConnector.state[`${s}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const s=n.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!i||o(a,e)))}loadNamespaces(e,n){const r=k_();return this.options.ns?(Va(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=k_();Va(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){var i,a;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((a=this.services)==null?void 0:a.languageUtils)||new Fve(zve());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new w5(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sM;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new w5(i);return(e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new kve(this.store.data,i),a.services.resourceStore=a.store),a.translator=new UR(a.services,i),a.translator.on("*",function(s){for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];a.emit(s,...u)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Od=w5.createInstance();Od.createInstance=w5.createInstance;Od.createInstance;Od.dir;Od.init;Od.loadResources;Od.reloadResources;Od.use;Od.changeLanguage;Od.getFixedT;Od.t;Od.exists;Od.setDefaultNamespace;Od.hasLoadedNamespace;Od.loadNamespaces;Od.loadLanguages;const hzt={"5000.0001":"2D registration","5000.0002":"Upload slice","5000.0003":"Upload Failed,please contact the administrator","5000.0004":"View result","5000.0005":"Downloading","5000.0006":"Select the range","5000.0007":"remove the range","5000.0008":"preview selected data","5000.0009":"Tips: press the 'A' key to switch between pan and zoom modes","5000.0010":"Set the downsampling rate","5000.5018":"Download selected data","5000.5012":"Normal mode","5000.5013":"Virtual surgery mode","5000.5014":"Atlas mapping","5000.5019":"Upload 3D image or swc file already mapped to STAM or CCF","5000.5020":"Map the uploaded data to the other atlas:","5000.5021":"Start","5000.5022":"Download","5000.5023":"View result","5000.5024":"Other atlases","5000.5025":"Setting","5000.5026":"Simple mode","5000.5027":"Select structure","5000.5028":"Select target","5000.5029":"Remove target","5000.5017":"Intelligent planning","5000.5030":"Planning","5000.5015":"Select the direction of conversion","5000.5016":"Cranial","2002.0301":"Information","5000.5031":"Block size:","5000.0019":"or press 'R' key to switch between Rotation mode and Translation mode","5000.5034":"Auto","5000.5035":"Manual","5000.5057":"Show 3D morphology","5000.5056":"Hide 3D morphology","5000.5058":"Unable to calculate a path to avoid the structures you selected","5000.0112":"Cancel","2002.0302":"View data","5000.0111":"Save","4000.0210":"Translate-X","2002.0300":"Neuron collaborative annotation platform","5000.0113":"Alias in Dong's nomenclature","4000.0212":"Translate-Z","4000.0211":"Translate-Y","4000.0214":"Rotate-Y","5000.0110":"Edit","4000.0213":"Rotate-X","4000.0216":"View high resolution slice","4000.0215":"Rotate-Z","4000.0218":"Coordinate","4000.0217":"Left hemisphere","4000.0219":"Datum Marks","4000.0100":"","4000.0221":"go to coronal","4000.0220":"SIZE","4000.0102":"Bregma","4000.0223":"go to horizontal","4000.0101":"unit:mm","4000.0222":"go to sagittal","4000.0104":"Sagittal sections","4000.0225":"guide","4000.0103":"Coronal sections","4000.0224":"go to arbitrary","2001.0402":"View data","4000.0106":"search anatomical structures","2001.0401":"Information","4000.0105":"Horizontal sections","4000.0226":"Finish","4000.0108":"Brain maps 4.0","4000.0229":"Next","2001.0403":"Vessel","4000.0107":"ARA ontology","4000.0228":"Skip","4000.0109":"Mouse Brain Atlas","2001.0400":"Cerebral vascular atlas","1000.0400":"Login","2002.0202":"View data","2002.0203":"After nonlinear registration, the registered image is then returned to the user. Additionally, users receive access to isotropic 1-micron resolution cytoarchitectural slice with the same position and angle.","2002.0200":"Automatic slice registration","2002.0201":"We provide an automatic brain slice registration service where users can upload single brain slice images stained with PI or DAPI. This service, through approximately 10 minutes of background computation, extracts a slice from the three-dimensional STAM that is closest to the position of the user-uploaded brain slice.","2002.0602":"The service provides information on the distance between the injection site and the cranial or intracranial datum marks, as well as the injection angle, based on user interactions.","2002.0600":"Stereotactic surgical navigation service","2002.0601":"We have incorporated a stereotaxic surgical navigation service into the three-dimensional visualization service page. Users can simulate the stereotaxic surgical procedure of injecting viruses into the mouse brain through interactive operations.","6000.0112":"Please enter an email address","6000.0110":"Please enter the purpose of the data","6000.0111":"Label image download","7000.0108":"Start","7000.0109":"Save","7000.0106":"Calculate the corresponding plane from the atlas","7000.0107":"View higher resolution image","4000.0201":"Anatomical Structure","7000.0104":"Get test image","4000.0200":"","7000.0105":"Upload","4000.0203":"Virtual surgery","7000.0102":"Description","4000.0202":"Assembling","7000.0103":"Choose the type of uploaded slice","4000.0205":"Magnitude","7000.0100":"","4000.0204":"Atlas reslicing","7000.0101":"Image registration service","4000.0207":"Scaling","4000.0206":"Frequency","2001.0101":"STAM's two-dimensional visualization service provides a digital map-style online browsing function with 700 coronal planes, 256 sagittal planes, and 367 horizontal planes.","4000.0209":"Reset","2001.0100":"2D visualization","4000.0208":"Select Target","2001.0103":"Users can observe individual standard profiles at different resolutions, navigate profiles at different locations along the same direction, and switch between the three standard profile directions. Each standard profile is a 20μm-thick projection image overlaid with a coordinate grid and annotated with boundaries of neuroanatomical structures.","2001.0102":"View data","1000.0302":"Contact us","2000.0800":"Manual Instruction","1000.0303":"Help","1000.0300":"About","1000.0301":"Introduction","2002.0103":"Users can choose the angle of interest and examine the isotropic 1-micron resolution cytoarchitectural brain slice at that angle. This service provides newly generated slices with annotations for brain regions and nuclei.","4000.0131":"Show Contour","2002.0500":"Anatomical knowledge base","4000.0130":"Show Atlas","2002.0101":"We also offer the service of visualizing slices at arbitrary angles.","2002.0102":"View data","4000.0132":"Nucleus Information","2002.0501":"We have developed a neuroanatomical knowledge base service for STAM.","7000.0113":"Upload and Download","2002.0502":"When users are exploring the three-dimensional topography of brain structures of interest using the two-dimensional and three-dimensional visualization services, they can conveniently access this knowledge base by right-clicking with the mouse. This allows them to query information related to the structure of interest, such as gene expression, neurotransmitters, projection pathways, and more. The knowledge base provides an entry point for the public to actively contribute, edit, and enhance neuroanatomical knowledge.","7000.0111":"Uploaded Image","7000.0112":"Output Image","7000.0110":"Any question about this online registration tool, welcome to contact atlas@brainsmatics.org","2002.0100":"Arbitrary-angle slice visualization","6000.0105":"Purpose of the data","6000.0106":"Submit","6000.0103":"Postal address","6000.0104":"E-mail","6000.0109":"Please enter a postal address","2000.2001":"Brain atlas and data","6000.0107":"Please enter the company name","6000.0108":"Please enter the contact person","2001.0203":"Users are capable of exploring the overall appearance as well as details of any anatomical structure of interest in three-dimensional space, from different perspectives and magnification levels. Additionally, through the assembly view feature, users can unfold the sub-structures contained within each brain region and nucleus, providing a detailed examination of the internal components.","2001.0200":"3D visualization","6000.0101":"Company Name","6000.0102":"Contact person","2001.0202":"View data","2001.0201":"STAM's three-dimensional visualization service reconstructs the three-dimensional topography of 915 brain regions and nuclei.","6000.0100":"","1000.0203":"Neuron collaborative annotation platform","1000.0204":"Data sharing service","1000.0200":"Tools","1000.0201":"High-resolution arbitrary angle reslicing service","1000.0202":"Image registration service","2000.2002":"Services","2000.0500":"Brains-Map","2002.0400":"Data sharing service","4000.0230":"Back","2002.0401":"Information","4000.0111":"D - V","4000.0232":"Step 2","4000.0110":"A - P","4000.0231":"Step 1","4000.0113":"Display","4000.0234":"Step 4","4000.0112":"M - L","4000.0233":"Step 3","2002.0402":"View data","4000.0115":"2D Navigation","4000.0236":"Select a structure on the left","4000.0114":"3D Atlas","4000.0235":"Click the start button","4000.0117":"Reset to default view","4000.0238":"Click the End button","4000.0116":"Annotation","4000.0237":"Left-click on the selected structure to<br> determine the injection site, <br>and then move the mouse to determine the injection direction","4000.0119":"Gridlines","4000.0118":"Information box","4000.0239":"Set the expanded length","4000.0120":"GO TO","4000.0241":"Click the icon here to expand the selected structure, <br> click the icon again to exit from the expanded state","5000.0101":"alias in Paxinos's nomenclature","4000.0240":"Sets the degree of zooming out of the <br>center expansion","5000.0100":"","4000.0122":"Introduction of this structure","4000.0243":"Right click on this structure in the model and select the face you need","5000.0103":"Reference","4000.0121":"3D Viewer","4000.0242":"Clear Target","5000.0102":"alias in Hof's nomenclature","4000.0124":"Zoom out","4000.0245":"Click to view higher resolution images","4000.0123":"Figure","4000.0244":"On the right side, you can drag the position of the section","0800.0801":"Operating Instructions The interface for the two-dimensional visualization service is illustrated below. The central area is the main window, used to display STAM's standard profiles (<span>①</span>) and the brain region annotations on these profiles (<span>②</span>). Users can use the left mouse button and scroll wheel in the main window to move, and zoom in to the resolution of the region of interest. When the user hovers the mouse over an annotation for a brain region or nucleus, the annotation switches to a blue highlighted mode (<span>③</span>), and the full name of the highlighted brain region or nucleus is displayed in the lower-left corner (<span>④</span>). The light gray grid behind the standard profile and annotations shows the distribution of the STAM coordinate system on the current standard profile (<span>⑤</span>). As the user moves the mouse, the real-time position of the mouse in the STAM coordinate system is displayed in the lower-left corner of the main window (<span>⑥</span>). Users can also observe the position of the current viewed standard profile in the entire mouse brain through the navigation window in the upper left corner (<span>⑦</span>). Users can freely switch to other profiles (<span>⑧</span>) or switch between different anatomical directions, such as coronal, sagittal, and horizontal planes (<span>⑨</span>). Additionally, users can search for brain regions or nuclei of interest in the input box (<span>⑩</span>) or navigate through the anatomical ontology tree (<span>⑪</span>). If the current viewed profile does not include the searched structure, it will jump to the nearest profile in the same direction that contains the structure. At the bottom of the main window is the button panel for the two-dimensional visualization service (<span>⑫</span>). The button functions, from left to right, include: zoom out, zoom in, reset view, full screen, switch to three-dimensional visualization service, switch to arbitrary angle cross-section visualization service, display mode switch, and jump to other profiles in the current anatomical direction.","4000.0126":"Reset","4000.0125":"Zoom in","4000.0128":"To 3d Viewer","5000.0109":"Chemical name","2001.0302":"View data","4000.0127":"Full Screen","5000.0108":"Disease name","2001.0701":"The Stereotaxic Topographic Atlas of the Mouse Brain (STAM) is a three-dimensional topographical atlas that depict the anatomical structures of the whole mouse brain, achieving precise single-cell resolution localization. This atlas is based on a three-dimensional Nissl-stained image dataset with isotropic one-micron resolution and is constructed by incorporating various auxiliary imaging data, including immunohistochemistry, neural circuit projections, and specific gene type neuron distribution data. Here, we established the STAM visualization platform, which includes services for exploring standard two-dimensional anatomical sections, three-dimensional topography, and arbitrary-angle slices of the brain atlas. The platform integrates different functionalities such as neuroanatomical knowledge base, stereotaxic surgical navigation, and automatic registration of user-uploaded slices. The STAM visualization platform is expected to provide an effective spatial localization benchmark for the registration and integration of results from single-cell level studies, such as multi-omics and neurocircuitry.","2001.0700":"The brief introduction to STAM","4000.0129":"E-mail","5000.0105":"Disease","5000.0104":"Gene","2001.0301":"Information","5000.0107":"Gene name","2001.0300":"Neuronal morphology database","5000.0106":"Chemical","1000.0104":"Cerebral vascular atlas","1000.0500":"Language","1000.0501":"Simplified Chinese","1000.0502":"English","1000.0100":"Atlas","1000.0101":"Stereotactic atlas","1000.0102":"Specific cell type distribution atlas","1000.0103":"Neuronal morphology database","0800.0803":"Operating Instructions The interface for the three-dimensional visualization service is illustrated as followed. The left side features the navigation window, while the right side is the main window. The main window displays the arbitrary angle slice of STAM (<span>①</span>) and the brain region annotations on that slice (<span>②</span>). Users can pan in the main window by holding down the left mouse button, zoom in using Ctrl + scroll wheel, or switch to different neighboring slices along the current angle by using the scroll wheel. On the right side of the main window is the list of brain regions and nuclei (<span>③</span>). When the user moves the mouse over the name of a structure of interest, the annotation for that structure in the main window is highlighted in light gray (<span>④</span>). Users can also move the mouse over the annotation of a structure of interest in the main window, and the name of that structure in the list of brain regions and nuclei on the right will automatically be highlighted. At this time, the name of the structure will also be displayed in the lower-left corner of the main window (<span>⑤</span>). Below the structure name is the scale bar of the slice image in the main window at the current resolution (<span>⑥</span>). In the navigation window on the left side, the central area displays the three-dimensional model of the right half of the mouse brain (<span>⑦</span>). The black plane corresponds to the position and angle of the slice in the main window (<span>⑧</span>). The red, green, and blue circles around the model are used to change the pitching, rotation, and rolling angles of the cross-section (<span>⑨</span>). Users can also input values in the lower-left corner of the navigation window to set the slice angle (<span>⑩</span>). The red, green, and blue arrows in the navigation window are used to determine the position of the slice along the given arbitrary angle in the three-dimensional space (<span>⑪</span>).","0800.0802":"Operating Instructions The interface for the three-dimensional visualization service is depicted as followed. The central area is the main window, which initially displays the outline of the mouse brain (<span>①</span>). On the left side of the main window is the anatomical ontology tree (<span>②</span>), where users can choose any structure of interest. By checking the three-dimensional model of the selected structure, it will be displayed in the main window (<span>③</span>), and the full name of the structure will appear in the lower-left corner of the main window (<span>④</span>). Users can use a long press of the left mouse button in the main window to select the observation angle and a long press of the right mouse button to pan the view. The gray grid behind the three-dimensional model represents the STAM coordinate system (<span>⑤</span>), with the coordinate origin selected by users from the candidates, indicated by a red sphere in the main window (<span>⑥</span>). As the user moves the mouse, the real-time position of the mouse in the STAM coordinate system is displayed in the lower-left corner of the main window (<span>⑦</span>). By clicking the blue three-dimensional cube icon to the right of any structure name in the anatomical naming tree, users can enter assembly view mode (<span>⑧</span>). In this mode, users can adjust parameters such as the degree of expansion of substructures to control the display effect (<span>⑨</span>).","0800.0805":`Operating Instructions The stereotaxic surgical navigation service is illustrated as followed and is integrated into the three-dimensional visualization service interface. Therefore, basic user interactions can refer to Section "Three-Dimensional Visualization Service." The surgical navigation panel is located on the right side of the main window. After clicking on the "Viral injection" tab, users can continue by clicking the "start programming" button to enter navigation mode (<span>①</span>). At this point, users can select brain regions or nuclei of interest from the anatomical naming tree on the left side of the interface. Once the three-dimensional model of the selected structure is displayed in the main window, users can use the left mouse button to set the injection site on the model (<span>②</span>). Subsequently, the surgical navigation service will automatically generate a ray emanating from the injection site, following the direction of the user's mouse movement (<span>③</span>). After adjusting the mouse position to set the injection direction, clicking the left mouse button again will generate a target point on the external surface of the mouse brain (<span>④</span>). The coordinates of the injection site and target point are displayed below the navigation service panel (<span>⑤</span>). These coordinates represent the relative positions of the two points to the user-selected datum marks, such as the Bregma point, in three-dimensional space. Users can also switch to any cranial and intracranial datum marks of interest. Additionally, the calculated information includes the angle between the user-selected injection direction and the three standard profiles of coronal, sagittal, and horizontal planes (<span>⑥</span>).`,"0800.0804":"Operating Instructions The interface for the neuroanatomical knowledge base service is depicted in the diagram below. Each brain region or nucleus has an independent page, and the example shown is a schematic representation of the knowledge base page for the Lateral dorsal nucleus of the thalamus (LD) nucleus. The page includes, from top to bottom, an overview of the structure of interest (<span>①</span>), aliases (<span>②</span>), references related to this structure (<span>③</span>), as well as information related to genes (<span>④</span>), chemicals (<span>⑤</span>), diseases (<span>⑥</span>), and more. For each gene, chemical, and disease, corresponding references are also listed. Additionally, we provide an entry point for users to edit the content. Users can click the Edit button on the right side of the page to submit edits, and we will review the content submitted by users in the background.","0800.0806":"Operating Instructions The brain slice automatic registration service interface is illustrated as followed. In the upper-left corner is the image upload panel (<span>①</span>), with a radio button on the left containing the currently allowed types of images for registration. After selecting the image type, users can click the Upload button on the right to upload the brain slice image for registration. Users can also click the “Get test image” button to download a test image and then upload it for testing. The uploaded image will be displayed in the lower-left corner of the interface (<span>②</span>). Once the upload is complete, click the “Start” button in the registration calculation panel on the upper-right side of the interface (<span>③</span>), and the background computation will begin. After the calculation is completed, the results will be displayed on the lower-right side of the interface (<span>④</span>). Users can click the “Save” button in the calculation panel to download the results locally. Alternatively, clicking the View higher resolution image button will navigate to the arbitrary angle slice service, allowing users to observe high-resolution cytoarchitectural images at the corresponding angle.","5000.0200":"Regions to avoid","5000.0201":"Structure for injecting","5000.0202":"Regions","5000.0204":"Vessels","5000.0205":"Vessels to avoid","5000.5060":"Hide neural circuit","5000.5061":"Show neural circuit","5000.5039":"Download the 3D image containing {{name}}","5000.5038":"Set {{name}} as the origin","5000.5040":"Input the region that soma locates","5000.5041":"Input the region that neuron projects","5000.0206":"Show vascular branches passing by","5000.0207":"Hide vascular branches passing by","5000.0208":"Show structures it supplies","5000.0209":"Hide structures it supplies","5000.5044":"Using this feature requires an API key. At this time, we provide a temporary key for testing. Click Go on button.","5000.5051":"Tip: Your API-key will be sent to the email address you provided. Please check your email after submission to ensure you have received the email containing your API-key.","5000.0011":"Sending emails","5000.5043":"Fill in the Key","5000.5042":"Request a Key","5000.5045":"Submit","5000.5049":"Key value","5000.5070":"Applicant","5000.5071":"Email","5000.5072":"Affiliation","5000.5073":"Purpose of use","5000.5050":"Save","5000.5052":"Neuronal circuits","5000.5053":"Input the inquired structure","5000.5047":"Commit failure","5000.5048":"Submit successfully","5000.5054":"Upstream","5000.5055":"Downstream","5000.5083":"Step 1","5000.5084":"Step 2","5000.5085":"Set Unfold Length","5000.5080":"Click the icon here to expand the selected structure. Clicking the icon again will allow you to exit from the expanded state","5000.5081":"Select a structure on the left side","5000.5082":"Please select injection mode,if automatic mode is selected, click on the left cell name to select the nucleus to bypass","5000.5086":"Chat with STAM","5000.6001":"Input an inquired structure to visualize the connectivity map, for example, ","5000.6002":"Language","5000.0012":"The current download file has exceeded the server transfer limit. You can choose to reduce the sampling level or send an email. Do you want to send an email?","5000.6003":"Neural circuit","5000.6004":"Hide this neuron","5000.6005":"Coronal view","5000.6006":"Sagittal view","5000.6007":"Horizontal view","5000.6008":"Click the button below to apply for downloading the 3D label image of the isotropic 10 micron resolution STAM map","5000.6009":"Requesting STAM labels","5000.6010":"Tip: The license for downloading will be sent to the email address you provided. Please check your email after submission to ensure you have received the email containing your license.","5000.6011":"Using this feature requires a license. If you do not have a license, please apply for one from us by click the button below.","5000.6012":"Request a license","5000.6013":"Fill in the license","5000.6014":"License number","5000.6015":"Inquire neurons that locate and project to","5000.6019":"Navigate the knowledge of {{focusVirusLineItem}}","5000.6020":"Navigate the knowledge of {{focusVirusLineItem}}'s parent {{lableValue}}","5000.6016":" RGB value","5000.6017":"Subcerebral region","5000.6018":"View higher resolution image","5000.6021":"Hide this branch","5000.6022":"Bounding box of {{lableStr}} as the range","5000.6023":"Hide 3D morphology of {{name}}","5000.6024":"Show 3D morphology of {{name}}","5000.6025":"Switch to coronal plane","5000.6026":"Switch to sagittal plane","5000.6027":"Switch to horizontal plane","5000.6028":"Switch to arbitrary plane","5000.6029":"Navigate the ","5000.6030":"whole-brain connectivity diagram","5000.6031":" consisting of single neuronal projections,or: ","5000.6032":",or: ","5000.6033":"Upload slice, or use the test ","5000.6034":" slices:","5000.6035":"Upload 3D image or swc file already mapped to STAM or CCF, otherwise use the test ","5000.6036":"3D image","5000.6037":"swc file:","5000.6038":"Data source: {{name}}","5000.6039":"Flat skull position","5000.6040":"Abundant projections","5000.6041":"New annotation","5000.6042":"Off","5000.6043":"On","5000.6044":"Grid","5000.6045":"Brain contour","5000.5087":"Step 3","5000.5088":"Step 4","8000.0001":"As shown in ①, on the left of the main window is the data panel, where users can select the anatomical nomenclature tree of STAM, cerebral vascular atlas registered to the STAM and neuron morphological data. You can also switch between different versions of anatomical nomenclature systems.","8000.0002":"As shown in ②, it can load three-dimensional models of brain regions or nuclei in the main window.","8000.0003":"As shown in ③, users can switch to different modes or functional modules.","8000.0004":"The 'Regions' tab includes the anatomical nomenclature tree of STAM, where you can select any number of structures of interest via checkboxes in the main window. The 'Vessels' tab contains a complete cerebral vascular atlas registered to the STAM, allowing to select vascular branches of interest. The 'Neurons' tab is used to query and filter neuron morphological data with somas or projection targets located in regions of interest. You can also switch to Brain maps 4.0 ontology, the structures of which could also be searched, selected and visualized.","8000.0005":"Users can click on blue square icon in the anatomical nomenclature tree under the 'Regions' tab, all substructures of the clicked structure will be visualized in an assembled form in the main window, and the expansion magnitude can be set in the right panel. By default, this coordinate system uses the Bregma point as the origin. You can also switch the coordinate origin to any of the other 19 cranial or intracranial datum marks provided by STAM, and the coordinates of the objects visualized in the main window will be recalculated based on the new origin. Right click on any cranial or intracranial datum marks to save the STAM label image with the cranial or intracranial datum marks as the coordinate origin.","8000.0006":"Users can switch to the 'setting' tab on the bottom. The 'Left hemisphere' switch determines whether the left hemisphere is displayed in the main window, and it is off by default. The 'Coordinate' switch determines whether coordinate values are displayed in the main window, and it is on by default. The 'Datum Marks' switch determines whether datum marks are displayed in the main window, and it is on by default. The 'Cranial' switch determines whether the three-dimensional contour of the skull is displayed in the main window, and it is off by default. ","8000.0007":"We have developed a virtual surgery navigating service. Users can simulate the stereotaxic surgical procedure of injecting viruses into the mouse brain through interactive operations. Based on user inputs, the STAM provides the information on the distance and injection angle between the injection site and origin defined by cranial or intracranial datum marks.","8000.0008":"Firstly, select the brain region for injection. Next, select the injection target on the chosen brain region. Continuing to click the 'Select target' button, a green dot follows the mouse cursor on the surface of the brain region's 3D model. Then, clicks 'Auto' to enter automatic type, the 'Structure for injecting' tab on the left data panel changes to 'Regions to avoid'. By clicking on the names of brain regions or nuclei to avoid, the selected text will highlight in bright red. Simultaneously, the 3D contours of these structures will be visualized in the main window. Next, clicking the 'Intellectual planning' button on the right panel initiates the process. After a few seconds, STAM returns a path originating from the injection target, avoiding all user-selected brain regions and nuclei.","8000.0009":"If the user clicks 'Manually' to enter manual planning type, the marked injection target turns into a blue dot. A red dashed line originates from the injection target and extends towards the current mouse position. The intersection of this dashed line with the outline of STAM (i.e., the injection site) is marked in green. Once the user identifies a suitable injection path, they can left-click to mark it. The marked path will appear as a solid blue line in the main window, with the injection site marked as a blue cone. The names of brain regions and nuclei that the path passes through will be arranged along the solid line according to their spatial positions. In the right panel, information about the angle between the injection path and three standard anatomical directions, the injection target, and the injection site is displayed. If the user wishes to restart the entire virtual surgery process, they can click the 'Reset' button on the right panel.","8000.0011":"As shown in ①, users can upload single brain slice images stained with PI or DAPI. This service will generate a corresponding atlas slice from STAM that is closest in position to the uploaded brain slice. The computed angle and position will then be displayed in the main window.","8000.0012":"Users can upload the 2D brain slice image in tif/tiff format for registration from your local device. Then select the type of the uploaded image. Next, click the 'Start' button in the 'Calculate the corresponding plane from the atlas' button group and wait for the result from the server. Once the calculation is complete, a preview image of the calculation result will appear below the 'Start' button, which can be enlarged by left-clicking. The 'Save' button to the right of the 'Start' button will also become clickable. By clicking this 'Save' button, users can download the calculation result to their local device.","8000.0013":"Right-click on the corresponding brain region or nucleus in the main window can jump to Arbitrary plane visualization and neuroanatomical knowledge base.","8000.0014":"As shown in ① and ②, users can select any region of interest within the 3D space of STAM and download the original images of the selected region at different sampling rates.","8000.0015":"Users can click “Select the range” button and orange-lined box will appear in the main window. Users can control the box's translation by left-clicking and dragging the red, green, and blue arrows, respectively. When an arrow is selected, it will be highlighted as bright yellow. ","8000.0016":"Users can switch from translation mode to scaling mode by pressing the 'A' key on the keyboard. In this mode, the arrows will change to squares, and dragging these squares will resize the box. Once the spatial range for the data to be downloaded is determined, users can click the 'preview selected data' button. This will visualize the images within the selected range in the main window using volume rendering.","8000.0017":"By dragging the 'Set the downsampling rate' slider, users can select the sampling rate for the data to be downloaded. The specific sampling rate value can be seen in the black-backgrounded tip above the slider. If the data size does not exceed 1 GB, clicking the 'Downloading' button to download it directly; When the value is exceeded, it will invoke the user's email client (such as Outlook) and automatically fill in the email body with the selected download range and sampling rate information. By clicking the send button, users can submit a data download request to the STAM website.","8000.0018":"We support users in uploading 3D image data and neuronal morphology data previously registered to the Common Coordinate Framework (CCF), then mapping it onto STAM, and directly visualizing it in 3D space. We also support reverse mapping, which allows data of the same type that has been registered to STAM to be mapped onto the CCF.","8000.0019":"Users can click the 'Upload' button in the right panel to upload 3D image data or neuronal morphology data that has been previously registered to either the CCF or STAM. After the uploading is completed, selecting the direction of conversion (either from STAM to CCF or vice versa) in the 'Select the direction of conversion' radio button. Then, click the 'Start' button to start the calculation on the STAM server. At this point, the 'Start' button enters the waiting status.","8000.0020":"After waiting for about 10 minutes, the STAM server finishes the calculation and returns the results. At this point, both the 'Save' button and the 'View result' button become clickable. Clicking the 'Save' button allows you to download the results to your local device; clicking the 'View result' button lets you preview the calculation results in the main window.","8000.0021":"We provide services to visualize atlas reslicing from any angle. Users can choose reslicing of STAM at any position and angle of interest, browse the brain regions and nucleus annotations on that reslicing, and jump from this reslicing to the isotropic 1-micron resolution reslicing provided by the STAM arbitrary section service.","8000.0022":"As shown in ①, on the left of the main window is the data panel, which has the same function as the data panel in “Stereotaxic topography visualization”. The central area is the main window.","8000.0023":"As shown in ②, users can also achieve translation and rotation of the atlas reslicing by dragging the sliders. The specific translation and rotation values can be seen in the black-background tip above the slider.","8000.0024":"Users can control the atlas reslicing's translation by left-clicking and dragging the red, green, and blue arrows, respectively. Users can switch from translation mode to rotation mode by pressing the 'R' key on the keyboard. In this mode, the arrows will change to sphere, and dragging these spheres will control the rotation of the atlas reslicing. ","8000.0025":"Users can also achieve translation and rotation of the atlas reslicing by dragging sliders. Users can clicking the “View higher resolution image” button can jump to Arbitrary plane visualization and click the “Requesting STAM labels” button and fill in the license to download 3D label images of isotropic 10 micron resolution STAM atlas.","8000.0026":"We provide services to visualize neuronal circuits of whole mouse brain somas or projection targets. Users can select any neural circuit data with somas or projection targets located in brain region or nuclei of interest, and examine the corresponding brain region and nuclei annotations of the neural circuit.","8000.0027":"As shown in ①, on the left of the main window is the data panel, which has the same function as 'Stereotaxic topography visualization'. The 'Neurons' tab is used to query and filter neuron morphological data with somas or projection targets located in regions of interest.","8000.0028":"As shown in ②, users can search for the brain region or nucleus of interest in the search box.","8000.0029":"As shown in ③, it is a neural circuit connection diagram composed of several brain regions and nucleus substructures.","8000.0030":"Users can click the 'whole brain connectivity diagram' button or search for the brain region or nucleus of interest in the search box to pop up a neural circuit connection diagram composed of several brain regions and nucleus substructures. Different dots represent different brain regions and nuclei, and the name of the brain region or nuclei is displayed next to the dot. Users can hover the mouse over dot or the name of a brain region or nuclei, left and right click the dot.","8000.0031":"Double click any dot representing a brain region or nuclei to hide the neural circuit connection diagram window and return to the main window page, displaying the upstream and downstream connection relationships of that structure. The neural circuits projected to the selected brain area and nucleus are displayed in the Upstream window, and the projection target areas of the selected brain area and nucleus are displayed in the Downstream window. Users can select any number of neurons of interest via checkboxes and visualize them in the main window.","8000.0032":"Query of anatomical structures, cerebral vascular, and neurons","8000.0033":"Visualize anatomical substructures and switch coordinate origin","8000.0034":"Visualization function settings","8000.0035":"Automatic planning mode","8000.0036":"Manual planning mode","8000.0037":"Upload brain slice image and calculate or download registration result","8000.0038":"Function of page jump","8000.0039":"Zoom mode to select the range of original image data and previews the image","8000.0040":"Select the sampling rate of the data and download","8000.0041":"Upload 3D image data and calculate","8000.0042":"Preview or download the result after the calculation is completed","8000.0043":"Translate or rotate the slice of the atlas for sectional view","8000.0044":"Download 3D label images of isotropic 10 micron resolution STAM atlas","8000.0045":"View the neural circuit connectivity diagram and interact","8000.0046":"Display the upstream and downstream connections of any user-appointed brain structure","8000.0047":"ranslation mode to select the range of original image data","5000.7001":"atlas","5000.7002":"first","5000.7003":"second","5000.7000":"(Optional) Upload the second slice, which is previously co-registered to the first uploaded slice","5000.7004":"opacity","5000.7005":"Terminals","5000.7006":"Visibility","5000.7007":"Branchings","5000.7008":"Analysis","5000.7009":"Distribution of neuron terminals","5000.7010":"terminals","5000.7011":"Pattern of neuron projections","5000.7012":"Distribution of projection length","5000.7013":"fliplr","7000.7014":"Also, you can download the ","7000.7015":" plugins for this function. If you want to use the test data, click","7000.7016":" here ","7000.7017":"to download.","7000.7018":"Issue report","7000.7019":"Set as the focus","7000.7020":"Reset the focus","7000.7021":"Reslicing Mode","7000.7022":"Translate","7000.7023":"Rotate","7000.7024":"Control mode","7000.7025":"Display available neurons only","7000.7026":"Click the Color button to modify the neuron color; click the Ana. button to display the analysis results of the neuron's projection pathway; click the Path button to show the brain structures traversed by the neuron on the main window; the Src button displays the source of the neuron data.","7000.7027":"Feedback","5000.7026":"Request timed out, download failed","5000.7027":"computational failure","5000.7028":"Cannot find a satisfactory path","5000.7029":"Too many regions to avoid, please reduce the number of regions to avoid","5000.7030":"Click here to download the queried results","5000.7031":"If you haven't applied for the key, you can click it."},pzt={"2002.0301":"提供基于多人在线协作模式,神经元重建","5000.0112":"取消","2002.0302":"查看数据","5000.0111":"提交","4000.0210":"平移-X","2002.0300":"神经元协同标注平台","5000.0113":"董宏伟命名系统别名","4000.0212":"平移-Z","4000.0211":"平移-Y","4000.0214":"角度-Y","5000.0110":"编辑","4000.0213":"角度-X","4000.0216":"查看高分辨率切片","4000.0215":"角度-Z","4000.0218":"坐标","4000.0217":"左半脑","4000.0219":"基准点","4000.0100":"","4000.0221":"转到冠状面","4000.0220":"大小","4000.0102":"前囟","4000.0223":"转到水平面","4000.0101":"单位:毫米","4000.0222":"转到矢状面","4000.0104":"矢状面","4000.0225":"引导","4000.0103":"冠状面","4000.0224":"转到任意面","2001.0402":"查看数据","4000.0106":"脑解剖结构检索","2001.0401":"探索血管图谱数据库","4000.0105":"水平面","4000.0226":"完成","4000.0108":"脑地图4.0命名系统","4000.0229":"下一步","2001.0403":"血管","4000.0107":"艾伦参考脑命名系统","4000.0228":"跳过","4000.0109":"小鼠脑图谱","2001.0400":"血管图谱","1000.0400":"登录","2002.0202":"查看数据","2002.0200":"配准服务","2002.0201":"提供脑片配准服务","6000.0112":"请输入电子邮箱","6000.0110":"请输入数据用途","6000.0111":"Label图像下载","7000.0108":"开始计算","7000.0109":"下载保存","7000.0106":"计算与上传图像对应的图谱切面","7000.0107":"查看更高分辨率的图像","4000.0201":"解剖结构","4000.0443":"先在左侧选择一个结构","7000.0104":"获取测试图像","4000.0200":"","7000.0105":"上传","4000.0203":"虚拟手术","4000.0445":"在右侧可以拖动截面的位置","7000.0102":"描述","4000.0202":"装配图","4000.0444":"在模型中右击选择你需要的面","7000.0103":"选择上传图像的类型","4000.0205":"展开幅度","7000.0100":"","4000.0204":"图谱切面","4000.0446":"点击查看更高分辨率的图像跳转","7000.0101":"配准服务","4000.0207":"缩放","4000.0206":"步长","2001.0101":"探索立体定位图谱的2D/3D图像信息","4000.0209":"重置","2001.0100":"立体定位图谱","4000.0208":"选择靶点","2001.0102":"查看数据","1000.0302":"联系我们","1000.0303":"帮助","1000.0300":"关于","1000.0301":"简介","4000.0131":"仅显示结构轮廓","4000.0130":"显示图谱","2002.0101":"提供高分辨任意角度切面服务","2002.0102":"查看数据","4000.0132":"核团信息","7000.0113":"上传和下载","7000.0111":"上传的图像","7000.0112":"输出的图像","7000.0110":"如果对这个在线注册工具有任何疑问,欢迎联系atlas@brainsmatics.org","2002.0100":"高分辨任意角度切面服务","6000.0105":"数据用途","6000.0106":"提交","6000.0103":"通讯地址","6000.0104":"电子邮箱","6000.0109":"请输入通讯地址","2000.2001":"图谱和数据","6000.0107":"请输入单位名称","6000.0108":"请输入联系人员","2001.0200":"特定类型细胞分布图谱","6000.0101":"单位名称","6000.0102":"联系人员","2001.0202":"查看数据","2001.0201":"探索特定类型细胞分布图谱的2D/3D图像信息","6000.0100":"","1000.0203":"神经元协同标注平台","1000.0204":"数据共享服务","1000.0200":"工具","1000.0201":"高分辨任意角度切面服务","1000.0202":"配准服务","2000.2002":"服务","2000.0500":"脑图谱","2002.0400":"数据共享服务","4000.0230":"上一步","2002.0401":"Label图像下载服务","4000.0111":"背-腹","4000.0232":"第二步","4000.0110":"前-后","4000.0231":"第一步","4000.0113":"显示","4000.0234":"第四步","4000.0112":"内-外","4000.0233":"第三步","2002.0402":"查看数据","4000.0115":"二维浏览","4000.0236":"在左侧选择一个结构","4000.0114":"三维图谱","4000.0235":'点击"开始"按钮',"4000.0117":"重置为默认视图","4000.0238":'点击"结束"按钮',"4000.0116":"标注","4000.0237":"在选择的结构上左键点击确定注射位点,<br>再通过移动鼠标确定注射方向","4000.0119":"网格线","4000.0118":"信息框","4000.0239":"设置展开长度","4000.0120":"前往","4000.0241":"点击此处图标,选中的结构会展开,<br>再次点击该图标后可以从展开状态中退出","5000.0101":"Paxinos命名系统别名","4000.0240":"设置中心展开的缩小程度","5000.0100":"","4000.0122":"该结构介绍","5000.0103":"参考","4000.0121":"三维浏览器","4000.0242":"清除靶点","5000.0102":"Hof命名系统别名","4000.0124":"缩小","4000.0123":"图示","4000.0126":"重置","4000.0125":"放大","4000.0128":"前往三维浏览器","5000.0109":"化学物质名称","2001.0302":"查看数据","4000.0127":"全屏","5000.0108":"疾病名称","4000.0129":"查看高分辨率图像","5000.0105":"疾病","5000.0104":"基因","2001.0301":"探索神经元形态数据库","5000.0107":"基因名称","2001.0300":"神经元形态数据库","5000.0106":"化学物质","1000.0104":"血管图谱","1000.0100":"脑图谱数据","1000.0101":"立体定位图谱","1000.0102":"特定类型细胞分布图谱","1000.0103":"神经元形态数据库","5000.0001":"脑片配准","5000.0002":"上传图像","5000.0003":"上传失败,请联系管理员","5000.0004":"显示结果","5000.0005":"数据下载","5000.0006":"选取下载范围","5000.0007":"取消选取范围","5000.0008":"预览下载图像","5000.0009":"提示:按A键切换平移和缩放模式","5000.0010":"设置采样倍数","5000.5012":"默认模式","5000.5013":"虚拟手术模式","5000.5014":"图谱映射","5000.5015":"选择转换方向","5000.5016":"颅骨","5000.5018":"下载所选范围","5000.5019":"上传已配准到STAM或CCF的3D图像或swc文件","5000.5020":"将上传数据映射到另一个图谱:","5000.5021":"开始计算","5000.5022":"下载保存","5000.5023":"显示结果","5000.5024":"其它图谱","5000.5025":"设置","5000.5026":"极简模式","5000.5027":"选择注射脑区","5000.5028":"选择注射靶点","5000.5029":"清除注射靶点","5000.5017":"开始智能规划","5000.5030":"规划中","5000.5031":"数据块预估大小:","5000.5032":"显示其他","5000.5033":"控制面板","5000.0019":"也可以按R在旋转模式和平移模式之间切换","5000.5034":"自动","5000.5035":"手动","5000.5057":"显示三维形貌","5000.5056":"隐藏三维形貌","5000.5058":"无法规划路径以避开勾选的结构","5000.5060":"隐藏投射路径","5000.5061":"显示投射路径","5000.5039":"下载{{name}}周围的原始图像","5000.5038":"切换{{name}}为坐标原点","5000.5040":"输入胞体所在脑区简写或全称","5000.5041":"输入投射所在脑区简写或全称","5000.0206":"显示穿过的血管分支","5000.0207":"隐藏穿过的血管分支","5000.0208":"显示被供血的结构","5000.0209":"隐藏被供血的结构","5000.5044":"使用该功能需要一个API Key。目前我们提供了一个临时的测试Key。请点击Go on按钮","5000.5051":"提示:key值将会发送到所填邮箱账号上,请提交完后关注邮箱是否收到信息。","5000.0011":"发送邮件","5000.5043":"填写Key","5000.5042":"申请Key","5000.5045":"提交","5000.5049":"Key值","5000.5070":"申请人","5000.5071":"邮箱","5000.5072":"所属单位","5000.5073":"使用目的","5000.5050":"保存","5000.5052":"神经环路","5000.5053":"请输入待查询的结构","5000.5047":"提交失败","5000.5048":"提交成功","5000.5054":"上游结构","5000.5055":"下游结构","5000.5083":"步骤一","5000.5084":"步骤二","5000.5085":"设置展开长度","5000.5080":"单击此处的图标以展开所选结构。再次单击图标将允许您退出展开状态","5000.5081":"选择左侧的结构","5000.5082":"请选择注射模式,如果选择自动模式,点击左侧细胞名称选择细胞核进行计算","5000.5086":"对话STAM","5000.6001":"输入一个待查询结构,可视化其连接图谱。可以试着填入 ","5000.6002":"语言切换","5000.0012":"当前下载文件已超出服务器传输限制,您可以选择降低采样等级或者发送邮件,是否发送邮件?","5000.6003":"投射路径","5000.6004":"隐藏该神经元","5000.6005":"冠状视图","5000.6006":"矢状视图","5000.6007":"水平视图","5000.6008":"点击下方按钮,申请下载各向同性10微米分辨率的STAM图谱3D标签图像","5000.6009":"请求STAM标签","5000.6010":"提示:下载所用的许可号将会发送到您所填写的邮箱,请在提交结束后关注是否收到包含许可号的邮件。","5000.6011":"请注意,使用此功能需要提供下载许可号,如果您没有下载许可号,请点击下方按钮向我们申请","5000.6012":"申请下载许可号","5000.6013":"填写下载许可号","5000.6014":"许可号","5000.6015":"查询位于或投射到该结构的神经元","5000.6019":"浏览 {{focusVirusLineItem}} 的知识库页面","5000.6020":"浏览 {{focusVirusLineItem}} 的父结构 {{lableValue}} 的知识库页面","5000.6016":" RGB值","5000.6017":"所属脑区","5000.6018":"查看更高分辨率图像","5000.6021":"隐藏该分支","5000.6022":"设置 {{lableStr}} 的包围盒为下载范围","5000.6023":"隐藏 {{name}} 的三维形貌","5000.6024":"显示 {{name}} 的三维形貌","5000.6025":"切换到冠状面","5000.6026":"切换到矢状面","5000.6027":"切换到水平面","5000.6028":"切换到任意角度切面","5000.6029":"探索由单神经元投射所构成的","5000.6030":"全脑连接范式图","5000.6031":"。您也可以:","5000.6032":"","5000.6033":"上传脑片图像,或使用","5000.6034":"的测试脑片图像:","5000.6035":"上传已配准到STAM或CCF的3D图像或swc文件,或使用测试","5000.6036":"3D图像","5000.6037":"swc文件:","5000.6038":"数据来源: {{name}}","5000.6039":"平颅方位","5000.6040":"投射丰富","5000.6041":"新标注","5000.6042":"关闭","5000.6043":"启用","5000.6044":"网格","5000.6045":"脑外轮廓","5000.5087":"步骤三","5000.5088":"步骤四","8000.0001":"如①所示,在主窗口左侧的是数据面板,用户可以在该选项卡下选择STAM的解剖命名树,配准到STAM上的完整脑血管图谱和神经元数据。用户也可以切换两个不同版本的命名系统。","8000.0002":"如②所示,主窗口中可以加载脑区、核团的三维模型。","8000.0003":"如③所示,用户可以切换不同的模式或者功能模块","8000.0004":"Regions选项卡包含的是STAM的解剖命名树,用户可以在该选项卡下的复选框中选择任意数量的感兴趣结构,在主窗口中可视化;Vessels选项卡包含了一套配准到STAM上的完整脑血管图谱,用户可以在此选择感兴趣的血管分支;Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。用户也可以选择切换到Brain maps 4.0 ontology,该命名树中的结构同样可以被检索、选中并可视化。","8000.0005":"用户可以点击Regions选项卡下的解剖命名树中蓝色的方块图标,此时主窗口中会以组装的形式可视化用户点击结构的所有子结构,同时展开幅度可在右侧面板设置。默认情况下,该坐标系统以Bregma点作为原点。户也可以将坐标原点切换为STAM的其它任意19个颅骨或颅内基准点,主窗口中可视化对象的坐标值将根据新的原点重新计算。右击任意基准点,可以保存以基准点为坐标原点的STAM标签图像。","8000.0006":"用户可以在页面底部切换到setting选项卡。Left hemisphere开关决定是否展示左半脑,默认为Off。Coordinate开关决定是否在主窗口中显示坐标数值,默认为On。Datum Marks开关决定是否在主窗口中显示基准点,默认为On。Cranial开关决定是否在主窗口中显示颅骨的三维轮廓,默认为Off。","8000.0007":"我们提供了虚拟手术导航服务,用户可以通过交互操作,模拟向小鼠脑注射病毒的立体定位手术过程。STAM会根据用户操作,返回注射位点与作为坐标原点的颅骨或颅内基准点之间的距离和注射角度信息。","8000.0008":"首先选择要注射的脑区。接下来在脑区上选择注射靶点。用户继续点击Select target按钮,注射脑区的三维模型表面会出现一个跟随鼠标移动的绿点。然后,点击Auto进入自动模式,左侧数据面板中的Structure for injecting选项卡变为Regions to avoid。用户点击需要避开脑区、核团的名称,被选中的文字会变为高亮的红色,同时这些结构的三维轮廓也会显示在主窗口中。接下来点击右侧面板中的Intellectual planning按钮,等待若干秒后,STAM会返回一条从注射靶点出发、并且避开所有用户选中脑区、核团的路径。","8000.0009":"用户点击Manually进入手动规划模式,此时用户标记的注射靶点变为蓝色圆点,并出现一条从注射靶点出发、连接到鼠标当前的位置的红色虚射线,该射线与STAM外轮廓的交点(即注射位点)会被标记为绿色。当用户找到合适的注射路径后,可点击鼠标左键标记,被标记的路径会在主窗口中形成一条蓝色实线,注射位点则被标记为蓝色圆锥,且该路径所穿过的脑区、核团名称也会按照其空间位置排列在实线上。在右侧面板中,会出现该注射路径与三个标准解剖方向的夹角、注射靶点,以及注射位点的信息。用户点击右侧面板上的Reset按钮,即可重新开始整个注射手术流程。","8000.0011":"如①所示,用户可上传PI或DAPI染色的单张脑片图像,该服务将通过约1分钟的服务器端计算,从STAM中重切出一张与用户上传的脑片位置最接近的图谱切面,并根据计算出来的角度和位置显示在主窗口中。","8000.0012":"用户可以从本地上传待配准的tif/tiff格式的二维脑片图像。然后选择上传图像的类型。接着点击Calculate the corresponding plane from the atlas按钮组中的Start按钮,等待后台返回计算结果。计算完成后,Start按钮下方会出现计算结果的预览图,可左键单击放大查看。Start按钮右侧的Save按钮此时也变为可点击,用户单击该按钮,可以将计算结果下载到本地。","8000.0013":"在主窗口右击相应的脑区、核团,可以跳转到任意剖面可视化和脑解剖知识库页面。","8000.0014":"如①和②所示,用户可以在STAM所在的三维空间中选取任意感兴趣范围,并以不同的采样倍数下载自己选取范围内的原始图像。","8000.0015":"用户可以点击“Select the range”按钮,然后主窗口中出现一个橙色线条的方框。用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制方框在各个方向上的平移,当某个方向的箭头被用户选中时,该箭头会变为高亮的黄色。","8000.0016":"用户也可以通过按下键盘上的“A”,将范围选取操作从平移模式切换为缩放模式。此时方框的箭头会变为方块,拖动方块,就可以改变方框的大小。经过上述操作明确了待下载数据的空间范围后,可以点击“预览下载图像”按钮,通过体绘制,在主窗口中对该范围内的图像进行可视化,","8000.0017":"拖动“Set the downsampling rate”滑动条,用户可以选择待下载数据的采样倍数;具体的倍数值可通过滑块上方的黑色背景提示文字查看。当数据量没有超过1 GB时,点击Downloading按钮可直接下载;当超过该数值,点击Downloading按钮会唤起用户终端的邮箱管理工具(如Outlook等),并自动将待下载范围和采样倍数信息填入邮件中,此时用户点击邮件发送按钮,即可向STAM网站发送数据下载申请。","8000.0018":"我们支持用户上传此前已经配准到Common Coordinate Framework(CCF)的三维图像数据和神经元完整形态数据,并将其映射到STAM上,并直接在三维空间中进行可视化;我们也支持反向映射,即将已经配准到STAM的同类型数据映射到CCF上。","8000.0019":"用户点击右侧面板的Upload按钮,上传已配准到CCF或者STAM的三维图像数据或神经元形态学数据。上传结束后,在Select the direction of conversion单选框中,确定数据的映射方向是从STAM到CCF还是反过来。此后点击Start按钮,STAM的服务器端开始计算,Start按钮变为等待状态。","8000.0020":"等待约10分钟后,STAM的服务器端完成计算并返回结果。此时Save按钮和View result按钮均变为可点击状态。点击Save按钮,可以将计算结果下载到本地;点击View result按钮,可以在主窗口中预览计算结果。","8000.0021":"我们提供了沿任意角度可视化脑图谱切面的服务。用户可以查看感兴趣的STAM任意位置和角度的切面,浏览该切面上的脑区、核团标注,并由该图谱切面跳转到STAM任意切面服务所提供的各向同性1微米分辨率切面。","8000.0022":"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同。位于正中区域的是主窗口。","8000.0023":"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。具体的平移、旋转数值可通过滑块上方的黑色背景提示文字查看。","8000.0024":"用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制图谱切面的平移。用户也可以通过按下键盘上的“R”,将范围选取操作从平移模式切换为旋转模式。此时箭头会变为球形,沿球形拖动,就可以控制图谱切面的旋转。","8000.0025":"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。点击viewer higher resolution image按钮可以跳转到任意剖面可视化界面。点击Requesting STAM labels按钮,填入许可证即可下载各向同性10微米分辨率的STAM图谱3D标签图像。","8000.0026":"我们提供全脑的胞体或投射靶区的神经环路数据可视化服务。用户可以选择感兴趣的任意胞体或投射靶区在脑区、核团的神经环路数据,并查看数据对应的脑区、核团标注。","8000.0027":"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同,其中Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。","8000.0028":"如②所示,用户可以在搜索框中搜索感兴趣脑区、核团。","8000.0029":"如③所示,这是一个由若干个脑区、核团子结构组成的神经环路连接示意图。","8000.0030":"用户可以点击“whole-brain connectivity diagram”按钮或在搜索框中搜索感兴趣脑区、核团,即可弹出由若干个脑区、核团子结构组成的神经环路连接示意图。不同圆点表示不同的脑区、核团结构,圆点旁边显示的是脑区、核团的名称。用户可以将鼠标移动到圆点、脑区或核团的名称上,左击或右击圆点。","8000.0031":"双击任意一个代表某个脑区、核团结构的圆点,神经环路连接示意图窗口隐藏,回到主窗口页面,显示该结构的上下游连接关系。在Upstream窗口中展示了投射到选中脑区、核团的神经环路,在Downstream窗口中展示了选中脑区、核团的投射靶区。用户可以用复选框选择任意数量的感兴趣神经元,在主窗口中可视化。","8000.0032":"解剖结构、脑血管和神经元查询","8000.0033":"可视化解剖子结构并切换坐标原点","8000.0034":"可视化功能设置","8000.0035":"自动导航模式","8000.0036":"手动导航模式","8000.0037":"上传脑片图像并计算或下载配准结果","8000.0038":"页面跳转功能","8000.0039":"缩放模式选择原始图像数据的范围并预览图像","8000.0040":"选择数据的采样倍数并下载","8000.0041":"上传三维图像数据并计算","8000.0042":"计算完成后预览或下载结果","8000.0043":"平移或旋转图谱切面","8000.0044":"下载高分辨率的STAM图谱3D标签图像","8000.0045":"查看神经环路连接示意图并交互","8000.0046":"显示用户指定脑区上下游连接关系","8000.0047":"平移模式选择原始图像数据的范围","8000.0048":"","5000.7001":"图谱","5000.7002":"脑片1","5000.7003":"脑片2","5000.7000":"(可选)上传第二张脑片图像,默认该图像已经配准到了第一张上传的脑片图像上","5000.7004":"阻光度","5000.7005":"末梢点","5000.7006":"可见性","5000.7007":"分支点","5000.7008":"分析","5000.7009":"神经元末梢分布","5000.7010":"末梢点","5000.7011":"神经元投射模式","5000.7012":"投射长度分布","5000.7013":"左右翻转","7000.7014":"您也可以在此下载","7000.7015":"的插件;您可能需要使用测试数据,请","7000.7016":"在此","7000.7017":"下载。","7000.7018":"报告问题","7000.7019":"设置为焦点","7000.7020":"重置焦点","7000.7021":"重切片模式","7000.7022":"平移 ","7000.7023":"旋转","7000.7024":"控制模式","7000.7025":"只展示可用神经元","7000.7026":"点击Color按钮,修改神经元颜色;点击Ana.按钮,显示神经元投射路径分析结果;点击Path按钮,在主界面显示神经元经过的脑结构;Src按钮展示了神经元数据的来源","7000.7027":"反馈","5000.7026":"请求超时,下载失败","5000.7027":"计算失败","5000.7028":"没有合适的路径","5000.7029":"请求过于频繁,请稍后再试","5000.7030":"点此下载查询结果","5000.7031":";如果你没有申请过key可以点击"},vzt="en_us",gzt={zh_cn:"zh",en_us:"en"},X8e=localStorage.getItem("lang")||vzt,mzt=gzt[X8e]||"en";localStorage.setItem("lang",X8e);Od.use(H$t).init({resources:{en:{translation:hzt},zh:{translation:pzt}},lng:mzt,fallbackLng:"en",interpolation:{escapeValue:!1}});const{Content:yzt}=UO;var kh=new DX({antialias:!0,logarithmicDepthBuffer:!0});kh.localClippingEnabled=!0;var bzt=new Nm(window.innerWidth-450,window.innerHeight);const WB=new M$t(kh,bzt);let Gve;new $8e(R$t);let xzt=new URL(window.location.href),Cv=new URLSearchParams(xzt.search),jve=Cv.get("datumMarkVisibility"),Wve=Cv.get("regionsChecked"),Xve=Cv.get("vesselsChecked"),Zve=Cv.get("neuronsChecked");Cv.get("leftHemisphereVisibility");let Kve=Cv.get("terminalVisibility"),Yve=Cv.get("branchingVisibility"),qve=Cv.get("branchingColor"),Jve=Cv.get("gridVisibility"),Qve=Cv.get("echart_Value"),ege=Cv.get("leftTabIndex");const Czt=t=>{const{atlasTopography:e,cerebralVessels:n,datumMarks:r,atlasColormap:i,atlasOntology:a,resourceTab:o,toolTab:s,ScaleNum:c,lang:u,home:d,ServerUrl:f}=t,{t:h}=Z$t(),p=C.useRef({}),v=C.useRef(null),y=C.useRef(new Ave(Ai.current,kh.domElement)),[g,m]=C.useState(1),b=C.useRef(1),[x,S]=C.useState(jve?JSON.parse(jve):!0),w=C.useRef(null),_=C.useRef(null),A=C.useRef([]),P=C.useRef(null),R=C.useRef(null),N=C.useRef(!1),k=C.useRef(!1),[B,H]=C.useState(!0),[F,G]=C.useState([]),z=C.useRef(2),[V,j]=C.useState(""),Y=C.useRef([]),W=C.useRef([]),Z=C.useRef(new Pa),[te,se]=C.useState("nucleusColour"),q=C.useRef(1),ne=C.useRef(null),[oe,ie]=C.useState(!0),ee=C.useRef(),ye=C.useRef(),ve=C.useRef(),pe=C.useRef(),[re,xe]=C.useState(Wve?JSON.parse(Wve):[]),[Q,be]=C.useState(Xve?JSON.parse(Xve):[]),[de,Ee]=C.useState(Zve?JSON.parse(Zve):[]),De=C.useRef(On=>new Ie),[He,Pe]=C.useState(!1),Se=C.useRef(new Ie),[We,ge]=C.useState(new Ie),[ue,Me]=C.useState(ege?parseInt(ege):1),it=C.useRef(!1),[Ne,Ke]=C.useState(!1),ft=C.useRef(""),[ct,ut]=C.useState(3),Ct=C.useRef(null),st=C.useRef([]),[ke,ht]=C.useState(""),nt=C.useRef(()=>{}),[et,bt]=C.useState(1),ze=C.useRef(1),[Mt,It]=C.useState({}),[Dt,Lt]=C.useState(""),Bt=C.useRef({}),[Gt,un]=C.useState(""),[xn,wn]=C.useState(""),[Fn,en]=C.useState({}),[Mr,_n]=C.useState(Qve||""),[gn,Rn]=C.useState(!1),[dn,Xn]=C.useState(0),[cr,Or]=C.useState({}),Bn=C.useRef({}),[ar,Ge]=C.useState(Jve?JSON.parse(Jve):!0),[At,Nt]=C.useState([]),[Ft,kt]=C.useState([]),[zt,Vt]=C.useState([]),[Xt,Dn]=C.useState(!1),[$t,Rt]=C.useState({});localStorage.setItem("lang",u||"en"),sa.current=c,uo.current=-5.7,qa.current=-6,to.current=-7.0055;const[qt,Un]=C.useState([]),In=C.useRef({start:Yve?JSON.parse(Yve):!0,end:Kve?JSON.parse(Kve):!0,start_color:qve||"#A7B5A1"});C.useEffect(()=>{var zr;Ae.current=new l7,Ai.current=new Uu(45,(window.innerWidth-450)/window.innerHeight,.01,1e4),Ai.current.position.set(18,-10,-10),Ai.current.up.set(0,-1,0),Ai.current.lookAt(new Ie(0,0,0)),bS.current=new Ow(16777215,4.5,0,.04),bS.current.position.set(18,-10,-10),Ae.current.add(bS.current),Ae.current.background=new li("#fff"),(zr=v.current)==null||zr.appendChild(kh.domElement),kh.setSize(window.innerWidth-450,window.innerHeight),y.current=new Ave(Ai.current,kh.domElement);let On=new URL(window.location.href),er=new URLSearchParams(On.search),jr=er.get("cameraInfo"),yr=er.get("controllerInfo");if(jr&&yr){let tr=JSON.parse(jr),Lr=JSON.parse(yr);Ai.current.position.set(tr.cameraPosition.x,tr.cameraPosition.y,tr.cameraPosition.z),bS.current.position.set(tr.cameraPosition.x,tr.cameraPosition.y,tr.cameraPosition.z),Ai.current.rotation.set(tr.cameraRotation.x,tr.cameraRotation.y,tr.cameraRotation.z),y.current.reset(),y.current.target.set(Lr.controlsTarget.x,Lr.controlsTarget.y,Lr.controlsTarget.z),y.current.object.position.set(Lr.controlsPosition.x,Lr.controlsPosition.y,Lr.controlsPosition.z),y.current.object.up.set(Lr.controlsUp.x,Lr.controlsUp.y,Lr.controlsUp.z),y.current.update(),Ai.current.updateMatrixWorld()}y.current.rotateSpeed=10,y.current.zoomSpeed=6,y.current.minDistance=1,y.current.maxDistance=6e3,y.current.staticMoving=!0,y.current.addEventListener("change",function(tr){bS.current.position.set(Ai.current.position.x,Ai.current.position.y,Ai.current.position.z);const Lr=JSON.stringify({cameraPosition:Ai.current.position,cameraRotation:Ai.current.rotation}),Dr=JSON.stringify({controlsTarget:y.current.target,controlsPosition:y.current.object.position,controlsUp:y.current.object.up});let Qn=new URL(window.location.href),Pr=new URLSearchParams(Qn.search);Pr.set("cameraInfo",Lr),Pr.set("controllerInfo",Dr),Qn.search=Pr.toString(),window.history.replaceState({},"",Qn)}),window.addEventListener("resize",Zn),window.addEventListener("wheel",nn),document.addEventListener("contextmenu",function(tr){tr.preventDefault()}),Gve=new L$t(Ae.current,Ai.current),WB.addPass(Gve),Wn(),f&&Ir(f),fetch("/app-api/p2p-api/folders").then(tr=>{if(!tr.ok)throw new Error(`HTTP error! Status: ${tr.status}`);return tr.json()}).then(tr=>{if(tr.code===200){let Lr=[{title:"Local",value:"0",key:"0",children:[]},{title:"Web",value:"1",key:"1",children:[]}];tr.data.forEach(Dr=>{const Qn={title:Dr.path,key:Dr.name,value:Dr.path};Dr.path.length>46?Lr[1].children.push(Qn):Lr[0].children.push(Qn)}),Un(Lr)}}).catch(tr=>{console.error("Fetch error:",tr)})},[]),C.useEffect(()=>{xr(zt)},[zt]);const xr=On=>{fetch("/app-api/p2p-api/swctree",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:On}),redirect:"follow"}).then(er=>er.json()).then(er=>{kt(er.data.swctree),Rt(er.data.soma_axon_data)}).catch(er=>console.log("error",er))};C.useEffect(()=>{let On=new URL(window.location.href),er=new URLSearchParams(On.search);er.set("leftTabIndex",String(ue)),On.search=er.toString(),window.history.replaceState({},"",On)},[ue]);async function Ir(On){try{const er=await fetch(On);if(!er.ok)throw new Error("Network response was not ok "+er.statusText);const jr=await er.json();jr.code===200?Nt(jr.data):console.error("Failed to fetch tab:",jr.message)}catch(er){console.error("Error fetching data:",er),alert("接口不可用,请检查服务器状态。")}}const Zn=()=>{kh.setSize(window.innerWidth-450,window.innerHeight),Ai.current.aspect=(window.innerWidth-450)/window.innerHeight,Ai.current.updateProjectionMatrix()},nn=()=>{y.current.update();const On=Ai.current.position;let er=Ae.current.getObjectByName("DR-anterior");if(er){const jr=On.distanceTo(er.position);for(let yr in p.current)p.current[yr].contentobj.children.forEach(tr=>{tr.levels.forEach((Lr,Dr)=>{Dr===0?Lr.object.visible=jr<9:Dr===1&&(Lr.object.visible=jr>=9)})});Ae.current.traverse(function(yr){yr.name==="lineNameMesh"&&yr.type==="Mesh"&&(jr<9&&jr>=6?yr.scale.x!=.3&&yr.scale.set(.3,.3,.3):jr<6?yr.scale.x!=.2&&yr.scale.set(.2,.2,.2):yr.scale.x!=.5&&yr.scale.set(.5,.5,.5))})}},Wn=()=>{requestAnimationFrame(Wn),y.current.update(),Ai.current.updateMatrixWorld(),Ae.current.traverse(function(On){On.name==="lineNameMesh"&&On.type==="Mesh"&&(On.up.set(0,-1,0),On.rotation.copy(Ai.current.rotation))}),WB.render()},Cn=On=>{Me(On),z.current=On},Sn=On=>{bt(On.target.value),ze.current=On.target.value};return C.createElement(UO,{className:"content",style:{overflowX:"hidden"}},C.createElement(yzt,{className:"Box3D",style:{height:"100%",display:"flex"}},C.createElement("div",{style:{height:"calc(100vh - 5px)",overflowY:"auto",background:"#fff",padding:10,position:"relative",borderRight:"1px solid #ccc"}},C.createElement(Om,{onChange:Cn,activeKey:ue.toString(),style:{width:300},defaultActiveKey:"1"},o.includes("label")?C.createElement(iT,{forceRender:!0,tab:q.current==2?ct===2?"Regions to avoid":"Structure for injecting":"Regions",key:String(o.indexOf("label")+1)},C.createElement(EL,{regionData:e,tasktype:"task3D",ref:ee,setdatum:S,offset_factor_R:b,vesselObj:p,treeDatas:a,type:"fbx",leftTreeRef:_,resourceTab:o,baozhaRef:w,needBaozha:!0,offset_factor:g,renderer:kh,axis_font:A,t:h,json_name:te,title:"Regions",showimage:oe,setCheckItems:xe,checkItems:re,outflag:He,clickPoint:Se,setendPoint:ge,automaticGroup:st,mode:et,echartValue:Mr,setEchartValue:_n,updatePage:Mt,auxRef:ye})):null,o.includes("vessel")?C.createElement(iT,{forceRender:!0,tab:ct===2?"Vessels to avoid":"Vessels",key:String(o.indexOf("vessel")+1)},C.createElement(EL,{regionData:e,tasktype:"task3D",ref:ve,offset_factor_R:b,offset_factor:g,vesselObj:p,treeDatas:n,type:"vessel",axis_font:A,t:h,renderer:kh,title:"Vessel",setdatum:function(On){throw new Error("Function not implemented.")},json_name:"",setCheckItems:be,checkItems:Q,clickPoint:Se,automaticGroup:st,mode:et})):null,o.includes("neurons")?C.createElement(iT,{forceRender:!0,disabled:ct===1,tab:"Neurons",key:String(o.indexOf("neurons")+1)},C.createElement(EL,{regionData:e,tasktype:"task3D",ref:pe,offset_factor_R:b,offset_factor:g,vesselObj:p,treeDatas:Ft,fbxTreeDatas:a,type:"swc",axis_font:A,t:h,renderer:kh,title:"Neuron",setdatum:function(On){throw new Error("Function not implemented.")},json_name:"",swclist:[],metadata:!1,setCheckItems:Ee,checkItems:de,clickPoint:Se,mode:et,axon_check:$t,swcnameMesh:Bt,childRef:ee,PointShow:In,Selected:zt,setSelected:Vt,setFormshow:Dn,Selectoptions:qt,formshow:Xt})):null,At.map((On,er)=>C.createElement(iT,{forceRender:!0,tab:On.name,key:er+3},C.createElement("p",null,On.name))))),C.createElement(sEe,{datum:x,regionData:e,renderer:kh,controls:y,vesselObj:p,pointDatas:r,currentRef:v,setHrefStr:j,menutagShow:B,setMenuTagShow:H,angleRef:P,jiaoduRef:R,menuTag:F,axis_font:A,startselect:N,mouseflag:k,linemeshs_jing:Z,points:Y,points2:W,activetabIndex:q,fetchCoordinateFunc:De,checkItems:re,outflag:He,clickPoint:Se,setoutflag:Pe,endPoint:We,outflagRef:it,setShowModeChoose:Ke,virusModeValue:ft,pipelineClickEvent:Ct,focusVirusLineItem:ke,setFocusVirusLineItem:ht,responsefunc:nt,mode:ze,childRef:ee,setUpdatePage:It,t:h,setSwcItem:Lt,swcItem:Dt,swcnameMesh:Bt,axon_check:$t,automaticGroup:st,setCheckItems:xe,vesselRef:ve,swcRef:pe,setLableStr:wn,setVesselStr:un,vesselStr:Gt,lableStr:xn,tabIndex:z,updatePage:Mt,sectionsInfoRef:Bn,setSectionsInfo:Or,gray_value:i,Luguchecked:dn,gridShow:ar,setNodeStr:en}),s.length!=0?C.createElement(A6e,{regionData:e,lefttab:o,righttab:s,ref:ye,renderer:kh,controls:y,offset_factor_R:b,setoffset_factor:m,baozhaRef:w,hrefStr:V,leftTreeRef:_,centerRef:v,childRef:ee,angleRef:P,jiaoduRef:R,mouseflag:k,menutagShow:B,setMenuTag:G,t:h,startselect:N,linemeshs_jing:Z,points:Y,points2:W,activetabIndex:q,material:ne,setShowimage:ie,checkItems:re,fetchCoordinateFunc:De,setoutflag:Pe,outflag:He,clickPoint:Se,setendPoint:ge,outflagRef:it,setdatum:S,datum:x,axis_font:A,modeChoose:Ne,setShowModeChoose:Ke,virusModeValue:ft,setShowTabNums:ut,pipelineClickEvent:Ct,automaticGroup:st,focusVirusLineItem:ke,setMenuTagShow:H,responsefunc:nt,mode:et,setCheckItems:xe,setLeftMenuTabIndex:Me,updatePage:Mt,swcItem:Dt,axon_check:$t,swcnameMesh:Bt,vesselRef:ve,setMode:bt,vesselStr:Gt,lableStr:xn,swcRef:pe,setShowSettingModal:Rn,showSettingModal:gn,fbxTreeDatas:a,composer:WB,echartValue:Mr,setEchartValue:_n,setSectionsInfo:Or,sectionsInfo:cr,sectionsInfoRef:Bn,gray_value:i,setLuguchecked:Xn,Luguchecked:dn,setGridShow:Ge,PointShow:In,nodeStr:Fn}):null,C.createElement(E8e,{t:h,home:d,controls:y,setUpdatePage:It,setShowSettingModal:Rn,auxRef:ye,activetabIndex:q,index:!1,setFormshow:Dn,Selectoptions:qt}),s.length==0?C.createElement(Ya.Group,{value:et,onChange:Sn,style:{position:"absolute",right:0,background:"#fff",padding:10,borderLeft:"1px solid rgb(225, 218, 218)"}},C.createElement(Ya,{style:{width:131},value:0},h("5000.5026")||"极简模式"),C.createElement(Ya,{style:{width:131},value:1},h("5000.5012")||"普通模式"),C.createElement(Ya,{style:{width:131},value:2},h("5000.5013")||"病毒标记模式")):null))};const{Content:Szt}=UO;var _0=new DX({antialias:!0,logarithmicDepthBuffer:!0});const GY=C.memo(({currentLevel:t,totalLevel:e,layerxyz:n,is3DViewer:r,setcurrentLevel:i,is2DViewer:a})=>{const o=C.useRef(new l7),s=C.useRef(null),c=C.useRef(0),u=C.useRef(0),d=C.useRef(null),[f,h]=C.useState(!1),[p,v]=C.useState(0);C.useEffect(()=>{var k;o.current=new l7,camera.current=new Uu(45,235/163,.01,1e4),camera.current.position.set(20,0,0),camera.current.up.set(0,-1,0),camera.current.lookAt(new Ie(0,0,0)),o.current.add(camera.current);let N=new Ow(16777215,100,0);N.position.set(8,-1,0),o.current.add(N),_0.render(o.current,camera.current),o.current.background=new li("#fff"),(k=s.current)==null||k.appendChild(_0.domElement),_0.setSize(235,163),c.current=_0.domElement.clientWidth-1,u.current=_0.domElement.clientHeight-1,window.addEventListener("resize",y),g()},[]);const y=()=>{_0.setSize(235,163),camera.current.aspect=235/163,camera.current.updateProjectionMatrix(),_0.render(o.current,camera.current)},g=()=>{requestAnimationFrame(g),camera.current.updateMatrixWorld(),_0.render(o.current,camera.current)},[m,b]=C.useState(t),x=N=>{b(N)},S=N=>{i(N)};C.useEffect(()=>{b(t)},[t]);const w=N=>{N.preventDefault(),h(!0)},_=N=>{N.preventDefault(),console.log(N.clientX),f&&((N.clientX-50<130||N.clientX-51>45)&&(v(N.clientX-50),d.current.style.left=N.clientX-50+"px"),N.clientX-50<=45&&(v(45),d.current.style.left="45px"),N.clientX-50>=130&&(v(180),d.current.style.left="130px"))},A=N=>{const V=(Math.min(Math.max(N,45),130)-45)/(130-45)*(45-1)+1;return Math.round(V)},P=()=>{h(!1),i(A(p))},R=N=>{const V=(Math.min(Math.max(N,1),45)-1)/(45-1)*(130-45)+45;return Math.round(V)};return C.createElement("div",null,C.createElement("div",{id:"img",style:{display:a?"block":"none"},onMouseMove:_,onMouseUp:P},C.createElement("img",{id:"x",src:"./cor.png"}),C.createElement("div",{id:"draggable-line",style:{left:`${R(t)}px`},ref:d,onMouseDown:w})),C.createElement(UO,{className:"content",style:{display:r?"block":"none"}},C.createElement(Szt,{className:"Box3D"},C.createElement(M6e,{percentage:m/e,layerxyz:n,scene:o})),C.createElement("div",{style:{position:"absolute",zIndex:"10",top:"20px",left:"70px",border:"1px solid"},ref:s},C.createElement(Up,{max:e,min:1,value:m,onAfterChange:S,onChange:x}))))});const wzt=()=>{const[t,e]=C.useState("Coronal sections"),[n,r]=C.useState("z"),[i,a]=C.useState("nucleusColour"),[o,s]=C.useState(xf.Coronal.count),[c,u]=C.useState(Math.floor(xf.Coronal.count/2)),[d,f]=C.useState([0,0]),[h,p]=C.useState(!1),[v,y]=C.useState(!0),[g,m]=C.useState(!0),[b,x]=C.useState(""),[S,w]=C.useState("");C.useEffect(()=>{s(_(t)),u(Math.floor(_(t)/2))},[t]),C.useEffect(()=>{l.setDate(x),l.setname(w)},[]);const _=R=>R==="Coronal sections"?(r("z"),xf.Coronal.count):R==="Sagittal sections"?(r("x"),xf.Sagittal.count):R==="Horizontal sections"?(r("y"),xf.Horizontal.count):0,A=({key:R})=>{e(R)},P=R=>{a(R.target.value)};return C.createElement("div",null,C.createElement(GY,{totalLevel:o,currentLevel:c,setcurrentLevel:u,is3DViewer:g,layerxyz:n,is2DViewer:!1}),C.createElement(EX,{data_path:"",layer:t,CurrentLevel:c,isListVisible:h,setListVisible:p,isGridViewer:v,setGridViewer:y,is3DViewer:g,set3DViewer:m,ZifData:xf,fbxname:b,Z:l,threeview:"/3Dtask"}),C.createElement(aj,{ZifData:xf,orgX:0,orgY:0}),C.createElement("div",{id:"nav_left"},C.createElement(qb,{menu:{items:ewe,onClick:A}},C.createElement(Ba,null,C.createElement(tb,null,t,C.createElement(F5,{rev:void 0})))),C.createElement("div",{id:"nav_menu"},C.createElement(Ya.Group,{value:i,onChange:P},C.createElement(Ya.Button,{value:"nucleusColour"},"ARA ontology"),C.createElement(Ya.Button,{value:"nucleusColour_swanson"},"Brain maps 4.0")),C.createElement(CX,{data_path:"",json:i,layerxyz:n,fbxname:b,setfbxname:x,CurrentLevel:c,setCurrentLevel:u,Z:l}))),C.createElement("div",{id:"nav_bottom"},C.createElement(wX,{mouse:d,hovername:S}),C.createElement(SX,{data_path:"",CurrentLevel:c,threeview:"/3Dtask",TotalLevel:o,setCurrentLevel:u,fbxname:b,Z:l})),C.createElement("div",{id:"nav_right"},C.createElement(_X,{data_path:"",layerxyz:n,CurrentLevel:c,setCurrentLevel:u,TotalLevel:o,isListVisible:h,setListVisible:p})))};const Ezt=()=>{const[t,e]=C.useState("Coronal sections"),[n,r]=C.useState("z"),[i,a]=C.useState("nucleusColour"),[o,s]=C.useState(xf.Coronal.count),[c,u]=C.useState(Math.floor(xf.Coronal.count/2)),[d,f]=C.useState([0,0]),[h,p]=C.useState(!1),[v,y]=C.useState(!0),[g,m]=C.useState(!0),[b,x]=C.useState(""),[S,w]=C.useState("");C.useEffect(()=>{s(_(t)),u(Math.floor(_(t)/2))},[t]),C.useEffect(()=>{l.setDate(x),l.setname(w)},[]);const _=R=>R==="Coronal sections"?(r("z"),xf.Coronal.count):R==="Sagittal sections"?(r("x"),xf.Sagittal.count):R==="Horizontal sections"?(r("y"),xf.Horizontal.count):0,A=({key:R})=>{e(R)},P=R=>{a(R.target.value)};return C.createElement("div",null,C.createElement(GY,{totalLevel:o,currentLevel:c,setcurrentLevel:u,is3DViewer:g,layer:t}),C.createElement(EX,{layer:t,CurrentLevel:c,isListVisible:h,setListVisible:p,isGridViewer:v,setGridViewer:y,is3DViewer:g,set3DViewer:m,ZifData:xf,fbxname:[b],Z:l}),C.createElement(aj,{isGridViewer:v,setMouse:f,ZifData:xf}),C.createElement("div",{id:"nav_left"},C.createElement(qb,{menu:{items:ewe,onClick:A}},C.createElement(Ba,null,C.createElement(tb,null,t,C.createElement(F5,{rev:void 0})))),C.createElement("div",{id:"nav_menu"},C.createElement(Ya.Group,{value:i,onChange:P},C.createElement(Ya.Button,{value:"nucleusColour"},"nucleusColour"),C.createElement(Ya.Button,{value:"nucleusColour_swanson"},"nucleusColour_swanson")),C.createElement(CX,{json:i,layerxyz:n,fbxname:b,setfbxname:x,CurrentLevel:c,setCurrentLevel:u,Z:l}))),C.createElement("div",{id:"nav_bottom"},C.createElement(wX,{mouse:d,hovername:S}),C.createElement(SX,{CurrentLevel:c,TotalLevel:o,setCurrentLevel:u,Z:l})),C.createElement("div",{id:"nav_right"},C.createElement(_X,{layer:t,CurrentLevel:c,setCurrentLevel:u,TotalLevel:o,isListVisible:h,setListVisible:p})))};/**::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
5076
|
+
`},O$t=(...t)=>{console!=null&&console.warn&&(yb(t[0])&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t))},Lve={},tj=(...t)=>{yb(t[0])&&Lve[t[0]]||(yb(t[0])&&(Lve[t[0]]=new Date),O$t(...t))},z8e=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},nj=(t,e,n)=>{t.loadNamespaces(e,z8e(t,n))},Rve=(t,e,n,r)=>{if(yb(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return nj(t,n,r);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,z8e(t,r))},P$t=(t,e,n={})=>!e.languages||!e.languages.length?(tj("i18n.languages were undefined or empty",e.languages),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,i)=>{var a;if(((a=n.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,t))return!1}}),yb=t=>typeof t=="string",N$t=t=>typeof t=="object"&&t!==null,D$t=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,k$t={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},U$t=t=>k$t[t],F$t=t=>t.replace(D$t,U$t);let rj={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:F$t};const B$t=(t={})=>{rj={...rj,...t}},V$t=()=>rj;let H8e;const $$t=t=>{H8e=t},z$t=()=>H8e,H$t={type:"3rdParty",init(t){B$t(t.options.react),$$t(t)}},G$t=C.createContext();class j$t{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const W$t=(t,e)=>{const n=C.useRef();return C.useEffect(()=>{n.current=e?n.current:t},[t,e]),n.current},G8e=(t,e,n,r)=>t.getFixedT(e,n,r),X$t=(t,e,n,r)=>C.useCallback(G8e(t,e,n,r),[t,e,n,r]),Z$t=(t,e={})=>{var S,w,_,A;const{i18n:n}=e,{i18n:r,defaultNS:i}=C.useContext(G$t)||{},a=n||r||z$t();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new j$t),!a){tj("You will need to pass in an i18next instance by using initReactI18next");const P=(N,k)=>yb(k)?k:N$t(k)&&yb(k.defaultValue)?k.defaultValue:Array.isArray(N)?N[N.length-1]:N,R=[P,{},!1];return R.t=P,R.i18n={},R.ready=!1,R}(S=a.options.react)!=null&&S.wait&&tj("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...V$t(),...a.options.react,...e},{useSuspense:s,keyPrefix:c}=o;let u=t||i||((w=a.options)==null?void 0:w.defaultNS);u=yb(u)?[u]:u||["translation"],(A=(_=a.reportNamespaces).addUsedNamespaces)==null||A.call(_,u);const d=(a.isInitialized||a.initializedStoreOnce)&&u.every(P=>P$t(P,a,o)),f=X$t(a,e.lng||null,o.nsMode==="fallback"?u:u[0],c),h=()=>f,p=()=>G8e(a,e.lng||null,o.nsMode==="fallback"?u:u[0],c),[v,y]=C.useState(h);let g=u.join();e.lng&&(g=`${e.lng}${g}`);const m=W$t(g),b=C.useRef(!0);C.useEffect(()=>{const{bindI18n:P,bindI18nStore:R}=o;b.current=!0,!d&&!s&&(e.lng?Rve(a,e.lng,u,()=>{b.current&&y(p)}):nj(a,u,()=>{b.current&&y(p)})),d&&m&&m!==g&&b.current&&y(p);const N=()=>{b.current&&y(p)};return P&&(a==null||a.on(P,N)),R&&(a==null||a.store.on(R,N)),()=>{b.current=!1,a&&(P==null||P.split(" ").forEach(k=>a.off(k,N))),R&&a&&R.split(" ").forEach(k=>a.store.off(k,N))}},[a,g]),C.useEffect(()=>{b.current&&d&&y(h)},[a,c,d]);const x=[v,a,d];if(x.t=v,x.i18n=a,x.ready=d,d||!d&&!s)return x;throw new Promise(P=>{e.lng?Rve(a,e.lng,u,()=>P()):nj(a,u,()=>P())})},Va=t=>typeof t=="string",k_=()=>{let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n},Ove=t=>t==null?"":""+t,K$t=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},Y$t=/###/g,Pve=t=>t&&t.indexOf("###")>-1?t.replace(Y$t,"."):t,Nve=t=>!t||Va(t),f4=(t,e,n)=>{const r=Va(e)?e.split("."):e;let i=0;for(;i<r.length-1;){if(Nve(t))return{};const a=Pve(r[i]);!t[a]&&n&&(t[a]=new n),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++i}return Nve(t)?{}:{obj:t,k:Pve(r[i])}},Dve=(t,e,n)=>{const{obj:r,k:i}=f4(t,e,Object);if(r!==void 0||e.length===1){r[i]=n;return}let a=e[e.length-1],o=e.slice(0,e.length-1),s=f4(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=f4(t,o,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},q$t=(t,e,n,r)=>{const{obj:i,k:a}=f4(t,e,Object);i[a]=i[a]||[],i[a].push(n)},NR=(t,e)=>{const{obj:n,k:r}=f4(t,e);if(n)return n[r]},J$t=(t,e,n)=>{const r=NR(t,n);return r!==void 0?r:NR(e,n)},j8e=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?Va(t[r])||t[r]instanceof String||Va(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):j8e(t[r],e[r],n):t[r]=e[r]);return t},UC=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Q$t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ezt=t=>Va(t)?t.replace(/[&<>"'\/]/g,e=>Q$t[e]):t;class tzt{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const nzt=[" ",",","?","!",";"],rzt=new tzt(20),izt=(t,e,n)=>{e=e||"",n=n||"";const r=nzt.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const i=rzt.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(n);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},ij=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let i=t;for(let a=0;a<r.length;){if(!i||typeof i!="object")return;let o,s="";for(let c=a;c<r.length;++c)if(c!==a&&(s+=n),s+=r[c],o=i[s],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<r.length-1)continue;a+=c-a+1;break}i=o}return i},DR=t=>t==null?void 0:t.replace("_","-"),azt={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};class kR{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||azt,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,i){return i&&!this.debug?null:(Va(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new kR(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new kR(this.logger,e)}}var og=new kR;class dP{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[s,c]=o;for(let u=0;u<c;u++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[s,c]=o;for(let u=0;u<c;u++)s.apply(s,[e,...r])})}}class kve extends dP{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){var u,d;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,n],r&&(Array.isArray(r)?s.push(...r):Va(r)&&a?s.push(...r.split(a)):s.push(r)));const c=NR(this.data,s);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=s[0],n=s[1],r=s.slice(2).join(".")),c||!o||!Va(r)?c:ij((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[n],r,a)}addResource(e,n,r,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,n];r&&(s=s.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(s=e.split("."),i=n,n=s[1]),this.addNamespaces(n),Dve(this.data,s,i),a.silent||this.emit("added",e,n,r,i)}addResources(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in r)(Va(r[a])||Array.isArray(r[a]))&&this.addResource(e,n,a,r[a],{silent:!0});i.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,i,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[e,n];e.indexOf(".")>-1&&(s=e.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let c=NR(this.data,s)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?j8e(c,r,a):c={...c,...r},Dve(this.data,s,c),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var W8e={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,i){return t.forEach(a=>{var o;e=((o=this.processors[a])==null?void 0:o.process(e,n,r,i))??e}),e}};const Uve={};class UR extends dP{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),K$t(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=og.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return(r==null?void 0:r.res)!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!izt(e,r,i);if(o&&!s){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:Va(a)?[a]:a};const u=e.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(a=u.shift()),e=u.join(i)}return{key:e,namespaces:Va(a)?[a]:a}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(e[e.length-1],n),c=s[s.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode"){if(d){const S=n.nsSeparator||this.options.nsSeparator;return i?{res:`${c}${S}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${S}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}const f=this.resolve(e,n);let h=f==null?void 0:f.res;const p=(f==null?void 0:f.usedKey)||o,v=(f==null?void 0:f.exactUsedKey)||o,y=Object.prototype.toString.apply(h),g=["[object Number]","[object Function]","[object RegExp]"],m=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=!Va(h)&&typeof h!="boolean"&&typeof h!="number";if(b&&h&&x&&g.indexOf(y)<0&&!(Va(m)&&Array.isArray(h))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,{...n,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(f.res=S,f.usedParams=this.getUsedParamsDetails(n),f):S}if(a){const S=Array.isArray(h),w=S?[]:{},_=S?v:p;for(const A in h)if(Object.prototype.hasOwnProperty.call(h,A)){const P=`${_}${a}${A}`;w[A]=this.translate(P,{...n,joinArrays:!1,ns:s}),w[A]===P&&(w[A]=h[A])}h=w}}else if(b&&Va(m)&&Array.isArray(h))h=h.join(m),h&&(h=this.extendTranslation(h,e,n,r));else{let S=!1,w=!1;const _=n.count!==void 0&&!Va(n.count),A=UR.hasDefaultValue(n),P=_?this.pluralResolver.getSuffix(u,n.count,n):"",R=n.ordinal&&_?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",N=_&&!n.ordinal&&n.count===0,k=N&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${P}`]||n[`defaultValue${R}`]||n.defaultValue;!this.isValidLookup(h)&&A&&(S=!0,h=k),this.isValidLookup(h)||(w=!0,h=o);const H=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&w?void 0:h,F=A&&k!==h&&this.options.updateMissing;if(w||S||F){if(this.logger.log(F?"updateKey":"missingKey",u,c,o,F?k:h),a){const j=this.resolve(o,{...n,keySeparator:!1});j&&j.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let G=[];const z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&z&&z[0])for(let j=0;j<z.length;j++)G.push(z[j]);else this.options.saveMissingTo==="all"?G=this.languageUtils.toResolveHierarchy(n.lng||this.language):G.push(n.lng||this.language);const V=(j,Y,W)=>{var te;const Z=A&&W!==h?W:H;this.options.missingKeyHandler?this.options.missingKeyHandler(j,c,Y,Z,F,n):(te=this.backendConnector)!=null&&te.saveMissing&&this.backendConnector.saveMissing(j,c,Y,Z,F,n),this.emit("missingKey",j,c,Y,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&_?G.forEach(j=>{const Y=this.pluralResolver.getSuffixes(j,n);N&&n[`defaultValue${this.options.pluralSeparator}zero`]&&Y.indexOf(`${this.options.pluralSeparator}zero`)<0&&Y.push(`${this.options.pluralSeparator}zero`),Y.forEach(W=>{V([j],o+W,n[`defaultValue${W}`]||k)})}):V(G,o,k))}h=this.extendTranslation(h,e,n,f,r),w&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${c}:${o}`),(w||S)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,S?h:void 0))}return i?(f.res=h,f.usedParams=this.getUsedParamsDetails(n),f):h}extendTranslation(e,n,r,i,a){var u,d;var o=this;if((u=this.i18nFormat)!=null&&u.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=Va(e)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(f){const v=e.match(this.interpolator.nestingRegexp);h=v&&v.length}let p=r.replace&&!Va(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),e=this.interpolator.interpolate(e,p,r.lng||this.language||i.usedLng,r),f){const v=e.match(this.interpolator.nestingRegexp),y=v&&v.length;h<y&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var v=arguments.length,y=new Array(v),g=0;g<v;g++)y[g]=arguments[g];return(a==null?void 0:a[0])===y[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):o.translate(...y,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,c=Va(s)?[s]:s;return e!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(e=W8e.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,a,o,s;return Va(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),d=u.key;i=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Va(n.count),p=h&&!n.ordinal&&n.count===0,v=n.context!==void 0&&(Va(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(g=>{var m,b;this.isValidLookup(r)||(s=g,!Uve[`${y[0]}-${g}`]&&((m=this.utils)!=null&&m.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(s))&&(Uve[`${y[0]}-${g}`]=!0,this.logger.warn(`key "${i}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(x=>{var _;if(this.isValidLookup(r))return;o=x;const S=[d];if((_=this.i18nFormat)!=null&&_.addLookupKeys)this.i18nFormat.addLookupKeys(S,d,x,g,n);else{let A;h&&(A=this.pluralResolver.getSuffix(x,n.count,n));const P=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(S.push(d+A),n.ordinal&&A.indexOf(R)===0&&S.push(d+A.replace(R,this.options.pluralSeparator)),p&&S.push(d+P)),v){const N=`${d}${this.options.contextSeparator}${n.context}`;S.push(N),h&&(S.push(N+A),n.ordinal&&A.indexOf(R)===0&&S.push(N+A.replace(R,this.options.pluralSeparator)),p&&S.push(N+P))}}let w;for(;w=S.pop();)this.isValidLookup(r)||(a=w,r=this.getResource(x,g,w,n))}))})}),{res:r,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){var a;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,n,r,i):this.resourceStore.getResource(e,n,r,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!Va(e.replace);let i=r?e.replace:e;if(r&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const a of n)delete i[a]}return i}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class Fve{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=og.create("languageUtils")}getScriptPartFromCode(e){if(e=DR(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=DR(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(Va(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{this.logger.warn(`failed to format code: ${e}`)}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(a=>{if(a===i)return a;if(!(a.indexOf("-")<0&&i.indexOf("-")<0)&&(a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),Va(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),i=[],a=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return Va(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):Va(e)&&a(this.formatLanguageCode(e)),r.forEach(o=>{i.indexOf(o)<0&&a(this.formatLanguageCode(o))}),i}}const Bve={zero:0,one:1,two:2,few:3,many:4,other:5},Vve={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ozt{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=og.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=DR(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let o;try{o=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Vve;if(!e.match(/-|_/))return Vve;const c=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(c,n)}return this.pluralRulesCache[a]=o,o}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(i=>`${n}${i}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,a)=>Bve[i]-Bve[a]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const $ve=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=J$t(t,e,n);return!a&&i&&Va(n)&&(a=ij(t,n,r),a===void 0&&(a=ij(e,n,r))),a},jB=t=>t.replace(/\$/g,"$$$$");class szt{constructor(){var n;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=og.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:s,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:p,nestingSuffix:v,nestingSuffixEscaped:y,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=n!==void 0?n:ezt,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?UC(a):o||"{{",this.suffix=s?UC(s):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=h?UC(h):p||UC("$t("),this.nestingSuffix=v?UC(v):y||UC(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,i){var p;let a,o,s;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=v=>{if(v.indexOf(this.formatSeparator)<0){const b=$ve(n,c,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...i,...n,interpolationkey:v}):b}const y=v.split(this.formatSeparator),g=y.shift().trim(),m=y.join(this.formatSeparator).trim();return this.format($ve(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure),m,r,{...i,...n,interpolationkey:g})};this.resetRegExp();const d=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((p=i==null?void 0:i.interpolation)==null?void 0:p.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:v=>jB(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?jB(this.escape(v)):jB(v)}].forEach(v=>{for(s=0;a=v.regex.exec(e);){const y=a[1].trim();if(o=u(y),o===void 0)if(typeof d=="function"){const m=d(e,a,i);o=Va(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,y))o="";else if(f){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),o="";else!Va(o)&&!this.useRawValueToEscape&&(o=Ove(o));const g=v.safeValue(o);if(e=e.replace(a[0],g),f?(v.regex.lastIndex+=o.length,v.regex.lastIndex-=a[0].length):v.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,a,o;const s=(c,u)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const f=c.split(new RegExp(`${d}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);const p=h.match(/'/g),v=h.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!v||v.length%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,y),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;i=this.nestingRegexp.exec(e);){let c=[];o={...r},o=o.replace&&!Va(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(f=>f.trim());i[1]=d.shift(),c=d,u=!0}if(a=n(s.call(this,i[1].trim(),o),o),a&&i[0]===e&&!Va(a))return a;Va(a)||(a=Ove(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),u&&(a=c.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],a),this.regexp.lastIndex=0}return e}}const lzt=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(o=>{if(o){const[s,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},FC=t=>{const e={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=r+JSON.stringify(a);let s=e[o];return s||(s=t(DR(r),i),e[o]=s),s(n)}};class czt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=og.create("formatter"),this.options=e,this.formats={number:FC((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return a=>i.format(a)}),currency:FC((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>i.format(a)}),datetime:FC((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return a=>i.format(a)}),relativetime:FC((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return a=>i.format(a,r.range||"day")}),list:FC((n,r)=>{const i=new Intl.ListFormat(n,{...r});return a=>i.format(a)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=FC(n)}format(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(s=>s.indexOf(")")>-1)){const s=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,s)].join(this.formatSeparator)}return a.reduce((s,c)=>{var f;const{formatName:u,formatOptions:d}=lzt(c);if(this.formats[u]){let h=s;try{const p=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},v=p.locale||p.lng||i.locale||i.lng||r;h=this.formats[u](s,v,{...d,...i,...p})}catch(p){this.logger.warn(p)}return h}else this.logger.warn(`there was no format function for ${u}`);return s},e)}}const uzt=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class dzt extends dP{constructor(e,n,r){var a,o;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=og.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,r,i.backend,i)}queueLoad(e,n,r,i){const a={},o={},s={},c={};return e.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[h]=!0),a[h]===void 0&&(a[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(s[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const i=e.split("|"),a=i[0],o=i[1];n&&this.emit("failedLoading",a,o,n),!n&&r&&this.store.addResourceBundle(a,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const s={};this.queue.forEach(c=>{q$t(c.loaded,[a],o),uzt(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{s[u]||(s[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{s[u][f]===void 0&&(s[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,i+1,a*2,o)},a);return}o(u,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(e,n);u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}return}return c(e,n,s)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Va(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Va(n)&&(n=[n]);const a=this.queueLoad(e,n,r,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),i=r[0],a=r[1];this.read(i,a,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${n}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${n}loaded namespace ${a} for language ${i}`,s),this.loaded(e,o,s)})}saveMissing(e,n,r,i,a){var c,u,d,f,h;let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((h=this.backend)!=null&&h.create){const p={...o,isUpdate:a},v=this.backend.create.bind(this.backend);if(v.length<6)try{let y;v.length===5?y=v(e,n,r,i,p):y=v(e,n,r,i),y&&typeof y.then=="function"?y.then(g=>s(null,g)).catch(s):s(null,y)}catch(y){s(y)}else v(e,n,r,i,s,p)}!e||!e[0]||this.store.addResource(e[0],n,r,i)}}}const zve=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),Va(t[1])&&(e.defaultValue=t[1]),Va(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Hve=t=>{var e,n;return Va(t.ns)&&(t.ns=[t.ns]),Va(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Va(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},sM=()=>{},fzt=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class w5 extends dP{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Hve(e),this.services={},this.logger=og,this.modules={external:[]},fzt(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(Va(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=zve();this.options={...i,...this.options,...Hve(n)},this.options.interpolation={...i.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?og.init(a(this.modules.logger),this.options):og.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=czt;const f=new Fve(this.options);this.store=new kve(this.options.resources,this.options);const h=this.services;h.logger=og,h.resourceStore=this.store,h.languageUtils=f,h.pluralResolver=new ozt(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(h.formatter=a(d),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new szt(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new dzt(a(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(p){for(var v=arguments.length,y=new Array(v>1?v-1:0),g=1;g<v;g++)y[g-1]=arguments[g];e.emit(p,...y)}),this.modules.languageDetector&&(h.languageDetector=a(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=a(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new UR(this.services,this.options),this.translator.on("*",function(p){for(var v=arguments.length,y=new Array(v>1?v-1:0),g=1;g<v;g++)y[g-1]=arguments[g];e.emit(p,...y)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,r||(r=sM),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const c=k_(),u=()=>{const d=(f,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(h),r(f,h)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),c}loadResources(e){var a,o;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sM;const i=Va(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&s.indexOf(f)<0&&s.push(f)})};i?c(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,u=>c(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(e,n,r){const i=k_();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=sM),this.services.backendConnector.reload(e,n,a=>{i.resolve(),r(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&W8e.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const i=k_();this.emit("languageChanging",e);const a=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,u)=>{u?(a(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},s=c=>{var d,f;!e&&!c&&this.services.languageDetector&&(c=[]);const u=Va(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||a(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{o(h,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),i}getFixedT(e,n,r){var i=this;const a=function(o,s){let c;if(typeof s!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];c=i.options.overloadTranslationOptionHandler([o,s].concat(d))}else c={...s};c.lng=c.lng||a.lng,c.lngs=c.lngs||a.lngs,c.ns=c.ns||a.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||a.keyPrefix);const h=i.options.keySeparator||".";let p;return c.keyPrefix&&Array.isArray(o)?p=o.map(v=>`${c.keyPrefix}${h}${v}`):p=c.keyPrefix?`${c.keyPrefix}${h}${o}`:o,i.t(p,c)};return Va(e)?a.lng=e:a.lngs=e,a.ns=n,a.keyPrefix=r,a}t(){var i;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(i=this.translator)==null?void 0:i.translate(...n)}exists(){var i;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(i=this.translator)==null?void 0:i.exists(...n)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(s,c)=>{const u=this.services.backendConnector.state[`${s}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const s=n.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!i||o(a,e)))}loadNamespaces(e,n){const r=k_();return this.options.ns?(Va(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=k_();Va(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){var i,a;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((a=this.services)==null?void 0:a.languageUtils)||new Fve(zve());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new w5(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sM;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new w5(i);return(e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new kve(this.store.data,i),a.services.resourceStore=a.store),a.translator=new UR(a.services,i),a.translator.on("*",function(s){for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];a.emit(s,...u)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Od=w5.createInstance();Od.createInstance=w5.createInstance;Od.createInstance;Od.dir;Od.init;Od.loadResources;Od.reloadResources;Od.use;Od.changeLanguage;Od.getFixedT;Od.t;Od.exists;Od.setDefaultNamespace;Od.hasLoadedNamespace;Od.loadNamespaces;Od.loadLanguages;const hzt={"5000.0001":"2D registration","5000.0002":"Upload slice","5000.0003":"Upload Failed,please contact the administrator","5000.0004":"View result","5000.0005":"Downloading","5000.0006":"Select the range","5000.0007":"remove the range","5000.0008":"preview selected data","5000.0009":"Tips: press the 'A' key to switch between pan and zoom modes","5000.0010":"Set the downsampling rate","5000.5018":"Download selected data","5000.5012":"Normal mode","5000.5013":"Virtual surgery mode","5000.5014":"Atlas mapping","5000.5019":"Upload 3D image or swc file already mapped to STAM or CCF","5000.5020":"Map the uploaded data to the other atlas:","5000.5021":"Start","5000.5022":"Download","5000.5023":"View result","5000.5024":"Other atlases","5000.5025":"Setting","5000.5026":"Simple mode","5000.5027":"Select structure","5000.5028":"Select target","5000.5029":"Remove target","5000.5017":"Intelligent planning","5000.5030":"Planning","5000.5015":"Select the direction of conversion","5000.5016":"Cranial","2002.0301":"Information","5000.5031":"Block size:","5000.0019":"or press 'R' key to switch between Rotation mode and Translation mode","5000.5034":"Auto","5000.5035":"Manual","5000.5057":"Show 3D morphology","5000.5056":"Hide 3D morphology","5000.5058":"Unable to calculate a path to avoid the structures you selected","5000.0112":"Cancel","2002.0302":"View data","5000.0111":"Save","4000.0210":"Translate-X","2002.0300":"Neuron collaborative annotation platform","5000.0113":"Alias in Dong's nomenclature","4000.0212":"Translate-Z","4000.0211":"Translate-Y","4000.0214":"Rotate-Y","5000.0110":"Edit","4000.0213":"Rotate-X","4000.0216":"View high resolution slice","4000.0215":"Rotate-Z","4000.0218":"Coordinate","4000.0217":"Left hemisphere","4000.0219":"Datum Marks","4000.0100":"","4000.0221":"go to coronal","4000.0220":"SIZE","4000.0102":"Bregma","4000.0223":"go to horizontal","4000.0101":"unit:mm","4000.0222":"go to sagittal","4000.0104":"Sagittal sections","4000.0225":"guide","4000.0103":"Coronal sections","4000.0224":"go to arbitrary","2001.0402":"View data","4000.0106":"search anatomical structures","2001.0401":"Information","4000.0105":"Horizontal sections","4000.0226":"Finish","4000.0108":"Brain maps 4.0","4000.0229":"Next","2001.0403":"Vessel","4000.0107":"ARA ontology","4000.0228":"Skip","4000.0109":"Mouse Brain Atlas","2001.0400":"Cerebral vascular atlas","1000.0400":"Login","2002.0202":"View data","2002.0203":"After nonlinear registration, the registered image is then returned to the user. Additionally, users receive access to isotropic 1-micron resolution cytoarchitectural slice with the same position and angle.","2002.0200":"Automatic slice registration","2002.0201":"We provide an automatic brain slice registration service where users can upload single brain slice images stained with PI or DAPI. This service, through approximately 10 minutes of background computation, extracts a slice from the three-dimensional STAM that is closest to the position of the user-uploaded brain slice.","2002.0602":"The service provides information on the distance between the injection site and the cranial or intracranial datum marks, as well as the injection angle, based on user interactions.","2002.0600":"Stereotactic surgical navigation service","2002.0601":"We have incorporated a stereotaxic surgical navigation service into the three-dimensional visualization service page. Users can simulate the stereotaxic surgical procedure of injecting viruses into the mouse brain through interactive operations.","6000.0112":"Please enter an email address","6000.0110":"Please enter the purpose of the data","6000.0111":"Label image download","7000.0108":"Start","7000.0109":"Save","7000.0106":"Calculate the corresponding plane from the atlas","7000.0107":"View higher resolution image","4000.0201":"Anatomical Structure","7000.0104":"Get test image","4000.0200":"","7000.0105":"Upload","4000.0203":"Virtual surgery","7000.0102":"Description","4000.0202":"Assembling","7000.0103":"Choose the type of uploaded slice","4000.0205":"Magnitude","7000.0100":"","4000.0204":"Atlas reslicing","7000.0101":"Image registration service","4000.0207":"Scaling","4000.0206":"Frequency","2001.0101":"STAM's two-dimensional visualization service provides a digital map-style online browsing function with 700 coronal planes, 256 sagittal planes, and 367 horizontal planes.","4000.0209":"Reset","2001.0100":"2D visualization","4000.0208":"Select Target","2001.0103":"Users can observe individual standard profiles at different resolutions, navigate profiles at different locations along the same direction, and switch between the three standard profile directions. Each standard profile is a 20μm-thick projection image overlaid with a coordinate grid and annotated with boundaries of neuroanatomical structures.","2001.0102":"View data","1000.0302":"Contact us","2000.0800":"Manual Instruction","1000.0303":"Help","1000.0300":"About","1000.0301":"Introduction","2002.0103":"Users can choose the angle of interest and examine the isotropic 1-micron resolution cytoarchitectural brain slice at that angle. This service provides newly generated slices with annotations for brain regions and nuclei.","4000.0131":"Show Contour","2002.0500":"Anatomical knowledge base","4000.0130":"Show Atlas","2002.0101":"We also offer the service of visualizing slices at arbitrary angles.","2002.0102":"View data","4000.0132":"Nucleus Information","2002.0501":"We have developed a neuroanatomical knowledge base service for STAM.","7000.0113":"Upload and Download","2002.0502":"When users are exploring the three-dimensional topography of brain structures of interest using the two-dimensional and three-dimensional visualization services, they can conveniently access this knowledge base by right-clicking with the mouse. This allows them to query information related to the structure of interest, such as gene expression, neurotransmitters, projection pathways, and more. The knowledge base provides an entry point for the public to actively contribute, edit, and enhance neuroanatomical knowledge.","7000.0111":"Uploaded Image","7000.0112":"Output Image","7000.0110":"Any question about this online registration tool, welcome to contact atlas@brainsmatics.org","2002.0100":"Arbitrary-angle slice visualization","6000.0105":"Purpose of the data","6000.0106":"Submit","6000.0103":"Postal address","6000.0104":"E-mail","6000.0109":"Please enter a postal address","2000.2001":"Brain atlas and data","6000.0107":"Please enter the company name","6000.0108":"Please enter the contact person","2001.0203":"Users are capable of exploring the overall appearance as well as details of any anatomical structure of interest in three-dimensional space, from different perspectives and magnification levels. Additionally, through the assembly view feature, users can unfold the sub-structures contained within each brain region and nucleus, providing a detailed examination of the internal components.","2001.0200":"3D visualization","6000.0101":"Company Name","6000.0102":"Contact person","2001.0202":"View data","2001.0201":"STAM's three-dimensional visualization service reconstructs the three-dimensional topography of 915 brain regions and nuclei.","6000.0100":"","1000.0203":"Neuron collaborative annotation platform","1000.0204":"Data sharing service","1000.0200":"Tools","1000.0201":"High-resolution arbitrary angle reslicing service","1000.0202":"Image registration service","2000.2002":"Services","2000.0500":"Brains-Map","2002.0400":"Data sharing service","4000.0230":"Back","2002.0401":"Information","4000.0111":"D - V","4000.0232":"Step 2","4000.0110":"A - P","4000.0231":"Step 1","4000.0113":"Display","4000.0234":"Step 4","4000.0112":"M - L","4000.0233":"Step 3","2002.0402":"View data","4000.0115":"2D Navigation","4000.0236":"Select a structure on the left","4000.0114":"3D Atlas","4000.0235":"Click the start button","4000.0117":"Reset to default view","4000.0238":"Click the End button","4000.0116":"Annotation","4000.0237":"Left-click on the selected structure to<br> determine the injection site, <br>and then move the mouse to determine the injection direction","4000.0119":"Gridlines","4000.0118":"Information box","4000.0239":"Set the expanded length","4000.0120":"GO TO","4000.0241":"Click the icon here to expand the selected structure, <br> click the icon again to exit from the expanded state","5000.0101":"alias in Paxinos's nomenclature","4000.0240":"Sets the degree of zooming out of the <br>center expansion","5000.0100":"","4000.0122":"Introduction of this structure","4000.0243":"Right click on this structure in the model and select the face you need","5000.0103":"Reference","4000.0121":"3D Viewer","4000.0242":"Clear Target","5000.0102":"alias in Hof's nomenclature","4000.0124":"Zoom out","4000.0245":"Click to view higher resolution images","4000.0123":"Figure","4000.0244":"On the right side, you can drag the position of the section","0800.0801":"Operating Instructions The interface for the two-dimensional visualization service is illustrated below. The central area is the main window, used to display STAM's standard profiles (<span>①</span>) and the brain region annotations on these profiles (<span>②</span>). Users can use the left mouse button and scroll wheel in the main window to move, and zoom in to the resolution of the region of interest. When the user hovers the mouse over an annotation for a brain region or nucleus, the annotation switches to a blue highlighted mode (<span>③</span>), and the full name of the highlighted brain region or nucleus is displayed in the lower-left corner (<span>④</span>). The light gray grid behind the standard profile and annotations shows the distribution of the STAM coordinate system on the current standard profile (<span>⑤</span>). As the user moves the mouse, the real-time position of the mouse in the STAM coordinate system is displayed in the lower-left corner of the main window (<span>⑥</span>). Users can also observe the position of the current viewed standard profile in the entire mouse brain through the navigation window in the upper left corner (<span>⑦</span>). Users can freely switch to other profiles (<span>⑧</span>) or switch between different anatomical directions, such as coronal, sagittal, and horizontal planes (<span>⑨</span>). Additionally, users can search for brain regions or nuclei of interest in the input box (<span>⑩</span>) or navigate through the anatomical ontology tree (<span>⑪</span>). If the current viewed profile does not include the searched structure, it will jump to the nearest profile in the same direction that contains the structure. At the bottom of the main window is the button panel for the two-dimensional visualization service (<span>⑫</span>). The button functions, from left to right, include: zoom out, zoom in, reset view, full screen, switch to three-dimensional visualization service, switch to arbitrary angle cross-section visualization service, display mode switch, and jump to other profiles in the current anatomical direction.","4000.0126":"Reset","4000.0125":"Zoom in","4000.0128":"To 3d Viewer","5000.0109":"Chemical name","2001.0302":"View data","4000.0127":"Full Screen","5000.0108":"Disease name","2001.0701":"The Stereotaxic Topographic Atlas of the Mouse Brain (STAM) is a three-dimensional topographical atlas that depict the anatomical structures of the whole mouse brain, achieving precise single-cell resolution localization. This atlas is based on a three-dimensional Nissl-stained image dataset with isotropic one-micron resolution and is constructed by incorporating various auxiliary imaging data, including immunohistochemistry, neural circuit projections, and specific gene type neuron distribution data. Here, we established the STAM visualization platform, which includes services for exploring standard two-dimensional anatomical sections, three-dimensional topography, and arbitrary-angle slices of the brain atlas. The platform integrates different functionalities such as neuroanatomical knowledge base, stereotaxic surgical navigation, and automatic registration of user-uploaded slices. The STAM visualization platform is expected to provide an effective spatial localization benchmark for the registration and integration of results from single-cell level studies, such as multi-omics and neurocircuitry.","2001.0700":"The brief introduction to STAM","4000.0129":"E-mail","5000.0105":"Disease","5000.0104":"Gene","2001.0301":"Information","5000.0107":"Gene name","2001.0300":"Neuronal morphology database","5000.0106":"Chemical","1000.0104":"Cerebral vascular atlas","1000.0500":"Language","1000.0501":"Simplified Chinese","1000.0502":"English","1000.0100":"Atlas","1000.0101":"Stereotactic atlas","1000.0102":"Specific cell type distribution atlas","1000.0103":"Neuronal morphology database","0800.0803":"Operating Instructions The interface for the three-dimensional visualization service is illustrated as followed. The left side features the navigation window, while the right side is the main window. The main window displays the arbitrary angle slice of STAM (<span>①</span>) and the brain region annotations on that slice (<span>②</span>). Users can pan in the main window by holding down the left mouse button, zoom in using Ctrl + scroll wheel, or switch to different neighboring slices along the current angle by using the scroll wheel. On the right side of the main window is the list of brain regions and nuclei (<span>③</span>). When the user moves the mouse over the name of a structure of interest, the annotation for that structure in the main window is highlighted in light gray (<span>④</span>). Users can also move the mouse over the annotation of a structure of interest in the main window, and the name of that structure in the list of brain regions and nuclei on the right will automatically be highlighted. At this time, the name of the structure will also be displayed in the lower-left corner of the main window (<span>⑤</span>). Below the structure name is the scale bar of the slice image in the main window at the current resolution (<span>⑥</span>). In the navigation window on the left side, the central area displays the three-dimensional model of the right half of the mouse brain (<span>⑦</span>). The black plane corresponds to the position and angle of the slice in the main window (<span>⑧</span>). The red, green, and blue circles around the model are used to change the pitching, rotation, and rolling angles of the cross-section (<span>⑨</span>). Users can also input values in the lower-left corner of the navigation window to set the slice angle (<span>⑩</span>). The red, green, and blue arrows in the navigation window are used to determine the position of the slice along the given arbitrary angle in the three-dimensional space (<span>⑪</span>).","0800.0802":"Operating Instructions The interface for the three-dimensional visualization service is depicted as followed. The central area is the main window, which initially displays the outline of the mouse brain (<span>①</span>). On the left side of the main window is the anatomical ontology tree (<span>②</span>), where users can choose any structure of interest. By checking the three-dimensional model of the selected structure, it will be displayed in the main window (<span>③</span>), and the full name of the structure will appear in the lower-left corner of the main window (<span>④</span>). Users can use a long press of the left mouse button in the main window to select the observation angle and a long press of the right mouse button to pan the view. The gray grid behind the three-dimensional model represents the STAM coordinate system (<span>⑤</span>), with the coordinate origin selected by users from the candidates, indicated by a red sphere in the main window (<span>⑥</span>). As the user moves the mouse, the real-time position of the mouse in the STAM coordinate system is displayed in the lower-left corner of the main window (<span>⑦</span>). By clicking the blue three-dimensional cube icon to the right of any structure name in the anatomical naming tree, users can enter assembly view mode (<span>⑧</span>). In this mode, users can adjust parameters such as the degree of expansion of substructures to control the display effect (<span>⑨</span>).","0800.0805":`Operating Instructions The stereotaxic surgical navigation service is illustrated as followed and is integrated into the three-dimensional visualization service interface. Therefore, basic user interactions can refer to Section "Three-Dimensional Visualization Service." The surgical navigation panel is located on the right side of the main window. After clicking on the "Viral injection" tab, users can continue by clicking the "start programming" button to enter navigation mode (<span>①</span>). At this point, users can select brain regions or nuclei of interest from the anatomical naming tree on the left side of the interface. Once the three-dimensional model of the selected structure is displayed in the main window, users can use the left mouse button to set the injection site on the model (<span>②</span>). Subsequently, the surgical navigation service will automatically generate a ray emanating from the injection site, following the direction of the user's mouse movement (<span>③</span>). After adjusting the mouse position to set the injection direction, clicking the left mouse button again will generate a target point on the external surface of the mouse brain (<span>④</span>). The coordinates of the injection site and target point are displayed below the navigation service panel (<span>⑤</span>). These coordinates represent the relative positions of the two points to the user-selected datum marks, such as the Bregma point, in three-dimensional space. Users can also switch to any cranial and intracranial datum marks of interest. Additionally, the calculated information includes the angle between the user-selected injection direction and the three standard profiles of coronal, sagittal, and horizontal planes (<span>⑥</span>).`,"0800.0804":"Operating Instructions The interface for the neuroanatomical knowledge base service is depicted in the diagram below. Each brain region or nucleus has an independent page, and the example shown is a schematic representation of the knowledge base page for the Lateral dorsal nucleus of the thalamus (LD) nucleus. The page includes, from top to bottom, an overview of the structure of interest (<span>①</span>), aliases (<span>②</span>), references related to this structure (<span>③</span>), as well as information related to genes (<span>④</span>), chemicals (<span>⑤</span>), diseases (<span>⑥</span>), and more. For each gene, chemical, and disease, corresponding references are also listed. Additionally, we provide an entry point for users to edit the content. Users can click the Edit button on the right side of the page to submit edits, and we will review the content submitted by users in the background.","0800.0806":"Operating Instructions The brain slice automatic registration service interface is illustrated as followed. In the upper-left corner is the image upload panel (<span>①</span>), with a radio button on the left containing the currently allowed types of images for registration. After selecting the image type, users can click the Upload button on the right to upload the brain slice image for registration. Users can also click the “Get test image” button to download a test image and then upload it for testing. The uploaded image will be displayed in the lower-left corner of the interface (<span>②</span>). Once the upload is complete, click the “Start” button in the registration calculation panel on the upper-right side of the interface (<span>③</span>), and the background computation will begin. After the calculation is completed, the results will be displayed on the lower-right side of the interface (<span>④</span>). Users can click the “Save” button in the calculation panel to download the results locally. Alternatively, clicking the View higher resolution image button will navigate to the arbitrary angle slice service, allowing users to observe high-resolution cytoarchitectural images at the corresponding angle.","5000.0200":"Regions to avoid","5000.0201":"Structure for injecting","5000.0202":"Regions","5000.0204":"Vessels","5000.0205":"Vessels to avoid","5000.5060":"Hide neural circuit","5000.5061":"Show neural circuit","5000.5039":"Download the 3D image containing {{name}}","5000.5038":"Set {{name}} as the origin","5000.5040":"Input the region that soma locates","5000.5041":"Input the region that neuron projects","5000.0206":"Show vascular branches passing by","5000.0207":"Hide vascular branches passing by","5000.0208":"Show structures it supplies","5000.0209":"Hide structures it supplies","5000.5044":"Using this feature requires an API key. At this time, we provide a temporary key for testing. Click Go on button.","5000.5051":"Tip: Your API-key will be sent to the email address you provided. Please check your email after submission to ensure you have received the email containing your API-key.","5000.0011":"Sending emails","5000.5043":"Fill in the Key","5000.5042":"Request a Key","5000.5045":"Submit","5000.5049":"Key value","5000.5070":"Applicant","5000.5071":"Email","5000.5072":"Affiliation","5000.5073":"Purpose of use","5000.5050":"Save","5000.5052":"Neuronal circuits","5000.5053":"Input the inquired structure","5000.5047":"Commit failure","5000.5048":"Submit successfully","5000.5054":"Upstream","5000.5055":"Downstream","5000.5083":"Step 1","5000.5084":"Step 2","5000.5085":"Set Unfold Length","5000.5080":"Click the icon here to expand the selected structure. Clicking the icon again will allow you to exit from the expanded state","5000.5081":"Select a structure on the left side","5000.5082":"Please select injection mode,if automatic mode is selected, click on the left cell name to select the nucleus to bypass","5000.5086":"Chat with STAM","5000.6001":"Input an inquired structure to visualize the connectivity map, for example, ","5000.6002":"Language","5000.0012":"The current download file has exceeded the server transfer limit. You can choose to reduce the sampling level or send an email. Do you want to send an email?","5000.6003":"Neural circuit","5000.6004":"Hide this neuron","5000.6005":"Coronal view","5000.6006":"Sagittal view","5000.6007":"Horizontal view","5000.6008":"Click the button below to apply for downloading the 3D label image of the isotropic 10 micron resolution STAM map","5000.6009":"Requesting STAM labels","5000.6010":"Tip: The license for downloading will be sent to the email address you provided. Please check your email after submission to ensure you have received the email containing your license.","5000.6011":"Using this feature requires a license. If you do not have a license, please apply for one from us by click the button below.","5000.6012":"Request a license","5000.6013":"Fill in the license","5000.6014":"License number","5000.6015":"Inquire neurons that locate and project to","5000.6019":"Navigate the knowledge of {{focusVirusLineItem}}","5000.6020":"Navigate the knowledge of {{focusVirusLineItem}}'s parent {{lableValue}}","5000.6016":" RGB value","5000.6017":"Subcerebral region","5000.6018":"View higher resolution image","5000.6021":"Hide this branch","5000.6022":"Bounding box of {{lableStr}} as the range","5000.6023":"Hide 3D morphology of {{name}}","5000.6024":"Show 3D morphology of {{name}}","5000.6025":"Switch to coronal plane","5000.6026":"Switch to sagittal plane","5000.6027":"Switch to horizontal plane","5000.6028":"Switch to arbitrary plane","5000.6029":"Navigate the ","5000.6030":"whole-brain connectivity diagram","5000.6031":" consisting of single neuronal projections,or: ","5000.6032":",or: ","5000.6033":"Upload slice, or use the test ","5000.6034":" slices:","5000.6035":"Upload 3D image or swc file already mapped to STAM or CCF, otherwise use the test ","5000.6036":"3D image","5000.6037":"swc file:","5000.6038":"Data source: {{name}}","5000.6039":"Flat skull position","5000.6040":"Abundant projections","5000.6041":"New annotation","5000.6042":"Off","5000.6043":"On","5000.6044":"Grid","5000.6045":"Brain contour","5000.5087":"Step 3","5000.5088":"Step 4","8000.0001":"As shown in ①, on the left of the main window is the data panel, where users can select the anatomical nomenclature tree of STAM, cerebral vascular atlas registered to the STAM and neuron morphological data. You can also switch between different versions of anatomical nomenclature systems.","8000.0002":"As shown in ②, it can load three-dimensional models of brain regions or nuclei in the main window.","8000.0003":"As shown in ③, users can switch to different modes or functional modules.","8000.0004":"The 'Regions' tab includes the anatomical nomenclature tree of STAM, where you can select any number of structures of interest via checkboxes in the main window. The 'Vessels' tab contains a complete cerebral vascular atlas registered to the STAM, allowing to select vascular branches of interest. The 'Neurons' tab is used to query and filter neuron morphological data with somas or projection targets located in regions of interest. You can also switch to Brain maps 4.0 ontology, the structures of which could also be searched, selected and visualized.","8000.0005":"Users can click on blue square icon in the anatomical nomenclature tree under the 'Regions' tab, all substructures of the clicked structure will be visualized in an assembled form in the main window, and the expansion magnitude can be set in the right panel. By default, this coordinate system uses the Bregma point as the origin. You can also switch the coordinate origin to any of the other 19 cranial or intracranial datum marks provided by STAM, and the coordinates of the objects visualized in the main window will be recalculated based on the new origin. Right click on any cranial or intracranial datum marks to save the STAM label image with the cranial or intracranial datum marks as the coordinate origin.","8000.0006":"Users can switch to the 'setting' tab on the bottom. The 'Left hemisphere' switch determines whether the left hemisphere is displayed in the main window, and it is off by default. The 'Coordinate' switch determines whether coordinate values are displayed in the main window, and it is on by default. The 'Datum Marks' switch determines whether datum marks are displayed in the main window, and it is on by default. The 'Cranial' switch determines whether the three-dimensional contour of the skull is displayed in the main window, and it is off by default. ","8000.0007":"We have developed a virtual surgery navigating service. Users can simulate the stereotaxic surgical procedure of injecting viruses into the mouse brain through interactive operations. Based on user inputs, the STAM provides the information on the distance and injection angle between the injection site and origin defined by cranial or intracranial datum marks.","8000.0008":"Firstly, select the brain region for injection. Next, select the injection target on the chosen brain region. Continuing to click the 'Select target' button, a green dot follows the mouse cursor on the surface of the brain region's 3D model. Then, clicks 'Auto' to enter automatic type, the 'Structure for injecting' tab on the left data panel changes to 'Regions to avoid'. By clicking on the names of brain regions or nuclei to avoid, the selected text will highlight in bright red. Simultaneously, the 3D contours of these structures will be visualized in the main window. Next, clicking the 'Intellectual planning' button on the right panel initiates the process. After a few seconds, STAM returns a path originating from the injection target, avoiding all user-selected brain regions and nuclei.","8000.0009":"If the user clicks 'Manually' to enter manual planning type, the marked injection target turns into a blue dot. A red dashed line originates from the injection target and extends towards the current mouse position. The intersection of this dashed line with the outline of STAM (i.e., the injection site) is marked in green. Once the user identifies a suitable injection path, they can left-click to mark it. The marked path will appear as a solid blue line in the main window, with the injection site marked as a blue cone. The names of brain regions and nuclei that the path passes through will be arranged along the solid line according to their spatial positions. In the right panel, information about the angle between the injection path and three standard anatomical directions, the injection target, and the injection site is displayed. If the user wishes to restart the entire virtual surgery process, they can click the 'Reset' button on the right panel.","8000.0011":"As shown in ①, users can upload single brain slice images stained with PI or DAPI. This service will generate a corresponding atlas slice from STAM that is closest in position to the uploaded brain slice. The computed angle and position will then be displayed in the main window.","8000.0012":"Users can upload the 2D brain slice image in tif/tiff format for registration from your local device. Then select the type of the uploaded image. Next, click the 'Start' button in the 'Calculate the corresponding plane from the atlas' button group and wait for the result from the server. Once the calculation is complete, a preview image of the calculation result will appear below the 'Start' button, which can be enlarged by left-clicking. The 'Save' button to the right of the 'Start' button will also become clickable. By clicking this 'Save' button, users can download the calculation result to their local device.","8000.0013":"Right-click on the corresponding brain region or nucleus in the main window can jump to Arbitrary plane visualization and neuroanatomical knowledge base.","8000.0014":"As shown in ① and ②, users can select any region of interest within the 3D space of STAM and download the original images of the selected region at different sampling rates.","8000.0015":"Users can click “Select the range” button and orange-lined box will appear in the main window. Users can control the box's translation by left-clicking and dragging the red, green, and blue arrows, respectively. When an arrow is selected, it will be highlighted as bright yellow. ","8000.0016":"Users can switch from translation mode to scaling mode by pressing the 'A' key on the keyboard. In this mode, the arrows will change to squares, and dragging these squares will resize the box. Once the spatial range for the data to be downloaded is determined, users can click the 'preview selected data' button. This will visualize the images within the selected range in the main window using volume rendering.","8000.0017":"By dragging the 'Set the downsampling rate' slider, users can select the sampling rate for the data to be downloaded. The specific sampling rate value can be seen in the black-backgrounded tip above the slider. If the data size does not exceed 1 GB, clicking the 'Downloading' button to download it directly; When the value is exceeded, it will invoke the user's email client (such as Outlook) and automatically fill in the email body with the selected download range and sampling rate information. By clicking the send button, users can submit a data download request to the STAM website.","8000.0018":"We support users in uploading 3D image data and neuronal morphology data previously registered to the Common Coordinate Framework (CCF), then mapping it onto STAM, and directly visualizing it in 3D space. We also support reverse mapping, which allows data of the same type that has been registered to STAM to be mapped onto the CCF.","8000.0019":"Users can click the 'Upload' button in the right panel to upload 3D image data or neuronal morphology data that has been previously registered to either the CCF or STAM. After the uploading is completed, selecting the direction of conversion (either from STAM to CCF or vice versa) in the 'Select the direction of conversion' radio button. Then, click the 'Start' button to start the calculation on the STAM server. At this point, the 'Start' button enters the waiting status.","8000.0020":"After waiting for about 10 minutes, the STAM server finishes the calculation and returns the results. At this point, both the 'Save' button and the 'View result' button become clickable. Clicking the 'Save' button allows you to download the results to your local device; clicking the 'View result' button lets you preview the calculation results in the main window.","8000.0021":"We provide services to visualize atlas reslicing from any angle. Users can choose reslicing of STAM at any position and angle of interest, browse the brain regions and nucleus annotations on that reslicing, and jump from this reslicing to the isotropic 1-micron resolution reslicing provided by the STAM arbitrary section service.","8000.0022":"As shown in ①, on the left of the main window is the data panel, which has the same function as the data panel in “Stereotaxic topography visualization”. The central area is the main window.","8000.0023":"As shown in ②, users can also achieve translation and rotation of the atlas reslicing by dragging the sliders. The specific translation and rotation values can be seen in the black-background tip above the slider.","8000.0024":"Users can control the atlas reslicing's translation by left-clicking and dragging the red, green, and blue arrows, respectively. Users can switch from translation mode to rotation mode by pressing the 'R' key on the keyboard. In this mode, the arrows will change to sphere, and dragging these spheres will control the rotation of the atlas reslicing. ","8000.0025":"Users can also achieve translation and rotation of the atlas reslicing by dragging sliders. Users can clicking the “View higher resolution image” button can jump to Arbitrary plane visualization and click the “Requesting STAM labels” button and fill in the license to download 3D label images of isotropic 10 micron resolution STAM atlas.","8000.0026":"We provide services to visualize neuronal circuits of whole mouse brain somas or projection targets. Users can select any neural circuit data with somas or projection targets located in brain region or nuclei of interest, and examine the corresponding brain region and nuclei annotations of the neural circuit.","8000.0027":"As shown in ①, on the left of the main window is the data panel, which has the same function as 'Stereotaxic topography visualization'. The 'Neurons' tab is used to query and filter neuron morphological data with somas or projection targets located in regions of interest.","8000.0028":"As shown in ②, users can search for the brain region or nucleus of interest in the search box.","8000.0029":"As shown in ③, it is a neural circuit connection diagram composed of several brain regions and nucleus substructures.","8000.0030":"Users can click the 'whole brain connectivity diagram' button or search for the brain region or nucleus of interest in the search box to pop up a neural circuit connection diagram composed of several brain regions and nucleus substructures. Different dots represent different brain regions and nuclei, and the name of the brain region or nuclei is displayed next to the dot. Users can hover the mouse over dot or the name of a brain region or nuclei, left and right click the dot.","8000.0031":"Double click any dot representing a brain region or nuclei to hide the neural circuit connection diagram window and return to the main window page, displaying the upstream and downstream connection relationships of that structure. The neural circuits projected to the selected brain area and nucleus are displayed in the Upstream window, and the projection target areas of the selected brain area and nucleus are displayed in the Downstream window. Users can select any number of neurons of interest via checkboxes and visualize them in the main window.","8000.0032":"Query of anatomical structures, cerebral vascular, and neurons","8000.0033":"Visualize anatomical substructures and switch coordinate origin","8000.0034":"Visualization function settings","8000.0035":"Automatic planning mode","8000.0036":"Manual planning mode","8000.0037":"Upload brain slice image and calculate or download registration result","8000.0038":"Function of page jump","8000.0039":"Zoom mode to select the range of original image data and previews the image","8000.0040":"Select the sampling rate of the data and download","8000.0041":"Upload 3D image data and calculate","8000.0042":"Preview or download the result after the calculation is completed","8000.0043":"Translate or rotate the slice of the atlas for sectional view","8000.0044":"Download 3D label images of isotropic 10 micron resolution STAM atlas","8000.0045":"View the neural circuit connectivity diagram and interact","8000.0046":"Display the upstream and downstream connections of any user-appointed brain structure","8000.0047":"ranslation mode to select the range of original image data","5000.7001":"atlas","5000.7002":"first","5000.7003":"second","5000.7000":"(Optional) Upload the second slice, which is previously co-registered to the first uploaded slice","5000.7004":"opacity","5000.7005":"Terminals","5000.7006":"Visibility","5000.7007":"Branchings","5000.7008":"Analysis","5000.7009":"Distribution of neuron terminals","5000.7010":"terminals","5000.7011":"Pattern of neuron projections","5000.7012":"Distribution of projection length","5000.7013":"fliplr","7000.7014":"Also, you can download the ","7000.7015":" plugins for this function. If you want to use the test data, click","7000.7016":" here ","7000.7017":"to download.","7000.7018":"Issue report","7000.7019":"Set as the focus","7000.7020":"Reset the focus","7000.7021":"Reslicing Mode","7000.7022":"Translate","7000.7023":"Rotate","7000.7024":"Control mode","7000.7025":"Display available neurons only","7000.7026":"Click the Color button to modify the neuron color; click the Ana. button to display the analysis results of the neuron's projection pathway; click the Path button to show the brain structures traversed by the neuron on the main window; the Src button displays the source of the neuron data.","7000.7027":"Feedback","5000.7026":"Request timed out, download failed","5000.7027":"computational failure","5000.7028":"Cannot find a satisfactory path","5000.7029":"Too many regions to avoid, please reduce the number of regions to avoid","5000.7030":"Click here to download the queried results","5000.7031":"If you haven't applied for the key, you can click it."},pzt={"2002.0301":"提供基于多人在线协作模式,神经元重建","5000.0112":"取消","2002.0302":"查看数据","5000.0111":"提交","4000.0210":"平移-X","2002.0300":"神经元协同标注平台","5000.0113":"董宏伟命名系统别名","4000.0212":"平移-Z","4000.0211":"平移-Y","4000.0214":"角度-Y","5000.0110":"编辑","4000.0213":"角度-X","4000.0216":"查看高分辨率切片","4000.0215":"角度-Z","4000.0218":"坐标","4000.0217":"左半脑","4000.0219":"基准点","4000.0100":"","4000.0221":"转到冠状面","4000.0220":"大小","4000.0102":"前囟","4000.0223":"转到水平面","4000.0101":"单位:毫米","4000.0222":"转到矢状面","4000.0104":"矢状面","4000.0225":"引导","4000.0103":"冠状面","4000.0224":"转到任意面","2001.0402":"查看数据","4000.0106":"脑解剖结构检索","2001.0401":"探索血管图谱数据库","4000.0105":"水平面","4000.0226":"完成","4000.0108":"脑地图4.0命名系统","4000.0229":"下一步","2001.0403":"血管","4000.0107":"艾伦参考脑命名系统","4000.0228":"跳过","4000.0109":"小鼠脑图谱","2001.0400":"血管图谱","1000.0400":"登录","2002.0202":"查看数据","2002.0200":"配准服务","2002.0201":"提供脑片配准服务","6000.0112":"请输入电子邮箱","6000.0110":"请输入数据用途","6000.0111":"Label图像下载","7000.0108":"开始计算","7000.0109":"下载保存","7000.0106":"计算与上传图像对应的图谱切面","7000.0107":"查看更高分辨率的图像","4000.0201":"解剖结构","4000.0443":"先在左侧选择一个结构","7000.0104":"获取测试图像","4000.0200":"","7000.0105":"上传","4000.0203":"虚拟手术","4000.0445":"在右侧可以拖动截面的位置","7000.0102":"描述","4000.0202":"装配图","4000.0444":"在模型中右击选择你需要的面","7000.0103":"选择上传图像的类型","4000.0205":"展开幅度","7000.0100":"","4000.0204":"图谱切面","4000.0446":"点击查看更高分辨率的图像跳转","7000.0101":"配准服务","4000.0207":"缩放","4000.0206":"步长","2001.0101":"探索立体定位图谱的2D/3D图像信息","4000.0209":"重置","2001.0100":"立体定位图谱","4000.0208":"选择靶点","2001.0102":"查看数据","1000.0302":"联系我们","1000.0303":"帮助","1000.0300":"关于","1000.0301":"简介","4000.0131":"仅显示结构轮廓","4000.0130":"显示图谱","2002.0101":"提供高分辨任意角度切面服务","2002.0102":"查看数据","4000.0132":"核团信息","7000.0113":"上传和下载","7000.0111":"上传的图像","7000.0112":"输出的图像","7000.0110":"如果对这个在线注册工具有任何疑问,欢迎联系atlas@brainsmatics.org","2002.0100":"高分辨任意角度切面服务","6000.0105":"数据用途","6000.0106":"提交","6000.0103":"通讯地址","6000.0104":"电子邮箱","6000.0109":"请输入通讯地址","2000.2001":"图谱和数据","6000.0107":"请输入单位名称","6000.0108":"请输入联系人员","2001.0200":"特定类型细胞分布图谱","6000.0101":"单位名称","6000.0102":"联系人员","2001.0202":"查看数据","2001.0201":"探索特定类型细胞分布图谱的2D/3D图像信息","6000.0100":"","1000.0203":"神经元协同标注平台","1000.0204":"数据共享服务","1000.0200":"工具","1000.0201":"高分辨任意角度切面服务","1000.0202":"配准服务","2000.2002":"服务","2000.0500":"脑图谱","2002.0400":"数据共享服务","4000.0230":"上一步","2002.0401":"Label图像下载服务","4000.0111":"背-腹","4000.0232":"第二步","4000.0110":"前-后","4000.0231":"第一步","4000.0113":"显示","4000.0234":"第四步","4000.0112":"内-外","4000.0233":"第三步","2002.0402":"查看数据","4000.0115":"二维浏览","4000.0236":"在左侧选择一个结构","4000.0114":"三维图谱","4000.0235":'点击"开始"按钮',"4000.0117":"重置为默认视图","4000.0238":'点击"结束"按钮',"4000.0116":"标注","4000.0237":"在选择的结构上左键点击确定注射位点,<br>再通过移动鼠标确定注射方向","4000.0119":"网格线","4000.0118":"信息框","4000.0239":"设置展开长度","4000.0120":"前往","4000.0241":"点击此处图标,选中的结构会展开,<br>再次点击该图标后可以从展开状态中退出","5000.0101":"Paxinos命名系统别名","4000.0240":"设置中心展开的缩小程度","5000.0100":"","4000.0122":"该结构介绍","5000.0103":"参考","4000.0121":"三维浏览器","4000.0242":"清除靶点","5000.0102":"Hof命名系统别名","4000.0124":"缩小","4000.0123":"图示","4000.0126":"重置","4000.0125":"放大","4000.0128":"前往三维浏览器","5000.0109":"化学物质名称","2001.0302":"查看数据","4000.0127":"全屏","5000.0108":"疾病名称","4000.0129":"查看高分辨率图像","5000.0105":"疾病","5000.0104":"基因","2001.0301":"探索神经元形态数据库","5000.0107":"基因名称","2001.0300":"神经元形态数据库","5000.0106":"化学物质","1000.0104":"血管图谱","1000.0100":"脑图谱数据","1000.0101":"立体定位图谱","1000.0102":"特定类型细胞分布图谱","1000.0103":"神经元形态数据库","5000.0001":"脑片配准","5000.0002":"上传图像","5000.0003":"上传失败,请联系管理员","5000.0004":"显示结果","5000.0005":"数据下载","5000.0006":"选取下载范围","5000.0007":"取消选取范围","5000.0008":"预览下载图像","5000.0009":"提示:按A键切换平移和缩放模式","5000.0010":"设置采样倍数","5000.5012":"默认模式","5000.5013":"虚拟手术模式","5000.5014":"图谱映射","5000.5015":"选择转换方向","5000.5016":"颅骨","5000.5018":"下载所选范围","5000.5019":"上传已配准到STAM或CCF的3D图像或swc文件","5000.5020":"将上传数据映射到另一个图谱:","5000.5021":"开始计算","5000.5022":"下载保存","5000.5023":"显示结果","5000.5024":"其它图谱","5000.5025":"设置","5000.5026":"极简模式","5000.5027":"选择注射脑区","5000.5028":"选择注射靶点","5000.5029":"清除注射靶点","5000.5017":"开始智能规划","5000.5030":"规划中","5000.5031":"数据块预估大小:","5000.5032":"显示其他","5000.5033":"控制面板","5000.0019":"也可以按R在旋转模式和平移模式之间切换","5000.5034":"自动","5000.5035":"手动","5000.5057":"显示三维形貌","5000.5056":"隐藏三维形貌","5000.5058":"无法规划路径以避开勾选的结构","5000.5060":"隐藏投射路径","5000.5061":"显示投射路径","5000.5039":"下载{{name}}周围的原始图像","5000.5038":"切换{{name}}为坐标原点","5000.5040":"输入胞体所在脑区简写或全称","5000.5041":"输入投射所在脑区简写或全称","5000.0206":"显示穿过的血管分支","5000.0207":"隐藏穿过的血管分支","5000.0208":"显示被供血的结构","5000.0209":"隐藏被供血的结构","5000.5044":"使用该功能需要一个API Key。目前我们提供了一个临时的测试Key。请点击Go on按钮","5000.5051":"提示:key值将会发送到所填邮箱账号上,请提交完后关注邮箱是否收到信息。","5000.0011":"发送邮件","5000.5043":"填写Key","5000.5042":"申请Key","5000.5045":"提交","5000.5049":"Key值","5000.5070":"申请人","5000.5071":"邮箱","5000.5072":"所属单位","5000.5073":"使用目的","5000.5050":"保存","5000.5052":"神经环路","5000.5053":"请输入待查询的结构","5000.5047":"提交失败","5000.5048":"提交成功","5000.5054":"上游结构","5000.5055":"下游结构","5000.5083":"步骤一","5000.5084":"步骤二","5000.5085":"设置展开长度","5000.5080":"单击此处的图标以展开所选结构。再次单击图标将允许您退出展开状态","5000.5081":"选择左侧的结构","5000.5082":"请选择注射模式,如果选择自动模式,点击左侧细胞名称选择细胞核进行计算","5000.5086":"对话STAM","5000.6001":"输入一个待查询结构,可视化其连接图谱。可以试着填入 ","5000.6002":"语言切换","5000.0012":"当前下载文件已超出服务器传输限制,您可以选择降低采样等级或者发送邮件,是否发送邮件?","5000.6003":"投射路径","5000.6004":"隐藏该神经元","5000.6005":"冠状视图","5000.6006":"矢状视图","5000.6007":"水平视图","5000.6008":"点击下方按钮,申请下载各向同性10微米分辨率的STAM图谱3D标签图像","5000.6009":"请求STAM标签","5000.6010":"提示:下载所用的许可号将会发送到您所填写的邮箱,请在提交结束后关注是否收到包含许可号的邮件。","5000.6011":"请注意,使用此功能需要提供下载许可号,如果您没有下载许可号,请点击下方按钮向我们申请","5000.6012":"申请下载许可号","5000.6013":"填写下载许可号","5000.6014":"许可号","5000.6015":"查询位于或投射到该结构的神经元","5000.6019":"浏览 {{focusVirusLineItem}} 的知识库页面","5000.6020":"浏览 {{focusVirusLineItem}} 的父结构 {{lableValue}} 的知识库页面","5000.6016":" RGB值","5000.6017":"所属脑区","5000.6018":"查看更高分辨率图像","5000.6021":"隐藏该分支","5000.6022":"设置 {{lableStr}} 的包围盒为下载范围","5000.6023":"隐藏 {{name}} 的三维形貌","5000.6024":"显示 {{name}} 的三维形貌","5000.6025":"切换到冠状面","5000.6026":"切换到矢状面","5000.6027":"切换到水平面","5000.6028":"切换到任意角度切面","5000.6029":"探索由单神经元投射所构成的","5000.6030":"全脑连接范式图","5000.6031":"。您也可以:","5000.6032":"","5000.6033":"上传脑片图像,或使用","5000.6034":"的测试脑片图像:","5000.6035":"上传已配准到STAM或CCF的3D图像或swc文件,或使用测试","5000.6036":"3D图像","5000.6037":"swc文件:","5000.6038":"数据来源: {{name}}","5000.6039":"平颅方位","5000.6040":"投射丰富","5000.6041":"新标注","5000.6042":"关闭","5000.6043":"启用","5000.6044":"网格","5000.6045":"脑外轮廓","5000.5087":"步骤三","5000.5088":"步骤四","8000.0001":"如①所示,在主窗口左侧的是数据面板,用户可以在该选项卡下选择STAM的解剖命名树,配准到STAM上的完整脑血管图谱和神经元数据。用户也可以切换两个不同版本的命名系统。","8000.0002":"如②所示,主窗口中可以加载脑区、核团的三维模型。","8000.0003":"如③所示,用户可以切换不同的模式或者功能模块","8000.0004":"Regions选项卡包含的是STAM的解剖命名树,用户可以在该选项卡下的复选框中选择任意数量的感兴趣结构,在主窗口中可视化;Vessels选项卡包含了一套配准到STAM上的完整脑血管图谱,用户可以在此选择感兴趣的血管分支;Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。用户也可以选择切换到Brain maps 4.0 ontology,该命名树中的结构同样可以被检索、选中并可视化。","8000.0005":"用户可以点击Regions选项卡下的解剖命名树中蓝色的方块图标,此时主窗口中会以组装的形式可视化用户点击结构的所有子结构,同时展开幅度可在右侧面板设置。默认情况下,该坐标系统以Bregma点作为原点。户也可以将坐标原点切换为STAM的其它任意19个颅骨或颅内基准点,主窗口中可视化对象的坐标值将根据新的原点重新计算。右击任意基准点,可以保存以基准点为坐标原点的STAM标签图像。","8000.0006":"用户可以在页面底部切换到setting选项卡。Left hemisphere开关决定是否展示左半脑,默认为Off。Coordinate开关决定是否在主窗口中显示坐标数值,默认为On。Datum Marks开关决定是否在主窗口中显示基准点,默认为On。Cranial开关决定是否在主窗口中显示颅骨的三维轮廓,默认为Off。","8000.0007":"我们提供了虚拟手术导航服务,用户可以通过交互操作,模拟向小鼠脑注射病毒的立体定位手术过程。STAM会根据用户操作,返回注射位点与作为坐标原点的颅骨或颅内基准点之间的距离和注射角度信息。","8000.0008":"首先选择要注射的脑区。接下来在脑区上选择注射靶点。用户继续点击Select target按钮,注射脑区的三维模型表面会出现一个跟随鼠标移动的绿点。然后,点击Auto进入自动模式,左侧数据面板中的Structure for injecting选项卡变为Regions to avoid。用户点击需要避开脑区、核团的名称,被选中的文字会变为高亮的红色,同时这些结构的三维轮廓也会显示在主窗口中。接下来点击右侧面板中的Intellectual planning按钮,等待若干秒后,STAM会返回一条从注射靶点出发、并且避开所有用户选中脑区、核团的路径。","8000.0009":"用户点击Manually进入手动规划模式,此时用户标记的注射靶点变为蓝色圆点,并出现一条从注射靶点出发、连接到鼠标当前的位置的红色虚射线,该射线与STAM外轮廓的交点(即注射位点)会被标记为绿色。当用户找到合适的注射路径后,可点击鼠标左键标记,被标记的路径会在主窗口中形成一条蓝色实线,注射位点则被标记为蓝色圆锥,且该路径所穿过的脑区、核团名称也会按照其空间位置排列在实线上。在右侧面板中,会出现该注射路径与三个标准解剖方向的夹角、注射靶点,以及注射位点的信息。用户点击右侧面板上的Reset按钮,即可重新开始整个注射手术流程。","8000.0011":"如①所示,用户可上传PI或DAPI染色的单张脑片图像,该服务将通过约1分钟的服务器端计算,从STAM中重切出一张与用户上传的脑片位置最接近的图谱切面,并根据计算出来的角度和位置显示在主窗口中。","8000.0012":"用户可以从本地上传待配准的tif/tiff格式的二维脑片图像。然后选择上传图像的类型。接着点击Calculate the corresponding plane from the atlas按钮组中的Start按钮,等待后台返回计算结果。计算完成后,Start按钮下方会出现计算结果的预览图,可左键单击放大查看。Start按钮右侧的Save按钮此时也变为可点击,用户单击该按钮,可以将计算结果下载到本地。","8000.0013":"在主窗口右击相应的脑区、核团,可以跳转到任意剖面可视化和脑解剖知识库页面。","8000.0014":"如①和②所示,用户可以在STAM所在的三维空间中选取任意感兴趣范围,并以不同的采样倍数下载自己选取范围内的原始图像。","8000.0015":"用户可以点击“Select the range”按钮,然后主窗口中出现一个橙色线条的方框。用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制方框在各个方向上的平移,当某个方向的箭头被用户选中时,该箭头会变为高亮的黄色。","8000.0016":"用户也可以通过按下键盘上的“A”,将范围选取操作从平移模式切换为缩放模式。此时方框的箭头会变为方块,拖动方块,就可以改变方框的大小。经过上述操作明确了待下载数据的空间范围后,可以点击“预览下载图像”按钮,通过体绘制,在主窗口中对该范围内的图像进行可视化,","8000.0017":"拖动“Set the downsampling rate”滑动条,用户可以选择待下载数据的采样倍数;具体的倍数值可通过滑块上方的黑色背景提示文字查看。当数据量没有超过1 GB时,点击Downloading按钮可直接下载;当超过该数值,点击Downloading按钮会唤起用户终端的邮箱管理工具(如Outlook等),并自动将待下载范围和采样倍数信息填入邮件中,此时用户点击邮件发送按钮,即可向STAM网站发送数据下载申请。","8000.0018":"我们支持用户上传此前已经配准到Common Coordinate Framework(CCF)的三维图像数据和神经元完整形态数据,并将其映射到STAM上,并直接在三维空间中进行可视化;我们也支持反向映射,即将已经配准到STAM的同类型数据映射到CCF上。","8000.0019":"用户点击右侧面板的Upload按钮,上传已配准到CCF或者STAM的三维图像数据或神经元形态学数据。上传结束后,在Select the direction of conversion单选框中,确定数据的映射方向是从STAM到CCF还是反过来。此后点击Start按钮,STAM的服务器端开始计算,Start按钮变为等待状态。","8000.0020":"等待约10分钟后,STAM的服务器端完成计算并返回结果。此时Save按钮和View result按钮均变为可点击状态。点击Save按钮,可以将计算结果下载到本地;点击View result按钮,可以在主窗口中预览计算结果。","8000.0021":"我们提供了沿任意角度可视化脑图谱切面的服务。用户可以查看感兴趣的STAM任意位置和角度的切面,浏览该切面上的脑区、核团标注,并由该图谱切面跳转到STAM任意切面服务所提供的各向同性1微米分辨率切面。","8000.0022":"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同。位于正中区域的是主窗口。","8000.0023":"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。具体的平移、旋转数值可通过滑块上方的黑色背景提示文字查看。","8000.0024":"用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制图谱切面的平移。用户也可以通过按下键盘上的“R”,将范围选取操作从平移模式切换为旋转模式。此时箭头会变为球形,沿球形拖动,就可以控制图谱切面的旋转。","8000.0025":"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。点击viewer higher resolution image按钮可以跳转到任意剖面可视化界面。点击Requesting STAM labels按钮,填入许可证即可下载各向同性10微米分辨率的STAM图谱3D标签图像。","8000.0026":"我们提供全脑的胞体或投射靶区的神经环路数据可视化服务。用户可以选择感兴趣的任意胞体或投射靶区在脑区、核团的神经环路数据,并查看数据对应的脑区、核团标注。","8000.0027":"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同,其中Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。","8000.0028":"如②所示,用户可以在搜索框中搜索感兴趣脑区、核团。","8000.0029":"如③所示,这是一个由若干个脑区、核团子结构组成的神经环路连接示意图。","8000.0030":"用户可以点击“whole-brain connectivity diagram”按钮或在搜索框中搜索感兴趣脑区、核团,即可弹出由若干个脑区、核团子结构组成的神经环路连接示意图。不同圆点表示不同的脑区、核团结构,圆点旁边显示的是脑区、核团的名称。用户可以将鼠标移动到圆点、脑区或核团的名称上,左击或右击圆点。","8000.0031":"双击任意一个代表某个脑区、核团结构的圆点,神经环路连接示意图窗口隐藏,回到主窗口页面,显示该结构的上下游连接关系。在Upstream窗口中展示了投射到选中脑区、核团的神经环路,在Downstream窗口中展示了选中脑区、核团的投射靶区。用户可以用复选框选择任意数量的感兴趣神经元,在主窗口中可视化。","8000.0032":"解剖结构、脑血管和神经元查询","8000.0033":"可视化解剖子结构并切换坐标原点","8000.0034":"可视化功能设置","8000.0035":"自动导航模式","8000.0036":"手动导航模式","8000.0037":"上传脑片图像并计算或下载配准结果","8000.0038":"页面跳转功能","8000.0039":"缩放模式选择原始图像数据的范围并预览图像","8000.0040":"选择数据的采样倍数并下载","8000.0041":"上传三维图像数据并计算","8000.0042":"计算完成后预览或下载结果","8000.0043":"平移或旋转图谱切面","8000.0044":"下载高分辨率的STAM图谱3D标签图像","8000.0045":"查看神经环路连接示意图并交互","8000.0046":"显示用户指定脑区上下游连接关系","8000.0047":"平移模式选择原始图像数据的范围","8000.0048":"","5000.7001":"图谱","5000.7002":"脑片1","5000.7003":"脑片2","5000.7000":"(可选)上传第二张脑片图像,默认该图像已经配准到了第一张上传的脑片图像上","5000.7004":"阻光度","5000.7005":"末梢点","5000.7006":"可见性","5000.7007":"分支点","5000.7008":"分析","5000.7009":"神经元末梢分布","5000.7010":"末梢点","5000.7011":"神经元投射模式","5000.7012":"投射长度分布","5000.7013":"左右翻转","7000.7014":"您也可以在此下载","7000.7015":"的插件;您可能需要使用测试数据,请","7000.7016":"在此","7000.7017":"下载。","7000.7018":"报告问题","7000.7019":"设置为焦点","7000.7020":"重置焦点","7000.7021":"重切片模式","7000.7022":"平移 ","7000.7023":"旋转","7000.7024":"控制模式","7000.7025":"只展示可用神经元","7000.7026":"点击Color按钮,修改神经元颜色;点击Ana.按钮,显示神经元投射路径分析结果;点击Path按钮,在主界面显示神经元经过的脑结构;Src按钮展示了神经元数据的来源","7000.7027":"反馈","5000.7026":"请求超时,下载失败","5000.7027":"计算失败","5000.7028":"没有合适的路径","5000.7029":"请求过于频繁,请稍后再试","5000.7030":"点此下载查询结果","5000.7031":"如果你没有申请过key可以点击"},vzt="en_us",gzt={zh_cn:"zh",en_us:"en"},X8e=localStorage.getItem("lang")||vzt,mzt=gzt[X8e]||"en";localStorage.setItem("lang",X8e);Od.use(H$t).init({resources:{en:{translation:hzt},zh:{translation:pzt}},lng:mzt,fallbackLng:"en",interpolation:{escapeValue:!1}});const{Content:yzt}=UO;var kh=new DX({antialias:!0,logarithmicDepthBuffer:!0});kh.localClippingEnabled=!0;var bzt=new Nm(window.innerWidth-450,window.innerHeight);const WB=new M$t(kh,bzt);let Gve;new $8e(R$t);let xzt=new URL(window.location.href),Cv=new URLSearchParams(xzt.search),jve=Cv.get("datumMarkVisibility"),Wve=Cv.get("regionsChecked"),Xve=Cv.get("vesselsChecked"),Zve=Cv.get("neuronsChecked");Cv.get("leftHemisphereVisibility");let Kve=Cv.get("terminalVisibility"),Yve=Cv.get("branchingVisibility"),qve=Cv.get("branchingColor"),Jve=Cv.get("gridVisibility"),Qve=Cv.get("echart_Value"),ege=Cv.get("leftTabIndex");const Czt=t=>{const{atlasTopography:e,cerebralVessels:n,datumMarks:r,atlasColormap:i,atlasOntology:a,resourceTab:o,toolTab:s,ScaleNum:c,lang:u,home:d,ServerUrl:f}=t,{t:h}=Z$t(),p=C.useRef({}),v=C.useRef(null),y=C.useRef(new Ave(Ai.current,kh.domElement)),[g,m]=C.useState(1),b=C.useRef(1),[x,S]=C.useState(jve?JSON.parse(jve):!0),w=C.useRef(null),_=C.useRef(null),A=C.useRef([]),P=C.useRef(null),R=C.useRef(null),N=C.useRef(!1),k=C.useRef(!1),[B,H]=C.useState(!0),[F,G]=C.useState([]),z=C.useRef(2),[V,j]=C.useState(""),Y=C.useRef([]),W=C.useRef([]),Z=C.useRef(new Pa),[te,se]=C.useState("nucleusColour"),q=C.useRef(1),ne=C.useRef(null),[oe,ie]=C.useState(!0),ee=C.useRef(),ye=C.useRef(),ve=C.useRef(),pe=C.useRef(),[re,xe]=C.useState(Wve?JSON.parse(Wve):[]),[Q,be]=C.useState(Xve?JSON.parse(Xve):[]),[de,Ee]=C.useState(Zve?JSON.parse(Zve):[]),De=C.useRef(On=>new Ie),[He,Pe]=C.useState(!1),Se=C.useRef(new Ie),[We,ge]=C.useState(new Ie),[ue,Me]=C.useState(ege?parseInt(ege):1),it=C.useRef(!1),[Ne,Ke]=C.useState(!1),ft=C.useRef(""),[ct,ut]=C.useState(3),Ct=C.useRef(null),st=C.useRef([]),[ke,ht]=C.useState(""),nt=C.useRef(()=>{}),[et,bt]=C.useState(1),ze=C.useRef(1),[Mt,It]=C.useState({}),[Dt,Lt]=C.useState(""),Bt=C.useRef({}),[Gt,un]=C.useState(""),[xn,wn]=C.useState(""),[Fn,en]=C.useState({}),[Mr,_n]=C.useState(Qve||""),[gn,Rn]=C.useState(!1),[dn,Xn]=C.useState(0),[cr,Or]=C.useState({}),Bn=C.useRef({}),[ar,Ge]=C.useState(Jve?JSON.parse(Jve):!0),[At,Nt]=C.useState([]),[Ft,kt]=C.useState([]),[zt,Vt]=C.useState([]),[Xt,Dn]=C.useState(!1),[$t,Rt]=C.useState({});localStorage.setItem("lang",u||"en"),sa.current=c,uo.current=-5.7,qa.current=-6,to.current=-7.0055;const[qt,Un]=C.useState([]),In=C.useRef({start:Yve?JSON.parse(Yve):!0,end:Kve?JSON.parse(Kve):!0,start_color:qve||"#A7B5A1"});C.useEffect(()=>{var zr;Ae.current=new l7,Ai.current=new Uu(45,(window.innerWidth-450)/window.innerHeight,.01,1e4),Ai.current.position.set(18,-10,-10),Ai.current.up.set(0,-1,0),Ai.current.lookAt(new Ie(0,0,0)),bS.current=new Ow(16777215,4.5,0,.04),bS.current.position.set(18,-10,-10),Ae.current.add(bS.current),Ae.current.background=new li("#fff"),(zr=v.current)==null||zr.appendChild(kh.domElement),kh.setSize(window.innerWidth-450,window.innerHeight),y.current=new Ave(Ai.current,kh.domElement);let On=new URL(window.location.href),er=new URLSearchParams(On.search),jr=er.get("cameraInfo"),yr=er.get("controllerInfo");if(jr&&yr){let tr=JSON.parse(jr),Lr=JSON.parse(yr);Ai.current.position.set(tr.cameraPosition.x,tr.cameraPosition.y,tr.cameraPosition.z),bS.current.position.set(tr.cameraPosition.x,tr.cameraPosition.y,tr.cameraPosition.z),Ai.current.rotation.set(tr.cameraRotation.x,tr.cameraRotation.y,tr.cameraRotation.z),y.current.reset(),y.current.target.set(Lr.controlsTarget.x,Lr.controlsTarget.y,Lr.controlsTarget.z),y.current.object.position.set(Lr.controlsPosition.x,Lr.controlsPosition.y,Lr.controlsPosition.z),y.current.object.up.set(Lr.controlsUp.x,Lr.controlsUp.y,Lr.controlsUp.z),y.current.update(),Ai.current.updateMatrixWorld()}y.current.rotateSpeed=10,y.current.zoomSpeed=6,y.current.minDistance=1,y.current.maxDistance=6e3,y.current.staticMoving=!0,y.current.addEventListener("change",function(tr){bS.current.position.set(Ai.current.position.x,Ai.current.position.y,Ai.current.position.z);const Lr=JSON.stringify({cameraPosition:Ai.current.position,cameraRotation:Ai.current.rotation}),Dr=JSON.stringify({controlsTarget:y.current.target,controlsPosition:y.current.object.position,controlsUp:y.current.object.up});let Qn=new URL(window.location.href),Pr=new URLSearchParams(Qn.search);Pr.set("cameraInfo",Lr),Pr.set("controllerInfo",Dr),Qn.search=Pr.toString(),window.history.replaceState({},"",Qn)}),window.addEventListener("resize",Zn),window.addEventListener("wheel",nn),document.addEventListener("contextmenu",function(tr){tr.preventDefault()}),Gve=new L$t(Ae.current,Ai.current),WB.addPass(Gve),Wn(),f&&Ir(f),fetch("/app-api/p2p-api/folders").then(tr=>{if(!tr.ok)throw new Error(`HTTP error! Status: ${tr.status}`);return tr.json()}).then(tr=>{if(tr.code===200){let Lr=[{title:"Local",value:"0",key:"0",children:[]},{title:"Web",value:"1",key:"1",children:[]}];tr.data.forEach(Dr=>{const Qn={title:Dr.path,key:Dr.name,value:Dr.path};Dr.path.length>46?Lr[1].children.push(Qn):Lr[0].children.push(Qn)}),Un(Lr)}}).catch(tr=>{console.error("Fetch error:",tr)})},[]),C.useEffect(()=>{xr(zt)},[zt]);const xr=On=>{fetch("/app-api/p2p-api/swctree",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:On}),redirect:"follow"}).then(er=>er.json()).then(er=>{kt(er.data.swctree),Rt(er.data.soma_axon_data)}).catch(er=>console.log("error",er))};C.useEffect(()=>{let On=new URL(window.location.href),er=new URLSearchParams(On.search);er.set("leftTabIndex",String(ue)),On.search=er.toString(),window.history.replaceState({},"",On)},[ue]);async function Ir(On){try{const er=await fetch(On);if(!er.ok)throw new Error("Network response was not ok "+er.statusText);const jr=await er.json();jr.code===200?Nt(jr.data):console.error("Failed to fetch tab:",jr.message)}catch(er){console.error("Error fetching data:",er),alert("接口不可用,请检查服务器状态。")}}const Zn=()=>{kh.setSize(window.innerWidth-450,window.innerHeight),Ai.current.aspect=(window.innerWidth-450)/window.innerHeight,Ai.current.updateProjectionMatrix()},nn=()=>{y.current.update();const On=Ai.current.position;let er=Ae.current.getObjectByName("DR-anterior");if(er){const jr=On.distanceTo(er.position);for(let yr in p.current)p.current[yr].contentobj.children.forEach(tr=>{tr.levels.forEach((Lr,Dr)=>{Dr===0?Lr.object.visible=jr<9:Dr===1&&(Lr.object.visible=jr>=9)})});Ae.current.traverse(function(yr){yr.name==="lineNameMesh"&&yr.type==="Mesh"&&(jr<9&&jr>=6?yr.scale.x!=.3&&yr.scale.set(.3,.3,.3):jr<6?yr.scale.x!=.2&&yr.scale.set(.2,.2,.2):yr.scale.x!=.5&&yr.scale.set(.5,.5,.5))})}},Wn=()=>{requestAnimationFrame(Wn),y.current.update(),Ai.current.updateMatrixWorld(),Ae.current.traverse(function(On){On.name==="lineNameMesh"&&On.type==="Mesh"&&(On.up.set(0,-1,0),On.rotation.copy(Ai.current.rotation))}),WB.render()},Cn=On=>{Me(On),z.current=On},Sn=On=>{bt(On.target.value),ze.current=On.target.value};return C.createElement(UO,{className:"content",style:{overflowX:"hidden"}},C.createElement(yzt,{className:"Box3D",style:{height:"100%",display:"flex"}},C.createElement("div",{style:{height:"calc(100vh - 5px)",overflowY:"auto",background:"#fff",padding:10,position:"relative",borderRight:"1px solid #ccc"}},C.createElement(Om,{onChange:Cn,activeKey:ue.toString(),style:{width:300},defaultActiveKey:"1"},o.includes("label")?C.createElement(iT,{forceRender:!0,tab:q.current==2?ct===2?"Regions to avoid":"Structure for injecting":"Regions",key:String(o.indexOf("label")+1)},C.createElement(EL,{regionData:e,tasktype:"task3D",ref:ee,setdatum:S,offset_factor_R:b,vesselObj:p,treeDatas:a,type:"fbx",leftTreeRef:_,resourceTab:o,baozhaRef:w,needBaozha:!0,offset_factor:g,renderer:kh,axis_font:A,t:h,json_name:te,title:"Regions",showimage:oe,setCheckItems:xe,checkItems:re,outflag:He,clickPoint:Se,setendPoint:ge,automaticGroup:st,mode:et,echartValue:Mr,setEchartValue:_n,updatePage:Mt,auxRef:ye})):null,o.includes("vessel")?C.createElement(iT,{forceRender:!0,tab:ct===2?"Vessels to avoid":"Vessels",key:String(o.indexOf("vessel")+1)},C.createElement(EL,{regionData:e,tasktype:"task3D",ref:ve,offset_factor_R:b,offset_factor:g,vesselObj:p,treeDatas:n,type:"vessel",axis_font:A,t:h,renderer:kh,title:"Vessel",setdatum:function(On){throw new Error("Function not implemented.")},json_name:"",setCheckItems:be,checkItems:Q,clickPoint:Se,automaticGroup:st,mode:et})):null,o.includes("neurons")?C.createElement(iT,{forceRender:!0,disabled:ct===1,tab:"Neurons",key:String(o.indexOf("neurons")+1)},C.createElement(EL,{regionData:e,tasktype:"task3D",ref:pe,offset_factor_R:b,offset_factor:g,vesselObj:p,treeDatas:Ft,fbxTreeDatas:a,type:"swc",axis_font:A,t:h,renderer:kh,title:"Neuron",setdatum:function(On){throw new Error("Function not implemented.")},json_name:"",swclist:[],metadata:!1,setCheckItems:Ee,checkItems:de,clickPoint:Se,mode:et,axon_check:$t,swcnameMesh:Bt,childRef:ee,PointShow:In,Selected:zt,setSelected:Vt,setFormshow:Dn,Selectoptions:qt,formshow:Xt})):null,At.map((On,er)=>C.createElement(iT,{forceRender:!0,tab:On.name,key:er+3},C.createElement("p",null,On.name))))),C.createElement(sEe,{datum:x,regionData:e,renderer:kh,controls:y,vesselObj:p,pointDatas:r,currentRef:v,setHrefStr:j,menutagShow:B,setMenuTagShow:H,angleRef:P,jiaoduRef:R,menuTag:F,axis_font:A,startselect:N,mouseflag:k,linemeshs_jing:Z,points:Y,points2:W,activetabIndex:q,fetchCoordinateFunc:De,checkItems:re,outflag:He,clickPoint:Se,setoutflag:Pe,endPoint:We,outflagRef:it,setShowModeChoose:Ke,virusModeValue:ft,pipelineClickEvent:Ct,focusVirusLineItem:ke,setFocusVirusLineItem:ht,responsefunc:nt,mode:ze,childRef:ee,setUpdatePage:It,t:h,setSwcItem:Lt,swcItem:Dt,swcnameMesh:Bt,axon_check:$t,automaticGroup:st,setCheckItems:xe,vesselRef:ve,swcRef:pe,setLableStr:wn,setVesselStr:un,vesselStr:Gt,lableStr:xn,tabIndex:z,updatePage:Mt,sectionsInfoRef:Bn,setSectionsInfo:Or,gray_value:i,Luguchecked:dn,gridShow:ar,setNodeStr:en}),s.length!=0?C.createElement(A6e,{regionData:e,lefttab:o,righttab:s,ref:ye,renderer:kh,controls:y,offset_factor_R:b,setoffset_factor:m,baozhaRef:w,hrefStr:V,leftTreeRef:_,centerRef:v,childRef:ee,angleRef:P,jiaoduRef:R,mouseflag:k,menutagShow:B,setMenuTag:G,t:h,startselect:N,linemeshs_jing:Z,points:Y,points2:W,activetabIndex:q,material:ne,setShowimage:ie,checkItems:re,fetchCoordinateFunc:De,setoutflag:Pe,outflag:He,clickPoint:Se,setendPoint:ge,outflagRef:it,setdatum:S,datum:x,axis_font:A,modeChoose:Ne,setShowModeChoose:Ke,virusModeValue:ft,setShowTabNums:ut,pipelineClickEvent:Ct,automaticGroup:st,focusVirusLineItem:ke,setMenuTagShow:H,responsefunc:nt,mode:et,setCheckItems:xe,setLeftMenuTabIndex:Me,updatePage:Mt,swcItem:Dt,axon_check:$t,swcnameMesh:Bt,vesselRef:ve,setMode:bt,vesselStr:Gt,lableStr:xn,swcRef:pe,setShowSettingModal:Rn,showSettingModal:gn,fbxTreeDatas:a,composer:WB,echartValue:Mr,setEchartValue:_n,setSectionsInfo:Or,sectionsInfo:cr,sectionsInfoRef:Bn,gray_value:i,setLuguchecked:Xn,Luguchecked:dn,setGridShow:Ge,PointShow:In,nodeStr:Fn}):null,C.createElement(E8e,{t:h,home:d,controls:y,setUpdatePage:It,setShowSettingModal:Rn,auxRef:ye,activetabIndex:q,index:!1,setFormshow:Dn,Selectoptions:qt}),s.length==0?C.createElement(Ya.Group,{value:et,onChange:Sn,style:{position:"absolute",right:0,background:"#fff",padding:10,borderLeft:"1px solid rgb(225, 218, 218)"}},C.createElement(Ya,{style:{width:131},value:0},h("5000.5026")||"极简模式"),C.createElement(Ya,{style:{width:131},value:1},h("5000.5012")||"普通模式"),C.createElement(Ya,{style:{width:131},value:2},h("5000.5013")||"病毒标记模式")):null))};const{Content:Szt}=UO;var _0=new DX({antialias:!0,logarithmicDepthBuffer:!0});const GY=C.memo(({currentLevel:t,totalLevel:e,layerxyz:n,is3DViewer:r,setcurrentLevel:i,is2DViewer:a})=>{const o=C.useRef(new l7),s=C.useRef(null),c=C.useRef(0),u=C.useRef(0),d=C.useRef(null),[f,h]=C.useState(!1),[p,v]=C.useState(0);C.useEffect(()=>{var k;o.current=new l7,camera.current=new Uu(45,235/163,.01,1e4),camera.current.position.set(20,0,0),camera.current.up.set(0,-1,0),camera.current.lookAt(new Ie(0,0,0)),o.current.add(camera.current);let N=new Ow(16777215,100,0);N.position.set(8,-1,0),o.current.add(N),_0.render(o.current,camera.current),o.current.background=new li("#fff"),(k=s.current)==null||k.appendChild(_0.domElement),_0.setSize(235,163),c.current=_0.domElement.clientWidth-1,u.current=_0.domElement.clientHeight-1,window.addEventListener("resize",y),g()},[]);const y=()=>{_0.setSize(235,163),camera.current.aspect=235/163,camera.current.updateProjectionMatrix(),_0.render(o.current,camera.current)},g=()=>{requestAnimationFrame(g),camera.current.updateMatrixWorld(),_0.render(o.current,camera.current)},[m,b]=C.useState(t),x=N=>{b(N)},S=N=>{i(N)};C.useEffect(()=>{b(t)},[t]);const w=N=>{N.preventDefault(),h(!0)},_=N=>{N.preventDefault(),console.log(N.clientX),f&&((N.clientX-50<130||N.clientX-51>45)&&(v(N.clientX-50),d.current.style.left=N.clientX-50+"px"),N.clientX-50<=45&&(v(45),d.current.style.left="45px"),N.clientX-50>=130&&(v(180),d.current.style.left="130px"))},A=N=>{const V=(Math.min(Math.max(N,45),130)-45)/(130-45)*(45-1)+1;return Math.round(V)},P=()=>{h(!1),i(A(p))},R=N=>{const V=(Math.min(Math.max(N,1),45)-1)/(45-1)*(130-45)+45;return Math.round(V)};return C.createElement("div",null,C.createElement("div",{id:"img",style:{display:a?"block":"none"},onMouseMove:_,onMouseUp:P},C.createElement("img",{id:"x",src:"./cor.png"}),C.createElement("div",{id:"draggable-line",style:{left:`${R(t)}px`},ref:d,onMouseDown:w})),C.createElement(UO,{className:"content",style:{display:r?"block":"none"}},C.createElement(Szt,{className:"Box3D"},C.createElement(M6e,{percentage:m/e,layerxyz:n,scene:o})),C.createElement("div",{style:{position:"absolute",zIndex:"10",top:"20px",left:"70px",border:"1px solid"},ref:s},C.createElement(Up,{max:e,min:1,value:m,onAfterChange:S,onChange:x}))))});const wzt=()=>{const[t,e]=C.useState("Coronal sections"),[n,r]=C.useState("z"),[i,a]=C.useState("nucleusColour"),[o,s]=C.useState(xf.Coronal.count),[c,u]=C.useState(Math.floor(xf.Coronal.count/2)),[d,f]=C.useState([0,0]),[h,p]=C.useState(!1),[v,y]=C.useState(!0),[g,m]=C.useState(!0),[b,x]=C.useState(""),[S,w]=C.useState("");C.useEffect(()=>{s(_(t)),u(Math.floor(_(t)/2))},[t]),C.useEffect(()=>{l.setDate(x),l.setname(w)},[]);const _=R=>R==="Coronal sections"?(r("z"),xf.Coronal.count):R==="Sagittal sections"?(r("x"),xf.Sagittal.count):R==="Horizontal sections"?(r("y"),xf.Horizontal.count):0,A=({key:R})=>{e(R)},P=R=>{a(R.target.value)};return C.createElement("div",null,C.createElement(GY,{totalLevel:o,currentLevel:c,setcurrentLevel:u,is3DViewer:g,layerxyz:n,is2DViewer:!1}),C.createElement(EX,{data_path:"",layer:t,CurrentLevel:c,isListVisible:h,setListVisible:p,isGridViewer:v,setGridViewer:y,is3DViewer:g,set3DViewer:m,ZifData:xf,fbxname:b,Z:l,threeview:"/3Dtask"}),C.createElement(aj,{ZifData:xf,orgX:0,orgY:0}),C.createElement("div",{id:"nav_left"},C.createElement(qb,{menu:{items:ewe,onClick:A}},C.createElement(Ba,null,C.createElement(tb,null,t,C.createElement(F5,{rev:void 0})))),C.createElement("div",{id:"nav_menu"},C.createElement(Ya.Group,{value:i,onChange:P},C.createElement(Ya.Button,{value:"nucleusColour"},"ARA ontology"),C.createElement(Ya.Button,{value:"nucleusColour_swanson"},"Brain maps 4.0")),C.createElement(CX,{data_path:"",json:i,layerxyz:n,fbxname:b,setfbxname:x,CurrentLevel:c,setCurrentLevel:u,Z:l}))),C.createElement("div",{id:"nav_bottom"},C.createElement(wX,{mouse:d,hovername:S}),C.createElement(SX,{data_path:"",CurrentLevel:c,threeview:"/3Dtask",TotalLevel:o,setCurrentLevel:u,fbxname:b,Z:l})),C.createElement("div",{id:"nav_right"},C.createElement(_X,{data_path:"",layerxyz:n,CurrentLevel:c,setCurrentLevel:u,TotalLevel:o,isListVisible:h,setListVisible:p})))};const Ezt=()=>{const[t,e]=C.useState("Coronal sections"),[n,r]=C.useState("z"),[i,a]=C.useState("nucleusColour"),[o,s]=C.useState(xf.Coronal.count),[c,u]=C.useState(Math.floor(xf.Coronal.count/2)),[d,f]=C.useState([0,0]),[h,p]=C.useState(!1),[v,y]=C.useState(!0),[g,m]=C.useState(!0),[b,x]=C.useState(""),[S,w]=C.useState("");C.useEffect(()=>{s(_(t)),u(Math.floor(_(t)/2))},[t]),C.useEffect(()=>{l.setDate(x),l.setname(w)},[]);const _=R=>R==="Coronal sections"?(r("z"),xf.Coronal.count):R==="Sagittal sections"?(r("x"),xf.Sagittal.count):R==="Horizontal sections"?(r("y"),xf.Horizontal.count):0,A=({key:R})=>{e(R)},P=R=>{a(R.target.value)};return C.createElement("div",null,C.createElement(GY,{totalLevel:o,currentLevel:c,setcurrentLevel:u,is3DViewer:g,layer:t}),C.createElement(EX,{layer:t,CurrentLevel:c,isListVisible:h,setListVisible:p,isGridViewer:v,setGridViewer:y,is3DViewer:g,set3DViewer:m,ZifData:xf,fbxname:[b],Z:l}),C.createElement(aj,{isGridViewer:v,setMouse:f,ZifData:xf}),C.createElement("div",{id:"nav_left"},C.createElement(qb,{menu:{items:ewe,onClick:A}},C.createElement(Ba,null,C.createElement(tb,null,t,C.createElement(F5,{rev:void 0})))),C.createElement("div",{id:"nav_menu"},C.createElement(Ya.Group,{value:i,onChange:P},C.createElement(Ya.Button,{value:"nucleusColour"},"nucleusColour"),C.createElement(Ya.Button,{value:"nucleusColour_swanson"},"nucleusColour_swanson")),C.createElement(CX,{json:i,layerxyz:n,fbxname:b,setfbxname:x,CurrentLevel:c,setCurrentLevel:u,Z:l}))),C.createElement("div",{id:"nav_bottom"},C.createElement(wX,{mouse:d,hovername:S}),C.createElement(SX,{CurrentLevel:c,TotalLevel:o,setCurrentLevel:u,Z:l})),C.createElement("div",{id:"nav_right"},C.createElement(_X,{layer:t,CurrentLevel:c,setCurrentLevel:u,TotalLevel:o,isListVisible:h,setListVisible:p})))};/**::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
5077
5077
|
@license Zoomify 图像查看器,版本位于下面第 25 行。版权所有 Zoomify, Inc.,1999-2016。版权所有。您可以
|
|
5078
5078
|
在私人和公共网站上出于个人和商业目的使用此文件,无论是否经过修改,只要此
|
|
5079
5079
|
通知已包含在内。未经事先许可,不得通过其他方式重新分发。适用附加条款。对于完整的
|