//UAParser
!function (i, e) { "use strict"; var t, o = "function", r = "undefined", a = "object", s = "string", n = "major", w = "model", b = "name", c = "type", u = "vendor", d = "version", l = "architecture", p = "console", h = "mobile", f = "tablet", m = "smarttv", g = "wearable", v = "embedded", $ = "user-agent", k = "brands", x = "formFactors", y = "fullVersionList", _ = "platform", T = "platformVersion", S = "bitness", C = "sec-ch-ua", q = C + "-full-version-list", O = C + "-arch", A = C + "-" + S, N = C + "-form-factors", z = C + "-" + h, P = C + "-" + w, H = C + "-" + _, U = H + "-version", I = [k, y, h, w, _, T, l, x, S], j = "browser", E = "device", M = "engine", R = "result", B = "Amazon", V = "Apple", F = "ASUS", G = "BlackBerry", L = "Google", D = "Huawei", X = "Lenovo", W = "Microsoft", K = "Motorola", Q = "Samsung", Z = "Sharp", Y = "Sony", J = "Xiaomi", ii = "Zebra", ie = "Mobile ", it = " Browser", io = "Chrome", ir = "Chromecast", ia = "Firefox", is = "Opera", iw = "Facebook", ib = "Sogou", ic = "Windows", iu = typeof i !== r, id = iu && i.navigator ? i.navigator : e, il = id && id.userAgentData ? id.userAgentData : e, ip = function (i, e) { var t = {}, o = e; if (!ig(e)) for (var r in o = {}, e) for (var a in e[r]) o[a] = e[r][a].concat(o[a] ? o[a] : []); for (var s in i) t[s] = o[s] && o[s].length % 2 == 0 ? o[s].concat(i[s]) : i[s]; return t }, ih = function (i) { for (var e = {}, t = 0; t < i.length; t++)e[i[t].toUpperCase()] = i[t]; return e }, im = function (i, e) { if (typeof i === a && i.length > 0) { for (var t in i) if (ik(i[t]) == ik(e)) return !0; return !1 } return !!iv(i) && -1 !== ik(e).indexOf(ik(i)) }, ig = function (i, e) { for (var t in i) return /^(browser|cpu|device|engine|os)$/.test(t) || !!e && ig(i[t]) }, iv = function (i) { return typeof i === s }, i$ = function (i) { if (i) { for (var e = [], t = i_(/\\?\"/g, i).split(","), o = 0; o < t.length; o++)if (t[o].indexOf(";") > -1) { var r = i4(t[o]).split(";v="); e[o] = { brand: r[0], version: r[1] } } else e[o] = i4(t[o]); return e } }, ik = function (i) { return iv(i) ? i.toLowerCase() : i }, ix = function (i) { return iv(i) ? i_(/[^\d\.]/g, i).split(".")[0] : e }, iy = function (i) { for (var t in i) { var o = i[t]; typeof o == a && 2 == o.length ? this[o[0]] = o[1] : this[o] = e } return this }, i_ = function (i, e) { return iv(e) ? e.replace(i, "") : e }, i0 = function (i) { return i_(/\\?\"/g, i) }, i4 = function (i, e) { if (iv(i)) return i = i_(/^\s\s*/, i), typeof e === r ? i : i.substring(0, 500) }, i1 = function (i, t) { if (i && t) for (var r, s, n, w, b, c, u = 0; u < t.length && !b;) { var d = t[u], l = t[u + 1]; for (r = s = 0; r < d.length && !b && d[r];)if (b = d[r++].exec(i)) for (n = 0; n < l.length; n++)c = b[++s], typeof (w = l[n]) === a && w.length > 0 ? 2 === w.length ? typeof w[1] == o ? this[w[0]] = w[1].call(this, c) : this[w[0]] = w[1] : 3 === w.length ? typeof w[1] !== o || w[1].exec && w[1].test ? this[w[0]] = c ? c.replace(w[1], w[2]) : e : this[w[0]] = c ? w[1].call(this, c, w[2]) : e : 4 === w.length && (this[w[0]] = c ? w[3].call(this, c.replace(w[1], w[2])) : e) : this[w] = c || e; u += 2 } }, i2 = function (i, t) { for (var o in t) if (typeof t[o] === a && t[o].length > 0) { for (var r = 0; r < t[o].length; r++)if (im(t[o][r], i)) return "?" === o ? e : o } else if (im(t[o], i)) return "?" === o ? e : o; return t.hasOwnProperty("*") ? t["*"] : i }, i8 = { ME: "4.90", "NT 3.11": "NT3.51", "NT 4.0": "NT4.0", 2e3: "NT 5.0", XP: ["NT 5.1", "NT 5.2"], Vista: "NT 6.0", 7: "NT 6.1", 8: "NT 6.2", "8.1": "NT 6.3", 10: ["NT 6.4", "NT 10.0"], RT: "ARM" }, i3 = { embedded: "Automotive", mobile: "Mobile", tablet: ["Tablet", "EInk"], smarttv: "TV", wearable: "Watch", xr: ["VR", "XR"], "?": ["Desktop", "Unknown"], "*": e }, iT = { browser: [[/\b(?:crmo|crios)\/([\w\.]+)/i], [d, [b, ie + "Chrome"]], [/edg(?:e|ios|a)?\/([\w\.]+)/i], [d, [b, "Edge"]], [/(opera mini)\/([-\w\.]+)/i, /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i], [b, d], [/opios[\/ ]+([\w\.]+)/i], [d, [b, is + " Mini"]], [/\bop(?:rg)?x\/([\w\.]+)/i], [d, [b, is + " GX"]], [/\bopr\/([\w\.]+)/i], [d, [b, is]], [/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i], [d, [b, "Baidu"]], [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i, /(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i, /(?:ms|\()(ie) ([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio)\/([-\w\.]+)/i, /(heytap|ovi)browser\/([\d\.]+)/i, /(weibo)__([\d\.]+)/i], [b, d], [/quark(?:pc)?\/([-\w\.]+)/i], [d, [b, "Quark"]], [/\bddg\/([\w\.]+)/i], [d, [b, "DuckDuckGo"]], [/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i], [d, [b, "UCBrowser"]], [/microm.+\bqbcore\/([\w\.]+)/i, /\bqbcore\/([\w\.]+).+microm/i, /micromessenger\/([\w\.]+)/i], [d, [b, "WeChat"]], [/konqueror\/([\w\.]+)/i], [d, [b, "Konqueror"]], [/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i], [d, [b, "IE"]], [/ya(?:search)?browser\/([\w\.]+)/i], [d, [b, "Yandex"]], [/slbrowser\/([\w\.]+)/i], [d, [b, "Smart " + X + it]], [/(avast|avg)\/([\w\.]+)/i], [[b, /(.+)/, "$1 Secure" + it], d], [/\bfocus\/([\w\.]+)/i], [d, [b, ia + " Focus"]], [/\bopt\/([\w\.]+)/i], [d, [b, is + " Touch"]], [/coc_coc\w+\/([\w\.]+)/i], [d, [b, "Coc Coc"]], [/dolfin\/([\w\.]+)/i], [d, [b, "Dolphin"]], [/coast\/([\w\.]+)/i], [d, [b, is + " Coast"]], [/miuibrowser\/([\w\.]+)/i], [d, [b, "MIUI" + it]], [/fxios\/([\w\.-]+)/i], [d, [b, ie + ia]], [/\bqihu|(qi?ho?o?|360)browser/i], [[b, "360" + it]], [/\b(qq)\/([\w\.]+)/i], [[b, /(.+)/, "$1Browser"], d], [/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i], [[b, /(.+)/, "$1" + it], d], [/samsungbrowser\/([\w\.]+)/i], [d, [b, Q + " Internet"]], [/(comodo_dragon)\/([\w\.]+)/i], [[b, /_/g, " "], d], [/metasr[\/ ]?([\d\.]+)/i], [d, [b, ib + " Explorer"]], [/(sogou)mo\w+\/([\d\.]+)/i], [[b, ib + " Mobile"], d], [/(electron)\/([\w\.]+) safari/i, /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, /m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i], [b, d], [/(lbbrowser|rekonq)/i, /\[(linkedin)app\]/i], [b], [/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i], [[b, iw], d], [/(Klarna)\/([\w\.]+)/i, /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, /safari (line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(alipay)client\/([\w\.]+)/i, /(twitter)(?:and| f.+e\/([\w\.]+))/i, /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i], [b, d], [/\bgsa\/([\w\.]+) .*safari\//i], [d, [b, "GSA"]], [/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i], [d, [b, "TikTok"]], [/headlesschrome(?:\/([\w\.]+)| )/i], [d, [b, io + " Headless"]], [/ wv\).+(chrome)\/([\w\.]+)/i], [[b, io + " WebView"], d], [/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i], [d, [b, "Android" + it]], [/chrome\/([\w\.]+) mobile/i], [d, [b, ie + "Chrome"]], [/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i], [b, d], [/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i], [d, [b, ie + "Safari"]], [/iphone .*mobile(?:\/\w+ | ?)safari/i], [[b, ie + "Safari"]], [/version\/([\w\.\,]+) .*(safari)/i], [d, b], [/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i], [b, [d, "1"]], [/(webkit|khtml)\/([\w\.]+)/i], [b, d], [/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i], [[b, ie + ia], d], [/(navigator|netscape\d?)\/([-\w\.]+)/i], [[b, "Netscape"], d], [/(wolvic)\/([\w\.]+)/i], [b, d], [/mobile vr; rv:([\w\.]+)\).+firefox/i], [d, [b, ia + " Reality"]], [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i, /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, /(firefox)\/([\w\.]+)/i, /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, /(links) \(([\w\.]+)/i], [b, [d, /_/g, "."]], [/(cobalt)\/([\w\.]+)/i], [b, [d, /[^\d\.]+./, ""]]], cpu: [[/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i], [[l, "amd64"]], [/(ia32(?=;))/i, /((?:i[346]|x)86)[;\)]/i], [[l, "ia32"]], [/\b(aarch64|arm(v?8e?l?|_?64))\b/i], [[l, "arm64"]], [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i], [[l, "armhf"]], [/windows (ce|mobile); ppc;/i], [[l, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i], [[l, /ower/, "", ik]], [/(sun4\w)[;\)]/i], [[l, "sparc"]], [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i], [[l, ik]]], device: [[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i], [w, [u, Q], [c, f]], [/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]((?!sm-[lr])[-\w]+)/i, /sec-(sgh\w+)/i], [w, [u, Q], [c, h]], [/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i], [w, [u, V], [c, h]], [/\((ipad);[-\w\),; ]+apple/i, /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i], [w, [u, V], [c, f]], [/(macintosh);/i], [w, [u, V]], [/\b(sh-?[altvz]?\d\d[a-ekm]?)/i], [w, [u, Z], [c, h]], [/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i], [w, [u, D], [c, f]], [/(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i], [w, [u, D], [c, h]], [/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i, /\b; (\w+) build\/hm\1/i, /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i, /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i], [[w, /_/g, " "], [u, J], [c, h]], [/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i, /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i], [[w, /_/g, " "], [u, J], [c, f]], [/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i], [w, [u, "OPPO"], [c, h]], [/\b(opd2\d{3}a?) bui/i], [w, [u, "OPPO"], [c, f]], [/vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i], [w, [u, "Vivo"], [c, h]], [/\b(rmx[1-3]\d{3})(?: bui|;|\))/i], [w, [u, "Realme"], [c, h]], [/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i], [w, [u, K], [c, h]], [/\b(mz60\d|xoom[2 ]{0,2}) build\//i], [w, [u, K], [c, f]], [/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i], [w, [u, "LG"], [c, f]], [/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, /\blg-?([\d\w]+) bui/i], [w, [u, "LG"], [c, h]], [/(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i], [w, [u, X], [c, f]], [/(?:maemo|nokia).*(n900|lumia \d+)/i, /nokia[-_ ]?([-\w\.]*)/i], [[w, /_/g, " "], [u, "Nokia"], [c, h]], [/(pixel c)\b/i], [w, [u, L], [c, f]], [/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i], [w, [u, L], [c, h]], [/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i], [w, [u, Y], [c, h]], [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i], [[w, "Xperia Tablet"], [u, Y], [c, f]], [/ (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i], [w, [u, "OnePlus"], [c, h]], [/(alexa)webm/i, /(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i, /(kf[a-z]+)( bui|\)).+silk\//i], [w, [u, B], [c, f]], [/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i], [[w, /(.+)/g, "Fire Phone $1"], [u, B], [c, h]], [/(playbook);[-\w\),; ]+(rim)/i], [w, u, [c, f]], [/\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i], [w, [u, G], [c, h]], [/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i], [w, [u, F], [c, f]], [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i], [w, [u, F], [c, h]], [/(nexus 9)/i], [w, [u, "HTC"], [c, f]], [/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i], [u, [w, /_/g, " "], [c, h]], [/tcl (xess p17aa)/i, /droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i], [w, [u, "TCL"], [c, f]], [/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i], [w, [u, "TCL"], [c, h]], [/(itel) ((\w+))/i], [[u, ik], w, [c, i2, { tablet: ["p10001l", "w7001"], "*": "mobile" }]], [/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i], [w, [u, "Acer"], [c, f]], [/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i], [w, [u, "Meizu"], [c, h]], [/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i], [w, [u, "Ulefone"], [c, h]], [/droid.+; (a(?:015|06[35]|142p?))/i], [w, [u, "Nothing"], [c, h]], [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i, /(hp) ([\w ]+\w)/i, /(asus)-?(\w+)/i, /(microsoft); (lumia[\w ]+)/i, /(lenovo)[-_ ]?([-\w]+)/i, /(jolla)/i, /(oppo) ?([\w ]+) bui/i], [u, w, [c, h]], [/(kobo)\s(ereader|touch)/i, /(archos) (gamepad2?)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i], [u, w, [c, f]], [/(surface duo)/i], [w, [u, W], [c, f]], [/droid [\d\.]+; (fp\du?)(?: b|\))/i], [w, [u, "Fairphone"], [c, h]], [/(shield[\w ]+) b/i], [w, [u, "Nvidia"], [c, f]], [/(sprint) (\w+)/i], [u, w, [c, h]], [/(kin\.[onetw]{3})/i], [[w, /\./g, " "], [u, W], [c, h]], [/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i], [w, [u, ii], [c, f]], [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i], [w, [u, ii], [c, h]], [/smart-tv.+(samsung)/i], [u, [c, m]], [/hbbtv.+maple;(\d+)/i], [[w, /^/, "SmartTV"], [u, Q], [c, m]], [/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i], [[u, "LG"], [c, m]], [/(apple) ?tv/i], [u, [w, V + " TV"], [c, m]], [/crkey.*devicetype\/chromecast/i], [[w, ir + " Third Generation"], [u, L], [c, m]], [/crkey.*devicetype\/([^/]*)/i], [[w, /^/, "Chromecast "], [u, L], [c, m]], [/fuchsia.*crkey/i], [[w, ir + " Nest Hub"], [u, L], [c, m]], [/crkey/i], [[w, ir], [u, L], [c, m]], [/droid.+aft(\w+)( bui|\))/i], [w, [u, B], [c, m]], [/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i], [w, [u, Z], [c, m]], [/(bravia[\w ]+)( bui|\))/i], [w, [u, Y], [c, m]], [/(mitv-\w{5}) bui/i], [w, [u, J], [c, m]], [/Hbbtv.*(technisat) (.*);/i], [u, w, [c, m]], [/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i], [[u, i4], [w, i4], [c, m]], [/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i], [[c, m]], [/(ouya)/i, /(nintendo) (\w+)/i], [u, w, [c, p]], [/droid.+; (shield) bui/i], [w, [u, "Nvidia"], [c, p]], [/(playstation \w+)/i], [w, [u, Y], [c, p]], [/\b(xbox(?: one)?(?!; xbox))[\); ]/i], [w, [u, W], [c, p]], [/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i], [w, [u, Q], [c, g]], [/((pebble))app/i], [u, w, [c, g]], [/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i], [w, [u, V], [c, g]], [/droid.+; (wt63?0{2,3})\)/i], [w, [u, ii], [c, g]], [/droid.+; (glass) \d/i], [w, [u, L], [c, "xr"]], [/(pico) (4|neo3(?: link|pro)?)/i], [u, w, [c, "xr"]], [/(quest( \d| pro)?)/i], [w, [u, iw], [c, "xr"]], [/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i], [u, [c, v]], [/(aeobc)\b/i], [w, [u, B], [c, v]], [/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i], [w, [c, h]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i], [w, [c, f]], [/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i], [[c, f]], [/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i], [[c, h]], [/(android[-\w\. ]{0,9});.+buil/i], [w, [u, "Generic"]]], engine: [[/windows.+ edge\/([\w\.]+)/i], [d, [b, "EdgeHTML"]], [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i], [d, [b, "Blink"]], [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, /(icab)[\/ ]([23]\.[\d\.]+)/i, /\b(libweb)/i], [b, d], [/rv\:([\w\.]{1,9})\b.+(gecko)/i], [d, b]], os: [[/microsoft (windows) (vista|xp)/i], [b, d], [/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i], [b, [d, i2, i8]], [/windows nt 6\.2; (arm)/i, /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i, /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i], [[d, i2, i8], [b, ic]], [/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i, /cfnetwork\/.+darwin/i], [[d, /_/g, "."], [b, "iOS"]], [/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i], [[b, "macOS"], [d, /_/g, "."]], [/android ([\d\.]+).*crkey/i], [d, [b, ir + " Android"]], [/fuchsia.*crkey\/([\d\.]+)/i], [d, [b, ir + " Fuchsia"]], [/crkey\/([\d\.]+).*devicetype\/smartspeaker/i], [d, [b, ir + " SmartSpeaker"]], [/linux.*crkey\/([\d\.]+)/i], [d, [b, ir + " Linux"]], [/crkey\/([\d\.]+)/i], [d, [b, ir]], [/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i], [d, b], [/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, /(tizen|kaios)[\/ ]([\w\.]+)/i, /\((series40);/i], [b, d], [/\(bb(10);/i], [d, [b, G]], [/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i], [d, [b, "Symbian"]], [/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i], [d, [b, ia + " OS"]], [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i], [d, [b, "webOS"]], [/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i], [d, [b, "watchOS"]], [/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i], [[b, "Chrome OS"], d], [/panasonic;(viera)/i, /(netrange)mmh/i, /(nettv)\/(\d+\.[\w\.]+)/i, /(nintendo|playstation) (\w+)/i, /(xbox); +xbox ([^\);]+)/i, /(pico) .+os([\w\.]+)/i, /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, /(mint)[\/\(\) ]?(\w*)/i, /(mageia|vectorlinux)[; ]/i, /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, /(hurd|linux) ?([\w\.]*)/i, /(gnu) ?([\w\.]*)/i, /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku) (\w+)/i], [b, d], [/(sunos) ?([\w\.\d]*)/i], [[b, "Solaris"], d], [/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, /(unix) ?([\w\.]*)/i], [b, d]] }, iS = (t = { init: {}, isIgnore: {}, isIgnoreRgx: {}, toString: {} }, iy.call(t.init, [[j, [b, d, n, c]], ["cpu", [l]], [E, [c, w, u]], [M, [b, d]], ["os", [b, d]]]), iy.call(t.isIgnore, [[j, [d, n]], [M, [d]], ["os", [d]]]), iy.call(t.isIgnoreRgx, [[j, / ?browser$/i], ["os", / ?os$/i]]), iy.call(t.toString, [[j, [b, d]], ["cpu", [l]], [E, [u, w]], [M, [b, d]], ["os", [b, d]]]), t), iC = function (i, e) { var t = iS.init[e], o = iS.isIgnore[e] || 0, a = iS.isIgnoreRgx[e] || 0, s = iS.toString[e] || 0; function n() { iy.call(this, t) } return n.prototype.getItem = function () { return i }, n.prototype.withClientHints = function () { return il ? il.getHighEntropyValues(I).then(function (e) { return i.setCH(new i7(e, !1)).parseCH().get() }) : i.parseCH().get() }, n.prototype.withFeatureCheck = function () { return i.detectFeature().get() }, e != R && (n.prototype.is = function (i) { var e = !1; for (var t in this) if (this.hasOwnProperty(t) && !im(o, t) && ik(a ? i_(a, this[t]) : this[t]) == ik(a ? i_(a, i) : i)) { if (e = !0, i != r) break } else if (i == r && e) { e = !e; break } return e }, n.prototype.toString = function () { var i = ""; for (var e in s) typeof this[s[e]] !== r && (i += (i ? " " : "") + this[s[e]]); return i || r }), il || (n.prototype.then = function (i) { var e = this, t = function () { for (var i in e) e.hasOwnProperty(i) && (this[i] = e[i]) }; t.prototype = { is: n.prototype.is, toString: n.prototype.toString }; var o = new t; return i(o), o }), new n }; function i7(i, e) { if (i = i || {}, iy.call(this, I), e) iy.call(this, [[k, i$(i[C])], [y, i$(i[q])], [h, /\?1/.test(i[z])], [w, i0(i[P])], [_, i0(i[H])], [T, i0(i[U])], [l, i0(i[O])], [x, i$(i[N])], [S, i0(i[A])]]); else for (var t in i) this.hasOwnProperty(t) && typeof i[t] !== r && (this[t] = i[t]) } function i5(i, t, a, s) { return this.get = function (i) { return i ? this.data.hasOwnProperty(i) ? this.data[i] : e : this.data }, this.set = function (i, e) { return this.data[i] = e, this }, this.setCH = function (i) { return this.uaCH = i, this }, this.detectFeature = function () { if (id && id.userAgent == this.ua) switch (this.itemType) { case j: id.brave && typeof id.brave.isBrave == o && this.set(b, "Brave"); break; case E: !this.get(c) && il && il[h] && this.set(c, h), "Macintosh" == this.get(w) && id && typeof id.standalone !== r && id.maxTouchPoints && id.maxTouchPoints > 2 && this.set(w, "iPad").set(c, f); break; case "os": !this.get(b) && il && il[_] && this.set(b, il[_]); break; case R: var i = this.data, e = function (e) { return i[e].getItem().detectFeature().get() }; this.set(j, e(j)).set("cpu", e("cpu")).set(E, e(E)).set(M, e(M)).set("os", e("os")) }return this }, this.parseUA = function () { return this.itemType != R && i1.call(this.data, this.ua, this.rgxMap), this.itemType == j && this.set(n, ix(this.get(d))), this }, this.parseCH = function () { var i, t = this.uaCH, o = this.rgxMap; switch (this.itemType) { case j: var r, a = t[y] || t[k]; if (a) for (var s in a) { var f = i_(/(Google|Microsoft) /, a[s].brand || a[s]), m = a[s].version; !/not.a.brand/i.test(f) && (!r || /chrom/i.test(r) && !/chromi/i.test(f)) && (this.set(b, f).set(d, m).set(n, ix(m)), r = f) } break; case "cpu": var g = t[l]; g && (g && "64" == t[S] && (g += "64"), i1.call(this.data, g + ";", o)); break; case E: if (t[h] && this.set(c, h), t[w] && this.set(w, t[w]), "Xbox" == t[w] && this.set(c, p).set(u, W), t[x]) { if ("string" != typeof t[x]) for (var v = 0; !i && v < t[x].length;)i = i2(t[x][v++], i3); else i = i2(t[x], i3); this.set(c, i) } break; case "os": var $ = t[_]; if ($) { var C = t[T]; $ == ic && (C = parseInt(ix(C), 10) >= 13 ? "11" : "10"), this.set(b, $).set(d, C) } this.get(b) == ic && "Xbox" == t[w] && this.set(b, "Xbox").set(d, e); break; case R: var q = this.data, O = function (i) { return q[i].getItem().setCH(t).parseCH().get() }; this.set(j, O(j)).set("cpu", O("cpu")).set(E, O(E)).set(M, O(M)).set("os", O("os")) }return this }, iy.call(this, [["itemType", i], ["ua", t], ["uaCH", s], ["rgxMap", a], ["data", iC(this, i)]]), this } function iq(i, t, o) { if (typeof i === a ? (ig(i, !0) ? (typeof t === a && (o = t), t = i) : (o = i, t = e), i = e) : typeof i !== s || ig(t, !0) || (o = t, t = e), !(this instanceof iq)) return new iq(i, t, o).getResult(); var r = typeof i === s ? i : id && id.userAgent ? id.userAgent : o && o[$] ? o[$] : "", n = new i7(o, !0), w = t ? ip(iT, t) : iT, b = function (i) { return i == R ? function () { return new i5(i, r, w, n).set("ua", r).set(j, this.getBrowser()).set("cpu", this.getCPU()).set(E, this.getDevice()).set(M, this.getEngine()).set("os", this.getOS()).get() } : function () { return new i5(i, r, w[i], n).parseUA().get() } }; return iy.call(this, [["getBrowser", b(j)], ["getCPU", b("cpu")], ["getDevice", b(E)], ["getEngine", b(M)], ["getOS", b("os")], ["getResult", b(R)], ["getUA", function () { return r }], ["setUA", function (i) { return iv(i) && (r = i.length > 500 ? i4(i, 500) : i), this }]]).setUA(r), this } iq.VERSION = "2.0.0-beta.3", iq.BROWSER = ih([b, d, n, c]), iq.CPU = ih([l]), iq.DEVICE = ih([w, u, c, p, h, m, f, g, v]), iq.ENGINE = iq.OS = ih([b, d]), typeof exports !== r ? (typeof module !== r && module.exports && (exports = module.exports = iq), exports.UAParser = iq) : typeof define === o && define.amd ? define(function () { return iq }) : iu && (i.UAParser = iq); var i6 = iu && (i.jQuery || i.Zepto); if (i6 && !i6.ua) { var iO = new iq; i6.ua = iO.getResult(), i6.ua.get = function () { return iO.getUA() }, i6.ua.set = function (i) { iO.setUA(i); var e = iO.getResult(); for (var t in e) i6.ua[t] = e[t] } } }("object" == typeof window ? window : this);
//////////////////
(function (window, document) {
    // Define API endpoints as variables
    const API_BASE_URL = "https://analytics.ariomex.ir/api";
    const SESSION_URL = `${API_BASE_URL}/sessions`;
    const EVENTS_URL = `${API_BASE_URL}/events`;
    const PAGEVIEW_URL = `${API_BASE_URL}/page_view`;
    const UTM_PARAMETERS_URL = `${API_BASE_URL}/utm_parameters`;
    const LIVENESS_URL = `${API_BASE_URL}/liveness`;
    // Variables for website ID and session ID
    let websiteId = "not_set";
    let oldUrl = "";
    let pageview_uuid = "";
    let anlyticsLiveIntervalId;
    let lastVisibilityState = document.visibilityState;
    let lastFocusState = document.hasFocus();
    // Helper functions for handling cookies
    function setCookie(name, value, expires = false) {
        let cookieString = `${name}=${value}; path=/`;
        if (expires === true) {
            const date = new Date();
            date.setTime(date.getTime() + 24 * 60 * 60 * 1000);
            cookieString += `; expires=${date.toUTCString()}`;
        }
        document.cookie = cookieString;
    }
    function getCookie(name) {
        const value = `; ${document.cookie}`;
        const parts = value.split(`; ${name}=`);
        if (parts.length === 2) return parts.pop().split(";").shift();
    }
    // Generate a unique session ID using UUID v4
    function generateUuid() {
        const buffer = new Uint8Array(16);
        window.crypto.getRandomValues(buffer);
        buffer[6] = (buffer[6] & 0x0f) | 0x40;     // Set version to 4
        buffer[8] = (buffer[8] & 0x3f) | 0x80;     // Set variant to RFC 4122
        const bytesToHex = Array.from(buffer).map((b) =>
            b.toString(16).padStart(2, "0")
        );
        // Format as UUID
        return [
            bytesToHex.slice(0, 4).join(""),
            bytesToHex.slice(4, 6).join(""),
            bytesToHex.slice(6, 8).join(""),
            bytesToHex.slice(8, 10).join(""),
            bytesToHex.slice(10).join(""),
        ].join("-");
    }
    function generateSessionId() {
        const uuid = generateUuid();
        return uuid;
    }
    // Get or set session ID using cookies
    function getOrCreateSessionId(from) {
        let returningUser = true;
        let sessionId = getCookie("aa_sid");
        let userId = getCookie("aa_uid");
        let user_uuid = getCookie("MAIN_ACCESS_TOKEN") || '';
        if (!sessionId) {
            sessionId = generateSessionId();
            setCookie("aa_sid", sessionId, true);
        }
        if (!userId && from === "init") {
            returningUser = false;
            userId = generateSessionId();
            setCookie("aa_uid", userId, false);
        }
        return { userId, sessionId, returningUser, user_uuid };
    }
    function setWebsiteId(id) {
        websiteId = id;
    }
    function getWebsiteId() {
        return websiteId;
    }
    function getDeviceInfo() {
        const parser = new UAParser();
        const result = parser.getResult();
        let deviceType = "desktop";
        let deviceBrand = "unknown";
        let deviceOS = "unknown";
        let deviceModel = "unknown";
        if (result.device.type === "mobile") {
            deviceType = "mobile";
            deviceBrand = result.device.vendor || "unknown";  // Mobile brand (e.g., Samsung, Apple)
            deviceModel = result.device.model || "unknown";   // Mobile brand (e.g., Samsung, Apple)
            deviceOS = result.os.name || "unknown";        // Mobile OS (e.g., Android, iOS)
        } else if (result.device.type === "tablet") {
            deviceType = "tablet";
            deviceBrand = result.device.vendor || "unknown";  // Tablet brand
            deviceModel = result.device.model || "unknown";
            deviceOS = result.os.name || "unknown";        // Tablet OS
        } else {
            deviceType = "desktop";
            deviceOS = result.os.name || "unknown";  // Desktop OS (e.g., Windows, macOS, Linux)
            deviceModel = result.os.name || "unknown";  // Desktop OS (e.g., Windows, macOS, Linux)
        }
        return {
            device_type: deviceType,
            device_brand: deviceBrand,
            device_os: deviceOS,
            device_model: deviceModel,
        };
    }
    function pageView(url, isInit, isUnload, isvisible = false) {
        const sessionidandreturning = getOrCreateSessionId("pv");
        const sid = sessionidandreturning.sessionId;
        const uid = sessionidandreturning.userId;
        let enter = {};
        let exit = {};
        if (isInit) {
            pageview_uuid = generateUuid();
            enter = {
                session_id: sid,
                user_id: uid,
                page_url: url,
                page_title: document.title,
                pageview_uuid: pageview_uuid,
            };
            exit = false;
        } else {
            exit = {
                session_id: sid,
                user_id: uid,
                page_url: oldUrl,
                page_title: document.title,
                pageview_uuid: pageview_uuid,
            };
            oldUrl = url;
            pageview_uuid = generateUuid();
            enter = {
                session_id: sid,
                user_id: uid,
                page_url: url,
                page_title: "",
                pageview_uuid: pageview_uuid,
            };
            if (isvisible === "visible") {
                exit = false;
            }
            if (isvisible === "hidden") {
                enter = false;
            }
        }
        if (isUnload) {
            enter = false;
        }
        const pageViewData = { enter, exit };
        sendPageViewData(pageViewData);
    }
    function init() {
        oldUrl = window.location.href;
        const sessionIdData = getOrCreateSessionId("init");
        const sessionId = sessionIdData.sessionId;
        const userId = sessionIdData.userId;
        const userUUID = sessionIdData.user_uuid;
        const returningUser = sessionIdData.returningUser;
        websiteId = getWebsiteId();
        const deviceInfo = getDeviceInfo();
        const sessionData = {
            user_id: userId,
            user_uuid: userUUID,
            session_id: sessionId,
            website_id: websiteId,
            user_agent: navigator.userAgent,
            screen_width: window.screen.width,
            screen_height: window.screen.height,
            viewport_width: window.innerWidth,
            viewport_height: window.innerHeight,
            language: navigator.language,
            timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
            referrer: document.referrer,
            ...deviceInfo,
        };
        const urlParams = new URLSearchParams(window.location.search);
        const utmData = {
            session_id: sessionId,
            user_id: userId,
            utm_source: urlParams.get("utm_source"),
            utm_medium: urlParams.get("utm_medium"),
            utm_campaign: urlParams.get("utm_campaign"),
            utm_term: urlParams.get("utm_term"),
            utm_content: urlParams.get("utm_content"),
        };
        if (!returningUser) {
            sendSessionData(sessionData);
        }
        const filteredUtmData = Object.fromEntries(
            Object.entries(utmData).filter(([key, value]) => value != null)
        );
        if (Object.keys(filteredUtmData).length > 2) {
            sendUTMParameters(utmData);
        }
        pageView(oldUrl, true, false);
        // Override pushState and replaceState to detect URL changes
        const oldPushState = history.pushState;
        const oldReplaceState = history.replaceState;
        /////////////////////link clicks onepage app//////////////////////
        history.pushState = function (state, title, url) {
            const fullUrl = window.location.origin + url;
            oldPushState.apply(history, arguments);
            pageView(fullUrl, false, false);
        };
        ////////////////////back and forward buttons/////////////////////
        history.replaceState = function (state, title, url) {
            const fullUrl = window.location.origin + url;
            oldReplaceState.apply(history, arguments);
            pageView(fullUrl, false, false);
        };
        //////////////////////live users handler//////////////////////////
        async function callIsLive(liveData) {
            fetch(LIVENESS_URL, {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify(liveData),
            });
        }
        function startPolling() {
            // Initial call
            callIsLive(getPollData());
            // Start polling if not already started
            if (!anlyticsLiveIntervalId) {
                anlyticsLiveIntervalId = setInterval(() => {
                    callIsLive(getPollData());
                }, 15000);
            }
        }
        function getPollData() {
            return {
                session_id: sessionId,
                user_id: userId,
                page_url: window.location.href,
                page_title: document.title,
            };
        }
        // Function to stop polling
        function stopPolling() {
            if (anlyticsLiveIntervalId) {
                clearInterval(anlyticsLiveIntervalId);
                anlyticsLiveIntervalId = null;
            }
        }
        function checkLiveness() {
            if (document.visibilityState === "visible" && document.hasFocus()) {
                startPolling();
            } else {
                stopPolling();
            }
        }
        checkLiveness();
        //////////////////////
        function handlePageVisibility() {
            const newVisibilityState = document.visibilityState;
            const newFocusState = document.hasFocus();
            if (newVisibilityState !== lastVisibilityState || newFocusState !== lastFocusState) {
                const fullUrl = window.location.origin + window.location.pathname;
                if (newVisibilityState === "visible" && newFocusState) {
                    pageView(fullUrl, false, false, "visible");
                } else {
                    pageView(fullUrl, false, false, "hidden");
                }
                // Update the last known states
                lastVisibilityState = newVisibilityState;
                lastFocusState = newFocusState;
            }
            // Always check liveness
            checkLiveness();
        }
        // Add a single listener for visibilitychange and focus/blur events
        document.addEventListener("visibilitychange", handlePageVisibility);
        window.addEventListener("focus", handlePageVisibility);
        window.addEventListener("blur", handlePageVisibility);
        // Initial check
        if (document.visibilityState === "visible") {
            startPolling();
        }
        // Add event listener for beforeunload
        window.addEventListener("beforeunload", function () {
            pageView(window.location.href, false, true);
        });
    }
    // Function to send session data to the backend
    async function sendSessionData(sessionData) {
        fetch(SESSION_URL, {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify(sessionData),
        });
    }
    // Function to send event data to the backend
    async function sendPageViewData(pageViewData) {
        fetch(PAGEVIEW_URL, {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify(pageViewData),
        });
    }
    // Function to send event data to the backend
    async function sendEventData(eventData) {
        fetch(EVENTS_URL, {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify(eventData),
        });
    }
    // Function to send UTM parameters to the backend
    async function sendUTMParameters(utmData) {
        fetch(UTM_PARAMETERS_URL, {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify(utmData),
        });
    }
    // Expose the functions globally
    window.arxa = {
        setWebsiteId: setWebsiteId,
        init: init,
        sendEvent: function (eventName, eventData, user_uuid) {
            const ids = getOrCreateSessionId("se");
            const session_id = ids.sessionId;
            sendEventData({
                session_id: session_id,
                event_user_uuid: user_uuid,
                event_name: eventName,
                event_data: eventData,
            });
        },
    };
})(window, document);
