import{ao as a,L as u,e3 as o,ck as m,c8 as c,aR as d,aq as x}from"./app-k0jcl5PQ.js";import{l as i}from"./DLmnDxSd.chunk.js";import{F as k}from"./DzRq1F5-.chunk.js";import{F as l}from"./DV1GpLCe.chunk.js";import{F as b}from"./C3DvQ1wU.chunk.js";const r="shared.editLink",n=u.encloseNamespace(r),C=i.object().shape({name:i.string().trim().max(255,()=>n("linkNameExceeds")).required(()=>n("linkNameRequired")).default(""),url:i.string().url().trim().max(16e3,()=>n("linkUrlExceeds")).required(()=>n("linkUrlRequired")).default("")}).noUnknown();s.defaultProps={submitButtonVariant:"primary"};function s(e){const t=o();return a.jsxs(m,{children:[a.jsx(l,{label:n("urlLabel"),name:"url",id:"url",value:t.values.url,placeholder:n("urlPlaceholder")}),(!e.isNew||!!t.values.url&&!t.errors.url)&&a.jsx(l,{label:n("nameLabel"),name:"name",id:"name",value:t.values.name,placeholder:n("namePlaceholder")}),a.jsxs("div",{className:e.buttonContainerClassName||"",children:[!!c.isFunction(e.onClickCancel)&&a.jsx(d,{variant:"link",className:"me-2",onClick:e.onClickCancel,children:a.jsx(x,{namespace:r,phrase:"cancel"})}),a.jsx(k,{isNew:e.isNew,submitText:e.submitButtonText,variant:e.submitButtonVariant})]})]})}h.defaultProps={submitButtonVariant:"light"};function h(e){var t;return a.jsx(b,{initialValues:e.link,validationSchema:C,onSubmit:e.saveLink,children:a.jsx(s,{isNew:!((t=e.link)!=null&&t.id),onClickCancel:e.onClickCancel,buttonContainerClassName:e.buttonContainerClassName,submitButtonText:e.submitButtonText,submitButtonVariant:e.submitButtonVariant})})}export{h as E};
//# sourceMappingURL=DwtKWFnX.chunk.js.map
