import{R as o,aa as A,aD as y,aE as E,aF as L,t as b,j as a,q as I,aG as P,E as F,aH as w,h as j,i as N,aI as R}from"./app-BgLa5dit.js";function k(e){var u,r;const[l,p]=o.useState(e.initialField),[C,c]=o.useState(!0),s=A(e.id),g=y(E.ALERT),t=L();o.useEffect(()=>(t==null||t.setVideoId(e.id),()=>{t==null||t.setVideoId(null)}),[e.id]);const n=b[e.stage].forms;function x(){var m;const f=((m=s.data)==null?void 0:m.masterType)==="Clip"?"clip":"video";let i=n[l].next;for(;i&&!n[i].supportedTypes.includes(f);)i=n[i].next;return i}function v(){if(C)return e.closePopup();g.createAlert({type:R.Warning,heading:"Are you sure?",message:"Click close again to close the popup."}),c(!0)}const{formComponent:h,popupSize:S=["review_thumbnail","review_video","published_video"].includes(e.stage)?"lg":"md"}=n[l],d=x();return a.jsx(I,{subStage:e.stage,pipelineId:e.pipelineId,children:a.jsx(P.Provider,{value:!!d,children:a.jsx(F,{title:(u=s.data)==null?void 0:u.name,closePopup:v,size:S,backdrop:"static",showLoadingSpinner:!s.hasCompleted,headerButtons:[{appLink:{application:N.ASSEMBLY_LINE,action:j.AssemblyLine.PICTURE_IN_PICTURE,args:[(r=s.data)==null?void 0:r.id]},svg:w,className:"text-secondary"}],children:a.jsx(h,{id:e.id,onNext:()=>p(d),closePopup:e.closePopup,stage:e.stage,setCanClosePopup:c,view:e.view})})})})}export{k as EditVideoContainerView};
//# sourceMappingURL=DF4YZMAp.chunk.js.map
