docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:27:07 +08:00
1 parent fa9c73363d
commit 2a69b23b47
18210 files changed
+5101211 -16

No files matched your search

@@ -0,0 +1,67 @@
import { f as createRule } from "../utils.js";
var jsx_equals_spacing_default = createRule({
name: "jsx-equals-spacing",
meta: {
type: "layout",
docs: { description: "Enforce or disallow spaces around equal signs in JSX attributes" },
fixable: "code",
schema: [{
type: "string",
enum: ["always", "never"]
}],
defaultOptions: ["never"],
messages: {
noSpaceBefore: "There should be no space before '='",
noSpaceAfter: "There should be no space after '='",
needSpaceBefore: "A space is required before '='",
needSpaceAfter: "A space is required after '='"
}
},
create(context, [config]) {
return { JSXOpeningElement(node) {
node.attributes.forEach((attrNode) => {
if (!(attrNode.type !== "JSXSpreadAttribute" && attrNode.value !== null)) return;
const sourceCode = context.sourceCode;
const equalToken = sourceCode.getTokenAfter(attrNode.name);
const spacedBefore = sourceCode.isSpaceBetween(attrNode.name, equalToken);
const spacedAfter = sourceCode.isSpaceBetween(equalToken, attrNode.value);
if (config === "never") {
if (spacedBefore) context.report({
node: attrNode,
messageId: "noSpaceBefore",
loc: equalToken.loc.start,
fix(fixer) {
return fixer.removeRange([attrNode.name.range[1], equalToken.range[0]]);
}
});
if (spacedAfter) context.report({
node: attrNode,
messageId: "noSpaceAfter",
loc: equalToken.loc.start,
fix(fixer) {
return fixer.removeRange([equalToken.range[1], attrNode.value.range[0]]);
}
});
} else if (config === "always") {
if (!spacedBefore) context.report({
messageId: "needSpaceBefore",
node: attrNode,
loc: equalToken.loc.start,
fix(fixer) {
return fixer.insertTextBefore(equalToken, " ");
}
});
if (!spacedAfter) context.report({
node: attrNode,
messageId: "needSpaceAfter",
loc: equalToken.loc.start,
fix(fixer) {
return fixer.insertTextAfter(equalToken, " ");
}
});
}
});
} };
}
});
export { jsx_equals_spacing_default as t };
@@ -0,0 +1,6 @@
function hasTarget(target, targets) {
return targets.has(target) && Object.keys(targets.get(target)).length > 0;
}
export { hasTarget };
//# sourceMappingURL=has-target.mjs.map
@@ -0,0 +1,16 @@
// src/use-previous.tsx
import * as React from "react";
function usePrevious(value) {
const ref = React.useRef({ value, previous: value });
return React.useMemo(() => {
if (ref.current.value !== value) {
ref.current.previous = ref.current.value;
ref.current.value = value;
}
return ref.current.previous;
}, [value]);
}
export {
usePrevious
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021-Present VoidZero Inc. and Vitest contributors
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.
@@ -0,0 +1 @@
{"version":3,"file":"check-circle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,23 @@
var test = require('tape');
var equal = require('../');
test('equal', function (t) {
t.ok(equal(
{ a : [ 2, 3 ], b : [ 4 ] },
{ a : [ 2, 3 ], b : [ 4 ] }
));
t.end();
});
test('not equal', function (t) {
t.notOk(equal(
{ x : 5, y : [6] },
{ x : 5, y : 6 }
));
t.end();
});
test('nested nulls', function (t) {
t.ok(equal([ null, null, null ], [ null, null, null ]));
t.end();
});
@@ -0,0 +1 @@
module.exports={C:{"108":0.03852,"115":0.01926,"120":0.09149,"121":0.17334,"130":0.00482,"147":0.00482,"150":0.01926,"153":0.00482,"154":0.06741,"155":0.17816,"156":0.23594,"157":0.00963,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 109 110 111 112 113 114 116 117 118 119 122 123 124 125 126 127 128 129 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 148 149 151 152 158 159 160 3.5 3.6"},D:{"46":0.00482,"79":0.00482,"87":0.00482,"92":0.00482,"93":0.00482,"97":0.4815,"103":0.37557,"104":0.35631,"105":0.35631,"106":0.34668,"107":0.33705,"108":0.2889,"109":0.34668,"110":0.33705,"111":0.34187,"112":0.29853,"116":0.68855,"117":0.27927,"118":0.36594,"119":0.20705,"120":0.55373,"122":0.00482,"123":0.00482,"124":0.30335,"125":0.00963,"126":0.00482,"128":0.06741,"131":0.65003,"132":0.02408,"133":0.71262,"134":0.10112,"135":0.11556,"136":0.13001,"137":0.13482,"138":0.13001,"139":0.08186,"140":0.14445,"141":0.13482,"142":0.44298,"143":0.00482,"144":0.08186,"145":0.19742,"146":0.03852,"147":0.00963,"148":0.34668,"149":0.5778,"150":3.40902,"151":3.89534,"152":7.45844,"153":6.89027,"154":2.39787,"155":0.00963,"156":0.00482,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 83 84 85 86 88 89 90 91 94 95 96 98 99 100 101 102 113 114 115 121 127 129 130 157"},F:{"133":0.00482,"134":0.23594,"135":0.42372,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"107":0.00482,"112":0.01445,"119":0.0626,"120":0.11556,"135":0.00482,"142":0.01926,"144":0.00482,"145":0.00963,"147":0.01445,"148":0.06741,"149":0.00963,"150":0.69336,"151":0.62595,"152":2.51343,"153":2.85048,"154":0.65003,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 108 109 110 111 113 114 115 116 117 118 121 122 123 124 125 126 127 128 129 130 131 132 133 134 136 137 138 139 140 141 143 146"},E:{"27":0.03852,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 11.1 12.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 17.0 17.3 17.4 18.0 18.1 18.5-18.7 26.0 26.1 27.1 27.2 TP","10.1":0.00482,"13.1":0.00482,"15.6":0.00963,"16.5":0.00482,"16.6":0.01926,"17.1":0.03371,"17.2":0.00482,"17.5":0.00963,"17.6":0.05778,"18.2":0.10112,"18.3":0.00482,"18.4":0.00482,"26.2":0.02408,"26.3":0.02408,"26.4":0.01445,"26.5":0.46706,"26.6":1.1556},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00161,"5.0-5.1":0.00161,"6.0-6.1":0,"7.0-7.1":0.00322,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01608,"11.0-11.2":0.00161,"11.3-11.4":0.00322,"12.0-12.1":0,"12.2-12.5":0.04181,"13.0-13.1":0,"13.2":0.00804,"13.3":0,"13.4-13.7":0.00161,"14.0-14.4":0.00643,"14.5-14.8":0.00965,"15.0-15.1":0.00965,"15.2-15.3":0.00643,"15.4":0.00804,"15.5":0.00965,"15.6-15.8":0.20905,"16.0":0.01608,"16.1":0.02895,"16.2":0.01608,"16.3":0.03538,"16.4":0.00804,"16.5":0.01286,"16.6-16.7":0.29106,"17.0":0.01126,"17.1":0.01608,"17.2":0.01608,"17.3":0.02412,"17.4":0.03377,"17.5":0.06593,"17.6-17.7":0.17046,"18.0":0.03538,"18.1":0.07076,"18.2":0.09648,"18.3":0.16724,"18.4":0.10452,"18.5-18.7":2.15965,"26.0":0.10452,"26.1":0.10613,"26.2":0.27659,"26.3":0.2991,"26.4":0.2187,"26.5":1.46496,"26.6":9.039,"27.0":0.69308,"27.1":0,"27.2":0.01769},P:{"4":0.05623,"20":0.00937,"26":0.00937,"27":0.02812,"28":0.01874,"29":0.26241,"30":1.63072,_:"21 22 23 24 25 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.13121},I:{"0":0.01036,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":2.31725,_:"10 11 12 11.1 11.5 12.1"},A:{"9":0.00482,_:"6 7 8 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":32.24001},R:{_:"0"},M:{"0":0.05702},Q:{"14.9":0.00518},O:{"0":0.13997},H:{all:0}};
@@ -0,0 +1,659 @@
const require_utils = require("./utils.cjs");
const require_invariant = require("./invariant.cjs");
const require_not_found = require("./not-found.cjs");
const require_root = require("./root.cjs");
const require_redirect = require("./redirect.cjs");
let _tanstack_router_core_isServer = require("@tanstack/router-core/isServer");
//#region src/load-matches.ts
const triggerOnReady = (inner) => {
if (!inner.rendered) {
inner.rendered = true;
return inner.onReady?.();
}
};
const hasForcePendingActiveMatch = (router) => {
return router.stores.matchesId.get().some((matchId) => {
return router.stores.matchStores.get(matchId)?.get()._forcePending;
});
};
const resolvePreload = (inner, matchId) => {
return !!(inner.preload && !inner.router.stores.matchStores.has(matchId));
};
/**
* Builds the accumulated context from router options and all matches up to (and optionally including) the given index.
* Merges __routeContext and __beforeLoadContext from each match.
*/
const buildMatchContext = (inner, index, includeCurrentMatch = true) => {
const context = { ...inner.router.options.context ?? {} };
const end = includeCurrentMatch ? index : index - 1;
for (let i = 0; i <= end; i++) {
const innerMatch = inner.matches[i];
if (!innerMatch) continue;
const m = inner.router.getMatch(innerMatch.id);
if (!m) continue;
Object.assign(context, m.__routeContext, m.__beforeLoadContext);
}
return context;
};
const getNotFoundBoundaryIndex = (inner, err) => {
if (!inner.matches.length) return;
const requestedRouteId = err.routeId;
const matchedRootIndex = inner.matches.findIndex((m) => m.routeId === inner.router.routeTree.id);
const rootIndex = matchedRootIndex >= 0 ? matchedRootIndex : 0;
let startIndex = requestedRouteId ? inner.matches.findIndex((match) => match.routeId === requestedRouteId) : inner.firstBadMatchIndex ?? inner.matches.length - 1;
if (startIndex < 0) startIndex = rootIndex;
for (let i = startIndex; i >= 0; i--) {
const match = inner.matches[i];
if (inner.router.looseRoutesById[match.routeId].options.notFoundComponent) return i;
}
return requestedRouteId ? startIndex : rootIndex;
};
const handleRedirectAndNotFound = (inner, match, err) => {
if (!require_redirect.isRedirect(err) && !require_not_found.isNotFound(err)) return;
if (require_redirect.isRedirect(err) && err.redirectHandled && !err.options.reloadDocument) throw err;
if (match) {
match._nonReactive.beforeLoadPromise?.resolve();
match._nonReactive.loaderPromise?.resolve();
match._nonReactive.beforeLoadPromise = void 0;
match._nonReactive.loaderPromise = void 0;
match._nonReactive.error = err;
inner.updateMatch(match.id, (prev) => ({
...prev,
status: require_redirect.isRedirect(err) ? "redirected" : require_not_found.isNotFound(err) ? "notFound" : prev.status === "pending" ? "success" : prev.status,
context: buildMatchContext(inner, match.index),
isFetching: false,
error: err
}));
if (require_not_found.isNotFound(err) && !err.routeId) err.routeId = match.routeId;
match._nonReactive.loadPromise?.resolve();
}
if (require_redirect.isRedirect(err)) {
inner.rendered = true;
err.options._fromLocation = inner.location;
err.redirectHandled = true;
err = inner.router.resolveRedirect(err);
}
throw err;
};
const shouldSkipLoader = (inner, matchId) => {
const match = inner.router.getMatch(matchId);
if (!match) return true;
if (!(_tanstack_router_core_isServer.isServer ?? inner.router.isServer) && match._nonReactive.dehydrated) return true;
if ((_tanstack_router_core_isServer.isServer ?? inner.router.isServer) && match.ssr === false) return true;
return false;
};
const syncMatchContext = (inner, matchId, index) => {
const nextContext = buildMatchContext(inner, index);
inner.updateMatch(matchId, (prev) => {
return {
...prev,
context: nextContext
};
});
};
const handleSerialError = (inner, index, err, routerCode) => {
const { id: matchId, routeId } = inner.matches[index];
const route = inner.router.looseRoutesById[routeId];
if (err instanceof Promise) throw err;
err.routerCode = routerCode;
inner.firstBadMatchIndex ??= index;
handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err);
try {
route.options.onError?.(err);
} catch (errorHandlerErr) {
err = errorHandlerErr;
handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err);
}
inner.updateMatch(matchId, (prev) => {
prev._nonReactive.beforeLoadPromise?.resolve();
prev._nonReactive.beforeLoadPromise = void 0;
prev._nonReactive.loadPromise?.resolve();
return {
...prev,
error: err,
status: "error",
isFetching: false,
updatedAt: Date.now(),
abortController: new AbortController()
};
});
if (!inner.preload && !require_redirect.isRedirect(err) && !require_not_found.isNotFound(err)) inner.serialError ??= err;
};
const isBeforeLoadSsr = (inner, matchId, index, route) => {
const existingMatch = inner.router.getMatch(matchId);
const parentMatchId = inner.matches[index - 1]?.id;
const parentMatch = parentMatchId ? inner.router.getMatch(parentMatchId) : void 0;
if (inner.router.isShell()) {
existingMatch.ssr = route.id === require_root.rootRouteId;
return;
}
if (parentMatch?.ssr === false) {
existingMatch.ssr = false;
return;
}
const parentOverride = (tempSsr) => {
if (tempSsr === true && parentMatch?.ssr === "data-only") return "data-only";
return tempSsr;
};
const defaultSsr = inner.router.options.defaultSsr ?? true;
if (route.options.ssr === void 0) {
existingMatch.ssr = parentOverride(defaultSsr);
return;
}
if (typeof route.options.ssr !== "function") {
existingMatch.ssr = parentOverride(route.options.ssr);
return;
}
const { search, params } = existingMatch;
const ssrFnContext = {
search: makeMaybe(search, existingMatch.searchError),
params: makeMaybe(params, existingMatch.paramsError),
location: inner.location,
matches: inner.matches.map((match) => ({
index: match.index,
pathname: match.pathname,
fullPath: match.fullPath,
staticData: match.staticData,
id: match.id,
routeId: match.routeId,
search: makeMaybe(match.search, match.searchError),
params: makeMaybe(match.params, match.paramsError),
ssr: match.ssr
}))
};
const tempSsr = route.options.ssr(ssrFnContext);
if (require_utils.isPromise(tempSsr)) return tempSsr.then((ssr) => {
existingMatch.ssr = parentOverride(ssr ?? defaultSsr);
});
existingMatch.ssr = parentOverride(tempSsr ?? defaultSsr);
};
const setupPendingTimeout = (inner, matchId, route, match) => {
if (match._nonReactive.pendingTimeout !== void 0) return;
const pendingMs = route.options.pendingMs ?? inner.router.options.defaultPendingMs;
if (!!(inner.onReady && !(_tanstack_router_core_isServer.isServer ?? inner.router.isServer) && !resolvePreload(inner, matchId) && (route.options.loader || route.options.beforeLoad || routeNeedsPreload(route)) && typeof pendingMs === "number" && pendingMs !== Infinity && (route.options.pendingComponent ?? inner.router.options?.defaultPendingComponent))) {
const pendingTimeout = setTimeout(() => {
triggerOnReady(inner);
}, pendingMs);
match._nonReactive.pendingTimeout = pendingTimeout;
}
};
const preBeforeLoadSetup = (inner, matchId, route) => {
const existingMatch = inner.router.getMatch(matchId);
if (!existingMatch._nonReactive.beforeLoadPromise && !existingMatch._nonReactive.loaderPromise) return;
setupPendingTimeout(inner, matchId, route, existingMatch);
const then = () => {
const match = inner.router.getMatch(matchId);
if (match.preload && (match.status === "redirected" || match.status === "notFound")) handleRedirectAndNotFound(inner, match, match.error);
};
return existingMatch._nonReactive.beforeLoadPromise ? existingMatch._nonReactive.beforeLoadPromise.then(then) : then();
};
const executeBeforeLoad = (inner, matchId, index, route) => {
const match = inner.router.getMatch(matchId);
let prevLoadPromise = match._nonReactive.loadPromise;
match._nonReactive.loadPromise = require_utils.createControlledPromise(() => {
prevLoadPromise?.resolve();
prevLoadPromise = void 0;
});
const { paramsError, searchError } = match;
if (paramsError) handleSerialError(inner, index, paramsError, "PARSE_PARAMS");
if (searchError) handleSerialError(inner, index, searchError, "VALIDATE_SEARCH");
setupPendingTimeout(inner, matchId, route, match);
const abortController = new AbortController();
let isPending = false;
const pending = () => {
if (isPending) return;
isPending = true;
inner.updateMatch(matchId, (prev) => ({
...prev,
isFetching: "beforeLoad",
fetchCount: prev.fetchCount + 1,
abortController
}));
};
const resolve = () => {
match._nonReactive.beforeLoadPromise?.resolve();
match._nonReactive.beforeLoadPromise = void 0;
inner.updateMatch(matchId, (prev) => ({
...prev,
isFetching: false
}));
};
if (!route.options.beforeLoad) {
inner.router.batch(() => {
pending();
resolve();
});
return;
}
match._nonReactive.beforeLoadPromise = require_utils.createControlledPromise();
const context = {
...buildMatchContext(inner, index, false),
...match.__routeContext
};
const { search, params, cause } = match;
const preload = resolvePreload(inner, matchId);
const beforeLoadFnContext = {
search,
abortController,
params,
preload,
context,
location: inner.location,
navigate: (opts) => inner.router.navigate({
...opts,
_fromLocation: inner.location
}),
buildLocation: inner.router.buildLocation,
cause: preload ? "preload" : cause,
matches: inner.matches,
routeId: route.id,
...inner.router.options.additionalContext
};
const updateContext = (beforeLoadContext) => {
if (beforeLoadContext === void 0) {
inner.router.batch(() => {
pending();
resolve();
});
return;
}
if (require_redirect.isRedirect(beforeLoadContext) || require_not_found.isNotFound(beforeLoadContext)) {
pending();
handleSerialError(inner, index, beforeLoadContext, "BEFORE_LOAD");
}
inner.router.batch(() => {
pending();
inner.updateMatch(matchId, (prev) => ({
...prev,
__beforeLoadContext: beforeLoadContext
}));
resolve();
});
};
let beforeLoadContext;
try {
beforeLoadContext = route.options.beforeLoad(beforeLoadFnContext);
if (require_utils.isPromise(beforeLoadContext)) {
pending();
return beforeLoadContext.catch((err) => {
handleSerialError(inner, index, err, "BEFORE_LOAD");
}).then(updateContext);
}
} catch (err) {
pending();
handleSerialError(inner, index, err, "BEFORE_LOAD");
}
updateContext(beforeLoadContext);
};
const handleBeforeLoad = (inner, index) => {
const { id: matchId, routeId } = inner.matches[index];
const route = inner.router.looseRoutesById[routeId];
const serverSsr = () => {
if (_tanstack_router_core_isServer.isServer ?? inner.router.isServer) {
const maybePromise = isBeforeLoadSsr(inner, matchId, index, route);
if (require_utils.isPromise(maybePromise)) return maybePromise.then(queueExecution);
}
return queueExecution();
};
const execute = () => executeBeforeLoad(inner, matchId, index, route);
const queueExecution = () => {
if (shouldSkipLoader(inner, matchId)) return;
const result = preBeforeLoadSetup(inner, matchId, route);
return require_utils.isPromise(result) ? result.then(execute) : execute();
};
return serverSsr();
};
const executeHead = (inner, matchId, route) => {
const match = inner.router.getMatch(matchId);
if (!match) return;
if (!route.options.head && !route.options.scripts && !route.options.headers) return;
const assetContext = {
ssr: inner.router.options.ssr,
matches: inner.matches,
match,
params: match.params,
loaderData: match.loaderData
};
return Promise.all([
route.options.head?.(assetContext),
route.options.scripts?.(assetContext),
route.options.headers?.(assetContext)
]).then(([headFnContent, scripts, headers]) => {
return {
meta: headFnContent?.meta,
links: headFnContent?.links,
headScripts: headFnContent?.scripts,
headers,
scripts,
styles: headFnContent?.styles
};
});
};
const getLoaderContext = (inner, matchPromises, matchId, index, route) => {
const parentMatchPromise = matchPromises[index - 1];
const { params, loaderDeps, abortController, cause } = inner.router.getMatch(matchId);
const context = buildMatchContext(inner, index);
const preload = resolvePreload(inner, matchId);
return {
params,
deps: loaderDeps,
preload: !!preload,
parentMatchPromise,
abortController,
context,
location: inner.location,
navigate: (opts) => inner.router.navigate({
...opts,
_fromLocation: inner.location
}),
cause: preload ? "preload" : cause,
route,
...inner.router.options.additionalContext
};
};
const runLoader = async (inner, matchPromises, matchId, index, route) => {
try {
const match = inner.router.getMatch(matchId);
try {
if (!(_tanstack_router_core_isServer.isServer ?? inner.router.isServer) || match.ssr === true) loadRouteChunk(route);
const routeLoader = route.options.loader;
const loader = typeof routeLoader === "function" ? routeLoader : routeLoader?.handler;
const loaderResult = loader?.(getLoaderContext(inner, matchPromises, matchId, index, route));
const loaderResultIsPromise = !!loader && require_utils.isPromise(loaderResult);
if (!!(loaderResultIsPromise || route._lazyPromise || route._componentsPromise || route.options.head || route.options.scripts || route.options.headers || match._nonReactive.minPendingPromise)) inner.updateMatch(matchId, (prev) => ({
...prev,
isFetching: "loader"
}));
if (loader) {
const loaderData = loaderResultIsPromise ? await loaderResult : loaderResult;
handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), loaderData);
if (loaderData !== void 0) inner.updateMatch(matchId, (prev) => ({
...prev,
loaderData
}));
}
if (route._lazyPromise) await route._lazyPromise;
const pendingPromise = match._nonReactive.minPendingPromise;
if (pendingPromise) await pendingPromise;
if (route._componentsPromise) await route._componentsPromise;
inner.updateMatch(matchId, (prev) => ({
...prev,
error: void 0,
context: buildMatchContext(inner, index),
status: "success",
isFetching: false,
updatedAt: Date.now()
}));
} catch (e) {
let error = e;
if (error?.name === "AbortError") {
if (match.abortController.signal.aborted) {
match._nonReactive.loaderPromise?.resolve();
match._nonReactive.loaderPromise = void 0;
return;
}
inner.updateMatch(matchId, (prev) => ({
...prev,
status: prev.status === "pending" ? "success" : prev.status,
isFetching: false,
context: buildMatchContext(inner, index)
}));
return;
}
const pendingPromise = match._nonReactive.minPendingPromise;
if (pendingPromise) await pendingPromise;
if (require_not_found.isNotFound(e)) await route.options.notFoundComponent?.preload?.();
handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), e);
try {
route.options.onError?.(e);
} catch (onErrorError) {
error = onErrorError;
handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), onErrorError);
}
if (!require_redirect.isRedirect(error) && !require_not_found.isNotFound(error)) await loadRouteChunk(route, ["errorComponent"]);
inner.updateMatch(matchId, (prev) => ({
...prev,
error,
context: buildMatchContext(inner, index),
status: "error",
isFetching: false
}));
}
} catch (err) {
const match = inner.router.getMatch(matchId);
if (match) match._nonReactive.loaderPromise = void 0;
handleRedirectAndNotFound(inner, match, err);
}
};
const loadRouteMatch = async (inner, matchPromises, index) => {
async function handleLoader(preload, prevMatch, previousRouteMatchId, match, route) {
const age = Date.now() - prevMatch.updatedAt;
const staleAge = preload ? route.options.preloadStaleTime ?? inner.router.options.defaultPreloadStaleTime ?? 3e4 : route.options.staleTime ?? inner.router.options.defaultStaleTime ?? 0;
const shouldReloadOption = route.options.shouldReload;
const shouldReload = typeof shouldReloadOption === "function" ? shouldReloadOption(getLoaderContext(inner, matchPromises, matchId, index, route)) : shouldReloadOption;
const { status, invalid } = match;
const staleMatchShouldReload = age >= staleAge && (!!inner.forceStaleReload || match.cause === "enter" || previousRouteMatchId !== void 0 && previousRouteMatchId !== match.id);
loaderShouldRunAsync = status === "success" && (invalid || (shouldReload ?? staleMatchShouldReload));
if (preload && route.options.preload === false) {} else if (loaderShouldRunAsync && !inner.sync && shouldReloadInBackground) {
loaderIsRunningAsync = true;
(async () => {
try {
await runLoader(inner, matchPromises, matchId, index, route);
const match = inner.router.getMatch(matchId);
match._nonReactive.loaderPromise?.resolve();
match._nonReactive.loadPromise?.resolve();
match._nonReactive.loaderPromise = void 0;
match._nonReactive.loadPromise = void 0;
} catch (err) {
if (require_redirect.isRedirect(err)) await inner.router.navigate(err.options);
}
})();
} else if (status !== "success" || loaderShouldRunAsync) await runLoader(inner, matchPromises, matchId, index, route);
else syncMatchContext(inner, matchId, index);
}
const { id: matchId, routeId } = inner.matches[index];
let loaderShouldRunAsync = false;
let loaderIsRunningAsync = false;
const route = inner.router.looseRoutesById[routeId];
const routeLoader = route.options.loader;
const shouldReloadInBackground = ((typeof routeLoader === "function" ? void 0 : routeLoader?.staleReloadMode) ?? inner.router.options.defaultStaleReloadMode) !== "blocking";
if (shouldSkipLoader(inner, matchId)) {
if (!inner.router.getMatch(matchId)) return inner.matches[index];
syncMatchContext(inner, matchId, index);
if (_tanstack_router_core_isServer.isServer ?? inner.router.isServer) return inner.router.getMatch(matchId);
} else {
const prevMatch = inner.router.getMatch(matchId);
const activeIdAtIndex = inner.router.stores.matchesId.get()[index];
const previousRouteMatchId = (activeIdAtIndex && inner.router.stores.matchStores.get(activeIdAtIndex) || null)?.routeId === routeId ? activeIdAtIndex : inner.router.stores.matches.get().find((d) => d.routeId === routeId)?.id;
const preload = resolvePreload(inner, matchId);
if (prevMatch._nonReactive.loaderPromise) {
if (prevMatch.status === "success" && !inner.sync && !prevMatch.preload && shouldReloadInBackground) return prevMatch;
await prevMatch._nonReactive.loaderPromise;
const match = inner.router.getMatch(matchId);
const error = match._nonReactive.error || match.error;
if (error) handleRedirectAndNotFound(inner, match, error);
if (match.status === "pending") await handleLoader(preload, prevMatch, previousRouteMatchId, match, route);
} else {
const nextPreload = preload && !inner.router.stores.matchStores.has(matchId);
const match = inner.router.getMatch(matchId);
match._nonReactive.loaderPromise = require_utils.createControlledPromise();
if (nextPreload !== match.preload) inner.updateMatch(matchId, (prev) => ({
...prev,
preload: nextPreload
}));
await handleLoader(preload, prevMatch, previousRouteMatchId, match, route);
}
}
const match = inner.router.getMatch(matchId);
if (!loaderIsRunningAsync) {
match._nonReactive.loaderPromise?.resolve();
match._nonReactive.loadPromise?.resolve();
match._nonReactive.loadPromise = void 0;
}
clearTimeout(match._nonReactive.pendingTimeout);
match._nonReactive.pendingTimeout = void 0;
if (!loaderIsRunningAsync) match._nonReactive.loaderPromise = void 0;
match._nonReactive.dehydrated = void 0;
const nextIsFetching = loaderIsRunningAsync ? match.isFetching : false;
if (nextIsFetching !== match.isFetching || match.invalid !== false) {
inner.updateMatch(matchId, (prev) => ({
...prev,
isFetching: nextIsFetching,
invalid: false
}));
return inner.router.getMatch(matchId);
} else return match;
};
async function loadMatches(arg) {
const inner = arg;
const matchPromises = [];
if (!(_tanstack_router_core_isServer.isServer ?? inner.router.isServer) && hasForcePendingActiveMatch(inner.router)) triggerOnReady(inner);
let beforeLoadNotFound;
for (let i = 0; i < inner.matches.length; i++) {
try {
const beforeLoad = handleBeforeLoad(inner, i);
if (require_utils.isPromise(beforeLoad)) await beforeLoad;
} catch (err) {
if (require_redirect.isRedirect(err)) throw err;
if (require_not_found.isNotFound(err)) beforeLoadNotFound = err;
else if (!inner.preload) throw err;
break;
}
if (inner.serialError || inner.firstBadMatchIndex != null) break;
}
const baseMaxIndexExclusive = inner.firstBadMatchIndex ?? inner.matches.length;
const boundaryIndex = beforeLoadNotFound && !inner.preload ? getNotFoundBoundaryIndex(inner, beforeLoadNotFound) : void 0;
const maxIndexExclusive = beforeLoadNotFound && inner.preload ? 0 : boundaryIndex !== void 0 ? Math.min(boundaryIndex + 1, baseMaxIndexExclusive) : baseMaxIndexExclusive;
let firstNotFound;
let firstUnhandledRejection;
for (let i = 0; i < maxIndexExclusive; i++) matchPromises.push(loadRouteMatch(inner, matchPromises, i));
try {
await Promise.all(matchPromises);
} catch {
const settled = await Promise.allSettled(matchPromises);
for (const result of settled) {
if (result.status !== "rejected") continue;
const reason = result.reason;
if (require_redirect.isRedirect(reason)) throw reason;
if (require_not_found.isNotFound(reason)) firstNotFound ??= reason;
else firstUnhandledRejection ??= reason;
}
if (firstUnhandledRejection !== void 0) throw firstUnhandledRejection;
}
const notFoundToThrow = firstNotFound ?? (beforeLoadNotFound && !inner.preload ? beforeLoadNotFound : void 0);
let headMaxIndex = inner.firstBadMatchIndex !== void 0 ? inner.firstBadMatchIndex : inner.matches.length - 1;
if (!notFoundToThrow && beforeLoadNotFound && inner.preload) return inner.matches;
if (notFoundToThrow) {
const renderedBoundaryIndex = getNotFoundBoundaryIndex(inner, notFoundToThrow);
if (renderedBoundaryIndex === void 0) {
if (process.env.NODE_ENV !== "production") throw new Error("Invariant failed: Could not find match for notFound boundary");
require_invariant.invariant();
}
const boundaryMatch = inner.matches[renderedBoundaryIndex];
const boundaryRoute = inner.router.looseRoutesById[boundaryMatch.routeId];
const defaultNotFoundComponent = inner.router.options?.defaultNotFoundComponent;
if (!boundaryRoute.options.notFoundComponent && defaultNotFoundComponent) boundaryRoute.options.notFoundComponent = defaultNotFoundComponent;
notFoundToThrow.routeId = boundaryMatch.routeId;
const boundaryIsRoot = boundaryMatch.routeId === inner.router.routeTree.id;
inner.updateMatch(boundaryMatch.id, (prev) => ({
...prev,
...boundaryIsRoot ? {
status: "success",
globalNotFound: true,
error: void 0
} : {
status: "notFound",
error: notFoundToThrow
},
isFetching: false
}));
headMaxIndex = renderedBoundaryIndex;
await loadRouteChunk(boundaryRoute, ["notFoundComponent"]);
} else if (!inner.preload) {
const rootMatch = inner.matches[0];
if (!rootMatch.globalNotFound) {
if (inner.router.getMatch(rootMatch.id)?.globalNotFound) inner.updateMatch(rootMatch.id, (prev) => ({
...prev,
globalNotFound: false,
error: void 0
}));
}
}
if (inner.serialError && inner.firstBadMatchIndex !== void 0) {
const errorRoute = inner.router.looseRoutesById[inner.matches[inner.firstBadMatchIndex].routeId];
await loadRouteChunk(errorRoute, ["errorComponent"]);
}
for (let i = 0; i <= headMaxIndex; i++) {
const { id: matchId, routeId } = inner.matches[i];
const route = inner.router.looseRoutesById[routeId];
try {
const headResult = executeHead(inner, matchId, route);
if (headResult) {
const head = await headResult;
inner.updateMatch(matchId, (prev) => ({
...prev,
...head
}));
}
} catch (err) {
console.error(`Error executing head for route ${routeId}:`, err);
}
}
const readyPromise = triggerOnReady(inner);
if (require_utils.isPromise(readyPromise)) await readyPromise;
if (notFoundToThrow) throw notFoundToThrow;
if (inner.serialError && !inner.preload && !inner.onReady) throw inner.serialError;
return inner.matches;
}
function preloadRouteComponents(route, componentTypesToLoad) {
const preloads = componentTypesToLoad.map((type) => route.options[type]?.preload?.()).filter(Boolean);
if (preloads.length === 0) return void 0;
return Promise.all(preloads);
}
function loadRouteChunk(route, componentTypesToLoad = componentTypes) {
if (!route._lazyLoaded && route._lazyPromise === void 0) if (route.lazyFn) route._lazyPromise = route.lazyFn().then((lazyRoute) => {
const { id: _id, ...options } = lazyRoute.options;
Object.assign(route.options, options);
route._lazyLoaded = true;
route._lazyPromise = void 0;
});
else route._lazyLoaded = true;
const runAfterLazy = () => route._componentsLoaded ? void 0 : componentTypesToLoad === componentTypes ? (() => {
if (route._componentsPromise === void 0) {
const componentsPromise = preloadRouteComponents(route, componentTypes);
if (componentsPromise) route._componentsPromise = componentsPromise.then(() => {
route._componentsLoaded = true;
route._componentsPromise = void 0;
});
else route._componentsLoaded = true;
}
return route._componentsPromise;
})() : preloadRouteComponents(route, componentTypesToLoad);
return route._lazyPromise ? route._lazyPromise.then(runAfterLazy) : runAfterLazy();
}
function makeMaybe(value, error) {
if (error) return {
status: "error",
error
};
return {
status: "success",
value
};
}
function routeNeedsPreload(route) {
for (const componentType of componentTypes) if (route.options[componentType]?.preload) return true;
return false;
}
const componentTypes = [
"component",
"errorComponent",
"pendingComponent",
"notFoundComponent"
];
//#endregion
exports.loadMatches = loadMatches;
exports.loadRouteChunk = loadRouteChunk;
exports.routeNeedsPreload = routeNeedsPreload;
//# sourceMappingURL=load-matches.cjs.map
@@ -0,0 +1,330 @@
require("./constants.cjs");
let node_stream_web = require("node:stream/web");
let node_stream = require("node:stream");
//#region src/ssr/transformStreamWithRouter.ts
function transformReadableStreamWithRouter(router, routerStream) {
return transformStreamWithRouter(router, routerStream);
}
function transformPipeableStreamWithRouter(router, routerStream) {
return node_stream.Readable.fromWeb(transformStreamWithRouter(router, node_stream.Readable.toWeb(routerStream)));
}
const BODY_END_TAG = "</body>";
const HTML_END_TAG = "</html>";
const MIN_CLOSING_TAG_LENGTH = 4;
const DEFAULT_SERIALIZATION_TIMEOUT_MS = 6e4;
const DEFAULT_LIFETIME_TIMEOUT_MS = 6e4;
const textEncoder = new TextEncoder();
/**
* Finds the position just after the last valid HTML closing tag in the string.
*
* Valid closing tags match the pattern: </[a-zA-Z][\w:.-]*>
* Examples: </div>, </my-component>, </slot:name.nested>
*
* @returns Position after the last closing tag, or -1 if none found
*/
function findLastClosingTagEnd(str) {
const len = str.length;
if (len < MIN_CLOSING_TAG_LENGTH) return -1;
let i = len - 1;
while (i >= MIN_CLOSING_TAG_LENGTH - 1) {
if (str.charCodeAt(i) === 62) {
let j = i - 1;
while (j >= 1) {
const code = str.charCodeAt(j);
if (code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 95 || code === 58 || code === 46 || code === 45) j--;
else break;
}
const tagNameStart = j + 1;
if (tagNameStart < i) {
const startCode = str.charCodeAt(tagNameStart);
if (startCode >= 97 && startCode <= 122 || startCode >= 65 && startCode <= 90) {
if (j >= 1 && str.charCodeAt(j) === 47 && str.charCodeAt(j - 1) === 60) return i + 1;
}
}
}
i--;
}
return -1;
}
function transformStreamWithRouter(router, appStream, opts) {
const serializationAlreadyFinished = router.serverSsr?.isSerializationFinished() ?? false;
const initialBufferedHtml = router.serverSsr?.takeBufferedHtml();
if (serializationAlreadyFinished && !initialBufferedHtml) {
let cleanedUp = false;
let controller;
let isStreamClosed = false;
let lifetimeTimeoutHandle;
const cleanup = () => {
if (cleanedUp) return;
cleanedUp = true;
if (lifetimeTimeoutHandle !== void 0) {
clearTimeout(lifetimeTimeoutHandle);
lifetimeTimeoutHandle = void 0;
}
router.serverSsr?.cleanup();
};
const safeClose = () => {
if (isStreamClosed) return;
isStreamClosed = true;
try {
controller?.close();
} catch {}
};
const safeError = (error) => {
if (isStreamClosed) return;
isStreamClosed = true;
try {
controller?.error(error);
} catch {}
};
const lifetimeMs = opts?.lifetimeMs ?? DEFAULT_LIFETIME_TIMEOUT_MS;
lifetimeTimeoutHandle = setTimeout(() => {
if (!cleanedUp && !isStreamClosed) {
console.warn(`SSR stream transform exceeded maximum lifetime (${lifetimeMs}ms), forcing cleanup`);
safeError(/* @__PURE__ */ new Error("Stream lifetime exceeded"));
cleanup();
}
}, lifetimeMs);
const stream = new node_stream_web.ReadableStream({
start(c) {
controller = c;
},
cancel() {
isStreamClosed = true;
cleanup();
}
});
(async () => {
const reader = appStream.getReader();
try {
while (true) {
const { done, value } = await reader.read();
if (done) break;
if (cleanedUp || isStreamClosed) return;
controller?.enqueue(value);
}
if (cleanedUp || isStreamClosed) return;
router.serverSsr?.setRenderFinished();
safeClose();
cleanup();
} catch (error) {
if (cleanedUp) return;
console.error("Error reading appStream:", error);
router.serverSsr?.setRenderFinished();
safeError(error);
cleanup();
} finally {
reader.releaseLock();
}
})().catch((error) => {
if (cleanedUp) return;
console.error("Error in stream transform:", error);
safeError(error);
cleanup();
});
return stream;
}
let stopListeningToInjectedHtml;
let stopListeningToSerializationFinished;
let serializationTimeoutHandle;
let lifetimeTimeoutHandle;
let cleanedUp = false;
let controller;
let isStreamClosed = false;
const textDecoder = new TextDecoder();
let pendingRouterHtml = initialBufferedHtml ?? "";
let leftover = "";
let pendingClosingTags = "";
const MAX_LEFTOVER_CHARS = 2048;
let isAppRendering = true;
let streamBarrierLifted = false;
let serializationFinished = serializationAlreadyFinished;
function safeEnqueue(chunk) {
if (isStreamClosed) return;
if (typeof chunk === "string") controller.enqueue(textEncoder.encode(chunk));
else controller.enqueue(chunk);
}
function safeClose() {
if (isStreamClosed) return;
isStreamClosed = true;
try {
controller.close();
} catch {}
}
function safeError(error) {
if (isStreamClosed) return;
isStreamClosed = true;
try {
controller.error(error);
} catch {}
}
/**
* Cleanup with guards; must be idempotent.
*/
function cleanup() {
if (cleanedUp) return;
cleanedUp = true;
try {
stopListeningToInjectedHtml?.();
stopListeningToSerializationFinished?.();
} catch {}
stopListeningToInjectedHtml = void 0;
stopListeningToSerializationFinished = void 0;
if (serializationTimeoutHandle !== void 0) {
clearTimeout(serializationTimeoutHandle);
serializationTimeoutHandle = void 0;
}
if (lifetimeTimeoutHandle !== void 0) {
clearTimeout(lifetimeTimeoutHandle);
lifetimeTimeoutHandle = void 0;
}
pendingRouterHtml = "";
leftover = "";
pendingClosingTags = "";
router.serverSsr?.cleanup();
}
const stream = new node_stream_web.ReadableStream({
start(c) {
controller = c;
},
cancel() {
isStreamClosed = true;
cleanup();
}
});
function flushPendingRouterHtml() {
if (!pendingRouterHtml) return;
safeEnqueue(pendingRouterHtml);
pendingRouterHtml = "";
}
function appendRouterHtml(html) {
if (!html) return;
pendingRouterHtml += html;
}
/**
* Finish only when app done and serialization complete.
*/
function tryFinish() {
if (isAppRendering || !serializationFinished) return;
if (cleanedUp || isStreamClosed) return;
if (serializationTimeoutHandle !== void 0) {
clearTimeout(serializationTimeoutHandle);
serializationTimeoutHandle = void 0;
}
const decoderRemainder = textDecoder.decode();
if (leftover) safeEnqueue(leftover);
if (decoderRemainder) safeEnqueue(decoderRemainder);
flushPendingRouterHtml();
if (pendingClosingTags) safeEnqueue(pendingClosingTags);
safeClose();
cleanup();
}
const lifetimeMs = opts?.lifetimeMs ?? DEFAULT_LIFETIME_TIMEOUT_MS;
lifetimeTimeoutHandle = setTimeout(() => {
if (!cleanedUp && !isStreamClosed) {
console.warn(`SSR stream transform exceeded maximum lifetime (${lifetimeMs}ms), forcing cleanup`);
safeError(/* @__PURE__ */ new Error("Stream lifetime exceeded"));
cleanup();
}
}, lifetimeMs);
if (!serializationAlreadyFinished) {
stopListeningToInjectedHtml = router.subscribe("onInjectedHtml", () => {
if (cleanedUp || isStreamClosed) return;
const html = router.serverSsr?.takeBufferedHtml();
if (!html) return;
if (isAppRendering || leftover || pendingClosingTags) appendRouterHtml(html);
else {
flushPendingRouterHtml();
safeEnqueue(html);
}
});
stopListeningToSerializationFinished = router.subscribe("onSerializationFinished", () => {
serializationFinished = true;
tryFinish();
});
}
(async () => {
const reader = appStream.getReader();
try {
while (true) {
const { done, value } = await reader.read();
if (done) break;
if (cleanedUp || isStreamClosed) return;
const text = value instanceof Uint8Array ? textDecoder.decode(value, { stream: true }) : String(value);
const chunkString = leftover ? leftover + text : text;
if (!streamBarrierLifted) {
if (chunkString.includes("$tsr-stream-barrier")) {
streamBarrierLifted = true;
router.serverSsr?.liftScriptBarrier();
}
}
if (pendingClosingTags) {
pendingClosingTags += chunkString;
leftover = "";
continue;
}
const bodyEndIndex = chunkString.indexOf(BODY_END_TAG);
const htmlEndIndex = chunkString.indexOf(HTML_END_TAG);
if (bodyEndIndex !== -1 && htmlEndIndex !== -1 && bodyEndIndex < htmlEndIndex) {
pendingClosingTags = chunkString.slice(bodyEndIndex);
safeEnqueue(chunkString.slice(0, bodyEndIndex));
flushPendingRouterHtml();
leftover = "";
continue;
}
const lastClosingTagEnd = findLastClosingTagEnd(chunkString);
if (lastClosingTagEnd > 0) {
safeEnqueue(chunkString.slice(0, lastClosingTagEnd));
flushPendingRouterHtml();
leftover = chunkString.slice(lastClosingTagEnd);
if (leftover.length > MAX_LEFTOVER_CHARS) {
safeEnqueue(leftover.slice(0, leftover.length - MAX_LEFTOVER_CHARS));
leftover = leftover.slice(-MAX_LEFTOVER_CHARS);
}
} else {
const combined = chunkString;
if (combined.length > MAX_LEFTOVER_CHARS) {
const flushUpto = combined.length - MAX_LEFTOVER_CHARS;
safeEnqueue(combined.slice(0, flushUpto));
leftover = combined.slice(flushUpto);
} else leftover = combined;
}
}
if (cleanedUp || isStreamClosed) return;
isAppRendering = false;
router.serverSsr?.setRenderFinished();
if (serializationFinished) tryFinish();
else {
const timeoutMs = opts?.timeoutMs ?? DEFAULT_SERIALIZATION_TIMEOUT_MS;
serializationTimeoutHandle = setTimeout(() => {
if (!cleanedUp && !isStreamClosed) {
console.error("Serialization timeout after app render finished");
safeError(/* @__PURE__ */ new Error("Serialization timeout after app render finished"));
cleanup();
}
}, timeoutMs);
}
} catch (error) {
if (cleanedUp) return;
console.error("Error reading appStream:", error);
isAppRendering = false;
router.serverSsr?.setRenderFinished();
safeError(error);
cleanup();
} finally {
reader.releaseLock();
}
})().catch((error) => {
if (cleanedUp) return;
console.error("Error in stream transform:", error);
safeError(error);
cleanup();
});
return stream;
}
//#endregion
exports.transformPipeableStreamWithRouter = transformPipeableStreamWithRouter;
exports.transformReadableStreamWithRouter = transformReadableStreamWithRouter;
exports.transformStreamWithRouter = transformStreamWithRouter;
//# sourceMappingURL=transformStreamWithRouter.cjs.map
@@ -0,0 +1 @@
{"version":3,"names":["_iterableToArrayLimit","arr","i","iterator","Symbol","_arr","iteratorNormalCompletion","didIteratorError","step","iteratorError","next","_return","call","Object","done","push","value","length","err"],"sources":["../../src/helpers/iterableToArrayLimit.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _iterableToArrayLimit<T>(arr: Iterable<T>, i: number) {\n // this is an expanded form of \\`for...of\\` that properly supports abrupt completions of\n // iterators etc.\n\n var iterator: Iterator<T> =\n arr == null\n ? null\n : (typeof Symbol !== \"undefined\" && arr[Symbol.iterator]) ||\n (arr as any)[\"@@iterator\"];\n if (iterator == null) return;\n\n var _arr: T[] = [];\n var iteratorNormalCompletion = true;\n var didIteratorError = false;\n var step, iteratorError, next, _return;\n try {\n next = (iterator = (iterator as unknown as Function).call(arr)).next;\n if (i === 0) {\n if (Object(iterator) !== iterator) return;\n iteratorNormalCompletion = false;\n } else {\n for (\n ;\n !(iteratorNormalCompletion = (step = next.call(iterator)).done);\n iteratorNormalCompletion = true\n ) {\n _arr.push(step.value);\n if (_arr.length === i) break;\n }\n }\n } catch (err) {\n didIteratorError = true;\n iteratorError = err;\n } finally {\n try {\n if (!iteratorNormalCompletion && iterator[\"return\"] != null) {\n _return = iterator[\"return\"]();\n // eslint-disable-next-line no-unsafe-finally\n if (Object(_return) !== _return) return;\n }\n } finally {\n // eslint-disable-next-line no-unsafe-finally\n if (didIteratorError) throw iteratorError;\n }\n }\n return _arr;\n}\n"],"mappings":";;;;;;AAEe,SAASA,qBAAqBA,CAAIC,GAAgB,EAAEC,CAAS,EAAE;EAI5E,IAAIC,QAAqB,GACvBF,GAAG,IAAI,IAAI,GACP,IAAI,GACH,OAAOG,MAAM,KAAK,WAAW,IAAIH,GAAG,CAACG,MAAM,CAACD,QAAQ,CAAC,IACrDF,GAAG,CAAS,YAAY,CAAC;EAChC,IAAIE,QAAQ,IAAI,IAAI,EAAE;EAEtB,IAAIE,IAAS,GAAG,EAAE;EAClB,IAAIC,wBAAwB,GAAG,IAAI;EACnC,IAAIC,gBAAgB,GAAG,KAAK;EAC5B,IAAIC,IAAI,EAAEC,aAAa,EAAEC,IAAI,EAAEC,OAAO;EACtC,IAAI;IACFD,IAAI,GAAG,CAACP,QAAQ,GAAIA,QAAQ,CAAyBS,IAAI,CAACX,GAAG,CAAC,EAAES,IAAI;IACpE,IAAIR,CAAC,KAAK,CAAC,EAAE;MACX,IAAIW,MAAM,CAACV,QAAQ,CAAC,KAAKA,QAAQ,EAAE;MACnCG,wBAAwB,GAAG,KAAK;IAClC,CAAC,MAAM;MACL,OAEE,EAAEA,wBAAwB,GAAG,CAACE,IAAI,GAAGE,IAAI,CAACE,IAAI,CAACT,QAAQ,CAAC,EAAEW,IAAI,CAAC,EAC/DR,wBAAwB,GAAG,IAAI,EAC/B;QACAD,IAAI,CAACU,IAAI,CAACP,IAAI,CAACQ,KAAK,CAAC;QACrB,IAAIX,IAAI,CAACY,MAAM,KAAKf,CAAC,EAAE;MACzB;IACF;EACF,CAAC,CAAC,OAAOgB,GAAG,EAAE;IACZX,gBAAgB,GAAG,IAAI;IACvBE,aAAa,GAAGS,GAAG;EACrB,CAAC,SAAS;IACR,IAAI;MACF,IAAI,CAACZ,wBAAwB,IAAIH,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE;QAC3DQ,OAAO,GAAGR,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE9B,IAAIU,MAAM,CAACF,OAAO,CAAC,KAAKA,OAAO,EAAE;MACnC;IACF,CAAC,SAAS;MAER,IAAIJ,gBAAgB,EAAE,MAAME,aAAa;IAC3C;EACF;EACA,OAAOJ,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,25 @@
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
import type plugin from './index';
declare const cjsExport: {
flatConfigs: {
'flat/all': FlatConfig.ConfigArray;
'flat/base': FlatConfig.Config;
'flat/disable-type-checked': FlatConfig.Config;
'flat/eslint-recommended': FlatConfig.Config;
'flat/recommended': FlatConfig.ConfigArray;
'flat/recommended-type-checked': FlatConfig.ConfigArray;
'flat/recommended-type-checked-only': FlatConfig.ConfigArray;
'flat/strict': FlatConfig.ConfigArray;
'flat/strict-type-checked': FlatConfig.ConfigArray;
'flat/strict-type-checked-only': FlatConfig.ConfigArray;
'flat/stylistic': FlatConfig.ConfigArray;
'flat/stylistic-type-checked': FlatConfig.ConfigArray;
'flat/stylistic-type-checked-only': FlatConfig.ConfigArray;
};
parser: FlatConfig.Parser;
plugin: typeof plugin;
};
export = cjsExport;
@@ -0,0 +1,143 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const noEmptyMessage = (emptyType) => [
`${emptyType} allows any non-nullish value, including literals like \`0\` and \`""\`.`,
"- If that's what you want, disable this lint rule with an inline comment or configure the '{{ option }}' rule option.",
'- If you want a type meaning "any object", you probably want `object` instead.',
'- If you want a type meaning "any value", you probably want `unknown` instead.',
].join('\n');
exports.default = (0, util_1.createRule)({
name: 'no-empty-object-type',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow accidentally using the "empty object" type',
recommended: 'recommended',
},
hasSuggestions: true,
messages: {
noEmptyInterface: noEmptyMessage('An empty interface declaration'),
noEmptyInterfaceWithSuper: 'An interface declaring no members is equivalent to its supertype.',
noEmptyObject: noEmptyMessage('The `{}` ("empty object") type'),
replaceEmptyInterface: 'Replace empty interface with `{{replacement}}`.',
replaceEmptyInterfaceWithSuper: 'Replace empty interface with a type alias.',
replaceEmptyObjectType: 'Replace `{}` with `{{replacement}}`.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowInterfaces: {
type: 'string',
description: 'Whether to allow empty interfaces.',
enum: ['always', 'never', 'with-single-extends'],
},
allowObjectTypes: {
type: 'string',
description: 'Whether to allow empty object type literals.',
enum: ['always', 'never'],
},
allowWithName: {
type: 'string',
description: 'A stringified regular expression to allow interfaces and object type aliases with the configured name.',
},
},
},
],
},
defaultOptions: [
{
allowInterfaces: 'never',
allowObjectTypes: 'never',
},
],
create(context, [{ allowInterfaces, allowObjectTypes, allowWithName }]) {
const allowWithNameTester = allowWithName
? new RegExp(allowWithName, 'u')
: undefined;
return {
...(allowInterfaces !== 'always' && {
TSInterfaceDeclaration(node) {
if (allowWithNameTester?.test(node.id.name)) {
return;
}
const extend = node.extends;
if (node.body.body.length !== 0 ||
(extend.length === 1 &&
allowInterfaces === 'with-single-extends') ||
extend.length > 1) {
return;
}
const scope = context.sourceCode.getScope(node);
const mergedWithClassDeclaration = scope.set
.get(node.id.name)
?.defs.some(def => def.node.type === utils_1.AST_NODE_TYPES.ClassDeclaration);
if (extend.length === 0) {
context.report({
node: node.id,
messageId: 'noEmptyInterface',
data: { option: 'allowInterfaces' },
...(!mergedWithClassDeclaration && {
suggest: ['object', 'unknown'].map(replacement => ({
messageId: 'replaceEmptyInterface',
data: { replacement },
fix(fixer) {
const id = context.sourceCode.getText(node.id);
const typeParam = node.typeParameters
? context.sourceCode.getText(node.typeParameters)
: '';
return fixer.replaceText(node, `type ${id}${typeParam} = ${replacement}`);
},
})),
}),
});
return;
}
context.report({
node: node.id,
messageId: 'noEmptyInterfaceWithSuper',
...(!mergedWithClassDeclaration && {
suggest: [
{
messageId: 'replaceEmptyInterfaceWithSuper',
fix(fixer) {
const extended = context.sourceCode.getText(extend[0]);
const id = context.sourceCode.getText(node.id);
const typeParam = node.typeParameters
? context.sourceCode.getText(node.typeParameters)
: '';
return fixer.replaceText(node, `type ${id}${typeParam} = ${extended}`);
},
},
],
}),
});
},
}),
...(allowObjectTypes !== 'always' && {
TSTypeLiteral(node) {
if (node.members.length ||
node.parent.type === utils_1.AST_NODE_TYPES.TSIntersectionType ||
(allowWithNameTester &&
node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration &&
allowWithNameTester.test(node.parent.id.name))) {
return;
}
context.report({
node,
messageId: 'noEmptyObject',
data: { option: 'allowObjectTypes' },
suggest: ['object', 'unknown'].map(replacement => ({
messageId: 'replaceEmptyObjectType',
data: { replacement },
fix: (fixer) => fixer.replaceText(node, replacement),
})),
});
},
}),
};
},
});
@@ -0,0 +1 @@
{"version":3,"file":"plus-circle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,4 @@
'use strict';
/** @type {import('./reflectApply')} */
module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
@@ -0,0 +1 @@
{"version":3,"file":"wordSequences.json.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -0,0 +1,627 @@
flf2a 6 6 10 63 14 0 8127 0
Author : myflix
Date : 2003/11/11 20:05:19
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Font Edited: Aug. 5, 2007 by PAT or JK
Update: Changed hardblank character and added "<" and ">" cards

.-. 
((5)) 
'-.-. 
((1)) 
'-' 
.------.
|!.--. |
| (\/) |
| :\/: |
| '--'!|
`------'
.------.
|".--. |
| :(): |
| ()() |
| '--'"|
`------'
.------.
|#.--. |
| :/\: |
| :\/: |
| '--'#|
`------'
.------.
|$.--. |
| :/\: |
| (__) |
| '--'$|
`------'
.------.
|%.--. |
| (\/) |
| :\/: |
| '--'%|
`------'
.------.
|&.--. |
| :(): |
| ()() |
| '--'&|
`------'
.------.
|'.--. |
| :/\: |
| :\/: |
| '--''|
`------'
.------.
|(.--. |
| :/\: |
| (__) |
| '--'(|
`------'
.------.
|).--. |
| (\/) |
| :\/: |
| '--')|
`------'
.------.
|*.--. |
| :(): |
| ()() |
| '--'*|
`------'
.------.
|+.--. |
| :/\: |
| :\/: |
| '--'+|
`------'
.------.
|,.--. |
| :/\: |
| (__) |
| '--',|
`------'
.------.
|-.--. |
| (\/) |
| :\/: |
| '--'-|
`------'
.------.
|..--. |
| :(): |
| ()() |
| '--'.|
`------'
/





