PageSourceSearch

https://aianimation.com/_next/static/chunks/3773.7bc85f01eaddff77.js

js aianimation.com collected 2026-10-08 05:21:57 UTC 17,380 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3773],{43773:function(e,s,t){t.r(s),t.d(s,{default:function(){return A}});var a=t(57437),n=t(2265),r=t(7124),i=t(5897),l=t(63640),o=t(54516),d=t(64374),c=t(95485),u=t(65126),h=t(70919),m=t(74081),p=t(67170),v=t(46982),f=t(50859),E=t(29306),I=t(98805),j=t(42503),x=t(96026),N=t(541),w=t(17754),b=t(42393);function R(e){var s;let t=(0,E.jQ)(e);if(!t)return{title:"Bring your shots to life",detail:"Choose one shot or a batch. Review permissions and price before generation."};let a=t.units.filter(e=>e.providerConfirmation).length,n=t.units.filter(e=>"READY"===e.status&&"PENDING"===e.review).length,r=t.units.filter(e=>"FAILED"===e.status).length,i=new Set((null===(s=t.acceptedSegments)||void 0===s?void 0:s.map(e=>e.frameId))||[]).size;return a?{title:"Waiting for provider confirmation",detail:"".concat(a," request").concat(1===a?"":"s"," unconfirmed. Credits remain reserved; completed clips are available below.")}:(null==e?void 0:e.status)==="CANCELLED"?{title:"Video task stopped",detail:"Completed takes are saved. No new submissions will start."}:t.paused?{title:"Video task paused",detail:"Your shots and permissions are saved. Review the issue before continuing."}:n?{title:"".concat(n," clip").concat(1===n?"":"s"," ready to review"),detail:"Play a take, check its range, then use it in your film."}:r?{title:"".concat(r," clip").concat(1===r?"":"s"," need attention"),detail:"Keep successful clips. Review a new price for only the take you want to retry."}:i?{title:"".concat(i," shot").concat(1===i?"":"s"," added"),detail:"Accepted takes are saved. Open your edit to watch the result."}:"REFERENCE_REVIEW"===t.phase?{title:"Confirm reference permissions",detail:"Use saved permissions or confirm the remaining references together."}:"QUOTED"===t.phase?{title:"Ready when you are",detail:"This estimate covers the selected clips. Generation starts only after approval."}:"GENERATING"===t.phase?{title:"Your shots are becoming video",detail:"You can keep talking to ANI. Each result appears here as it arrives."}:{title:"Your motion plan",detail:"The saved storyboard supplies the direction. Adjust it here before continuing."}}var g=t(41538),k=t.n(g);let y=(0,n.lazy)(()=>Promise.all([t.e(7291),t.e(228)]).then(t.bind(t,97291))),C=[{label:"Shots",icon:r.Z},{label:"Review & generate",icon:i.Z},{label:"Takes",icon:l.Z}];function A(e){var s;let{board:t,workspaceId:g,projectId:A,userId:S,target:D,visible:T,onAttached:P,onWatch:F,onStatus:L}=e,[Z,z]=(0,n.useState)(null),[_,O]=(0,n.useState)([]),[M,G]=(0,n.useState)(!1),[U,Q]=(0,n.useState)(),[W,V]=(0,n.useState)(()=>
1(0,E.rT)(g,A,S,!0)),[Y,q]=(0,n.useState)(D.frameIds),[H,B]=(0,n.useState)(D.instruction),[X,J]=(0,n.useState)("seedance25"),[K,$]=(0,n.useState)(D.seedanceRenderStrategy),[ee,es]=(0,n.useState)("720p"),[et,ea]=(0,n.useState)(!1),[en,er]=(0,n.useState)(""),[ei,el]=(0,n.useState)(!1),[eo,ed]=(0,n.useState)(!1),ec=(0,n.useRef)(!1),eu=(0,n.useRef)(!0),eh=(0,n.useRef)(Z),em=(0,n.useRef)(null);eh.current=Z;let ep=(0,n.useRef)((0,f.Uz)()),ev=(0,n.useRef)(),ef=(0,E.jQ)(Z),eE=!!(Z&&["COMPLETED","FAILED","CANCELLED"].includes(Z.status)),eI=(null==Z?void 0:Z.createdByUserId)===S,ej=!!((null==W?void 0:W.canPrepare)&&eI),ex=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=new Set(s.flatMap(s=>{let t=(0,E.jQ)(s);if(!t||t.storyboardId!==e.storyboardId||s.projectId!==e.projectId)return[];let a=t.units.filter(e=>["SUBMITTING","PENDING"].includes(e.status)||e.providerConfirmation).flatMap(e=>e.shotIds);return["COMPLETED","CANCELLED","FAILED"].includes(s.status)?a:[...t.shots.map(e=>e.frameId),...a]}));return e.frames.filter(e=>(0,E.ZW)(e)&&!t.has(e.frameId))}(t,_),eN=Y.filter(e=>ex.some(s=>s.frameId===e)).slice(0,12),ew=R(Z),eb=function(e){let s=(0,E.jQ)(e);return s?"REFERENCE_REVIEW"===s.phase?1:"QUOTED"===s.phase?2:["GENERATING","REVIEW"].includes(s.phase)||(null==e?void 0:e.status)==="COMPLETED"?3:0:0}(Z),eR=Z?3===eb?2:1:0,eg=!!(ef&&["DRAFT","REFERENCE_REVIEW","QUOTED"].includes(ef.phase)),ek=ef?(0,w.fR)(ef,ef.shots.map(e=>e.direction),!1):null,ey="QUOTE"===ek||"PREVIEW"===ek;(0,n.useEffect)(()=>{var e;T||null===(e=em.current)||void 0===e||e.querySelectorAll("audio,video").forEach(e=>e.pause())},[T]);let eC=(0,n.useCallback)(e=>{var s,a;eu.current&&e.projectId===A&&e.workspaceId===g&&(null===(s=(0,E.jQ)(e))||void 0===s?void 0:s.storyboardId)===t.storyboardId&&((null===(a=eh.current)||void 0===a?void 0:a.workflowRunId)===e.workflowRunId&&eh.current.revision>e.revision||(eh.current=e,z(e),O(s=>[e,...s.filter(s=>s.workflowRunId!==e.workflowRunId)])))},[A,g,t.storyboardId]),eA=(0,n.useCallback)(async()=>{let e=await (0,E.CC)(A,t.storyboardId);eu.current&&(O(s=>{var t;let a=new Map(e.items.filter(e=>e.workspaceId===g).map(e=>[e.workflowRunId,e]));for(let e of s)((null===(t=a.get(e.workflowRunId))||void 0===t?void 0:t.revision)||0)<e.revision&&a.set(e.workflowRunId,e);return[...a.values()].sort((e,s)=>(s.updatedAt||"").localeCompare(e.updatedAt||""))}),Q(e.nextToken),G(!e.nextToken))},[A,g,t.storyboardId]),eS=(0,n.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],s=await (0,E.vr)(g,A,{actorId:S,force:e});eu.current&&(V(s),s.availableModelIds.includes("seedance25")||(J("seedance20"),$("STANDARD")))},[g,A,S]);(0,n.useEffect)(()=>(eu.current=!0,Promise.all([eA(),eS()]).catch(e=>{eu.current&&er((0,E.ll)(e))}),()=>{eu.current=!1}),[eA,eS]),(0,n.useEffect)(()=>{L({...ew,working:et||!!(Z&&(0,E.WJ)(Z)),...Z&&ef?{workflowRunId:Z.workflowRunId,phase:ef.phase,ready:ef.units.filter(e=>"READY"===e.status&&"PENDING"===e.review).length,failed:ef.units.filter(e=>"FAILED"===e.status).length,unconfirmed:ef.units.filter(e=>e.providerConfirmation).length}:{}})},[ew.title,ew.detail,et,null==Z?void 0:Z.workflowRunId,null==Z?void 0:Z.revision,null==Z?void 0:Z.updatedAt,L]);let eD=async function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!ec.current&&eu.current){ec.current=!0,ea(!0),er("");try{let t=await e();if(!eu.current)return;return eC(t),s&&await P(),t}catch(e){if(!eu.current)return;if(er((0,E.ll)(e)),eh.current)try{eC(await (0,E.Ps)(eh.current.workflowRunId))}catch(e){}}finally{ec.current=!1,eu.current&&ea(!1)}}},eT=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=eh.current;return t?eD(()=>(0,E.dX)(t,e),s):Promise.resolve(void 0)};return(0,n.useEffect)(()=>{if(!Z||et||ei||!(0,E.WJ)(Z))return;let e=!0,s=window.setTimeout(()=>{(0,E.Ps)(Z.workflowRunId).then(s=>{e&&eC(s)}).catch(()=>{e&&er("Progress updates were interrupted. Your submitted work is saved; check progress to reconnect.")})},T?5e3:15e3);return()=>{e=!1,clearTimeout(s)}},[Z,et,ei,T,eC]),(0,n.useEffect)(()=>{var e;if(!Z||(null==ef?void 0:ef.phase)!=="DRAFT"||"QUOTE"!==ek||!(null===(e=ef.generationPlan)||void 0===e?void 0:e.every(e=>e.prompt))||!ej||eE||ef.paused||et||ei||!T||en)return;let s="".concat(Z.workflowRunId,":").concat(Z.revision);ev.current!==s&&(ev.current=s,eD(()=>(0,b.e)(Z,E.dX,eC,()=>eu.current)))},[null==Z?void 0:Z.workflowRunId,null==Z?void 0:Z.revision,null==ef?void 0:ef.phase,null==ef?void 0:ef.paused,ek,ej,eE,et,ei,T,en]),(0,a.jsxs)("section",{ref:em,className:k().panel,"aria-label":"Make video with ANI",hidden:!T,children:[(0,a.jsxs)("header",{className:k().heading,children:[(0,a.jsx)("span",{className:k().headingIcon,children:(0,a.jsx)(r.Z,{size:21})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h2",{children:ew.title}),(0,a.jsx)("p",{children:ew.detail})]}),Z&&(0,a.jsx)("button",{className:k().button,disabled:et,"aria-label":"Check video progress",onClick:()=>void eD(()=>(0,E.Ps)(Z.workflowRunId)),children:(0,a.jsx)(o.Z,{size:14})})]}),(0,a.jsx)("ol",{className:k().steps,"aria-label":"Video production stages",children:C.map((e,s)=>{let{label:t,icon:n}=e;return(0,a.jsxs)("li",{"data-active":eR===s,"data-done":eR>s,"aria-current":eR===s?"step":void 0,children:[eR>s?(0,a.jsx)(d.Z,{size:13}):(0,a.jsx)(n,{size:13}),t]},t)}
1)}),en&&(0,a.jsxs)("div",{className:k().notice,role:"alert",children:[(0,a.jsx)(c.Z,{size:15}),(0,a.jsx)("span",{className:"flex-1",children:en}),(0,a.jsx)("button",{className:k().button,disabled:et,onClick:()=>{er(""),Promise.all([eA(),eS(!0)]).catch(e=>{eu.current&&er((0,E.ll)(e))})},children:"Refresh"})]}),Z?ef&&(0,a.jsxs)(a.Fragment,{children:[eg&&!ei&&(0,a.jsx)("div",{className:"mb-4 space-y-3",children:(0,a.jsx)(N.Z,{compact:!0,video:ef,busy:et,onEditPrompt:ej&&!eE?()=>el(!0):void 0,onEditSettings:ej&&!eE?()=>el(!0):void 0})}),"REFERENCE_REVIEW"===ef.phase&&W&&!eE&&(0,a.jsx)(I.Z,{targets:ef.referenceManifest||[],workspaceId:g,projectId:A,episodeId:Z.episodeId||void 0,modelId:ef.modelId,advancedCreationRightsEnabled:W.advancedCreationRightsEnabled,canContinue:ej&&!et&&!ei,onPortalOpen:ed,onReviewReferences:()=>el(!0),onReady:async e=>{if(!await eT({action:"REFERENCE_PERMISSIONS_READY",overrides:e}))throw Error("Permissions are saved. Check the task to continue to its estimate.")}},JSON.stringify(ef.referenceManifest)),"QUOTED"===ef.phase&&!eE&&(0,a.jsx)(j.Z,{showPlan:!1,video:ef,busy:et,onRefresh:ej?()=>void eT({action:"QUOTE"}):void 0,onApprove:ej?()=>{let e=ef.units.filter(e=>"QUOTED"===e.status&&"FINAL_FROM_DRAFT"===e.seedanceRenderMode);eT({action:e.length?"APPROVE_FINAL":"APPROVE",...e.length?{unitIds:e.map(e=>e.unitId)}:{},quoteId:ef.quoteId,maximumCredits:ef.maximumCredits})}:void 0}),["GENERATING","REVIEW"].includes(ef.phase)&&(0,a.jsx)(x.ZP,{compact:!0,video:ef,busy:et,runStatus:Z.status,creator:ej,onCommand:(e,s)=>{eT(e,s)}}),"DRAFT"===ef.phase&&(0,a.jsxs)("div",{className:k().footer,children:[(0,a.jsx)("p",{role:"status",className:k().muted,children:et?"Preparing your estimate…":ey?"Storyboard directions are ready. Preparing your estimate.":"A shot needs preparation before we can estimate it."}),(en||!ey)&&(0,a.jsxs)("button",{className:k().primary,disabled:et||!ej||eE,onClick:()=>ey?void eD(()=>(0,b.e)(Z,E.dX,eC,()=>eu.current)):el(!0),children:[ey?"Retry estimate":"Review preparation",(0,a.jsx)(h.Z,{size:13})]})]}),!["DRAFT","REFERENCE_REVIEW","QUOTED","GENERATING","REVIEW"].includes(ef.phase)&&(0,a.jsxs)("div",{className:k().footer,children:[(0,a.jsx)("p",{className:k().muted,children:"This task has additional preparation to review."}),(0,a.jsxs)("button",{className:k().primary,onClick:()=>el(!0),children:["Review preparation",(0,a.jsx)(h.Z,{size:13})]})]}),!!(null===(s=ef.acceptedSegments)||void 0===s?void 0:s.length)&&(0,a.jsxs)("div",{className:k().footer,children:[(0,a.jsxs)("span",{className:k().receipt,children:[(0,a.jsx)(d.Z,{size:14}),new Set(ef.acceptedSegments.map(e=>e.frameId)).size," shot",1===new Set(ef.acceptedSegments.map(e=>e.frameId)).size?"":"s"," saved"]}),(0,a.jsxs)("button",{className:k().primary,onClick:F,children:[(0,a.jsx)(l.Z,{size:14}),"Watch edit"]})]}),"REVIEW"===ef.phase&&!eE&&(0,a.jsxs)("button",{className:"".concat(k().button," mt-4"),disabled:et||ef.units.some(e=>"READY"===e.status&&"PENDING"===e.review)||ef.units.some(e=>!["READY","FAILED"].includes(e.status))||"SETTLEMENT_PENDING"===Z.billingStatus,onClick:()=>void eT({action:"FINISH"}),children:[(0,a.jsx)(d.Z,{size:14}),"Done reviewing"]}),(0,a.jsxs)("details",{className:k().disclosure,children:[(0,a.jsxs)("summary",{children:[(0,a.jsx)(u.Z,{size:13}),"Task options"]}),(0,a.jsxs)("div",{className:"".concat(k().actions," mt-3"),children:[(0,a.jsx)("button",{className:k().button,disabled:et,onClick:()=>{eh.current=null,z(null),ep.current=(0,f.Uz)(),er(""),eA().catch(e=>er((0,E.ll)(e)))},children:"Choose another batch"}),(0,a.jsx)("button",{className:k().button,disabled:et,onClick:()=>el(!0),children:"Advanced settings & task history"}),!eE&&["GENERATING","PLANNING","GUIDE_PREPARING"].includes(ef.phase)&&(0,a.jsx)("button",{className:k().button,disabled:et||!ej&&ef.paused,onClick:()=>void eT({action:ef.paused?"RESUME":"PAUSE"}),children:ef.paused?"Check & resume saved requests":"Pause new submissions"})]})]})]}):(0,a.jsxs)(a.Fragment,{children:[W?W.canPrepare?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:k().actions,children:[(0,a.jsxs)("button",{className:k().button,disabled:!M||et||!ex.length,onClick:()=>q(ex.slice(0,12).map(e=>e.frameId)),children:[(0,a.jsx)(d.Z,{size:13}),"Select ready shots",ex.length>12?" \xb7 first 12":""]}),(0,a.jsx)("button",{className:k().button,disabled:et||!eN.length,onClick:()=>q([]),children:"Clear"}),(0,a.jsxs)("span",{className:k().muted,children:[eN.length," selected",ex.length>12?" \xb7 up to 12 per batch":""]})]}),(0,a.jsx)("div",{className:k().shotRail,children:ex.map(e=>(0,a.jsxs)("button",{className:k().shot,"aria-label":"Select shot ".concat(t.frames.indexOf(e)+1),"aria-pressed":eN.includes(e.frameId),disabled:et||!eN.includes(e.frameId)&&eN.length>=12,onClick:()=>q(s=>s.includes(e.frameId)?s.filter(s=>s!==e.frameId):[...s,e.frameId]),children:[(0,a.jsx)(p.Z,{src:e.thumbnailUrl||e.imageUrl,alt:"",loading:"lazy"}),(0,a.jsx)("span",{className:k().check,children:eN.includes(e.frameId)&&(0,a.jsx)(d.Z,{size:13})}),(0,a.jsxs)("strong",{children:["Shot ",t.frames.indexOf(e)+1]}),(0,a.jsxs)("small",{children:[((e.displayDurationMs||e.durationMs||3e3)/1e3).toFixed(1),"s"]})]},e.frameId))}),!ex.length&&M&&(0,a.jsx)("p",{className:k().muted,children:"No unassigned stills are ready for video. Continue a saved task below or choose another storyboard frame."}),(0,a.jsxs)("details",{className:k().disclosure,children:[(0,a.jsxs)("summary",{children:[(0,a.jsx)(u.Z,{size:14}),"Motion & quality ",(0,a.jsxs)("span",{className:"ml-auto",children:["seedance25"===X?"Seedance 2.5":"Seedance 2.0"," \xb7 ","DRAFT_THEN_FINAL"===K?"480p preview":ee]})]}),(0,a.jsxs)("div",{className:k().settings,children:[(0,a.jsxs)("label",{children:["Model",(0,a.jsx)("select",{disabled:et,value:X,onChange:e=>{J(e.target.value),"seedance20"===e.target.value&&$("STANDARD")},children:W.availableModelIds.map(e=>(0,a.jsx)("option",{value:e,children:"seedance25"===e?"Seedance 2.5":"Seedance 2.0"},e))})]}),(0,a.jsxs)("label",{children:["Quality",(0,a.jsxs)("select",{disabled:et,value:"DRAFT_THEN_FINAL"===K?"draft":ee,onChange:e=>{$("draft"===e.target.value?"DRAFT_THEN_FINAL":"STANDARD"),"draft"!==e.target.value&&es(e.target.value)},children:["seedance25"===X&&(0,a.jsx)("option",{value:"draft",children:"480p preview \xb7 optional 1080p later"}),(0,a.jsx)("option",{value:"720p",children:"720p"}),(0,a.jsx)("option",{value:"1080p",children:"1080p"})]})]}),(0,a.jsxs)("label",{className:"sm:col-span-2",children:["Direction",(0,a.jsx)("textarea",{rows:2,maxLength:6e3,disabled:et,value:H,onChange:e=>B(e.target.value)})]})]})]}),(0,a.jsxs)("div",{className:k().footer,children:[(0,a.jsxs)("span",{className:k().muted,children:[(0,a.jsx)(i.Z,{size:13,className:"mr-1 inline"}),"Recommended directions \xb7 review the price before generating."]}),(0,a.jsxs)("button",{className:k().primary,disabled:et||!M||!eN.length,onClick:()=>void eD(async()=>
1{if(!(null==W?void 0:W.canPrepare)||!M||!eN.length)throw Error("Check access and current tasks before preparing shots.");let e=await (0,E.B_)({workspaceId:g,projectId:A,storyboardId:t.storyboardId,frameIds:eN,instruction:H,modelId:X,resolution:"DRAFT_THEN_FINAL"===K?"1080p":ee,seedanceRenderStrategy:K,grouping:"INDIVIDUAL",audio:!1,useApprovedAudio:!1,workflowRunId:ep.current});return(eC(e),eu.current)?(0,b.e)(e,E.dX,eC,()=>eu.current):e}),children:[et?"Preparing your shots…":"Continue \xb7 ".concat(eN.length||""," shot").concat(1===eN.length?"":"s"),(0,a.jsx)(h.Z,{size:14})]})]})]}):(0,a.jsx)("div",{className:k().notice,children:(0,E.mW)(W)}):(0,a.jsxs)("div",{className:k().loading,children:[(0,a.jsx)(v.Z,{className:"h-8 w-8"}),"Loading video options…"]}),(_.length>0||U)&&(0,a.jsxs)("details",{className:k().disclosure,open:!ex.length,children:[(0,a.jsxs)("summary",{children:[(0,a.jsx)(m.Z,{size:14}),"Saved video tasks ",(0,a.jsx)("span",{className:"ml-auto",children:_.length})]}),_.map(e=>{var s,t;return(0,a.jsxs)("div",{className:k().history,children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("strong",{children:[null===(s=(0,E.jQ)(e))||void 0===s?void 0:s.shots.length," shot",(null===(t=(0,E.jQ)(e))||void 0===t?void 0:t.shots.length)===1?"":"s"," \xb7 ",R(e).title]}),(0,a.jsx)("p",{className:k().muted,children:new Date(e.createdAt||e.updatedAt||"").toLocaleDateString()})]}),(0,a.jsxs)("button",{className:k().button,disabled:et,onClick:()=>void eD(()=>(0,E.Ps)(e.workflowRunId)),children:["Open",(0,a.jsx)(h.Z,{size:12})]})]},e.workflowRunId)}),U&&(0,a.jsx)("button",{className:"".concat(k().button," mt-3"),disabled:et,onClick:async()=>{ea(!0);try{let e=await (0,E.CC)(A,t.storyboardId,U);eu.current&&(O(s=>[...new Map([...s,...e.items.filter(e=>e.workspaceId===g)].map(e=>[e.workflowRunId,e])).values()]),Q(e.nextToken),G(!e.nextToken))}catch(e){er((0,E.ll)(e))}finally{ea(!1)}},children:"Load earlier tasks before starting a new batch"})]})]}),ei&&!eo&&(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)("p",{role:"status",className:k().muted,children:"Opening motion settings…"}),children:(0,a.jsx)(y,{board:t,projectId:A,workspaceId:g,userId:S,initialFrameIds:eN,initialWorkflowRunId:null==Z?void 0:Z.workflowRunId,onAttached:async e=>{eC(e),await P()},onClose:()=>{el(!1),eh.current&&eD(()=>(0,E.Ps)(eh.current.workflowRunId))}})})]})}}}]);

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.