import{_ as x}from"./BY0xeA_q.js";import{d as C,J as T,a3 as $,g as b,a4 as A,e as u,o as r,c as m,l as p,m as e,b as B,a as D,n as E,_ as w,t as K}from"./B08CJtNn.js";import{_ as L}from"./fTZc3uM5.js";import"./DbksU3dH.js";import"./88opOQSr.js";const d={BASE_URL:"https://api.koalityguide.com/?identifier=",pageSize:"monitoring.performance.pagesize",uptime:"monitoring.uptime.uptime",browserTimings:"monitoring.performance.browserspeed",serverTimings:"monitoring.performance.serverspeed",lighthouse:"monitoring.performance.lighthouse",seoscore:"monitoring.seo.lighthouse",sitemapmobile:"monitoring.seo.sitemap",contentBroken:"monitoring.content.content",javascript:"monitoring.technology.technology",certs:"monitoring.security.https",cookiesCount:"monitoring.security.cookieCount",cookieCount:"monitoring.security.cookieCount",insecureElements:"monitoring.security.insecureElements"},N={key:1,class:"transition-discrete delay-700 duration-1000 ease-in-out starting:opacity-0 ending:opacity-100"},S={class:"text-sm text-uiText-toned flex items-center gap-2"},U=C({__name:"AdvisorContent",props:{infoType:{},guideKey:{}},setup(g){const t=g,{locale:s}=T(),{setCachedData:l,addTimeToProcessedData:_}=$(),f=b(()=>t.guideKey?`advisor-${t.guideKey.replace(".","-")}-${s.value}`:`advisor-${t.infoType}-${s.value}`),{data:i,error:a,status:c,refresh:y}=A(f.value,async()=>await $fetch(`${d.BASE_URL}${t.guideKey||d[t.infoType]}&language=${s.value}&format=md&fallbackLanguage=en`),{transform:o=>_(o,36e5),getCachedData:(o,h,n)=>{if(!(n.cause==="refresh:manual"||n.cause==="refresh:hook"))return l(o)}});return(o,h)=>{const n=x,v=w,k=L;return r(),u("div",null,[e(a)?(r(),m(n,{key:0,error:e(a),refresh:e(y)},null,8,["error","refresh"])):e(c)==="pending"?(r(),u("div",N,[B("p",S,[D(v,{name:"svg-spinners:90-ring-with-bg",class:"size-4"}),E(" "+K(o.$t("Loading advisor content...")),1)])])):p("",!0),e(c)==="success"&&e(i)?.content?(r(),m(k,{key:2,text:e(i)?.content,markdown:"","big-typo":!0,class:"text-uiText-muted transition-discrete duration-300 ease-in-out opacity-100 starting:opacity-0"},null,8,["text"])):p("",!0)])}}}),F=Object.assign(U,{__name:"AdvisorContent"});export{F as default};
