import{fJ as P,j as i,ba as C,bp as v,br as h,bs as g,bq as x,bb as p,al as A,E as L,F as s,d2 as w,ek as j,a9 as o,o as E,h as r,i as d,s as T,r as y,ag as f,cw as b,g as I}from"./app-BgLa5dit.js";import{V as G,I as S,a as N,b as O}from"./CXuN-bs8.chunk.js";import{u as D}from"./CIv-y2Up.chunk.js";import"./DUGw_22-.chunk.js";import"./Ib-esfrz.chunk.js";import"./oUIMm7ik.chunk.js";function F(e){var a,t,c;const n=P((a=e.interactive.subjectPresentationAudiences)==null?void 0:a.data,e.presentationAudiences);return i.jsxs("div",{className:"row gx-0 py-2",children:[i.jsx("div",{className:"col-4",children:i.jsx(C,{video:e.interactive,appLink:e.getInteractiveAppLink(e.interactive),onClick:e.onClickAppLink,audience:n,imageOptions:{size:A.Medium},textPosition:p.Independent,type:"static",analyticsOptions:{entity:x.Interactive,actionType:g.Click,location:h.InteractivesGuidancePopup,descriptor:v.Thumbnail},showOwner:e.showOwner,commonVideoProps:e.commonVideoProps,disableFavourite:!0})}),i.jsxs("div",{className:"col-8 ps-2",children:[i.jsx(G,{video:e.interactive,appLink:e.getInteractiveAppLink(e.interactive),onClickAppLink:e.onClickAppLink,yearGroups:e.commonVideoProps.yearGroups,showPadlock:!e.commonVideoProps.hasStudentExperience&&!e.commonVideoProps.hasGuestExperience,analyticsOptions:{entity:x.Interactive,actionType:g.Click,location:h.InteractivesGuidancePopup,descriptor:v.Title}}),e.canViewInteractives?i.jsx("div",{className:"pt-sm-1 pt-md-0",children:i.jsx(S,{timepoints:(t=e.interactive._timepoints)==null?void 0:t.value,appLink:e.getInteractiveAppLink(e.interactive),previewAppLink:(c=e.getPreviewQuestionsAppLink)==null?void 0:c.call(e,e.interactive),onClickAppLink:e.onClickAppLink,totalToDisplay:3})}):i.jsx(N,{video:e.interactive,hasStudentExperience:e.commonVideoProps.hasStudentExperience,hasGuestExperience:e.commonVideoProps.hasGuestExperience}),!e.commonVideoProps.hasStudentExperience&&!e.commonVideoProps.hasGuestExperience&&i.jsx(O,{video:e.interactive,yearGroups:e.commonVideoProps.yearGroups})]})]})}const l="shared.videoGuidanceInteractivesPopup",V=350;function M(e){return i.jsx(L,{closePopup:e.onClickClose,showLoadingSpinner:e.isLoading,title:e.isLoading?"":s.getPhrase(l,"interactives"),size:"lg",children:!e.isLoading&&i.jsxs(i.Fragment,{children:[i.jsxs(w,{autoHeight:!0,autoHeightMax:V,autoHeightMin:V,children:[i.jsx("ul",{className:"list-unstyled",children:e.interactives.map(n=>i.jsx("li",{children:i.jsx(F,{interactive:n,getInteractiveAppLink:e.getInteractiveAppLink,getPreviewQuestionsAppLink:e.getPreviewQuestionsAppLink,presentationAudiences:e.presentationAudiences,canViewInteractives:e.canViewInteractives,onClickAppLink:e.closePopup,showOwner:e.showOwner,commonVideoProps:e.commonVideoProps})},n.id))}),(e.hasMore||e.isFetching)&&i.jsx(j,{isFetching:e.isFetching,fetchNext:e.fetchNext,nextCursor:e.nextCursor,fetchOnScroll:!0})]}),i.jsxs(o,{children:[i.jsx(o.Cancel,{onClick:e.onClickClose,text:s.getPhrase(l,"close")}),i.jsx(o.Submit,{text:s.getPhrase(l,"viewVideo"),variant:"dark",onClick:e.onClickViewVideo})]})]})})}function B(e){var u,m;function n(){return e.type===f.Video?T.video(e.id):y.clip(e.id)}const{commonVideoProps:a}=D(),t=E(n());function c(){if(b.isVideo(t.data)){I.trigger({application:d.VIDEOS,action:r.Videos.EDIT_VIDEO,args:[t.data.id]}),e.closePopup();return}I.trigger({application:d.CLIPS,action:r.Clips.EDIT_CLIP_DETAILS,args:[t.data.id]}),e.closePopup()}return i.jsx(M,{isLoading:!t.hasCompleted,video:t.data,interactives:((m=(u=t.data)==null?void 0:u.interactives)==null?void 0:m.data)??[],hasMore:!1,isFetching:!1,nextCursor:null,fetchNext:()=>{},onClickClose:e.closePopup,onClickViewVideo:c,presentationAudiences:[],getInteractiveAppLink:k=>({application:d.INTERACTIVES,action:r.Interactives.EDIT_INTERACTIVE,args:[k.id]}),canViewInteractives:!0,closePopup:e.closePopup,commonVideoProps:a})}export{B as VideoGuidanceInteractivesView};
//# sourceMappingURL=CzMhLSsv.chunk.js.map
