UNPKG

@newgenesis/vision

Version:

Professional bot and AI detection library with behavioral analysis, fingerprinting, and adaptive challenges

3 lines 997 B
'use strict';/** @license MIT - Sentinel by NewGenesis (https://newgenesis.ai) */ var o=class{constructor(){this.config={theme:"glass",autoDetect:true};this.listeners=new Set;}getConfig(){return {...this.config}}setTheme(e){this.config.theme=e,this.config.autoDetect=false,this.notifyListeners();}setAutoDetect(e){this.config.autoDetect=e,this.notifyListeners();}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notifyListeners(){this.listeners.forEach(e=>e(this.getConfig()));}getEffectiveTheme(){return this.config.autoDetect?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches&&this.config.theme==="glass"?"glass":this.config.theme:this.config.theme}},i=new o;typeof window<"u"&&(window.Vision={get theme(){return i.getConfig().theme},set theme(t){i.setTheme(t);},get autoDetect(){return i.getConfig().autoDetect},set autoDetect(t){i.setAutoDetect(t);}});exports.visionConfig=i;//# sourceMappingURL=config.js.map //# sourceMappingURL=config.js.map