import{a as y,f as m,d as f,o as T,s as _,u as g,x as w,y as S}from"./vue-vendor.BKvPJiPW.js";import{_ as O,T as b}from"./frontend-components.Cb0sJqJc.js";import{T as u}from"./frontend-templates.BhTenXHY.js";import{a as l}from"./axios-vendor.B9ygI19o.js";import"./frontend-components-large.D6ajlMg-.js";import"./frontend-modules.DdrmqCxF.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))a(t);new MutationObserver(t=>{for(const e of t)if(e.type==="childList")for(const r of e.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&a(r)}).observe(document,{childList:!0,subtree:!0});function c(t){const e={};return t.integrity&&(e.integrity=t.integrity),t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?e.credentials="include":t.crossOrigin==="anonymous"?e.credentials="omit":e.credentials="same-origin",e}function a(t){if(t.ep)return;t.ep=!0;const e=c(t);fetch(t.href,e)}})();const A={name:"App",components:{Toast:b},mounted(){this.$root.$on("update-seo-tags",o=>{this.updateSEOTags(o)})},beforeUnmount(){this.$root.$off("update-seo-tags")},watch:{$route(o){this.$nextTick(()=>{this.updateSEOTags(o),setTimeout(()=>{this.updateSEOTags(this.$route)},200)})},"$route.meta.seo":{handler(o){o&&this.updateSEOTags(this.$route)},deep:!0}},mounted(){this.$nextTick(()=>{this.updateSEOTags(this.$route)}),setTimeout(()=>{this.updateSEOTags(this.$route)},100),this.$nextTick(()=>{this.$refs.toast&&(this.$root.$toast=this.$refs.toast,window.$toast=this.$refs.toast)}),setTimeout(()=>{this.$refs.toast&&(this.$root.$toast=this.$refs.toast,window.$toast=this.$refs.toast)},100)},methods:{updateSEOTags(o){var c,a,t,e;const s=((c=o.meta)==null?void 0:c.seo)||((t=(a=o.meta)==null?void 0:a.componentData)==null?void 0:t.menuItem)||((e=o.meta)==null?void 0:e.componentData);if(s){const r=s.meta_title||s.title;r&&r.trim()!==""&&r!=="CMS Site"&&(document.title=r);let i=document.querySelector('meta[name="description"]');const d=s.meta_description||s.description||"";d?i?i.setAttribute("content",d):(i=document.createElement("meta"),i.setAttribute("name","description"),i.setAttribute("content",d),document.head.appendChild(i)):i&&i.remove();let n=document.querySelector('meta[name="keywords"]');const p=s.meta_keywords||"";p?n?n.setAttribute("content",p):(n=document.createElement("meta"),n.setAttribute("name","keywords"),n.setAttribute("content",p),document.head.appendChild(n)):n&&n.remove()}}}},E={id:"app"};function v(o,s,c,a,t,e){const r=f("router-view"),i=f("Toast");return T(),y("div",E,[m(r),m(i,{ref:"toast"},null,512)])}const x=O(A,[["render",v]]),L=[{path:"/",component:u},{path:"/article/:alias",component:u},{path:"/category/:alias",component:u},{path:"/:pathMatch(.*)*",component:u}];function C(){return _({history:typeof window>"u"?g():w("/"),routes:L})}let h=null;typeof window<"u"&&(h=C());const R=h;l.defaults.baseURL="/frontend/api";l.defaults.withCredentials=!0;const $=S(x);$.use(R);$.mount("#app");