PageSourceSearch

https://vid.ai/_next/static/chunks/5754.17910e831a11b206.js

js vid.ai collected 2026-10-04 06:57:33 UTC 6,266 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5754],{75754:function(e,t,n){n.r(t),n.d(t,{ClipTimingDialog:function(){return g},default:function(){return p},formatSeconds:function(){return m}});var i=n(85893),a=n(67294);let l=(0,n(63759).Z)("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);var s=n(39970),r=n(21488),c=n(56286),o=n(98310),d=n(87242);let m=e=>{let t=Math.max(0,Math.round(10*(Number(e)||0)));return"".concat(Math.floor(t/600),":").concat(String(Math.floor(t%600/10)).padStart(2,"0"),".").concat(t%10)},u=e=>{let t=Number(String(e).trim().replace(",","."));return Number.isFinite(t)?t:null},h=e=>Math.round(10*e)/10,x=(e,t)=>t?Math.min(t.max,Math.max(t.min,e)):e,g=e=>{var t,n,g,p,v;let{open:f,onOpenChange:b,clipNumber:j,clip:N,startRange:y,lengthRange:w,trimRange:S,getPlayheadSeconds:k,onApply:M}=e,C=(0,a.useRef)(null),[T,F]=(0,a.useState)(""),[E,_]=(0,a.useState)(""),[I,z]=(0,a.useState)(!1),[B,O]=(0,a.useState)(0),[U,$]=(0,a.useState)(null),q=Number(null==N?void 0:N.videoStart)||0,A=Number(null==N?void 0:N.videoEnd)||0,L=(null==w?void 0:w.edge)==="start",Z=(null==N?void 0:null===(n=N.clips)||void 0===n?void 0:null===(t=n[0])||void 0===t?void 0:t.videoUrl)||null,D=(null==N?void 0:null===(p=N.clips)||void 0===p?void 0:null===(g=p[0])||void 0===g?void 0:g.imageUrl)||null;(0,a.useEffect)(()=>{f&&(F(String(h(q))),_(String(h(A-q))),z(!1),O((null==S?void 0:S.current)||0),$(k?k():null))},[f,q,A]),(0,a.useEffect)(()=>{let e=C.current;if(f&&e&&Number.isFinite(B))try{e.currentTime=B}catch(e){}},[f,B]);let K=u(T),R=y&&null!==K&&(K<y.min-1e-4||K>y.max+1e-4)?"Between ".concat(m(y.min)," and ").concat(m(y.max),"."):y&&null===K?"Enter a time in seconds.":"",V=y&&null!==K&&!R?K:q,G=(0,a.useMemo)(()=>w&&!L?{min:w.min,max:h(w.max+(q-V))}:null,[w,L,q,V]),H=I&&!L?E:String(h(A-V)),J=u(H),P=G&&null!==J&&(J<G.min-1e-4||J>G.max+1e-4)?"Between ".concat(G.min," and ").concat(G.max," seconds."):G&&null===J?"Enter a length in seconds.":"",Q=(0,a.useMemo)(()=>{let e={};return y&&null!==K&&Math.abs(K-q)>=.05&&(e.start=x(K,y)),I&&G&&null!==J&&Math.abs(V+J-A)>=.05&&(e.length=x(J,G)),S&&Math.abs(B-(S.current||0))>=.01&&(e.trim=B),e},[y,K,q,I,G,J,V,A,S,B]),W=Object.keys(Q).length>0&&!R&&!P,X=y&&Number.isFinite(U)&&U>=y.min&&U<=y.max;return(0,i.jsx)(s.Vq,{open:f,onOpenChange:b,children:(0,i.jsxs)(s.cZ,{className:"max-h-[90dvh] overflow-y-auto sm:max-w-lg","data-clip-timing-dialog":!0,children:[(0,i.jsxs)(s.fK,{children:[(0,i.jsx)(s.$N,{children:"Clip ".concat(String(j).padStart(2,"0")," timing")}),(0,i.jsx)(s.Be,{children:"Captions, graphics and the narration stay where they are. The clips next to this one get shorter or longer to make room. On the timeline you can also drag the line between two clips."})]}),(0,i.jsx)("div",{className:"mx-auto w-full max-w-sm overflow-hidden rounded-lg border border-white/10 bg-black",children:Z?(0,i.jsx)("video",{ref:C,src:Z,muted:!0,playsInline:!0,preload:"metadata",controls:!0,onLoadedMetadata:e=>{try{e.currentTarget.currentTime=B||0}catch(e){}},className:"aspect-video w-full object-contain"}):D?(0,i.jsx)("img",{src:D,alt:"",className:"aspect-video w-full object-cover"}):(0,i.jsx)("div",{className:"aspect-video w-full"})}),(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.jsx)(o._,{htmlFor:"clip-timing-start",children:"Starts at (seconds)"}),X&&(0,i.jsxs)("button",{type:"button",onClick:()=>F(String(h(U))),className:"inline-flex min-h-8 items-center gap-1 rounded-md px-2 text-xs font-medium text-blue-300 hover:bg-white/[0.06] hover:text-blue-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 max-md:min-h-10",children:[(0,i.jsx)(l,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Use playhead (".concat(m(U),")")]})]}),(0,i.jsx)(c.I,{id:"clip-timing-start",inputMode:"decimal",value:T,onChange:e=>F(e.target.value),disabled:!y,"aria-invalid":!!R,className:"tabular-nums"}),(0,i.jsx)("p",{className:R?"text-xs text-red-400":"text-xs text-muted-foreground",children:R||(y?"Any time from ".concat(m(y.min)," to ").concat(m(y.max),". The clip before this one ends when it starts."):1===j?"The first clip starts with the video.":"The clip before this one can't move.")})]}),(0,i.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,i.jsx)(o._,{htmlFor:"clip-timing-length",children:"Length (seconds)"}),(0,i.jsx)(c.I,{id:"clip-timing-length",inputMode:"decimal",value:H,onChange:e=>{_(e.target.value),z(!0)},disabled:!w||L,"aria-invalid":!!P,className:"tabular-nums"}),(0,i.jsx)("p",{className:P?"text-xs text-red-400":"text-xs text-muted-foreground",children:P||(L?"It ends with the video at ".concat(m(A),", so move its start to change its length."):G?"From ".concat(G.min," to ").concat(G.max," seconds. The next clip starts when this one ends."):"The next clip can't move, so this length is fixed.")})]}),S&&(0,i.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,i.jsx)(o._,{htmlFor:"clip-timing-trim",children:"Footage starts at"}),(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("input",{id:"clip-timing-trim",type:"range",min:0,max:null!==(v=S.max)&&void 0!==v?v:Math.max(30,B),step:.1,value:B,onChange:e=>O(Number(e.target.value)),className:"h-2 min-w-0 flex-1 cursor-pointer accent-blue-500"}),(0,i.jsx)("span",{className:"w-14 shrink-0 text-right text-sm tabular-nums text-zinc-200",children:"".concat(B.toFixed(1)," s")})]}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:S.sourceSeconds?"Skip the start of the footage. The clip is ".concat(h(S.sourceSeconds)," s long; if what's left is shorter than this spot, it plays slower or repeats."):"Skip the start of the footage."})]})]}),(0,i.jsxs)(s.cN,{children:[(0,i.jsx)(r.z,{variant:"outline",onClick:()=>b(!1),children:"Cancel"}),(0,i.jsx)(r.z,{className:d.$$,disabled:!W,onClick:()=>M(Q),children:"Apply"})]})]})})};var p=g}}]);

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.