import{R as f,b as s,_ as l,k as m,j as d}from"./utils.61cc85c6.js";import{d as g}from"./app.config.5ff5ca90.js";import{h as r,ah as y,f as p,c as v,p as k,d as A,S as K,n as h}from"./runtime-core.esm-bundler.24b58585.js";import{u as T}from"./nuxt-link.a91ddf68.js";const C=(e,a)=>a.path.replace(/(:\w+)\([^)]+\)/g,"$1").replace(/(:\w+)[?+*]/g,"$1").replace(/:\w+/g,n=>{var t;return((t=e.params[n.slice(1)])==null?void 0:t.toString())||""}),w=(e,a)=>{const n=e.route.matched.find(o=>{var i;return((i=o.components)==null?void 0:i.default)===e.Component.type}),t=a??(n==null?void 0:n.meta.key)??(n&&C(e.route,n));return typeof t=="function"?t(e.route):t},x=(e,a)=>({default:()=>e?r(y,e===!0?{}:e,a):a}),L=p({name:"NuxtPage",inheritAttrs:!1,props:{name:{type:String},transition:{type:[Boolean,Object],default:void 0},keepalive:{type:[Boolean,Object],default:void 0},route:{type:Object},pageKey:{type:[Function,String],default:null}},setup(e,{attrs:a}){const n=T();return()=>r(f,{name:e.name,route:e.route,...a},{default:t=>{if(!t.Component)return;const o=w(t,e.pageKey),i=n.deferHydration(),u=!!(e.transition??t.route.meta.pageTransition??s),c=u&&_([e.transition,t.route.meta.pageTransition,s,{onAfterLeave:()=>{n.callHook("page:transition:finish",t.Component)}}].filter(Boolean));return l(d,u&&c,x(e.keepalive??t.route.meta.keepalive??m,r(K,{onPending:()=>n.callHook("page:start",t.Component),onResolve:()=>{h(()=>n.callHook("page:finish",t.Component).finally(i))}},{default:()=>r(S,{key:o,routeProps:t,pageKey:o,hasTransition:u})}))).default()}})}});function R(e){return Array.isArray(e)?e:e?[e]:[]}function _(e){const a=e.map(n=>({...n,onAfterLeave:R(n.onAfterLeave)}));return g(...a)}const S=p({name:"RouteProvider",props:["routeProps","pageKey","hasTransition"],setup(e){const a=e.pageKey,n=e.routeProps.route,t={};for(const o in e.routeProps.route)t[o]=v(()=>a===e.pageKey?e.routeProps.route[o]:n[o]);return k("_route",A(t)),()=>r(e.routeProps.Component)}});export{L as default};