.------.
|0.--. |
| :/\: |
| :\/: |
| '--'0|
`------'
.------.
|1.--. |
| :/\: |
| (__) |
| '--'1|
`------'
.------.
|2.--. |
| (\/) |
| :\/: |
| '--'2|
`------'
.------.
|3.--. |
| :(): |
| ()() |
| '--'3|
`------'
.------.
|4.--. |
| :/\: |
| :\/: |
| '--'4|
`------'
.------.
|5.--. |
| :/\: |
| (__) |
| '--'5|
`------'
.------.
|6.--. |
| (\/) |
| :\/: |
| '--'6|
`------'
.------.
|7.--. |
| :(): |
| ()() |
| '--'7|
`------'
.------.
|8.--. |
| :/\: |
| :\/: |
| '--'8|
`------'
.------.
|9.--. |
| :/\: |
| (__) |
| '--'9|
`------'
.------.
|:.--. |
| :/\: |
| :\/: |
| '--':|
`------'
.------.
|;.--. |
| :/\: |
| (__) |
| '--';|
`------'
.------.
|<.--. |
| (\/) |
| :\/: |
| '--'<|
`------'
.------.
|=.--. |
| (\/) |
| :\/: |
| '--'=|
`------'
.------.
|>.--. |
| (\/) |
| :\/: |
| '--'>|
`------'
.------.
|?.--. |
| :(): |
| ()() |
| '--'?|
`------'
.------.
|@.--. |
| :/\: |
| :\/: |
| '--'@|
`------'
.------.
|A.--. |
| (\/) |
| :\/: |
| '--'A|
`------'
.------.
|B.--. |
| :(): |
| ()() |
| '--'B|
`------'
.------.
|C.--. |
| :/\: |
| :\/: |
| '--'C|
`------'
.------.
|D.--. |
| :/\: |
| (__) |
| '--'D|
`------'
.------.
|E.--. |
| (\/) |
| :\/: |
| '--'E|
`------'
.------.
|F.--. |
| :(): |
| ()() |
| '--'F|
`------'
.------.
|G.--. |
| :/\: |
| :\/: |
| '--'G|
`------'
.------.
|H.--. |
| :/\: |
| (__) |
| '--'H|
`------'
.------.
|I.--. |
| (\/) |
| :\/: |
| '--'I|
`------'
.------.
|J.--. |
| :(): |
| ()() |
| '--'J|
`------'
.------.
|K.--. |
| :/\: |
| :\/: |
| '--'K|
`------'
.------.
|L.--. |
| :/\: |
| (__) |
| '--'L|
`------'
.------.
|M.--. |
| (\/) |
| :\/: |
| '--'M|
`------'
.------.
|N.--. |
| :(): |
| ()() |
| '--'N|
`------'
.------.
|O.--. |
| :/\: |
| :\/: |
| '--'O|
`------'
.------.
|P.--. |
| :/\: |
| (__) |
| '--'P|
`------'
.------.
|Q.--. |
| (\/) |
| :\/: |
| '--'Q|
`------'
.------.
|R.--. |
| :(): |
| ()() |
| '--'R|
`------'
.------.
|S.--. |
| :/\: |
| :\/: |
| '--'S|
`------'
.------.
|T.--. |
| :/\: |
| (__) |
| '--'T|
`------'
.------.
|U.--. |
| (\/) |
| :\/: |
| '--'U|
`------'
.------.
|V.--. |
| :(): |
| ()() |
| '--'V|
`------'
.------.
|W.--. |
| :/\: |
| :\/: |
| '--'W|
`------'
.------.
|X.--. |
| :/\: |
| (__) |
| '--'X|
`------'
.------.
|Y.--. |
| (\/) |
| :\/: |
| '--'Y|
`------'
.------.
|Z.--. |
| :(): |
| ()() |
| '--'Z|
`------'
.------.
|[.--. |
| :/\: |
| (__) |
| '--'[|
`------'
\





