import{k as h,l as j,o,s as r,p as y,j as t,h as v,aR as V,dF as c}from"./app-BgLa5dit.js";import{O as b}from"./B-fq6xxv.chunk.js";import{u as x,E}from"./BEI8Wlav.chunk.js";import{S as G}from"./CJf3ETiT.chunk.js";import{E as O}from"./RTbqjc8Y.chunk.js";import"./w68yffRy.chunk.js";import"./ekVIVtrT.chunk.js";import"./BfMtaC_g.chunk.js";function w(e){const s=h(),I=j(),l=o(V.currentUser()),i=o(r.video(e.videoId)),u=o(y.getAssemblyLineVideo(e.videoId)),d=x(e.videoId),m=o(r.clickViewTags(e.videoId));function f(a){return s(c.updateAtAGlance(e.videoId,a))}function A(){return s(c.updateAtAGlance(e.videoId,null))}async function P(a){if(!(a!=null&&a.length))try{return await Promise.all(d.items.map(n=>s(c.deletePointOfInterest(n.id)))),{...i.data,pointsOfInterest:{data:[],pagination:null}}}catch{return i.data}return s(c.updatePointOfInterest(e.videoId,a.map(n=>({...n,id:n.id.toString().includes("lookup")?null:n.id}))))}async function g(a,n){await Promise.all([s(r.updateContentPipelineVideo(e.videoId,{hasPointsOfInterest:a})),s(r.addContentPipelineVideoComment(e.videoId,"bypassPointsOfInterest",n.bypassCategory,n.bypassReason))]),I.success("Successfully removed points of interest requirement")}return!!(d!=null&&d.hasCompleted)&&!!i.data&&!!m.data&&!!u.hasCompleted?t.jsxs(t.Fragment,{children:[!!l.data&&t.jsx(t.Fragment,{children:e.context==="streamable"?t.jsx(G,{videoId:e.videoId,activeAction:v.StreamableLearning.EDIT_VIDEO_GLANCE}):t.jsx(O,{videoId:e.videoId,activeAction:v.Videos.MANAGE_POINTS_OF_INTEREST,currentUser:l.data})}),t.jsx(b,{object:i.data}),t.jsx(E,{obj:i.data,tags:m.data,initialPois:d.items,saveGlance:f,deleteGlance:A,updatePointsOfInterest:P,onToggleHasPointsOfInterest:g,contentPipelineVideo:u.data})]}):t.jsx(t.Fragment,{})}export{w as ManagePointsOfInterestView};
//# sourceMappingURL=BYZ1GX3L.chunk.js.map
