import{j as a,dy as m,dz as T,dA as r,F as b,G as u,aA as x,az as j,T as v,C as S,dB as C,dC as V,dD as y,ct as n,dE as p}from"./app-BgLa5dit.js";import{F as N}from"./w68yffRy.chunk.js";const P="videos.editVideoTagsSearchBar",k=b.encloseNamespace(P);function L(e){var s;const t=((s=e.tagList)==null?void 0:s.length)>0;return a.jsxs("div",{className:`p-3 mt-3 border rounded ${m.container}`,children:[e.title&&a.jsx("h4",{className:"mb-2",children:e.title}),a.jsx("div",{className:"w-50 mb-2",children:a.jsx(T,{...e})}),t?a.jsx(r,{tags:e.tagList,onRemove:e.onRemove}):a.jsx("p",{className:"text-secondary pt-1",children:k("noTags")})]})}const B=x.object().shape(p("hasTagType",!1));function f(e){function t(){var s,i,l,g,d,o,c,h;return e.contentPipelineVideo?e.type===n.Skill?{hasTagType:e.contentPipelineVideo.hasSkillTags,bypassCategory:(i=(s=e.contentPipelineVideo.comments)==null?void 0:s.bypassSkillTags)==null?void 0:i.category,bypassReason:(g=(l=e.contentPipelineVideo.comments)==null?void 0:l.bypassSkillTags)==null?void 0:g.reason}:{hasTagType:e.contentPipelineVideo.hasPedagogyTags,bypassCategory:(o=(d=e.contentPipelineVideo.comments)==null?void 0:d.bypassPedagogyTags)==null?void 0:o.category,bypassReason:(h=(c=e.contentPipelineVideo.comments)==null?void 0:c.bypassPedagogyTags)==null?void 0:h.reason}:{hasTagType:!0,bypassCategory:"",bypassReason:""}}return a.jsx(u,{initialValues:t(),onSubmit:e.onSubmit,validationSchema:B,children:s=>a.jsx(j,{children:a.jsxs("div",{className:"border rounded p-3 mt-3",children:[a.jsx("h4",{className:"mb-1",children:e.heading}),a.jsx("p",{className:"mb-1",children:e.description}),!!e.contentPipelineVideo&&a.jsx("div",{className:"my-3",children:a.jsx(v,{title:e.tags.length>0?"All tags must be removed.":"",spanHack:!0,spanHackClassName:"",children:a.jsx(S,{id:`${e.type}`,label:"This video does not require pedagogy tags",checked:!s.values.hasTagType,onChange:()=>{s.setValues({hasTagType:!s.values.hasTagType,bypassCategory:"",bypassReason:""})},disabled:e.tags.length>0})})}),s.values.hasTagType?a.jsx(C,{tags:e.allTags,selectedTags:e.tags,onToggle:e.onToggleTag,disabled:!s.values.hasTagType}):a.jsxs(a.Fragment,{children:[a.jsx(V,{categories:e.type===n.Skill?y.bypassSkillTags:y.bypassPedagogyTags,dropdownPlaceholder:e.type===n.Skill?"Why doesn't this video require skill tags?":"Why doesn't this video require pedagogy tags?"}),a.jsx(N,{submitText:"Save reason",variant:"dark"})]})]})})})}export{L as S,f as T};
//# sourceMappingURL=CEzAQXMv.chunk.js.map
