"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["app/web-app-firewall/submit-handler"],{3238(e,t,n){n.r(t),n.d(t,{default:()=>c});var o=n(95);const s=o.Locale.getSection("components.forms.web-app-firewall"),l=o.Locale.getSection("components.buttons"),c=({currentWebServer:e,currentRuleSet:t,isCustomized:n,needPresetWarning:c})=>{const r=[];let i=!1;const u=document.getElementById("ruleSets-webServer")?.value;"nginx"===u&&e!==u&&n&&(r.push(s.lmsg("nginxIsIncompatible")),i=!0);const d=document.getElementById("ruleSets-ruleSet-crs")?.checked;d&&"crs"!==t&&r.push(s.lmsg("ruleSetCrsConfirmDescription"));const g=document.getElementById("ruleEngine-On"),m=document.getElementById("ruleEngine-DetectionOnly"),a=document.getElementById("config-configPreset-tradeoff"),p=document.getElementById("config-configPreset-thorough");if(!c||m&&!m.checked&&!g.checked||p&&!p.checked&&!a.checked||r.push(s.lmsg("tradeoffAndThoroughModeWarning")),!r.length)return!0;let h=r[0],b="p",f=e=>e;return r.length>1&&(h=r.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:l.lmsg("yes"),no:l.lmsg("no")}})})};n.dn(c)}}]);
//# sourceMappingURL=submit-handler.js.map?c08adeda4be21b4c2338