"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["app/web-app-firewall/submit-handler"],{3218(e,t,n){n.r(t),n.d(t,{default:()=>l});var o=n(95);const s=o.Locale.getSection("components.forms.web-app-firewall"),r=o.Locale.getSection("components.buttons"),l=({currentWebServer:e,currentRuleSet:t,isCustomized:n,needPresetWarning:l})=>{const c=[];let i=!1;const u=document.getElementById("ruleSets-webServer")?.value;"nginx"===u&&e!==u&&n&&(c.push(s.lmsg("nginxIsIncompatible")),i=!0);const d=document.getElementById("ruleSets-ruleSet-crs")?.checked;d&&"crs"!==t&&c.push(s.lmsg("ruleSetCrsConfirmDescription"));const a=document.getElementById("ruleEngine-On"),g=document.getElementById("ruleEngine-DetectionOnly"),m=document.getElementById("config-configPreset-tradeoff"),p=document.getElementById("config-configPreset-thorough");if(!l||g&&!g.checked&&!a.checked||p&&!p.checked&&!m.checked||c.push(s.lmsg("tradeoffAndThoroughModeWarning")),!c.length)return!0;let h=c[0],b="p",f=e=>e;return c.length>1&&(h=c.map(e=>`<li>${e}</li>`).join(""),b="ul"),i&&(f=e=>`${e}<div class="indent-box"><input type="checkbox" class="checkbox" id="resetBox" value="true"><div class="indent-box-content"><label for="resetBox">${s.lmsg("nginxResetCustomizations")}</label></div></div>`),new Promise(e=>{o.messageBox.show({type:o.messageBox.TYPE_YESNO,subtype:o.messageBox.SUBTYPE_CONFIRM,text:s.lmsg("ruleSetCrsConfirmTitle"),description:h,descriptionWrapperTag:b,descriptionDecorator:f,onYesClick:()=>{document.getElementById("resetBox")?.checked&&(document.getElementById("ruleSets-resetCustomizations").value="true"),e(!0)},onNoClick:()=>{e(!1)},buttonTitles:{yes:r.lmsg("yes"),no:r.lmsg("no")}})})};(Object.getOwnPropertyDescriptor(l,"name")||{}).writable||Object.defineProperty(l,"name",{value:"default",configurable:!0})}}]);
//# sourceMappingURL=submit-handler.js.map?1959281b13ba4ace2899