(()=>{var t={232:()=>{"undefined"!=typeof Element&&(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}))},264:function(t,e,n){!function(t){var e=function(){try{return!!Symbol.iterator}catch(t){return!1}}(),n=function(t){var n={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return e&&(n[Symbol.iterator]=function(){return n}),n},i=function(t){return encodeURIComponent(t).replace(/%20/g,"+")},o=function(t){return decodeURIComponent(String(t).replace(/\+/g," "))};(function(){try{var e=t.URLSearchParams;return"a=1"===new e("?a=1").toString()&&"function"==typeof e.prototype.set&&"function"==typeof e.prototype.entries}catch(t){return!1}})()||function(){var o=function(t){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var e=typeof t;if("undefined"===e);else if("string"===e)""!==t&&this._fromString(t);else if(t instanceof o){var n=this;t.forEach((function(t,e){n.append(e,t)}))}else{if(null===t||"object"!==e)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(t))for(var i=0;ie[0]?1:0})),t._entries&&(t._entries={});for(var n=0;n1?o(i[1]):"")}})}(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this),function(t){if(function(){try{var e=new t.URL("b","http://a");return e.pathname="c d","http://a/c%20d"===e.href&&e.searchParams}catch(t){return!1}}()||function(){var e=t.URL,n=function(e,n){"string"!=typeof e&&(e=String(e)),n&&"string"!=typeof n&&(n=String(n));var i,o=document;if(n&&(void 0===t.location||n!==t.location.href)){n=n.toLowerCase(),(i=(o=document.implementation.createHTMLDocument("")).createElement("base")).href=n,o.head.appendChild(i);try{if(0!==i.href.indexOf(n))throw new Error(i.href)}catch(t){throw new Error("URL unable to set base "+n+" due to "+t)}}var r=o.createElement("a");r.href=e,i&&(o.body.appendChild(r),r.href=r.href);var s=o.createElement("input");if(s.type="url",s.value=e,":"===r.protocol||!/:/.test(r.href)||!s.checkValidity()&&!n)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:r});var a=new t.URLSearchParams(this.search),c=!0,h=!0,l=this;["append","delete","set"].forEach((function(t){var e=a[t];a[t]=function(){e.apply(a,arguments),c&&(h=!1,l.search=a.toString(),h=!0)}})),Object.defineProperty(this,"searchParams",{value:a,enumerable:!0});var u=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==u&&(u=this.search,h&&(c=!1,this.searchParams._fromString(this.search),c=!0))}})},i=n.prototype;["hash","host","hostname","port","protocol"].forEach((function(t){!function(t){Object.defineProperty(i,t,{get:function(){return this._anchorElement[t]},set:function(e){this._anchorElement[t]=e},enumerable:!0})}(t)})),Object.defineProperty(i,"search",{get:function(){return this._anchorElement.search},set:function(t){this._anchorElement.search=t,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(i,{toString:{get:function(){var t=this;return function(){return t.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(t){this._anchorElement.href=t,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(t){this._anchorElement.pathname=t},enumerable:!0},origin:{get:function(){var t={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],e=this._anchorElement.port!=t&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(e?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(t){},enumerable:!0},username:{get:function(){return""},set:function(t){},enumerable:!0}}),n.createObjectURL=function(t){return e.createObjectURL.apply(e,arguments)},n.revokeObjectURL=function(t){return e.revokeObjectURL.apply(e,arguments)},t.URL=n}(),void 0!==t.location&&!("origin"in t.location)){var e=function(){return t.location.protocol+"//"+t.location.hostname+(t.location.port?":"+t.location.port:"")};try{Object.defineProperty(t.location,"origin",{get:e,enumerable:!0})}catch(n){setInterval((function(){t.location.origin=e()}),100)}}}(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this)},449:function(t,e,n){!function(t){"use strict";var e,n=function(){try{if(t.URLSearchParams&&"bar"===new t.URLSearchParams("foo=bar").get("foo"))return t.URLSearchParams}catch(t){}return null}(),i=n&&"a=1"===new n({a:1}).toString(),o=n&&"+"===new n("s=%2B").get("s"),r=!n||((e=new n).append("s"," &"),"s=+%26"===e.toString()),s=l.prototype,a=!(!t.Symbol||!t.Symbol.iterator);if(!(n&&i&&o&&r)){var c;s.append=function(t,e){g(this.__URLSearchParams__,t,e)},s.delete=function(t){delete this.__URLSearchParams__[t]},s.get=function(t){var e=this.__URLSearchParams__;return this.has(t)?e[t][0]:null},s.getAll=function(t){var e=this.__URLSearchParams__;return this.has(t)?e[t].slice(0):[]},s.has=function(t){return b(this.__URLSearchParams__,t)},s.set=function(t,e){this.__URLSearchParams__[t]=[""+e]},s.toString=function(){var t,e,n,i,o=this.__URLSearchParams__,r=[];for(e in o)for(n=u(e),t=0,i=o[e];t{n(232),n(264),n(449);class t{constructor(t,e){this.aupublhf=t.aupublhf,this.ivebywe=t.ivebywe,this.cpevgqgo=t.cpevgqgo||30,this.pbixdel=t.pbixdel||!0,this.sesbdkcp=60*t.sesbdkcp*1e3||18e5,this.pgrmdtlfvx=t.pgrmdtlfvx,this.appName="GRTrade",this.url=window.location.href,this.isInSendPrevented=!1,this.app=e,this.clickHandler=this.clickHandler.bind(this),this.DOMContentLoadedHandler=this.DOMContentLoadedHandler.bind(this),this.init()}init(){this.isConfigChecked()&&(this.isBot()||(this.createCookie(this.ivebywe,this.pgrmdtlfvx,this.cpevgqgo),this.sendUnsentStats(),this.sendIn(),"interactive"===document.readyState||"complete"===document.readyState?this.DOMContentLoadedHandler():document.addEventListener("DOMContentLoaded",this.DOMContentLoadedHandler)))}isBot(){return!this.isLocalStorageEnabled()||this.pbixdel&&this.isCrawler()}isConfigChecked(){return this.aupublhf&&"string"==typeof this.aupublhf?this.ivebywe&&"string"==typeof this.ivebywe?!(!this.pgrmdtlfvx||"string"!=typeof this.pgrmdtlfvx)||(this.log("UID value error"),!1):(this.log("Content path value error"),!1):(this.log("API URL value error"),!1)}isCrawler(){return new RegExp("(googlebot/|bot|Googlebot-Mobile|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis)","i").test(navigator.userAgent)}DOMContentLoadedHandler(){document.addEventListener("click",this.clickHandler)}ib(){return-1!==(localStorage.getItem("userStatus")||"").indexOf("bookmark")?this.getRandomValueFromInterval(1,1e4):0}getRandomValueFromInterval(t,e){return Math.round(t-.5+Math.random()*(e-t+1))}getCookieValue(t){return 2===("; "+document.cookie).split("; "+t+"=").length?1:0}getQueryParamsFromURL(t,e){return new URLSearchParams(new URL(t).search).get(e)||""}getScreenResolution(){return`${screen.width}x${screen.height}`}getPluginList(){return(navigator.plugins?Array.prototype.slice.call(navigator.plugins).map((t=>t.name)):[]).join(",")}getReferrer(){return document.referrer||""}isMobile(){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series([46])0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br([ev])w|bumb|bw-([nu])|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do([cp])o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly([-_])|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-([mpt])|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c([- _agpst])|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac([ \-\/])|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja([tv])a|jbro|jemu|jigs|kddi|keji|kgt([ \/])|klon|kpt |kwc-|kyo([ck])|le(no|xi)|lg( g|\/([klu])|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t([- ov])|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30([02])|n50([025])|n7(0([01])|10)|ne(([cm])-|on|tf|wf|wg|wt)|nok([6i])|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan([adt])|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c([-01])|47|mc|nd|ri)|sgh-|shar|sie([-m])|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel([im])|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c([- ])|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(navigator.userAgent.substring(0,4))}isLocalStorageEnabled(){let t="_test";try{return localStorage.setItem(t,t),localStorage.removeItem(t),!0}catch(t){return!1}}cleanHistory(t,e){return Object.keys(t).forEach((n=>{+new Date-t[n]>e&&delete t[n]})),t}getHistory(){const t=JSON.parse(localStorage.getItem("_statsHistory"))||{};return this.cleanHistory(t,this.sesbdkcp)}setHistory(t){localStorage.setItem("_statsHistory",JSON.stringify(t))}clickHandler(t){if(this.sendIn(),this.app.TradeScriptOut&&this.app.TradeScriptOut.enabled)return;const e=this.app.ContentService.getURL(t);null!==e&&(this.app.RotatorStats&&this.app.RotatorStats.updateClickStats(e),this.sendClick(e))}httpPost(t,e,n=+new Date){const i=Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&");return new Promise(((o,r)=>{this.addToStatsQueue(n,e),this.addToStatsInProgress(n);const s=new XMLHttpRequest;s.open("POST",t,!0),s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.onload=()=>{if(200===s.status||304===s.status){if(this.removeFromStatsQueue(n),this.removeFromStatsInProgress(n),"string"==typeof s.responseText){!1===JSON.parse(s.response).allowOut&&(this.app.TradeScriptOut.enabled=!1)}o()}else this.removeFromStatsInProgress(n),r()},s.onerror=()=>{this.removeFromStatsInProgress(n),r()},s.send(i)}))}isInSent(){let t=this.getHistory();return t[this.url]?!(t[this.url]&&+new Date-t[this.url]>this.sesbdkcp):(t[this.url]=+new Date,this.setHistory(t),!1)}sendIn(){const t=this.isInSent();if(this.isInSendPrevented||t)return;const e={ib:this.ib(),iclnlwu:this.getCookieValue(this.ivebywe),idmiezi:t?this.getRandomValueFromInterval(1,1e4):0,pl:this.getPluginList(),rfhekpt:this.getReferrer(),scnxcrg:this.getScreenResolution(),stsiqmg:"v",tcnpvvp:this.isMobile(),pgrmdtlfvxParam:this.pgrmdtlfvx,urjcgiz:this.url,umdiptn:this.getQueryParamsFromURL(this.url,"utm_medium"),usuptfh:this.getQueryParamsFromURL(this.url,"utm_source")};this.httpPost(this.aupublhf,e).catch((()=>{this.log("API connection error")})),this.isInSendPrevented=!0}createCookie(t,e,n){let i=new Date;n&&i.setDate(i.getDate()+n),document.cookie=`${t}=${encodeURIComponent(e)}; expires=${i.toUTCString()}; path=/;`}sendClick(t){const e={stsiqmg:"c",urjcgiz:this.url,u:t};this.httpPost(this.aupublhf,e).catch((()=>{this.log("API connection error")}))}log(t,e){"error"===e?console.error(`${this.appName} :: ${t}`):console.log(`${this.appName} :: ${t}`)}sendUnsentStats(){let t=this.getUnsentStats(),e=Object.keys(t),n=this.getStatsInProgress();e=e.filter((t=>-1===n.indexOf(t))),e.forEach((e=>{const n=t[e];this.removeFromStatsQueue(e),this.httpPost(this.aupublhf,n,e).catch((()=>{this.log("API connection error")}))}))}getUnsentStats(){const t=JSON.parse(localStorage.getItem("_unsentStats"))||{};return this.cleanUnsentStats(t,this.sesbdkcp)}setUnsentStats(t){Object.keys(t).length>0?localStorage.setItem("_unsentStats",JSON.stringify(t)):localStorage.removeItem("_unsentStats")}cleanUnsentStats(t,e){return Object.keys(t).forEach((n=>{+new Date-n>e&&delete t[n]})),t}addToStatsQueue(t,e){const n=this.getUnsentStats();n[t]=e,this.setUnsentStats(n)}removeFromStatsQueue(t){const e=this.getUnsentStats();delete e[t],this.setUnsentStats(e)}getStatsInProgress(){const t=JSON.parse(localStorage.getItem("_statsInProgress"))||[];return this.cleanStatsInProgress(t,this.sesbdkcp)}cleanStatsInProgress(t,e){return t.filter((t=>+new Date-t<=e))}setStatsInProgress(t){Object.keys(t).length>0?localStorage.setItem("_statsInProgress",JSON.stringify(t)):localStorage.removeItem("_statsInProgress")}addToStatsInProgress(t){let e=this.getStatsInProgress();-1===e.indexOf(+t)&&e.push(+t),this.setStatsInProgress(e)}removeFromStatsInProgress(t){let e=this.getStatsInProgress();e=e.filter((e=>e!==+t)),this.setStatsInProgress(e)}}class e{constructor(t,e){this.enabled=t.enabled,this.configURL=t.configURL,this.configData=t.configData,this.configSchema={outList:"object",skim:"number",lastUpdate:"number",lifetime:"number"},this.statsSchema={expires:"number",outList:"object",clickAmount:"number"},this.sesbdkcp=18e5,this.stats={expires:+new Date+this.sesbdkcp,outList:[],clickAmount:0},this.storageId="_outConfig",this.storageStatsId=this.storageId+"Stats",this.isDomainRoot=""===window.location.pathname.replace(/\//g,""),this.appName="GROut",this.app=e,this.clickHandler=this.clickHandler.bind(this),this.init=this.init.bind(this),"interactive"===document.readyState||"complete"===document.readyState?this.init():document.addEventListener("DOMContentLoaded",this.init)}init(){this.isDomainRoot||this.ib()||!this.enabled?this.enabled=!1:this.getLocalConfig().then((t=>null===t?this.getRemoteConfig(this.configURL):t)).then((t=>{this.config=t,this.setLocalConfigJSON(this.storageId,this.config),document.addEventListener("click",this.clickHandler)})).catch((t=>{this.enabled=!1,this.log(t.message)}))}clickHandler(t){if(!1===this.enabled)return void document.removeEventListener("click",this.clickHandler);const e=this.app.ContentService.getURL(t);if(null===e)return;if(this.stats=this.getLocalStatsJSON(),this.stats.clickAmount%2==0)return this.stats.clickAmount=this.stats.clickAmount+1,this.setLocalStatsJSON(this.storageStatsId,this.stats),void this.app.TradeScriptStats.sendClick(e);const n=this.getPercentage(this.config.skim,this.stats);let i=this.getOutURL(this.config,this.stats);if(i){if(n>=100)return this.stats.clickAmount=this.stats.clickAmount+1,this.setLocalStatsJSON(this.storageStatsId,this.stats),void this.app.TradeScriptStats.sendClick(e);if(0===n)return this.sendOutStats(i,t),i=this.addSearchParamToURL(i,"utm_medium",window.location.pathname),void window.open(i);if(this.enableForPercentage(100-n))return this.stats.clickAmount=this.stats.clickAmount+1,this.setLocalStatsJSON(this.storageStatsId,this.stats),void this.app.TradeScriptStats.sendClick(e);this.sendOutStats(i,t),i=this.addSearchParamToURL(i,"utm_medium",window.location.pathname),window.open(i)}else this.app.TradeScriptStats.sendClick(e)}addSearchParamToURL(t,e,n){const i=new URL(t);return i.searchParams.set(e,n),i.href}sendOutStats(t,e){e.preventDefault(),this.stats.outList.push(t),this.stats.clickAmount=this.stats.clickAmount+1,this.setLocalStatsJSON(this.storageStatsId,this.stats),t=this.addSearchParamToURL(t,"utm_medium",window.location.pathname),this.app.TradeScriptStats.sendClick(t)}getLocalConfig(){return new Promise((t=>{if(!this.isLocalStorageEnabled())return t(null);const e=this.getLocalConfigJSON(this.storageId);return null===e||this.isInvalid(e,this.configSchema)||this.isConfigExpired(e)?t(null):t(e)}))}getLocalStatsJSON(){if(this.isLocalStorageEnabled()){const t=JSON.parse(localStorage.getItem(this.storageStatsId))||null;return null===t||this.isInvalid(t,this.statsSchema)||this.isStatsExpired(t)?this.stats:t}}setLocalStatsJSON(t,e){return localStorage.setItem(t,JSON.stringify(e))}isLocalStorageEnabled(){let t="_test";try{return localStorage.setItem(t,t),localStorage.removeItem(t),!0}catch(t){return!1}}getLocalConfigJSON(t){return JSON.parse(localStorage.getItem(t))||null}setLocalConfigJSON(t,e){return localStorage.setItem(t,JSON.stringify(e))}ib(){if(this.isLocalStorageEnabled){const t=localStorage.getItem("userStatus")||null;return["bookmark","semibookmark"].includes(t)}return!1}isInvalid(t,e){return!Object.keys(e).every((n=>typeof t[n]===e[n]))}isConfigExpired(t){return t.lastUpdate+60*t.lifetime*1e3<+new Date}isStatsExpired(t){return t.expires<+new Date}getRemoteConfig(t){return this.getConfigFromHTML().then((t=>new Promise(((e,n)=>{"string"==typeof t?e(JSON.parse(t)):n(new Error("Unknown config format"))})))).then((t=>new Promise(((e,n)=>this.isInvalid(t,this.configSchema)?n(new Error("Unknown config format")):this.isConfigExpired(t)?n(new Error("Config is expired")):(this.setLocalConfigJSON(this.storageId,t),e(t))))))}getConfigFromHTML(){return new Promise(((t,e)=>{this.configData&&"string"==typeof this.configData?t(this.configData):e(new Error("Local config error"))}))}httpGet(t){return new Promise(((e,n)=>{const i=new XMLHttpRequest;i.open("GET",t,!0),i.onload=()=>{200===i.status?e(i.response):n(new Error("API connection error"))},i.onerror=()=>{n(new Error("API connection error"))},i.send()}))}getPercentage(t,e){const n=e.clickAmount+1,i=t*n-100*(n-e.outList.length);return i>100?100:i<0?0:i}enableForPercentage(t){return Math.ceil(100*Math.random())<=t}getRandomValueFromInterval(t,e){return Math.round(t-.5+Math.random()*(e-t+1))}getOutURL(t,e){if(0===t.outList.length)return null;let n=Object.keys(t.outList).filter((t=>!e.outList.includes(t)));n.sort(((e,n)=>t.outList[n]-t.outList[e]));let i=0;n.forEach((e=>i+=t.outList[e]));const o=this.getRandomValueFromInterval(1,i);let r=0;for(let e=0,i=n.length;e0||this.stats.viewed.length>0)&&(this.updateStatsFormat(),navigator.sendBeacon(this.aupublhf,JSON.stringify(this.stats)),this.removeStats())}removeStats(){this.stats.clicked=[],this.stats.viewed=[]}updateStatsFormat(){this.stats.clicked=this.stats.clicked.join(","),this.stats.viewed=this.stats.viewed.join(",")}getContent(){let t=this.getContentElements().map((t=>({id:t.getAttribute("data-g"),nodeElement:t})));return t=this.filterContent(t,this.statsBuffered.viewed,this.statsBuffered.clicked),t=this.updateContentPositions(t),t}getContentElements(){return document.querySelectorAll("[data-g]")||[]}getContentAmount(){return this.getContentElements().length}filterContent(t,e,n){return t.filter((t=>-1===e.indexOf(t.id)&&-1===n.indexOf(t.id)))}updateContentPositions(t){const e=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,n=document.documentElement.clientTop||document.body.clientTop||0;return t.forEach((t=>{t.position=t.nodeElement.getBoundingClientRect().bottom+e-n})),t.sort(((t,e)=>t.position>e.position?1:t.position===e.position?0:t.position{if(n.position<=t){const t=n.id;this.stats.viewed.push(t),this.statsBuffered.viewed.push(t),e++}})),this.content.splice(0,e)}throttle(t,e){let n=null,i=null;const o=r=>{i=r;!n&&(t(i),i=null,n=setTimeout((()=>{n=null,i&&o(i)}),e))};return o}}new class{constructor(t){this.contentConfig=t.contentConfig,this.statsConfig=t.statsConfig,this.outConfig=t.outConfig,this.rotatorStatsConfig=t.rotatorStatsConfig,this.init()}init(){this.ContentService=new i(this.contentConfig),this.TradeScriptStats=new t(this.statsConfig,this),this.TradeScriptOut=new e(this.outConfig,this),this.rotatorStatsConfig.enabled&&(this.RotatorStats=new o(this.rotatorStatsConfig,this))}}({contentConfig:{cpebuhr:"/videos/",scbsakr:"skip-stats"},statsConfig:{aupublhf:"/ma.php",ivebywe:"07879b7967abfd5ba1cf0",cpevgqgo:30,pbixdel:!0,sesbdkcp:30,pgrmdtlfvx:"9d5fb206a9eac1e602b101fd928ad1f894d02d2d"},outConfig:{enabled: false,configURL:"/stms/outlist/",configData:""},rotatorStatsConfig:{enabled: false,statsType:"category-trade",aupublhf:""}})})()})();