import{R as x,o as s,s as f,p as g,j as e,ar as w,h as V,aJ as v,e as A,i as E,de as R,aR as C}from"./app-BgLa5dit.js";import{P as N,M as P}from"./CanLAf7a.chunk.js";import{C as S}from"./CULwvqVp.chunk.js";import{O as L}from"./B-fq6xxv.chunk.js";import{E as k}from"./RTbqjc8Y.chunk.js";import{A as n}from"./DFA8aJel.chunk.js";import"./B0KtsevF.chunk.js";import"./IEOSPmnY.chunk.js";import"./C8_78Eqq.chunk.js";import"./Bkj-W53y.chunk.js";import"./KIVqng-q.chunk.js";import"./DIopWku2.chunk.js";import"./VIUZq4Vp.chunk.js";import"./B3xA170I.chunk.js";import"./t8cVFCZO.chunk.js";import"./Cu2-dDll.chunk.js";import"./kOrk-qeI.chunk.js";import"./BfMtaC_g.chunk.js";function G(o){var d,l,c,m,p,u,h;const[y,j]=x.useState(!1),r=s(C.currentUser()),a=s(f.video(o.id)),i=s(g.getAssemblyLineVideo(o.id)),t=s(a.data&&N.createViewKey(a.data.id,P.MasterObject));return!a.data||!r.data||!t.hasCompleted||!i.hasCompleted?e.jsx("div",{className:"text-center py-5",children:e.jsx(w,{as:"div",animation:"border"})}):e.jsxs("div",{children:[!!r.data&&e.jsx(k,{videoId:o.id,activeAction:V.Videos.PREVIEW_VIDEO,currentUser:r.data}),!t.hasError&&a.data.status===v.Published&&e.jsxs(n,{variant:"info",className:"mt-3 mb-1",children:["This video is ",e.jsx("strong",{children:"published"})," and cannot be edited or deleted. You may archive it if you believe it should no longer be in use."]}),!t.hasError&&a.data.status===v.Archived&&e.jsxs(n,{variant:"info",className:"mt-3 mb-1",children:["This video is ",e.jsx("strong",{children:"archived"}),". You may publish it again from the options menu."]}),t.hasError&&e.jsxs(n,{variant:"danger",className:"mt-3 mb-1",children:[e.jsx("p",{children:"Your account doesn't have access to watch this video. Please login to an account with one of the following libraries"}),e.jsx("ul",{children:(c=(l=(d=a.data)==null?void 0:d.libraries)==null?void 0:l.data)==null?void 0:c.map(b=>e.jsx("li",{children:b.description},b.id))})]}),e.jsxs("div",{className:`${y&&((m=t.data)!=null&&m.viewKey)?"":"d-none"}`,children:[e.jsx(L,{object:{name:a.data.name,status:a.data.status},actions:[{label:"Open in Content Pipeline",svg:R,appLink:{application:E.ASSEMBLY_LINE,action:A.mapStageToAction((p=i.data)==null?void 0:p.stage),params:{query:(u=a.data)==null?void 0:u.id}},button:!0,disabled:!i.data,tooltip:i.data?"":"Videp is not in the content pipeline",className:"btn btn-outline-dark me-2",openInNewTab:!0}],actionsDropdownClassName:"btn btn-outline-dark",showStatus:!0}),e.jsx(S,{viewKey:(h=t.data)==null?void 0:h.viewKey,playerApi:new URL(ClickView.Config.Urls.PlayerApi),hotkeyElQuerySelector:"body",onReady:()=>j(!0),eventLogging:!1})]})]})}export{G as PreviewVideoView};
//# sourceMappingURL=9u-P7YIc.chunk.js.map
