"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["app/domain/restriction"],{3130(e,t,o){o.r(t),o.d(t,{Toggles:()=>r,default:()=>a});var s=o(396),l=o(95),i=o(397),n=o(786),g=o.n(n);const r=({listToggleStatus:e,resolutionToggleStatus:t,resolutionToggleIsAllowed:o=!1})=>{const[n,g]=(0,s.useState)(e),[r,a]=(0,s.useState)(t),[d,u]=(0,s.useState)(!1),[c,T]=(0,s.useState)(!1),S=l.Locale.getSection("admin.components.lists.restricteddomains");(0,s.useEffect)(()=>{g(e),a(t)},[e,t]);return(0,s.jsxs)(s.Fragment,{children:[o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Switch,{id:"resolutionToggle",onChange:e=>(e=>{a(e=>!e),T(!0),l.api.post("/admin/domain-restriction/resolution-restriction",{toState:e}).finally(()=>T(!1))})(e),loading:c,checked:r,children:S.lmsg("toggleResolution")}),(0,s.jsx)("br",{})]}),(0,s.jsx)(i.Switch,{id:"listToggle",onChange:e=>(e=>{g(e=>!e),u(!0),l.api.post("/admin/domain-restriction/list-restriction",{toState:e}).finally(()=>u(!1))})(e),loading:d,checked:n,children:S.lmsg("toggleProhibitedList")})]})};r.propTypes={listToggleStatus:g().bool.isRequired,resolutionToggleStatus:g().bool.isRequired,resolutionToggleIsAllowed:g().bool};const a=r},3129(e,t,o){o.r(t),o.d(t,{default:()=>i});var s=o(396),l=o(3130);const i=({listToggleStatus:e,resolutionToggleStatus:t,resolutionToggleIsAllowed:o,renderTo:i})=>{(0,s.render)((0,s.jsx)(l.Toggles,{listToggleStatus:e,resolutionToggleStatus:t,resolutionToggleIsAllowed:o}),document.getElementById(i))};o.dn(i)}}]);
//# sourceMappingURL=restriction.js.map?61b3822c76338ff7ad14