import{r as t}from"./p-76ab1744.js";const o={DK:"Denmark",EE:"Estonia",FI:"Finland",LT:"Lithuania",NO:"Norway",SE:"Sweden",Global:"Global"};Object.values(o);const s=class{constructor(o){t(this,o),this.project="",this.country=null,this.cache=new Set}handleVocaInternalUStats(t){if("localhost"===window.location.hostname)try{const s=o[this.country]||(()=>{throw new Error('telia-voca-stats "country" prop is invalid')})(),a=`${t.detail.voca_component}-${t.detail.voca_added}`;if(!this.cache.has(a)&&this.project){const o=Object.assign({voca_project:this.project,voca_country:s},t.detail);this.cache.add(a),fetch("https://stats.api.voca.teliacompany.com/components",{method:"POST",body:JSON.stringify(o)}).then((t=>t.json())).catch((t=>{console.error(t.body)}))}}catch(t){console.error(t.message)}}render(){return null}};export{s as telia_voca_stats}