import{b2 as S,bc as F,p as M,aX as q,az as v,aj as B,f0 as U,bN as Q,L as A,T as n,f as z,e as G,aI as O,ao as t,fp as W,c3 as X,dy as _,bw as D,v as J}from"./app-k0jcl5PQ.js";import{B as K}from"./CCtuxSlD.chunk.js";import{I as Y}from"./DXJ2-V8v.chunk.js";import{V as Z,a as $}from"./DH1mz64H.chunk.js";import{h as ee}from"./DIAJ896Y.chunk.js";import{u as te}from"./CnmbO5oy.chunk.js";import{u as ie,V as se}from"./BUtU6IOA.chunk.js";import{u as oe}from"./DDxzgH2W.chunk.js";import{u as re}from"./DgW9Cwsn.chunk.js";import{u as ae}from"./GqZ33xmI.chunk.js";import{V as I,P as ne}from"./Ci0tHKfw.chunk.js";import"./CPXlV0fg.chunk.js";import"./BlKMjFEf.chunk.js";import"./CofWDDSQ.chunk.js";import"./DwvfEevL.chunk.js";import"./D9SGbB34.chunk.js";import"./BwBaQklX.chunk.js";import"./ByBCp1MC.chunk.js";import"./BhYYYlpK.chunk.js";import"./FGhEvk_q.chunk.js";import"./WCBjpMHJ.chunk.js";import"./DoFMWlew.chunk.js";import"./CMnqIsoM.chunk.js";import"./eerUhItV.chunk.js";import"./Cukd0Qmt.chunk.js";import"./B31bqZwo.chunk.js";import"./uoUaCILN.chunk.js";import"./f_twTV5Z.chunk.js";import"./BDeUEvb2.chunk.js";import"./Daim1zo7.chunk.js";import"./B3XH0kWB.chunk.js";import"./BRhv_AHY.chunk.js";import"./BDviDDog.chunk.js";import"./wCY37Ze3.chunk.js";import"./CIN5bTKK.chunk.js";import"./DAIetGMf.chunk.js";import"./TReHo2Ua.chunk.js";import"./Bj7bJt_4.chunk.js";import"./CGYNvpr2.chunk.js";import"./U4M4wGTR.chunk.js";import"./Bw9otuBi.chunk.js";import"./BvnABNse.chunk.js";import"./Bh7bFXwG.chunk.js";import"./DCdUbbLx.chunk.js";import"./t24_x3Gi.chunk.js";const C="shared.videoMedia",x=A.encloseNamespace(C);function $e(p){var u,f,V,g;const{clipId:s}=p,P=S(),L=F(),{commonVideoProps:w,hasCommonVideoPropsCompleted:b}=oe({locationContext:M.VideoThumbnail}),j=ie({location:se.VideoItem,presentationSlug:null}),o=ae(),k=re(),{hasPermissions:R}=q(),y=v(B.currentUser()),i=v(o.canViewClips&&U.clip(s));Q({title:i.data?x("clipInteractiveViewPageTitle",{video:(u=i.data)==null?void 0:u.name}):""});function c(e){return D.videoInteractives(s,null,e)}function m(e){return P(c(e))}function N(e,a){if(e===1)return ee(a);L.error(A.getPhrase(C,"errorInteractives"))}const{items:r,hasMore:T,isFetching:d}=te(o.canViewInteractives?c:!1,m,N),l=x("interactivesHeading"),E=[{name:(f=i.data)==null?void 0:f.name,appLink:{...I.playClip,args:[s,n.slugify((V=i.data)==null?void 0:V.name)]}},{name:l,appLink:{application:G.CLIPS,action:z.Clips.CLIP_INTERACTIVES,args:[s,n.slugify((g=i.data)==null?void 0:g.name)]},active:!0}];function H(){var e;J.trigger({...I.playClip,args:[s,n.slugify((e=i.data)==null?void 0:e.name)]},{replace:!0})}return O.useEffect(()=>{o.canViewInteractives||H()},[o.canViewInteractives]),!i.data||!(r!=null&&r.length)||!b?t.jsx(ne,{}):t.jsx(Z.Provider,{value:j,children:t.jsxs("div",{className:"px-3",children:[t.jsx("h1",{className:"h2 mb-2",children:l}),t.jsx("div",{className:"mb-2",children:t.jsx(K,{breadcrumbs:E})}),t.jsx($,{videos:r,getVideoAppLink:(e,a)=>{var h;return X.getAppLink(e,{...a,context:_.Widget,contextId:p.clipId,includeContext:(h=y.data)==null?void 0:h.isAuthenticated},null)},hasPermissions:R,presentationAudiences:k.data,getPreviewQuestionsAppLink:e=>W.getPreviewQuestionsAppLink(e),showOwner:!0,commonVideoProps:w}),(T||d)&&t.jsx(Y,{isFetching:d,fetchNext:m})]})})}export{$e as ClipInteractivesView};
//# sourceMappingURL=xAYttU_H.chunk.js.map
