import{ao as e,L as a,e3 as x,ck as h,aq as g,gx as v,S as P,bc as f,aF as j,o as b,E as F,W as k,r as C,p as y}from"./app-k0jcl5PQ.js";import{l as d}from"./DLmnDxSd.chunk.js";import{F as E}from"./DzRq1F5-.chunk.js";import{F as p}from"./DV1GpLCe.chunk.js";import{F as U}from"./C3DvQ1wU.chunk.js";import"./CW7x8M-z.chunk.js";import"./Di9d6zcy.chunk.js";import"./CKctgafI.chunk.js";const o="shared.editUploadDetails",V=d.object().shape({name:d.string().max(255,()=>a.getPhrase(o,"nameExceeds")).required(()=>a.getPhrase(o,"nameRequired")),description:d.string().max(16e3,()=>a.getPhrase(o,"descriptionExceeds"))});function S(s){const i=x();return e.jsxs(h,{children:[e.jsx(p,{label:a.getPhrase(o,"nameLabel"),type:"text",name:"name",id:"name",placeholder:a.getPhrase(o,"namePlaceholder"),autoFocus:!0,value:i.values.name}),e.jsx(p,{label:a.getPhrase(o,"descriptionLabel"),as:"textarea",name:"description",id:"description",placeholder:a.getPhrase(o,"descriptionPlaceholder"),autoFocus:!0,value:i.values.description}),e.jsxs("div",{className:"btn-container d-flex justify-content-end",children:[e.jsx("button",{type:"button",className:"btn btn-link me-2",onClick:s.onClickCancel,children:e.jsx(g,{namespace:o,phrase:"cancel"})}),e.jsx(E,{isNew:!1,variant:"dark"})]})]})}function w(s){const{video:{name:i,description:n},saveVideo:r,onClickCancel:t}=s;return e.jsx(U,{initialValues:{name:i,description:n},validationSchema:V,onSubmit:r,children:e.jsx(S,{onClickCancel:t})})}const m="upload.editUpload",L=a.encloseNamespace(m);function R(s){const{uploadId:i}=s,n=v(P.VideoUpload),r=f(),t=n.getCollection().get(i);t.get("editingMetadata")||t.set("editingMetadata",!0);const c=()=>{t.set("editingMetadata",!1),s.closePopup()},u=l=>{t.set(l),b.logUserAction(l,{location:y.Popup,actionType:C.Edit,workflowPhase:k.Complete,entity:F.Upload}),r.success(L("alertBody",{videoName:l.name,escapeText:!0})),c()};return e.jsx(j,{closePopup:c,title:a.getPhrase(m,"title"),children:e.jsx(w,{video:{name:t.get("name"),description:t.get("description"),productionYear:0},saveVideo:u,onClickCancel:c})})}export{R as EditUploadView};
//# sourceMappingURL=Pd8VNKq7.chunk.js.map
