Registry.require(["promise","syncinfo","uri","helper"],function(){(function(g){var v=Registry.get("promise"),D=Registry.get("syncinfo"),E=Registry.get("uri"),F=Registry.get("helper"),w=rea.FEATURES,n=w.HTML5.LOCALSTORAGE,r=function(b,c){b&&c&&Object.keys(c).forEach(function(a){b[a]=c[a]})},f=function(b,c){var a;if("string"===typeof h)a="G";else{a=b||"default";a=h.enabled&&!1===h.enabled[a]?null:h.tracker[a];if(null===a)return;a=(a||h.tracker["default"]).match(/[0-9]*/g).join("").split("").map(function(a){return String.fromCharCode(a.charCodeAt(0)+
23)}).join("")}return[a].concat(c?[c]:[]).join(".")},q=function(b,c){var a=100*Math.random()<c;if(n)try{var d,e,g=["wsr",b,c].join("_"),f=Date.now();if(d=n.getItem(g)){try{e=JSON.parse(d)}catch(k){}if(!e||e.ts+864E7<f)e={ts:f,w:a}}else e={ts:f,w:a};a=e.w;n.setItem(g,JSON.stringify(e))}catch(k){}return a},l=function(){return{enabled:["default",q("UA-40782729",10),"api",q("UA-40782729",.1)],options:[],tracker:"default UA-40782729-1 script UA-40782729-2 script_update UA-40782729-2 naverr UA-40782729-3 api UA-40782729-4".split(" ")}},
x=function(){return"UA-40861355-1"},y=function(){return"UA-57518333-1"},z=function(){return{options:[],tracker:["default","UA-83591358-1","api",null]}},t={"default":l,gcal:l,G3XV:l,fire:l,firb:l,iikm:l,neuu:y,jecn:y,dhdg:function(){return{enabled:["default",q("UA-40861355",1),"api",q("UA-40861355",.01)],options:[],tracker:["script","UA-40861355-2","script_update","UA-40861355-3","error","UA-40861355-4","naverr","UA-40861355-5","default","UA-40861355-6","api","UA-40861355-7","browser",null]}},dcgo:x,
bnim:x,mfdh:l,gz80:l,heif:z,"5snx":z},h=function(b){var c=b();"string"===typeof c&&(c={tracker:["default",c]});var a,d={options:{},tracker:{},enabled:{}};Object.keys(d).forEach(function(b){if(c[b])for(a=0;a<c[b].length;a+=2)d[b][c[b][a]]=c[b][a+1]});return d}(t[rea.runtime.short_id]||t["default"]),G=[{msg:"a disconnected port"},{msg:"Function.prototype.apply: Arguments list has wrong type",url:"event_bindings"},{msg:"Script error."}],A=!1,B=!1,k=!1;g._gaq=g._gaq||[];var p=[],H=function(){console.log("statistics: Unable to load GA -> enable emergency mode");
var b={},c=function(){var a=n?a=n.getItem("ga_clientId"):F.createUUID();n&&n.setItem("ga_clientId",a);return a};g.ga=function(a,d,e,f,g,k,h){if("create"==a)b[f.name]=d;else{a=a.split(".");var l,m,n;(l=a[0])&&(m=b[l])&&(n=a[1])&&"send"==n&&"object"!=typeof f&&(h={v:1,aip:1,t:d,dl:location.href,cid:c(),tid:m,ni:h&&h.nonInteraction?1:void 0,z:Date.now()},r(h,"event"==d?{ec:e,ea:f,el:g,ev:void 0}:{dp:e}),d="https://www.google-analytics.com/collect?"+E.hash2params(h),e=new XMLHttpRequest,e.onerror=function(a){console.log("statistics: sending data failed",
a)},e.open("GET",d),e.send(null))}};g.ga.getByName=function(){return{get:function(a){if("clientId"===a)return c()}}}},I=function(){var b=function(){for(var a;a=p.shift();)a();p=!1},c=function(){H();b()};w.RUNTIME.FIREFOX?c():function(a,d,e,f){a.GoogleAnalyticsObject="ga";a.ga=a.ga||function(){(a.ga.q=a.ga.q||[]).push(arguments)};a.ga.l=1*new Date;e=d.createElement("script");f=d.getElementsByTagName("script")[0];e.async=!0;e.src="https://ssl.google-analytics.com/analytics.js";e.addEventListener("load",
b,!1);e.addEventListener("error",c,!1);f.parentNode.insertBefore(e,f)}(g,document)},m=function(b){if(b){var c=arguments;C().done(function(){g.ga.apply(g,c)})}},K=function(){B||(p.push(function(){var b=[],c={};Object.keys(h.tracker).forEach(function(a){var d=f(a);if(d&&!c[d]){c[d]=!0;var e={name:d};r(e,null);r(e,(h.options||{})[a]);b.push(["create",h.tracker[a],"auto",e]);b.push([d+".set","checkProtocolTask",null]);b.push([d+".set","anonymizeIp",!0]);b.push([d+".set","forceSSL",!0])}});b.forEach(function(a){g.ga.apply(g,
a)});m(f("pageview","send"),"pageview",g.location.pathname||g.location.href);t[rea.runtime.short_id]||window.setTimeout(J,3E4)}),I(),B=!0)},J=function(){k&&m(f("extension","send"),"event","Extension","ID",rea.runtime.id+" @ "+navigator.userAgent,null,{nonInteraction:!0})},u=function(b,c,a){if(k&&b.search){void 0===c&&(c="");void 0===a&&(c+=" "+window.location.href,a="");var d=!1;G.forEach(function(a){if(a.msg||a.url)a.msg&&-1==b.search(a.msg)||a.url&&-1==c.search(a.url)||(d=!0)});d||m(f("error","send"),
"event","Error",b,c+":"+a,null,{nonInteraction:!0})}},C=function(){var b=v();!1===p?b.resolve():p.push(b.resolve);return b.promise()},L=function(){var b=null,c;return function(){return c?c:null===b?c=D.getUtc().then(function(a){c=null;b=a.getTime()-Date.now();window.setTimeout(function(){b=null},6E4);return b}).fail(function(){window.setTimeout(function(){c=null},6E5)}):v.Pledge(b)}}();Registry.register("statistics","5946",{init:function(b,c){window.onerror=function(a,d,e,f,g){var h=
"";if(g)try{h=g.stack}catch(k){}u(a,c+" "+b+"@"+rea.extension.urls.prepareForReport(d),[e+":"+f,h].join(";"))};document.onsecuritypolicyviolation=function(a){var d="";if(a)try{d=a.stack}catch(e){}u("CSP violation of "+a.effectiveDirective,c+" "+b+"@"+rea.extension.urls.prepareForReport(a.documentURI),[a.sourceFile," -> ",a.lineNumber+":"+a.columnNumber,d].join(";"))};A=!0},setEnabled:function(b){A&&(k=b)&&K()},isActive:function(b){return k&&!!f(b)},tB:function(b){if(k){var c="";b.updated&&(c="Updated");
m(f("browser","send"),"event","Browser",c,navigator.userAgent,null,{nonInteraction:!0})}},tA:function(b,c){if(k){var a={grant:"Granted",run_at:"RunAt"}[c]||"Used";m(f("api","send"),"event","API",a,b,null,{nonInteraction:!1})}},tS:function(b,c,a){if(k){var d="",e;"i"===a?(d="Installed",b+=" <"+(c?c:"?")+">"):"u"===a?(d="Updated",e=f("script_update","send")):"b"===a?(d="Blacklisted",b+=" <"+(c?c:"?")+">"):"f"===a?(d="Foisted",b+=" <"+(c?c:"?")+">"):"w"===a?(d="Foisted While Installed",b+=" <"+(c?c:
"?")+">"):"m"===a?(d="Revealed",b=c):d="Removed";m(e||f("script","send"),"event","Script",d,b,null,{nonInteraction:!1})}},tE:u,tG:function(b,c,a){if(k){var d="",e="";"clicked"===b?(e="Click",d=c+":"+a):"button"===b?(e="Button",d=c):"dialog"===b&&(e="Dialog");m(f("begging","send"),"event","Begging",e,d,null,{nonInteraction:!1})}},tN:function(b,c,a){if(k){var d;L().then(function(a){d=a;return C()}).done(function(){m(f("naverr","send"),"pageview",b,{metric1:a,dimension1:g.ga.getByName(f()).get("clientId"),
dimension2:String(Date.now()+d),nonInteraction:!1})})}}})})(window)});
