Criada a API do site

This commit is contained in:
Caio1w
2025-10-29 19:56:41 -03:00
parent f201c8edbd
commit 4a14f533d2
3074 changed files with 780728 additions and 41 deletions

21
node_modules/vue-router/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2019-present Eduardo San Martin Morote
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

111
node_modules/vue-router/README.md generated vendored Normal file
View File

@@ -0,0 +1,111 @@
# vue-router [![release candidate](https://img.shields.io/npm/v/vue-router.svg)](https://www.npmjs.com/package/vue-router) [![test](https://github.com/vuejs/router/actions/workflows/test.yml/badge.svg)](https://github.com/vuejs/router/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/vuejs/router/graph/badge.svg?token=azNM3FI0d1)](https://codecov.io/gh/vuejs/router)
> - This is the repository for Vue Router 4 (for Vue 3)
> - For Vue Router 3 (for Vue 2) see [vuejs/vue-router](https://github.com/vuejs/vue-router).
<h2 align="center">Supporting Vue Router</h2>
Vue Router is part of the Vue Ecosystem and is an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider:
- [Become a Sponsor on GitHub](https://github.com/sponsors/posva)
- [One-time donation via PayPal](https://paypal.me/posva)
<!--sponsors start-->
<h4 align="center">Gold Sponsors</h4>
<p align="center">
<a href="https://www.coderabbit.ai/?utm_source=vuerouter&utm_medium=sponsor" target="_blank" rel="noopener noreferrer">
<picture>
<source srcset="https://posva-sponsors.pages.dev/logos/coderabbitai-dark.svg" media="(prefers-color-scheme: dark)" height="72px" alt="CodeRabbit" />
<img src="https://posva-sponsors.pages.dev/logos/coderabbitai-light.svg" height="72px" alt="CodeRabbit" />
</picture>
</a>
</p>
<h4 align="center">Silver Sponsors</h4>
<p align="center">
<a href="https://www.vuemastery.com/" target="_blank" rel="noopener noreferrer">
<picture>
<source srcset="https://posva-sponsors.pages.dev/logos/vuemastery-dark.png" media="(prefers-color-scheme: dark)" height="42px" alt="VueMastery" />
<img src="https://posva-sponsors.pages.dev/logos/vuemastery-light.svg" height="42px" alt="VueMastery" />
</picture>
</a>
<a href="https://www.prefect.io/" target="_blank" rel="noopener noreferrer">
<picture>
<source srcset="https://posva-sponsors.pages.dev/logos/prefectlogo-dark.svg" media="(prefers-color-scheme: dark)" height="42px" alt="Prefect" />
<img src="https://posva-sponsors.pages.dev/logos/prefectlogo-light.svg" height="42px" alt="Prefect" />
</picture>
</a>
<a href="https://www.controla.ai/?utm_source=posva" target="_blank" rel="noopener noreferrer">
<picture>
<source srcset="https://posva-sponsors.pages.dev/logos/controla-dark.png" media="(prefers-color-scheme: dark)" height="42px" alt="Controla" />
<img src="https://posva-sponsors.pages.dev/logos/controla-light.png" height="42px" alt="Controla" />
</picture>
</a>
<a href=" https://jobs.sendcloud.com" target="_blank" rel="noopener noreferrer">
<picture>
<source srcset="https://posva-sponsors.pages.dev/logos/sendcloud-dark.svg" media="(prefers-color-scheme: dark)" height="42px" alt="SendCloud" />
<img src="https://posva-sponsors.pages.dev/logos/sendcloud-light.svg" height="42px" alt="SendCloud" />
</picture>
</a>
<a href="https://route4me.com" target="_blank" rel="noopener noreferrer">
<picture>
<source srcset="https://posva-sponsors.pages.dev/logos/route4me.png" media="(prefers-color-scheme: dark)" height="42px" alt="Route Optimizer and Route Planner Software" />
<img src="https://posva-sponsors.pages.dev/logos/route4me.png" height="42px" alt="Route Optimizer and Route Planner Software" />
</picture>
</a>
</p>
<h4 align="center">Bronze Sponsors</h4>
<p align="center">
<a href="https://storyblok.com" target="_blank" rel="noopener noreferrer">
<picture>
<source srcset="https://posva-sponsors.pages.dev/logos/storyblok.png" media="(prefers-color-scheme: dark)" height="26px" alt="Storyblok" />
<img src="https://posva-sponsors.pages.dev/logos/storyblok.png" height="26px" alt="Storyblok" />
</picture>
</a>
<a href="https://nuxtlabs.com" target="_blank" rel="noopener noreferrer">
<picture>
<source srcset="https://posva-sponsors.pages.dev/logos/nuxt-dark.svg" media="(prefers-color-scheme: dark)" height="26px" alt="NuxtLabs" />
<img src="https://posva-sponsors.pages.dev/logos/nuxt-light.svg" height="26px" alt="NuxtLabs" />
</picture>
</a>
<a href="https://stormier.ninja" target="_blank" rel="noopener noreferrer">
<picture>
<source srcset="https://avatars.githubusercontent.com/u/2486424?u=7b0c73ae5d090ce53bf59473094e9606fe082c59&v=4" media="(prefers-color-scheme: dark)" height="26px" alt="Stanislas Ormières" />
<img src="https://avatars.githubusercontent.com/u/2486424?u=7b0c73ae5d090ce53bf59473094e9606fe082c59&v=4" height="26px" alt="Stanislas Ormières" />
</picture>
</a>
</p>
<!--sponsors end-->
---
Get started with the [documentation](https://router.vuejs.org).
## Quickstart
- Via CDN: `<script src="https://unpkg.com/vue-router@4"></script>`
- In-browser playground on [CodeSandbox](https://codesandbox.io/s/vue-router-4-reproduction-hb9lh)
- Add it to an existing Vue Project:
```bash
npm install vue-router@4
```
## Changes from Vue Router 3
Please consult the [Migration Guide](https://router.vuejs.org/guide/migration/).
## Contributing
See [Contributing Guide](https://github.com/vuejs/router/blob/main/.github/contributing.md).
## Special Thanks
<a href="https://www.browserstack.com">
<img src="https://github.com/vuejs/vue-router/raw/dev/assets/browserstack-logo-600x315.png" height="80" title="BrowserStack Logo" alt="BrowserStack Logo" />
</a>
Special thanks to [BrowserStack](https://www.browserstack.com) for letting the maintainers use their service to debug browser specific issues.

1218
node_modules/vue-router/dist/devtools-BLCumUwL.mjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

38
node_modules/vue-router/dist/experimental/index.d.mts generated vendored Normal file
View File

@@ -0,0 +1,38 @@
/*!
* vue-router v4.6.3
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/
import { EXPERIMENTAL_RouteRecordNormalized, EXPERIMENTAL_RouteRecordNormalized_Group, EXPERIMENTAL_RouteRecordNormalized_Matchable, EXPERIMENTAL_RouteRecordRaw, EXPERIMENTAL_RouteRecord_Base, EXPERIMENTAL_RouteRecord_Group, EXPERIMENTAL_RouteRecord_Matchable, EXPERIMENTAL_Router, EXPERIMENTAL_RouterOptions, EXPERIMENTAL_RouterOptions_Base, EXPERIMENTAL_Router_Base, EmptyParams, MatcherParamsFormatted, MatcherPattern, MatcherPatternHash, MatcherPatternPath, MatcherPatternPathDynamic, MatcherPatternPathDynamic_ParamOptions, MatcherPatternPathStatic, MatcherPatternQuery, MatcherPatternQueryParam, MatcherQueryParams, MatcherQueryParamsValue, PARAM_PARSER_BOOL, PARAM_PARSER_INT, ParamParser, createFixedResolver, defineParamParser, definePathParamParser, defineQueryParamParser, experimental_createRouter, mergeRouteRecord, normalizeRouteRecord } from "../router-BbqN7H95.mjs";
//#region src/experimental/route-resolver/matchers/errors.d.ts
/**
* Error throw when a matcher matches by regex but validation fails.
*/
declare class MatchMiss extends Error {
name: string;
}
/**
* Helper to create a {@link MatchMiss} error.
* @param args - Arguments to pass to the `MatchMiss` constructor.
*
* @example
* ```ts
* throw miss()
* // in a number param matcher
* throw miss('Number must be finite')
* ```
*/
declare const miss: (...args: ConstructorParameters<typeof MatchMiss>) => MatchMiss;
//#endregion
//#region src/experimental/index.d.ts
declare module 'vue-router' {
interface RouteLocationMatched {
/**
* The experimental router uses a `parent` property instead of `children`.
*/
children?: never;
}
}
//#endregion
export { type EXPERIMENTAL_RouteRecordNormalized, type EXPERIMENTAL_RouteRecordNormalized_Group, type EXPERIMENTAL_RouteRecordNormalized_Matchable, type EXPERIMENTAL_RouteRecordRaw, type EXPERIMENTAL_RouteRecord_Base, type EXPERIMENTAL_RouteRecord_Group, type EXPERIMENTAL_RouteRecord_Matchable, type EXPERIMENTAL_Router, type EXPERIMENTAL_RouterOptions, type EXPERIMENTAL_RouterOptions_Base, type EXPERIMENTAL_Router_Base, type EmptyParams, MatchMiss, type MatcherParamsFormatted, type MatcherPattern, type MatcherPatternHash, type MatcherPatternPath, MatcherPatternPathDynamic, type MatcherPatternPathDynamic_ParamOptions, MatcherPatternPathStatic, type MatcherPatternQuery, MatcherPatternQueryParam, type MatcherQueryParams, type MatcherQueryParamsValue, PARAM_PARSER_BOOL, PARAM_PARSER_INT, type ParamParser, mergeRouteRecord as _mergeRouteRecord, createFixedResolver, defineParamParser, definePathParamParser, defineQueryParamParser, experimental_createRouter, miss, normalizeRouteRecord };

754
node_modules/vue-router/dist/experimental/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,754 @@
/*!
* vue-router v4.6.3
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/
import { ErrorTypes, NEW_stringifyURL, NavigationType, START_LOCATION_NORMALIZED, addDevtools, assign, computeScrollPosition, createRouterError, decode, encodeParam, encodePath, extractChangingRecords, extractComponentsGuards, getSavedScrollPosition, getScrollKey, guardToPromiseFn, identityFn, isArray, isBrowser, isNavigationFailure, isSameRouteLocation, noop, normalizeQuery, parseQuery, parseURL, resolveRelativePath, routeLocationKey, routerKey, routerViewLocationKey, saveScrollPosition, scrollToPosition, stringifyQuery, useCallbacks, warn as warn$1 } from "../devtools-BLCumUwL.mjs";
import { nextTick, shallowReactive, shallowRef, toValue, unref, warn } from "vue";
//#region src/experimental/router.ts
function normalizeRouteRecord(record) {
const normalizedRecord = {
meta: {},
props: {},
parent: null,
...record,
instances: {},
leaveGuards: /* @__PURE__ */ new Set(),
updateGuards: /* @__PURE__ */ new Set()
};
Object.defineProperty(normalizedRecord, "mods", { value: {} });
return normalizedRecord;
}
/**
* Merges route record objects for the experimental resolver format.
* This function is specifically designed to work with objects that will be passed to normalizeRouteRecord().
*
* @internal
*
* @param main - main route record object
* @param routeRecords - route records to merge (from definePage imports)
* @returns merged route record object
*/
function mergeRouteRecord(main, ...routeRecords) {
for (const record of routeRecords) {
main.meta = {
...main.meta,
...record.meta
};
main.props = {
...main.props,
...record.props
};
}
return main;
}
/**
* Creates an experimental Router that allows passing a resolver instead of a
* routes array. This router does not have `addRoute()` and `removeRoute()`
* methods and is meant to be used with unplugin-vue-router by generating the
* resolver from the `pages/` folder
*
* @param options - Options to initialize the router
*/
function experimental_createRouter(options) {
let { resolver, stringifyQuery: stringifyQuery$1 = stringifyQuery, history: routerHistory } = options;
const beforeGuards = useCallbacks();
const beforeResolveGuards = useCallbacks();
const afterGuards = useCallbacks();
const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
let pendingLocation = START_LOCATION_NORMALIZED;
if (isBrowser && options.scrollBehavior) history.scrollRestoration = "manual";
function resolve(...[to, currentLocation]) {
const matchedRoute = resolver.resolve(to, currentLocation ?? (typeof to === "string" ? currentRoute.value : void 0));
const href = routerHistory.createHref(matchedRoute.fullPath);
if (process.env.NODE_ENV !== "production") {
if (href.startsWith("//")) warn(`Location ${JSON.stringify(to)} resolved to "${href}". A resolved location cannot start with multiple slashes.`);
if (!matchedRoute.matched.length) warn(`No match found for location with path "${to}"`);
}
return assign(matchedRoute, {
redirectedFrom: void 0,
href,
meta: mergeMetaFields(matchedRoute.matched)
});
}
function checkCanceledNavigation(to, from) {
if (pendingLocation !== to) return createRouterError(ErrorTypes.NAVIGATION_CANCELLED, {
from,
to
});
}
const push = (...args) => pushWithRedirect(resolve(...args));
const replace = (...args) => pushWithRedirect(resolve(...args), true);
function handleRedirectRecord(to, from) {
const redirect = to.matched.at(-1)?.redirect;
if (redirect) return resolver.resolve(typeof redirect === "function" ? redirect(to, from) : redirect, from);
}
function pushWithRedirect(to, replace$1, redirectedFrom) {
replace$1 = to.replace ?? replace$1;
pendingLocation = to;
const from = currentRoute.value;
const data = to.state;
const force = to.force;
const shouldRedirect = handleRedirectRecord(to, from);
if (shouldRedirect) return pushWithRedirect({
...resolve(shouldRedirect, currentRoute.value),
state: typeof shouldRedirect === "object" ? assign({}, data, shouldRedirect.state) : data,
force
}, replace$1, redirectedFrom || to);
const toLocation = to;
toLocation.redirectedFrom = redirectedFrom;
let failure;
if (!force && isSameRouteLocation(stringifyQuery$1, from, to)) {
failure = createRouterError(ErrorTypes.NAVIGATION_DUPLICATED, {
to: toLocation,
from
});
handleScroll(from, from, true, false);
}
return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure$1) => {
if (failure$1) {
if (isNavigationFailure(failure$1, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) {
if (process.env.NODE_ENV !== "production" && isSameRouteLocation(stringifyQuery$1, resolve(failure$1.to), toLocation) && redirectedFrom && (redirectedFrom._count = redirectedFrom._count ? redirectedFrom._count + 1 : 1) > 30) {
warn(`Detected a possibly infinite redirection in a navigation guard when going from "${from.fullPath}" to "${toLocation.fullPath}". Aborting to avoid a Stack Overflow.\n Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`);
return Promise.reject(/* @__PURE__ */ new Error("Infinite redirect in navigation guard"));
}
return pushWithRedirect({
...resolve(failure$1.to, currentRoute.value),
state: typeof failure$1.to === "object" ? assign({}, data, failure$1.to.state) : data,
force
}, replace$1, redirectedFrom || toLocation);
}
} else failure$1 = finalizeNavigation(toLocation, from, true, replace$1, data);
triggerAfterEach(toLocation, from, failure$1);
return failure$1;
});
}
/**
* Helper to reject and skip all navigation guards if a new navigation happened
* @param to
* @param from
*/
function checkCanceledNavigationAndReject(to, from) {
const error = checkCanceledNavigation(to, from);
return error ? Promise.reject(error) : Promise.resolve();
}
function runWithContext(fn) {
const app = installedApps.values().next().value;
return app?.runWithContext ? app.runWithContext(fn) : fn();
}
function navigate(to, from) {
let guards;
const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
for (const record of leavingRecords) record.leaveGuards.forEach((guard) => {
guards.push(guardToPromiseFn(guard, to, from));
});
const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
guards.push(canceledNavigationCheck);
return runGuardQueue(guards).then(() => {
guards = [];
for (const guard of beforeGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
for (const record of updatingRecords) record.updateGuards.forEach((guard) => {
guards.push(guardToPromiseFn(guard, to, from));
});
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
guards = [];
for (const record of enteringRecords) if (record.beforeEnter) if (isArray(record.beforeEnter)) for (const beforeEnter of record.beforeEnter) guards.push(guardToPromiseFn(beforeEnter, to, from));
else guards.push(guardToPromiseFn(record.beforeEnter, to, from));
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
to.matched.forEach((record) => record.enterCallbacks = {});
guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
guards = [];
for (const guard of beforeResolveGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).catch((err) => isNavigationFailure(err, ErrorTypes.NAVIGATION_CANCELLED) ? err : Promise.reject(err));
}
function triggerAfterEach(to, from, failure) {
afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
}
/**
* - Cleans up any navigation guards
* - Changes the url if necessary
* - Calls the scrollBehavior
*/
function finalizeNavigation(toLocation, from, isPush, replace$1, data) {
const error = checkCanceledNavigation(toLocation, from);
if (error) return error;
const isFirstNavigation = from === START_LOCATION_NORMALIZED;
const state = !isBrowser ? {} : history.state;
if (isPush) if (replace$1 || isFirstNavigation) routerHistory.replace(toLocation.fullPath, assign({ scroll: isFirstNavigation && state && state.scroll }, data));
else routerHistory.push(toLocation.fullPath, data);
currentRoute.value = toLocation;
handleScroll(toLocation, from, isPush, isFirstNavigation);
markAsReady();
}
let removeHistoryListener;
function setupListeners() {
if (removeHistoryListener) return;
removeHistoryListener = routerHistory.listen((to, _from, info) => {
if (!router.listening) return;
const toLocation = resolve(to);
const shouldRedirect = handleRedirectRecord(toLocation, router.currentRoute.value);
if (shouldRedirect) {
pushWithRedirect(assign(resolve(shouldRedirect), { force: true }), true, toLocation).catch(noop);
return;
}
pendingLocation = toLocation;
const from = currentRoute.value;
if (isBrowser) saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
navigate(toLocation, from).catch((error) => {
if (isNavigationFailure(error, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_CANCELLED)) return error;
if (isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) {
pushWithRedirect(assign(resolve(error.to), { force: true }), void 0, toLocation).then((failure) => {
if (isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED) && !info.delta && info.type === NavigationType.pop) routerHistory.go(-1, false);
}).catch(noop);
return Promise.reject();
}
if (info.delta) routerHistory.go(-info.delta, false);
return triggerError(error, toLocation, from);
}).then((failure) => {
failure = failure || finalizeNavigation(toLocation, from, false);
if (failure) {
if (info.delta && !isNavigationFailure(failure, ErrorTypes.NAVIGATION_CANCELLED)) routerHistory.go(-info.delta, false);
else if (info.type === NavigationType.pop && isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED)) routerHistory.go(-1, false);
}
triggerAfterEach(toLocation, from, failure);
}).catch(noop);
});
}
let readyHandlers = useCallbacks();
let errorListeners = useCallbacks();
let ready;
/**
* Trigger errorListeners added via onError and throws the error as well
*
* @param error - error to throw
* @param to - location we were navigating to when the error happened
* @param from - location we were navigating from when the error happened
* @returns the error as a rejected promise
*/
function triggerError(error, to, from) {
markAsReady(error);
const list = errorListeners.list();
if (list.length) list.forEach((handler) => handler(error, to, from));
else {
if (process.env.NODE_ENV !== "production") warn("uncaught error during route navigation:");
console.error(error);
}
return Promise.reject(error);
}
function isReady() {
if (ready && currentRoute.value !== START_LOCATION_NORMALIZED) return Promise.resolve();
return new Promise((resolve$1, reject) => {
readyHandlers.add([resolve$1, reject]);
});
}
function markAsReady(err) {
if (!ready) {
ready = !err;
setupListeners();
readyHandlers.list().forEach(([resolve$1, reject]) => err ? reject(err) : resolve$1());
readyHandlers.reset();
}
return err;
}
function handleScroll(to, from, isPush, isFirstNavigation) {
const { scrollBehavior } = options;
if (!isBrowser || !scrollBehavior) return Promise.resolve();
const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position) => position && scrollToPosition(position)).catch((err) => triggerError(err, to, from));
}
const go = (delta) => routerHistory.go(delta);
let started;
const installedApps = /* @__PURE__ */ new Set();
const router = {
currentRoute,
listening: true,
hasRoute: (name) => !!resolver.getRoute(name),
getRoutes: () => resolver.getRoutes(),
resolve,
options,
push,
replace,
go,
back: () => go(-1),
forward: () => go(1),
beforeEach: beforeGuards.add,
beforeResolve: beforeResolveGuards.add,
afterEach: afterGuards.add,
onError: errorListeners.add,
isReady,
install(app) {
app.config.globalProperties.$router = router;
Object.defineProperty(app.config.globalProperties, "$route", {
enumerable: true,
get: () => unref(currentRoute)
});
if (isBrowser && !started && currentRoute.value === START_LOCATION_NORMALIZED) {
started = true;
push(routerHistory.location).catch((err) => {
if (process.env.NODE_ENV !== "production") warn("Unexpected error on initial navigation:", err);
});
}
const reactiveRoute = {};
for (const key in START_LOCATION_NORMALIZED) Object.defineProperty(reactiveRoute, key, {
get: () => currentRoute.value[key],
enumerable: true
});
app.provide(routerKey, router);
app.provide(routeLocationKey, shallowReactive(reactiveRoute));
app.provide(routerViewLocationKey, currentRoute);
installedApps.add(app);
app.onUnmount(() => {
installedApps.delete(app);
if (installedApps.size < 1) {
pendingLocation = START_LOCATION_NORMALIZED;
removeHistoryListener && removeHistoryListener();
removeHistoryListener = null;
currentRoute.value = START_LOCATION_NORMALIZED;
started = false;
ready = false;
}
});
if ((process.env.NODE_ENV !== "production" || __VUE_PROD_DEVTOOLS__) && isBrowser) addDevtools(app, router, resolver);
}
};
function runGuardQueue(guards) {
return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
}
if (process.env.NODE_ENV !== "production") router._hmrReplaceResolver = (newResolver) => {
resolver = newResolver;
};
return router;
}
/**
* Merge meta fields of an array of records
*
* @param matched - array of matched records
*/
function mergeMetaFields(matched) {
return assign({}, ...matched.map((r) => r.meta));
}
//#endregion
//#region src/experimental/route-resolver/resolver-abstract.ts
/**
* Common properties for a location that couldn't be matched. This ensures
* having the same name while having a `path`, `query` and `hash` that change.
*/
const NO_MATCH_LOCATION = {
name: process.env.NODE_ENV !== "production" ? Symbol("no-match") : Symbol(),
params: {},
matched: []
};
//#endregion
//#region src/experimental/route-resolver/resolver-fixed.ts
/**
* Build the `matched` array of a record that includes all parent records from the root to the current one.
*/
function buildMatched(record) {
const matched = [];
let node = record;
while (node) {
matched.unshift(node);
node = node.parent;
}
return matched;
}
/**
* Creates a fixed resolver that must have all records defined at creation
* time.
*
* @template TRecord - extended type of the records
* @param {TRecord[]} records - Ordered array of records that will be used to resolve routes
* @returns a resolver that can be passed to the router
*/
function createFixedResolver(records) {
const recordMap = /* @__PURE__ */ new Map();
for (const record of records) recordMap.set(record.name, record);
function validateMatch(record, url) {
const pathParams = record.path.match(url.path);
const hashParams = record.hash?.match(url.hash);
const matched = buildMatched(record);
const queryParams = Object.assign({}, ...matched.flatMap((record$1) => record$1.query?.map((query) => query.match(url.query))));
return [matched, {
...pathParams,
...queryParams,
...hashParams
}];
}
function resolve(...[to, currentLocation]) {
if (typeof to === "object" && (to.name || to.path == null)) {
if (process.env.NODE_ENV !== "production" && to.name == null && currentLocation == null) {
warn$1(`Cannot resolve relative location "${JSON.stringify(to)}"without a "name" or a current location. This will crash in production.`, to);
const query$1 = normalizeQuery(to.query);
const hash$1 = to.hash ?? "";
const path$1 = to.path ?? "/";
return {
...to,
...NO_MATCH_LOCATION,
fullPath: NEW_stringifyURL(stringifyQuery, path$1, query$1, hash$1),
path: path$1,
query: query$1,
hash: hash$1
};
}
const name = to.name ?? currentLocation.name;
const record = recordMap.get(name);
if (process.env.NODE_ENV !== "production") {
if (!record || !name) throw new Error(`Record "${String(name)}" not found`);
if (typeof to === "object" && to.hash && !to.hash.startsWith("#")) warn$1(`A "hash" should always start with the character "#". Replace "${to.hash}" with "#${to.hash}".`);
}
let params = {
...currentLocation?.params,
...to.params
};
const path = record.path.build(params);
const hash = record.hash?.build(params) ?? to.hash ?? currentLocation?.hash ?? "";
let matched = buildMatched(record);
const query = Object.assign({
...currentLocation?.query,
...normalizeQuery(to.query)
}, ...matched.flatMap((record$1) => record$1.query?.map((query$1) => query$1.build(params))));
const url = {
...to,
fullPath: NEW_stringifyURL(stringifyQuery, path, query, hash),
path,
hash,
query
};
[matched, params] = validateMatch(record, url);
return {
...url,
name,
matched,
params
};
} else {
let url;
if (typeof to === "string") url = parseURL(parseQuery, to, currentLocation?.path);
else {
const query = normalizeQuery(to.query);
const path = resolveRelativePath(to.path, currentLocation?.path || "/");
url = {
...to,
fullPath: NEW_stringifyURL(stringifyQuery, path, query, to.hash),
path,
query,
hash: to.hash || ""
};
}
let record;
let matched;
let parsedParams;
for (record of records) try {
[matched, parsedParams] = validateMatch(record, url);
break;
} catch (e) {}
if (!parsedParams || !matched) return {
...url,
...NO_MATCH_LOCATION
};
return {
...url,
name: record.name,
params: parsedParams,
matched
};
}
}
return {
resolve,
getRoutes: () => records,
getRoute: (name) => recordMap.get(name)
};
}
//#endregion
//#region src/experimental/route-resolver/matchers/errors.ts
/**
* Error throw when a matcher matches by regex but validation fails.
*/
var MatchMiss = class extends Error {
name = "MatchMiss";
};
/**
* Helper to create a {@link MatchMiss} error.
* @param args - Arguments to pass to the `MatchMiss` constructor.
*
* @example
* ```ts
* throw miss()
* // in a number param matcher
* throw miss('Number must be finite')
* ```
*/
const miss = (...args) => new MatchMiss(...args);
//#endregion
//#region src/experimental/route-resolver/matchers/matcher-pattern.ts
/**
* Allows matching a static path.
*
* @example
* ```ts
* const matcher = new MatcherPatternPathStatic('/team')
* matcher.match('/team') // {}
* matcher.match('/team/123') // throws MatchMiss
* matcher.build() // '/team'
* ```
*/
var MatcherPatternPathStatic = class {
/**
* lowercase version of the path to match against.
* This is used to make the matching case insensitive.
*/
pathi;
constructor(path) {
this.path = path;
this.pathi = path.toLowerCase();
}
match(path) {
if (path.toLowerCase() !== this.pathi) throw miss();
return {};
}
build() {
return this.path;
}
};
/**
* Regex to remove trailing slashes from a path.
*
* @internal
*/
const RE_TRAILING_SLASHES = /\/*$/;
/**
* Handles the `path` part of a URL with dynamic parameters.
*/
var MatcherPatternPathDynamic = class {
/**
* Cached keys of the {@link params} object.
*/
paramsKeys;
/**
* Creates a new dynamic path matcher.
*
* @param re - regex to match the path against
* @param params - object of param parsers as {@link MatcherPatternPathDynamic_ParamOptions}
* @param pathParts - array of path parts, where strings are static parts, 1 are regular params, and 0 are splat params (not encode slash)
* @param trailingSlash - whether the path should end with a trailing slash, null means "do not care" (for trailing splat params)
*/
constructor(re, params, pathParts, trailingSlash = false) {
this.re = re;
this.params = params;
this.pathParts = pathParts;
this.trailingSlash = trailingSlash;
this.paramsKeys = Object.keys(this.params);
}
match(path) {
if (this.trailingSlash != null && this.trailingSlash === !path.endsWith("/")) throw miss();
const match = path.match(this.re);
if (!match) throw miss();
const params = {};
for (var i = 0; i < this.paramsKeys.length; i++) {
var paramName = this.paramsKeys[i];
var [parser, repeatable] = this.params[paramName];
var currentMatch = match[i + 1] ?? null;
var value = repeatable ? (currentMatch?.split("/") || []).map(decode) : decode(currentMatch);
params[paramName] = (parser?.get || identityFn)(value);
}
if (process.env.NODE_ENV !== "production" && Object.keys(params).length !== Object.keys(this.params).length) warn$1(`Regexp matched ${match.length} params, but ${i} params are defined. Found when matching "${path}" against ${String(this.re)}`);
return params;
}
build(params) {
let paramIndex = 0;
let paramName;
let parser;
let repeatable;
let optional;
let value;
const path = "/" + this.pathParts.map((part) => {
if (typeof part === "string") return part;
else if (typeof part === "number") {
paramName = this.paramsKeys[paramIndex++];
[parser, repeatable, optional] = this.params[paramName];
value = (parser?.set || identityFn)(params[paramName]);
if (Array.isArray(value) && !value.length && !optional) throw miss();
return Array.isArray(value) ? value.map(encodeParam).join("/") : (part ? encodeParam : encodePath)(value);
} else return part.map((subPart) => {
if (typeof subPart === "string") return subPart;
paramName = this.paramsKeys[paramIndex++];
[parser, repeatable, optional] = this.params[paramName];
value = (parser?.set || identityFn)(params[paramName]);
if (process.env.NODE_ENV !== "production" && repeatable) {
warn$1(`Param "${String(paramName)}" is repeatable, but used in a sub segment of the path: "${this.pathParts.join("")}". Repeated params can only be used as a full path segment: "/file/[ids]+/something-else". This will break in production.`);
return Array.isArray(value) ? value.map(encodeParam).join("/") : encodeParam(value);
}
return encodeParam(value);
}).join("");
}).filter(identityFn).join("/");
/**
* If the last part of the path is a splat param and its value is empty, it gets
* filteretd out, resulting in a path that doesn't end with a `/` and doesn't even match
* with the original splat path: e.g. /teams/[...pathMatch] does not match /teams, so it makes
* no sense to build a path it cannot match.
*/
return this.trailingSlash == null ? path + (!value && path.at(-1) !== "/" ? "/" : "") : path.replace(RE_TRAILING_SLASHES, this.trailingSlash ? "/" : "");
}
};
//#endregion
//#region src/experimental/route-resolver/matchers/param-parsers/booleans.ts
const PARAM_BOOLEAN_SINGLE = {
get: (value) => {
if (value === void 0) return void 0;
if (value == null) return true;
const lowercaseValue = value.toLowerCase();
if (lowercaseValue === "true") return true;
if (lowercaseValue === "false") return false;
throw miss();
},
set: (value) => value == null ? value : String(value)
};
const PARAM_BOOLEAN_REPEATABLE = {
get: (value) => value.map((v) => {
const result = PARAM_BOOLEAN_SINGLE.get(v);
return result === void 0 ? false : result;
}),
set: (value) => value.map((v) => PARAM_BOOLEAN_SINGLE.set(v))
};
/**
* Native Param parser for booleans.
*
* @internal
*/
const PARAM_PARSER_BOOL = {
get: (value) => Array.isArray(value) ? PARAM_BOOLEAN_REPEATABLE.get(value) : PARAM_BOOLEAN_SINGLE.get(value),
set: (value) => Array.isArray(value) ? PARAM_BOOLEAN_REPEATABLE.set(value) : PARAM_BOOLEAN_SINGLE.set(value)
};
//#endregion
//#region src/experimental/route-resolver/matchers/param-parsers/integers.ts
const PARAM_INTEGER_SINGLE = {
get: (value) => {
const num = Number(value);
if (value && Number.isSafeInteger(num)) return num;
throw miss();
},
set: (value) => String(value)
};
const PARAM_INTEGER_REPEATABLE = {
get: (value) => value.filter((v) => v != null).map(PARAM_INTEGER_SINGLE.get),
set: (value) => value.map(PARAM_INTEGER_SINGLE.set)
};
/**
* Native Param parser for integers.
*
* @internal
*/
const PARAM_PARSER_INT = {
get: (value) => Array.isArray(value) ? PARAM_INTEGER_REPEATABLE.get(value) : value != null ? PARAM_INTEGER_SINGLE.get(value) : null,
set: (value) => Array.isArray(value) ? PARAM_INTEGER_REPEATABLE.set(value) : value != null ? PARAM_INTEGER_SINGLE.set(value) : null
};
//#endregion
//#region src/experimental/route-resolver/matchers/param-parsers/index.ts
/**
* Default parser for params that will keep values as is, and will use `String()`
*/
const PARAM_PARSER_DEFAULTS = {
get: (value) => value ?? null,
set: (value) => value == null ? null : Array.isArray(value) ? value.map((v) => v == null ? null : String(v)) : String(value)
};
/**
* Defines a path param parser.
*
* @param parser - the parser to define. Will be returned as is.
*
* @see {@link defineQueryParamParser}
* @see {@link defineParamParser}
*/
/*! #__NO_SIDE_EFFECTS__ */
function definePathParamParser(parser) {
return parser;
}
/**
* Defines a query param parser. Note that query params can also be used as
* path param parsers.
*
* @param parser - the parser to define. Will be returned as is.
*
* @see {@link definePathParamParser}
* @see {@link defineParamParser}
*/
/*! #__NO_SIDE_EFFECTS__ */
function defineQueryParamParser(parser) {
return parser;
}
/**
* Alias for {@link defineQueryParamParser}. Implementing a param parser like this
* works for path, query, and hash params.
*
* @see {@link defineQueryParamParser}
* @see {@link definePathParamParser}
*/
const defineParamParser = defineQueryParamParser;
//#endregion
//#region src/experimental/route-resolver/matchers/matcher-pattern-query.ts
/**
* Matcher for a specific query parameter. It will read and write the parameter
*/
var MatcherPatternQueryParam = class {
constructor(paramName, queryKey, format, parser = {}, defaultValue) {
this.paramName = paramName;
this.queryKey = queryKey;
this.format = format;
this.parser = parser;
this.defaultValue = defaultValue;
}
match(query) {
const queryValue = query[this.queryKey];
let valueBeforeParse = this.format === "value" ? Array.isArray(queryValue) ? queryValue.at(-1) : queryValue : Array.isArray(queryValue) ? queryValue : queryValue == null ? [] : [queryValue];
let value;
if (Array.isArray(valueBeforeParse)) if (queryValue === void 0 && this.defaultValue !== void 0) value = toValue(this.defaultValue);
else try {
value = (this.parser.get ?? PARAM_PARSER_DEFAULTS.get)(valueBeforeParse);
} catch (error) {
if (this.defaultValue === void 0) throw error;
value = void 0;
}
else try {
value = valueBeforeParse === void 0 ? valueBeforeParse : (this.parser.get ?? PARAM_PARSER_DEFAULTS.get)(valueBeforeParse);
} catch (error) {
if (this.defaultValue === void 0) throw error;
}
if (value === void 0) {
if (this.defaultValue === void 0) throw miss();
value = toValue(this.defaultValue);
}
return { [this.paramName]: value };
}
build(params) {
const paramValue = params[this.paramName];
if (paramValue === void 0) return {};
return { [this.queryKey]: (this.parser.set ?? PARAM_PARSER_DEFAULTS.set)(paramValue) };
}
};
//#endregion
export { MatchMiss, MatcherPatternPathDynamic, MatcherPatternPathStatic, MatcherPatternQueryParam, PARAM_PARSER_BOOL, PARAM_PARSER_INT, mergeRouteRecord as _mergeRouteRecord, createFixedResolver, defineParamParser, definePathParamParser, defineQueryParamParser, experimental_createRouter, miss, normalizeRouteRecord };

1928
node_modules/vue-router/dist/router-BbqN7H95.d.mts generated vendored Normal file

File diff suppressed because it is too large Load Diff

2797
node_modules/vue-router/dist/vue-router.cjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

393
node_modules/vue-router/dist/vue-router.d.mts generated vendored Normal file
View File

@@ -0,0 +1,393 @@
/*!
* vue-router v4.6.3
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/
import { EXPERIMENTAL_RouterOptions_Base, EXPERIMENTAL_Router_Base, ErrorTypes, HistoryState, LocationAsRelativeRaw, LocationQuery, LocationQueryRaw, LocationQueryValue, LocationQueryValueRaw, MatcherLocation, MatcherLocationAsPath, NavigationFailure, NavigationFailureType, NavigationGuard, NavigationGuardNext, NavigationGuardNextCallback, NavigationGuardReturn, NavigationGuardWithThis, NavigationHookAfter, NavigationRedirectError, PathParserOptions, RouteComponent, RouteLocation, RouteLocationAsPath, RouteLocationAsPathGeneric, RouteLocationAsPathTyped, RouteLocationAsPathTypedList, RouteLocationAsRelative, RouteLocationAsRelativeGeneric, RouteLocationAsRelativeTyped, RouteLocationAsRelativeTypedList, RouteLocationAsString, RouteLocationAsStringTyped, RouteLocationAsStringTypedList, RouteLocationGeneric, RouteLocationMatched, RouteLocationNamedRaw, RouteLocationNormalized, RouteLocationNormalizedGeneric, RouteLocationNormalizedLoaded, RouteLocationNormalizedLoadedGeneric, RouteLocationNormalizedLoadedTyped, RouteLocationNormalizedLoadedTypedList, RouteLocationNormalizedTyped, RouteLocationNormalizedTypedList, RouteLocationOptions, RouteLocationPathRaw, RouteLocationRaw, RouteLocationResolved, RouteLocationResolvedGeneric, RouteLocationResolvedTyped, RouteLocationResolvedTypedList, RouteLocationTyped, RouteLocationTypedList, RouteMap, RouteMapGeneric, RouteMeta, RouteParamValue, RouteParamValueRaw, RouteParamsGeneric, RouteParamsRawGeneric, RouteQueryAndHash, RouteRecord, RouteRecordInfo, RouteRecordInfoGeneric, RouteRecordMultipleViews, RouteRecordMultipleViewsWithChildren, RouteRecordName, RouteRecordNameGeneric, RouteRecordNormalized, RouteRecordRaw, RouteRecordRedirect, RouteRecordRedirectOption, RouteRecordSingleView, RouteRecordSingleViewWithChildren, RouterHistory, RouterMatcher, RouterScrollBehavior, START_LOCATION_NORMALIZED, TypesConfig, _Awaitable, _PathParserOptions, _RouteLocationBase, _RouteRecordBase, _RouteRecordProps, createRouterMatcher, isNavigationFailure, parseQuery, stringifyQuery } from "./router-BbqN7H95.mjs";
import { AllowedComponentProps, AnchorHTMLAttributes, ComponentCustomProps, ComputedRef, DefineComponent, InjectionKey, MaybeRef, Ref, UnwrapRef, VNode, VNodeProps } from "vue";
//#region src/typed-routes/params.d.ts
/**
* Utility type for raw and non raw params like :id+
*
*/
type ParamValueOneOrMore<isRaw extends boolean> = [ParamValue<isRaw>, ...ParamValue<isRaw>[]];
/**
* Utility type for raw and non raw params like :id*
*
*/
type ParamValueZeroOrMore<isRaw extends boolean> = true extends isRaw ? ParamValue<isRaw>[] | undefined | null : ParamValue<isRaw>[] | undefined;
/**
* Utility type for raw and non raw params like :id?
*
*/
type ParamValueZeroOrOne<isRaw extends boolean> = true extends isRaw ? string | number | null | undefined : string;
/**
* Utility type for raw and non raw params like :id
*
*/
type ParamValue<isRaw extends boolean> = true extends isRaw ? string | number : string;
/**
* Generate a type safe params for a route location. Requires the name of the route to be passed as a generic.
* @see {@link RouteParamsGeneric}
*/
type RouteParams<Name extends keyof RouteMap = keyof RouteMap> = RouteMap[Name]['params'];
/**
* Generate a type safe raw params for a route location. Requires the name of the route to be passed as a generic.
* @see {@link RouteParamsRaw}
*/
type RouteParamsRaw<Name extends keyof RouteMap = keyof RouteMap> = RouteMap[Name]['paramsRaw'];
//#endregion
//#region src/history/html5.d.ts
/**
* Creates an HTML5 history. Most common history for single page applications.
*
* @param base -
*/
declare function createWebHistory(base?: string): RouterHistory;
//#endregion
//#region src/history/memory.d.ts
/**
* Creates an in-memory based history. The main purpose of this history is to handle SSR. It starts in a special location that is nowhere.
* It's up to the user to replace that location with the starter location by either calling `router.push` or `router.replace`.
*
* @param base - Base applied to all urls, defaults to '/'
* @returns a history object that can be passed to the router constructor
*/
declare function createMemoryHistory(base?: string): RouterHistory;
//#endregion
//#region src/history/hash.d.ts
/**
* Creates a hash history. Useful for web applications with no host (e.g. `file://`) or when configuring a server to
* handle any URL is not possible.
*
* @param base - optional base to provide. Defaults to `location.pathname + location.search` If there is a `<base>` tag
* in the `head`, its value will be ignored in favor of this parameter **but note it affects all the history.pushState()
* calls**, meaning that if you use a `<base>` tag, it's `href` value **has to match this parameter** (ignoring anything
* after the `#`).
*
* @example
* ```js
* // at https://example.com/folder
* createWebHashHistory() // gives a url of `https://example.com/folder#`
* createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
* // if the `#` is provided in the base, it won't be added by `createWebHashHistory`
* createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
* // you should avoid doing this because it changes the original url and breaks copying urls
* createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
*
* // at file:///usr/etc/folder/index.html
* // for locations with no `host`, the base is ignored
* createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
* ```
*/
declare function createWebHashHistory(base?: string): RouterHistory;
//#endregion
//#region src/router.d.ts
/**
* Options to initialize a {@link Router} instance.
*/
interface RouterOptions extends EXPERIMENTAL_RouterOptions_Base {
/**
* Initial list of routes that should be added to the router.
*/
routes: Readonly<RouteRecordRaw[]>;
}
/**
* Router instance.
*/
interface Router extends EXPERIMENTAL_Router_Base<RouteRecordNormalized> {
/**
* Original options object passed to create the Router
*/
readonly options: RouterOptions;
/**
* Add a new {@link RouteRecordRaw | route record} as the child of an existing route.
*
* @param parentName - Parent Route Record where `route` should be appended at
* @param route - Route Record to add
*/
addRoute(parentName: NonNullable<RouteRecordNameGeneric>, route: RouteRecordRaw): () => void;
/**
* Add a new {@link RouteRecordRaw | route record} to the router.
*
* @param route - Route Record to add
*/
addRoute(route: RouteRecordRaw): () => void;
/**
* Remove an existing route by its name.
*
* @param name - Name of the route to remove
*/
removeRoute(name: NonNullable<RouteRecordNameGeneric>): void;
/**
* Delete all routes from the router.
*/
clearRoutes(): void;
}
/**
* Creates a Router instance that can be used by a Vue app.
*
* @param options - {@link RouterOptions}
*/
declare function createRouter(options: RouterOptions): Router;
//#endregion
//#region src/injectionSymbols.d.ts
/**
* RouteRecord being rendered by the closest ancestor Router View. Used for
* `onBeforeRouteUpdate` and `onBeforeRouteLeave`. rvlm stands for Router View
* Location Matched
*
* @internal
*/
declare const matchedRouteKey: InjectionKey<ComputedRef<RouteRecordNormalized | undefined>>;
/**
* Allows overriding the router view depth to control which component in
* `matched` is rendered. rvd stands for Router View Depth
*
* @internal
*/
declare const viewDepthKey: InjectionKey<Ref<number> | number>;
/**
* Allows overriding the router instance returned by `useRouter` in tests. r
* stands for router
*
* @internal
*/
declare const routerKey: InjectionKey<Router>;
/**
* Allows overriding the current route returned by `useRoute` in tests. rl
* stands for route location
*
* @internal
*/
declare const routeLocationKey: InjectionKey<RouteLocationNormalizedLoaded>;
/**
* Allows overriding the current route used by router-view. Internally this is
* used when the `route` prop is passed.
*
* @internal
*/
declare const routerViewLocationKey: InjectionKey<Ref<RouteLocationNormalizedLoaded>>;
//#endregion
//#region src/navigationGuards.d.ts
/**
* Add a navigation guard that triggers whenever the component for the current
* location is about to be left. Similar to {@link beforeRouteLeave} but can be
* used in any component. The guard is removed when the component is unmounted.
*
* @param leaveGuard - {@link NavigationGuard}
*/
declare function onBeforeRouteLeave(leaveGuard: NavigationGuard): void;
/**
* Add a navigation guard that triggers whenever the current location is about
* to be updated. Similar to {@link beforeRouteUpdate} but can be used in any
* component. The guard is removed when the component is unmounted.
*
* @param updateGuard - {@link NavigationGuard}
*/
declare function onBeforeRouteUpdate(updateGuard: NavigationGuard): void;
/**
* Ensures a route is loaded, so it can be passed as o prop to `<RouterView>`.
*
* @param route - resolved route to load
*/
declare function loadRouteLocation(route: RouteLocation | RouteLocationNormalized): Promise<RouteLocationNormalizedLoaded>;
//#endregion
//#region src/RouterLink.d.ts
interface RouterLinkOptions {
/**
* Route Location the link should navigate to when clicked on.
*/
to: RouteLocationRaw;
/**
* Calls `router.replace` instead of `router.push`.
*/
replace?: boolean;
}
interface RouterLinkProps extends RouterLinkOptions {
/**
* Whether RouterLink should not wrap its content in an `a` tag. Useful when
* using `v-slot` to create a custom RouterLink
*/
custom?: boolean;
/**
* Class to apply when the link is active
*/
activeClass?: string;
/**
* Class to apply when the link is exact active
*/
exactActiveClass?: string;
/**
* Value passed to the attribute `aria-current` when the link is exact active.
*
* @defaultValue `'page'`
*/
ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
/**
* Pass the returned promise of `router.push()` to `document.startViewTransition()` if supported.
*/
viewTransition?: boolean;
}
/**
* Options passed to {@link useLink}.
*/
interface UseLinkOptions<Name extends keyof RouteMap = keyof RouteMap> {
to: MaybeRef<RouteLocationAsString | RouteLocationAsRelativeTyped<RouteMap, Name> | RouteLocationAsPath | RouteLocationRaw>;
replace?: MaybeRef<boolean | undefined>;
/**
* Pass the returned promise of `router.push()` to `document.startViewTransition()` if supported.
*/
viewTransition?: boolean;
}
/**
* Return type of {@link useLink}.
* @internal
*/
interface UseLinkReturn<Name extends keyof RouteMap = keyof RouteMap> {
route: ComputedRef<RouteLocationResolved<Name>>;
href: ComputedRef<string>;
isActive: ComputedRef<boolean>;
isExactActive: ComputedRef<boolean>;
navigate(e?: MouseEvent): Promise<void | NavigationFailure>;
}
/**
* Returns the internal behavior of a {@link RouterLink} without the rendering part.
*
* @param props - a `to` location and an optional `replace` flag
*/
declare function useLink<Name extends keyof RouteMap = keyof RouteMap>(props: UseLinkOptions<Name>): UseLinkReturn<Name>;
/**
* Component to render a link that triggers a navigation on click.
*/
declare const RouterLink: _RouterLinkI;
/**
* @internal
*/
type _RouterLinkPropsTypedBase = AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterLinkProps;
/**
* @internal
*/
type RouterLinkPropsTyped<Custom extends boolean | undefined> = Custom extends true ? _RouterLinkPropsTypedBase & {
custom: true;
} : _RouterLinkPropsTypedBase & {
custom?: false | undefined;
} & Omit<AnchorHTMLAttributes, 'href'>;
/**
* Typed version of the `RouterLink` component. Its generic defaults to the typed router, so it can be inferred
* automatically for JSX.
*
* @internal
*/
interface _RouterLinkI {
new <Custom extends boolean | undefined = boolean | undefined>(): {
$props: RouterLinkPropsTyped<Custom>;
$slots: {
default?: ({
route,
href,
isActive,
isExactActive,
navigate
}: UnwrapRef<UseLinkReturn>) => VNode[];
};
};
/**
* Access to `useLink()` without depending on using vue-router
*
* @internal
*/
useLink: typeof useLink;
}
//#endregion
//#region src/RouterView.d.ts
interface RouterViewProps {
name?: string;
route?: RouteLocationNormalized;
}
/**
* Component to display the current route the user is at.
*/
declare const RouterView: {
new (): {
$props: AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterViewProps;
$slots: {
default?: ({
Component,
route
}: {
Component: VNode;
route: RouteLocationNormalizedLoaded;
}) => VNode[];
};
};
};
//#endregion
//#region src/useApi.d.ts
/**
* Returns the router instance. Equivalent to using `$router` inside
* templates.
*/
declare function useRouter(): Router;
/**
* Returns the current route location. Equivalent to using `$route` inside
* templates.
*/
declare function useRoute<Name extends keyof RouteMap = keyof RouteMap>(_name?: Name): RouteLocationNormalizedLoaded<Name | RouteMap[Name]["childrenNames"]>;
//#endregion
//#region src/index.d.ts
declare module 'vue' {
interface ComponentCustomOptions {
/**
* Guard called when the router is navigating to the route that is rendering
* this component from a different route. Differently from `beforeRouteUpdate`
* and `beforeRouteLeave`, `beforeRouteEnter` does not have access to the
* component instance through `this` because it triggers before the component
* is even mounted.
*
* @param to - RouteLocationRaw we are navigating to
* @param from - RouteLocationRaw we are navigating from
* @param next - function to validate, cancel or modify (by redirecting) the
* navigation
*/
beforeRouteEnter?: TypesConfig extends Record<'beforeRouteEnter', infer T> ? T : NavigationGuardWithThis<undefined>;
/**
* Guard called whenever the route that renders this component has changed, but
* it is reused for the new route. This allows you to guard for changes in
* params, the query or the hash.
*
* @param to - RouteLocationRaw we are navigating to
* @param from - RouteLocationRaw we are navigating from
* @param next - function to validate, cancel or modify (by redirecting) the
* navigation
*/
beforeRouteUpdate?: TypesConfig extends Record<'beforeRouteUpdate', infer T> ? T : NavigationGuard;
/**
* Guard called when the router is navigating away from the current route that
* is rendering this component.
*
* @param to - RouteLocationRaw we are navigating to
* @param from - RouteLocationRaw we are navigating from
* @param next - function to validate, cancel or modify (by redirecting) the
* navigation
*/
beforeRouteLeave?: TypesConfig extends Record<'beforeRouteLeave', infer T> ? T : NavigationGuard;
}
interface ComponentCustomProperties {
/**
* Normalized current location. See {@link RouteLocationNormalizedLoaded}.
*/
$route: TypesConfig extends Record<'$route', infer T> ? T : RouteLocationNormalizedLoaded;
/**
* {@link Router} instance used by the application.
*/
$router: TypesConfig extends Record<'$router', infer T> ? T : Router;
}
interface GlobalComponents {
RouterView: TypesConfig extends Record<'RouterView', infer T> ? T : typeof RouterView;
RouterLink: TypesConfig extends Record<'RouterLink', infer T> ? T : typeof RouterLink;
}
}
//#endregion
export { type ErrorTypes, type HistoryState, type LocationAsRelativeRaw, type LocationQuery, type LocationQueryRaw, type LocationQueryValue, type LocationQueryValueRaw, type MatcherLocation, type MatcherLocationAsPath, type NavigationFailure, NavigationFailureType, type NavigationGuard, type NavigationGuardNext, type NavigationGuardNextCallback, type NavigationGuardReturn, type NavigationGuardWithThis, type NavigationHookAfter, type NavigationRedirectError, type ParamValue, type ParamValueOneOrMore, type ParamValueZeroOrMore, type ParamValueZeroOrOne, type PathParserOptions, type RouteComponent, type RouteLocation, type RouteLocationAsPath, type RouteLocationAsPathGeneric, type RouteLocationAsPathTyped, type RouteLocationAsPathTypedList, type RouteLocationAsRelative, type RouteLocationAsRelativeGeneric, type RouteLocationAsRelativeTyped, type RouteLocationAsRelativeTypedList, type RouteLocationAsString, type RouteLocationAsStringTyped, type RouteLocationAsStringTypedList, type RouteLocationGeneric, type RouteLocationMatched, type RouteLocationNamedRaw, type RouteLocationNormalized, type RouteLocationNormalizedGeneric, type RouteLocationNormalizedLoaded, type RouteLocationNormalizedLoadedGeneric, type RouteLocationNormalizedLoadedTyped, type RouteLocationNormalizedLoadedTypedList, type RouteLocationNormalizedTyped, type RouteLocationNormalizedTypedList, type RouteLocationOptions, type RouteLocationPathRaw, type RouteLocationRaw, type RouteLocationResolved, type RouteLocationResolvedGeneric, type RouteLocationResolvedTyped, type RouteLocationResolvedTypedList, type RouteLocationTyped, type RouteLocationTypedList, type RouteMap, type RouteMapGeneric, type RouteMeta, type RouteParamValue, type RouteParamValueRaw, type RouteParams, type RouteParamsGeneric, type RouteParamsRaw, type RouteParamsRawGeneric, type RouteQueryAndHash, type RouteRecord, type RouteRecordInfo, type RouteRecordInfoGeneric, type RouteRecordMultipleViews, type RouteRecordMultipleViewsWithChildren, type RouteRecordName, type RouteRecordNameGeneric, type RouteRecordNormalized, type RouteRecordRaw, type RouteRecordRedirect, type RouteRecordRedirectOption, type RouteRecordSingleView, type RouteRecordSingleViewWithChildren, type Router, type RouterHistory, RouterLink, type RouterLinkProps, type RouterMatcher, type RouterOptions, type RouterScrollBehavior, RouterView, type RouterViewProps, START_LOCATION_NORMALIZED as START_LOCATION, type TypesConfig, type UseLinkOptions, type UseLinkReturn, type _Awaitable, type _PathParserOptions, type _RouteLocationBase, type _RouteRecordBase, type _RouteRecordProps, type _RouterLinkI, createMemoryHistory, createRouter, createRouterMatcher, createWebHashHistory, createWebHistory, isNavigationFailure, loadRouteLocation, matchedRouteKey, onBeforeRouteLeave, onBeforeRouteUpdate, parseQuery, routeLocationKey, routerKey, routerViewLocationKey, stringifyQuery, useLink, useRoute, useRouter, viewDepthKey };

2743
node_modules/vue-router/dist/vue-router.esm-browser.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
console.warn("[vue-router]: importing from 'vue-router/dist/vue-router.esm-bundler.js' is deprecated. Use 'vue-router' directly.")
export * from './vue-router.mjs'

3040
node_modules/vue-router/dist/vue-router.global.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

1557
node_modules/vue-router/dist/vue-router.mjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

23
node_modules/vue-router/dist/vue-router.prod.cjs generated vendored Normal file

File diff suppressed because one or more lines are too long

7
node_modules/vue-router/index.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/vue-router.prod.cjs')
} else {
module.exports = require('./dist/vue-router.cjs')
}

154
node_modules/vue-router/package.json generated vendored Normal file
View File

@@ -0,0 +1,154 @@
{
"name": "vue-router",
"version": "4.6.3",
"main": "index.js",
"unpkg": "dist/vue-router.global.js",
"jsdelivr": "dist/vue-router.global.js",
"module": "dist/vue-router.mjs",
"types": "dist/vue-router.d.mts",
"exports": {
".": {
"types": "./dist/vue-router.d.mts",
"node": {
"import": {
"production": "./vue-router.node.mjs",
"development": "./vue-router.node.mjs",
"default": "./vue-router.node.mjs"
},
"require": {
"production": "./dist/vue-router.prod.cjs",
"development": "./dist/vue-router.cjs",
"default": "./index.js"
}
},
"import": "./dist/vue-router.mjs",
"require": "./index.js"
},
"./dist/*": "./dist/*",
"./vetur/*": "./vetur/*",
"./package.json": "./package.json",
"./experimental": "./dist/experimental/index.mjs",
"./auto-resolver": {
"types": "./vue-router-auto-resolver.d.mts"
},
"./auto-routes": {
"types": "./vue-router-auto-routes.d.ts",
"node": {
"import": {
"production": "./vue-router.node.mjs",
"development": "./vue-router.node.mjs",
"default": "./vue-router.node.mjs"
},
"require": {
"production": "./dist/vue-router.prod.cjs",
"development": "./dist/vue-router.cjs",
"default": "./index.js"
}
},
"import": "./dist/vue-router.mjs",
"require": "./index.js"
},
"./auto": {
"types": "./vue-router-auto.d.ts",
"node": {
"import": {
"production": "./vue-router.node.mjs",
"development": "./vue-router.node.mjs",
"default": "./vue-router.node.mjs"
},
"require": {
"production": "./dist/vue-router.prod.cjs",
"development": "./dist/vue-router.cjs",
"default": "./index.js"
}
},
"import": "./dist/vue-router.mjs",
"require": "./index.js"
}
},
"sideEffects": false,
"author": {
"name": "Eduardo San Martin Morote",
"email": "posva13@gmail.com"
},
"funding": "https://github.com/sponsors/posva",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/router.git"
},
"bugs": {
"url": "https://github.com/vuejs/router/issues"
},
"homepage": "https://router.vuejs.org",
"files": [
"vue-router-auto-resolver.d.mts",
"index.js",
"vue-router.node.mjs",
"vue-router-auto.d.ts",
"vue-router-auto-routes.d.ts",
"dist/**/*.{js,cjs,mjs}",
"dist/**/*.d.{ts,mts}",
"vetur/tags.json",
"vetur/attributes.json",
"README.md"
],
"peerDependencies": {
"vue": "^3.5.0"
},
"vetur": {
"tags": "vetur/tags.json",
"attributes": "vetur/attributes.json"
},
"dependencies": {
"@vue/devtools-api": "^6.6.4"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.7",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-replace": "^6.0.2",
"@rollup/plugin-terser": "^0.4.4",
"@types/jsdom": "^21.1.7",
"@types/nightwatch": "^2.3.32",
"@typescript/native-preview": "7.0.0-dev.20251013.1",
"@vitejs/plugin-vue": "^6.0.1",
"@vue/compiler-sfc": "~3.5.22",
"@vue/server-renderer": "~3.5.22",
"@vue/test-utils": "^2.4.6",
"browserstack-local": "^1.5.8",
"chromedriver": "^138.0.5",
"connect-history-api-fallback": "^1.6.0",
"dotenv": "^17.2.3",
"faked-promise": "^2.2.2",
"geckodriver": "^6.0.2",
"happy-dom": "^20.0.0",
"nightwatch": "^3.12.2",
"nightwatch-helpers": "^1.2.0",
"rimraf": "^6.0.1",
"rollup": "^4.52.4",
"rollup-plugin-typescript2": "^0.36.0",
"tsdown": "^0.15.7",
"tsup": "^8.5.0",
"vite": "^7.1.10",
"vue": "~3.6.0-alpha.2"
},
"scripts": {
"dev": "vitest --ui",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
"build": "tsdown",
"build:old": "rimraf dist && rollup -c rollup.config.mjs",
"build:playground": "vue-tsc --noEmit && vite build --config playground/vite.config.ts",
"build:e2e": "vue-tsc --noEmit && vite build --config e2e/vite.config.mjs",
"build:size": "pnpm run build && rollup -c size-checks/rollup.config.mjs",
"dev:e2e": "vite --config e2e/vite.config.mjs",
"test:types": "tsc --build tsconfig.json",
"test:unit": "vitest --coverage run",
"test": "pnpm run build && pnpm run test:types && pnpm run test:unit && pnpm run test:e2e",
"test:e2e": "pnpm run test:e2e:headless",
"test:e2e:headless": "node e2e/runner.mjs --env chrome-headless",
"test:e2e:native": "node e2e/runner.mjs --env chrome",
"test:e2e:ci": "node e2e/runner.mjs --env chrome-headless --retries 2",
"test:e2e:bs": "node e2e/runner.mjs --local -e android5 --tag browserstack",
"test:e2e:bs-test": "node e2e/runner.mjs --local --env browserstack.local_chrome --tag browserstack"
}
}

32
node_modules/vue-router/vetur/attributes.json generated vendored Normal file
View File

@@ -0,0 +1,32 @@
{
"name": {
"type": "string | symbol",
"description": "When a `<router-view>` has a `name` prop, it will render the component with the corresponding name in the matched route record's components option."
},
"route": {
"description": "When a `<router-view>` has a `route` prop, it will use that resolved Route Location instead of the current location."
},
"to": {
"description": "Denotes the target route of the link. When clicked, the value of the `to` prop will be internally passed to `router.push()`, so the value can be either a string or a location descriptor object."
},
"replace": {
"type": "boolean",
"description": "Setting replace prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will replace the current history entry."
},
"custom": {
"type": "boolean",
"description": "Whether `<router-link>` should not wrap its content in an `<a>` tag."
},
"active-class": {
"type": "string",
"description": "Configure the active CSS class applied when the link is active. Note the default value can also be configured globally via the `linkActiveClass` router constructor option."
},
"exact-active-class": {
"type": "string",
"description": "Configure the active CSS class applied when the link is exactly active. Note the default value can also be configured globally via the `linkExactActiveClass` router constructor option."
},
"aria-current-value": {
"options": ["page", "step", "location", "date", "time", "true", "false"],
"description": "Configure the value of `aria-current` when the link is active with exact match. It must be one of the [allowed values for `aria-current`](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the default of `page` should be the best fit."
}
}

10
node_modules/vue-router/vetur/tags.json generated vendored Normal file
View File

@@ -0,0 +1,10 @@
{
"router-view": {
"attributes": ["name", "route"],
"description": "Component that renders the matched component for the current location. Components rendered by `<router-view>` can also contain their own `<router-view>` to render nested routes."
},
"router-link": {
"attributes": ["to", "replace", "custom", "active-class","exact-active-class", "aria-current-value"],
"description": "Component that renders an `<a>` with the correct `href` attribute and click listeners to trigger a local navigation when clicked. Can also customize its rendering by providing the `custom` prop and using its `v-slot` API."
}
}

22
node_modules/vue-router/vue-router-auto-resolver.d.mts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
/**
* TODO: remove the declaration if possible when merging unplugin-vue-router into this monorepo
*/
declare module 'vue-router/auto-resolver' {
import type {
EXPERIMENTAL_Router,
EXPERIMENTAL_RouterOptions,
} from 'vue-router/experimental'
/**
* Handles HMR.
* Generated by unplugin-vue-router
*/
export function handleHotUpdate(router: EXPERIMENTAL_Router): void
/**
* Custom resolver automatically generated at build time
* Generated by unplugin-vue-router
*/
export const resolver: EXPERIMENTAL_RouterOptions['resolver']
}

4
node_modules/vue-router/vue-router-auto-routes.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
/**
* Array of routes generated by unplugin-vue-router
*/
export declare const routes: any[]

1
node_modules/vue-router/vue-router-auto.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
// augmented by unplugin-vue-router

2
node_modules/vue-router/vue-router.node.mjs generated vendored Normal file
View File

@@ -0,0 +1,2 @@
global.__VUE_PROD_DEVTOOLS__ = false
export * from './dist/vue-router.mjs'