1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[606],{285:(e,t,a)=>{"use strict";a.d(t,{$:()=>l,r:()=>d});var r=a(5155),s=a(2115),i=a(9708),n=a(2085),o=a(9434);let d=(0,n.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),l=s.forwardRef((e,t)=>{let{className:a,variant:s,size:n,asChild:l=!1,...c}=e,m=l?i.DX:"button";return(0,r.jsx)(m,{className:(0,o.cn)(d({variant:s,size:n,className:a})),ref:t,...c})});l.displayName="Button"},1059:(e,t,a)=>{Promise.resolve().then(a.bind(a,7045))},2346:(e,t,a)=>{"use strict";a.d(t,{Separator:()=>o});var r=a(5155),s=a(2115),i=a(7489),n=a(9434);let o=s.forwardRef((e,t)=>{let{className:a,orientation:s="horizontal",decorative:o=!0,...d}=e;return(0,r.jsx)(i.b,{ref:t,decorative:o,orientation:s,className:(0,n.cn)("shrink-0 bg-border","horizontal"===s?"h-[1px] w-full":"h-full w-[1px]",a),...d})});o.displayName=i.b.displayName},5057:(e,t,a)=>{"use strict";a.d(t,{J:()=>l});var r=a(5155),s=a(2115),i=a(968),n=a(2085),o=a(9434);let d=(0,n.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),l=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(i.b,{ref:t,className:(0,o.cn)(d(),a),...s})});l.displayName=i.b.displayName},5365:(e,t,a)=>{"use strict";a.d(t,{Fc:()=>d,TN:()=>c,XL:()=>l});var r=a(5155),s=a(2115),i=a(2085),n=a(9434);let o=(0,i.F)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),d=s.forwardRef((e,t)=>{let{className:a,variant:s,...i}=e;return(0,r.jsx)("div",{ref:t,role:"alert",className:(0,n.cn)(o({variant:s}),a),...i})});d.displayName="Alert";let l=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("h5",{ref:t,className:(0,n.cn)("mb-1 font-medium leading-none tracking-tight",a),...s})});l.displayName="AlertTitle";let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("text-sm [&_p]:leading-relaxed",a),...s})});c.displayName="AlertDescription"},6695:(e,t,a)=>{"use strict";a.d(t,{BT:()=>l,Wu:()=>c,ZB:()=>d,Zp:()=>n,aR:()=>o});var r=a(5155),s=a(2115),i=a(9434);let n=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",a),...s})});n.displayName="Card";let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("flex flex-col space-y-1.5 p-6",a),...s})});o.displayName="CardHeader";let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("h3",{ref:t,className:(0,i.cn)("text-2xl font-semibold leading-none tracking-tight",a),...s})});d.displayName="CardTitle";let l=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("p",{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",a),...s})});l.displayName="CardDescription";let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("p-6 pt-0",a),...s})});c.displayName="CardContent",s.forwardRef((e,t)=>
1{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,i.cn)("flex items-center p-6 pt-0",a),...s})}).displayName="CardFooter"},7045:(e,t,a)=>{"use strict";a.d(t,{default:()=>T});var r=a(5155),s=a(9137),i=a.n(s),n=a(2115),o=a(5695),d=a(6766),l=a(285),c=a(6695),m=a(5057),u=a(4073),x=a(9434);let f=n.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsxs)(u.bL,{ref:t,className:(0,x.cn)("relative flex w-full touch-none select-none items-center",a),...s,children:[(0,r.jsx)(u.CC,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:(0,r.jsx)(u.Q6,{className:"absolute h-full bg-primary"})}),(0,r.jsx)(u.zi,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]})});f.displayName=u.bL.displayName;var g=a(5365),p=a(172),h=a(594),b=a(7832),v=a(9255),j=a(4477);let N=(0,j.createServerReference)("40a784e0e11a145ce0384df3cee54913baaa85e07a",j.callServer,void 0,j.findSourceMapURL,"generateOrbitVisualization");var y=a(7481),w=a(5028),S=a(2346);let k=(0,w.default)(()=>Promise.all([a.e(748),a.e(416),a.e(156)]).then(a.bind(a,5156)),{loadableGenerated:{webpack:()=>[5156]},ssr:!1,loading:()=>(0,r.jsxs)("div",{className:"flex items-center justify-center h-full bg-muted rounded-md",children:[(0,r.jsx)(p.A,{className:"h-8 w-8 animate-spin"})," ",(0,r.jsx)("p",{className:"ml-2",children:"Loading 3D View..."})]})}),A={altitudeKm:550,inclinationDegrees:0,eccentricity:.001,speed:1},z=()=>(0,r.jsxs)("div",{className:"jsx-a672369ce54eb841 relative flex items-center justify-center w-full h-64 overflow-hidden rounded-md bg-muted/50 border border-dashed",children:[(0,r.jsx)("div",{className:"jsx-a672369ce54eb841 absolute w-32 h-32 rounded-full bg-primary/20"}),(0,r.jsx)("div",{className:"jsx-a672369ce54eb841 absolute w-28 h-28 rounded-full bg-primary/40 animate-pulse"}),(0,r.jsx)("div",{className:"jsx-a672369ce54eb841 absolute w-48 h-20 border-2 border-dashed rounded-full border-foreground
1/30 animate-spin-slow"}),(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-a672369ce54eb841 absolute w-8 h-8 text-primary animate-orbit",children:[(0,r.jsx)("path",{d:"m7.5 7.5 9 9",className:"jsx-a672369ce54eb841"}),(0,r.jsx)("path",{d:"m7.5 16.5 9-9",className:"jsx-a672369ce54eb841"}),(0,r.jsx)("path",{d:"M12 2a10 10 0 1 1-5.5 17.5",className:"jsx-a672369ce54eb841"}),(0,r.jsx)("path",{d:"M12 2a10 10 0 1 0 5.5 17.5",className:"jsx-a672369ce54eb841"})]}),(0,r.jsx)(i(),{id:"a672369ce54eb841",children:"@-webkit-keyframes spin-slow{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes spin-slow{from{-moz-transform:rotate(0deg);transform:rotate(0deg)}to{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes spin-slow{from{-o-transform:rotate(0deg);transform:rotate(0deg)}to{-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin-slow{from{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}.animate-spin-slow.jsx-a672369ce54eb841{-webkit-animation:spin-slow 20s linear infinite;-moz-animation:spin-slow 20s linear infinite;-o-animation:spin-slow 20s linear infinite;animation:spin-slow 20s linear infinite}@-webkit-keyframes orbit{0%{-webkit-transform:rotate(0deg)translatex(90px)rotate(0deg);transform:rotate(0deg)translatex(90px)rotate(0deg)}100%{-webkit-transform:rotate(360deg)translatex(90px)rotate(-360deg);transform:rotate(360deg)translatex(90px)rotate(-360deg)}}@-moz-keyframes orbit{0%{-moz-transform:rotate(0deg)translatex(90px)rotate(0deg);transform:rotate(0deg)translatex(90px)rotate(0deg)}100%{-moz-transform:rotate(360deg)translatex(90px)rotate(-360deg);transform:rotate(360deg)translatex(90px)rotate(-360deg)}}@-o-keyframes orbit{0%{-o-transform:rotate(0deg)translatex(90px)rotate(0deg);transform:rotate(0deg)translatex(90px)rotate(0deg)}100%{-o-transform:rotate(360deg)translatex(90px)rotate(-360deg);transform:rotate(360deg)translatex(90px)rotate(-360deg)}}@keyframes orbit{0%{-webkit-transform:rotate(0deg)translatex(90px)rotate(0deg);-moz-transform:rotate(0deg)translatex(90px)rotate(0deg);-o-transform:rotate(0deg)translatex(90px)rotate(0deg);transform:rotate(0deg)translatex(90px)rotate(0deg)}100%{-webkit-transform:rotate(360deg)translatex(90px)rotate(-360deg);-moz-transform:rotate(360deg)translatex(90px)rotate(-360deg);-o-transform:rotate(360deg)translatex(90px)rotate(-360deg);transform:rotate(360deg)translatex(90px)rotate(-360deg)}}.animate-orbit.jsx-a672369ce54eb841{-webkit-animation:orbit 15s linear infinite;-moz-animation:orbit 15s linear infinite;-o-animation:orbit 15s linear infinite;animation:orbit 15s linear infinite}"}),(0,r.jsxs)("div",{className:"jsx-a672369ce54eb841 absolute bottom-4 text-center text-muted-foreground",children:[(0,r.jsx)("p",{className:"jsx-a672369ce54eb841",children:'Configure parameters and click "Generate Visualization".'}),(0,r.jsx)("p",{className:"jsx-a672369ce54eb841 text-xs",children:"An AI-generated image will appear here."})]})]});function T(){let e=(0,o.useSearchParams)(),[t,a]=(0,n.useState)(A.altitudeKm),[s,i]=(0,n.useState)(A.inclinationDegrees),[u,x]=(0,n.useState)(A.eccentricity),[j,w]=(0,n.useState)(A.speed),[T,C]=(0,n.useState)(void 0),[R,D]=(0,n.useState)(void 0),[F,O]=(0,n.useState)("1U"),[E,_]=(0,n.use
1State)(!1),[I,V]=(0,n.useState)(null),[M,L]=(0,n.useState)(null),{toast:B}=(0,y.dj)();(0,n.useEffect)(()=>{let t=e.get("design");if(t)try{let e=JSON.parse(decodeURIComponent(t)),a=e.components.reduce((e,t)=>e+t.mass,0);C(a),O(e.size);let r=e.components.map(e=>e.name).slice(0,3),s="";r.length>0&&(s="featuring ".concat(r.join(", ")),e.components.length>3&&(s+=", and other components")),D(s||void 0),B({title:"CubeSat Design Applied",description:"".concat(e.size," design loaded with ").concat(a.toFixed(2)," kg mass ").concat(s?" "+s:"",".")})}catch(e){console.error("Failed to parse design from query params",e),B({title:"Failed to load design",description:"There was an error pre-filling design specifications.",variant:"destructive"})}},[e,B]);let P=async()=>{_(!0),V(null),L(null);let e=R||"",a={altitudeKm:t,inclinationDegrees:s,eccentricity:u,cubeSatFeatures:(e=F?"".concat(F," CubeSat ").concat(e):"A CubeSat ".concat(e)).trim()};void 0!==T&&(a.cubeSatMassKg=T);try{let e=await N(a);L(e),B({title:"Orbit Visualization Generated",description:"AI has successfully generated the orbit image."})}catch(e){console.error("Error generating orbit visualization:",e),V(e instanceof Error?e.message:"An unknown error occurred during visualization."),B({title:"Generation Failed",description:"Could not generate orbit visualization.",variant:"destructive"})}finally{_(!1)}};return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsxs)(c.Zp,{className:"shadow-lg w-full",children:[(0,r.jsxs)(c.aR,{children:[(0,r.jsx)(c.ZB,{className:"font-headline text-2xl",children:"Orbit Simulator"}),(0,r.jsx)(c.BT,{children:"Define orbital parameters to visualize your CubeSat, then generate an AI image of it in orbit."})]}),(0,r.jsxs)(c.Wu,{className:"space-y-6",children:[(void 0!==T||R)&&(0,r.jsxs)(g.Fc,{variant:"default",className:"bg-primary/10 border-primary/30",children:[(0,r.jsx)(h.A,{className:"h-4 w-4 text-primary"}),(0,r.jsx)(g.XL,{children:"CubeSat Design Applied"}),(0,r.jsxs)(g.TN,{children:[F&&"Size: ".concat(F,". "),void 0!==T&&"Mass: ".concat(T.toFixed(2)," kg. "),R&&"Features: ".concat(R,". "),"These details will be used in the visualization prompt."]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 items-start",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(m.J,{htmlFor:"altitude",children:["Altitude: ",t," km"]}),(0,r.jsx)(f,{id:"altitude",min:200,max:2e3,step:10,value:[t],onValueChange:e=>a(e[0]),disabled:E,className:"my-2"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"(Range: 200 - 2000 km)"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(m.J,{htmlFor:"inclination",children:["Inclination: ",s.toFixed(1),"\xb0"]}),(0,r.jsx)(f,{id:"inclination",min:0,max:180,step:.1,value:[s],onValueChange:e=>i(e[0]),disabled:E,className:"my-2"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"(Range: 0 - 180\xb0)"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(m.J,{htmlFor:"eccentricity",children:["Eccentricity: ",u.toFixed(3)]}),(0,r.jsx)(f,{id:"eccentricity",min:0,max:.1,step:.001,value:[u],onValueChange:e=>x(e[0]),disabled:E,className:"my-2"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"(Range: 0 - 0.1)"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(m.J,{htmlFor:"speed",children:["Orbit Speed: ",j.toFixed(1),"x"]}),(0,r.jsx)(f,{id:"speed",min:.1,max:5,step:.1,value:[j],onValueChange:e=>w(e[0]),disabled:E,className:"my-2"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"(3D view only)"})]})]}),(0,r.jsx)(S.Separator,{className:"my-6"}),(0,r.jsx)("div",{className:"h-[600px] w-full bg-background rounded-lg",children:(0,r.jsx)(k,{altitudeKm:t,inclinationDegrees:s,cubeSatSize:F,speed:j})}),(0,r.jsx)(S.Separator,{className:"my-6"}),(0,r.jsxs)("div",{className:"flex gap-4 pt-4",children:[(0,r.jsxs)(l.$,{onClick:P,disabled:E,size:"lg",className:"flex-grow",children:[E?(0,r.jsx)(p.A,{className:"mr-2 h-4 w-4 animate-spin"}):(0,r.jsx)(b.A,{className:"mr-2 h-4 w-4"}),"Generate AI Visualization"]}),(0,r.jsxs)(l.$,{variant:"outline",onClick:()=>{a(A.altitudeKm),i(A.inclinationDegrees),x(A.eccentricity),w(A.speed),L(null),V(null),B({title:"Parameters Reset",description:"Orbital parameters reset to default values."})},disabled:E,children:[(0,r.jsx)(v.A,{className:"mr-2 h-4 w-4"})," Reset"]})]})]})]}),(0,r.jsxs)(c.Zp,{className:"shadow-lg w-full",children:[(0,r.jsxs)(c.aR,{children:[(0,r.jsx)(c.ZB,{className:"font-headline text-2xl",children:"AI Orbit Visualization"}),(0,r.jsx)(c.BT,{children:"An AI-generated image of the CubeSat in the specified orbit."})]}),(0,r.jsxs)(c.Wu,{children:[E&&(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center h-64 bg-muted rounded-md",children:[(0,r.jsx)(p.A,{className:"h-12 w-12 animate-spin text-primary"}),(0,r.jsx)("p",{className:"mt-4 text-muted-foreground",children:"Generating orbit visualization..."})]}),I&&(0,r.jsxs)(g.Fc,{variant:"destructive",children:[(0,r.jsx)(g.XL,{children:"Error"}),(0,r.jsx)(g.TN,{children:I})]}),!E&&!I&&M&&(0,r.jsxs)("div",{className:"grid md:grid-cols-2 gap-6 items-center",children:[(0,r.jsx)(d.default,{src:M.imageUrl,alt:M.narrativeDescription||"Orbit Visualization",width:800,height:600,className:"rounded-md border aspect-video object-cover w-full",unoptimized:M.imageUrl.startsWith("data:")}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h3",{className:"font-semibold text-lg",children:"Narrative Description"}),(0,r.jsx)("div",{className:"text-base text-muted-foreground bg-muted p-4 rounded-md",children:(0,r.jsx)("p",{children:M.narrativeDescription})}),(0,r.jsx)("h3",{className:"font-semibold text-lg",children:"Detailed Parameters"}),(0,r.jsxs)("div",{className:"text-sm text-muted-foreground bg-muted p-4 rounded-md grid grid-cols-2 gap-x-4 gap-y-2",children:[(0,r.jsxs)("p",{children:[(0,r.jsx)("strong",{children:"CubeSat:"})," ",M.description.sizeAndFeatures]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("strong",{children:"Mass:"})," ",M.description.mass]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("strong",{children:"Altitude:"})," ",M.description.altitude]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("strong",{children:"Inclination:"})," ",M.description.inclination]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("strong",{children:"Eccentricity:"})," ",M.description.eccentricity]})]})]})]}),!E&&!I&&!M&&(0,r.jsx)(z,{})]})]})]})}},7481:(e,t,a)=>{"use strict";a.d(t,{dj:()=>u});var r=a(2115);let s=0,i=new Map,n=e=>{if(i.has(e))return;let t=setTimeout(()=>{i.delete(e),c({type:"REMOVE_TOAST",toastId:e})},1e6);i.set(e,t)},o=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:a}=t;
1return a?n(a):e.toasts.forEach(e=>{n(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===a||void 0===a?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},d=[],l={toasts:[]};function c(e){l=o(l,e),d.forEach(e=>{e(l)})}function m(e){let{...t}=e,a=(s=(s+1)%Number.MAX_SAFE_INTEGER).toString(),r=()=>c({type:"DISMISS_TOAST",toastId:a});return c({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:e=>{e||r()}}}),{id:a,dismiss:r,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:a}})}}function u(){let[e,t]=r.useState(l);return r.useEffect(()=>(d.push(t),()=>{let e=d.indexOf(t);e>-1&&d.splice(e,1)}),[e]),{...e,toast:m,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}},9434:(e,t,a)=>{"use strict";a.d(t,{cn:()=>i});var r=a(2596),s=a(9688);function i(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}}},e=>{var t=t=>e(e.s=t);e.O(0,[803,63,984,441,684,358],()=>t(1059)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.