import{k as R,p as t,j as e}from"./silentshield-vendor-lib-BOYiOmBi.js";import{c as u,u as J,_ as a,C as n,i as l,k as i,V as b,f as m,m as T,B as W,s as z,Z as v,h as k,l as C,I as X,y as Q,n as Y,w as P}from"./silentshield-admin.js";import{L as I,S as D}from"./silentshield-label-CMPShFf3.js";import{u as ee,a as ae,A as E,P as te}from"./silentshield-useApiManagement-CVAxTEx4.js";import{T as re,a as ce,b as F,c as f,d as oe,e as V}from"./silentshield-table-D7OkaxR3.js";import{E as se}from"./silentshield-eye-C3fJ4UpD.js";import{C as U}from"./silentshield-circle-check-big-NiZTsOJS.js";import{C as $}from"./silentshield-circle-x-GQt3emFf.js";import{I as ne}from"./silentshield-info-BOcn7Nfl.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 le=u("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @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 ie=u("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
 * @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 de=u("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
 * @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 A=u("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);function p(){const s=window.silentShieldConfig,x=encodeURIComponent((s==null?void 0:s.siteUrl)??window.location.origin),o=encodeURIComponent((s==null?void 0:s.version)??"unknown");return`https://www.silentshield.io/en/free?domain=${x}&source=wp-plugin&source_version=${o}`}const me=[{feature:a("Honeypot Protection","captcha-for-contact-form-7"),local:!0,free:!0,pro:!0},{feature:a("Math Captcha","captcha-for-contact-form-7"),local:!0,free:!0,pro:!0},{feature:a("Image Captcha","captcha-for-contact-form-7"),local:!0,free:!0,pro:!0},{feature:a("Timer Protection","captcha-for-contact-form-7"),local:!0,free:!0,pro:!0},{feature:a("JS/Browser Detection","captcha-for-contact-form-7"),local:!0,free:!0,pro:!0},{feature:a("IP-based Rate Limiting","captcha-for-contact-form-7"),local:!0,free:!0,pro:!0},{feature:a("Content Rules","captcha-for-contact-form-7"),local:!0,free:!0,pro:!0},{feature:a("Whitelist","captcha-for-contact-form-7")+"/"+a("IP Blacklist","captcha-for-contact-form-7"),local:!0,free:!0,pro:!0},{feature:a("Audit Log","captcha-for-contact-form-7"),local:!0,free:!0,pro:!0},{feature:a("AI Behavior Analysis","captcha-for-contact-form-7"),local:!1,free:a("Limited","captcha-for-contact-form-7"),pro:!0},{feature:a("Browser Fingerprinting","captcha-for-contact-form-7"),local:!1,free:!0,pro:!0},{feature:a("Branding removed","captcha-for-contact-form-7"),local:!1,free:!1,pro:!0},{feature:a("Adaptive Challenges","captcha-for-contact-form-7"),local:!1,free:!1,pro:!0},{feature:a("Score Breakdown","captcha-for-contact-form-7"),local:!1,free:!1,pro:!0},{feature:a("Shadow Mode","captcha-for-contact-form-7"),local:!1,free:!1,pro:!0},{feature:a("API Requests","captcha-for-contact-form-7"),local:"—",free:a("Limited","captcha-for-contact-form-7"),pro:a("Unlimited","captcha-for-contact-form-7")},{feature:a("Bot Detection Rate","captcha-for-contact-form-7"),local:"~85%",free:"~95%",pro:"~99%"}];function ke(){var M,j,L;const[s,x]=R(!1),{settings:o,updateBeta:S,updateGlobal:H}=J(),{data:c,isLoading:K}=ee(),g=ae(),[h,N]=R("idle"),d=((M=o==null?void 0:o.beta)==null?void 0:M.beta_captcha_api_key)??"",q=Number((j=o==null?void 0:o.beta)==null?void 0:j.beta_captcha_enable)===1,Z=Number((L=o==null?void 0:o.global)==null?void 0:L.protection_api_shadow_mode)===1,O=async()=>{if(d)try{const r=await g.mutateAsync(d);N(r.valid?"valid":"invalid"),r.valid?P.success(a("API key valid","captcha-for-contact-form-7")):P.error(r.message||a("API key invalid","captcha-for-contact-form-7"))}catch{N("invalid"),P.error(a("Validation failed","captcha-for-contact-form-7"))}},y=14,_=(c==null?void 0:c.days_remaining)??0,G=c!=null&&c.active?Math.round((y-_)/y*100):0;return t("div",{className:"space-y-6",children:[t("div",{children:[e("h1",{className:"text-2xl font-bold tracking-tight",children:"API / SilentShield"}),e("p",{className:"text-muted-foreground",children:a("AI-powered spam protection — start for free","captcha-for-contact-form-7")})]}),t("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e(n,{className:"group hover:border-primary/40 transition-colors",children:t(l,{className:"flex items-center gap-4 p-4",children:[e("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 group-hover:bg-primary/20 transition-colors",children:e(ie,{className:"h-5 w-5 text-primary"})}),t("div",{className:"flex-1 min-w-0",children:[e("p",{className:"text-sm font-medium",children:a("SilentShield Dashboard","captcha-for-contact-form-7")}),e("p",{className:"text-xs text-muted-foreground",children:a("Manage account, API keys & statistics","captcha-for-contact-form-7")})]}),e(i,{variant:"outline",size:"sm",asChild:!0,children:t("a",{href:"https://silentshield.io/login",target:"_blank",rel:"noopener noreferrer",className:"gap-1.5",children:["Login ",e(b,{className:"h-3 w-3"})]})})]})}),e(n,{className:"group hover:border-primary/40 transition-colors",children:t(l,{className:"flex items-center gap-4 p-4",children:[e("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 group-hover:bg-blue-500/20 transition-colors",children:e(de,{className:"h-5 w-5 text-blue-500"})}),t("div",{className:"flex-1 min-w-0",children:[e("p",{className:"text-sm font-medium",children:"SilentChat"}),e("p",{className:"text-xs text-muted-foreground",children:a("AI chat widget for your website","captcha-for-contact-form-7")})]}),e("span",{className:"inline-flex items-center rounded-md bg-muted px-2.5 py-0.5 text-xs font-medium text-muted-foreground",children:"Coming Soon"})]})})]}),!d&&!(c!=null&&c.active)&&e(n,{className:"border-primary/30 bg-gradient-to-r from-primary/5 to-transparent",children:t(l,{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4 p-5",children:[e("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:e(A,{className:"h-5 w-5 text-primary"})}),t("div",{className:"flex-1 min-w-0",children:[e("p",{className:"text-sm font-semibold",children:a("Start for free","captcha-for-contact-form-7")}),e("p",{className:"text-xs text-muted-foreground mt-0.5",children:a("Create a free SilentShield account with AI behavior analysis and browser fingerprinting. Includes branding — no credit card required.","captcha-for-contact-form-7")})]}),e(i,{size:"sm",asChild:!0,className:"shrink-0 gap-1.5",children:t("a",{href:p(),target:"_blank",rel:"noopener noreferrer",children:[a("Start for free","captcha-for-contact-form-7")," ",e(E,{className:"h-3 w-3"})]})})]})}),K?t(n,{className:"border-primary/30",children:[e(m,{className:"pb-3",children:e(T,{className:"h-6 w-48"})}),e(l,{children:e(T,{className:"h-2 w-full"})})]}):c!=null&&c.active?t(n,{className:"border-primary/30",children:[e(m,{className:"pb-3",children:t("div",{className:"flex items-center justify-between",children:[t("div",{className:"flex items-center gap-2",children:[e(W,{className:"bg-primary text-primary-foreground",children:a("Trial active","captcha-for-contact-form-7")}),e("span",{className:"text-xs text-muted-foreground",children:z(a("%1$d of %2$d days remaining","captcha-for-contact-form-7"),_,y)})]}),e(i,{size:"sm",asChild:!0,children:t("a",{href:p(),target:"_blank",rel:"noopener noreferrer",className:"gap-1.5",children:[a("Switch to Free Plan","captcha-for-contact-form-7")," ",e(E,{className:"h-3 w-3"})]})})]})}),t(l,{className:"space-y-2",children:[e(te,{value:G,className:"h-2"}),c.expires_at&&e("p",{className:"text-xs text-muted-foreground",children:z(a("Expiration date: %s","captcha-for-contact-form-7"),new Date(c.expires_at).toLocaleDateString())})]})]}):null,t(n,{children:[e(m,{children:t("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(v,{className:"h-4 w-4 text-primary"})}),t("div",{children:[e(k,{className:"text-sm",children:a("API Connection","captcha-for-contact-form-7")}),e(C,{className:"text-xs",children:a("Connect your SilentShield account","captcha-for-contact-form-7")})]})]})}),t(l,{className:"space-y-4",children:[t("div",{className:"space-y-2",children:[e(I,{className:"text-xs",children:a("API Key","captcha-for-contact-form-7")}),t("div",{className:"flex gap-2",children:[t("div",{className:"relative flex-1",children:[e(X,{type:s?"text":"password",value:d,onChange:r=>{S("beta_captcha_api_key",r.target.value),N("idle")},placeholder:"ss_live_...",className:"h-9 pr-10 font-mono text-xs"}),e(i,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9",onClick:()=>x(!s),children:s?e(le,{className:"h-3 w-3"}):e(se,{className:"h-3 w-3"})})]}),t(i,{size:"sm",onClick:O,disabled:!d||g.isPending,children:[g.isPending?e(Q,{className:"h-3 w-3 animate-spin mr-1"}):null,a("Validate","captcha-for-contact-form-7")]})]}),!d&&t("p",{className:"text-[10px] text-muted-foreground",children:[a("No API key yet?","captcha-for-contact-form-7")," ",e("a",{href:p(),target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:a("Register for free","captcha-for-contact-form-7")})]})]}),h!=="idle"&&t("div",{className:`flex items-center gap-2 rounded-lg p-3 ${h==="valid"?"bg-success/10 text-success":"bg-destructive/10 text-destructive"}`,children:[h==="valid"?e(U,{className:"h-4 w-4"}):e($,{className:"h-4 w-4"}),e("span",{className:"text-xs font-medium",children:h==="valid"?a("API key valid – connection established","captcha-for-contact-form-7"):a("API key invalid","captcha-for-contact-form-7")})]})]})]}),t(n,{children:[e(m,{children:t("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(Y,{className:"h-4 w-4 text-primary"})}),t("div",{children:[e(k,{className:"text-sm",children:a("API Settings","captcha-for-contact-form-7")}),e(C,{className:"text-xs",children:a("Control API integration behavior","captcha-for-contact-form-7")})]})]})}),t(l,{className:"space-y-3",children:[t("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[t("div",{children:[e(I,{className:"text-xs font-medium",children:a("Activate API","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:a("Enable API checks for all forms","captcha-for-contact-form-7")})]}),e(D,{checked:q,onCheckedChange:r=>S("beta_captcha_enable",r?1:0)})]}),t("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[t("div",{children:[e(I,{className:"text-xs font-medium",children:a("Shadow Mode","captcha-for-contact-form-7")}),e("p",{className:"text-[10px] text-muted-foreground",children:a("API runs in parallel but does not block","captcha-for-contact-form-7")})]}),e(D,{checked:Z,onCheckedChange:r=>H("protection_api_shadow_mode",r?1:0)})]}),t("div",{className:"flex items-start gap-2 rounded-lg bg-accent p-3",children:[e(ne,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),e("p",{className:"text-xs text-muted-foreground",children:a("Compares API results with local results without affecting visitors","captcha-for-contact-form-7")})]})]})]}),t(n,{children:[t(m,{children:[e(k,{className:"text-base",children:a("Feature Comparison","captcha-for-contact-form-7")}),e(C,{className:"text-xs",children:a("Plugin (local) vs. Free Plan vs. Pro","captcha-for-contact-form-7")})]}),t(l,{children:[t(re,{children:[e(ce,{children:t(F,{children:[e(f,{className:"text-xs",children:a("Feature","captcha-for-contact-form-7")}),e(f,{className:"text-xs text-center",children:a("Plugin","captcha-for-contact-form-7")}),e(f,{className:"text-xs text-center",children:t("span",{className:"flex items-center justify-center gap-1",children:["Free ",e(A,{className:"h-3 w-3 text-primary"})]})}),e(f,{className:"text-xs text-center",children:t("span",{className:"flex items-center justify-center gap-1",children:["Pro ",e(v,{className:"h-3 w-3 text-amber-500"})]})})]})}),e(oe,{children:me.map(r=>t(F,{children:[e(V,{className:"text-xs font-medium",children:r.feature}),[r.local,r.free,r.pro].map((w,B)=>e(V,{className:"text-center",children:typeof w=="boolean"?w?e(U,{className:"h-4 w-4 text-success mx-auto"}):e($,{className:"h-4 w-4 text-muted-foreground/30 mx-auto"}):e("span",{className:`text-xs ${B===2?"font-semibold text-amber-600":""}`,children:w})},B))]},r.feature))})]}),t("div",{className:"mt-4 flex flex-col sm:flex-row justify-center gap-3",children:[e(i,{variant:"outline",className:"gap-2",asChild:!0,children:t("a",{href:p(),target:"_blank",rel:"noopener noreferrer",children:[e(A,{className:"h-4 w-4"}),a("Start for free","captcha-for-contact-form-7"),e(b,{className:"h-3 w-3"})]})}),e(i,{className:"gap-2",asChild:!0,children:t("a",{href:"https://www.silentshield.io/en/pricing?source=wp-plugin",target:"_blank",rel:"noopener noreferrer",children:[e(v,{className:"h-4 w-4"}),a("View Pro Plans","captcha-for-contact-form-7"),e(b,{className:"h-3 w-3"})]})})]})]})]})]})}export{ke as default};
