"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/dns/records/dns-zone-sync"],{1420:(e,n,t)=>{t.r(n),t.d(n,{default:()=>u});var s=t(295),o=t(598),c=t(296);const u=({onClose:e,isOpen:n=!0,closeOnFormSuccess:t=!0,closeUrl:u="..",form:r,...l})=>{const a=(0,o.useNavigate)(),[i,f]=(0,s.useState)(n),d=(0,s.useRef)(null),p=(0,s.useCallback)((...n)=>{const t=e??(()=>a(u,{preventScrollReset:!0}));f(!1),d.current=setTimeout(()=>{t(...n),d.current=null},300)},[u,a,e]);(0,s.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]),(0,s.useEffect)(()=>{n?d.current&&clearTimeout(d.current):f(n)},[n]);const m=(0,s.useMemo)(()=>{if(r&&t){if((0,s.isValidElement)(r))return(0,s.cloneElement)(r,{onSuccess:(...e)=>{r.props.onSuccess?.(...e),p()}});if("object"==typeof r)return{...r,onSuccess:(...e)=>{r.onSuccess?.(...e),p()}}}return r},[t,p,r]);return(0,s.jsx)(c.Drawer,{...l,form:m,onClose:p,isOpen:i})}},2307:(e,n,t)=>{t.r(n),t.d(n,{default:()=>p});var s=t(695),o=t(582),c=t(296),u=t(697),r=t(1420),l=t(1294),a=t(90),i=t(295);const f=a.Locale.getTranslate("admin.controllers.dns.sync"),d=o.gql`
    mutation SyncDnsZone($input: SyncDnsZoneInput!) {
        syncDnsZone(input: $input) {
            task {
                id
            }
        }
    }
`,p=()=>{const[e]=(0,s.useMutation)(d);return(0,i.jsx)(r.default,{component:u.default,dataType:"dns-zone-sync",isOpen:!0,title:(0,i.jsx)(f,{content:"title"}),form:(0,i.jsx)(l.default,{applyButton:!1,mutation:e,onSubmit:({sync:e})=>({forced:"forced"===e}),submitButton:{"data-type":"dns-sync-apply"},values:{sync:"safe"},children:(0,i.jsx)(c.FormFieldRadioButtons,{label:(0,i.jsx)(f,{content:"type-option"}),name:"sync",options:[{value:"safe",label:(0,i.jsx)(f,{content:"safe"})},{value:"forced",label:(0,i.jsx)(f,{content:"force"})}]})})})}}}]);
//# sourceMappingURL=dns-zone-sync.js.map?442dbc90bdca90b6b52c