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