import{f as j,g as _,s as T,h as B,i as A,j as E,k as N,l as U,m as F,n as I,p as L,q as P,v as D,x as k,y as H,z as p,A as O,B as V,C as z,D as M,E as W,F as G,G as $}from"./D5RAwM_h.js";const Q=(...t)=>t.find(u=>u!==void 0);function J(t){const u=t.componentName||"NuxtLink";function h(e){return typeof e=="string"&&e.startsWith("#")}function C(e,r,m){const a=m??t.trailingSlash;if(!e||a!=="append"&&a!=="remove")return e;if(typeof e=="string")return R(e,a);const o="path"in e&&e.path!==void 0?e.path:r(e).path;return{...e,name:void 0,path:R(o,a)}}function q(e){const r=_(),m=z(),a=p(()=>!!e.target&&e.target!=="_self"),o=p(()=>{const f=e.to||e.href||"";return typeof f=="string"&&O(f,{acceptRelative:!0})}),x=P("RouterLink"),g=typeof x!="string"?x.useLink:void 0,d=p(()=>{if(e.external)return!0;const f=e.to||e.href||"";return typeof f=="object"?!1:f===""||o.value}),l=p(()=>{const f=e.to||e.href||"";return d.value?f:C(f,r.resolve,e.trailingSlash)}),c=d.value||g==null?void 0:g({...e,to:l}),y=p(()=>{var S;const f=e.trailingSlash??t.trailingSlash;if(!l.value||o.value||h(l.value))return l.value;if(d.value){const b=typeof l.value=="object"&&"path"in l.value?k(l.value):l.value,n=typeof b=="object"?r.resolve(b).href:b;return R(n,f)}return typeof l.value=="object"?((S=r.resolve(l.value))==null?void 0:S.href)??null:R(V(m.app.baseURL,l.value),f)});return{to:l,hasTarget:a,isAbsoluteUrl:o,isExternal:d,href:y,isActive:(c==null?void 0:c.isActive)??p(()=>l.value===r.currentRoute.value.path),isExactActive:(c==null?void 0:c.isExactActive)??p(()=>l.value===r.currentRoute.value.path),route:(c==null?void 0:c.route)??p(()=>r.resolve(l.value)),async navigate(f){await M(y.value,{replace:e.replace,external:d.value||a.value})}}}return j({name:u,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1},trailingSlash:{type:String,default:void 0,required:!1}},useLink:q,setup(e,{slots:r}){const m=_(),{to:a,href:o,navigate:x,isExternal:g,hasTarget:d,isAbsoluteUrl:l}=q(e),c=T(!1),y=B(null),f=n=>{var s;y.value=e.custom?(s=n==null?void 0:n.$el)==null?void 0:s.nextElementSibling:n==null?void 0:n.$el};function S(n){var s,i;return!c.value&&(typeof e.prefetchOn=="string"?e.prefetchOn===n:((s=e.prefetchOn)==null?void 0:s[n])??((i=t.prefetchOn)==null?void 0:i[n]))&&(e.prefetch??t.prefetch)!==!1&&e.noPrefetch!==!0&&e.target!=="_blank"&&!Y()}async function b(n=A()){if(c.value)return;c.value=!0;const s=typeof a.value=="string"?a.value:g.value?k(a.value):m.resolve(a.value).fullPath,i=g.value?new URL(s,window.location.href).href:s;await Promise.all([n.hooks.callHook("link:prefetch",i).catch(()=>{}),!g.value&&!d.value&&H(a.value,m).catch(()=>{})])}if(S("visibility")){const n=A();let s,i=null;E(()=>{const v=K();N(()=>{s=U(()=>{var w;(w=y==null?void 0:y.value)!=null&&w.tagName&&(i=v.observe(y.value,async()=>{i==null||i(),i=null,await b(n)}))})})}),F(()=>{s&&I(s),i==null||i(),i=null})}return()=>{var i;if(!g.value&&!d.value&&!h(a.value)){const v={ref:f,to:a.value,activeClass:e.activeClass||t.activeClass,exactActiveClass:e.exactActiveClass||t.exactActiveClass,replace:e.replace,ariaCurrentValue:e.ariaCurrentValue,custom:e.custom};return e.custom||(S("interaction")&&(v.onPointerenter=b.bind(null,void 0),v.onFocus=b.bind(null,void 0)),c.value&&(v.class=e.prefetchedClass||t.prefetchedClass),v.rel=e.rel||void 0),L(P("RouterLink"),v,r.default)}const n=e.target||null,s=Q(e.noRel?"":e.rel,t.externalRelAttribute,l.value||d.value?"noopener noreferrer":"")||null;return e.custom?r.default?r.default({href:o.value,navigate:x,prefetch:b,get route(){if(!o.value)return;const v=new URL(o.value,window.location.href);return{path:v.pathname,fullPath:v.pathname,get query(){return D(v.search)},hash:v.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:o.value}},rel:s,target:n,isExternal:g.value||d.value,isActive:!1,isExactActive:!1}):null:L("a",{ref:y,href:o.value||null,rel:s,target:n},(i=r.default)==null?void 0:i.call(r))}}})}const ee=J($);function R(t,u){const h=u==="append"?W:G;return O(t)&&!t.startsWith("http")?t:h(t,!0)}function K(){const t=A();if(t._observer)return t._observer;let u=null;const h=new Map,C=(e,r)=>(u||(u=new IntersectionObserver(m=>{for(const a of m){const o=h.get(a.target);(a.isIntersecting||a.intersectionRatio>0)&&o&&o()}})),h.set(e,r),u.observe(e),()=>{h.delete(e),u==null||u.unobserve(e),h.size===0&&(u==null||u.disconnect(),u=null)});return t._observer={observe:C}}const X=/2g/;function Y(){const t=navigator.connection;return!!(t&&(t.saveData||X.test(t.effectiveType)))}export{ee as _};