import{f as H,j as e,p as a,q as N}from"./silentshield-vendor-lib-BOYiOmBi.js";import{c as k,o as q,k as T,I as v,u as z,_ as t,n as F,s as _,C,f as L,h as M,l as S,i as j,M as G,p as W,m as y}from"./silentshield-admin.js";import{L as i,S as d}from"./silentshield-label-CMPShFf3.js";import{T as A,a as B,b as f,c as u}from"./silentshield-tabs-BTNm6AzK.js";import{M as V}from"./silentshield-minus-BT5uLD95.js";import{C as J}from"./silentshield-clock-D68IEilz.js";import{I as w}from"./silentshield-info-BOcn7Nfl.js";import{B as $}from"./silentshield-ban-BzT3Rktb.js";import"./silentshield-vendor-ui-BEc9V-_C.js";import"./silentshield-vendor-charts-CfxhkB09.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const K=k("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const O=k("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Q=k("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const X=k("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),b=H(({className:n,...h},r)=>e("textarea",{className:q("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),ref:r,...h}));b.displayName="Textarea";function p({label:n,description:h,value:r,onChange:o,suffix:l,min:c=0,max:x=999999,step:I=1}){const D=()=>o(Math.max(c,r-I)),U=()=>o(Math.min(x,r+I));return a("div",{className:"space-y-2",children:[a("div",{children:[e(i,{className:"text-xs font-medium",children:n}),h&&e("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:h})]}),a("div",{className:"flex items-center rounded-md border border-input bg-background w-full max-w-[220px]",children:[e(T,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-r-none border-r border-input text-muted-foreground hover:text-foreground",onClick:D,disabled:r<=c,children:e(V,{className:"h-3 w-3"})}),a("div",{className:"flex flex-1 items-center justify-center gap-1 min-w-0",children:[e(v,{type:"number",value:r,onChange:E=>{const P=Number(E.target.value);isNaN(P)||o(Math.min(x,Math.max(c,P)))},className:"h-8 border-0 bg-transparent text-center text-sm font-medium shadow-none focus-visible:ring-0 p-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"}),l&&e("span",{className:"text-[11px] text-muted-foreground shrink-0 pr-1",children:l})]}),e(T,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 rounded-l-none border-l border-input text-muted-foreground hover:text-foreground",onClick:U,disabled:r>=x,children:e(O,{className:"h-3 w-3"})})]})]})}const s=n=>Number(n)===1,m=n=>n?1:0;function g({icon:n,title:h,description:r,children:o,iconColor:l="bg-primary/10 text-primary"}){const[c,x]=l.split(" ");return a(C,{children:[e(L,{className:"pb-4",children:a("div",{className:"flex items-center gap-3",children:[e("div",{className:`flex h-9 w-9 items-center justify-center rounded-lg ${c}`,children:e(n,{className:`h-4 w-4 ${x}`})}),a("div",{children:[e(M,{className:"text-sm font-medium",children:h}),r&&e(S,{className:"text-xs",children:r})]})]})}),e(j,{className:"space-y-4",children:o})]})}function R(n){return n>=3600?_(t("%s min.","captcha-for-contact-form-7"),Math.round(n/60)):n>=60?_(t("%s min.","captcha-for-contact-form-7"),Math.round(n/60)):_(t("%s sec.","captcha-for-contact-form-7"),n)}function Y(){return a("div",{className:"space-y-6",children:[a("div",{children:[e(y,{className:"h-8 w-64 mb-2"}),e(y,{className:"h-4 w-96"})]}),[1,2,3,4,5,6].map(n=>e(y,{className:"h-32 w-full rounded-lg"},n))]})}function le(){const{settings:n,isLoading:h,updateGlobal:r}=z();if(h||!n)return e(Y,{});const o=n.global??{},l=c=>Number(o[c])||0;return a("div",{className:"space-y-6",children:[a("div",{children:[e("h1",{className:"text-2xl font-bold tracking-tight",children:t("Advanced Settings","captcha-for-contact-form-7")}),e("p",{className:"text-muted-foreground",children:t("Content rules, IP management, whitelist/blacklist","captcha-for-contact-form-7")})]}),a(g,{icon:F,title:t("IP-based Rate Limiting","captcha-for-contact-form-7"),description:t("Limits repeated form submissions per IP","captcha-for-contact-form-7"),children:[a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e(i,{className:"text-xs font-medium",children:t("Activate","captcha-for-contact-form-7")}),e(d,{checked:s(o.protection_ip_enable),onCheckedChange:c=>r("protection_ip_enable",m(c))})]}),s(o.protection_ip_enable)&&a(N,{children:[a("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[e(p,{label:t("Max. Attempts","captcha-for-contact-form-7"),description:t("Number of submissions allowed before blocking the IP","captcha-for-contact-form-7"),value:l("protection_ip_max_retries"),onChange:c=>r("protection_ip_max_retries",c),min:1,max:100}),e(p,{label:t("Trial Period","captcha-for-contact-form-7"),description:t("Time window in which max attempts are counted","captcha-for-contact-form-7"),value:l("protection_ip_max_retries_period"),onChange:c=>r("protection_ip_max_retries_period",c),suffix:t("sec.","captcha-for-contact-form-7"),min:1,max:86400,step:10}),e(p,{label:t("Min. time between submissions","captcha-for-contact-form-7"),description:t("Minimum wait time required between two submissions from the same IP","captcha-for-contact-form-7"),value:l("protection_ip_period_between_submits"),onChange:c=>r("protection_ip_period_between_submits",c),suffix:t("sec.","captcha-for-contact-form-7"),min:1,max:3600,step:5}),e(p,{label:t("Block Duration","captcha-for-contact-form-7"),description:t("How long an IP stays blocked after exceeding the limit","captcha-for-contact-form-7"),value:l("protection_ip_block_time"),onChange:c=>r("protection_ip_block_time",c),suffix:t("sec.","captcha-for-contact-form-7"),min:60,max:86400,step:60})]}),a("div",{className:"rounded-lg border bg-accent/50 p-4",children:[a("div",{className:"flex items-center gap-2 mb-3",children:[e(J,{className:"h-4 w-4 text-muted-foreground"}),e("span",{className:"text-xs font-medium",children:t("Flow Visualization","captcha-for-contact-form-7")})]}),a("div",{className:"flex items-center gap-2 text-[11px]",children:[e("div",{className:"flex-1 rounded-md bg-primary/10 border border-primary/20 px-3 py-2.5 text-center font-medium text-primary",children:_(t("%s attempts","captcha-for-contact-form-7"),l("protection_ip_max_retries"))}),e("span",{className:"text-muted-foreground font-medium",children:t("in","captcha-for-contact-form-7")}),e("div",{className:"flex-1 rounded-md bg-primary/10 border border-primary/20 px-3 py-2.5 text-center font-medium text-primary",children:R(l("protection_ip_max_retries_period"))}),e("div",{className:"flex items-center text-muted-foreground",children:e("svg",{width:"24",height:"12",viewBox:"0 0 24 12",children:e("path",{d:"M0 6h20M16 1l5 5-5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})})}),e("div",{className:"flex-1 rounded-md bg-destructive/10 border border-destructive/20 px-3 py-2.5 text-center font-medium text-destructive",children:_(t("Block %s","captcha-for-contact-form-7"),R(l("protection_ip_block_time")))})]})]})]})]}),a(C,{children:[e(L,{className:"pb-4",children:a("div",{className:"flex items-center gap-3",children:[e("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10",children:e(Q,{className:"h-4 w-4 text-primary"})}),a("div",{children:[e(M,{className:"text-sm font-medium",children:t("Content Rules","captcha-for-contact-form-7")}),e(S,{className:"text-xs",children:t("URL limits, BBCode detection, word blacklist","captcha-for-contact-form-7")})]})]})}),e(j,{children:a(A,{defaultValue:"urls",children:[a(B,{className:"w-full",children:[e(f,{value:"urls",className:"flex-1 text-xs",children:t("URL Limit","captcha-for-contact-form-7")}),e(f,{value:"bbcode",className:"flex-1 text-xs",children:t("BBCode","captcha-for-contact-form-7")}),e(f,{value:"words",className:"flex-1 text-xs",children:t("Word Blacklist","captcha-for-contact-form-7")})]}),a(u,{value:"urls",className:"space-y-4 pt-4",children:[a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e(i,{className:"text-xs",children:t("Activate","captcha-for-contact-form-7")}),e(d,{checked:s(o.protection_rules_url_enable),onCheckedChange:c=>r("protection_rules_url_enable",m(c))})]}),s(o.protection_rules_url_enable)&&a(N,{children:[e(p,{label:t("Max. URLs per submission","captcha-for-contact-form-7"),description:t("Submissions with more URLs than this will be blocked (0 = no URLs allowed)","captcha-for-contact-form-7"),value:l("protection_rules_url_limit"),onChange:c=>r("protection_rules_url_limit",c),min:0,max:50}),a("div",{className:"space-y-1.5",children:[e(i,{className:"text-xs",children:t("Error Message","captcha-for-contact-form-7")}),e(v,{value:o.protection_rules_error_message_url??"",onChange:c=>r("protection_rules_error_message_url",c.target.value),className:"h-9 text-xs"})]})]})]}),a(u,{value:"bbcode",className:"space-y-4 pt-4",children:[a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e(i,{className:"text-xs",children:t("Activate","captcha-for-contact-form-7")}),e(d,{checked:s(o.protection_rules_bbcode_enable),onCheckedChange:c=>r("protection_rules_bbcode_enable",m(c))})]}),s(o.protection_rules_bbcode_enable)&&a("div",{className:"space-y-1.5",children:[e(i,{className:"text-xs",children:t("Error Message","captcha-for-contact-form-7")}),e(v,{value:o.protection_rules_error_message_bbcode??"",onChange:c=>r("protection_rules_error_message_bbcode",c.target.value),className:"h-9 text-xs"})]})]}),a(u,{value:"words",className:"space-y-4 pt-4",children:[a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e(i,{className:"text-xs",children:t("Activate","captcha-for-contact-form-7")}),e(d,{checked:s(o.protection_rules_blacklist_enable),onCheckedChange:c=>r("protection_rules_blacklist_enable",m(c))})]}),s(o.protection_rules_blacklist_enable)&&a(N,{children:[a("div",{className:"flex items-start gap-2 rounded-lg border bg-accent/50 p-3",children:[e(w,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),e("p",{className:"text-xs text-muted-foreground",children:t('Synchronized with WordPress "Disallowed Comment Keys"',"captcha-for-contact-form-7")})]}),a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a("div",{children:[e(i,{className:"text-xs",children:t("Greedy Mode","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:t('Also block partial matches (e.g. "spam" also matches "spammer")',"captcha-for-contact-form-7")})]}),e(d,{checked:s(o.protection_rules_blacklist_greedy),onCheckedChange:c=>r("protection_rules_blacklist_greedy",m(c))})]}),a("div",{className:"space-y-1.5",children:[e(i,{className:"text-xs",children:t("Error Message","captcha-for-contact-form-7")}),e(v,{value:o.protection_rules_error_message_blacklist??"",onChange:c=>r("protection_rules_error_message_blacklist",c.target.value),className:"h-9 text-xs"})]})]})]})]})})]}),e(g,{icon:$,title:t("IP Blacklist","captcha-for-contact-form-7"),description:t("IP addresses that are always blocked","captcha-for-contact-form-7"),children:a("div",{className:"space-y-1.5",children:[e(i,{className:"text-xs",children:t("IP addresses (one per line, IPv4/IPv6/CIDR)","captcha-for-contact-form-7")}),e(b,{value:o.protection_blacklist_ips??"",onChange:c=>r("protection_blacklist_ips",c.target.value),placeholder:`192.168.1.1
10.0.0.0/24`,className:"font-mono text-xs min-h-[100px]"})]})}),a(C,{children:[e(L,{className:"pb-4",children:a("div",{className:"flex items-center gap-3",children:[e("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-success/10",children:e(X,{className:"h-4 w-4 text-success"})}),a("div",{children:[e(M,{className:"text-sm font-medium",children:t("Whitelist","captcha-for-contact-form-7")}),e(S,{className:"text-xs",children:t("Emails, IPs and roles that skip protection","captcha-for-contact-form-7")})]})]})}),e(j,{children:a(A,{defaultValue:"email",children:[a(B,{className:"w-full",children:[e(f,{value:"email",className:"flex-1 text-xs",children:t("Email","captcha-for-contact-form-7")}),e(f,{value:"ip",className:"flex-1 text-xs",children:t("IP","captcha-for-contact-form-7")}),e(f,{value:"roles",className:"flex-1 text-xs",children:t("Roles","captcha-for-contact-form-7")})]}),a(u,{value:"email",className:"space-y-3 pt-4",children:[e(b,{value:o.protection_whitelist_emails??"",onChange:c=>r("protection_whitelist_emails",c.target.value),placeholder:`admin@example.com
support@example.com`,className:"font-mono text-xs min-h-[100px]"}),a("div",{className:"flex items-start gap-2 rounded-lg border bg-accent/50 p-3",children:[e(w,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),e("p",{className:"text-xs text-muted-foreground",children:t("These email addresses skip all protection mechanisms","captcha-for-contact-form-7")})]})]}),e(u,{value:"ip",className:"pt-4",children:e(b,{value:o.protection_whitelist_ips??"",onChange:c=>r("protection_whitelist_ips",c.target.value),placeholder:`192.168.1.1
10.0.0.0/24`,className:"font-mono text-xs min-h-[100px]"})}),a(u,{value:"roles",className:"space-y-3 pt-4",children:[a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a("div",{children:[e(i,{className:"text-xs",children:t("Skip Administrators","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:t("Admin users are not checked","captcha-for-contact-form-7")})]}),e(d,{checked:s(o.protection_whitelist_role_admin),onCheckedChange:c=>r("protection_whitelist_role_admin",m(c))})]}),a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a("div",{children:[e(i,{className:"text-xs",children:t("Skip Logged-In Users","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:t("All authenticated users are not checked","captcha-for-contact-form-7")})]}),e(d,{checked:s(o.protection_whitelist_role_logged_in),onCheckedChange:c=>r("protection_whitelist_role_logged_in",m(c))})]})]})]})})]}),a(g,{icon:K,title:t("Asset Loading","captcha-for-contact-form-7"),description:t("Control JS/CSS loading","captcha-for-contact-form-7"),children:[a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a("div",{children:[e(i,{className:"text-xs",children:t("Force Global","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:t("Load JS/CSS on all pages","captcha-for-contact-form-7")})]}),e(d,{checked:s(o.protection_global_asset_loading),onCheckedChange:c=>r("protection_global_asset_loading",m(c))})]}),a("div",{className:"space-y-1.5",children:[e(i,{className:"text-xs",children:t("Custom URLs","captcha-for-contact-form-7")}),e(b,{value:o.protection_asset_loading_urls??"",onChange:c=>r("protection_asset_loading_urls",c.target.value),placeholder:`/kontakt
/checkout
/login`,className:"font-mono text-xs min-h-[80px]"}),e("p",{className:"text-[10px] text-muted-foreground",children:t("URL patterns for targeted loading (one per line)","captcha-for-contact-form-7")})]})]}),a(g,{icon:G,title:t("Mail Logging","captcha-for-contact-form-7"),description:t("Log sent and blocked form messages","captcha-for-contact-form-7"),children:[a("div",{className:"flex items-start gap-3 rounded-lg bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-900 p-3 mb-1",children:[e(w,{className:"h-4 w-4 text-amber-600 dark:text-amber-400 shrink-0 mt-0.5"}),e("p",{className:"text-[10px] text-amber-700 dark:text-amber-400",children:t("GDPR Notice: The mail log stores personal data (email addresses, message contents). Make sure this is compatible with your privacy policy.","captcha-for-contact-form-7")})]}),a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a("div",{children:[e(i,{className:"text-xs",children:t("Enable Mail Logging","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:t("Log form messages","captcha-for-contact-form-7")})]}),e(d,{checked:s(o.protection_mail_log_enable),onCheckedChange:c=>r("protection_mail_log_enable",m(c))})]}),s(o.protection_mail_log_enable)&&a(N,{children:[a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a("div",{children:[e(i,{className:"text-xs",children:t("Log sent mails","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:t("Log successfully sent form submissions","captcha-for-contact-form-7")})]}),e(d,{checked:s(o.protection_mail_log_sent),onCheckedChange:c=>r("protection_mail_log_sent",m(c))})]}),a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a("div",{children:[e(i,{className:"text-xs",children:t("Log blocked mails","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:t("Log submissions blocked as spam","captcha-for-contact-form-7")})]}),e(d,{checked:s(o.protection_mail_log_blocked),onCheckedChange:c=>r("protection_mail_log_blocked",m(c))})]}),e(p,{label:t("Retention","captcha-for-contact-form-7"),description:t("How many days mail logs are kept before automatic deletion","captcha-for-contact-form-7"),value:l("protection_mail_log_retention"),onChange:c=>r("protection_mail_log_retention",c),suffix:t("Days","captcha-for-contact-form-7"),min:1,max:365})]})]}),a(g,{icon:W,title:t("Logging & Tracking","captcha-for-contact-form-7"),description:t("Block Log and Audit Log Settings","captcha-for-contact-form-7"),children:[a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a("div",{children:[e(i,{className:"text-xs",children:t("Detailed Tracking","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:t("Block log with IP, user agent, reason","captcha-for-contact-form-7")})]}),e(d,{checked:s(o.protection_detailed_tracking),onCheckedChange:c=>r("protection_detailed_tracking",m(c))})]}),s(o.protection_detailed_tracking)&&a("div",{className:"grid gap-4 sm:grid-cols-2",children:[e(p,{label:t("Block Log Retention","captcha-for-contact-form-7"),description:t("Days to keep records of blocked submissions","captcha-for-contact-form-7"),value:l("protection_detailed_tracking_retention"),onChange:c=>r("protection_detailed_tracking_retention",c),suffix:t("Days","captcha-for-contact-form-7"),min:1,max:365}),e(p,{label:t("Audit Log Retention","captcha-for-contact-form-7"),description:t("Days to keep system event logs (settings changes, errors, etc.)","captcha-for-contact-form-7"),value:l("protection_audit_log_retention"),onChange:c=>r("protection_audit_log_retention",c),suffix:t("Days","captcha-for-contact-form-7"),min:1,max:365})]}),a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a("div",{children:[e(i,{className:"text-xs",children:t("Plaintext Logging","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:t("Log IPs unencrypted (default: SHA-256 hash)","captcha-for-contact-form-7")})]}),e(d,{checked:s(o.protection_log_plaintext),onCheckedChange:c=>r("protection_log_plaintext",m(c))})]}),a("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[a("div",{children:[e(i,{className:"text-xs",children:t("Telemetry","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:t("Send anonymous usage data to SilentShield","captcha-for-contact-form-7")})]}),e(d,{checked:s(o.telemetry),onCheckedChange:c=>r("telemetry",m(c))})]})]})]})}export{le as default};
