import{c4 as L,bc as j,aJ as w,az as p,aj as y,f0 as l,ao as e,aF as E,L as k,aq as I,bU as n,m as R,o as U,W as V,p as _,E as D,r as T,a as b,e as u,f as o,v}from"./app-k0jcl5PQ.js";const d="shared.deleteClip",a=k.encloseNamespace(d);function q(t){const h=L(),c=j(),[x,C]=w.useState(!1),m=p(y.currentUser()),s=p(!!m.data&&l.clip(t.id));function P(){var i;C(!0);const S=()=>{c.success(a("success",{name:s.data.name,escapeText:!0})),U.logUserAction({id:t.id},{actionType:T.Delete,entity:D.Clip,location:_.Popup,workflowPhase:V.Complete});const r=b.getCurrentRoute().appLink,A=[o.Clips.PLAY_CLIP,o.Share.VIEW_SHARE_LINK];r.application===u.CLIPS&&A.includes(r.action)&&v.trigger({application:u.MY_VIDEOS,action:o.MyVideos.MY_VIDEOS})},f=()=>{c.error(a("error",{name:s.data.name,escapeText:!0}))},g=()=>{t.closePopup()};R(h,l.deleteClip(t.id,(i=s.data._parentVideo)==null?void 0:i.id,S,f,g))}return e.jsx(E,{title:a("title"),closePopup:t.closePopup,showLoadingSpinner:!s.data,children:!!s.data&&e.jsxs(e.Fragment,{children:[e.jsx("p",{children:e.jsx(I,{namespace:d,phrase:"body",options:{name:s.data.name}})}),e.jsxs(n,{children:[e.jsx(n.Cancel,{onClick:t.closePopup}),e.jsx(n.Submit,{showSpinner:x,variant:"danger",text:a("confirm"),onClick:P})]})]})})}export{q as DeleteClipView};
//# sourceMappingURL=oQhzJv9I.chunk.js.map
