import{d as l,e as o}from"./chunk-H45JNRUV.js";import{Ia as a,Na as c}from"./chunk-V6BPA3D7.js";var h=(()=>{class i{constructor(t,e){this.metaService=t,this.titleService=e,this.createCanonicalTag(document.URL)}createCanonicalTag(t){this.canonicalElement=document.querySelector("link[rel=canonical]"),this.canonicalElement||(this.canonicalElement=document.createElement("link"),this.canonicalElement.setAttribute("rel","canonical"),document.head.appendChild(this.canonicalElement),this.canonicalElement.setAttribute("href",t))}removeCanonicalUrls(){let t=document.querySelectorAll("link[rel=canonical]");for(let e=0,n=t.length;e<n;e++)t[e].remove();this.canonicalElement=document.querySelector("link[rel=canonical]")}setSeoTags({title:t,metas:e}){this.titleService.setTitle(t),this.setMetas(e)}setMetas(t){Object.keys(t).map(e=>t[e]).forEach(e=>{if(e.content)this.metaService.updateTag(e);else{let n=Object.keys(e)[0];n&&this.metaService.removeTag(`${n}='${e[n]}'`)}})}setCanonicalUrl(t){this.canonicalElement?this.canonicalElement.setAttribute("href",t):this.createCanonicalTag(t)}static{this.\u0275fac=function(e){return new(e||i)(c(l),c(o))}}static{this.\u0275prov=a({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{h as a};