(function(){async function A(){try{let w=function(s){return s.reduce(function(c,e){return c+(e?1:0)},0)},l=function(s,c){return s.indexOf(c)!==-1},h=function(s){return Object.getOwnPropertyNames(s)},m=function(s,...c){for(const e of c)if(typeof e=="string"){if(l(s,e))return!0}else if(s.find(i=>e.test(i))!=null)return!0;return!1},S=function(){var e;const s=window,c=navigator;return w(["webkitPersistentStorage"in c,"webkitTemporaryStorage"in c,c.vendor.indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in s,"BatteryManager"in s,"webkitMediaStream"in s,"webkitSpeechGrammar"in s])>=5?u.Chromium:w(["ApplePayError"in s,"CSSPrimitiveValue"in s,"Counter"in s,c.vendor.indexOf("Apple")===0,"getStorageUpdates"in c,"WebKitMediaKeys"in s])>=4?u.Webkit:w(["buildID"in navigator,"MozAppearance"in(((e=document.documentElement)==null?void 0:e.style)??{}),"onmozfullscreenchange"in s,"mozInnerScreenX"in s,"CSSMozDocumentRule"in s,"CanvasCaptureMediaStream"in s])>=4?u.Gecko:u.Unknown};var E=w,D=l,g=h,y=m,k=S;const n={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"},f={Unknown:"unknown",Chrome:"chrome",Firefox:"firefox",Opera:"opera",Safari:"safari",WeChat:"wechat",Edge:"edge"},u={Chromium:"chromium",Gecko:"gecko",Webkit:"webkit",Unknown:"unknown"};class a extends Error{constructor(c,e){super(e),this.state=c,this.name="BotdError",Object.setPrototypeOf(this,a.prototype)}}class W{constructor(){this.components=void 0,this.detections=void 0}initSource(){return{browserEngineKind:S,android:function(){const e=S(),t=e===u.Chromium,i=e===u.Gecko,o=window,r=navigator;return t?w([!("SharedWorker"in o),r.connection&&"ontypechange"in r.connection,!("sinkId"in new Audio)])>=2:i?w(["onorientationchange"in o,"orientation"in o,/android/i.test(r.appVersion)])>=2:!1},browserKind:function(){var t;const e=(t=navigator.userAgent)==null?void 0:t.toLowerCase();return l(e,"edg/")?f.Edge:l(e,"firefox")?f.Firefox:l(e,"opera")||l(e,"opr")?f.Opera:l(e,"chrome")?f.Chrome:/iphone|ipad|ipod/.test(e)||l(e,"safari")?f.Safari:f.Unknown},webview:function(){return"web"},documentFocus:function(){return document.hasFocus!==void 0&&document.hasFocus()},userAgent:function(){return navigator.userAgent},appVersion:function(){var e=navigator.appVersion;if(e==null)throw new a(-1,"navigator.appVersion is undefined");return e},connection:function(){if(navigator.connection){const{downlink:e,effectiveType:t,rtt:i}=navigator.connection||{};return{downlink:e,effectiveType:t,rtt:i}}return null},screen:function(){return{availHeight:window.screen.availHeight,availWidth:window.screen.availWidth,availLeft:window.screen.availLeft,availTop:window.screen.availTop,height:window.screen.height,width:window.screen.width,colorDepth:window.screen.colorDepth}},windowSize:function(){return{outerWidth:window.outerWidth,outerHeight:window.outerHeight,innerWidth:window.innerWidth,innerHeight:window.innerHeight}},userAgentData:async function(){try{return"userAgentData"in navigator?await navigator.userAgentData.getHighEntropyValues(["architecture","model","platformVersion","fullVersionList"]):!1}catch{throw new a(-1,"userAgentData is undefined")}},hardwareConcurrency:async function(){return navigator.hardwareConcurrency||0},deviceMemory:async function(){return navigator.deviceMemory||0},maxTouchPoints:async function(){return navigator.maxTouchPoints||0},devicePixelRatio:async function(){return window.devicePixelRatio||null},errorTrace:function(){try{null[0]()}catch(e){if(e instanceof Error&&e.stack!=null)return e.stack.toString()}throw new a(-3,"errorTrace signal unexpected behaviour")},windowExternal:function(){if(window.external===void 0)throw new a(-1,"window.external is undefined");var e=window.external;if(typeof e.toString!="function")throw new a(-2,"window.external.toString is not a function");return e.toString()},evalLength:function(){return eval.toString().length},webGL:function(){var e=document.createElement("canvas");if(typeof e.getContext!="function")throw new a(-2,"HTMLCanvasElement.getContext is not a function");var t=e.getContext("webgl");if(t===null)throw new a(-4,"WebGLRenderingContext is null");if(typeof t.getParameter!="function")throw new a(-2,"WebGLRenderingContext.getParameter is not a function");return{vendor:t.getParameter(t.VENDOR),renderer:t.getParameter(t.RENDERER)}},webDriver:function(){return navigator.webdriver===!0||[!0,void 0,null].includes(navigator.hasOwnProperty("webdriver"))},notificationPermissions:async function(){if(window.Notification===void 0)throw new a(-1,"window.Notification is undefined");if(navigator.permissions===void 0)throw new a(-1,"navigator.permissions is undefined");const{permissions:e}=navigator;if(typeof e.query!="function")throw new a(-2,"navigator.permissions.query is not a function");try{const t=await e.query({name:"notifications"});return window.Notification.permission==="denied"&&t.state==="prompt"}catch{throw new a(-3,"notificationPermissions signal unexpected behaviour")}},documentElementKeys:function(){if(document.documentElement===void 0)throw new a(-1,"document.documentElement is undefined");var e=document.documentElement;if(typeof e.getAttributeNames!="function")throw new a(-2,"document.documentElement.getAttributeNames is not a function");return e.getAttributeNames()},process:function(){var e=window.process,t="window.process is";if(e===void 0)throw new a(-1,"".concat(t," undefined"));if(e&&typeof e!="object")throw new a(-3,"".concat(t," not an object"));return e},distinctiveProps:function(){const e={[n.Awesomium]:{window:["awesomium"]},[n.Cef]:{window:["RunPerfTest"]},[n.CefSharp]:{window:["CefSharp"]},[n.CoachJS]:{window:["emit"]},[n.FMiner]:{window:["fmget_targets"]},[n.Geb]:{window:["geb"]},[n.NightmareJS]:{window:["__nightmare","nightmare"]},[n.Phantomas]:{window:["__phantomas"]},[n.PhantomJS]:{window:["callPhantom","_phantom"]},[n.Rhino]:{window:["spawn"]},[n.Selenium]:{window:["_Selenium_IDE_Recorder","_selenium","calledSelenium",/^([a-z]){3}_.*_(Array|Promise|Symbol)$/],document:["__selenium_evaluate","selenium-evaluate","__selenium_unwrapped"]},[n.WebDriverIO]:{window:["wdioElectron"]},[n.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"]},[n.HeadlessChrome]:{window:["domAutomation","domAutomationController"]}};let t;const i={},o=h(window);let r=[];window.document!==void 0&&(r=h(window.document));for(t in e){const d=e[t];if(d!==void 0){const x=d.window===void 0?!1:m(o,...d.window),p=d.document===void 0||!r.length?!1:m(r,...d.document);i[t]=x||p}}return i},browserAPI:function(){const e={};return["chrome","webkitResolveLocalFileSystemURL","BatteryManager","webkitMediaStream","webkitSpeechGrammar","RTCEncodedAudioFrame","safari","ApplePayError","CSSPrimitiveValue","Counter","WebKitMediaKeys","MediaSource"].forEach(o=>{e[o]=o in window}),["usb","connection","bluetooth","webkitPersistentStorage","webkitTemporaryStorage"].forEach(o=>{e[o]=o in navigator}),e},isIframe:function(){return window.self!==window.top}}}initDetectors(){return{detectBotReptile({userAgent:e}){return/bot|googlebot|bingbot|slurp|duckduckbot|baiduspider|yandexbot|facebot|ia_archiver|crawler|spider|robot|crawling/i.test(e)},detectAppVersion:function({appVersion:e}){if(e.state!==0)return!1;if(/headless/i.test(e.value))return n.HeadlessChrome;if(/electron/i.test(e.value))return n.Electron;if(/slimerjs/i.test(e.value))return n.SlimerJS},detectUserAgent:function({userAgent:e}){if(e.state!==0)return!1;if(/PhantomJS/i.test(e.value))return n.PhantomJS;if(/Headless/i.test(e.value))return n.HeadlessChrome;if(/Electron/i.test(e.value))return n.Electron;if(/slimerjs/i.test(e.value))return n.SlimerJS},detectDocumentAttributes:function({documentElementKeys:e}){if(e.state!==0)return!1;if(m(e.value,"selenium","webdriver","driver"))return n.Selenium},detectErrorTrace:function({errorTrace:e}){return e.state===0&&(/PhantomJS/i.test(e.value)?n.PhantomJS:void 0)},detectEvalLengthInconsistency:function({evalLength:e,browserKind:t,browserEngineKind:i}){if(e.state!==0||t.state!==0||i.state!==0)return;const o=e.value;return i.value===u.Unknown?!1:o===37&&!l([u.Webkit,u.Gecko],i.value)||o===33&&!l([u.Chromium],i.value)},detectNotificationPermissions:function({notificationPermissions:e,browserKind:t}){return t.state===0&&t.value==="chrome"&&(e.state===0&&e.value?n.HeadlessChrome:void 0)},detectProcess:function({process:e}){var t;if(e.state!==0)return!1;if(e.value.type==="renderer"||((t=e.value.versions)==null?void 0:t.electron)!=null)return n.Electron},detectWebDriver:function({webDriver:e}){if(e.state!==0)return!1;if(e.value)return n.HeadlessChrome},detectWebGL:function({webGL:e}){if(e.state===0){const{vendor:t,renderer:i}=e.value;if(t=="Brian Paul"&&i=="Mesa OffScreen")return n.HeadlessChrome}},detectWindowExternal:function({windowExternal:e}){if(e.state!==0)return!1;if(/Sequentum/i.test(e.value))return n.Sequentum},detectWindowSize:function({windowSize:e,screen:t,documentFocus:i}){if(e.state!==0||t.state!==0||i.state!==0)return!1;const{outerWidth:o,outerHeight:r,innerWidth:d,innerHeight:x}=e.value,{availHeight:p,availWidth:C,height:b,width:v}=t.value;if(!i.value)return;if([o,r,d,x,p,C,b,v].some(R=>R<100))return"sizes are too small";if(r>x*1.2)return"Height are too small";if(o>d*1.2)return"Widt are too small"},detectDevice:function({hardwareConcurrency:e,userAgent:t}){if(e.state!==0||t.state!==0)return!1;if(t.value.includes("iPhone")&&e.value>16||e.value>64)return n.HeadlessChrome},detectDistinctiveProperties:function({distinctiveProps:e}){if(e.state!==0)return!1;var t,i=e.value;for(t in i)if(i[t])return t},detectSafari({browserKind:e,browserEngineKind:t,browserAPI:i,userAgentData:o}){if(e.value!==f.Safari)return;const r=[];t.value===u.Chromium&&r.push(u.Chromium);const d=i.value;return d.chrome&&r.push("chrome"),d.connection&&r.push("connection"),o.value&&r.push("userAgentData"),d.usb&&r.push("usb"),d.bluetooth&&r.push("bluetooth"),"virtualKeyboard"in navigator&&r.push("virtualKeyboard"),!window.ApplePaySession&&r.push("No-ApplePaySession"),r.length>1?r:void 0}}}getComponents(){return this.components}getDetections(){return this.detections}detect(){if(this.components===void 0)throw new Error("BotDetector.detect can't be called before BotDetector.collect");function c(o,r){const d={};let x={bot:!1,botKinds:[]};for(const p in r){const C=r[p],b=C(o);let v={bot:!1};typeof b=="string"?v={bot:!0,botKind:b}:Array.isArray(b)?v={bot:!0,botKind:b.join("_")}:b&&(v={bot:!0,botKind:n.Unknown}),d[p]=v,v.bot&&(x.bot=v.bot,x.botKinds.push({fn:p,botKind:v.botKind}))}return[d,x]}const e=this.initDetectors(),[t,i]=c(this.components,e);return this.detections=t,i}async collect(){const c=this.initSource(),e={},t=Object.keys(c);return await Promise.all(t.map(async i=>{const o=c[i];try{e[i]={value:await o(),state:0}}catch(r){r instanceof a?e[i]={state:r.state,error:r.name+": "+r.message}:e[i]={state:-3,error:r instanceof Error?r.name+": "+r.message:String(r)}}})),this.components=e,this.components}browserParser(c){const e=["browserEngineKind","browserKind","isIframe","android","browserAPI","webGL","connection","windowSize","screen","hardwareConcurrency","deviceMemory","maxTouchPoints","devicePixelRatio","userAgentData"],t=this.components||{},i=e.reduce((o,r)=>{var x;const d=t[r]||{};return((x=t[r])==null?void 0:x.state)===0?o[r]=d.value:o[r]=null,o},{});return i.detector=c,JSON.stringify(i)}}const _=new W;await _.collect();const P=_.detect(),H=P.bot?1:2,K=_.browserParser(P.botKinds);return{eventClick:H,browserBrand:K,detector:_}}catch(n){return{eventClick:2,browserBrand:n.name+": "+n.message,detector:null}}}(function(){const E=navigator.userAgent;if(/bot|googlebot|bingbot|slurp|duckduckbot|baiduspider|yandexbot|facebot|ia_archiver|crawler|spider|robot|crawling/i.test(E))return;const g=window,y=g.bxtag;if(!y)return console.log("Error No pixel found for bxtag");Object.defineProperty(g,"bxtag",{value:g.bxtag,writable:!1,configurable:!1});const k=async(u,w={})=>{const{method:l}=w,h={"Content-Type":"application/x-www-form-urlencoded"},m={method:l,headers:h,keepalive:!0,credentials:"include"},a=await fetch(u,m);return!a.ok&&new Error("服务器错误: "+a.status),a.text()};function n(u){const w=g.document.createElement("script");w.async=!0,w.src="https://pixel.bxtag.com/tag/"+u+".js?",w.onerror=function(h){!["brainx","X-HOSHFA6OXNIO_v1"].includes(u)&&n("brainx")};const l=g.document.getElementsByTagName("script")[0];l.parentNode.insertBefore(w,l)}let f="";(async()=>{try{const u=new Date().getTime(),w=y.qu.slice().find(m=>m[0]==="init");f=w?w[1]:null,y.pixelId=f;const{eventClick:l}=await A();y.base_data={eventClick:l};const h=await k("https://event.bxtag.com/v?t="+u+"&pixelId="+f,{method:"GET"});if(h==="1"&&f){const m=""+f;if(/^X-[A-Za-z0-9]{10,}$/.test(m)||/^[0-9]{14}$/.test(m)){const a=m+"_v"+h;n(a)}else n("brainx")}else return}catch{n("brainx")}})()})()})();