import{c4 as S,bc as j,aJ as I,az as u,n as c,dm as f,ao as s,aF as A,L as C,aq as T,bU as l,m as V,o as m,q as b,W as E,E as F,r as k}from"./app-k0jcl5PQ.js";const y="playlists.removeVideoFromPlaylist",t=C.encloseNamespace(y);function L(e){var p;const v=S(),r=j(),[P,h]=I.useState(!1),a=u(c.getPlaylist(e.playlistId)),o=u(c.getVideoCandidate(e.videoId)),i=o.statusCode===f.Forbidden,x=()=>{h(!0);const g=()=>{const n=i?t("successPrivate",{playlist:a.data.name,escapeText:!0}):t("success",{video:o.data.name,playlist:a.data.name,escapeText:!0});r.success(n),m.logUserAction({id:e.videoId,playlistId:e.playlistId},m.mergeOptions(e.analyticsOptions,{actionType:k.Dissociate,entity:F.Video,workflowPhase:E.Complete,descriptor:b.Playlist})),e.closePopup()},w=()=>{const n=i?t("errorPrivate",{playlist:a.data.name,escapeText:!0}):t("error",{video:o.data.name,playlist:a.data.name,escapeText:!0});r.error(n),e.closePopup()};V(v,c.removePlaylistVideo(e.playlistId,e.videoId,e.typeId,g,w))},d=!!a.data&&!!o.hasCompleted;return s.jsx(A,{title:t("heading"),closePopup:e.closePopup,showLoadingSpinner:!d,children:d&&s.jsxs("div",{className:"remove-video-container",children:[s.jsx("div",{className:"remove-video-body",children:s.jsx("p",{children:s.jsx(T,{namespace:y,phrase:i?"warningPrivate":"warning",options:{video:(p=o.data)==null?void 0:p.name,playlist:a.data.name}})})}),s.jsxs(l,{children:[s.jsx(l.Cancel,{onClick:e.closePopup}),s.jsx(l.Submit,{variant:"danger",text:t("confirm"),onClick:x,showSpinner:P})]})]})})}export{L as RemoveVideoFromPlaylistView};
//# sourceMappingURL=Bnt4nTB1.chunk.js.map
