/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@fingerprintjs/botd@2.0.0/dist/botd.cjs.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var version="2.0.0";const BotKind={Awesomium:"awesomium",Cef:"cef",CefSharp:"cefsharp",CoachJS:"coachjs",Electron:"electron",FMiner:"fminer",Geb:"geb",NightmareJS:"nightmarejs",Phantomas:"phantomas",PhantomJS:"phantomjs",Rhino:"rhino",Selenium:"selenium",Sequentum:"sequentum",SlimerJS:"slimerjs",WebDriverIO:"webdriverio",WebDriver:"webdriver",HeadlessChrome:"headless_chrome",Unknown:"unknown"};class BotdError extends Error{constructor(e,t){super(t),this.state=e,this.name="BotdError",Object.setPrototypeOf(this,BotdError.prototype)}}function detect(e,t){const n={};let o={bot:!1};for(const r in t){const i=(0,t[r])(e);let s={bot:!1};"string"==typeof i?s={bot:!0,botKind:i}:i&&(s={bot:!0,botKind:BotKind.Unknown}),n[r]=s,s.bot&&(o=s)}return[n,o]}async function collect(e){const t={},n=Object.keys(e);return await Promise.all(n.map((async n=>{const o=e[n];try{t[n]={value:await o(),state:0}}catch(e){t[n]=e instanceof BotdError?{state:e.state,error:`${e.name}: ${e.message}`}:{state:-3,error:e instanceof Error?`${e.name}: ${e.message}`:String(e)}}}))),t}function detectAppVersion({appVersion:e}){return 0===e.state&&(/headless/i.test(e.value)?BotKind.HeadlessChrome:/electron/i.test(e.value)?BotKind.Electron:/slimerjs/i.test(e.value)?BotKind.SlimerJS:void 0)}function arrayIncludes(e,t){return-1!==e.indexOf(t)}function strIncludes(e,t){return-1!==e.indexOf(t)}function arrayFind(e,t){if("find"in e)return e.find(t);for(let n=0;n<e.length;n++)if(t(e[n],n,e))return e[n]}function getObjectProps(e){return Object.getOwnPropertyNames(e)}function includes(e,...t){for(const n of t)if("string"==typeof n){if(arrayIncludes(e,n))return!0}else{if(null!=arrayFind(e,(e=>n.test(e))))return!0}return!1}function countTruthy(e){return e.reduce(((e,t)=>e+(t?1:0)),0)}function detectDocumentAttributes({documentElementKeys:e}){return 0===e.state&&(includes(e.value,"selenium","webdriver","driver")?BotKind.Selenium:void 0)}function detectErrorTrace({errorTrace:e}){return 0===e.state&&(/PhantomJS/i.test(e.value)?BotKind.PhantomJS:void 0)}function detectEvalLengthInconsistency({evalLength:e,browserKind:t,browserEngineKind:n}){if(0!==e.state||0!==t.state||0!==n.state)return;const o=e.value;return"unknown"!==n.value&&(37===o&&!arrayIncludes(["webkit","gecko"],n.value)||39===o&&!arrayIncludes(["internet_explorer"],t.value)||33===o&&!arrayIncludes(["chromium"],n.value))}function detectFunctionBind({functionBind:e}){if(-2===e.state)return BotKind.PhantomJS}function detectLanguagesLengthInconsistency({languages:e}){if(0===e.state&&0===e.value.length)return BotKind.HeadlessChrome}function detectMimeTypesConsistent({mimeTypesConsistent:e}){if(0===e.state&&!e.value)return BotKind.Unknown}function detectNotificationPermissions({notificationPermissions:e,browserKind:t}){return 0===t.state&&"chrome"===t.value&&(0===e.state&&e.value?BotKind.HeadlessChrome:void 0)}function detectPluginsArray({pluginsArray:e}){if(0===e.state&&!e.value)return BotKind.HeadlessChrome}function detectPluginsLengthInconsistency({pluginsLength:e,android:t,browserKind:n,browserEngineKind:o}){if(0===e.state&&0===t.state&&0===n.state&&0===o.state&&"chrome"===n.value&&!t.value&&"chromium"===o.value)return 0===e.value?BotKind.HeadlessChrome:void 0}function detectProcess({process:e}){var t;return 0===e.state&&("renderer"===e.value.type||null!=(null===(t=e.value.versions)||void 0===t?void 0:t.electron)?BotKind.Electron:void 0)}function detectProductSub({productSub:e,browserKind:t}){return 0===e.state&&0===t.state&&("chrome"!==t.value&&"safari"!==t.value&&"opera"!==t.value&&"wechat"!==t.value||"20030107"===e.value?void 0:BotKind.Unknown)}function detectUserAgent({userAgent:e}){return 0===e.state&&(/PhantomJS/i.test(e.value)?BotKind.PhantomJS:/Headless/i.test(e.value)?BotKind.HeadlessChrome:/Electron/i.test(e.value)?BotKind.Electron:/slimerjs/i.test(e.value)?BotKind.SlimerJS:void 0)}function detectWebDriver({webDriver:e}){if(0===e.state&&e.value)return BotKind.HeadlessChrome}function detectWebGL({webGL:e}){if(0===e.state){const{vendor:t,renderer:n}=e.value;if("Brian Paul"==t&&"Mesa OffScreen"==n)return BotKind.HeadlessChrome}}function detectWindowExternal({windowExternal:e}){return 0===e.state&&(/Sequentum/i.test(e.value)?BotKind.Sequentum:void 0)}function detectWindowSize({windowSize:e,documentFocus:t}){if(0!==e.state||0!==t.state)return!1;const{outerWidth:n,outerHeight:o}=e.value;return t.value&&0===n&&0===o?BotKind.HeadlessChrome:void 0}function detectDistinctiveProperties({distinctiveProps:e}){if(0!==e.state)return!1;const t=e.value;let n;for(n in t)if(t[n])return n}const detectors={detectAppVersion:detectAppVersion,detectDocumentAttributes:detectDocumentAttributes,detectErrorTrace:detectErrorTrace,detectEvalLengthInconsistency:detectEvalLengthInconsistency,detectFunctionBind:detectFunctionBind,detectLanguagesLengthInconsistency:detectLanguagesLengthInconsistency,detectNotificationPermissions:detectNotificationPermissions,detectPluginsArray:detectPluginsArray,detectPluginsLengthInconsistency:detectPluginsLengthInconsistency,detectProcess:detectProcess,detectUserAgent:detectUserAgent,detectWebDriver:detectWebDriver,detectWebGL:detectWebGL,detectWindowExternal:detectWindowExternal,detectWindowSize:detectWindowSize,detectMimeTypesConsistent:detectMimeTypesConsistent,detectProductSub:detectProductSub,detectDistinctiveProperties:detectDistinctiveProperties};function getAppVersion(){const e=navigator.appVersion;if(null==e)throw new BotdError(-1,"navigator.appVersion is undefined");return e}function getDocumentElementKeys(){if(void 0===document.documentElement)throw new BotdError(-1,"document.documentElement is undefined");const{documentElement:e}=document;if("function"!=typeof e.getAttributeNames)throw new BotdError(-2,"document.documentElement.getAttributeNames is not a function");return e.getAttributeNames()}function getErrorTrace(){try{null[0]()}catch(e){if(e instanceof Error&&null!=e.stack)return e.stack.toString()}throw new BotdError(-3,"errorTrace signal unexpected behaviour")}function getEvalLength(){return eval.toString().length}function getFunctionBind(){if(void 0===Function.prototype.bind)throw new BotdError(-2,"Function.prototype.bind is undefined");return Function.prototype.bind.toString()}function getBrowserEngineKind(){var e,t;const n=window,o=navigator;return countTruthy(["webkitPersistentStorage"in o,"webkitTemporaryStorage"in o,0===o.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in n,"BatteryManager"in n,"webkitMediaStream"in n,"webkitSpeechGrammar"in n])>=5?"chromium":countTruthy(["ApplePayError"in n,"CSSPrimitiveValue"in n,"Counter"in n,0===o.vendor.indexOf("Apple"),"getStorageUpdates"in o,"WebKitMediaKeys"in n])>=4?"webkit":countTruthy(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4?"gecko":"unknown"}function getBrowserKind(){var e;const t=null===(e=navigator.userAgent)||void 0===e?void 0:e.toLowerCase();return strIncludes(t,"edg/")?"edge":strIncludes(t,"trident")||strIncludes(t,"msie")?"internet_explorer":strIncludes(t,"wechat")?"wechat":strIncludes(t,"firefox")?"firefox":strIncludes(t,"opera")||strIncludes(t,"opr")?"opera":strIncludes(t,"chrome")?"chrome":strIncludes(t,"safari")?"safari":"unknown"}function isAndroid(){const e=getBrowserEngineKind(),t="gecko"===e,n=window,o=navigator,r="connection";return"chromium"===e?countTruthy([!("SharedWorker"in n),o[r]&&"ontypechange"in o[r],!("sinkId"in new Audio)])>=2:!!t&&countTruthy(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function getDocumentFocus(){return void 0!==document.hasFocus&&document.hasFocus()}function isChromium86OrNewer(){const e=window;return countTruthy([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function getLanguages(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&t.push([n]),Array.isArray(e.languages)){"chromium"===getBrowserEngineKind()&&isChromium86OrNewer()||t.push(e.languages)}else if("string"==typeof e.languages){const n=e.languages;n&&t.push(n.split(","))}return t}function areMimeTypesConsistent(){if(void 0===navigator.mimeTypes)throw new BotdError(-1,"navigator.mimeTypes is undefined");const{mimeTypes:e}=navigator;let t=Object.getPrototypeOf(e)===MimeTypeArray.prototype;for(let n=0;n<e.length;n++)t&&(t=Object.getPrototypeOf(e[n])===MimeType.prototype);return t}async function getNotificationPermissions(){if(void 0===window.Notification)throw new BotdError(-1,"window.Notification is undefined");if(void 0===navigator.permissions)throw new BotdError(-1,"navigator.permissions is undefined");const{permissions:e}=navigator;if("function"!=typeof e.query)throw new BotdError(-2,"navigator.permissions.query is not a function");try{const t=await e.query({name:"notifications"});return"denied"===window.Notification.permission&&"prompt"===t.state}catch(e){throw new BotdError(-3,"notificationPermissions signal unexpected behaviour")}}function getPluginsArray(){if(void 0===navigator.plugins)throw new BotdError(-1,"navigator.plugins is undefined");if(void 0===window.PluginArray)throw new BotdError(-1,"window.PluginArray is undefined");return navigator.plugins instanceof PluginArray}function getPluginsLength(){if(void 0===navigator.plugins)throw new BotdError(-1,"navigator.plugins is undefined");if(void 0===navigator.plugins.length)throw new BotdError(-3,"navigator.plugins.length is undefined");return navigator.plugins.length}function getProcess(){const{process:e}=window,t="window.process is";if(void 0===e)throw new BotdError(-1,`${t} undefined`);if(e&&"object"!=typeof e)throw new BotdError(-3,`${t} not an object`);return e}function getProductSub(){const{productSub:e}=navigator;if(void 0===e)throw new BotdError(-1,"navigator.productSub is undefined");return e}function getRTT(){if(void 0===navigator.connection)throw new BotdError(-1,"navigator.connection is undefined");if(void 0===navigator.connection.rtt)throw new BotdError(-1,"navigator.connection.rtt is undefined");return navigator.connection.rtt}function getUserAgent(){return navigator.userAgent}function getWebDriver(){if(null==navigator.webdriver)throw new BotdError(-1,"navigator.webdriver is undefined");return navigator.webdriver}function getWebGL(){const e=document.createElement("canvas");if("function"!=typeof e.getContext)throw new BotdError(-2,"HTMLCanvasElement.getContext is not a function");const t=e.getContext("webgl");if(null===t)throw new BotdError(-4,"WebGLRenderingContext is null");if("function"!=typeof t.getParameter)throw new BotdError(-2,"WebGLRenderingContext.getParameter is not a function");return{vendor:t.getParameter(t.VENDOR),renderer:t.getParameter(t.RENDERER)}}function getWindowExternal(){if(void 0===window.external)throw new BotdError(-1,"window.external is undefined");const{external:e}=window;if("function"!=typeof e.toString)throw new BotdError(-2,"window.external.toString is not a function");return e.toString()}function getWindowSize(){return{outerWidth:window.outerWidth,outerHeight:window.outerHeight,innerWidth:window.innerWidth,innerHeight:window.innerHeight}}function checkDistinctiveProperties(){const e={[BotKind.Awesomium]:{window:["awesomium"]},[BotKind.Cef]:{window:["RunPerfTest"]},[BotKind.CefSharp]:{window:["CefSharp"]},[BotKind.CoachJS]:{window:["emit"]},[BotKind.FMiner]:{window:["fmget_targets"]},[BotKind.Geb]:{window:["geb"]},[BotKind.NightmareJS]:{window:["__nightmare","nightmare"]},[BotKind.Phantomas]:{window:["__phantomas"]},[BotKind.PhantomJS]:{window:["callPhantom","_phantom"]},[BotKind.Rhino]:{window:["spawn"]},[BotKind.Selenium]:{window:["_Selenium_IDE_Recorder","_selenium","calledSelenium",/^([a-z]){3}_.*_(Array|Promise|Symbol)$/],document:["__selenium_evaluate","selenium-evaluate","__selenium_unwrapped"]},[BotKind.WebDriverIO]:{window:["wdioElectron"]},[BotKind.WebDriver]:{window:["webdriver","__webdriverFunc","__lastWatirAlert","__lastWatirConfirm","__lastWatirPrompt","_WEBDRIVER_ELEM_CACHE","ChromeDriverw"],document:["__webdriver_script_fn","__driver_evaluate","__webdriver_evaluate","__fxdriver_evaluate","__driver_unwrapped","__webdriver_unwrapped","__fxdriver_unwrapped","__webdriver_script_fn","__webdriver_script_func","__webdriver_script_function","$cdc_asdjflasutopfhvcZLmcf","$cdc_asdjflasutopfhvcZLmcfl_","$chrome_asyncScriptInfo","__$webdriverAsyncExecutor"]},[BotKind.HeadlessChrome]:{window:["domAutomation","domAutomationController"]}};let t;const n={},o=getObjectProps(window);let r=[];for(t in void 0!==window.document&&(r=getObjectProps(window.document)),e){const i=e[t];if(void 0!==i){const e=void 0!==i.window&&includes(o,...i.window),s=!(void 0===i.document||!r.length)&&includes(r,...i.document);n[t]=e||s}}return n}const sources={android:isAndroid,browserKind:getBrowserKind,browserEngineKind:getBrowserEngineKind,documentFocus:getDocumentFocus,userAgent:getUserAgent,appVersion:getAppVersion,rtt:getRTT,windowSize:getWindowSize,pluginsLength:getPluginsLength,pluginsArray:getPluginsArray,errorTrace:getErrorTrace,productSub:getProductSub,windowExternal:getWindowExternal,mimeTypesConsistent:areMimeTypesConsistent,evalLength:getEvalLength,webGL:getWebGL,webDriver:getWebDriver,languages:getLanguages,notificationPermissions:getNotificationPermissions,documentElementKeys:getDocumentElementKeys,functionBind:getFunctionBind,process:getProcess,distinctiveProps:checkDistinctiveProperties};class BotDetector{constructor(){this.components=void 0,this.detections=void 0}getComponents(){return this.components}getDetections(){return this.detections}detect(){if(void 0===this.components)throw new Error("BotDetector.detect can't be called before BotDetector.collect");const[e,t]=detect(this.components,detectors);return this.detections=e,t}async collect(){return this.components=await collect(sources),this.components}}function monitor(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/botd/v${version}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}async function load({monitoring:e=!0}={}){e&&monitor();const t=new BotDetector;return await t.collect(),t}var index={load:load};exports.BotKind=BotKind,exports.BotdError=BotdError,exports.collect=collect,exports.default=index,exports.detect=detect,exports.detectors=detectors,exports.load=load,exports.sources=sources;
//# sourceMappingURL=/sm/17a3e6506f6de6d897425d5045dcf8f6ca77b6214c48278ae9201c42361d96b1.map