PageSourceSearch

https://orthomentors.ai/_next/static/chunks/2832.0b2d24bbe76e5fab.js

js orthomentors.ai collected 2026-10-05 14:28:51 UTC 10,562 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2832],{42832:(e,r,s)=>{s.r(r),s.d(r,{VideoGeneratorModal:()=>v});var a=s(39232),l=s(88140),t=s(91923),d=s.n(t),n=s(17015),i=s(6929),o=s(65982),c=s(50901),u=s(96308),x=s(97953),m=s(55479),b=s(67724),g=s(50304);let h=[{value:"nova",label:"Nova (female, warm)"},{value:"alloy",label:"Alloy (neutral)"},{value:"echo",label:"Echo (male, calm)"},{value:"fable",label:"Fable (narrative)"},{value:"onyx",label:"Onyx (male, deep)"},{value:"shimmer",label:"Shimmer (female, bright)"}],p={idle:"Ready",scripting:"Writing the script…",scene:"Generating footage & narration…",rendering:"Stitching the video…",uploading:"Uploading…",done:"Done",error:"Failed"},f={narration:"writing narration",footage:"generating AI footage (this takes a few minutes)",slides:"building slide visuals"};function v({open:e,onClose:r,sessionId:s=null,source:t="prompt"}){let[f,v]=(0,l.useState)(""),[y,N]=(0,l.useState)("nova"),[k,w]=(0,l.useState)("standard"),[_,C]=(0,l.useState)("auto"),[A,S]=(0,l.useState)("idle"),[V,q]=(0,l.useState)(null),[E,G]=(0,l.useState)(null),[z,F]=(0,l.useState)(null),O=(0,l.useRef)(null),T=(0,l.useRef)(!1),$=(0,l.useCallback)(()=>{T.current=!0,O.current&&(clearTimeout(O.current),O.current=null)},[]),M=(0,l.useCallback)(()=>{$(),S("idle"),q(null),G(null),F(null)},[$]);(0,l.useEffect)(()=>{e||M()},[e,M]),(0,l.useEffect)(()=>()=>$(),[$]);let R=()=>{M(),v(""),r()},I=(0,l.useCallback)(async e=>{if(!T.current){try{let r=await fetch(`/student/ai-classroom/api/video/job/${e}`);if(!r.ok)throw Error(`Polling failed (${r.status})`);let s=await r.json();if("ready"===s.status){$(),F({id:s.id,video_url:s.video_url,thumbnail_url:s.thumbnail_url,duration_sec:s.duration_sec??0,scene_count:s.scene_count??0,credits_charged:s.credits_charged??0}),S("done");return}if("failed"===s.status){$(),G(s.error||"Generation failed"),S("error");return}let a=s.progress;a?.stage&&(S(a.stage),q(a))}catch{}T.current||(O.current=setTimeout(()=>I(e),2e3))}},[$]),P=async()=>{let e=f.trim();if(e&&"scripting"!==A&&"scene"!==A&&"rendering"!==A&&"uploading"!==A){M(),T.current=!1,S("scripting"),G(null);try{let r=await fetch("/student/ai-classroom/api/video/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e,voice:y,mode:k,footage:_,source:s?t:"prompt",...s&&"material"===t?{session_id:s}:{}})});if(!r.ok){let e=await r.json().catch(()=>({detail:"Failed to start generation"}));throw Error(e.detail||`Request failed (${r.status})`)}let{id:a}=await r.json();I(a)}catch(e){G(e instanceof Error?e.message:"Something went wrong"),S("error")}}},W="scripting"===A||"scene"===A||"rendering"===A||"uploading"===A;return e?(0,a.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-0",onClick:e=>e.target===e.currentTarget&&R(),children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-surface-inverse/30 backdrop-blur-md",onClick:R}),(0,a.jsxs)("div",{className:(0,n.cn)("relative z-10 bg-card w-full max-w-lg rounded-2xl shadow-2xl border border-border/70 dark:border-border overflow-hidden","animate-in zoom-in-95 duration-200"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border bg-muted/60 dark:bg-card/60 backdrop-blur-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-xl bg-primary/10 dark:bg-primary/60 border border-primary-line dark:border-primary flex items-center justify-center",children:(0,a.jsx)(i.A,{className:"h-4 w-4 text-primary"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-bold text-foreground",children:"Video Generator"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Narrated study videos from a prompt"})]})]}),(0,a.jsx)("button",{onClick:R,className:"p-1.5 rounded-lg hover:bg-muted/60 dark:hover:bg-surface-inverse text-muted-foreground transition-colors cursor-pointer","aria-label":"Close",children:(0,a.jsx)(o.A,{className:"h-4 w-4"})})]}),(0,a.jsxs)("div",{className:"px-5 py-5 space-y-4",children:["done"!==A&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-semibold text-muted-foreground dark:text-foreground",children:"What should the video cover?"}),(0,a.jsx)("textarea",{value:f,onChange:e=>v(e.target.value),disabled:W,rows:3,placeholder:"e.g. Fracture healing: inflammation, repair, remodelling phases with key exam points",className:"w-full rounded-xl border border-border bg-card px-3.5 py-2.5 text-sm text-foreground placeholder:text-muted-foreground dark:placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/30 disabled:opacity-60 resize-none"})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-semibold text-muted-foreground dark:text-foreground",children:"Narration voice"}),(0,a.jsxs)(g.l6,{value:y,onValueChange:N,disabled:W,children:[(0,a.jsx)(g.bq,{className:"w-full rounded-xl border-border",children:(0,a.jsx)(g.yv,{})}),(0,a.jsx)(g.gC,{children:h.map(e=>(0,a.jsx)(g.eb,{value:e.value,children:e.label},e.value))})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-semibold text-muted-foreground dark:text-foreground",children:"Video length"}),(0,a.jsxs)(g.l6,{value:k,onValueChange:e=>w(e),disabled:W,children:[(0,a.jsx)(g.bq,{className:"w-full rounded-xl border-border",children:(0,a.jsx)(g.yv,{})}),(0,a.jsxs)(g.gC,{children:[(0,a.jsx)(g.eb,{value:"standard",children:"Standard — 4–6 AI scenes"}
1),(0,a.jsx)(g.eb,{value:"quick",children:"Quick — 2–3 scenes (faster, fewer credits)"})]})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-semibold text-muted-foreground dark:text-foreground",children:"Visual style"}),(0,a.jsxs)(g.l6,{value:_,onValueChange:e=>C(e),disabled:W,children:[(0,a.jsx)(g.bq,{className:"w-full rounded-xl border-border",children:(0,a.jsx)(g.yv,{})}),(0,a.jsxs)(g.gC,{children:[(0,a.jsx)(g.eb,{value:"auto",children:"Auto — slides if Veo quota is unavailable"}),(0,a.jsx)(g.eb,{value:"slides",children:"Slides only — fast, no Google quota needed"}),(0,a.jsx)(g.eb,{value:"veo",children:"Veo AI footage — requires Google billing"})]})]})]}),E&&(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-xl bg-error/10 dark:bg-error/40 border border-error/20 dark:border-error/60 px-3 py-2.5 text-xs text-error",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 shrink-0 mt-0.5"}),(0,a.jsx)("span",{children:E})]}),W&&(0,a.jsx)(j,{stage:A,progress:V}),W&&(0,a.jsxs)("p",{className:"text-[11px] text-muted-foreground text-center",children:["You can close this — we keep generating in the background and the video will appear in"," ",(0,a.jsx)(d(),{href:"/student/ai-classroom/videos",className:"underline",children:"My Videos"}),"."]}),(0,a.jsxs)("button",{onClick:P,disabled:!f.trim()||W,className:(0,n.cn)("w-full inline-flex items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-colors","bg-primary text-primary-foreground hover:bg-primary disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"),children:[W?(0,a.jsx)(u.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(x.A,{className:"h-4 w-4"}),W?p[A]:"Generate video"]})]}),"done"===A&&z&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-success",children:[(0,a.jsx)(m.A,{className:"h-4 w-4"}),"Video ready"]}),(0,a.jsx)("div",{className:"rounded-xl overflow-hidden border border-border bg-scrim",children:(0,a.jsx)("video",{src:z.video_url,poster:z.thumbnail_url??void 0,controls:!0,className:"w-full aspect-video object-contain"})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-muted-foreground",children:[(0,a.jsxs)("span",{className:"rounded-full bg-muted dark:bg-card px-2.5 py-1",children:[z.scene_count," scenes"]}),(0,a.jsxs)("span",{className:"rounded-full bg-muted dark:bg-card px-2.5 py-1",children:[Math.round(z.duration_sec),"s"]}),(0,a.jsxs)("span",{className:"rounded-full bg-muted dark:bg-card px-2.5 py-1",children:[z.credits_charged," credits used"]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("a",{href:z.video_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-xl border border-border px-3 py-2 text-xs font-semibold text-foreground hover:bg-muted dark:hover:bg-surface-inverse cursor-pointer",children:[(0,a.jsx)(b.A,{className:"h-3.5 w-3.5"})," Open"]}),(0,a.jsxs)(d(),{href:"/student/ai-classroom/videos",onClick:()=>R(),className:"inline-flex items-center gap-1.5 rounded-xl border border-border px-3 py-2 text-xs font-semibold text-foreground hover:bg-muted dark:hover:bg-surface-inverse cursor-pointer",children:[(0,a.jsx)(i.A,{className:"h-3.5 w-3.5"})," View all"]}),(0,a.jsxs)("button",{onClick:()=>{M(),v("")},className:"inline-flex items-center gap-1.5 rounded-xl bg-primary text-primary-foreground px-3 py-2 text-xs font-semibold hover:bg-primary cursor-pointer",children:[(0,a.jsx)(x.A,{className:"h-3.5 w-3.5"})," Create another"]})]})]})]})]})]}):null}function j({stage:e,progress:r}){let s=["scripting","scene","rendering","uploading"],l=s.indexOf(e),t=r?.sub?f[r.sub]??r.sub:null;return(0,a.jsxs)("div",{className:"rounded-xl border border-border bg-muted/60 dark:bg-card/40 px-3.5 py-3 space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs font-semibold text-foreground",children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5 animate-spin text-primary"}),p[e],"scene"===e&&r?.index&&r?.total&&(0,a.jsxs)("span",{className:"text-muted-foreground font-normal",children:["\xb7 ",r.index,"/",r.total,r?.title?`: ${r.title}`:"",t?` — ${t}`:""]})]}),(0,a.jsx)("div",{className:"flex gap-1.5",children:s.map((e,r)=>(0,a.jsx)("div",{className:(0,n.cn)("h-1.5 flex-1 rounded-full transition-colors",r<l?"bg-primary":r===l?"bg-primary animate-pulse":"bg-muted dark:bg-card")},e))})]})}},50901:(e,r,s)=>{s.d(r,{A:()=>a});let a=(0,s(6821).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},67724:(e,r,s)=>{s.d(r,{A:()=>a});let a=(0,s(6821).A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])}}]);

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.