2 lines
856 B
JavaScript
2 lines
856 B
JavaScript
class w{static evaluate(c,s){var l,h;console.log("[BoomCast][Gate] Evaluating browser classification.");const n=new Set((s.whitelist||[]).map(e=>e.toLowerCase())),r=new Set((s.privacy_sensitive_speech||[]).map(e=>e.toLowerCase())),m=Number(((l=s.thresholds)==null?void 0:l.relevance)??.5),i=Number(((h=s.thresholds)==null?void 0:h.speech)??.5),t=c.filter(e=>n.has(e.class.toLowerCase())&&e.score>=m),o=c.some(e=>r.has(e.class.toLowerCase())&&e.score>=i);console.log("[BoomCast][Gate] Relevant whitelist matches:",t),console.log("[BoomCast][Gate] Speech detected:",o);const a=t.length?"whitelist_match":o?"speech_only":"no_match";return console.log(`[BoomCast][Gate] Decision: ${a.toUpperCase()}`),a!=="whitelist_match"&&console.log("[BoomCast][Gate] Automatic upload suppressed."),{result:a,speechDetected:o,matches:t}}}export{w as BrowserSubmissionGate};
|