import{d as r,e as l}from"./chunk-H45JNRUV.js";import{Ia as o,Na as i}from"./chunk-V6BPA3D7.js";var d=(()=>{class c{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)}setPageMovedMetas(t){let e=document.querySelector("meta[name=prerender-status-code]");if(e)e.setAttribute("content","301");else{let a=document.createElement("META");a.setAttribute("name","prerender-status-code"),a.setAttribute("content","301"),document.getElementsByTagName("HEAD")[0].appendChild(a)}let n=document.querySelector("meta[name=prerender-header]");if(n)n.setAttribute("content",`Location: ${t}`);else{let a=document.createElement("META");a.setAttribute("name","prerender-header"),a.setAttribute("content","Location:"+t),document.getElementsByTagName("HEAD")[0].appendChild(a)}}removePageMovedMetas(){document.querySelector("meta[name=prerender-status-code]")?.remove(),document.querySelector("meta[name=prerender-header]")?.remove()}static{this.\u0275fac=function(e){return new(e||c)(i(r),i(l))}}static{this.\u0275prov=o({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})();export{d as a};