.------.
|].--. |
| (\/) |
| :\/: |
| '--']|
`------'
.------.
|^.--. |
| :(): |
| ()() |
| '--'^|
`------'
.------.
|_.--. |
| :/\: |
| :\/: |
| '--'_|
`------'
.------.
|`.--. |
| :/\: |
| (__) |
| '--'`|
`------'
.------.
|A.--. |
| (\/) |
| :\/: |
| '--'A|
`------'
.------.
|B.--. |
| :(): |
| ()() |
| '--'B|
`------'
.------.
|C.--. |
| :/\: |
| :\/: |
| '--'C|
`------'
.------.
|D.--. |
| :/\: |
| (__) |
| '--'D|
`------'
.------.
|E.--. |
| (\/) |
| :\/: |
| '--'E|
`------'
.------.
|F.--. |
| :(): |
| ()() |
| '--'F|
`------'
.------.
|G.--. |
| :/\: |
| :\/: |
| '--'G|
`------'
.------.
|H.--. |
| :/\: |
| (__) |
| '--'H|
`------'
.------.
|I.--. |
| (\/) |
| :\/: |
| '--'I|
`------'
.------.
|J.--. |
| :(): |
| ()() |
| '--'J|
`------'
.------.
|K.--. |
| :/\: |
| :\/: |
| '--'K|
`------'
.------.
|L.--. |
| :/\: |
| (__) |
| '--'L|
`------'
.------.
|M.--. |
| (\/) |
| :\/: |
| '--'M|
`------'
.------.
|N.--. |
| :(): |
| ()() |
| '--'N|
`------'
.------.
|O.--. |
| :/\: |
| :\/: |
| '--'O|
`------'
.------.
|P.--. |
| :/\: |
| (__) |
| '--'P|
`------'
.------.
|Q.--. |
| (\/) |
| :\/: |
| '--'Q|
`------'
.------.
|R.--. |
| :(): |
| ()() |
| '--'R|
`------'
.------.
|S.--. |
| :/\: |
| :\/: |
| '--'S|
`------'
.------.
|T.--. |
| :/\: |
| (__) |
| '--'T|
`------'
.------.
|U.--. |
| (\/) |
| :\/: |
| '--'U|
`------'
.------.
|V.--. |
| :(): |
| ()() |
| '--'V|
`------'
.------.
|W.--. |
| :/\: |
| :\/: |
| '--'W|
`------'
.------.
|X.--. |
| :/\: |
| (__) |
| '--'X|
`------'
.------.
|Y.--. |
| (\/) |
| :\/: |
| '--'Y|
`------'
.------.
|Z.--. |
| :(): |
| ()() |
| '--'Z|
`------'
.------.
|{.--. |
| (\/) |
| :\/: |
| '--'{|
`------'
|





.------.
|}.--. |
| :(): |
| ()() |
| '--'}|
`------'
.------.
|~.--. |
| :/\: |
| :\/: |
| '--'~|
`------'
.------.
|A.--. |
| (\/) |
| :\/: |
| '--'A|
`------'
.------.
|O.--. |
| :/\: |
| :\/: |
| '--'O|
`------'
.------.
|U.--. |
| (\/) |
| :\/: |
| '--'U|
`------'
.------.
|A.--. |
| (\/) |
| :\/: |
| '--'A|
`------'
.------.
|O.--. |
| :/\: |
| :\/: |
| '--'O|
`------'
.------.
|U.--. |
| (\/) |
| :\/: |
| '--'U|
`------'

.-. 
((5)) 
'-.-. 
((1)) 
'-' 
@@ -0,0 +1,4 @@
import { exportSidecar } from 'use-sidecar';
import { RemoveScrollSideCar } from './SideEffect';
import { effectCar } from './medium';
export default exportSidecar(effectCar, RemoveScrollSideCar);
@@ -0,0 +1,14 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2016 = void 0;
const es2015_1 = require("./es2015");
const es2016_array_include_1 = require("./es2016.array.include");
const es2016_intl_1 = require("./es2016.intl");
exports.es2016 = {
libs: [es2015_1.es2015, es2016_array_include_1.es2016_array_include, es2016_intl_1.es2016_intl],
variables: [],
};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_z","164":"B"},B:{"1":"_J"},C:{"1":"_5J","2":"_KM"},D:{"1":"_LJ _KE","2":"_4Q","132":"sB _3N yB"},E:{"1":"_BI","2":"_ZC","164":"_qJ _mF _ID"},F:{"1":"_XO","2":"_SS","132":"_mT _CG"},G:{"1":"_NC","2":"_0C"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_U","2":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:2,C:"Encrypted Media Extensions",D:true};
@@ -0,0 +1,42 @@
{
"name": "object-assign",
"version": "4.1.1",
"description": "ES2015 `Object.assign()` ponyfill",
"license": "MIT",
"repository": "sindresorhus/object-assign",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "xo && ava",
"bench": "matcha bench.js"
},
"files": [
"index.js"
],
"keywords": [
"object",
"assign",
"extend",
"properties",
"es2015",
"ecmascript",
"harmony",
"ponyfill",
"prollyfill",
"polyfill",
"shim",
"browser"
],
"devDependencies": {
"ava": "^0.16.0",
"lodash": "^4.16.4",
"matcha": "^0.7.0",
"xo": "^0.16.0"
}
}
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './code-xml.js';
//# sourceMappingURL=code-2.js.map
@@ -0,0 +1 @@
{"version":3,"file":"blake3.d.ts","sourceRoot":"","sources":["src/blake3.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAY,MAAM,aAAa,CAAC;AAEhD,OAAO,EAML,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AA4BpB;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,kCAAkC;IAClC,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB,CAAC;AAEF,iFAAiF;AACjF,qBAAa,OAAQ,SAAQ,OAAO,CAAC,OAAO,CAAE,YAAW,OAAO,CAAC,OAAO,CAAC;IACvE,QAAQ,CAAC,MAAM,QAAQ;IACvB,OAAO,CAAC,QAAQ,CAAK;IAGrB,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,EAAE,CAAc;IACxB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,KAAK,CAAqB;IAElC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,SAAS,CAAa;IAG9B,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,SAAS,CAAQ;gBAEb,IAAI,GAAE,UAAe,EAAE,KAAK,SAAI;IA6B5C,SAAS,CAAC,GAAG,IAAI,EAAE;IAGnB,SAAS,CAAC,GAAG,IAAI,IAAI;IAGrB,OAAO,CAAC,UAAU;IAmBlB,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,GAAE,MAAU,EAAE,MAAM,GAAE,OAAe,GAAG,IAAI;IAkCvF,UAAU,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO;IAiBjC,OAAO,IAAI,IAAI;IAQf,OAAO,CAAC,aAAa;IA+BrB,SAAS,CAAC,MAAM,IAAI,IAAI;IAsBxB,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;IAIhD,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;IAIpC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI;IAQvC,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC;CAK3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAEtD,CAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"auth-utils.js","sourceRoot":"","sources":["../../../src/shared/auth-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,GAAiB;IACtD,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/E,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,kBAAkB;IACzC,OAAO,WAAW,CAAC;AACvB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACjC,iBAAiB,EACjB,kBAAkB,EAIrB;IACG,MAAM,SAAS,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACvH,MAAM,UAAU,GAAG,OAAO,kBAAkB,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAE3H,gDAAgD;IAChD,IAAI,SAAS,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,wDAAwD;IACxD,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACzD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,8DAA8D;IAC9D,qDAAqD;IACrD,mEAAmE;IACnE,8DAA8D;IAC9D,kEAAkE;IAClE,4DAA4D;IAC5D,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,GAAG,GAAG,CAAC;IACvG,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,GAAG,GAAG,CAAC;IAE3G,OAAO,aAAa,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACpD,CAAC"}
@@ -0,0 +1,43 @@
import { frame, cancelFrame } from '../frameloop/frame.mjs';
import { numberValueTypes } from '../value/types/maps/number.mjs';
import { getValueAsType } from '../value/types/utils/get-as-type.mjs';
class MotionValueState {
constructor() {
this.latest = {};
this.values = new Map();
}
set(name, value, render, computed, useDefaultValueType = true) {
const existingValue = this.values.get(name);
if (existingValue) {
existingValue.onRemove();
}
const onChange = () => {
const v = value.get();
if (useDefaultValueType) {
this.latest[name] = getValueAsType(v, numberValueTypes[name]);
}
else {
this.latest[name] = v;
}
render && frame.render(render);
};
onChange();
const cancelOnChange = value.on("change", onChange);
computed && value.addDependent(computed);
const remove = () => {
cancelOnChange();
render && cancelFrame(render);
this.values.delete(name);
computed && value.removeDependent(computed);
};
this.values.set(name, { value, onRemove: remove });
return remove;
}
get(name) {
return this.values.get(name)?.value;
}
}
export { MotionValueState };
//# sourceMappingURL=MotionValueState.mjs.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_IB","260":"F","1026":"E"},B:{"1":"_J"},C:{"1":"_tN _lB","4":"_f","132":"_vF"},D:{"1":"_dO","4":"_aL","132":"_VQ"},E:{"1":"_dB","4":"_u"},F:{"1":"_a","4":"_VE","132":"aC"},G:{"1":"_8C","4":"_1"},H:{"132":"1D"},I:{"1":"_X","4":"_LB","132":"_PH","900":"J"},J:{"1":"A","4":"D"},K:{"1":"H","4":"_cB","132":"aC"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:6,C:"ECMAScript 5",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"RouterClient.js","names":[],"sources":["../../../src/ssr/RouterClient.tsx"],"sourcesContent":["import { hydrate } from '@tanstack/router-core/ssr/client'\nimport { Await } from '../awaited'\nimport { RouterProvider } from '../RouterProvider'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nlet hydrationPromise: Promise<void | Array<Array<void>>> | undefined\n\nexport function RouterClient(props: { router: AnyRouter }) {\n if (!hydrationPromise) {\n if (!props.router.stores.matchesId.get().length) {\n hydrationPromise = hydrate(props.router)\n } else {\n hydrationPromise = Promise.resolve()\n }\n }\n return (\n <Await\n promise={hydrationPromise}\n children={() => <RouterProvider router={props.router} />}\n />\n )\n}\n"],"mappings":";;;;;AAKA,IAAI;AAEJ,SAAgB,aAAa,OAA8B;AACzD,KAAI,CAAC,iBACH,KAAI,CAAC,MAAM,OAAO,OAAO,UAAU,KAAK,CAAC,OACvC,oBAAmB,QAAQ,MAAM,OAAO;KAExC,oBAAmB,QAAQ,SAAS;AAGxC,QACE,oBAAC,OAAD;EACE,SAAS;EACT,gBAAgB,oBAAC,gBAAD,EAAgB,QAAQ,MAAM,QAAU,CAAA;EACxD,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"bluetooth-connected.js","sources":["../../../src/icons/bluetooth-connected.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BluetoothConnected\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNyA3IDEwIDEwLTUgNVYybDUgNUw3IDE3IiAvPgogIDxsaW5lIHgxPSIxOCIgeDI9IjIxIiB5MT0iMTIiIHkyPSIxMiIgLz4KICA8bGluZSB4MT0iMyIgeDI9IjYiIHkxPSIxMiIgeTI9IjEyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/bluetooth-connected\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst BluetoothConnected = createLucideIcon('BluetoothConnected', [\n ['path', { d: 'm7 7 10 10-5 5V2l5 5L7 17', key: '1q5490' }],\n ['line', { x1: '18', x2: '21', y1: '12', y2: '12', key: '1rsjjs' }],\n ['line', { x1: '3', x2: '6', y1: '12', y2: '12', key: '11yl8c' }],\n]);\n\nexport default BluetoothConnected;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,iBAAiB,oBAAsB,CAAA,CAAA,CAAA;AAAA,CAAA,CAChE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC1D,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAClE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAClE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,9 @@
/**
* Clears all of the internal caches.
* Generally you shouldn't need or want to use this.
* Examples of intended uses:
* - In tests to reset parser state to keep tests isolated.
* - In custom lint tooling that iteratively lints one project at a time to prevent OOMs.
*/
export declare function clearCaches(): void;
export declare const clearProgramCache: typeof clearCaches;
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const AlignVerticalDistributeStart = createLucideIcon("AlignVerticalDistributeStart", [
["rect", { width: "14", height: "6", x: "5", y: "14", rx: "2", key: "jmoj9s" }],
["rect", { width: "10", height: "6", x: "7", y: "4", rx: "2", key: "aza5on" }],
["path", { d: "M2 14h20", key: "myj16y" }],
["path", { d: "M2 4h20", key: "mda7wb" }]
]);
export { AlignVerticalDistributeStart as default };
//# sourceMappingURL=align-vertical-distribute-start.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index-B-4n9P0J.d.mts","names":[],"sources":["../../core-internal/src/auth/errors.ts","../../core-internal/src/errors/sdkErrors.ts","../../core-internal/src/shared/authUtils.ts","../../core-internal/src/types/schemas.ts","../../core-internal/src/types/types.ts","../../core-internal/src/wire/codec.ts","../../core-internal/src/util/standardSchema.ts","../../core-internal/src/shared/inputRequired.ts","../../core-internal/src/shared/inputRequiredDriver.ts","../../core-internal/src/types/enums.ts","../../core-internal/src/types/errors.ts","../../core-internal/src/types/guards.ts","../../core-internal/src/types/specTypeSchema.ts","../../core-internal/src/shared/transport.ts","../../core-internal/src/shared/protocol.ts","../../core-internal/src/shared/mediaType.ts","../../core-internal/src/shared/metadataUtils.ts","../../core-internal/src/shared/protocolEras.ts","../../core-internal/src/shared/stdio.ts","../../core-internal/src/shared/uriTemplate.ts","../../core-internal/src/util/inMemory.ts","../../core-internal/src/wire/preload.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAOY,aAAA,cAAA;EA8GC;;;;EAkB+G,cAAA,GAAA,iBAAA;EAAb;;;;EAsCxD,aAAA,GAAA,gBAAA;EAxDvB;;;;;EC3GpB;AA6GZ;;EAKqB,kBAAO,GAAA,qBAAA;EAasD;;;EAoBpD,oBAAA,GAAA,wBAAA;EAGZ;;;EAWD,YAAA,GAAA,eAAgB;EAsBpB;;;EAU8C,YAAA,GAAA,eAAA;EAA4B;;;;;;ACjMvF;EAwBgB,sBAAA,GAAoB,yBAAA;EAChC;;;EAIoB,uBAAA,GAAA,2BAAA;EAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cF8Ed,UAAA,SAAmB,KAAA;iBA4BF;;UAvBT,MAAA,CAAO,WAAA;;;;;;;;;;kFAasD,+BAA6B,aAAa;oBAU9F;;;;sBAYN;;;;gCAgBU,qBAAqB;;;;;;;;;AAtKvD;AA8GA;;AAKqB,aChHT,YAAA;ED6HsE;EAA0C,YAAA,GAAA,eAAA;EAAb;EAUjF,gBAAA,GAAA,mBAAA;EAYN;EAgBU,cAAA,GAAA,iBAAA;EAAqB;EAxDvB,sBAAA,GAAA,0BAAA;EAAK;;;;EC3GzB;EA6GC,UAAA,GAAS,aAAA;EAsCQ;EAjCT,aAAO,GAAA,gBAAA;EAasD;;;;;EAlBpD,qBAAA,GAAA,yBAAA;EAAK;AAoDnC;AAsBA;;;;;;EAA0C,2BAAA,GAAA,gCAAA;;;;ACvL1C;AAwBA;;;;EAKwB,sBAAA,GAAA,0BAAA;EAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cDgFd,QAAA,SAAiB,KAAA;iBAsCA;;UAjCT,MAAA,CAAO,WAAA;;;;;;;;;;kFAasD,+BAA6B,aAAa;;;;;;;;;;;oBAoB9F,qEAGZ;;;;;UAWD,gBAAA;;;;;;;;;;;;;;;;;;;;;cAsBJ,YAAA,SAAqB,QAAA;iBAKP;;;;oBAKL,qCAAqC,4BAA4B;;;;;;;;;;;ADpMvF;AA8GA;;;AAkBkF,iBE7HlE,wBAAA,CF6HkE,GAAA,EE7HpC,GF6HoC,GAAA,MAAA,CAAA,EE7HrB,GF6HqB;;;;;;;;;;AC7HlF;AA6Ga,iBCrFG,oBAAA,CDqFM;EAAA,iBAAA;EAAA;CAAA,EAAA;EAsCQ,iBAAA,ECvHP,GDuHO,GAAA,MAAA;EAjCT,kBAAO,ECrFJ,GDqFI,GAAA,MAAA;CAasD,CAAA,EAAA,OAAA;AAAA;;;;;;ADlIlF;AA8GA;KImEK,iBJvCyB,CAAA,GAAA,CAAA,GIuCF,GJvCE,SAAA,MAAA,GAAA,CIuCkB,GJvClB,SAAA,KAAA,EAAA,GAAA,QAvBF,MI8DsD,CJ9DtD,GI8D0D,iBJ9D1D,CI8D4E,CJ9D5E,CI8D8E,CJ9D9E,CAAA,CAAA,EAasD,GAAA,KAAA,CAAA,GIiDyC,GJjDzC;KImD7E,SAAA,GJnDuH,MAAA,GAAA,MAAA,GAAA,OAAA,GAAA,MAAA,GAAA,IAAA,GAAA,SAAA;KIoDvH,OJpD0G,CAAA,GAAA,CAAA,GIoD7F,GJpD6F,SIoDnF,SJpDmF,GIqDzG,GJrDyG,GIsDzG,GJtDyG,SIsD/F,KJtD+F,CAAA,KAAA,EAAA,CAAA,GIuDvG,KJvDuG,CIuDjG,OJvDiG,CIuDzF,CJvDyF,CAAA,CAAA,GIwDvG,GJxDuG,SIwD7F,GJxD6F,CAAA,KAAA,EAAA,CAAA,GIyDrG,GJzDqG,CIyDjG,OJzDiG,CIyDzF,CJzDyF,CAAA,CAAA,GI0DrG,GJ1DqG,SI0D3F,GJ1D2F,CAAA,KAAA,EAAA,EAAA,KAAA,EAAA,CAAA,GI2DnG,GJ3DmG,CI2D/F,OJ3D+F,CI2DvF,CJ3DuF,CAAA,EI2DnF,OJ3DmF,CI2D3E,CJ3D2E,CAAA,CAAA,GI4DnG,GJ5DmG,SAAA,MAAA,GAAA,QAUjF,MImDF,GJnDE,GImDE,OJnDF,CImDU,GJnDV,CImDY,CJnDZ,CAAA,CAAA,EAYN,GIwCV,GJxCU;KI0CnB,KJ1B6B,CAAA,eI0BR,CAAA,CAAE,UJ1BM,CAAA,GI0BQ,OJ1BR,CI0BgB,CAAA,CAAE,KJ1BlB,CI0BwB,MJ1BxB,CAAA,CAAA;;;;;;;ACnKlC;AA6GA;KG0FK,iBAAA,GHpDyB,YAAA;;;;;;KG2DzB,aHxDa,CAAA,GAAA,CAAA,GGwDM,GHxDN,SAAA,OAAA,GAAA,QAzCY,MGiG4B,GHjG5B,IGiGiC,CHjGjC,SGiG2C,iBHjG3C,GAAA,KAAA,GGiGuE,CHjGvE,GGiG2E,GHjG3E,CGiG6E,CHjG7E,CAAA,EAAK,GAAA,KAAA;AAoDlB,KGgDL,aAAA,GAAgB,KHhDK,CAAA,OGgDQ,mBHhDR,CAAA;AAsBpB,KG2BD,MAAA,GAAS,KH3BK,CAAA,OG2BQ,YH3BR,CAAA;AAKC,KGuBf,OAAA,GAAU,KHvBK,CAAA,OGuBQ,aHvBR,CAAA;;AAKgC,KGoB/C,0BAAA,GAA6B,KHpBkB,CAAA,OGoBL,gCHpBK,CAAA;AAA4B,KGqB3E,WAAA,GAAc,KHrB6D,CAAA,OGqBhD,iBHrBgD,CAAA;AAVrD,KGgCtB,YAAA,GAAe,KHhCO,CAAA,OGgCM,kBHhCN,CAAA;AAAQ,KGiC9B,QAAA,GAAS,aHjCqB,CGiCP,KHjCO,CAAA,OGiCM,YHjCN,CAAA,CAAA;KGkC9B,SAAA,GAAY,aAAa;KACzB,cAAA,GAAiB,aAAa;KAC9B,mBAAA,GAAsB,aAAa;AF3N/B,KE4NJ,oBAAA,GAAuB,KF5NK,CAAA,OE4NQ,0BF5NgB,CAAA;AAwBhD,KEuMJ,qBAAA,GAAwB,IFvMA,CEuMK,KFvML,CAAA,OEuMkB,2BFvMlB,CAAA,EAAA,QAAA,CAAA,GAAA;EAChC,MAAA,EEsMsG,QFtMtG;CACA;AAEmB,KEoMX,eAAA,GAAkB,qBFpMP,GEoM+B,oBFpM/B;AACC,KEoMZ,cAAA,GAAiB,cFpML,GEoMsB,mBFpMtB,GEoM4C,qBFpM5C,GEoMoE,oBFpMpE;AAAG,KEqMf,aAAA,GAAgB,KFrMD,CAAA,OEqMc,uBFrMd,CAAA;KEsMf,kBAAA,GAAqB,aAAa;;;;;;;;;;KAUlC,mBAAA;KAYA,WAAA,GAAc,cAAc,aAAa;KAGzC,2BAAA,GAA8B,aAAa;KAC3C,qBAAA,GAAwB,aAAa;KAGrC,IAAA,GAAO,aAAa;KACpB,KAAA,GAAQ,aAAa;KACrB,YAAA,GAAe,aAAa;KAC5B,WAAA,GAAc,aAAa;KAC3B,IAAA,GAAO,aAAa;KAGpB,cAAA,GAAiB,aAAa;;;;;;;;KAQ9B,kBAAA,GAAqB,aAAa;KAClC,uBAAA,GAA0B,aAAa;KACvC,iBAAA,GAAoB,aAAa;;;;;;;;KAQjC,kBAAA,GAAqB,aAAa;KAClC,gBAAA,GAAmB,cAAc,aAAa;KAC9C,uBAAA,GAA0B,aAAa;KAGvC,eAAA,GAAkB,aAAa;KAC/B,cAAA,GAAiB,cAAc,aAAa;KAG5C,WAAA,GAAc,aAAa;KAG3B,QAAA,GAAW,aAAa;KACxB,0BAAA,GAA6B,aAAa;KAC1C,oBAAA,GAAuB,aAAa;;KAYpC,IAAA,GAAO,aAAa;;KAEpB,UAAA,GAAa,aAAa;;KAE1B,kBAAA,GAAqB,aAAa;;KAElC,YAAA,GAAe,aAAa;;KAE5B,mBAAA,GAAsB,aAALine truncated
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=streamableHttpWithSseFallbackClient.d.ts.map
@@ -0,0 +1,128 @@
import { describe, expect, it } from "vitest";
import ru from "../../../locales/ru.js";
describe("Russian localization", () => {
const localeError = ru().localeError;
describe("pluralization rules", () => {
for (const { type, cases } of TEST_CASES) {
describe(`${type} pluralization`, () => {
for (const { count, expected } of cases) {
it(`correctly pluralizes ${count} ${type}`, () => {
const error = localeError({
code: "too_small",
minimum: count,
type: "number",
inclusive: true,
path: [],
origin: type,
input: count - 1,
});
expect(error).toContain(expected);
});
}
});
}
it("handles negative numbers correctly", () => {
const error = localeError({
code: "too_small",
minimum: -2,
type: "number",
inclusive: true,
path: [],
origin: "array",
input: -3,
});
expect(error).toContain("-2 элемента");
});
it("handles zero correctly", () => {
const error = localeError({
code: "too_small",
minimum: 0,
type: "number",
inclusive: true,
path: [],
origin: "array",
input: -1,
});
expect(error).toContain("0 элементов");
});
it("handles bigint values correctly", () => {
const error = localeError({
code: "too_small",
minimum: BigInt(21),
type: "number",
inclusive: true,
path: [],
origin: "array",
input: BigInt(20),
});
expect(error).toContain("21 элемент");
});
});
});
const TEST_CASES = [
{
type: "array",
cases: [
{ count: 1, expected: "1 элемент" },
{ count: 2, expected: "2 элемента" },
{ count: 5, expected: "5 элементов" },
{ count: 11, expected: "11 элементов" },
{ count: 21, expected: "21 элемент" },
{ count: 22, expected: "22 элемента" },
{ count: 25, expected: "25 элементов" },
{ count: 101, expected: "101 элемент" },
{ count: 111, expected: "111 элементов" },
],
},
{
type: "set",
cases: [
{ count: 1, expected: "1 элемент" },
{ count: 2, expected: "2 элемента" },
{ count: 5, expected: "5 элементов" },
{ count: 11, expected: "11 элементов" },
{ count: 21, expected: "21 элемент" },
{ count: 22, expected: "22 элемента" },
{ count: 25, expected: "25 элементов" },
{ count: 101, expected: "101 элемент" },
{ count: 111, expected: "111 элементов" },
],
},
{
type: "string",
cases: [
{ count: 1, expected: "1 символ" },
{ count: 2, expected: "2 символа" },
{ count: 5, expected: "5 символов" },
{ count: 11, expected: "11 символов" },
{ count: 21, expected: "21 символ" },
{ count: 22, expected: "22 символа" },
{ count: 25, expected: "25 символов" },
],
},
{
type: "file",
cases: [
{ count: 0, expected: "0 байт" },
{ count: 1, expected: "1 байт" },
{ count: 2, expected: "2 байта" },
{ count: 5, expected: "5 байт" },
{ count: 11, expected: "11 байт" },
{ count: 21, expected: "21 байт" },
{ count: 22, expected: "22 байта" },
{ count: 25, expected: "25 байт" },
{ count: 101, expected: "101 байт" },
{ count: 110, expected: "110 байт" },
],
},
] as const;
@@ -0,0 +1 @@
{"version":3,"file":"soup.js","sources":["../../../src/icons/soup.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Soup\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMjFhOSA5IDAgMCAwIDktOUgzYTkgOSAwIDAgMCA5IDlaIiAvPgogIDxwYXRoIGQ9Ik03IDIxaDEwIiAvPgogIDxwYXRoIGQ9Ik0xOS41IDEyIDIyIDYiIC8+CiAgPHBhdGggZD0iTTE2LjI1IDNjLjI3LjEuOC41My43NSAxLjM2LS4wNi44My0uOTMgMS4yLTEgMi4wMi0uMDUuNzguMzQgMS4yNC43MyAxLjYyIiAvPgogIDxwYXRoIGQ9Ik0xMS4yNSAzYy4yNy4xLjguNTMuNzQgMS4zNi0uMDUuODMtLjkzIDEuMi0uOTggMi4wMi0uMDYuNzguMzMgMS4yNC43MiAxLjYyIiAvPgogIDxwYXRoIGQ9Ik02LjI1IDNjLjI3LjEuOC41My43NSAxLjM2LS4wNi44My0uOTMgMS4yLTEgMi4wMi0uMDUuNzguMzQgMS4yNC43NCAxLjYyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/soup\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Soup = createLucideIcon('Soup', [\n ['path', { d: 'M12 21a9 9 0 0 0 9-9H3a9 9 0 0 0 9 9Z', key: '4rw317' }],\n ['path', { d: 'M7 21h10', key: '1b0cd5' }],\n ['path', { d: 'M19.5 12 22 6', key: 'shfsr5' }],\n [\n 'path',\n {\n d: 'M16.25 3c.27.1.8.53.75 1.36-.06.83-.93 1.2-1 2.02-.05.78.34 1.24.73 1.62',\n key: 'rpc6vp',\n },\n ],\n [\n 'path',\n {\n d: 'M11.25 3c.27.1.8.53.74 1.36-.05.83-.93 1.2-.98 2.02-.06.78.33 1.24.72 1.62',\n key: '1lf63m',\n },\n ],\n [\n 'path',\n { d: 'M6.25 3c.27.1.8.53.75 1.36-.06.83-.93 1.2-1 2.02-.05.78.34 1.24.74 1.62', key: '97tijn' },\n ],\n]);\n\nexport default Soup;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CAAA,CACpC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAyC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACtE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2E,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAChG,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const AArrowUp = createLucideIcon("AArrowUp", [
["path", { d: "M3.5 13h6", key: "p1my2r" }],
["path", { d: "m2 16 4.5-9 4.5 9", key: "ndf0b3" }],
["path", { d: "M18 16V7", key: "ty0viw" }],
["path", { d: "m14 11 4-4 4 4", key: "1pu57t" }]
]);
export { AArrowUp as default };
//# sourceMappingURL=a-arrow-up.js.map
@@ -0,0 +1,20 @@
/*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*/
module.exports = function isExtglob(str) {
if (typeof str !== 'string' || str === '') {
return false;
}
var match;
while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) {
if (match[2]) return true;
str = str.slice(match.index + match[0].length);
}
return false;
};
@@ -0,0 +1,190 @@
export default `flf2a$ 1 1 30 -1 40
Morse by Glenn Chappell <ggc@uiuc.edu> 10/95
Based on info from "Morse Code and the Phonetic Alphabets"
URL: http://www.soton.ac.uk/~scp93ch/refer/alphabet.html
Includes some ISO Latin-1 characters
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Use of this font allows figlet to convert ASCII to International Morse
Code.
The following substitutions have been made, i.e., if figlet receives a
character on the left as input, it will print the Morse Code for the
character on the right:
! -> .
; -> :
[]{} -> ()
German s-z -> ss
Latin-1 "prime" -> '
# -> <Delete last word>
* -> Ch
Except as noted above, characters not available in Morse Code will print
as "?".
Inter-word spaces have been enlarged to improve readability. To conform
to the standards for automatic transmission of Morse Code, use smushmode
zero ("figlet -f morse -m0"); wait the duration of a dot for each blank
in the output, as well as between any two output characters (dots,
dashes or blanks).
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be \`a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
1 - height of a character
1 - height of a character, not including descenders
30 - max line length (excluding comment lines) + a fudge factor
-1 - default smushmode for this font
40 - number of comment lines
$@
.-.-.-$@
.-..-.$@
........$@
?$#
?$#
?$#
.----.$@
-.--.-$@
-.--.-$@
----$@
?$#
--..--$@
-....-$@
.-.-.-$@
-..-.$@
-----$@
.----$@
..---$@
...--$@
....-$@
.....$@
-....$@
--...$@
---..$@
----.$@
---...$@
---...$@
?$#
?$#
?$#
..--..$@
?$#
.-$@
-...$@
-.-.$@
-..$@
.$@
..-.$@
--.$@
....$@
..$@
.---$@
-.-$@
.-..$@
--$@
-.$@
---$@
.--.$@
--.-$@
.-.$@
...$@
-$@
..-$@
...-$@
.--$@
-..-$@
-.--$@
--..$@
-.--.-$@
?$#
-.--.-$@
?$#
?$#
?$#
.-$@
-...$@
-.-.$@
-..$@
.$@
..-.$@
--.$@
....$@
..$@
.---$@
-.-$@
.-..$@
--$@
-.$@
---$@
.--.$@
--.-$@
.-.$@
...$@
-$@
..-$@
...-$@
.--$@
-..-$@
-.--$@
--..$@
-.--.-$@
?$#
-.--.-$@
?$#
.-.-$@
---.$@
..--$@
.-.-$@
---.$@
..--$@
...$...$@
0
?$#
160
$@
171
.-..-.$@
180
.----.$@
187
.-..-.$@
188
.----$-..-.$....-$@
189
.----$-..-.$..---$@
190
...--$-..-.$....-$@
193
.--.-$@
196
.-.-$@
197
.--.-$@
201
..-..$@
209
--.--$@
214
---.$@
220
..--$@
223
...$...$@
225
.--.-$@
228
.-.-$@
229
.--.-$@
233
..-..$@
241
--.--$@
246
---.$@
252
..--$@
`
@@ -0,0 +1,922 @@
flf2a^ 9 8 20 0 3
Gradient.flf by Philip Menke (philippe@dds.nl)
Concept by Bob Allison (boba@wwa.com) Font by Philip Menke
May 1995
...$
:::$
---$
+++$
***$
===$
###$
@@@$
$$
.e..$
@@@:$
%%%-$
&&&+$
|||*$
====$
:::#$
...@$
$$
eee..eee.$
@@@::@@@:$
-%----%--$
+++++++++$
*********$
=========$
#########$
@@@@@@@@@$
$$
..eee..eee...$
@@@@@@@@@@@@:$
%%%%%%%%%%%%-$
++&&&++&&&+++$
**|||**|||***$
!!!!!!!!!!!!=$
::::::::::::#$
@@...@@...@@@$
$$
....eee.....$
:@@@@@@@@@::$
%%%%%----%%-$
+&&&&&++++++$
****||||||**$
!!====!!!!!=$
#::::::::::#$
@@@@...@@@@@$
$$
eeee...eee.$
@@@@::@@@::$
%%%%-%%%---$
++++&&&++++$
***|||*****$
==!!!=!!!!=$
#:::##::::#$
...@@@....@$
$$
....eee.....$
:::@@:@@::::$
----%%%-----$
+++&&&&+++++$
**|||*|||***$
=!!!===!!!==$
:::::::::::#$
@......@@..@$
$$
.eee.$
:@@@:$
%%%--$
+++++$
*****$
=====$
#####$
@@@@@$
$$
..eee.$
:@@@::$
%%%---$
&&&+++$
|||***$
!!!===$
#:::##$
@@...@$
$$
eee...$
:@@@::$
--%%%-$
++&&&+$
**|||*$
==!!!=$
#:::##$
...###$
$$
eeee....eeee.$
:@@@@::@@@@::$
--%%%%%%%%---$
&&&&&&&&&&&&+$
||||||||||||*$
==!!!!!!!!===$
#::::##::::##$
....@@@@....@$
$$
..........$
:::@@@::::$
---%%%----$
&&&&&&&&&+$
|||||||||*$
===!!!====$
###:::####$
@@@@@@@@@@$
$$
.....$
:::::$
-----$
+++++$
*****$
=!!!=$
#:::#$
...@@$
$$
........$
::::::::$
--------$
&&&&&&&+$
|||||||*$
========$
########$
@@@@@@@@$
$$
....$
::::$
----$
++++$
****$
====$
:::#$
...@$
$$
.......eee.$
::::::@@@::$
-----%%%---$
++++&&&++++$
***|||*****$
==!!!======$
#:::#######$
...@@@@@@@@$
$$
.eeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&++&&&+$
|||**|||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
..ee.$
:@@@:$
%%%%-$
+&&&+$
*|||*$
=!!!=$
#:::#$
@...@$
$$
.eeeeee..$
@@@@@@@@:$
%%%--%%%-$
++++&&&++$
***|||***$
==!!!====$
#:::::::#$
........@$
$$
.eeeeee..$
@@@@@@@@:$
%%%--%%%-$
++++&&&++$
****|||**$
!!!==!!!=$
::::::::#$
@......@@$
$$
.....eeeee...$
::::@@@@@@:::$
---%%%-%%%---$
++&&&++&&&+++$
*|||||||||||*$
!!!!!!!!!!!!=$
#######:::###$
@@@@@@@...@@@$
$$
eeeeeeeee.$
@@@@@@@@@:$
%%%-------$
&&&&&&&&++$
|||||||||*$
======!!!=$
:::::::::#$
@.......@@$
$$
.eeeeee..$
@@@@@@@@:$
%%%------$
&&&&&&&++$
||||||||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
eeeeeeee.$
@@@@@@@@:$
----%%%--$
+++&&&+++$
**|||****$
=!!!=====$
:::######$
...@@@@@@$
$$
.eeeeee..$
@@@@@@@@:$
%%%--%%%-$
+&&&&&&++$
*||||||**$
!!!==!!!=$
::::::::#$
@......@@$
$$
.eeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&&&&&&+$
*|||||||*$
=====!!!=$
::::::::#$
@......@@$
$$
....$
@@@:$
%%%-$
++++$
****$
!!!=$
:::#$
@@@@$
$$
.....$
:@@@:$
-%%%-$
+++++$
*****$
=!!!=$
#:::#$
...@@$
$$
...eee.$
::@@@::$
-%%%---$
&&&++++$
|||****$
=!!!===$
##:::##$
@@@...@$
$$
..........$
::::::::::$
%%%%%%%%%-$
&&&&&&&&&+$
**********$
!!!!!!!!!=$
:::::::::#$
@@@@@@@@@@$
$$
eee....$
:@@@:::$
--%%%--$
+++&&&+$
***|||*$
==!!!==$
#:::###$
...@@@@$
$$
.eeeeee..$
@@@@@@@@:$
%%%--%%%-$
++++&&&++$
***|||***$
==!!!====$
#########$
@...@@@@@$
$$
.eeeeeeeeeee..$
@@@@@@@@@@@@@:$
%%%-------%%%-$
&&&++&&&++&&&+$
|||**|||**|||*$
!!!===!!!!!!==$
:::###########$
@...........@@$
$$
.eeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&&&&&&+$
||||||||*$
!!!==!!!=$
:::##:::#$
...@@...@$
$$
eeeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&&&&&++$
||||||||*$
!!!==!!!=$
::::::::#$
.......@@$
$$
.eeeee.$
@@@@@@:$
%%%----$
&&&++++$
|||****$
!!!====$
::::::#$
@.....@$
$$
eeeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&++&&&+$
|||**|||*$
!!!==!!!=$
::::::::#$
.......@@$
$$
eeeeee.$
@@@@@@:$
%%%----$
&&&&&++$
|||||**$
!!!====$
::::::#$
......@$
$$
eeeeee.$
@@@@@@:$
%%%----$
&&&&&++$
|||||**$
!!!====$
:::####$
...@@@@$
$$
.eeeeee..$
@@@@@@@@:$
%%%------$
&&&++++++$
|||*||||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
eee..eee.$
@@@::@@@:$
%%%--%%%-$
&&&&&&&&+$
||||||||*$
!!!==!!!=$
:::##:::#$
...@@...@$
$$
eee.$
@@@:$
%%%-$
&&&+$
|||*$
!!!=$
:::#$
...@$
$$
eeeeeee.$
@@@@@@@:$
----%%%-$
++++&&&+$
****|||*$
!!==!!!=$
:::::::#$
@.....@@$
$$
eee..eee.$
@@@::@@@:$
%%%-%%%--$
&&&&&&+++$
||||||***$
!!!=!!!==$
:::##:::#$
...@@...@$
$$
eee....$
@@@::::$
%%%----$
&&&++++$
|||****$
!!!====$
::::::#$
......@$
$$
eee......eee.$
@@@@::::@@@@:$
%%%%%--%%%%%-$
&&&&&&&&&&&&+$
|||*||||*|||*$
!!!==!!==!!!=$
:::######:::#$
...@@@@@@...@$
$$
eeeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&++&&&+$
|||**|||*$
!!!==!!!=$
:::##:::#$
...@@...@$
$$
.eeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&++&&&+$
|||**|||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
eeeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&&&&&&+$
|||||||**$
!!!======$
:::######$
...@@@@@@$
$$
.eeeeeeee...$
@@@@@@@@@@::$
%%%----%%%--$
&&&++++&&&++$
|||*||*|||**$
!!!==!!!!!==$
::::::::::##$
@......@...@$
$$
eeeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&&&&&++$
||||||***$
!!!=!!!==$
:::##:::#$
...@@...@$
$$
.eeeeee.$
@@@@@@@:$
%%%-----$
&&&&&&++$
*||||||*$
====!!!=$
:::::::#$
......@@$
$$
eeeeeeeee.$
@@@@@@@@@:$
---%%%----$
+++&&&++++$
***|||****$
===!!!====$
###:::####$
@@@...@@@@$
$$
eee..eee.$
@@@::@@@:$
%%%--%%%-$
&&&++&&&+$
|||**|||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
eee....eee.$
@@@::::@@@:$
%%%----%%%-$
&&&++++&&&+$
*|||**|||**$
==!!!!!!===$
###::::####$
@@@@..@@@@@$
$$
eee..eee..eee.$
@@@::@@@::@@@:$
%%%--%%%--%%%-$
&&&++&&&++&&&+$
|||**|||**|||*$
!!!==!!!==!!!=$
:::::::::::::#$
@...........@@$
$$
eee..eee.$
@@@::@@@:$
%%%--%%%-$
+&&&&&&++$
*||||||**$
!!!==!!!=$
:::##:::#$
...@@...@$
$$
eee...eee.$
@@@:::@@@.$
%%%---%%%-$
+&&&&&&&++$
**|||||***$
===!!!====$
###:::####$
@@@...@@@@$
$$
eeeeeeee.$
@@@@@@@@:$
----%%%--$
+++&&&+++$
**|||****$
=!!!=====$
::::::::#$
........@$
$$
eeeeee.$
@@@@@@:$
%%%----$
&&&++++$
|||****$
!!!====$
::::::#$
......@$
$$
eee........$
:@@@:::::::$
--%%%------$
+++&&&+++++$
****|||****$
=====!!!===$
######:::##$
@@@@@@@...@$
$$
eeeeee.$
@@@@@@:$
---%%%-$
+++&&&+$
***|||*$
===!!!=$
::::::#$
......@$
$$
..eeee...$
:@@@@@@::$
%%%--%%%-$
+++++++++$
*********$
=========$
#########$
@@@@@@@@@$
$$
.........$
:::::::::$
---------$
+++++++++$
*********$
=========$
::::::::#$
........@$
$$
eee..$
@@@::$
-%%%-$
+++++$
*****$
=====$
:::::$
.....$
$$
.eeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&&&&&&+$
||||||||*$
!!!==!!!=$
:::##:::#$
...@@...@$
$$
eeeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&&&&&++$
||||||||*$
!!!==!!!=$
::::::::#$
.......@@$
$$
.eeeee.$
@@@@@@:$
%%%----$
&&&++++$
|||****$
!!!====$
::::::#$
@.....@$
$$
eeeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&++&&&+$
|||**|||*$
!!!==!!!=$
::::::::#$
.......@@$
$$
eeeeee.$
@@@@@@:$
%%%----$
&&&&&++$
|||||**$
!!!====$
::::::#$
......@$
$$
eeeeee.$
@@@@@@:$
%%%----$
&&&&&++$
|||||**$
!!!====$
:::####$
...@@@@$
$$
.eeeeee..$
@@@@@@@@:$
%%%------$
&&&++++++$
|||*||||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
eee..eee.$
@@@::@@@:$
%%%--%%%-$
&&&&&&&&+$
||||||||*$
!!!==!!!=$
:::##:::#$
...@@...@$
$$
eee.$
@@@:$
%%%-$
&&&+$
|||*$
!!!=$
:::#$
...@$
$$
eeeeeee.$
@@@@@@@:$
----%%%-$
++++&&&+$
****|||*$
!!==!!!=$
:::::::#$
@.....@@$
$$
eee..eee.$
@@@::@@@:$
%%%-%%%--$
&&&&&&+++$
||||||***$
!!!=!!!==$
:::##:::#$
...@@...@$
$$
eee....$
@@@::::$
%%%----$
&&&++++$
|||****$
!!!====$
::::::#$
......@$
$$
eee......eee.$
@@@@::::@@@@:$
%%%%%--%%%%%-$
&&&&&&&&&&&&+$
|||*||||*|||*$
!!!==!!==!!!=$
:::######:::#$
...@@@@@@...@$
$$
eeeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&++&&&+$
|||**|||*$
!!!==!!!=$
:::##:::#$
...@@...@$
$$
.eeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&++&&&+$
|||**|||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
eeeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&&&&&&+$
|||||||**$
!!!======$
:::######$
...@@@@@@$
$$
.eeeeeeee...$
@@@@@@@@@@::$
%%%----%%%--$
&&&++++&&&++$
|||*||*|||**$
!!!==!!!!!==$
::::::::::##$
@......@...@$
$$
eeeeeee..$
@@@@@@@@:$
%%%--%%%-$
&&&&&&&++$
||||||***$
!!!=!!!==$
:::##:::#$
...@@...@$
$$
.eeeeee.$
@@@@@@@:$
%%%-----$
&&&&&&++$
*||||||*$
====!!!=$
:::::::#$
......@@$
$$
eeeeeeeee.$
@@@@@@@@@:$
---%%%----$
+++&&&++++$
***|||****$
===!!!====$
###:::####$
@@@...@@@@$
$$
eee..eee.$
@@@::@@@:$
%%%--%%%-$
&&&++&&&+$
|||**|||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
eee....eee.$
@@@::::@@@:$
%%%----%%%-$
&&&++++&&&+$
*|||**|||**$
==!!!!!!===$
###::::####$
@@@@..@@@@@$
$$
eee..eee..eee.$
@@@::@@@::@@@:$
%%%--%%%--%%%-$
&&&++&&&++&&&+$
|||**|||**|||*$
!!!==!!!==!!!=$
:::::::::::::#$
@...........@@$
$$
eee..eee.$
@@@::@@@:$
%%%--%%%-$
+&&&&&&++$
*||||||**$
!!!==!!!=$
:::##:::#$
...@@...@$
$$
eee...eee.$
@@@:::@@@.$
%%%---%%%-$
+&&&&&&&++$
**|||||***$
===!!!====$
###:::####$
@@@...@@@@$
$$
eeeeeeee.$
@@@@@@@@:$
----%%%--$
+++&&&+++$
**|||****$
=!!!=====$
::::::::#$
........@$
$$
...eeeee.$
::@@@@@@:$
-%%%-----$
&&&++++++$
|||******$
=!!!=====$
##::::::#$
@@@.....@$
$$
eee.$
@@@:$
%%%-$
&&&+$
|||*$
!!!=$
:::#$
...@$
$$
eeeee....$
@@@@@@:::$
----%%%--$
+++++&&&+$
*****|||*$
====!!!==$
::::::###$
.....@@@@$
$$
..eeee....eee.$
:@@@@@@::@@@::$
%%%--%%%%%%---$
++++++++++++++$
**************$
==============$
##############$
@@@@@@@@@@@@@@$
$$
eee...ee...eee.$
@@@::@@@@::@@@:$
----%%%%%%-----$
+++&&&++&&&++++$
**|||****|||***$
=!!!!!!!!!!!!==$
::::::::::::::#$
...@@@@@@@@...@$
$$
eee..eee.$
@@@::@@@:$
---------$
+&&&&&&++$
||||||||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
eee..eee.$
@@@::@@@:$
---------$
&&&++&&&+$
|||**|||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
eee...ee...eee.$
@@@::@@@@::@@@:$
----%%%%%%-----$
+++&&&++&&&++++$
**|||****|||***$
=!!!!!!!!!!!!==$
::::::::::::::#$
...@@@@@@@@...@$
$$
eee..eee.$
@@@::@@@:$
---------$
+&&&&&&++$
||||||||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
eee..eee.$
@@@::@@@:$
---------$
&&&++&&&+$
|||**|||*$
!!!==!!!=$
::::::::#$
@......@@$
$$
..eeeeee..$
:@@@@@@@@:$
-%%%--%%%-$
+&&&+&&&++$
*|||**|||*$
=!!!==!!!=$
:::##::::#$
...@@...@@$
$$
@@ -0,0 +1,501 @@
/**
* blake2b (64-bit) & blake2s (8 to 32-bit) hash functions.
* b could have been faster, but there is no fast u64 in js, so s is 1.5x faster.
* @module
*/
import { BSIGMA, G1s, G2s } from "./_blake.js";
import { SHA256_IV } from "./_md.js";
import * as u64 from "./_u64.js";
// prettier-ignore
import { abytes, aexists, anumber, aoutput, clean, createHasher, swap32IfBE, swap8IfBE, u32 } from "./utils.js";
// Same IV words as `SHA512_IV`, but endian-swapped into LE u32 low/high halves
// for the BLAKE2b u64 helpers below.
const B2B_IV = /* @__PURE__ */ Uint32Array.from([
0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a,
0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19,
]);
// Shared synchronous BLAKE2b work vector as LE u32 low/high halves.
const BBUF = /* @__PURE__ */ new Uint32Array(32);
// BLAKE2b G mix split into two half-rounds over LE u32 low/high limbs.
function G1b(a, b, c, d, msg, x) {
// NOTE: V is LE here
const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore
let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore
let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore
let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore
let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore
// v[a] = (v[a] + v[b] + x) | 0;
let ll = u64.add3L(Al, Bl, Xl);
Ah = u64.add3H(ll, Ah, Bh, Xh);
Al = ll | 0;
// v[d] = rotr(v[d] ^ v[a], 32)
({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al });
({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) });
// v[c] = (v[c] + v[d]) | 0;
({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl));
// v[b] = rotr(v[b] ^ v[c], 24)
({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl });
({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) });
((BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah));
((BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh));
((BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch));
((BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh));
}
// Second half-round of the same LE-limb BLAKE2b G mix; `x` is the message word offset.
function G2b(a, b, c, d, msg, x) {
// NOTE: V is LE here
const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore
let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore
let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore
let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore
let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore
// v[a] = (v[a] + v[b] + x) | 0;
let ll = u64.add3L(Al, Bl, Xl);
Ah = u64.add3H(ll, Ah, Bh, Xh);
Al = ll | 0;
// v[d] = rotr(v[d] ^ v[a], 16)
({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al });
({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) });
// v[c] = (v[c] + v[d]) | 0;
({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl));
// v[b] = rotr(v[b] ^ v[c], 63)
({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl });
({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) });
((BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah));
((BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh));
((BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch));
((BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh));
}
function checkBlake2Opts(outputLen, opts = {}, keyLen, saltLen, persLen) {
anumber(keyLen);
// RFC 7693 §2.1 requires digest length nn in 1..keyLen.
if (outputLen <= 0 || outputLen > keyLen)
throw new Error('outputLen bigger than keyLen');
const { key, salt, personalization } = opts;
// This API uses `undefined` for the RFC 7693 `kk = 0` case, so a provided key must be non-empty.
if (key !== undefined && (key.length < 1 || key.length > keyLen))
throw new Error('"key" expected to be undefined or of length=1..' + keyLen);
if (salt !== undefined)
abytes(salt, saltLen, 'salt');
if (personalization !== undefined)
abytes(personalization, persLen, 'personalization');
}
/** Internal base class for BLAKE2. */
export class _BLAKE2 {
buffer;
buffer32;
finished = false;
destroyed = false;
length = 0;
pos = 0;
blockLen;
outputLen;
canXOF = false;
constructor(blockLen, outputLen) {
anumber(blockLen);
anumber(outputLen);
this.blockLen = blockLen;
this.outputLen = outputLen;
this.buffer = new Uint8Array(blockLen);
this.buffer32 = u32(this.buffer);
}
update(data) {
aexists(this);
abytes(data);
// Main difference with other hashes: there is flag for last block,
// so we cannot process current block before we know that there
// is the next one. This significantly complicates logic and reduces ability
// to do zero-copy processing
const { blockLen, buffer, buffer32 } = this;
const len = data.length;
const offset = data.byteOffset;
const buf = data.buffer;
for (let pos = 0; pos < len;) {
// If buffer is full and we still have input (don't process last block, same as blake2s)
if (this.pos === blockLen) {
swap32IfBE(buffer32);
this.compress(buffer32, 0, false);
swap32IfBE(buffer32);
this.pos = 0;
}
const take = Math.min(blockLen - this.pos, len - pos);
const dataOffset = offset + pos;
// Zero-copy only for full, 4-byte-aligned, non-final blocks.
if (take === blockLen && !(dataOffset % 4) && pos + take < len) {
const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4));
swap32IfBE(data32);
for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) {
this.length += blockLen;
this.compress(data32, pos32, false);
}
swap32IfBE(data32);
continue;
}
buffer.set(data.subarray(pos, pos + take), this.pos);
this.pos += take;
this.length += take;
pos += take;
}
return this;
}
digestInto(out) {
aexists(this);
aoutput(out, this);
const { pos, buffer32 } = this;
this.finished = true;
// Padding
clean(this.buffer.subarray(pos));
swap32IfBE(buffer32);
this.compress(buffer32, 0, true);
swap32IfBE(buffer32);
// Reject unaligned views explicitly instead of hiding them behind a full scratch copy.
if (out.byteOffset & 3)
throw new RangeError('"digestInto() output" expected 4-byte aligned byteOffset, got ' + out.byteOffset);
const state = this.get();
const out32 = u32(out);
const full = Math.floor(this.outputLen / 4);
for (let i = 0; i < full; i++)
out32[i] = swap8IfBE(state[i]);
const tail = this.outputLen % 4;
if (!tail)
return;
const off = full * 4;
const word = state[full];
for (let i = 0; i < tail; i++)
out[off + i] = word >>> (8 * i);
}
digest() {
const { buffer, outputLen } = this;
this.digestInto(buffer);
// Return a copy so callers do not alias the instance scratch buffer used during finalization.
const res = buffer.slice(0, outputLen);
this.destroy();
return res;
}
_cloneInto(to) {
const { buffer, length, finished, destroyed, outputLen, pos } = this;
// Recreate only `dkLen`; key/salt/personalization are already absorbed into the copied state.
to ||= new this.constructor({ dkLen: outputLen });
to.set(...this.get());
to.buffer.set(buffer);
to.destroyed = destroyed;
to.finished = finished;
to.length = length;
to.pos = pos;
// @ts-ignore
to.outputLen = outputLen;
return to;
}
clone() {
return this._cloneInto();
}
}
/** Internal blake2b hash class with state stored as LE u32 low/high halves. */
export class _BLAKE2b extends _BLAKE2 {
// Same IV words as SHA-512 / BLAKE2b, encoded as LE u32 low/high halves.
v0l = B2B_IV[0] | 0;
v0h = B2B_IV[1] | 0;
v1l = B2B_IV[2] | 0;
v1h = B2B_IV[3] | 0;
v2l = B2B_IV[4] | 0;
v2h = B2B_IV[5] | 0;
v3l = B2B_IV[6] | 0;
v3h = B2B_IV[7] | 0;
v4l = B2B_IV[8] | 0;
v4h = B2B_IV[9] | 0;
v5l = B2B_IV[10] | 0;
v5h = B2B_IV[11] | 0;
v6l = B2B_IV[12] | 0;
v6h = B2B_IV[13] | 0;
v7l = B2B_IV[14] | 0;
v7h = B2B_IV[15] | 0;
constructor(opts = {}) {
const olen = opts.dkLen === undefined ? 64 : opts.dkLen;
super(128, olen);
checkBlake2Opts(olen, opts, 64, 16, 16);
let { key, personalization, salt } = opts;
let keyLength = 0;
if (key !== undefined) {
abytes(key, undefined, 'key');
keyLength = key.length;
}
// RFC 7693 §2.5: xor `p[0] = 0x0101kknn` into the low 32 bits of `h[0]`;
// the high 32 bits stay at `IV[0]`.
this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24);
if (salt !== undefined) {
abytes(salt, undefined, 'salt');
const slt = u32(salt);
this.v4l ^= swap8IfBE(slt[0]);
this.v4h ^= swap8IfBE(slt[1]);
this.v5l ^= swap8IfBE(slt[2]);
this.v5h ^= swap8IfBE(slt[3]);
}
if (personalization !== undefined) {
abytes(personalization, undefined, 'personalization');
const pers = u32(personalization);
this.v6l ^= swap8IfBE(pers[0]);
this.v6h ^= swap8IfBE(pers[1]);
this.v7l ^= swap8IfBE(pers[2]);
this.v7h ^= swap8IfBE(pers[3]);
}
if (key !== undefined) {
// Pad to blockLen and update
const tmp = new Uint8Array(this.blockLen);
tmp.set(key);
this.update(tmp);
}
}
// prettier-ignore
get() {
let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this;
return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h];
}
// prettier-ignore
set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) {
this.v0l = v0l | 0;
this.v0h = v0h | 0;
this.v1l = v1l | 0;
this.v1h = v1h | 0;
this.v2l = v2l | 0;
this.v2h = v2h | 0;
this.v3l = v3l | 0;
this.v3h = v3h | 0;
this.v4l = v4l | 0;
this.v4h = v4h | 0;
this.v5l = v5l | 0;
this.v5h = v5h | 0;
this.v6l = v6l | 0;
this.v6h = v6h | 0;
this.v7l = v7l | 0;
this.v7h = v7h | 0;
}
compress(msg, offset, isLast) {
this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state.
BBUF.set(B2B_IV, 16); // Second half from IV.
let { h, l } = u64.fromBig(BigInt(this.length));
BBUF[24] = B2B_IV[8] ^ l; // Low word of the offset.
BBUF[25] = B2B_IV[9] ^ h; // High word.
// Invert all bits for last block
if (isLast) {
BBUF[28] = ~BBUF[28];
BBUF[29] = ~BBUF[29];
}
let j = 0;
const s = BSIGMA;
// SIGMA selects 64-bit message words; multiply by 2 because `msg` stores
// each word as [low32, high32].
for (let i = 0; i < 12; i++) {
G1b(0, 4, 8, 12, msg, offset + 2 * s[j++]);
G2b(0, 4, 8, 12, msg, offset + 2 * s[j++]);
G1b(1, 5, 9, 13, msg, offset + 2 * s[j++]);
G2b(1, 5, 9, 13, msg, offset + 2 * s[j++]);
G1b(2, 6, 10, 14, msg, offset + 2 * s[j++]);
G2b(2, 6, 10, 14, msg, offset + 2 * s[j++]);
G1b(3, 7, 11, 15, msg, offset + 2 * s[j++]);
G2b(3, 7, 11, 15, msg, offset + 2 * s[j++]);
G1b(0, 5, 10, 15, msg, offset + 2 * s[j++]);
G2b(0, 5, 10, 15, msg, offset + 2 * s[j++]);
G1b(1, 6, 11, 12, msg, offset + 2 * s[j++]);
G2b(1, 6, 11, 12, msg, offset + 2 * s[j++]);
G1b(2, 7, 8, 13, msg, offset + 2 * s[j++]);
G2b(2, 7, 8, 13, msg, offset + 2 * s[j++]);
G1b(3, 4, 9, 14, msg, offset + 2 * s[j++]);
G2b(3, 4, 9, 14, msg, offset + 2 * s[j++]);
}
this.v0l ^= BBUF[0] ^ BBUF[16];
this.v0h ^= BBUF[1] ^ BBUF[17];
this.v1l ^= BBUF[2] ^ BBUF[18];
this.v1h ^= BBUF[3] ^ BBUF[19];
this.v2l ^= BBUF[4] ^ BBUF[20];
this.v2h ^= BBUF[5] ^ BBUF[21];
this.v3l ^= BBUF[6] ^ BBUF[22];
this.v3h ^= BBUF[7] ^ BBUF[23];
this.v4l ^= BBUF[8] ^ BBUF[24];
this.v4h ^= BBUF[9] ^ BBUF[25];
this.v5l ^= BBUF[10] ^ BBUF[26];
this.v5h ^= BBUF[11] ^ BBUF[27];
this.v6l ^= BBUF[12] ^ BBUF[28];
this.v6h ^= BBUF[13] ^ BBUF[29];
this.v7l ^= BBUF[14] ^ BBUF[30];
this.v7h ^= BBUF[15] ^ BBUF[31];
clean(BBUF);
}
destroy() {
this.destroyed = true;
clean(this.buffer32);
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
}
/**
* Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS.
* @param msg - message that would be hashed
* @param opts - Optional output, MAC, salt, and personalization settings.
* `dkLen` must be 1..64 bytes; `salt` and `personalization`, if present,
* must be 16 bytes each. See {@link Blake2Opts}.
* @returns Digest bytes.
* @example
* Hash a message with Blake2b.
* ```ts
* blake2b(new Uint8Array([97, 98, 99]));
* ```
*/
export const blake2b = /* @__PURE__ */ createHasher((opts) => new _BLAKE2b(opts));
/**
* BLAKE2-compress core method.
* Runs only the round function over a caller-supplied local vector; callers initialize `v0..v15`
* and apply the final `h[i] ^= v[i] ^ v[i + 8]` fold themselves.
* @param s - flattened sigma schedule bytes
* @param offset - starting word offset inside `msg`, not a byte offset
* @param msg - message words
* @param rounds - round count to execute
* @param v0 - state word 0
* @param v1 - state word 1
* @param v2 - state word 2
* @param v3 - state word 3
* @param v4 - state word 4
* @param v5 - state word 5
* @param v6 - state word 6
* @param v7 - state word 7
* @param v8 - state word 8
* @param v9 - state word 9
* @param v10 - state word 10
* @param v11 - state word 11
* @param v12 - state word 12
* @param v13 - state word 13
* @param v14 - state word 14
* @param v15 - state word 15
* @returns Updated compression state words.
* @example
* Run the BLAKE2 compression core on zeroed state and message words.
* ```ts
* import { compress } from '@noble/hashes/blake2.js';
* const state = compress(
* new Uint8Array(16),
* 0,
* new Uint32Array(16),
* 1,
* 0, 0, 0, 0, 0, 0, 0, 0,
* 0, 0, 0, 0, 0, 0, 0, 0
* );
* state.v0;
* ```
*/
// prettier-ignore
export function compress(s, offset, msg, rounds, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) {
let j = 0;
for (let i = 0; i < rounds; i++) {
({ a: v0, b: v4, c: v8, d: v12 } = G1s(v0, v4, v8, v12, msg[offset + s[j++]]));
({ a: v0, b: v4, c: v8, d: v12 } = G2s(v0, v4, v8, v12, msg[offset + s[j++]]));
({ a: v1, b: v5, c: v9, d: v13 } = G1s(v1, v5, v9, v13, msg[offset + s[j++]]));
({ a: v1, b: v5, c: v9, d: v13 } = G2s(v1, v5, v9, v13, msg[offset + s[j++]]));
({ a: v2, b: v6, c: v10, d: v14 } = G1s(v2, v6, v10, v14, msg[offset + s[j++]]));
({ a: v2, b: v6, c: v10, d: v14 } = G2s(v2, v6, v10, v14, msg[offset + s[j++]]));
({ a: v3, b: v7, c: v11, d: v15 } = G1s(v3, v7, v11, v15, msg[offset + s[j++]]));
({ a: v3, b: v7, c: v11, d: v15 } = G2s(v3, v7, v11, v15, msg[offset + s[j++]]));
({ a: v0, b: v5, c: v10, d: v15 } = G1s(v0, v5, v10, v15, msg[offset + s[j++]]));
({ a: v0, b: v5, c: v10, d: v15 } = G2s(v0, v5, v10, v15, msg[offset + s[j++]]));
({ a: v1, b: v6, c: v11, d: v12 } = G1s(v1, v6, v11, v12, msg[offset + s[j++]]));
({ a: v1, b: v6, c: v11, d: v12 } = G2s(v1, v6, v11, v12, msg[offset + s[j++]]));
({ a: v2, b: v7, c: v8, d: v13 } = G1s(v2, v7, v8, v13, msg[offset + s[j++]]));
({ a: v2, b: v7, c: v8, d: v13 } = G2s(v2, v7, v8, v13, msg[offset + s[j++]]));
({ a: v3, b: v4, c: v9, d: v14 } = G1s(v3, v4, v9, v14, msg[offset + s[j++]]));
({ a: v3, b: v4, c: v9, d: v14 } = G2s(v3, v4, v9, v14, msg[offset + s[j++]]));
}
return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 };
}
// Blake2s reuses the SHA-256 IV words as-is.
const B2S_IV = /* @__PURE__ */ SHA256_IV.slice();
/** Internal blake2s hash class. */
export class _BLAKE2s extends _BLAKE2 {
// Internal state, same as SHA-256
v0 = B2S_IV[0] | 0;
v1 = B2S_IV[1] | 0;
v2 = B2S_IV[2] | 0;
v3 = B2S_IV[3] | 0;
v4 = B2S_IV[4] | 0;
v5 = B2S_IV[5] | 0;
v6 = B2S_IV[6] | 0;
v7 = B2S_IV[7] | 0;
constructor(opts = {}) {
const olen = opts.dkLen === undefined ? 32 : opts.dkLen;
super(64, olen);
checkBlake2Opts(olen, opts, 32, 8, 8);
let { key, personalization, salt } = opts;
let keyLength = 0;
if (key !== undefined) {
abytes(key, undefined, 'key');
keyLength = key.length;
}
// RFC 7693 §2.5: xor `p[0] = 0x0101kknn` directly into `h[0]`, since
// BLAKE2s stores each state word as one `u32`.
this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24);
if (salt !== undefined) {
abytes(salt, undefined, 'salt');
const slt = u32(salt);
this.v4 ^= swap8IfBE(slt[0]);
this.v5 ^= swap8IfBE(slt[1]);
}
if (personalization !== undefined) {
abytes(personalization, undefined, 'personalization');
const pers = u32(personalization);
this.v6 ^= swap8IfBE(pers[0]);
this.v7 ^= swap8IfBE(pers[1]);
}
if (key !== undefined) {
// Pad to blockLen and update
const tmp = new Uint8Array(this.blockLen);
tmp.set(key);
this.update(tmp);
}
}
get() {
const { v0, v1, v2, v3, v4, v5, v6, v7 } = this;
return [v0, v1, v2, v3, v4, v5, v6, v7];
}
// prettier-ignore
set(v0, v1, v2, v3, v4, v5, v6, v7) {
this.v0 = v0 | 0;
this.v1 = v1 | 0;
this.v2 = v2 | 0;
this.v3 = v3 | 0;
this.v4 = v4 | 0;
this.v5 = v5 | 0;
this.v6 = v6 | 0;
this.v7 = v7 | 0;
}
compress(msg, offset, isLast) {
const { h, l } = u64.fromBig(BigInt(this.length));
// Seed v8..v15 from the IV, xor the low/high 32-bit byte counter into
// v12/v13, and invert v14 on the final block.
// prettier-ignore
const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(BSIGMA, offset, msg, 10, this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, B2S_IV[0], B2S_IV[1], B2S_IV[2], B2S_IV[3], l ^ B2S_IV[4], h ^ B2S_IV[5], isLast ? ~B2S_IV[6] : B2S_IV[6], B2S_IV[7]);
this.v0 ^= v0 ^ v8;
this.v1 ^= v1 ^ v9;
this.v2 ^= v2 ^ v10;
this.v3 ^= v3 ^ v11;
this.v4 ^= v4 ^ v12;
this.v5 ^= v5 ^ v13;
this.v6 ^= v6 ^ v14;
this.v7 ^= v7 ^ v15;
}
destroy() {
this.destroyed = true;
clean(this.buffer32);
this.set(0, 0, 0, 0, 0, 0, 0, 0);
}
}
/**
* Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS.
* @param msg - message that would be hashed
* @param opts - Optional output, MAC, salt, and personalization settings.
* `dkLen` must be 1..32 bytes; `salt` and `personalization`, if present,
* must be 8 bytes each. See {@link Blake2Opts}.
* @returns Digest bytes.
* @example
* Hash a message with Blake2s.
* ```ts
* blake2s(new Uint8Array([97, 98, 99]));
* ```
*/
export const blake2s = /* @__PURE__ */ createHasher((opts) => new _BLAKE2s(opts));
//# sourceMappingURL=blake2.js.map
@@ -0,0 +1,294 @@
/**
* negotiator
* Copyright(c) 2012 Isaac Z. Schlueter
* Copyright(c) 2014 Federico Romero
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict';
/**
* Module exports.
* @public
*/
module.exports = preferredMediaTypes;
module.exports.preferredMediaTypes = preferredMediaTypes;
/**
* Module variables.
* @private
*/
var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;
/**
* Parse the Accept header.
* @private
*/
function parseAccept(accept) {
var accepts = splitMediaTypes(accept);
for (var i = 0, j = 0; i < accepts.length; i++) {
var mediaType = parseMediaType(accepts[i].trim(), i);
if (mediaType) {
accepts[j++] = mediaType;
}
}
// trim accepts
accepts.length = j;
return accepts;
}
/**
* Parse a media type from the Accept header.
* @private
*/
function parseMediaType(str, i) {
var match = simpleMediaTypeRegExp.exec(str);
if (!match) return null;
var params = Object.create(null);
var q = 1;
var subtype = match[2];
var type = match[1];
if (match[3]) {
var kvps = splitParameters(match[3]).map(splitKeyValuePair);
for (var j = 0; j < kvps.length; j++) {
var pair = kvps[j];
var key = pair[0].toLowerCase();
var val = pair[1];
// get the value, unwrapping quotes
var value = val && val[0] === '"' && val[val.length - 1] === '"'
? val.slice(1, -1)
: val;
if (key === 'q') {
q = parseFloat(value);
break;
}
// store parameter
params[key] = value;
}
}
return {
type: type,
subtype: subtype,
params: params,
q: q,
i: i
};
}
/**
* Get the priority of a media type.
* @private
*/
function getMediaTypePriority(type, accepted, index) {
var priority = {o: -1, q: 0, s: 0};
for (var i = 0; i < accepted.length; i++) {
var spec = specify(type, accepted[i], index);
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
priority = spec;
}
}
return priority;
}
/**
* Get the specificity of the media type.
* @private
*/
function specify(type, spec, index) {
var p = parseMediaType(type);
var s = 0;
if (!p) {
return null;
}
if(spec.type.toLowerCase() == p.type.toLowerCase()) {
s |= 4
} else if(spec.type != '*') {
return null;
}
if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) {
s |= 2
} else if(spec.subtype != '*') {
return null;
}
var keys = Object.keys(spec.params);
if (keys.length > 0) {
if (keys.every(function (k) {
return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase();
})) {
s |= 1
} else {
return null
}
}
return {
i: index,
o: spec.i,
q: spec.q,
s: s,
}
}
/**
* Get the preferred media types from an Accept header.
* @public
*/
function preferredMediaTypes(accept, provided) {
// RFC 2616 sec 14.2: no header = */*
var accepts = parseAccept(accept === undefined ? '*/*' : accept || '');
if (!provided) {
// sorted list of all types
return accepts
.filter(isQuality)
.sort(compareSpecs)
.map(getFullType);
}
var priorities = provided.map(function getPriority(type, index) {
return getMediaTypePriority(type, accepts, index);
});
// sorted list of accepted types
return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) {
return provided[priorities.indexOf(priority)];
});
}
/**
* Compare two specs.
* @private
*/
function compareSpecs(a, b) {
return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
}
/**
* Get full type string.
* @private
*/
function getFullType(spec) {
return spec.type + '/' + spec.subtype;
}
/**
* Check if a spec has any quality.
* @private
*/
function isQuality(spec) {
return spec.q > 0;
}
/**
* Count the number of quotes in a string.
* @private
*/
function quoteCount(string) {
var count = 0;
var index = 0;
while ((index = string.indexOf('"', index)) !== -1) {
count++;
index++;
}
return count;
}
/**
* Split a key value pair.
* @private
*/
function splitKeyValuePair(str) {
var index = str.indexOf('=');
var key;
var val;
if (index === -1) {
key = str;
} else {
key = str.slice(0, index);
val = str.slice(index + 1);
}
return [key, val];
}
/**
* Split an Accept header into media types.
* @private
*/
function splitMediaTypes(accept) {
var accepts = accept.split(',');
for (var i = 1, j = 0; i < accepts.length; i++) {
if (quoteCount(accepts[j]) % 2 == 0) {
accepts[++j] = accepts[i];
} else {
accepts[j] += ',' + accepts[i];
}
}
// trim accepts
accepts.length = j + 1;
return accepts;
}
/**
* Split a string of parameters.
* @private
*/
function splitParameters(str) {
var parameters = str.split(';');
for (var i = 1, j = 0; i < parameters.length; i++) {
if (quoteCount(parameters[j]) % 2 == 0) {
parameters[++j] = parameters[i];
} else {
parameters[j] += ';' + parameters[i];
}
}
// trim parameters
parameters.length = j + 1;
for (var i = 0; i < parameters.length; i++) {
parameters[i] = parameters[i].trim();
}
return parameters;
}
@@ -0,0 +1 @@
{"version":3,"file":"apple.js","sources":["../../../src/icons/apple.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Apple\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMjAuOTRjMS41IDAgMi43NSAxLjA2IDQgMS4wNiAzIDAgNi04IDYtMTIuMjJBNC45MSA0LjkxIDAgMCAwIDE3IDVjLTIuMjIgMC00IDEuNDQtNSAyLTEtLjU2LTIuNzgtMi01LTJhNC45IDQuOSAwIDAgMC01IDQuNzhDMiAxNCA1IDIyIDggMjJjMS4yNSAwIDIuNS0xLjA2IDQtMS4wNloiIC8+CiAgPHBhdGggZD0iTTEwIDJjMSAuNSAyIDIgMiA1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/apple\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Apple = createLucideIcon('Apple', [\n [\n 'path',\n {\n d: 'M12 20.94c1.5 0 2.75 1.06 4 1.06 3 0 6-8 6-12.22A4.91 4.91 0 0 0 17 5c-2.22 0-4 1.44-5 2-1-.56-2.78-2-5-2a4.9 4.9 0 0 0-5 4.78C2 14 5 22 8 22c1.25 0 2.5-1.06 4-1.06Z',\n key: '3s7exb',\n },\n ],\n ['path', { d: 'M10 2c1 .5 2 2 2 5', key: 'fcco2y' }],\n]);\n\nexport default Apple;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CACtC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACrD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,360 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = rewriteLiveReferences;
var _core = require("@babel/core");
function isInType(path) {
do {
switch (path.parent.type) {
case "TSTypeAnnotation":
case "TSTypeAliasDeclaration":
case "TSTypeReference":
case "TypeAnnotation":
case "TypeAlias":
return true;
case "ExportSpecifier":
return path.parentPath.parent.exportKind === "type";
default:
if (path.parentPath.isStatement() || path.parentPath.isExpression()) {
return false;
}
}
} while (path = path.parentPath);
}
function rewriteLiveReferences(programPath, metadata, wrapReference) {
const imported = new Map();
const exported = new Map();
const requeueInParent = path => {
programPath.requeue(path);
};
for (const [source, data] of metadata.source) {
for (const [localName, importName] of data.imports) {
imported.set(localName, [source, importName, null]);
}
for (const localName of data.importsNamespace) {
imported.set(localName, [source, null, localName]);
}
}
for (const [local, data] of metadata.local) {
let exportMeta = exported.get(local);
if (!exportMeta) {
exportMeta = [];
exported.set(local, exportMeta);
}
exportMeta.push(...data.names);
}
const rewriteBindingInitVisitorState = {
metadata,
requeueInParent,
scope: programPath.scope,
exported
};
programPath.traverse(rewriteBindingInitVisitor, rewriteBindingInitVisitorState);
const rewriteReferencesVisitorState = {
seen: new WeakSet(),
metadata,
requeueInParent,
scope: programPath.scope,
imported,
exported,
buildImportReference([source, importName, localName], identNode) {
const meta = metadata.source.get(source);
meta.referenced = true;
if (localName) {
if (meta.wrap) {
var _wrapReference;
identNode = (_wrapReference = wrapReference(identNode, meta.wrap)) != null ? _wrapReference : identNode;
}
return identNode;
}
let namespace = _core.types.identifier(meta.name);
if (meta.wrap) {
var _wrapReference2;
namespace = (_wrapReference2 = wrapReference(namespace, meta.wrap)) != null ? _wrapReference2 : namespace;
}
if (importName === "default" && meta.interop === "node-default") {
return namespace;
}
const computed = metadata.stringSpecifiers.has(importName);
return _core.types.memberExpression(namespace, computed ? _core.types.stringLiteral(importName) : _core.types.identifier(importName), computed);
}
};
programPath.traverse(rewriteReferencesVisitor, rewriteReferencesVisitorState);
}
const rewriteBindingInitVisitor = {
Scope(path) {
path.skip();
},
ClassDeclaration(path) {
const {
requeueInParent,
exported,
metadata
} = this;
const {
id
} = path.node;
if (!id) throw new Error("Expected class to have a name");
const localName = id.name;
const exportNames = exported.get(localName) || [];
if (exportNames.length > 0) {
const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, _core.types.identifier(localName), path.scope));
statement._blockHoist = path.node._blockHoist;
requeueInParent(path.insertAfter(statement)[0]);
}
},
VariableDeclaration(path) {
const {
requeueInParent,
exported,
metadata
} = this;
const isVar = path.node.kind === "var";
for (const decl of path.get("declarations")) {
const {
id
} = decl.node;
let {
init
} = decl.node;
if (_core.types.isIdentifier(id) && exported.has(id.name) && !_core.types.isArrowFunctionExpression(init) && (!_core.types.isFunctionExpression(init) || init.id) && (!_core.types.isClassExpression(init) || init.id)) {
if (!init) {
if (isVar) {
continue;
} else {
init = path.scope.buildUndefinedNode();
}
}
decl.node.init = buildBindingExportAssignmentExpression(metadata, exported.get(id.name), init, path.scope);
requeueInParent(decl.get("init"));
} else {
for (const localName of Object.keys(decl.getOuterBindingIdentifiers())) {
if (exported.has(localName)) {
const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exported.get(localName), _core.types.identifier(localName), path.scope));
statement._blockHoist = path.node._blockHoist;
requeueInParent(path.insertAfter(statement)[0]);
}
}
}
}
}
};
const buildBindingExportAssignmentExpression = (metadata, exportNames, localExpr, scope) => {
const exportsObjectName = metadata.exportName;
for (let currentScope = scope; currentScope != null; currentScope = currentScope.parent) {
if (currentScope.hasOwnBinding(exportsObjectName)) {
currentScope.rename(exportsObjectName);
}
}
return (exportNames || []).reduce((expr, exportName) => {
const {
stringSpecifiers
} = metadata;
const computed = stringSpecifiers.has(exportName);
return _core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.identifier(exportsObjectName), computed ? _core.types.stringLiteral(exportName) : _core.types.identifier(exportName), computed), expr);
}, localExpr);
};
const buildImportThrow = localName => {
return _core.template.expression.ast`
(function() {
throw new Error('"' + '${localName}' + '" is read-only.');
})()
`;
};
const rewriteReferencesVisitor = {
ReferencedIdentifier(path) {
const {
seen,
buildImportReference,
scope,
imported,
requeueInParent
} = this;
if (seen.has(path.node)) return;
seen.add(path.node);
const localName = path.node.name;
const importData = imported.get(localName);
if (importData) {
if (isInType(path)) {
throw path.buildCodeFrameError(`Cannot transform the imported binding "${localName}" since it's also used in a type annotation. ` + `Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`);
}
const localBinding = path.scope.getBinding(localName);
const rootBinding = scope.getBinding(localName);
if (rootBinding !== localBinding) return;
const ref = buildImportReference(importData, path.node);
ref.loc = path.node.loc;
if ((path.parentPath.isCallExpression({
callee: path.node
}) || path.parentPath.isOptionalCallExpression({
callee: path.node
}) || path.parentPath.isTaggedTemplateExpression({
tag: path.node
})) && _core.types.isMemberExpression(ref)) {
path.replaceWith(_core.types.sequenceExpression([_core.types.numericLiteral(0), ref]));
} else if (path.isJSXIdentifier() && _core.types.isMemberExpression(ref)) {
const {
object,
property
} = ref;
path.replaceWith(_core.types.jsxMemberExpression(_core.types.jsxIdentifier(object.name), _core.types.jsxIdentifier(property.name)));
} else {
path.replaceWith(ref);
}
requeueInParent(path);
path.skip();
}
},
UpdateExpression(path) {
const {
scope,
seen,
imported,
exported,
requeueInParent,
buildImportReference
} = this;
if (seen.has(path.node)) return;
seen.add(path.node);
const arg = path.get("argument");
if (arg.isMemberExpression()) return;
const update = path.node;
if (arg.isIdentifier()) {
const localName = arg.node.name;
if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
return;
}
const exportedNames = exported.get(localName);
const importData = imported.get(localName);
if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
if (importData) {
path.replaceWith(_core.types.assignmentExpression(update.operator[0] + "=", buildImportReference(importData, arg.node), buildImportThrow(localName)));
} else if (update.prefix) {
path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.cloneNode(update), path.scope));
} else {
const ref = scope.generateDeclaredUidIdentifier(localName);
path.replaceWith(_core.types.sequenceExpression([_core.types.assignmentExpression("=", _core.types.cloneNode(ref), _core.types.cloneNode(update)), buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope), _core.types.cloneNode(ref)]));
}
}
}
requeueInParent(path);
path.skip();
},
AssignmentExpression: {
exit(path) {
const {
scope,
seen,
imported,
exported,
requeueInParent,
buildImportReference
} = this;
if (seen.has(path.node)) return;
seen.add(path.node);
const left = path.get("left");
if (left.isMemberExpression()) return;
if (left.isIdentifier()) {
const localName = left.node.name;
if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
return;
}
const exportedNames = exported.get(localName);
const importData = imported.get(localName);
if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
const assignment = path.node;
if (importData) {
assignment.left = buildImportReference(importData, left.node);
assignment.right = _core.types.sequenceExpression([assignment.right, buildImportThrow(localName)]);
}
const {
operator
} = assignment;
let newExpr;
if (operator === "=") {
newExpr = assignment;
} else if (operator === "&&=" || operator === "||=" || operator === "??=") {
newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.logicalExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right));
} else {
newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.binaryExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right));
}
path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, newExpr, path.scope));
requeueInParent(path);
path.skip();
}
} else {
const ids = left.getOuterBindingIdentifiers();
const programScopeIds = Object.keys(ids).filter(localName => scope.getBinding(localName) === path.scope.getBinding(localName));
const id = programScopeIds.find(localName => imported.has(localName));
if (id) {
path.node.right = _core.types.sequenceExpression([path.node.right, buildImportThrow(id)]);
}
const items = [];
programScopeIds.forEach(localName => {
const exportedNames = exported.get(localName) || [];
if (exportedNames.length > 0) {
items.push(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope));
}
});
if (items.length > 0) {
let node = _core.types.sequenceExpression(items);
if (path.parentPath.isExpressionStatement()) {
node = _core.types.expressionStatement(node);
node._blockHoist = path.parentPath.node._blockHoist;
}
const statement = path.insertAfter(node)[0];
requeueInParent(statement);
}
}
}
},
ForXStatement(path) {
const {
scope,
node
} = path;
const {
left
} = node;
const {
exported,
imported,
scope: programScope
} = this;
if (!_core.types.isVariableDeclaration(left)) {
let didTransformExport = false,
importConstViolationName;
const loopBodyScope = path.get("body").scope;
for (const name of Object.keys(_core.types.getOuterBindingIdentifiers(left))) {
if (programScope.getBinding(name) === scope.getBinding(name)) {
if (exported.has(name)) {
didTransformExport = true;
if (loopBodyScope.hasOwnBinding(name)) {
loopBodyScope.rename(name);
}
}
if (imported.has(name) && !importConstViolationName) {
importConstViolationName = name;
}
}
}
if (!didTransformExport && !importConstViolationName) {
return;
}
path.ensureBlock();
const bodyPath = path.get("body");
const newLoopId = scope.generateUidIdentifierBasedOnNode(left);
path.get("left").replaceWith(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(newLoopId))]));
scope.registerDeclaration(path.get("left"));
if (didTransformExport) {
bodyPath.unshiftContainer("body", _core.types.expressionStatement(_core.types.assignmentExpression("=", left, newLoopId)));
}
if (importConstViolationName) {
bodyPath.unshiftContainer("body", _core.types.expressionStatement(buildImportThrow(importConstViolationName)));
}
}
}
};
//# sourceMappingURL=rewrite-live-references.js.map
@@ -0,0 +1 @@
{"version":3,"file":"contact-2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,62 @@
//#region src/utils/types.d.ts
/**
* @module
* Types utility.
*/
export type Expect<T extends true> = T;
export type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
export type NotEqual<X, Y> = true extends Equal<X, Y> ? false : true;
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
export type RemoveBlankRecord<T> = T extends Record<infer K, unknown> ? (K extends string ? T : never) : never;
export type IfAnyThenEmptyObject<T> = 0 extends 1 & T ? {} : T;
export type JSONPrimitive = string | boolean | number | null;
export type JSONArray = (JSONPrimitive | JSONObject | JSONArray)[];
export type JSONObject = {
[key: string]: JSONPrimitive | JSONArray | JSONObject | object | InvalidJSONValue;
};
export type InvalidJSONValue = undefined | symbol | ((...args: unknown[]) => unknown);
type InvalidToNull<T> = T extends InvalidJSONValue ? null : T;
type IsInvalid<T> = T extends InvalidJSONValue ? true : false;
/**
* symbol keys are omitted through `JSON.stringify`
*/
type OmitSymbolKeys<T> = { [K in keyof T as K extends symbol ? never : K]: T[K]; };
export type JSONValue = JSONObject | JSONArray | JSONPrimitive;
/**
* Convert a type to a JSON-compatible type.
*
* Non-JSON values such as `Date` implement `.toJSON()`,
* so they can be transformed to a value assignable to `JSONObject`
*
* `JSON.stringify()` throws a `TypeError` when it encounters a `bigint` value,
* unless a custom `replacer` function or `.toJSON()` method is provided.
*
* This behavior can be controlled by the `TError` generic type parameter,
* which defaults to `bigint | ReadonlyArray<bigint>`.
* You can set it to `never` to disable this check.
*/
export type JSONParsed<T, TError = bigint | ReadonlyArray<bigint>> = T extends {
toJSON(): infer J;
} ? (() => J) extends (() => JSONPrimitive) ? J : (() => J) extends (() => {
toJSON(): unknown;
}) ? {} : JSONParsed<J, TError> : T extends JSONPrimitive ? T : T extends InvalidJSONValue ? never : T extends ReadonlyArray<unknown> ? { [K in keyof T]: JSONParsed<InvalidToNull<T[K]>, TError>; } extends (infer A) ? A extends ReadonlyArray<unknown> ? A : JSONParsed<InvalidToNull<T[number]>, TError>[] : never : T extends Set<unknown> | Map<unknown, unknown> | Record<string, never> ? {} : T extends object ? T[keyof T] extends TError ? never : { [K in keyof OmitSymbolKeys<T> as IsInvalid<T[K]> extends true ? never : K]: boolean extends IsInvalid<T[K]> ? JSONParsed<T[K], TError> | undefined : JSONParsed<T[K], TError>; } : T extends unknown ? T extends TError ? never : JSONValue : never;
/**
* Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
* @copyright from sindresorhus/type-fest
*/
export type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
/**
* A simple extension of Simplify that will deeply traverse array elements.
*/
export type SimplifyDeepArray<T> = T extends any[] ? { [E in keyof T]: SimplifyDeepArray<T[E]>; } : Simplify<T>;
export type InterfaceToType<T> = T extends Function ? T : { [K in keyof T]: InterfaceToType<T[K]>; };
export type RequiredKeysOf<BaseType extends object> = Exclude<{ [Key in keyof BaseType]: BaseType extends Record<Key, BaseType[Key]> ? Key : never; }[keyof BaseType], undefined>;
export type HasRequiredKeys<BaseType extends object> = RequiredKeysOf<BaseType> extends never ? false : true;
export type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false;
/**
* String literal types with auto-completion
* @see https://github.com/Microsoft/TypeScript/issues/29729
*/
export type StringLiteralUnion<T> = T | (string & Record<never, never>);
//#endregion
export {};
@@ -0,0 +1,46 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 180
quote_type = single
[test/*]
max_line_length = off
[LICENSE.md]
indent_size = off
[*.md]
max_line_length = off
[*.json]
max_line_length = off
[Makefile]
max_line_length = off
[CHANGELOG.md]
indent_style = space
indent_size = 2
[LICENSE]
indent_size = 2
max_line_length = off
[coverage/**/*]
indent_size = off
indent_style = off
indent = off
max_line_length = off
[.nycrc]
indent_style = tab
[tea.yaml]
indent_size = 2
@@ -0,0 +1 @@
{"version":3,"file":"panel-right-dashed.js","sources":["../../../src/icons/panel-right-dashed.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PanelRightDashed\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0xNSAxNHYxIiAvPgogIDxwYXRoIGQ9Ik0xNSAxOXYyIiAvPgogIDxwYXRoIGQ9Ik0xNSAzdjIiIC8+CiAgPHBhdGggZD0iTTE1IDl2MSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/panel-right-dashed\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst PanelRightDashed = createLucideIcon('PanelRightDashed', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M15 14v1', key: 'ilsfch' }],\n ['path', { d: 'M15 19v2', key: '1fst2f' }],\n ['path', { d: 'M15 3v2', key: 'z204g4' }],\n ['path', { d: 'M15 9v1', key: 'z2a8b1' }],\n]);\n\nexport default PanelRightDashed;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmB,iBAAiB,kBAAoB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,113 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "અક્ષર", verb: "હોવા જોઈએ" },
file: { unit: "બાયટ", verb: "હોવા જોઈએ" },
array: { unit: "આઇટમ", verb: "હોવા જોઈએ" },
set: { unit: "આઇટમ", verb: "હોવા જોઈએ" },
map: { unit: "એન્ટ્રી", verb: "હોવા જોઈએ" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "ઇનપુટ",
email: "ઈમેઇલ એડ્રેસ",
url: "URL",
emoji: "ઇમોજી",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO તારીખ અને સમય",
date: "ISO તારીખ",
time: "ISO સમય",
duration: "ISO અવધિ",
ipv4: "IPv4 એડ્રેસ",
ipv6: "IPv6 એડ્રેસ",
mac: "MAC એડ્રેસ",
cidrv4: "IPv4 શ્રેણી",
cidrv6: "IPv6 શ્રેણી",
base64: "base64-એન્કોડેડ સ્ટ્રિંગ",
base64url: "base64url-એન્કોડેડ સ્ટ્રિંગ",
json_string: "JSON સ્ટ્રિંગ",
e164: "E.164 નંબર",
credit_card: "ક્રેડિટ કાર્ડ નંબર",
currency_code: "ચલણ કોડ",
iban: "IBAN",
jwt: "JWT",
template_literal: "ઇનપુટ",
};
const TypeDictionary = {
nan: "NaN",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
return `અમાન્ય ઇનપુટ: અપેક્ષિત ${expected}, પ્રાપ્ત ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `અમાન્ય ઇનપુટ: અપેક્ષિત ${util.stringifyPrimitive(issue.values[0])}`;
return `અમાન્ય વિકલ્પ: ${util.joinValues(issue.values, " | ")} માધ્યમથી એક અપેક્ષિત`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `ખૂબ મોટું: ${issue.origin ?? "મૂલ્ય"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "એલિમેન્ટ"} હોવા જોઈએ`;
return `ખૂબ મોટું: ${issue.origin ?? "મૂલ્ય"} ${adj}${issue.maximum.toString()} હોવું જોઈએ`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `ખૂબ નાનું: ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} હોવા જોઈએ`;
}
return `ખૂબ નાનું: ${issue.origin} ${adj}${issue.minimum.toString()} હોવું જોઈએ`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `અમાન્ય સ્ટ્રિંગ: "${_issue.prefix}" થી શરૂ થવું જોઈએ`;
}
if (_issue.format === "ends_with")
return `અમાન્ય સ્ટ્રિંગ: "${_issue.suffix}" પર સમાપ્ત થવું જોઈએ`;
if (_issue.format === "includes")
return `અમાન્ય સ્ટ્રિંગ: "${_issue.includes}" શામેલ હોવું જોઈએ`;
if (_issue.format === "regex")
return `અમાન્ય સ્ટ્રિંગ: પેટર્ન ${_issue.pattern} સાથે મેળ ખાવું જોઈએ`;
return `અમાન્ય ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `અમાન્ય નંબર: ${issue.divisor} નો ગુણાંક હોવો જોઈએ`;
case "unrecognized_keys":
return `ઓળખી શકાતા નહીં તે કી${issue.keys.length > 1 ? "ઓ" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `${issue.origin} માં અમાન્ય કી`;
case "invalid_union":
if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) {
const opts = issue.options.map((o) => `'${o}'`).join(" | ");
return `અમાન્ય ડિસ્ક્રિમિનેટર મૂલ્ય. અપેક્ષિત ${opts}`;
}
return "અમાન્ય ઇનપુટ";
case "invalid_element":
return `${issue.origin} માં અમાન્ય મૂલ્ય`;
default:
return "અમાન્ય ઇનપુટ";
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1 @@
{"version":3,"file":"move-left.js","sources":["../../../src/icons/move-left.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MoveLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiA4TDIgMTJMNiAxNiIgLz4KICA8cGF0aCBkPSJNMiAxMkgyMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/move-left\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MoveLeft = createLucideIcon('MoveLeft', [\n ['path', { d: 'M6 8L2 12L6 16', key: 'kyvwex' }],\n ['path', { d: 'M2 12H22', key: '1m8cig' }],\n]);\n\nexport default MoveLeft;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,283 @@
import { expect, test } from "vitest";
import * as z from "zod/v4";
test("string length", async () => {
try {
await z.string().length(4).parseAsync("asd");
} catch (err) {
// ("String must contain exactly 4 character(s)");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"exact": true,
"inclusive": true,
"message": "Too small: expected string to have exactly 4 characters",
"minimum": 4,
"origin": "string",
"path": [],
},
]
`);
}
try {
await z.string().length(4).parseAsync("asdaa");
} catch (err) {
// ("String must contain exactly 4 character(s)");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"exact": true,
"inclusive": true,
"maximum": 4,
"message": "Too big: expected string to have exactly 4 characters",
"origin": "string",
"path": [],
},
]
`);
}
});
test("string min/max", async () => {
try {
await z.string().min(4).parseAsync("asd");
} catch (err) {
// ("String must contain at least 4 character(s)");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": true,
"message": "Too small: expected string to have >=4 characters",
"minimum": 4,
"origin": "string",
"path": [],
},
]
`);
}
});
test("string max", async () => {
try {
await z.string().max(4).parseAsync("aasdfsdfsd");
} catch (err) {
// ("String must contain at most 4 character(s)");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": true,
"maximum": 4,
"message": "Too big: expected string to have <=4 characters",
"origin": "string",
"path": [],
},
]
`);
}
});
test("number min", async () => {
try {
await z.number().min(3).parseAsync(2);
} catch (err) {
// ("Number must be greater than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": true,
"message": "Too small: expected number to be >=3",
"minimum": 3,
"origin": "number",
"path": [],
},
]
`);
}
});
test("number gte", async () => {
try {
await z.number().gte(3).parseAsync(2);
} catch (err) {
// ("Number must be greater than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": true,
"message": "Too small: expected number to be >=3",
"minimum": 3,
"origin": "number",
"path": [],
},
]
`);
}
});
test("number gt", async () => {
try {
await z.number().gt(3).parseAsync(3);
} catch (err) {
// ("Number must be greater than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": false,
"message": "Too small: expected number to be >3",
"minimum": 3,
"origin": "number",
"path": [],
},
]
`);
}
});
test("number max", async () => {
try {
await z.number().max(3).parseAsync(4);
} catch (err) {
// ("Number must be less than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": true,
"maximum": 3,
"message": "Too big: expected number to be <=3",
"origin": "number",
"path": [],
},
]
`);
}
});
test("number lte", async () => {
try {
await z.number().lte(3).parseAsync(4);
} catch (err) {
// ("Number must be less than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": true,
"maximum": 3,
"message": "Too big: expected number to be <=3",
"origin": "number",
"path": [],
},
]
`);
}
});
test("number lt", async () => {
try {
await z.number().lt(3).parseAsync(3);
} catch (err) {
// ("Number must be less than or equal to 3");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": false,
"maximum": 3,
"message": "Too big: expected number to be <3",
"origin": "number",
"path": [],
},
]
`);
}
});
test("number nonnegative", async () => {
try {
await z.number().nonnegative().parseAsync(-1);
} catch (err) {
// ("Number must be greater than or equal to 0");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": true,
"message": "Too small: expected number to be >=0",
"minimum": 0,
"origin": "number",
"path": [],
},
]
`);
}
});
test("number nonpositive", async () => {
try {
await z.number().nonpositive().parseAsync(1);
} catch (err) {
// ("Number must be less than or equal to 0");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": true,
"maximum": 0,
"message": "Too big: expected number to be <=0",
"origin": "number",
"path": [],
},
]
`);
}
});
test("number negative", async () => {
try {
await z.number().negative().parseAsync(1);
} catch (err) {
// ("Number must be less than 0");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_big",
"inclusive": false,
"maximum": 0,
"message": "Too big: expected number to be <0",
"origin": "number",
"path": [],
},
]
`);
}
});
test("number positive", async () => {
try {
await z.number().positive().parseAsync(-1);
} catch (err) {
// ("Number must be greater than 0");
expect((err as z.ZodError).issues).toMatchInlineSnapshot(`
[
{
"code": "too_small",
"inclusive": false,
"message": "Too small: expected number to be >0",
"minimum": 0,
"origin": "number",
"path": [],
},
]
`);
}
});
@@ -0,0 +1,122 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "ký tự", verb: "có" },
file: { unit: "byte", verb: "có" },
array: { unit: "phần tử", verb: "có" },
set: { unit: "phần tử", verb: "có" },
map: { unit: "phần tử", verb: "có" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "đầu vào",
email: "địa chỉ email",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ngày giờ ISO",
date: "ngày ISO",
time: "giờ ISO",
duration: "khoảng thời gian ISO",
ipv4: "địa chỉ IPv4",
ipv6: "địa chỉ IPv6",
mac: "địa chỉ MAC",
cidrv4: "dải IPv4",
cidrv6: "dải IPv6",
base64: "chuỗi mã hóa base64",
base64url: "chuỗi mã hóa base64url",
json_string: "chuỗi JSON",
e164: "số E.164",
credit_card: "số thẻ tín dụng",
currency_code: "mã tiền tệ",
iban: "IBAN",
jwt: "JWT",
template_literal: "đầu vào",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
number: "số",
array: "mảng",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Đầu vào không hợp lệ: mong đợi instanceof ${issue.expected}, nhận được ${received}`;
}
return `Đầu vào không hợp lệ: mong đợi ${expected}, nhận được ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Đầu vào không hợp lệ: mong đợi ${util.stringifyPrimitive(issue.values[0])}`;
return `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Quá lớn: mong đợi ${issue.origin ?? "giá trị"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "phần tử"}`;
return `Quá lớn: mong đợi ${issue.origin ?? "giá trị"} ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Quá nhỏ: mong đợi ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Quá nhỏ: mong đợi ${issue.origin} ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `Chuỗi không hợp lệ: phải bắt đầu bằng "${_issue.prefix}"`;
if (_issue.format === "ends_with") return `Chuỗi không hợp lệ: phải kết thúc bằng "${_issue.suffix}"`;
if (_issue.format === "includes") return `Chuỗi không hợp lệ: phải bao gồm "${_issue.includes}"`;
if (_issue.format === "regex") return `Chuỗi không hợp lệ: phải khớp với mẫu ${_issue.pattern}`;
return `${FormatDictionary[_issue.format] ?? issue.format} không hợp lệ`;
}
case "not_multiple_of":
return `Số không hợp lệ: phải là bội số của ${issue.divisor}`;
case "unrecognized_keys":
return `Khóa không được nhận dạng: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Khóa không hợp lệ trong ${issue.origin}`;
case "invalid_union":
return "Đầu vào không hợp lệ";
case "invalid_element":
return `Giá trị không hợp lệ trong ${issue.origin}`;
default:
return `Đầu vào không hợp lệ`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1,128 @@
{
"name": "@hono/node-server",
"version": "2.1.5",
"description": "Node.js Adapter for Hono",
"main": "dist/index.mjs",
"type": "module",
"types": "dist/index.d.mts",
"files": [
"dist"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./serve-static": {
"import": {
"types": "./dist/serve-static.d.mts",
"default": "./dist/serve-static.mjs"
},
"require": {
"types": "./dist/serve-static.d.cts",
"default": "./dist/serve-static.cjs"
}
},
"./utils/*": {
"import": {
"types": "./dist/utils/*.d.mts",
"default": "./dist/utils/*.mjs"
},
"require": {
"types": "./dist/utils/*.d.cts",
"default": "./dist/utils/*.cjs"
}
},
"./conninfo": {
"import": {
"types": "./dist/conninfo.d.mts",
"default": "./dist/conninfo.mjs"
},
"require": {
"types": "./dist/conninfo.d.cts",
"default": "./dist/conninfo.cjs"
}
},
"./early-hints": {
"import": {
"types": "./dist/early-hints.d.mts",
"default": "./dist/early-hints.mjs"
},
"require": {
"types": "./dist/early-hints.d.cts",
"default": "./dist/early-hints.cjs"
}
}
},
"typesVersions": {
"*": {
".": [
"./dist/index.d.mts"
],
"serve-static": [
"./dist/serve-static.d.mts"
],
"utils/*": [
"./dist/utils/*.d.mts"
],
"conninfo": [
"./dist/conninfo.d.mts"
],
"early-hints": [
"./dist/early-hints.d.mts"
]
}
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/honojs/node-server.git"
},
"homepage": "https://github.com/honojs/node-server",
"author": "Yusuke Wada <yusuke@kamawada.com> (https://github.com/yusukebe)",
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public",
"provenance": true
},
"engines": {
"node": ">=20"
},
"devDependencies": {
"@hono/eslint-config": "^1.0.1",
"@types/node": "^20.10.0",
"@types/ws": "^8.18.1",
"@whatwg-node/fetch": "^0.9.14",
"eslint": "^9.10.0",
"hono": "^4.13.9",
"np": "^11.2.1",
"prettier": "^3.2.4",
"publint": "^0.3.18",
"tsdown": "^0.20.3",
"typescript": "^5.3.2",
"vitest": "^4.0.18",
"ws": "^8.19.0"
},
"peerDependencies": {
"hono": "^4 || ^5.0.0-0"
},
"scripts": {
"test": "vitest",
"build": "tsdown --external hono",
"watch": "tsdown --watch",
"postbuild": "publint",
"prerelease": "pnpm run build && pnpm run test --run",
"release": "np --no-publish",
"typecheck": "tsc --noEmit",
"lint": "eslint src test",
"lint:fix": "eslint src test --fix",
"format": "prettier --check \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\"",
"format:fix": "prettier --write \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\""
}
}
@@ -0,0 +1 @@
{"version":3,"file":"square-arrow-out-up-right.js","sources":["../../../src/icons/square-arrow-out-up-right.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareArrowOutUpRight\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTN2NmEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJoNiIgLz4KICA8cGF0aCBkPSJtMjEgMy05IDkiIC8+CiAgPHBhdGggZD0iTTE1IDNoNnY2IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/square-arrow-out-up-right\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst SquareArrowOutUpRight = createLucideIcon('SquareArrowOutUpRight', [\n ['path', { d: 'M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6', key: 'y09zxi' }],\n ['path', { d: 'm21 3-9 9', key: 'mpx6sq' }],\n ['path', { d: 'M15 3h6v6', key: '1q9fwt' }],\n]);\n\nexport default SquareArrowOutUpRight;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwB,iBAAiB,uBAAyB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,53 @@
declare namespace pLocate {
interface Options {
/**
Number of concurrently pending promises returned by `tester`. Minimum: `1`.
@default Infinity
*/
readonly concurrency?: number;
/**
Preserve `input` order when searching.
Disable this to improve performance if you don't care about the order.
@default true
*/
readonly preserveOrder?: boolean;
}
}
/**
Get the first fulfilled promise that satisfies the provided testing function.
@param input - An iterable of promises/values to test.
@param tester - This function will receive resolved values from `input` and is expected to return a `Promise<boolean>` or `boolean`.
@returns A `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`.
@example
```
import pathExists = require('path-exists');
import pLocate = require('p-locate');
const files = [
'unicorn.png',
'rainbow.png', // Only this one actually exists on disk
'pony.png'
];
(async () => {
const foundPath = await pLocate(files, file => pathExists(file));
console.log(foundPath);
//=> 'rainbow'
})();
```
*/
declare function pLocate<ValueType>(
input: Iterable<PromiseLike<ValueType> | ValueType>,
tester: (element: ValueType) => PromiseLike<boolean> | boolean,
options?: pLocate.Options
): Promise<ValueType | undefined>;
export = pLocate;
@@ -0,0 +1,22 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var framerMotion = require('framer-motion');
Object.defineProperty(exports, "m", {
enumerable: true,
get: function () { return framerMotion.m; }
});
Object.defineProperty(exports, "motion", {
enumerable: true,
get: function () { return framerMotion.motion; }
});
Object.keys(framerMotion).forEach(function (k) {
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
enumerable: true,
get: function () { return framerMotion[k]; }
});
});
@@ -0,0 +1,19 @@
# @babel/helper-string-parser
> A utility package to parse strings
See our website [@babel/helper-string-parser](https://babeljs.io/docs/babel-helper-string-parser) for more information.
## Install
Using npm:
```sh
npm install --save @babel/helper-string-parser
```
or using yarn:
```sh
yarn add @babel/helper-string-parser
```
@@ -0,0 +1,836 @@
export default `flf2a$ 8 7 16 -1 18
AMC untitled font by LESTER
=============================
-> Conversion to FigLet font by MEPH. (Part of ASCII Editor Service Pack I)
(http://studenten.freepage.de/meph/ascii/ascii/editor/_index.htm)
-> Defined: ASCII code alphanumeric
.-~~-.
(_^..^_)
Lester||||AMC - Anthony Cucchiara
*Mythos Online : Internet Magazine of Lovecraftian Horror - Dead Alice*
http://www.fortunecity.com/victorian/redlion/157/deadal.htm
*Visit my web page ANSI/ASCII/Fonts*
http://members.aol.com/lester5374/
$@
$@
$@
$@
$@
$@
$@
$@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
,''. @
',,' @
@@
@
@
@
@
@
@
@
@@
,'',,'', @
; ,'', ; @
; ; ; ; @
; ;\\ ; ; @
; ; \\; ; @
; ',,' ; @
',,'',,' @
@@
,'''''', @
',,'; ; @
; ; @
; ; @
; ; @
; ; @
',,' @
@@
,'''''', @
',,'; ; @
,,'' @
',,' @
,'', @
; ;,'', @
',,,,,,' @
@@
,'''''', @
',,'; ; @
,'',; ; @
',,'; ; @
; ; @
,'',; ; @
',,,,,,' @
@@
,'',,'', @
; ;; ; @
; ;; ; @
',,'; ; @
; ; @
; ; @
',,' @
@@
,'''''', @
; ;',,' @
; ; @
',,','', @
; ; @
,'',; ; @
',,,,,,' @
@@
,'''''', @
; ;',,' @
; ; @
; ;,'', @
; ;', ; @
; ;,' ; @
',,'',,' @
@@
,'''''', @
',,'; ; @
,,'' @
',,' @
,'', @
; ; @
',,' @
@@
,'',,''', @
; ,'', ; @
; ',,' ; @
; ,'', ; @
; ; ; ; @
; ',,' ; @
',,'',,,' @
@@
,'',,'', @
; ,'; ; @
; ',; ; @
',,'; ; @
; ; @
,'',; ; @
',,,,,,' @
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
,'',,''', @
; ;', ; @
; ;,' ; @
; ;', ; @
; ; ; ; @
; ; ; ; @
',,' ',,' @
@@
,'',,''', @
; ;', ; @
; ;,' ; @
; ;', ; @
; ; ; ; @
; ;,' ; @
',,'',,,' @
@@
,'',,'', @
; ;',,' @
; ; @
; ; @
; ; @
; ;,'', @
',,'',,' @
@@
,'',,'', @
; ;; ; @
; ;; ; @
; ;; ; @
; ;; ; @
; ;; ; @
',,'',,' @
@@
,'',,'', @
; ;',,' @
; ;,'', @
; ;',,' @
; ; @
; ;,'', @
',,'',,' @
@@
,'',,'', @
; ;',,' @
; ;,'', @
; ;',,' @
; ; @
; ; @
',,' @
@@
,'',,'', @
; ;',,' @
; ; @
; ;,'', @
; ;', ; @
; ;,' ; @
',,'',,' @
@@
,'', ,'', @
; ; ; ; @
; ;,',; ; @
; ;','; ; @
; ; ; ; @
; ; ; ; @
',,' ',,' @
@@
,'', @
; ; @
; ; @
; ; @
; ; @
; ; @
',,' @
@@
,'', @
; ; @
; ; @
; ; @
; ; @
,'',; ; @
',,'',,' @
@@
,'', ,'', @
; ; ',,' @
; ;,'', @
; ;; ; @
; ; ; ; @
; ; ; ; @
',,' ',,' @
@@
,'', @
; ; @
; ; @
; ; @
; ; @
; ;,'', @
',,'',,' @
@@
,'',,'',,'', @
; ;', ;', ; @
; ; ; ; ; ; @
; ; ; ; ; ; @
; ; ; ; ; ; @
; ; ; ; ; ; @
',,' ',' ',' @
@@
,'',,'', @
; ;', ; @
; ; ; ; @
; ; ; ; @
; ; ; ; @
; ; ; ; @
',,' ',' @
@@
,'',,'', @
; ;; ; @
; ;; ; @
; ;; ; @
; ;; ; @
; ;; ; @
',,'',,' @
@@
,'',,'', @
; ;; ; @
; ;',,' @
; ; @
; ; @
; ; @
',,' @
@@
,'',,'', @
; ;; ; @
; ;; ; @
; ;; ; @
; ;', ; @
; ;,' ', @
',,'',,,,' @
@@
,'',,''', @
; ;', ; @
; ;,' ,' @
; ;', ', @
; ; ; ; @
; ; ; ; @
',,' ',,' @
@@
,'',,'', @
; ;',,' @
; ; @
',,','', @
; ; @
,'',; ; @
',,'',,' @
@@
,'',,'',,'', @
',,'; ;',,' @
; ; @
; ; @
; ; @
; ; @
',,' @
@@
,'', ,'', @
; ; ; ; @
; ; ; ; @
; ; ; ; @
; ; ; ; @
; ',,' ; @
',,,'',,,' @
@@
,'',,'', @
; ;; ; @
; ;; ; @
; ;; ; @
; ;; ; @
; ;; ; @
','',' @
@@
,'', ,', ,', @
; ; ; ; ; ; @
; ; ; ; ; ; @
; ; ; ; ; ; @
; ; ; ; ; ; @
; ;,' ;,' ; @
',,'',,'',,' @
@@
,'',,'', @
; ;; ; @
', ;; ,' @
; ;; ; @
,' ;; ', @
; ;; ; @
',,'',,' @
@@
,'',,'', @
; ;; ; @
',,'',,' @
,'', @
; ; @
; ; @
',,' @
@@
,'',,'', @
',,'; ; @
,,'' @
',,' @
,'', @
; ;,'', @
',,'',,' @
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
,'',,''', @
; ;', ; @
; ;,' ; @
; ;', ; @
',,' ',,' @
@@
@
@
,'',,''', @
; ;', ; @
; ;', ; @
; ;,' ; @
',,'',,,' @
@@
@
@
,'',,'', @
; ;',,' @
; ; @
; ;,'', @
',,'',,' @
@@
@
@
,'',,'', @
; ;; ; @
; ;; ; @
; ;; ; @
',,'',,' @
@@
@
@
,'',,'', @
; ;',,' @
; ;',,' @
; ; ,, @
',,'',,' @
@@
@
@
,'',,'', @
; ;',,' @
; ;',,' @
; ; @
',,' @
@@
@
@
,'',,'', @
; ; '' @
; ;,'', @
; ;,' ; @
',,'',,' @
@@
@
@
,'', ,'', @
; ;,; ; @
; ;'; ; @
; ; ; ; @
',,' ',,' @
@@
@
@
,'', @
; ; @
; ; @
; ; @
',,' @
@@
@
@
,'', @
; ; @
; ; @
,'',; ; @
',,'',,' @
@@
@
@
,'',,'', @
; ;',,' @
; ;; ; @
; ; ; ; @
',,' ',,' @
@@
@
@
,'', @
; ; @
; ; @
; ;,'', @
',,'',,' @
@@
@
@
,'',,'',,'', @
; ;', ;', ; @
; ; ; ; ; ; @
; ; ; ; ; ; @
',,' ',' ',' @
@@
@
@
,'',,'', @
; ;', ; @
; ; ; ; @
; ; ; ; @
',,' ',' @
@@
@
@
,'',,'', @
; ;; ; @
; ;; ; @
; ;; ; @
',,'',,' @
@@
@
@
,'',,'', @
; ;; ; @
; ;',,' @
; ; @
',,' @
@@
@
@
,'',,'', @
; ;; ; @
; ;', ; @
; ;,' ', @
',,'',,,,' @
@@
@
@
,'',,'', @
; ;', ; @
; ;,' ,' @
; ;', ', @
',,' ',,' @
@@
@
@
,'',,'', @
; ;',,' @
',,','', @
,'',; ; @
',,'',,' @
@@
@
@
,'',,'',,'', @
',,'; ;',,' @
; ; @
; ; @
',,' @
@@
@
@
,', ,', @
; ; ; ; @
; ; ; ; @
; ',,' ; @
',,'',,' @
@@
@
@
,'',,'', @
; ;; ; @
; ;; ; @
; ;; ; @
','',' @
@@
@
@
,'', ,', ,', @
; ; ; ; ; ; @
; ; ; ; ; ; @
; ;,' ;,' ; @
',,'',,'',,' @
@@
@
@
,'',,'', @
', ;; ,' @
,' ;; ', @
; ;; ; @
',,'',,' @
@@
@
@
,'',,'', @
',,'',,' @
,'', @
; ; @
',,' @
@@
@
@
,'',,'', @
'',;,,' @
',,' @
,'', ,, @
',,'',,' @
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,87 @@
import { parseDef } from "./parseDef.js";
import { getRefs } from "./Refs.js";
import { parseAnyDef } from "./parsers/any.js";
const zodToJsonSchema = (schema, options) => {
const refs = getRefs(options);
let definitions = typeof options === "object" && options.definitions
? Object.entries(options.definitions).reduce((acc, [name, schema]) => ({
...acc,
[name]: parseDef(schema._def, {
...refs,
currentPath: [...refs.basePath, refs.definitionPath, name],
}, true) ?? parseAnyDef(refs),
}), {})
: undefined;
const name = typeof options === "string"
? options
: options?.nameStrategy === "title"
? undefined
: options?.name;
const main = parseDef(schema._def, name === undefined
? refs
: {
...refs,
currentPath: [...refs.basePath, refs.definitionPath, name],
}, false) ?? parseAnyDef(refs);
const title = typeof options === "object" &&
options.name !== undefined &&
options.nameStrategy === "title"
? options.name
: undefined;
if (title !== undefined) {
main.title = title;
}
if (refs.flags.hasReferencedOpenAiAnyType) {
if (!definitions) {
definitions = {};
}
if (!definitions[refs.openAiAnyTypeName]) {
definitions[refs.openAiAnyTypeName] = {
// Skipping "object" as no properties can be defined and additionalProperties must be "false"
type: ["string", "number", "integer", "boolean", "array", "null"],
items: {
$ref: refs.$refStrategy === "relative"
? "1"
: [
...refs.basePath,
refs.definitionPath,
refs.openAiAnyTypeName,
].join("/"),
},
};
}
}
const combined = name === undefined
? definitions
? {
...main,
[refs.definitionPath]: definitions,
}
: main
: {
$ref: [
...(refs.$refStrategy === "relative" ? [] : refs.basePath),
refs.definitionPath,
name,
].join("/"),
[refs.definitionPath]: {
...definitions,
[name]: main,
},
};
if (refs.target === "jsonSchema7") {
combined.$schema = "http://json-schema.org/draft-07/schema#";
}
else if (refs.target === "jsonSchema2019-09" || refs.target === "openAi") {
combined.$schema = "https://json-schema.org/draft/2019-09/schema#";
}
if (refs.target === "openAi" &&
("anyOf" in combined ||
"oneOf" in combined ||
"allOf" in combined ||
("type" in combined && Array.isArray(combined.type)))) {
console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");
}
return combined;
};
export { zodToJsonSchema };
@@ -0,0 +1 @@
{"version":3,"file":"theater.js","sources":["../../../src/icons/theater.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Theater\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAxMHMzLTMgMy04IiAvPgogIDxwYXRoIGQ9Ik0yMiAxMHMtMy0zLTMtOCIgLz4KICA8cGF0aCBkPSJNMTAgMmMwIDQuNC0zLjYgOC04IDgiIC8+CiAgPHBhdGggZD0iTTE0IDJjMCA0LjQgMy42IDggOCA4IiAvPgogIDxwYXRoIGQ9Ik0yIDEwczIgMiAyIDUiIC8+CiAgPHBhdGggZD0iTTIyIDEwcy0yIDItMiA1IiAvPgogIDxwYXRoIGQ9Ik04IDE1aDgiIC8+CiAgPHBhdGggZD0iTTIgMjJ2LTFhMiAyIDAgMCAxIDItMmg0YTIgMiAwIDAgMSAyIDJ2MSIgLz4KICA8cGF0aCBkPSJNMTQgMjJ2LTFhMiAyIDAgMCAxIDItMmg0YTIgMiAwIDAgMSAyIDJ2MSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/theater\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Theater = createLucideIcon('Theater', [\n ['path', { d: 'M2 10s3-3 3-8', key: '3xiif0' }],\n ['path', { d: 'M22 10s-3-3-3-8', key: 'ioaa5q' }],\n ['path', { d: 'M10 2c0 4.4-3.6 8-8 8', key: '16fkpi' }],\n ['path', { d: 'M14 2c0 4.4 3.6 8 8 8', key: 'b9eulq' }],\n ['path', { d: 'M2 10s2 2 2 5', key: '1au1lb' }],\n ['path', { d: 'M22 10s-2 2-2 5', key: 'qi2y5e' }],\n ['path', { d: 'M8 15h8', key: '45n4r' }],\n ['path', { d: 'M2 22v-1a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1', key: '1vsc2m' }],\n ['path', { d: 'M14 22v-1a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1', key: 'hrha4u' }],\n]);\n\nexport default Theater;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAyB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAyB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,SAAS,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5E,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
module.exports={A:{A:{"644":"_IB","2049":"_V","2692":"E"},B:{"1":"_K","2049":"_I"},C:{"1":"_jQ _XC","2":"GD","260":"_KG","1156":"fC","1284":"KD","1796":"LD"},D:{"1":"_Q"},E:{"1":"_DB","16":"_e"},F:{"1":"_0F","16":"_mB","132":"_lN"},G:{"1":"_eB","16":"lC"},H:{"1":"1D"},I:{"1":"_SB","16":"_m"},J:{"1":"_B"},K:{"1":"_CB","132":"A"},L:{"1":"I"},M:{"1":"YC"},N:{"2049":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:5,C:"Element.getBoundingClientRect()",D:true};
@@ -0,0 +1,7 @@
import{s as R,g as Z}from"./confbox.9388d834.mjs";function $(n,l=!1){const g=n.length;let e=0,u="",p=0,k=16,A=0,o=0,O=0,B=0,b=0;function I(i,T){let s=0,c=0;for(;s<i||!T;){let t=n.charCodeAt(e);if(t>=48&&t<=57)c=c*16+t-48;else if(t>=65&&t<=70)c=c*16+t-65+10;else if(t>=97&&t<=102)c=c*16+t-97+10;else break;e++,s++}return s<i&&(c=-1),c}function V(i){e=i,u="",p=0,k=16,b=0}function F(){let i=e;if(n.charCodeAt(e)===48)e++;else for(e++;e<n.length&&L(n.charCodeAt(e));)e++;if(e<n.length&&n.charCodeAt(e)===46)if(e++,e<n.length&&L(n.charCodeAt(e)))for(e++;e<n.length&&L(n.charCodeAt(e));)e++;else return b=3,n.substring(i,e);let T=e;if(e<n.length&&(n.charCodeAt(e)===69||n.charCodeAt(e)===101))if(e++,(e<n.length&&n.charCodeAt(e)===43||n.charCodeAt(e)===45)&&e++,e<n.length&&L(n.charCodeAt(e))){for(e++;e<n.length&&L(n.charCodeAt(e));)e++;T=e}else b=3;return n.substring(i,T)}function j(){let i="",T=e;for(;;){if(e>=g){i+=n.substring(T,e),b=2;break}const s=n.charCodeAt(e);if(s===34){i+=n.substring(T,e),e++;break}if(s===92){if(i+=n.substring(T,e),e++,e>=g){b=2;break}switch(n.charCodeAt(e++)){case 34:i+='"';break;case 92:i+="\\";break;case 47:i+="/";break;case 98:i+="\b";break;case 102:i+="\f";break;case 110:i+=`
`;break;case 114:i+="\r";break;case 116:i+=" ";break;case 117:const t=I(4,!0);t>=0?i+=String.fromCharCode(t):b=4;break;default:b=5}T=e;continue}if(s>=0&&s<=31)if(r(s)){i+=n.substring(T,e),b=2;break}else b=6;e++}return i}function w(){if(u="",b=0,p=e,o=A,B=O,e>=g)return p=g,k=17;let i=n.charCodeAt(e);if(J(i)){do e++,u+=String.fromCharCode(i),i=n.charCodeAt(e);while(J(i));return k=15}if(r(i))return e++,u+=String.fromCharCode(i),i===13&&n.charCodeAt(e)===10&&(e++,u+=`
`),A++,O=e,k=14;switch(i){case 123:return e++,k=1;case 125:return e++,k=2;case 91:return e++,k=3;case 93:return e++,k=4;case 58:return e++,k=6;case 44:return e++,k=5;case 34:return e++,u=j(),k=10;case 47:const T=e-1;if(n.charCodeAt(e+1)===47){for(e+=2;e<g&&!r(n.charCodeAt(e));)e++;return u=n.substring(T,e),k=12}if(n.charCodeAt(e+1)===42){e+=2;const s=g-1;let c=!1;for(;e<s;){const t=n.charCodeAt(e);if(t===42&&n.charCodeAt(e+1)===47){e+=2,c=!0;break}e++,r(t)&&(t===13&&n.charCodeAt(e)===10&&e++,A++,O=e)}return c||(e++,b=1),u=n.substring(T,e),k=13}return u+=String.fromCharCode(i),e++,k=16;case 45:if(u+=String.fromCharCode(i),e++,e===g||!L(n.charCodeAt(e)))return k=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return u+=F(),k=11;default:for(;e<g&&v(i);)e++,i=n.charCodeAt(e);if(p!==e){switch(u=n.substring(p,e),u){case"true":return k=8;case"false":return k=9;case"null":return k=7}return k=16}return u+=String.fromCharCode(i),e++,k=16}}function v(i){if(J(i)||r(i))return!1;switch(i){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function E(){let i;do i=w();while(i>=12&&i<=15);return i}return{setPosition:V,getPosition:()=>e,scan:l?E:w,getToken:()=>k,getTokenValue:()=>u,getTokenOffset:()=>p,getTokenLength:()=>e-p,getTokenStartLine:()=>o,getTokenStartCharacter:()=>p-B,getTokenError:()=>b}}function J(n){return n===32||n===9}function r(n){return n===10||n===13}function L(n){return n>=48&&n<=57}var Q;(function(n){n[n.lineFeed=10]="lineFeed",n[n.carriageReturn=13]="carriageReturn",n[n.space=32]="space",n[n._0=48]="_0",n[n._1=49]="_1",n[n._2=50]="_2",n[n._3=51]="_3",n[n._4=52]="_4",n[n._5=53]="_5",n[n._6=54]="_6",n[n._7=55]="_7",n[n._8=56]="_8",n[n._9=57]="_9",n[n.a=97]="a",n[n.b=98]="b",n[n.c=99]="c",n[n.d=100]="d",n[n.e=101]="e",n[n.f=102]="f",n[n.g=103]="g",n[n.h=104]="h",n[n.i=105]="i",n[n.j=106]="j",n[n.k=107]="k",n[n.l=108]="l",n[n.m=109]="m",n[n.n=110]="n",n[n.o=111]="o",n[n.p=112]="p",n[n.q=113]="q",n[n.r=114]="r",n[n.s=115]="s",n[n.t=116]="t",n[n.u=117]="u",n[n.v=118]="v",n[n.w=119]="w",n[n.x=120]="x",n[n.y=121]="y",n[n.z=122]="z",n[n.A=65]="A",n[n.B=66]="B",n[n.C=67]="C",n[n.D=68]="D",n[n.E=69]="E",n[n.F=70]="F",n[n.G=71]="G",n[n.H=72]="H",n[n.I=73]="I",n[n.J=74]="J",n[n.K=75]="K",n[n.L=76]="L",n[n.M=77]="M",n[n.N=78]="N",n[n.O=79]="O",n[n.P=80]="P",n[n.Q=81]="Q",n[n.R=82]="R",n[n.S=83]="S",n[n.T=84]="T",n[n.U=85]="U",n[n.V=86]="V",n[n.W=87]="W",n[n.X=88]="X",n[n.Y=89]="Y",n[n.Z=90]="Z",n[n.asterisk=42]="asterisk",n[n.backslash=92]="backslash",n[n.closeBrace=125]="closeBrace",n[n.closeBracket=93]="closeBracket",n[n.colon=58]="colon",n[n.comma=44]="comma",n[n.dot=46]="dot",n[n.doubleQuote=34]="doubleQuote",n[n.minus=45]="minus",n[n.openBrace=123]="openBrace",n[n.openBracket=91]="openBracket",n[n.plus=43]="plus",n[n.slash=47]="slash",n[n.formFeed=12]="formFeed",n[n.tab=9]="tab"})(Q||(Q={})),new Array(20).fill(0).map((n,l)=>" ".repeat(l));const N=200;new Array(N).fill(0).map((n,l)=>`
`+" ".repeat(l)),new Array(N).fill(0).map((n,l)=>"\r"+" ".repeat(l)),new Array(N).fill(0).map((n,l)=>`\r
`+" ".repeat(l)),new Array(N).fill(0).map((n,l)=>`
`+" ".repeat(l)),new Array(N).fill(0).map((n,l)=>"\r"+" ".repeat(l)),new Array(N).fill(0).map((n,l)=>`\r
`+" ".repeat(l));var U;(function(n){n.DEFAULT={allowTrailingComma:!1}})(U||(U={}));function S(n,l=[],g=U.DEFAULT){let e=null,u=[];const p=[];function k(o){Array.isArray(u)?u.push(o):e!==null&&(u[e]=o)}return P(n,{onObjectBegin:()=>{const o={};k(o),p.push(u),u=o,e=null},onObjectProperty:o=>{e=o},onObjectEnd:()=>{u=p.pop()},onArrayBegin:()=>{const o=[];k(o),p.push(u),u=o,e=null},onArrayEnd:()=>{u=p.pop()},onLiteralValue:k,onError:(o,O,B)=>{l.push({error:o,offset:O,length:B})}},g),u[0]}function P(n,l,g=U.DEFAULT){const e=$(n,!1),u=[];let p=0;function k(f){return f?()=>p===0&&f(e.getTokenOffset(),e.getTokenLength(),e.getTokenStartLine(),e.getTokenStartCharacter()):()=>!0}function A(f){return f?m=>p===0&&f(m,e.getTokenOffset(),e.getTokenLength(),e.getTokenStartLine(),e.getTokenStartCharacter()):()=>!0}function o(f){return f?m=>p===0&&f(m,e.getTokenOffset(),e.getTokenLength(),e.getTokenStartLine(),e.getTokenStartCharacter(),()=>u.slice()):()=>!0}function O(f){return f?()=>{p>0?p++:f(e.getTokenOffset(),e.getTokenLength(),e.getTokenStartLine(),e.getTokenStartCharacter(),()=>u.slice())===!1&&(p=1)}:()=>!0}function B(f){return f?()=>{p>0&&p--,p===0&&f(e.getTokenOffset(),e.getTokenLength(),e.getTokenStartLine(),e.getTokenStartCharacter())}:()=>!0}const b=O(l.onObjectBegin),I=o(l.onObjectProperty),V=B(l.onObjectEnd),F=O(l.onArrayBegin),j=B(l.onArrayEnd),w=o(l.onLiteralValue),v=A(l.onSeparator),E=k(l.onComment),i=A(l.onError),T=g&&g.disallowComments,s=g&&g.allowTrailingComma;function c(){for(;;){const f=e.scan();switch(e.getTokenError()){case 4:t(14);break;case 5:t(15);break;case 3:t(13);break;case 1:T||t(11);break;case 2:t(12);break;case 6:t(16);break}switch(f){case 12:case 13:T?t(10):E();break;case 16:t(1);break;case 15:case 14:break;default:return f}}}function t(f,m=[],y=[]){if(i(f),m.length+y.length>0){let _=e.getToken();for(;_!==17;){if(m.indexOf(_)!==-1){c();break}else if(y.indexOf(_)!==-1)break;_=c()}}}function D(f){const m=e.getTokenValue();return f?w(m):(I(m),u.push(m)),c(),!0}function G(){switch(e.getToken()){case 11:const f=e.getTokenValue();let m=Number(f);isNaN(m)&&(t(2),m=0),w(m);break;case 7:w(null);break;case 8:w(!0);break;case 9:w(!1);break;default:return!1}return c(),!0}function M(){return e.getToken()!==10?(t(3,[],[2,5]),!1):(D(!1),e.getToken()===6?(v(":"),c(),a()||t(4,[],[2,5])):t(5,[],[2,5]),u.pop(),!0)}function X(){b(),c();let f=!1;for(;e.getToken()!==2&&e.getToken()!==17;){if(e.getToken()===5){if(f||t(4,[],[]),v(","),c(),e.getToken()===2&&s)break}else f&&t(6,[],[]);M()||t(4,[],[2,5]),f=!0}return V(),e.getToken()!==2?t(7,[2],[]):c(),!0}function Y(){F(),c();let f=!0,m=!1;for(;e.getToken()!==4&&e.getToken()!==17;){if(e.getToken()===5){if(m||t(4,[],[]),v(","),c(),e.getToken()===4&&s)break}else m&&t(6,[],[]);f?(u.push(0),f=!1):u[u.length-1]++,a()||t(4,[],[4,5]),m=!0}return j(),f||u.pop(),e.getToken()!==4?t(8,[4],[]):c(),!0}function a(){switch(e.getToken()){case 3:return Y();case 1:return X();case 10:return D(!0);default:return G()}}return c(),e.getToken()===17?g.allowEmptyContent?!0:(t(4,[],[]),!1):a()?(e.getToken()!==17&&t(9,[],[]),!0):(t(4,[],[]),!1)}var W;(function(n){n[n.None=0]="None",n[n.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=2]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",n[n.InvalidUnicode=4]="InvalidUnicode",n[n.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",n[n.InvalidCharacter=6]="InvalidCharacter"})(W||(W={}));var H;(function(n){n[n.OpenBraceToken=1]="OpenBraceToken",n[n.CloseBraceToken=2]="CloseBraceToken",n[n.OpenBracketToken=3]="OpenBracketToken",n[n.CloseBracketToken=4]="CloseBracketToken",n[n.CommaToken=5]="CommaToken",n[n.ColonToken=6]="ColonToken",n[n.NullKeyword=7]="NullKeyword",n[n.TrueKeyword=8]="TrueKeyword",n[n.FalseKeyword=9]="FalseKeyword",n[n.StringLiteral=10]="StringLiteral",n[n.NumericLiteral=11]="NumericLiteral",n[n.LineCommentTrivia=12]="LineCommentTrivia",n[n.BlockCommentTrivia=13]="BlockCommentTrivia",n[n.LineBreakTrivia=14]="LineBreakTrivia",n[n.Trivia=15]="Trivia",n[n.Unknown=16]="Unknown",n[n.EOF=17]="EOF"})(H||(H={}));const K=S;var q;(function(n){n[n.InvalidSymbol=1]="InvalidSymbol",n[n.InvalidNumberFormat=2]="InvalidNumberFormat",n[n.PropertyNameExpected=3]="PropertyNameExpected",n[n.ValueExpected=4]="ValueExpected",n[n.ColonExpected=5]="ColonExpected",n[n.CommaExpected=6]="CommaExpected",n[n.CloseBraceExpected=7]="CloseBraceExpected",n[n.CloseBracketExpected=8]="CloseBracketExpected",n[n.EndOfFileExpected=9]="EndOfFileExpected",n[n.InvalidCommentToken=10]="InvalidCommentToken",n[n.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=12]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",n[n.InvalidUnicode=14]="InvalidUnicode",n[n.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",n[n.InvalidCharacter=16]="InvalidCharacter"})(q||(q={}));function x(n,l){const g=JSON.parse(n,l?.reviver);return R(n,g,l),g}function z(n,l){const g=Z(n,l),e=JSONLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"circle-arrow-down.js","sources":["../../../src/icons/circle-arrow-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleArrowDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJNMTIgOHY4IiAvPgogIDxwYXRoIGQ9Im04IDEyIDQgNCA0LTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/circle-arrow-down\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleArrowDown = createLucideIcon('CircleArrowDown', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'M12 8v8', key: 'napkw2' }],\n ['path', { d: 'm8 12 4 4 4-4', key: 'k98ssh' }],\n]);\n\nexport default CircleArrowDown;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,iBAAiB,iBAAmB,CAAA,CAAA,CAAA;AAAA,CAC1D,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,221 @@
import { HistoryState, ParsedHistoryState } from '@tanstack/history';
import { AllParams, CatchAllPaths, CurrentPath, FullSearchSchema, FullSearchSchemaInput, ParentPath, RouteByPath, RouteByToPath, RoutePaths, RouteToPath, ToPath } from './routeInfo.cjs';
import { AnyRouter, RegisteredRouter, ViewTransitionOptions } from './router.cjs';
import { ConstrainLiteral, Expand, MakeDifferenceOptional, NoInfer, NonNullableUpdater, Updater } from './utils.cjs';
import { ParsedLocation } from './location.cjs';
export type IsRequiredParams<TParams> = Record<never, never> extends TParams ? never : true;
export interface ParsePathParamsResult<in out TRequired, in out TOptional, in out TRest> {
required: TRequired;
optional: TOptional;
rest: TRest;
}
export type AnyParsePathParamsResult = ParsePathParamsResult<string, string, string>;
export type ParsePathParamsBoundaryStart<T extends string> = T extends `${infer TLeft}{-${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['required'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : T extends `${infer TLeft}{${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'] | ParsePathParams<TRight>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : never;
export type ParsePathParamsSymbol<T extends string> = T extends `${string}$${infer TRight}` ? TRight extends `${string}/${string}` ? TRight extends `${infer TParam}/${infer TRest}` ? TParam extends '' ? ParsePathParamsResult<ParsePathParams<TRest>['required'], '_splat' | ParsePathParams<TRest>['optional'], ParsePathParams<TRest>['rest']> : ParsePathParamsResult<TParam | ParsePathParams<TRest>['required'], ParsePathParams<TRest>['optional'], ParsePathParams<TRest>['rest']> : never : TRight extends '' ? ParsePathParamsResult<never, '_splat', never> : ParsePathParamsResult<TRight, never, never> : never;
export type ParsePathParamsBoundaryEnd<T extends string> = T extends `${infer TLeft}}${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'] | ParsePathParams<TRight>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : never;
export type ParsePathParamsEscapeStart<T extends string> = T extends `${infer TLeft}[${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'] | ParsePathParams<TRight>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : never;
export type ParsePathParamsEscapeEnd<T extends string> = T extends `${string}]${infer TRight}` ? ParsePathParams<TRight> : never;
export type ParsePathParams<T extends string> = T extends `${string}[${string}` ? ParsePathParamsEscapeStart<T> : T extends `${string}]${string}` ? ParsePathParamsEscapeEnd<T> : T extends `${string}}${string}` ? ParsePathParamsBoundaryEnd<T> : T extends `${string}{${string}` ? ParsePathParamsBoundaryStart<T> : T extends `${string}$${string}` ? ParsePathParamsSymbol<T> : never;
export type AddTrailingSlash<T> = T extends `${string}/` ? T : `${T & string}/`;
export type RemoveTrailingSlashes<T> = T & `${string}/` extends never ? T : T extends `${infer R}/` ? R : T;
export type AddLeadingSlash<T> = T & `/${string}` extends never ? `/${T & string}` : T;
export type RemoveLeadingSlashes<T> = T & `/${string}` extends never ? T : T extends `/${infer R}` ? R : T;
type JoinPath<TLeft extends string, TRight extends string> = TRight extends '' ? TLeft : TLeft extends '' ? TRight : `${RemoveTrailingSlashes<TLeft>}/${RemoveLeadingSlashes<TRight>}`;
type RemoveLastSegment<T extends string, TAcc extends string = ''> = T extends `${infer TSegment}/${infer TRest}` ? TRest & `${string}/${string}` extends never ? TRest extends '' ? TAcc : `${TAcc}${TSegment}` : RemoveLastSegment<TRest, `${TAcc}${TSegment}/`> : TAcc;
export type ResolveCurrentPath<TFrom extends string, TTo extends string> = TTo extends '.' ? TFrom : TTo extends './' ? AddTrailingSlash<TFrom> : TTo & `./${string}` extends never ? never : TTo extends `./${infer TRest}` ? AddLeadingSlash<JoinPath<TFrom, TRest>> : never;
export type ResolveParentPath<TFrom extends string, TTo extends string> = TTo extends '../' | '..' ? TFrom extends '' | '/' ? never : AddLeadingSlash<RemoveLastSegment<TFrom>> : TTo & `../${string}` extends never ? AddLeadingSlash<JoinPath<TFrom, TTo>> : TFrom extends '' | '/' ? never : TTo extends `../${infer ToRest}` ? ResolveParentPath<RemoveLastSegment<TFrom>, ToRest> : AddLeadingSlash<JoinPath<TFrom, TTo>>;
export type ResolveRelativePath<TFrom, TTo = '.'> = string extends TFrom ? TTo : string extends TTo ? TFrom : undefined extends TTo ? TFrom : TTo extends string ? TFrom extends string ? TTo extends `/${string}` ? TTo : TTo extends `..${string}` ? ResolveParentPath<TFrom, TTo> : TTo extends `.${string}` ? ResolveCurrentPath<TFrom, TTo> : AddLeadingSlash<JoinPath<TFrom, TTo>> : never : never;
export type FindDescendantToPaths<TRouter extends AnyRouter, TPrefix extends string> = `${TPrefix}/${string}` & RouteToPath<TRouter>;
export type InferDescendantToPaths<TRouter extends AnyRouter, TPrefix extends string, TPaths = FindDescendantToPaths<TRouter, TPrefix>> = TPaths extends `${TPrefix}/` ? never : TPaths extends `${TPrefix}/${infer TRest}` ? TRest : never;
export type RelativeToPath<TRouter extends AnyRouter, TTo extends string, TResolvedPath extends string> = (TResolvedPath & RouteToPath<TRouter> extends never ? never : ToPath<TRouter, TTo>) | `${RemoveTrailingSlashes<TTo>}/${InferDescendantToPaths<TRouter, RemoveTrailingSlashes<TResolvedPath>>}`;
export type RelativeToParentPath<TRouter extends AnyRouter, TFrom extends string, TTo extends string, TResolvedPath extends string = ResolveRelativePath<TFrom, TTo>> = RelativeToPath<TRouter, TTo, TResolvedPath> | (TTo extends `${string}..` | `${string}../` ? TResolvedPath extends '/' | '' ? never : FindDescendantToPaths<TRouter, RemoveTrailingSlashes<TResolvedPath>> extends never ? never : `${RemoveTrailingSlashes<TTo>}/${ParentPath<TRouter>}` : never);
export type RelativeToCurrentPath<TRouter extends AnyRouter, TFrom extends string, TTo extends string, TResolvedPath extends string = ResolveRelativePath<TFrom, TTo>> = RelativeToPath<TRouter, TTo, TResolvedPath> | CurrentPath<TRouter>;
export type AbsoluteToPath<TRouter extends AnyRouter, TFrom extends string> = (string extends TFrom ? CurrentPath<TRouter> : TFrom extends `/` ? never : CurrentPath<TRouter>) | (string extends TFrom ? ParentPath<TRouter> : TFrom extends `/` ? never : ParentPath<TRouter>) | RouteToPath<TRouter> | (TFrom extends '/' ? never : string extends TFrom ? never : InferDescendantToPaths<TRouter, RemoveTrailingSlashes<TFrom>>);
export type RelativeToPathAutoComplete<TRouter extends AnyRouter, TFrom extends string, TTo extends string> = string extends TTo ? string : string extends TFrom ? AbsoluteToPath<TRouter, TFrom> : TTo & `..${string}` extends never ? TTo & `.${string}` extends never ? AbsoluteToPath<TRouter, TFrom> : RelativeToCurrentPath<TRouter, TFrom, TTo> : RelativeToParentPath<TRouter, TFrom, TTo>;
export type NavigateOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = ToOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & NavigateOptionProps;
/**
* The NavigateOptions type is used to describe the options that can be used when describing a navigation action in TanStack Router.
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType)
*/
export interface NavigateOptionProps {
/**
* If set to `true`, the router will scroll the element with an id matching the hash into view with default `ScrollIntoViewOptions`.
* If set to `false`, the router will not scroll the element with an id matching the hash into view.
* If set to `ScrollIntoViewOptions`, the router will scroll the element with an id matching the hash into view with the provided options.
* @default true
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#hashscrollintoview)
* @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)
*/
hashScrollIntoView?: boolean | ScrollIntoViewOptions;
/**
* `replace` is a boolean that determines whether the navigation should replace the current history entry or push a new one.
* @default false
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#replace)
*/
replace?: boolean;
/**
* Defaults to `true` so that the scroll position will be reset to 0,0 after the location is committed to the browser history.
* If `false`, the scroll position will not be reset to 0,0 after the location is committed to history.
* @default true
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#resetscroll)
*/
resetScroll?: boolean;
/** @deprecated All navigations now use startTransition under the hood */
startTransition?: boolean;
/**
* If set to `true`, the router will wrap the resulting navigation in a `document.startViewTransition()` call.
* If `ViewTransitionOptions`, route navigations will be called using `document.startViewTransition({update, types})`
* where `types` will be the strings array passed with `ViewTransitionOptions["types"]`.
* If the browser does not support viewTransition types, the navigation will fall back to normal `document.startTransition()`, same as if `true` was passed.
*
* If the browser does not support this api, this option will be ignored.
* @default false
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#viewtransition)
* @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition)
* @see [Google](https://developer.chrome.com/docs/web-platform/view-transitions/same-document#view-transition-types)
*/
viewTransition?: boolean | ViewTransitionOptions;
/**
* If `true`, navigation will ignore any blockers that might prevent it.
* @default false
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#ignoreblocker)
*/
ignoreBlocker?: boolean;
/**
* If `true`, navigation to a route inside of router will trigger a full page load instead of the traditional SPA navigation.
* @default false
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#reloaddocument)
*/
reloadDocument?: boolean;
/**
* This can be used instead of `to` to navigate to a fully built href, e.g. pointing to an external target.
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
*/
href?: string;
}
export type ToOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = ToSubOptions<TRouter, TFrom, TTo> & MaskOptions<TRouter, TMaskFrom, TMaskTo>;
export interface MaskOptions<in out TRouter extends AnyRouter, in out TMaskFrom extends string, in out TMaskTo extends string> {
_fromLocation?: ParsedLocation;
mask?: ToMaskOptions<TRouter, TMaskFrom, TMaskTo>;
}
export type ToMaskOptions<TRouter extends AnyRouter = RegisteredRouter, TMaskFrom extends string = string, TMaskTo extends string = '.'> = ToSubOptions<TRouter, TMaskFrom, TMaskTo> & {
unmaskOnReload?: boolean;
};
export type ToSubOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.'> = ToSubOptionsProps<TRouter, TFrom, TTo> & SearchParamOptions<TRouter, TFrom, TTo> & PathParamOptions<TRouter, TFrom, TTo>;
export interface RequiredToOptions<in out TRouter extends AnyRouter, in out TFrom extends string, in out TTo extends string | undefined> {
/**
* The internal route path to navigate to. This should be a relative or absolute path within your application.
* For external URLs, use the `href` property instead.
* @example "/dashboard" or "../profile"
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
*/
to: ToPathOption<TRouter, TFrom, TTo> & {};
}
export interface OptionalToOptions<in out TRouter extends AnyRouter, in out TFrom extends string, in out TTo extends string | undefined> {
/**
* The internal route path to navigate to. This should be a relative or absolute path within your application.
* For external URLs, use the `href` property instead.
* @example "/dashboard" or "../profile"
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
*/
to?: ToPathOption<TRouter, TFrom, TTo> & {};
}
export type MakeToRequired<TRouter extends AnyRouter, TFrom extends string, TTo extends string | undefined> = string extends TFrom ? string extends TTo ? OptionalToOptions<TRouter, TFrom, TTo> : TTo & CatchAllPaths<TRouter> extends never ? RequiredToOptions<TRouter, TFrom, TTo> : OptionalToOptions<TRouter, TFrom, TTo> : OptionalToOptions<TRouter, TFrom, TTo>;
export type ToSubOptionsProps<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TTo extends string | undefined = '.'> = MakeToRequired<TRouter, TFrom, TTo> & {
hash?: true | Updater<string>;
state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>;
from?: FromPathOption<TRouter, TFrom> & {};
unsafeRelative?: 'path';
};
export type ParamsReducerFn<in out TRouter extends AnyRouter, in out TParamVariant extends ParamVariant, in out TFrom, in out TTo> = (current: Expand<ResolveFromParams<TRouter, TParamVariant, TFrom>>) => Expand<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>>;
type ParamsReducer<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = Expand<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>> | (ParamsReducerFn<TRouter, TParamVariant, TFrom, TTo> & {});
type ParamVariant = 'PATH' | 'SEARCH';
export type ResolveRoute<TRouter extends AnyRouter, TFrom, TTo, TPath = ResolveRelativePath<TFrom, TTo>> = TPath extends string ? TFrom extends TPath ? RouteByPath<TRouter['routeTree'], TPath> : RouteByToPath<TRouter, TPath> : never;
type ResolveFromParamType<TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchema';
type ResolveFromAllParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? AllParams<TRouter['routeTree']> : FullSearchSchema<TRouter['routeTree']>;
type ResolveFromParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom> = string extends TFrom ? ResolveFromAllParams<TRouter, TParamVariant> : RouteByPath<TRouter['routeTree'], TFrom>['types'][ResolveFromParamType<TParamVariant>];
type ResolveToParamType<TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchemaInput';
type ResolveAllToParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? AllParams<TRouter['routeTree']> : FullSearchSchemaInput<TRouter['routeTree']>;
export type ResolveToParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = ResolveRelativePath<TFrom, TTo> extends infer TPath ? undefined extends TPath ? never : string extends TPath ? ResolveAllToParams<TRouter, TParamVariant> : TPath extends CatchAllPaths<TRouter> ? ResolveAllToParams<TRouter, TParamVariant> : ResolveRoute<TRouter, TFrom, TTo>['types'][ResolveToParamType<TParamVariant>] : never;
type ResolveRelativeToParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo, TToParams = ResolveToParams<TRouter, TParamVariant, TFrom, TTo>> = TParamVariant extends 'SEARCH' ? TToParams : string extends TFrom ? TToParams : MakeDifferenceOptional<ResolveFromParams<TRouter, TParamVariant, TFrom>, TToParams>;
export interface MakeOptionalSearchParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
search?: true | (ParamsReducer<TRouter, 'SEARCH', TFrom, TTo> & {});
}
export interface MakeOptionalPathParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
params?: true | (ParamsReducer<TRouter, 'PATH', TFrom, TTo> & {});
}
type MakeRequiredParamsReducer<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = (string extends TFrom ? never : ResolveFromParams<TRouter, TParamVariant, TFrom> extends ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo> ? true : never) | (ParamsReducer<TRouter, TParamVariant, TFrom, TTo> & {});
export interface MakeRequiredPathParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
params: MakeRequiredParamsReducer<TRouter, 'PATH', TFrom, TTo> & {};
}
export interface MakeRequiredSearchParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
search: MakeRequiredParamsReducer<TRouter, 'SEARCH', TFrom, TTo> & {};
}
export type IsRequired<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = ResolveRelativePath<TFrom, TTo> extends infer TPath ? undefined extends TPath ? never : TPath extends CatchAllPaths<TRouter> ? never : IsRequiredParams<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>> : never;
export type SearchParamOptions<TRouter extends AnyRouter, TFrom, TTo> = IsRequired<TRouter, 'SEARCH', TFrom, TTo> extends never ? MakeOptionalSearchParams<TRouter, TFrom, TTo> : MakeRequiredSearchParams<TRouter, TFrom, TTo>;
export type PathParamOptions<TRouter extends AnyRouter, TFrom, TTo> = IsRequired<TRouter, 'PATH', TFrom, TTo> extends never ? MakeOptionalPathParams<TRouter, TFrom, TTo> : MakeRequiredPathParams<TRouter, TFrom, TTo>;
export type ToPathOption<TRouter extends AnyRouter = AnyRouter, TFrom extends string = string, TTo extends string | undefined = string> = ConstrainLiteral<TTo, RelativeToPathAutoComplete<TRouter, NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>>;
export type FromPathOption<TRouter extends AnyRouter, TFrom> = ConstrainLiteral<TFrom, RoutePaths<TRouter['routeTree']>>;
/**
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/navigation#active-options)
*/
export interface ActiveOptions {
/**
* If true, the link will be active if the current route matches the `to` route path exactly (no children routes)
* @default false
*/
exact?: boolean;
/**
* If true, the link will only be active if the current URL hash matches the `hash` prop
* @default false
*/
includeHash?: boolean;
/**
* If true, the link will only be active if the current URL search params inclusively match the `search` prop
* @default true
*/
includeSearch?: boolean;
/**
* This modifies the `includeSearch` behavior.
* If true, properties in `search` that are explicitly `undefined` must NOT be present in the current URL search params for the link to be active.
* @default false
*/
explicitUndefined?: boolean;
}
export interface LinkOptionsProps {
/**
* The standard anchor tag target attribute
*/
target?: HTMLAnchorElement['target'];
/**
* Configurable options to determine if the link should be considered active or not
* @default {exact:true,includeHash:true}
*/
activeOptions?: ActiveOptions;
/**
* The preloading strategy for this link
* - `false` - No preloading
* - `'intent'` - Preload the linked route on hover and cache it for this many milliseconds in hopes that the user will eventually navigate there.
* - `'viewport'` - Preload the linked route when it enters the viewport
*/
preload?: false | 'intent' | 'viewport' | 'render';
/**
* When a preload strategy is set, this delays the preload by this many milliseconds.
* If the user exits the link before this delay, the preload will be cancelled.
*/
preloadDelay?: number;
/**
* Control whether the link should be disabled or not
* If set to `true`, the link will be rendered without an `href` attribute
* @default false
*/
disabled?: boolean;
/**
* When the preload strategy is set to `intent`, this controls the proximity of the link to the cursor before it is preloaded.
* If the user exits this proximity before this delay, the preload will be cancelled.
*/
preloadIntentProximity?: number;
}
export type LinkOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & LinkOptionsProps;
export declare const preloadWarning = "Error preloading route! \u261D\uFE0F";
export {};
@@ -0,0 +1 @@
{"version":3,"file":"message-square-off.js","sources":["../../../src/icons/message-square-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageSquareOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTVWNWEyIDIgMCAwIDAtMi0ySDkiIC8+CiAgPHBhdGggZD0ibTIgMiAyMCAyMCIgLz4KICA8cGF0aCBkPSJNMy42IDMuNmMtLjQuMy0uNi44LS42IDEuNHYxNmw0LTRoMTAiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/message-square-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MessageSquareOff = createLucideIcon('MessageSquareOff', [\n ['path', { d: 'M21 15V5a2 2 0 0 0-2-2H9', key: '43el77' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n ['path', { d: 'M3.6 3.6c-.4.3-.6.8-.6 1.4v16l4-4h10', key: 'pwpm4a' }],\n]);\n\nexport default MessageSquareOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmB,iBAAiB,kBAAoB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACvE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,93 @@
"use client";
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
let react = require("react");
react = require_runtime.__toESM(react);
/**
* React.use if available (React 19+), undefined otherwise.
* Use dynamic lookup to avoid Webpack compilation errors with React 18.
*/
var reactUse = react["use"];
var useLayoutEffect = typeof window !== "undefined" ? react.useLayoutEffect : react.useEffect;
/**
* Taken from https://www.developerway.com/posts/implementing-advanced-use-previous-hook#part3
*/
function usePrevious(value) {
const ref = react.useRef({
value,
prev: null
});
const current = ref.current.value;
if (value !== current) ref.current = {
value,
prev: current
};
return ref.current.prev;
}
/**
* React hook to wrap `IntersectionObserver`.
*
* This hook will create an `IntersectionObserver` and observe the ref passed to it.
*
* When the intersection changes, the callback will be called with the `IntersectionObserverEntry`.
*
* @param ref - The ref to observe
* @param intersectionObserverOptions - The options to pass to the IntersectionObserver
* @param options - The options to pass to the hook
* @param callback - The callback to call when the intersection changes
* @returns The IntersectionObserver instance
* @example
* ```tsx
* const MyComponent = () => {
* const ref = React.useRef<HTMLDivElement>(null)
* useIntersectionObserver(
* ref,
* (entry) => { doSomething(entry) },
* { rootMargin: '10px' },
* { disabled: false }
* )
* return <div ref={ref} />
* ```
*/
function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, options = {}) {
react.useEffect(() => {
if (!ref.current || options.disabled || typeof IntersectionObserver !== "function") return;
const observer = new IntersectionObserver(([entry]) => {
callback(entry);
}, intersectionObserverOptions);
observer.observe(ref.current);
return () => {
observer.disconnect();
};
}, [
callback,
intersectionObserverOptions,
options.disabled,
ref
]);
}
/**
* React hook to take a `React.ForwardedRef` and returns a `ref` that can be used on a DOM element.
*
* @param ref - The forwarded ref
* @returns The inner ref returned by `useRef`
* @example
* ```tsx
* const MyComponent = React.forwardRef((props, ref) => {
* const innerRef = useForwardedRef(ref)
* return <div ref={innerRef} />
* })
* ```
*/
function useForwardedRef(ref) {
const innerRef = react.useRef(null);
react.useImperativeHandle(ref, () => innerRef.current, []);
return innerRef;
}
//#endregion
exports.reactUse = reactUse;
exports.useForwardedRef = useForwardedRef;
exports.useIntersectionObserver = useIntersectionObserver;
exports.useLayoutEffect = useLayoutEffect;
exports.usePrevious = usePrevious;
//# sourceMappingURL=utils.cjs.map
@@ -0,0 +1,5 @@
'use strict';
throw new Error(
'react-dom/profiling is not supported in React Server Components.'
);
@@ -0,0 +1,672 @@
// Generated by dts-bundle-generator v8.1.2
import { NextFunction, Request, RequestHandler, Response } from 'express';
/**
* Returns the IP address itself for IPv4, or a CIDR-notation subnet for IPv6.
*
* If you write a custom keyGenerator that allows a fallback to IP address for
* unauthenticated users, return ipKeyGenerator(req.ip) rather than just req.ip.
*
* For more information, {@see Options.ipv6Subnet}.
*
* @param ip {string} - The IP address to process, usually request.ip.
* @param ipv6Subnet {number | false} - The subnet mask for IPv6 addresses.
*
* @returns {string} - The key generated from the IP address
*
* @public
*/
export declare function ipKeyGenerator(ip: string, ipv6Subnet?: number | false): string;
declare const SUPPORTED_DRAFT_VERSIONS: readonly [
"draft-6",
"draft-7",
"draft-8"
];
declare const validations: {
enabled: {
[key: string]: boolean;
};
disable(): void;
/**
* Checks whether the IP address is valid, and that it does not have a port
* number in it.
*
* See https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes#err_erl_invalid_ip_address.
*
* @param ip {string | undefined} - The IP address provided by Express as request.ip.
*
* @returns {void}
*/
ip(ip: string | undefined): void;
/**
* Makes sure the trust proxy setting is not set to `true`.
*
* See https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes#err_erl_permissive_trust_proxy.
*
* @param request {Request} - The Express request object.
*
* @returns {void}
*/
trustProxy(request: Request): void;
/**
* Makes sure the trust proxy setting is set in case the `X-Forwarded-For`
* header is present.
*
* See https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes#err_erl_unset_trust_proxy.
*
* @param request {Request} - The Express request object.
*
* @returns {void}
*/
xForwardedForHeader(request: Request): void;
/**
* Alert the user if the Forwarded header is set (standardized version of X-Forwarded-For - not supported by express as of version 5.1.0)
*
* @param request {Request} - The Express request object.
*
* @returns {void}
*/
forwardedHeader(request: Request): void;
/**
* Ensures totalHits value from store is a positive integer.
*
* @param hits {any} - The `totalHits` returned by the store.
*/
positiveHits(hits: any): void;
/**
* Ensures a single store instance is not used with multiple express-rate-limit instances
*/
unsharedStore(store: Store): void;
/**
* Ensures a given key is incremented only once per request.
*
* @param request {Request} - The Express request object.
* @param store {Store} - The store class.
* @param key {string} - The key used to store the client's hit count.
*
* @returns {void}
*/
singleCount(request: Request, store: Store, key: string): void;
/**
* Warns the user that the behaviour for `max: 0` / `limit: 0` is
* changing in the next major release.
*
* @param limit {number} - The maximum number of hits per client.
*
* @returns {void}
*/
limit(limit: number): void;
/**
* Warns the user that the `draft_polli_ratelimit_headers` option is deprecated
* and will be removed in the next major release.
*
* @param draft_polli_ratelimit_headers {any | undefined} - The now-deprecated setting that was used to enable standard headers.
*
* @returns {void}
*/
draftPolliHeaders(draft_polli_ratelimit_headers?: any): void;
/**
* Warns the user that the `onLimitReached` option is deprecated and
* will be removed in the next major release.
*
* @param onLimitReached {any | undefined} - The maximum number of hits per client.
*
* @returns {void}
*/
onLimitReached(onLimitReached?: any): void;
/**
* Warns the user when an invalid/unsupported version of the draft spec is passed.
*
* @param version {any | undefined} - The version passed by the user.
*
* @returns {void}
*/
headersDraftVersion(version?: any): void;
/**
* Warns the user when the selected headers option requires a reset time but
* the store does not provide one.
*
* @param resetTime {Date | undefined} - The timestamp when the client's hit count will be reset.
*
* @returns {void}
*/
headersResetTime(resetTime?: Date): void;
knownOptions(passedOptions?: Partial<Options>): void;
/**
* Checks the options.validate setting to ensure that only recognized
* validations are enabled or disabled.
*
* If any unrecognized values are found, an error is logged that
* includes the list of supported validations.
*/
validationsConfig(): void;
/**
* Checks to see if the instance was created inside of a request handler,
* which would prevent it from working correctly, with the default memory
* store (or any other store with localKeys.)
*/
creationStack(store: Store): void;
ipv6Subnet(ipv6Subnet?: any): void;
ipv6SubnetOrKeyGenerator(options: Partial<Options>): void;
keyGeneratorIpFallback(keyGenerator?: ValueDeterminingMiddleware<string>): void;
/**
* Checks to see if the window duration is greater than 2^32 - 1. This is only
* called by the default MemoryStore, since it uses Node's setInterval method.
*
* See https://nodejs.org/api/timers.html#setintervalcallback-delay-args.
*/
windowMs(windowMs: number): void;
};
export type Validations = typeof validations;
/**
* Basic logging function
*
* @param error {unknown} - The error to log
* @param message {string | undefined} - Additional details about the error
*/
export type LoggerFn = (error: unknown, message?: string) => void;
/**
* Minimal interface for logging warnings and errors
*/
export type Logger = {
/**
* Function to log an error
*/
error: LoggerFn;
/**
* Function to log a warning
*/
warn: LoggerFn;
};
/**
* Callback that fires when a client's hit counter is incremented.
*
* @param error {Error | undefined} - The error that occurred, if any.
* @param totalHits {number} - The number of hits for that client so far.
* @param resetTime {Date | undefined} - The time when the counter resets.
*/
export type IncrementCallback = (error: Error | undefined, totalHits: number, resetTime: Date | undefined) => void;
/**
* Method (in the form of middleware) to generate/retrieve a value based on the
* incoming request.
*
* @param request {Request} - The Express request object.
* @param response {Response} - The Express response object.
*
* @returns {T} - The value needed.
*/
export type ValueDeterminingMiddleware<T> = (request: Request, response: Response) => T | Promise<T>;
/**
* Express request handler that sends back a response when a client is
* rate-limited.
*
* @param request {Request} - The Express request object.
* @param response {Response} - The Express response object.
* @param next {NextFunction} - The Express `next` function, can be called to skip responding.
* @param optionsUsed {Options} - The options used to set up the middleware.
*/
export type RateLimitExceededEventHandler = (request: Request, response: Response, next: NextFunction, optionsUsed: Options) => void;
/**
* Event callback that is triggered on a client's first request that exceeds the limit
* but not for subsequent requests. May be used for logging, etc. Should *not*
* send a response.
*
* @param request {Request} - The Express request object.
* @param response {Response} - The Express response object.
* @param optionsUsed {Options} - The options used to set up the middleware.
*/
export type RateLimitReachedEventHandler = (request: Request, response: Response, optionsUsed: Options) => void;
/**
* Data returned from the `Store` when a client's hit counter is incremented.
*
* @property totalHits {number} - The number of hits for that client so far.
* @property resetTime {Date | undefined} - The time when the counter resets.
*/
export type ClientRateLimitInfo = {
totalHits: number;
resetTime: Date | undefined;
};
export type IncrementResponse = ClientRateLimitInfo;
/**
* A modified Express request handler with the rate limit functions.
*/
export type RateLimitRequestHandler = RequestHandler & {
/**
* Method to reset a client's hit counter.
*
* @param key {string} - The identifier for a client.
*/
resetKey: (key: string) => void;
/**
* Method to fetch a client's hit count and reset time.
*
* @param key {string} - The identifier for a client.
*
* @returns {ClientRateLimitInfo} - The number of hits and reset time for that client.
*/
getKey: (key: string) => Promise<ClientRateLimitInfo | undefined> | ClientRateLimitInfo | undefined;
};
/**
* An interface that all hit counter stores must implement.
*
* @deprecated 6.x - Implement the `Store` interface instead.
*/
export type LegacyStore = {
/**
* Method to increment a client's hit counter.
*
* @param key {string} - The identifier for a client.
* @param callback {IncrementCallback} - The callback to call once the counter is incremented.
*/
incr: (key: string, callback: IncrementCallback) => void;
/**
* Method to decrement a client's hit counter.
*
* @param key {string} - The identifier for a client.
*/
decrement: (key: string) => void;
/**
* Method to reset a client's hit counter.
*
* @param key {string} - The identifier for a client.
*/
resetKey: (key: string) => void;
/**
* Method to reset everyone's hit counter.
*/
resetAll?: () => void;
};
/**
* An interface that all hit counter stores must implement.
*/
export type Store = {
/**
* Method that initializes the store, and has access to the options passed to
* the middleware too.
*
* Called once during initialization.
*
* Errors / promise rejections will be caught and logged.
*
* Note that the result is not awaited - other store methods (such as increment) may be called before init returns and/or after it throws/rejects.
*
* @param options {Options} - The options used to setup the middleware.
*/
init?: (options: Options) => void | Promise<void>;
/**
* Method to fetch a client's hit count and reset time.
*
* @param key {string} - The identifier for a client.
*
* @returns {ClientRateLimitInfo} - The number of hits and reset time for that client.
*/
get?: (key: string) => Promise<ClientRateLimitInfo | undefined> | ClientRateLimitInfo | undefined;
/**
* Method to increment a client's hit counter.
*
* @param key {string} - The identifier for a client.
*
* @returns {IncrementResponse | undefined} - The number of hits and reset time for that client.
*/
increment: (key: string) => Promise<IncrementResponse> | IncrementResponse;
/**
* Method to decrement a client's hit counter.
*
* @param key {string} - The identifier for a client.
*/
decrement: (key: string) => Promise<void> | void;
/**
* Method to reset a client's hit counter.
*
* @param key {string} - The identifier for a client.
*/
resetKey: (key: string) => Promise<void> | void;
/**
* Method to reset everyone's hit counter.
*/
resetAll?: () => Promise<void> | void;
/**
* Method to shutdown the store, stop timers, and release all resources.
*/
shutdown?: () => Promise<void> | void;
/**
* Flag to indicate that keys incremented in one instance of this store can
* not affect other instances. Typically false if a database is used, true for
* MemoryStore.
*
* Used to help detect double-counting misconfigurations.
*/
localKeys?: boolean;
/**
* Optional value that the store prepends to keys
*
* Used by the double-count check to avoid false-positives when a key is counted
* twice, but with different prefixes.
*/
prefix?: string;
};
export type DraftHeadersVersion = (typeof SUPPORTED_DRAFT_VERSIONS)[number];
/**
* Validate configuration object for enabling or disabling specific validations.
*
* The keys must also be keys in the validations object, except `enable`, `disable`,
* and `default`.
*/
export type EnabledValidations = {
[key in keyof Omit<Validations, "enabled" | "disable"> | "default"]?: boolean;
};
/**
* The configuration options for the rate limiter.
*/
export type Options = {
/**
* How long we should remember the requests.
*
* Defaults to `60000` ms (= 1 minute).
*/
windowMs: number;
/**
* The maximum number of connections to allow during the `window` before
* rate limiting the client.
*
* Can be the limit itself as a number or express middleware that parses
* the request and then figures out the limit.
*
* Defaults to `5`.
*/
limit: number | ValueDeterminingMiddleware<number>;
/**
* The response body to send back when a client is rate limited.
*
* Defaults to `'Too many requests, please try again later.'`
*/
message: any | ValueDeterminingMiddleware<any>;
/**
* The HTTP status code to send back when a client is rate limited.
*
* Defaults to `HTTP 429 Too Many Requests` (RFC 6585).
*/
statusCode: number;
/**
* Whether to send `X-RateLimit-*` headers with the rate limit and the number
* of requests.
*
* Defaults to `true` (for backward compatibility).
*/
legacyHeaders: boolean;
/**
* Whether to enable support for the standardized rate limit headers (`RateLimit-*`).
*
* Defaults to `false` (for backward compatibility, but its use is recommended).
*/
standardHeaders: boolean | DraftHeadersVersion;
/**
* The name used to identify the quota policy in the `RateLimit` headers as per
* the 8th draft of the IETF specification.
*
* Defaults to `{limit}-in-{window}`.
*/
identifier: string | ValueDeterminingMiddleware<string>;
/**
* The name of the property on the request object to store the rate limit info.
*
* Defaults to `rateLimit`.
*/
requestPropertyName: string;
/**
* If `true`, the library will (by default) skip all requests that have a 4XX
* or 5XX status.
*
* Defaults to `false`.
*/
skipFailedRequests: boolean;
/**
* If `true`, the library will (by default) skip all requests that have a
* status code less than 400.
*
* Defaults to `false`.
*/
skipSuccessfulRequests: boolean;
/**
* Method to generate custom identifiers for clients.
*
* By default, the client's IP address is used.
*/
keyGenerator: ValueDeterminingMiddleware<string>;
/**
* IPv6 subnet mask applied to IPv6 addresses in the default keyGenerator.
*
* Default is 56. The valid range is technically 1-128 but the value should
* generally be in the 32-64 range.
*
* Smaller numbers are more aggressive, larger numbers are more lenient. Try
* bumping to 60 or 64 if you see evidence of users being blocked incorrectly.
*
* May also be set to a function that returns a number based on the request.
*
* See the documentation for more info:
* https://express-rate-limit.mintlify.app/reference/configuration#ipv6subnet.
*/
ipv6Subnet: 64 | 60 | 56 | 52 | 50 | 48 | 32 | number | ValueDeterminingMiddleware<number> | false;
/**
* Express request handler that sends back a response when a client is
* rate-limited.
*
* By default, sends back the `statusCode` and `message` set via the options.
*/
handler: RateLimitExceededEventHandler;
/**
* Method (in the form of middleware) to determine whether or not this request
* counts towards a client's quota.
*
* By default, skips no requests.
*/
skip: ValueDeterminingMiddleware<boolean>;
/**
* Method to determine whether or not the request counts as 'successful'. Used
* when either `skipSuccessfulRequests` or `skipFailedRequests` is set to true.
*
* By default, requests with a response status code less than 400 are considered
* successful.
*/
requestWasSuccessful: ValueDeterminingMiddleware<boolean>;
/**
* The `Store` to use to store the hit count for each client.
*
* By default, the built-in `MemoryStore` will be used.
*/
store: Store | LegacyStore;
/**
* The list of validation checks that should run.
*/
validate: boolean | EnabledValidations;
/**
* Whether to send `X-RateLimit-*` headers with the rate limit and the number
* of requests.
*
* @deprecated 6.x - This option was renamed to `legacyHeaders`.
*/
headers?: boolean;
/**
* The maximum number of connections to allow during the `window` before
* rate limiting the client.
*
* Can be the limit itself as a number or express middleware that parses
* the request and then figures out the limit.
*
* @deprecated 7.x - This option was renamed to `limit`. However, it will not
* be removed from the library in the foreseeable future.
*/
max?: number | ValueDeterminingMiddleware<number>;
/**
* If the Store generates an error, allow the request to pass.
*/
passOnStoreError: boolean;
/**
* The logger to use to log errors. If absent, logs to the console.
*/
logger: Logger;
};
/**
* The extended request object that includes information about the client's
* rate limit.
*/
export type AugmentedRequest = Request & {
[key: string]: RateLimitInfo;
};
/**
* The rate limit related information for each client included in the
* Express request object.
*/
export type RateLimitInfo = {
limit: number;
used: number;
remaining: number;
resetTime: Date | undefined;
key: string;
};
/**
* The record that stores information about a client - namely, how many times
* they have hit the endpoint, and when their hit count resets.
*
* Similar to `ClientRateLimitInfo`, except `resetTime` is a compulsory field.
*/
export type Client = {
totalHits: number;
resetTime: Date;
};
/**
* A `Store` that stores the hit count for each client in memory.
*
* @public
*/
export declare class MemoryStore implements Store {
private validations?;
/**
* The duration of time before which all hit counts are reset (in milliseconds).
*/
windowMs: number;
/**
* These two maps store usage (requests) and reset time by key (for example, IP
* addresses or API keys).
*
* They are split into two to avoid having to iterate through the entire set to
* determine which ones need reset. Instead, `Client`s are moved from `previous`
* to `current` as they hit the endpoint. Once `windowMs` has elapsed, all clients
* left in `previous`, i.e., those that have not made any recent requests, are
* known to be expired and can be deleted in bulk.
*/
previous: Map<string, Client>;
current: Map<string, Client>;
/**
* A reference to the active timer.
*/
interval?: NodeJS.Timeout;
/**
* Confirmation that the keys incremented in once instance of MemoryStore
* cannot affect other instances.
*/
localKeys: boolean;
constructor(validations?: Validations | undefined);
/**
* Method that initializes the store.
*
* @param options {Options} - The options used to setup the middleware.
*/
init(options: Options): void;
/**
* Method to fetch a client's hit count and reset time.
*
* @param key {string} - The identifier for a client.
*
* @returns {ClientRateLimitInfo | undefined} - The number of hits and reset time for that client.
*
* @public
*/
get(key: string): Promise<ClientRateLimitInfo | undefined>;
/**
* Method to increment a client's hit counter.
*
* @param key {string} - The identifier for a client.
*
* @returns {ClientRateLimitInfo} - The number of hits and reset time for that client.
*
* @public
*/
increment(key: string): Promise<ClientRateLimitInfo>;
/**
* Method to decrement a client's hit counter.
*
* @param key {string} - The identifier for a client.
*
* @public
*/
decrement(key: string): Promise<void>;
/**
* Method to reset a client's hit counter.
*
* @param key {string} - The identifier for a client.
*
* @public
*/
resetKey(key: string): Promise<void>;
/**
* Method to reset everyone's hit counter.
*
* @public
*/
resetAll(): Promise<void>;
/**
* Method to stop the timer (if currently running) and prevent any memory
* leaks.
*
* @public
*/
shutdown(): void;
/**
* Recycles a client by setting its hit count to zero, and reset time to
* `windowMs` milliseconds from now.
*
* NOT to be confused with `#resetKey()`, which removes a client from both the
* `current` and `previous` maps.
*
* @param client {Client} - The client to recycle.
* @param now {number} - The current time, to which the `windowMs` is added to get the `resetTime` for the client.
*
* @return {Client} - The modified client that was passed in, to allow for chaining.
*/
private resetClient;
/**
* Retrieves or creates a client, given a key. Also ensures that the client being
* returned is in the `current` map.
*
* @param key {string} - The key under which the client is (or is to be) stored.
*
* @returns {Client} - The requested client.
*/
private getClient;
/**
* Move current clients to previous, create a new map for current.
*
* This function is called every `windowMs`.
*/
private clearExpired;
}
/**
*
* Create an instance of IP rate-limiting middleware for Express.
*
* @param passedOptions {Options} - Options to configure the rate limiter.
*
* @returns {RateLimitRequestHandler} - The middleware that rate-limits clients based on your configuration.
*
* @public
*/
export declare const rateLimit: (passedOptions?: Partial<Options>) => RateLimitRequestHandler;
export {
rateLimit as default,
};
export {};