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,49 @@
import {
getElementScrollRestorationEntry,
setupScrollRestoration,
} from '@tanstack/router-core'
import { useRouter } from './useRouter'
import type {
ParsedLocation,
ScrollRestorationEntry,
ScrollRestorationOptions,
} from '@tanstack/router-core'
function useScrollRestoration() {
const router = useRouter()
setupScrollRestoration(router, true)
}
/**
* @deprecated Use the `scrollRestoration` router option instead.
*/
export function ScrollRestoration(_props: ScrollRestorationOptions) {
useScrollRestoration()
if (process.env.NODE_ENV === 'development') {
console.warn(
"The ScrollRestoration component is deprecated. Use createRouter's `scrollRestoration` option instead.",
)
}
return null
}
export function useElementScrollRestoration(
options: (
| {
id: string
getElement?: () => Window | Element | undefined | null
}
| {
id?: string
getElement: () => Window | Element | undefined | null
}
) & {
getKey?: (location: ParsedLocation) => string
},
): ScrollRestorationEntry | undefined {
useScrollRestoration()
return getElementScrollRestorationEntry(useRouter(), options)
}
@@ -0,0 +1,4 @@
import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types";
export type NotKeywordError = ErrorNoParams<"not", AnySchema>;
declare const def: CodeKeywordDefinition;
export default def;
@@ -0,0 +1,129 @@
/* ---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
* REQUIREMENT: This definition is dependent on the @types/node definition.
* Install with `npm install @types/node --save-dev`
*-------------------------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------------------------
* This file provides detailed typings for the public API of iconv-lite
*-------------------------------------------------------------------------------------------- */
import type Stream = require("stream")
import type { Encoding } from "../types/encodings"
declare namespace iconv {
export interface DecodeOptions {
/**
* Strip the Byte Order Mark (BOM) from the input,
* when decoding, if the codec is BOM-aware. @default true
*/
stripBOM?: boolean;
/** Override the default endianness for `UTF-16` and `UTF-32` decodings. */
defaultEncoding?: "utf16be" | "utf32be";
}
export interface EncodeOptions {
/**
* Add a Byte Order Mark (BOM) to the output, when encoding,
* if the codec is BOM-aware. @default false
*/
addBOM?: boolean;
/** Override the default endianness for `UTF-32` encoding. */
defaultEncoding?: "utf32be";
}
export interface EncoderStream {
write(str: string): Buffer;
end(): Buffer | undefined;
}
export interface DecoderStream {
write(buf: Buffer): string;
end(): string | undefined;
}
export interface Codec {
encoder: new (options?: EncodeOptions, codec?: Codec) => EncoderStream;
decoder: new (options?: DecodeOptions, codec?: Codec) => DecoderStream;
bomAware?: boolean;
[key: string]: any;
}
/** Encodes a `string` into a `Buffer`, using the provided `encoding`. */
export function encode (content: string, encoding: Encoding, options?: EncodeOptions): Buffer
/** Decodes a `Buffer` into a `string`, using the provided `encoding`. */
export function decode (buffer: Buffer | Uint8Array, encoding: Encoding, options?: DecodeOptions): string
/** Checks if a given encoding is supported by `iconv-lite`. */
export function encodingExists (encoding: string): encoding is Encoding
/** Legacy alias for {@link iconv.encode}. */
export const toEncoding: typeof iconv.encode
/** Legacy alias for {@link iconv.decode}. */
export const fromEncoding: typeof iconv.decode
/** Creates a stream that decodes binary data from a given `encoding` into strings. */
export function decodeStream (encoding: Encoding, options?: DecodeOptions): NodeJS.ReadWriteStream
/** Creates a stream that encodes strings into binary data in a given `encoding`. */
export function encodeStream (encoding: Encoding, options?: EncodeOptions): NodeJS.ReadWriteStream
/**
* Explicitly enable Streaming API in browser environments by passing in:
* ```js
* require('stream')
* ```
* @example iconv.enableStreamingAPI(require('stream'));
*/
export function enableStreamingAPI (stream_module: { Transform: typeof Stream.Transform }): void
/** Creates and returns a low-level encoder stream. */
export function getEncoder (encoding: Encoding, options?: EncodeOptions): EncoderStream
/** Creates and returns a low-level decoder stream. */
export function getDecoder (encoding: Encoding, options?: DecodeOptions): DecoderStream
/**
* Returns a codec object for the given `encoding`.
* @throws If the `encoding` is not recognized.
*/
export function getCodec (encoding: Encoding): Codec
/** Strips all non-alphanumeric characters and appended year from `encoding`. */
export function _canonicalizeEncoding (encoding: Encoding): string
/** A cache of all loaded encoding definitions. */
export let encodings: Record<
Encoding,
| string
| {
type: string;
[key: string]: any;
}
> | null
/** A cache of initialized codec objects. */
export let _codecDataCache: Record<string, Codec>
/** The character used for untranslatable `Unicode` characters. @default "�" */
export let defaultCharUnicode: string
/** The character used for untranslatable `single-byte` characters. @default "?" */
export let defaultCharSingleByte: string
/**
* Skip deprecation warning when strings are used instead of Buffers during decoding.
* Note: {@link iconv.decode} converts the string to Buffer regardless.
*/
export let skipDecodeWarning: boolean
/** @readonly Whether or not, Streaming API is enabled. */
export const supportsStreams: boolean
export type { iconv as Iconv, Encoding }
}
export = iconv
@@ -0,0 +1 @@
{"version":3,"file":"foreignNames.d.ts","sourceRoot":"","sources":["../src/foreignNames.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,qBAwCxB,CAAC;AACF,eAAO,MAAM,cAAc,qBA8D1B,CAAC"}
@@ -0,0 +1 @@
{"version":3,"names":["_isNativeReflectConstruct","require","_setPrototypeOf","_construct","Parent","args","Class","isNativeReflectConstruct","Reflect","construct","apply","arguments","a","push","instance","bind","setPrototypeOf","prototype"],"sources":["../../src/helpers/construct.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.ts\";\nimport setPrototypeOf from \"./setPrototypeOf.ts\";\n\nexport default function _construct(\n Parent: Function,\n args: any[],\n Class: Function,\n): any {\n if (isNativeReflectConstruct()) {\n // Avoid issues with Class being present but undefined when it wasn't\n // present in the original call.\n return Reflect.construct.apply(null, arguments as any);\n }\n // NOTE: If Parent !== Class, the correct __proto__ is set *after*\n // calling the constructor.\n var a: [any, ...any[]] = [null];\n a.push.apply(a, args);\n var instance = new (Parent.bind.apply(Parent, a))();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEe,SAASE,UAAUA,CAChCC,MAAgB,EAChBC,IAAW,EACXC,KAAe,EACV;EACL,IAAI,IAAAC,iCAAwB,EAAC,CAAC,EAAE;IAG9B,OAAOC,OAAO,CAACC,SAAS,CAACC,KAAK,CAAC,IAAI,EAAEC,SAAgB,CAAC;EACxD;EAGA,IAAIC,CAAkB,GAAG,CAAC,IAAI,CAAC;EAC/BA,CAAC,CAACC,IAAI,CAACH,KAAK,CAACE,CAAC,EAAEP,IAAI,CAAC;EACrB,IAAIS,QAAQ,GAAG,KAAKV,MAAM,CAACW,IAAI,CAACL,KAAK,CAACN,MAAM,EAAEQ,CAAC,CAAC,EAAE,CAAC;EACnD,IAAIN,KAAK,EAAE,IAAAU,uBAAc,EAACF,QAAQ,EAAER,KAAK,CAACW,SAAS,CAAC;EACpD,OAAOH,QAAQ;AACjB","ignoreList":[]}
@@ -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 ChartColumnIncreasing = createLucideIcon("ChartColumnIncreasing", [
["path", { d: "M13 17V9", key: "1fwyjl" }],
["path", { d: "M18 17V5", key: "sfb6ij" }],
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
["path", { d: "M8 17v-3", key: "17ska0" }]
]);
export { ChartColumnIncreasing as default };
//# sourceMappingURL=chart-column-increasing.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_index","require","BLOCK_SCOPED_SYMBOL","Symbol","for","isVar","node","isVariableDeclaration","kind"],"sources":["../../src/validators/isVar.ts"],"sourcesContent":["import { isVariableDeclaration } from \"./generated/index.ts\";\nimport type * as t from \"../index.ts\";\n\nif (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var BLOCK_SCOPED_SYMBOL = Symbol.for(\"var used to be block scoped\");\n}\n\n/**\n * Check if the input `node` is a variable declaration.\n */\nexport default function isVar(node: t.Node | null | undefined): boolean {\n if (process.env.BABEL_8_BREAKING) {\n return isVariableDeclaration(node) && node.kind === \"var\";\n } else {\n return (\n isVariableDeclaration(node, { kind: \"var\" }) &&\n !(\n // @ts-expect-error document private properties\n node[BLOCK_SCOPED_SYMBOL]\n )\n );\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKE,IAAIC,mBAAmB,GAAGC,MAAM,CAACC,GAAG,CAAC,6BAA6B,CAAC;AAMtD,SAASC,KAAKA,CAACC,IAA+B,EAAW;EAIpE,OACE,IAAAC,4BAAqB,EAACD,IAAI,EAAE;IAAEE,IAAI,EAAE;EAAM,CAAC,CAAC,IAC5C,CAEEF,IAAI,CAACJ,mBAAmB,CACzB;AAGP","ignoreList":[]}
@@ -0,0 +1,43 @@
import { StatusCode } from "../../utils/http-status.js";
import { MiddlewareHandler } from "../../types.js";
import { Context } from "../../context.js";
//#region src/middleware/cache/index.d.ts
/**
* Cache Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/cache}
*
* @param {Object} options - The options for the cache middleware.
* @param {string | Function} options.cacheName - The name of the cache. Can be used to store multiple caches with different identifiers.
* @param {boolean} [options.wait=false] - A boolean indicating if Hono should wait for the Promise of the `cache.put` function to resolve before continuing with the request. Required to be true for the Deno environment.
* @param {string} [options.cacheControl] - A string of directives for the `Cache-Control` header.
* @param {string | string[]} [options.vary] - Adds the configured request headers to the cache key variants and sets the `Vary` header in the response. If the original response header already contains a `Vary` header, the values are merged, removing any duplicates.
* @param {Function} [options.keyGenerator] - Generates keys for every request in the `cacheName` store. This can be used to cache data based on request parameters or context parameters. QUERY keys additionally include a digest of the request content and its representation metadata.
* @param {number} [options.maxQueryBodySize=65536] - The maximum QUERY request body size in bytes that can be cached. Larger QUERY requests bypass the cache.
* @param {number[]} [options.cacheableStatusCodes=[200]] - An array of status codes that can be cached.
* @param {Function | false} [options.onCacheNotAvailable] - A callback invoked with the reason when `globalThis.caches` is not available or QUERY caching cannot use Web Crypto. By default, the reason is logged to the console. Set to `false` to suppress the log, or provide a custom function.
* @returns {MiddlewareHandler} The middleware handler function.
* @throws {Error} If the `vary` option includes "*".
*
* @example
* ```ts
* app.use(
* '*',
* cache({
* cacheName: 'my-app',
* cacheControl: 'max-age=3600',
* })
* )
* ```
*/
export declare const cache: (options: {
cacheName: string | ((c: Context) => Promise<string> | string);
wait?: boolean;
cacheControl?: string;
vary?: string | string[];
keyGenerator?: (c: Context) => Promise<string> | string;
maxQueryBodySize?: number;
cacheableStatusCodes?: StatusCode[];
onCacheNotAvailable?: ((reason: string) => void) | false;
}) => MiddlewareHandler;
//#endregion
@@ -0,0 +1,25 @@
const React = require('react');
module.exports = function FlattenButton({ setIsFlat, isFlat }) {
return (
<div className="toggle">
<div className="toggle__label">Files:</div>
<div className="toggle__options">
<button
onClick={() => setIsFlat(!isFlat)}
className={
'toggle__option ' + (!isFlat ? 'is-toggled' : '')
}
>
Tree
</button>
<button
onClick={() => setIsFlat(!isFlat)}
className={'toggle__option ' + (isFlat ? 'is-toggled' : '')}
>
Flat
</button>
</div>{' '}
</div>
);
};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_S"},D:{"1":"_ZD","16":"_Y"},E:{"1":"_YB","16":"_4"},F:{"1":"_a","2":"_T"},G:{"1":"_t","16":"_d"},H:{"2":"1D"},I:{"1":"_SB","16":"_m"},J:{"1":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"2":"_C"}},B:7,C:"Element.scrollIntoViewIfNeeded()",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"strip-trailing-slashes.d.ts","sourceRoot":"","sources":["../../src/strip-trailing-slashes.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,WAQ/C,CAAA"}
@@ -0,0 +1,19 @@
/**
* @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 ChartBarStacked = createLucideIcon("ChartBarStacked", [
["path", { d: "M11 13v4", key: "vyy2rb" }],
["path", { d: "M15 5v4", key: "1gx88a" }],
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
["rect", { x: "7", y: "13", width: "9", height: "4", rx: "1", key: "1iip1u" }],
["rect", { x: "7", y: "5", width: "12", height: "4", rx: "1", key: "1anskk" }]
]);
export { ChartBarStacked as default };
//# sourceMappingURL=chart-bar-stacked.js.map
@@ -0,0 +1,26 @@
/**
* @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 QrCode = createLucideIcon("QrCode", [
["rect", { width: "5", height: "5", x: "3", y: "3", rx: "1", key: "1tu5fj" }],
["rect", { width: "5", height: "5", x: "16", y: "3", rx: "1", key: "1v8r4q" }],
["rect", { width: "5", height: "5", x: "3", y: "16", rx: "1", key: "1x03jg" }],
["path", { d: "M21 16h-3a2 2 0 0 0-2 2v3", key: "177gqh" }],
["path", { d: "M21 21v.01", key: "ents32" }],
["path", { d: "M12 7v3a2 2 0 0 1-2 2H7", key: "8crl2c" }],
["path", { d: "M3 12h.01", key: "nlz23k" }],
["path", { d: "M12 3h.01", key: "n36tog" }],
["path", { d: "M12 16v.01", key: "133mhm" }],
["path", { d: "M16 12h1", key: "1slzba" }],
["path", { d: "M21 12v.01", key: "1lwtk9" }],
["path", { d: "M12 21v-1", key: "1880an" }]
]);
export { QrCode as default };
//# sourceMappingURL=qr-code.js.map
@@ -0,0 +1,5 @@
# `react-use-is-hydrated`
## Usage
This is an internal utility, not intended for public usage.
@@ -0,0 +1,41 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->
## Security
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
## Reporting Security Issues
**Please do not report security vulnerabilities through public GitHub issues.**
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
## Preferred Languages
We prefer all communications to be in English.
## Policy
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
<!-- END MICROSOFT SECURITY.MD BLOCK -->
@@ -0,0 +1,128 @@
// Generated by LiveScript 1.6.0
(function(){
var ref$, any, all, isItNaN, types, defaultType, toString$ = {}.toString;
ref$ = require('prelude-ls'), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN;
types = {
Number: {
typeOf: 'Number',
validate: function(it){
return !isItNaN(it);
}
},
NaN: {
typeOf: 'Number',
validate: isItNaN
},
Int: {
typeOf: 'Number',
validate: function(it){
return !isItNaN(it) && it % 1 === 0;
}
},
Float: {
typeOf: 'Number',
validate: function(it){
return !isItNaN(it);
}
},
Date: {
typeOf: 'Date',
validate: function(it){
return !isItNaN(it.getTime());
}
}
};
defaultType = {
array: 'Array',
tuple: 'Array'
};
function checkArray(input, type, options){
return all(function(it){
return checkMultiple(it, type.of, options);
}, input);
}
function checkTuple(input, type, options){
var i, i$, ref$, len$, types;
i = 0;
for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) {
types = ref$[i$];
if (!checkMultiple(input[i], types, options)) {
return false;
}
i++;
}
return input.length <= i;
}
function checkFields(input, type, options){
var inputKeys, numInputKeys, k, numOfKeys, key, ref$, types;
inputKeys = {};
numInputKeys = 0;
for (k in input) {
inputKeys[k] = true;
numInputKeys++;
}
numOfKeys = 0;
for (key in ref$ = type.of) {
types = ref$[key];
if (!checkMultiple(input[key], types, options)) {
return false;
}
if (inputKeys[key]) {
numOfKeys++;
}
}
return type.subset || numInputKeys === numOfKeys;
}
function checkStructure(input, type, options){
if (!(input instanceof Object)) {
return false;
}
switch (type.structure) {
case 'fields':
return checkFields(input, type, options);
case 'array':
return checkArray(input, type, options);
case 'tuple':
return checkTuple(input, type, options);
}
}
function check(input, typeObj, options){
var type, structure, setting, that;
type = typeObj.type, structure = typeObj.structure;
if (type) {
if (type === '*') {
return true;
}
setting = options.customTypes[type] || types[type];
if (setting) {
return (setting.typeOf === void 8 || setting.typeOf === toString$.call(input).slice(8, -1)) && setting.validate(input);
} else {
return type === toString$.call(input).slice(8, -1) && (!structure || checkStructure(input, typeObj, options));
}
} else if (structure) {
if (that = defaultType[structure]) {
if (that !== toString$.call(input).slice(8, -1)) {
return false;
}
}
return checkStructure(input, typeObj, options);
} else {
throw new Error("No type defined. Input: " + input + ".");
}
}
function checkMultiple(input, types, options){
if (toString$.call(types).slice(8, -1) !== 'Array') {
throw new Error("Types must be in an array. Input: " + input + ".");
}
return any(function(it){
return check(input, it, options);
}, types);
}
module.exports = function(parsedType, input, options){
options == null && (options = {});
if (options.customTypes == null) {
options.customTypes = {};
}
return checkMultiple(input, parsedType, options);
};
}).call(this);
@@ -0,0 +1,23 @@
/**
* @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 KeyboardMusic = createLucideIcon("KeyboardMusic", [
["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "18n3k1" }],
["path", { d: "M6 8h4", key: "utf9t1" }],
["path", { d: "M14 8h.01", key: "1primd" }],
["path", { d: "M18 8h.01", key: "emo2bl" }],
["path", { d: "M2 12h20", key: "9i4pu4" }],
["path", { d: "M6 12v4", key: "dy92yo" }],
["path", { d: "M10 12v4", key: "1fxnav" }],
["path", { d: "M14 12v4", key: "1hft58" }],
["path", { d: "M18 12v4", key: "tjjnbz" }]
]);
export { KeyboardMusic as default };
//# sourceMappingURL=keyboard-music.js.map
@@ -0,0 +1 @@
{"version":3,"file":"vibrate.js","sources":["../../../src/icons/vibrate.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Vibrate\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMiA4IDIgMi0yIDIgMiAyLTIgMiIgLz4KICA8cGF0aCBkPSJtMjIgOC0yIDIgMiAyLTIgMiAyIDIiIC8+CiAgPHJlY3Qgd2lkdGg9IjgiIGhlaWdodD0iMTQiIHg9IjgiIHk9IjUiIHJ4PSIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/vibrate\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 Vibrate = createLucideIcon('Vibrate', [\n ['path', { d: 'm2 8 2 2-2 2 2 2-2 2', key: 'sv1b1' }],\n ['path', { d: 'm22 8-2 2 2 2-2 2 2 2', key: '101i4y' }],\n ['rect', { width: '8', height: '14', x: '8', y: '5', rx: '1', key: '1oyrl4' }],\n]);\n\nexport default Vibrate;\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,CAAwB,CAAA,CAAA,CAAA,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,SAAS,CAAA,CAAA;AAAA,CAAA,CACpD,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,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,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;AAC/E,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,765 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
const promiseUtils_1 = require("../util/promiseUtils");
function parseChecksVoidReturn(checksVoidReturn) {
switch (checksVoidReturn) {
case false:
return false;
case true:
case undefined:
return {
arguments: true,
attributes: true,
inheritedMethods: true,
properties: true,
returns: true,
variables: true,
};
default:
return {
arguments: checksVoidReturn.arguments ?? true,
attributes: checksVoidReturn.attributes ?? true,
inheritedMethods: checksVoidReturn.inheritedMethods ?? true,
properties: checksVoidReturn.properties ?? true,
returns: checksVoidReturn.returns ?? true,
variables: checksVoidReturn.variables ?? true,
};
}
}
exports.default = (0, util_1.createRule)({
name: 'no-misused-promises',
meta: {
type: 'problem',
docs: {
description: 'Disallow Promises in places not designed to handle them',
recommended: 'recommended',
requiresTypeChecking: true,
},
messages: {
conditional: 'Expected non-Promise value in a boolean conditional.',
predicate: 'Expected a non-Promise value to be returned.',
spread: 'Expected a non-Promise value to be spread in an object.',
voidReturnArgument: 'Promise returned in function argument where a void return was expected.',
voidReturnAttribute: 'Promise-returning function provided to attribute where a void return was expected.',
voidReturnInheritedMethod: "Promise-returning method provided where a void return was expected by extended/implemented type '{{ heritageTypeName }}'.",
voidReturnProperty: 'Promise-returning function provided to property where a void return was expected.',
voidReturnReturnValue: 'Promise-returning function provided to return value where a void return was expected.',
voidReturnVariable: 'Promise-returning function provided to variable where a void return was expected.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
checksConditionals: {
type: 'boolean',
description: 'Whether to warn when a Promise is provided to conditional statements.',
},
checksSpreads: {
type: 'boolean',
description: 'Whether to warn when `...` spreading a `Promise`.',
},
checksVoidReturn: {
description: 'Whether to warn when a Promise is returned from a function typed as returning `void`.',
oneOf: [
{
type: 'boolean',
description: 'Whether to disable checking all asynchronous functions.',
},
{
type: 'object',
additionalProperties: false,
description: 'Which forms of functions may have checking disabled.',
properties: {
arguments: {
type: 'boolean',
description: 'Disables checking an asynchronous function passed as argument where the parameter type expects a function that returns `void`.',
},
attributes: {
type: 'boolean',
description: 'Disables checking an asynchronous function passed as a JSX attribute expected to be a function that returns `void`.',
},
inheritedMethods: {
type: 'boolean',
description: 'Disables checking an asynchronous method in a type that extends or implements another type expecting that method to return `void`.',
},
properties: {
type: 'boolean',
description: 'Disables checking an asynchronous function passed as an object property expected to be a function that returns `void`.',
},
returns: {
type: 'boolean',
description: 'Disables checking an asynchronous function returned in a function whose return type is a function that returns `void`.',
},
variables: {
type: 'boolean',
description: 'Disables checking an asynchronous function used as a variable whose return type is a function that returns `void`.',
},
},
},
],
},
},
},
],
},
defaultOptions: [
{
checksConditionals: true,
checksSpreads: true,
checksVoidReturn: true,
},
],
create(context, [{ checksConditionals, checksSpreads, checksVoidReturn }]) {
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
const checkedNodes = new Set();
const conditionalChecks = {
'CallExpression > MemberExpression': checkArrayPredicates,
ConditionalExpression: checkTestConditional,
DoWhileStatement: checkTestConditional,
ForStatement: checkTestConditional,
IfStatement: checkTestConditional,
LogicalExpression: checkConditional,
'UnaryExpression[operator="!"]'(node) {
checkConditional(node.argument, true);
},
WhileStatement: checkTestConditional,
};
checksVoidReturn = parseChecksVoidReturn(checksVoidReturn);
const voidReturnChecks = checksVoidReturn
? {
...(checksVoidReturn.arguments && {
CallExpression: checkArguments,
NewExpression: checkArguments,
}),
...(checksVoidReturn.attributes && {
JSXAttribute: checkJSXAttribute,
}),
...(checksVoidReturn.inheritedMethods && {
ClassDeclaration: checkClassLikeOrInterfaceNode,
ClassExpression: checkClassLikeOrInterfaceNode,
TSInterfaceDeclaration: checkClassLikeOrInterfaceNode,
}),
...(checksVoidReturn.properties && {
Property: checkProperty,
}),
...(checksVoidReturn.returns && {
ReturnStatement: checkReturnStatement,
}),
...(checksVoidReturn.variables && {
AssignmentExpression: checkAssignment,
VariableDeclarator: checkVariableDeclaration,
}),
}
: {};
const spreadChecks = {
SpreadElement: checkSpread,
};
/**
* A syntactic check to see if an annotated type is maybe a function type.
* This is a perf optimization to help avoid requesting types where possible
*/
function isPossiblyFunctionType(node) {
switch (node.typeAnnotation.type) {
case utils_1.AST_NODE_TYPES.TSConditionalType:
case utils_1.AST_NODE_TYPES.TSConstructorType:
case utils_1.AST_NODE_TYPES.TSFunctionType:
case utils_1.AST_NODE_TYPES.TSImportType:
case utils_1.AST_NODE_TYPES.TSIndexedAccessType:
case utils_1.AST_NODE_TYPES.TSInferType:
case utils_1.AST_NODE_TYPES.TSIntersectionType:
case utils_1.AST_NODE_TYPES.TSQualifiedName:
case utils_1.AST_NODE_TYPES.TSThisType:
case utils_1.AST_NODE_TYPES.TSTypeOperator:
case utils_1.AST_NODE_TYPES.TSTypeQuery:
case utils_1.AST_NODE_TYPES.TSTypeReference:
case utils_1.AST_NODE_TYPES.TSUnionType:
return true;
case utils_1.AST_NODE_TYPES.TSTypeLiteral:
return node.typeAnnotation.members.some(member => member.type === utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration ||
member.type === utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration);
case utils_1.AST_NODE_TYPES.TSAbstractKeyword:
case utils_1.AST_NODE_TYPES.TSAnyKeyword:
case utils_1.AST_NODE_TYPES.TSArrayType:
case utils_1.AST_NODE_TYPES.TSAsyncKeyword:
case utils_1.AST_NODE_TYPES.TSBigIntKeyword:
case utils_1.AST_NODE_TYPES.TSBooleanKeyword:
case utils_1.AST_NODE_TYPES.TSDeclareKeyword:
case utils_1.AST_NODE_TYPES.TSExportKeyword:
case utils_1.AST_NODE_TYPES.TSIntrinsicKeyword:
case utils_1.AST_NODE_TYPES.TSLiteralType:
case utils_1.AST_NODE_TYPES.TSMappedType:
case utils_1.AST_NODE_TYPES.TSNamedTupleMember:
case utils_1.AST_NODE_TYPES.TSNeverKeyword:
case utils_1.AST_NODE_TYPES.TSNullKeyword:
case utils_1.AST_NODE_TYPES.TSNumberKeyword:
case utils_1.AST_NODE_TYPES.TSObjectKeyword:
case utils_1.AST_NODE_TYPES.TSOptionalType:
case utils_1.AST_NODE_TYPES.TSPrivateKeyword:
case utils_1.AST_NODE_TYPES.TSProtectedKeyword:
case utils_1.AST_NODE_TYPES.TSPublicKeyword:
case utils_1.AST_NODE_TYPES.TSReadonlyKeyword:
case utils_1.AST_NODE_TYPES.TSRestType:
case utils_1.AST_NODE_TYPES.TSStaticKeyword:
case utils_1.AST_NODE_TYPES.TSStringKeyword:
case utils_1.AST_NODE_TYPES.TSSymbolKeyword:
case utils_1.AST_NODE_TYPES.TSTemplateLiteralType:
case utils_1.AST_NODE_TYPES.TSTupleType:
case utils_1.AST_NODE_TYPES.TSTypePredicate:
case utils_1.AST_NODE_TYPES.TSUndefinedKeyword:
case utils_1.AST_NODE_TYPES.TSUnknownKeyword:
case utils_1.AST_NODE_TYPES.TSVoidKeyword:
return false;
}
}
function checkTestConditional(node) {
if (node.test) {
checkConditional(node.test, true);
}
}
/**
* This function analyzes the type of a node and checks if it is a Promise in a boolean conditional.
* It uses recursion when checking nested logical operators.
* @param node The AST node to check.
* @param isTestExpr Whether the node is a descendant of a test expression.
*/
function checkConditional(node, isTestExpr = false) {
// prevent checking the same node multiple times
if (checkedNodes.has(node)) {
return;
}
checkedNodes.add(node);
if (node.type === utils_1.AST_NODE_TYPES.LogicalExpression) {
// ignore the left operand for nullish coalescing expressions not in a context of a test expression
if (node.operator !== '??' || isTestExpr) {
checkConditional(node.left, isTestExpr);
}
// we ignore the right operand when not in a context of a test expression
if (isTestExpr) {
checkConditional(node.right, isTestExpr);
}
return;
}
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
if (isAlwaysThenable(checker, tsNode)) {
context.report({
node,
messageId: 'conditional',
});
}
}
function checkArrayPredicates(node) {
const parent = node.parent;
if (parent.type === utils_1.AST_NODE_TYPES.CallExpression) {
const callback = parent.arguments.at(0);
if (callback &&
(0, util_1.isArrayMethodCallWithPredicate)(context, services, parent)) {
const type = services.esTreeNodeToTSNodeMap.get(callback);
if (returnsThenable(checker, type)) {
context.report({
node: callback,
messageId: 'predicate',
});
}
}
}
}
function checkArguments(node) {
if (node.type === utils_1.AST_NODE_TYPES.CallExpression &&
isPromiseFinallyMethod(node)) {
return;
}
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
const voidArgs = voidFunctionArguments(checker, tsNode);
if (voidArgs.size === 0) {
return;
}
for (const [index, argument] of node.arguments.entries()) {
if (!voidArgs.has(index)) {
continue;
}
const tsNode = services.esTreeNodeToTSNodeMap.get(argument);
if (returnsThenable(checker, tsNode)) {
context.report({
node: argument,
messageId: 'voidReturnArgument',
});
}
}
}
function checkAssignment(node) {
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
const varType = services.getTypeAtLocation(node.left);
if (!isVoidReturningFunctionType(checker, tsNode.left, varType)) {
return;
}
if (returnsThenable(checker, tsNode.right)) {
context.report({
node: node.right,
messageId: 'voidReturnVariable',
});
}
}
function checkVariableDeclaration(node) {
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
if (tsNode.initializer == null ||
node.init == null ||
node.id.typeAnnotation == null) {
return;
}
// syntactically ignore some known-good cases to avoid touching type info
if (!isPossiblyFunctionType(node.id.typeAnnotation)) {
return;
}
const varType = services.getTypeAtLocation(node.id);
if (!isVoidReturningFunctionType(checker, tsNode.initializer, varType)) {
return;
}
if (returnsThenable(checker, tsNode.initializer)) {
context.report({
node: node.init,
messageId: 'voidReturnVariable',
});
}
}
function checkProperty(node) {
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
if (ts.isPropertyAssignment(tsNode)) {
const contextualType = checker.getContextualType(tsNode.initializer);
if (contextualType != null &&
isVoidReturningFunctionType(checker, tsNode.initializer, contextualType) &&
returnsThenable(checker, tsNode.initializer)) {
if ((0, util_1.isFunction)(node.value)) {
const functionNode = node.value;
if (functionNode.returnType) {
context.report({
node: functionNode.returnType.typeAnnotation,
messageId: 'voidReturnProperty',
});
}
else {
context.report({
loc: (0, util_1.getFunctionHeadLoc)(functionNode, context.sourceCode),
messageId: 'voidReturnProperty',
});
}
}
else {
context.report({
node: node.value,
messageId: 'voidReturnProperty',
});
}
}
}
else if (ts.isShorthandPropertyAssignment(tsNode)) {
const contextualType = checker.getContextualType(tsNode.name);
if (contextualType != null &&
isVoidReturningFunctionType(checker, tsNode.name, contextualType) &&
returnsThenable(checker, tsNode.name)) {
context.report({
node: node.value,
messageId: 'voidReturnProperty',
});
}
}
else if (ts.isMethodDeclaration(tsNode)) {
if (ts.isComputedPropertyName(tsNode.name)) {
return;
}
const obj = tsNode.parent;
// Below condition isn't satisfied unless something goes wrong,
// but is needed for type checking.
// 'node' does not include class method declaration so 'obj' is
// always an object literal expression, but after converting 'node'
// to TypeScript AST, its type includes MethodDeclaration which
// does include the case of class method declaration.
if (!ts.isObjectLiteralExpression(obj)) {
return;
}
if (!returnsThenable(checker, tsNode)) {
return;
}
const objType = checker.getContextualType(obj);
if (objType == null) {
return;
}
const propertySymbol = tsutils
.unionConstituents(objType)
.map(t => checker.getPropertyOfType(t, tsNode.name.getText()))
.find(p => p);
if (propertySymbol == null) {
return;
}
const contextualType = checker.getTypeOfSymbolAtLocation(propertySymbol, tsNode.name);
if (isVoidReturningFunctionType(checker, tsNode.name, contextualType)) {
const functionNode = node.value;
if (functionNode.returnType) {
context.report({
node: functionNode.returnType.typeAnnotation,
messageId: 'voidReturnProperty',
});
}
else {
context.report({
loc: (0, util_1.getFunctionHeadLoc)(functionNode, context.sourceCode),
messageId: 'voidReturnProperty',
});
}
}
return;
}
}
function checkReturnStatement(node) {
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
if (tsNode.expression == null || node.argument == null) {
return;
}
// syntactically ignore some known-good cases to avoid touching type info
const functionNode = (() => {
let current = node.parent;
while (current && !(0, util_1.isFunction)(current)) {
current = current.parent;
}
return (0, util_1.nullThrows)(current, util_1.NullThrowsReasons.MissingParent);
})();
if (functionNode.returnType &&
!isPossiblyFunctionType(functionNode.returnType)) {
return;
}
const contextualType = checker.getContextualType(tsNode.expression);
if (contextualType != null &&
isVoidReturningFunctionType(checker, tsNode.expression, contextualType) &&
returnsThenable(checker, tsNode.expression)) {
context.report({
node: node.argument,
messageId: 'voidReturnReturnValue',
});
}
}
function isPromiseFinallyMethod(node) {
const promiseFinallyCall = (0, promiseUtils_1.parseFinallyCall)(node, context);
return (promiseFinallyCall != null &&
(0, util_1.isPromiseLike)(services.program, (0, util_1.getConstrainedTypeAtLocation)(services, promiseFinallyCall.object)));
}
function checkClassLikeOrInterfaceNode(node) {
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
const heritageTypes = getHeritageTypes(checker, tsNode);
if (!heritageTypes?.length) {
return;
}
for (const nodeMember of tsNode.members) {
const memberName = nodeMember.name?.getText();
if (memberName == null) {
// Call/construct/index signatures don't have names. TS allows call signatures to mismatch,
// and construct signatures can't be async.
// TODO - Once we're able to use `checker.isTypeAssignableTo` (v8), we can check an index
// signature here against its compatible index signatures in `heritageTypes`
continue;
}
if (!returnsThenable(checker, nodeMember)) {
continue;
}
const node = services.tsNodeToESTreeNodeMap.get(nodeMember);
if (isStaticMember(node)) {
continue;
}
for (const heritageType of heritageTypes) {
checkHeritageTypeForMemberReturningVoid(nodeMember, heritageType, memberName);
}
}
}
/**
* Checks `heritageType` for a member named `memberName` that returns void; reports the
* 'voidReturnInheritedMethod' message if found.
* @param nodeMember Node member that returns a Promise
* @param heritageType Heritage type to check against
* @param memberName Name of the member to check for
*/
function checkHeritageTypeForMemberReturningVoid(nodeMember, heritageType, memberName) {
const heritageMember = getMemberIfExists(heritageType, memberName);
if (heritageMember == null) {
return;
}
const memberType = checker.getTypeOfSymbolAtLocation(heritageMember, nodeMember);
if (!isVoidReturningFunctionType(checker, nodeMember, memberType)) {
return;
}
context.report({
node: services.tsNodeToESTreeNodeMap.get(nodeMember),
messageId: 'voidReturnInheritedMethod',
data: { heritageTypeName: checker.typeToString(heritageType) },
});
}
function checkJSXAttribute(node) {
if (node.value?.type !== utils_1.AST_NODE_TYPES.JSXExpressionContainer) {
return;
}
const expressionContainer = services.esTreeNodeToTSNodeMap.get(node.value);
const expression = services.esTreeNodeToTSNodeMap.get(node.value.expression);
const contextualType = checker.getContextualType(expressionContainer);
if (contextualType != null &&
isVoidReturningFunctionType(checker, expressionContainer, contextualType) &&
returnsThenable(checker, expression)) {
context.report({
node: node.value,
messageId: 'voidReturnAttribute',
});
}
}
function checkSpread(node) {
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
if (isSometimesThenable(checker, tsNode.expression)) {
context.report({
node: node.argument,
messageId: 'spread',
});
}
}
return {
...(checksConditionals ? conditionalChecks : {}),
...(checksVoidReturn ? voidReturnChecks : {}),
...(checksSpreads ? spreadChecks : {}),
};
},
});
function isSometimesThenable(checker, node) {
const type = checker.getTypeAtLocation(node);
for (const subType of tsutils.unionConstituents(checker.getApparentType(type))) {
if (tsutils.isThenableType(checker, node, subType)) {
return true;
}
}
return false;
}
// Variation on the thenable check which requires all forms of the type (read:
// alternates in a union) to be thenable. Otherwise, you might be trying to
// check if something is defined or undefined and get caught because one of the
// branches is thenable.
function isAlwaysThenable(checker, node) {
const type = checker.getTypeAtLocation(node);
for (const subType of tsutils.unionConstituents(checker.getApparentType(type))) {
const thenProp = subType.getProperty('then');
// If one of the alternates has no then property, it is not thenable in all
// cases.
if (thenProp == null) {
return false;
}
// We walk through each variation of the then property. Since we know it
// exists at this point, we just need at least one of the alternates to
// be of the right form to consider it thenable.
const thenType = checker.getTypeOfSymbolAtLocation(thenProp, node);
let hasThenableSignature = false;
for (const subType of tsutils.unionConstituents(thenType)) {
for (const signature of subType.getCallSignatures()) {
if (signature.parameters.length !== 0 &&
isFunctionParam(checker, signature.parameters[0], node)) {
hasThenableSignature = true;
break;
}
}
// We only need to find one variant of the then property that has a
// function signature for it to be thenable.
if (hasThenableSignature) {
break;
}
}
// If no flavors of the then property are thenable, we don't consider the
// overall type to be thenable
if (!hasThenableSignature) {
return false;
}
}
// If all variants are considered thenable (i.e. haven't returned false), we
// consider the overall type thenable
return true;
}
function isFunctionParam(checker, param, node) {
const type = checker.getApparentType(checker.getTypeOfSymbolAtLocation(param, node));
for (const subType of tsutils.unionConstituents(type)) {
if (subType.getCallSignatures().length !== 0) {
return true;
}
}
return false;
}
function checkThenableOrVoidArgument(checker, node, type, index, thenableReturnIndices, voidReturnIndices) {
if (isThenableReturningFunctionType(checker, node.expression, type)) {
thenableReturnIndices.add(index);
}
else if (isVoidReturningFunctionType(checker, node.expression, type) &&
// If a certain argument accepts both thenable and void returns,
// a promise-returning function is valid
!thenableReturnIndices.has(index)) {
voidReturnIndices.add(index);
}
const contextualType = checker.getContextualTypeForArgumentAtIndex(node, index);
if (contextualType !== type) {
checkThenableOrVoidArgument(checker, node, contextualType, index, thenableReturnIndices, voidReturnIndices);
}
}
// Get the positions of arguments which are void functions (and not also
// thenable functions). These are the candidates for the void-return check at
// the current call site.
// If the function parameters end with a 'rest' parameter, then we consider
// the array type parameter (e.g. '...args:Array<SomeType>') when determining
// if trailing arguments are candidates.
function voidFunctionArguments(checker, node) {
// 'new' can be used without any arguments, as in 'let b = new Object;'
// In this case, there are no argument positions to check, so return early.
if (!node.arguments) {
return new Set();
}
const thenableReturnIndices = new Set();
const voidReturnIndices = new Set();
const type = checker.getTypeAtLocation(node.expression);
// We can't use checker.getResolvedSignature because it prefers an early '() => void' over a later '() => Promise<void>'
// See https://github.com/microsoft/TypeScript/issues/48077
for (const subType of tsutils.unionConstituents(type)) {
// Standard function calls and `new` have two different types of signatures
const signatures = ts.isCallExpression(node)
? subType.getCallSignatures()
: subType.getConstructSignatures();
for (const signature of signatures) {
for (const [index, parameter] of signature.parameters.entries()) {
const decl = parameter.valueDeclaration;
let type = checker.getTypeOfSymbolAtLocation(parameter, node.expression);
// If this is a array 'rest' parameter, check all of the argument indices
// from the current argument to the end.
if (decl && (0, util_1.isRestParameterDeclaration)(decl)) {
if (checker.isArrayType(type)) {
// Unwrap 'Array<MaybeVoidFunction>' to 'MaybeVoidFunction',
// so that we'll handle it in the same way as a non-rest
// 'param: MaybeVoidFunction'
type = checker.getTypeArguments(type)[0];
for (let i = index; i < node.arguments.length; i++) {
checkThenableOrVoidArgument(checker, node, type, i, thenableReturnIndices, voidReturnIndices);
}
}
else if (checker.isTupleType(type)) {
// Check each type in the tuple - for example, [boolean, () => void] would
// add the index of the second tuple parameter to 'voidReturnIndices'
const typeArgs = checker.getTypeArguments(type);
for (let i = index; i < node.arguments.length && i - index < typeArgs.length; i++) {
checkThenableOrVoidArgument(checker, node, typeArgs[i - index], i, thenableReturnIndices, voidReturnIndices);
}
}
}
else {
checkThenableOrVoidArgument(checker, node, type, index, thenableReturnIndices, voidReturnIndices);
}
}
}
}
for (const index of thenableReturnIndices) {
voidReturnIndices.delete(index);
}
return voidReturnIndices;
}
/**
* @returns Whether any call signature of the type has a thenable return type.
*/
function anySignatureIsThenableType(checker, node, type) {
for (const signature of type.getCallSignatures()) {
const returnType = signature.getReturnType();
if (tsutils.isThenableType(checker, node, returnType)) {
return true;
}
}
return false;
}
/**
* @returns Whether type is a thenable-returning function.
*/
function isThenableReturningFunctionType(checker, node, type) {
for (const subType of tsutils.unionConstituents(type)) {
if (anySignatureIsThenableType(checker, node, subType)) {
return true;
}
}
return false;
}
/**
* @returns Whether type is a void-returning function.
*/
function isVoidReturningFunctionType(checker, node, type) {
let hadVoidReturn = false;
for (const subType of tsutils.unionConstituents(type)) {
for (const signature of subType.getCallSignatures()) {
const returnType = signature.getReturnType();
// If a certain positional argument accepts both thenable and void returns,
// a promise-returning function is valid
if (tsutils.isThenableType(checker, node, returnType)) {
return false;
}
hadVoidReturn ||= tsutils.isTypeFlagSet(returnType, ts.TypeFlags.Void);
}
}
return hadVoidReturn;
}
/**
* @returns Whether expression is a function that returns a thenable.
*/
function returnsThenable(checker, node) {
const type = checker.getApparentType(checker.getTypeAtLocation(node));
return tsutils
.unionConstituents(type)
.some(t => anySignatureIsThenableType(checker, node, t));
}
function getHeritageTypes(checker, tsNode) {
return tsNode.heritageClauses
?.flatMap(clause => clause.types)
.map(typeExpression => checker.getTypeAtLocation(typeExpression));
}
/**
* @returns The member with the given name in `type`, if it exists.
*/
function getMemberIfExists(type, memberName) {
const escapedMemberName = ts.escapeLeadingUnderscores(memberName);
const symbolMemberMatch = type.getSymbol()?.members?.get(escapedMemberName);
return (symbolMemberMatch ?? tsutils.getPropertyOfType(type, escapedMemberName));
}
function isStaticMember(node) {
return ((node.type === utils_1.AST_NODE_TYPES.MethodDefinition ||
node.type === utils_1.AST_NODE_TYPES.PropertyDefinition ||
node.type === utils_1.AST_NODE_TYPES.AccessorProperty) &&
node.static);
}
@@ -0,0 +1,17 @@
import { isControllingVariants, isVariantLabel } from 'motion-dom';
function getCurrentTreeVariants(props, context) {
if (isControllingVariants(props)) {
const { initial, animate } = props;
return {
initial: initial === false || isVariantLabel(initial)
? initial
: undefined,
animate: isVariantLabel(animate) ? animate : undefined,
};
}
return props.inherit !== false ? context : {};
}
export { getCurrentTreeVariants };
//# sourceMappingURL=utils.mjs.map
@@ -0,0 +1,41 @@
import {OrderedMap} from 'immutable';
import {SassList} from './list';
import {Value} from './index';
/**
* Sass's [map type](https://sass-lang.com/documentation/values/maps).
*
* @category Custom Function
*/
export class SassMap extends Value {
/**
* Creates a new map.
*
* @param contents - The contents of the map. This is an immutable
* `OrderedMap` from the [`immutable` package](https://immutable-js.com/).
* Defaults to an empty map.
*/
constructor(contents?: OrderedMap<Value, Value>);
/**
* Returns the contents of this map as an immutable {@link OrderedMap} from the
* [`immutable` package](https://immutable-js.com/).
*/
get contents(): OrderedMap<Value, Value>;
/**
* Returns the value associated with `key` in this map, or `undefined` if
* `key` isn't in the map.
*
* This is a shorthand for `this.contents.get(key)`, although it may be more
* efficient in some cases.
*/
get(key: Value): Value | undefined;
/** Inherited from {@link Value.get}. */
get(index: number): SassList | undefined;
/** @hidden */
tryMap(): SassMap;
}
@@ -0,0 +1,55 @@
{
"name": "undici-types",
"version": "7.24.6",
"description": "A stand-alone types package for Undici",
"homepage": "https://undici.nodejs.org",
"bugs": {
"url": "https://github.com/nodejs/undici/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nodejs/undici.git"
},
"license": "MIT",
"types": "index.d.ts",
"files": [
"*.d.ts"
],
"contributors": [
{
"name": "Daniele Belardi",
"url": "https://github.com/dnlup",
"author": true
},
{
"name": "Ethan Arrowood",
"url": "https://github.com/ethan-arrowood",
"author": true
},
{
"name": "Matteo Collina",
"url": "https://github.com/mcollina",
"author": true
},
{
"name": "Matthew Aitken",
"url": "https://github.com/KhafraDev",
"author": true
},
{
"name": "Robert Nagy",
"url": "https://github.com/ronag",
"author": true
},
{
"name": "Szymon Marczak",
"url": "https://github.com/szmarczak",
"author": true
},
{
"name": "Tomas Della Vedova",
"url": "https://github.com/delvedor",
"author": true
}
]
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_5O","2":"_uL"},C:{"1":"_UL _p","2":"_bB _IK _L"},D:{"1":"_H _LL _bH _l","2":"_v _II"},E:{"1":"_uC","2":"_BH"},F:{"1":"_wN _RR","2":"_8 _sD W _O"},G:{"1":"_7B","2":"_XE"},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:{"2":"bC"},P:{"1":"_GB IE","2":"_AP eC"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:5,C:"CSS font-palette",D:true};
@@ -0,0 +1,18 @@
import { assignRef } from './assignRef';
import { createCallbackRef } from './createRef';
/**
* Merges two or more refs together providing a single interface to set their value
* @param {RefObject|Ref} refs
* @returns {MutableRefObject} - a new ref, which translates all changes to {refs}
*
* @see {@link useMergeRefs} to be used in ReactComponents
* @example
* const Component = React.forwardRef((props, ref) => {
* const ownRef = useRef();
* const domRef = mergeRefs([ref, ownRef]); // 👈 merge together
* return <div ref={domRef}>...</div>
* }
*/
export function mergeRefs(refs) {
return createCallbackRef((newValue) => refs.forEach((ref) => assignRef(ref, newValue)));
}
@@ -0,0 +1,657 @@
import { createControlledPromise, isPromise } from "./utils.js";
import { invariant } from "./invariant.js";
import { isNotFound } from "./not-found.js";
import { rootRouteId } from "./root.js";
import { isRedirect } from "./redirect.js";
import { isServer } from "@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 (!isRedirect(err) && !isNotFound(err)) return;
if (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: isRedirect(err) ? "redirected" : isNotFound(err) ? "notFound" : prev.status === "pending" ? "success" : prev.status,
context: buildMatchContext(inner, match.index),
isFetching: false,
error: err
}));
if (isNotFound(err) && !err.routeId) err.routeId = match.routeId;
match._nonReactive.loadPromise?.resolve();
}
if (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 (!(isServer ?? inner.router.isServer) && match._nonReactive.dehydrated) return true;
if ((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 && !isRedirect(err) && !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 === 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 (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 && !(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 = 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 = 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 (isRedirect(beforeLoadContext) || 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 (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 (isServer ?? inner.router.isServer) {
const maybePromise = isBeforeLoadSsr(inner, matchId, index, route);
if (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 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 (!(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 && 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 (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 (!isRedirect(error) && !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 (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 (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 = 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 (!(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 (isPromise(beforeLoad)) await beforeLoad;
} catch (err) {
if (isRedirect(err)) throw err;
if (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 (isRedirect(reason)) throw reason;
if (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");
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 (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
export { loadMatches, loadRouteChunk, routeNeedsPreload };
//# sourceMappingURL=load-matches.js.map
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const code_1 = require("../code");
const additionalItems_1 = require("./additionalItems");
const error = {
message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,
};
const def = {
keyword: "items",
type: "array",
schemaType: ["object", "boolean"],
before: "uniqueItems",
error,
code(cxt) {
const { schema, parentSchema, it } = cxt;
const { prefixItems } = parentSchema;
it.items = true;
if ((0, util_1.alwaysValidSchema)(it, schema))
return;
if (prefixItems)
(0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
else
cxt.ok((0, code_1.validateArray)(cxt));
},
};
exports.default = def;
//# sourceMappingURL=items2020.js.map
@@ -0,0 +1,24 @@
/**
* Checks if `value` is a valid array-like length.
*
* 校验是否是一个有效的数组长度
*
* @example
* ```js
* import { isLength } from 'is-what-type';
*
* isLength(3); // true
* isLength(0); // true
* isLength(Number.MIN_VALUE); // false
* isLength(Infinity); // false
* isLength(-1); // false
* isLength(3.5); // false
* isLength('3'); // false
* isLength(null); // false
* isLength(undefined); // false
* ```
*
* @param value - The value to check
* @returns `true` if `value` is a valid length, `false` otherwise
*/
export declare function isLength(value: unknown): value is number;
@@ -0,0 +1 @@
{"version":3,"file":"feedback.mjs","sources":["../../../src/matcher/spatial/feedback.ts"],"sourcesContent":[null],"names":["options","match","warning","translations","warnings","keyPattern","turns","straightRow","suggestions","longerKeyboardPattern"],"mappings":"AAGA,qBAAe,CAACA,OAAgB,EAAEC,KAAqB,KAAI;EACzD,IAAIC,OAAO,GAAGF,OAAO,CAACG,YAAY,CAACC,QAAQ,CAACC,UAAU;AACtD,EAAA,IAAIJ,KAAK,CAACK,KAAK,KAAK,CAAC,EAAE;AACrBJ,IAAAA,OAAO,GAAGF,OAAO,CAACG,YAAY,CAACC,QAAQ,CAACG,WAAW;AACrD,EAAA;EACA,OAAO;IACLL,OAAO;IACPM,WAAW,EAAE,CAACR,OAAO,CAACG,YAAY,CAACK,WAAW,CAACC,qBAAqB;GACrE;AACH,CAAC;;;;"}
@@ -0,0 +1,413 @@
export default `flf2a$ 4 3 20 -1 3
LockerGnome by Christopher Joseph Pirillo <pirillc2770@cobra.uni.edu>
Figletized by Simon Bradley <syb3@aber.ac.uk>
$$@
$$@
$$@
$$@@
::| @
\`:' @
+ @
@@
::| ::| @
\`\` \`\` @
@
@@
:|:| @
::==:| @
:|:| @
@@
.::|::\\@
\`::|::>@
\\::|:/ @
\` @@
:| ::/'@
::/ @
,::/ :|@
@@
/:::\\ @
\\:,:/_, @
:,,,\\_ @
@@
::| @
:/ @
@
@@
,:/ @
(:( @
\`:\\ @
@@
\\:, @
):) @
/:' @
@@
\\:|:/ @
--:-- @
/:|:\\ @
@@
::| @
::::::| @
::| @
@@
@
@
::| @
:/ @@
@
:::::| @
@
@@
@
@
::| @
@@
::/'@
::/ @
,::/ @
@@
,::::,@
: -- |@
\`::::'@
@@
::| @
:| @
:::| @
@@
::~~:\\@
,:/ @
/::::|@
@@
/:'\`:,@
|:< @
\\:,,:'@
@@
:| :| @
:::::|@
:| @
@@
:::::|@
\`:::\\ @
,:::/ @
@@
,::::\\@
::---,@
\`::::'@
@@
:::::/@
::/ @
::/ @
@@
,::::,@
>----<@
\`::::'@
@@
,::::,@
\\----|@
,::::'@
@@
@
::) @
::) @
@@
@
::) @
::| @
:/ @@
,:/ @
<:< @
\`:\\ @
@@
@
:::::| @
:::::| @
@@
\\:. @
>:> @
/:' @
@@
/:~~~:\\@
,:::/@
++ @
@@
/:::\\ @
\`\\__| ) @
\`\\:::/ @
@@
::::\\ @
::|,::|@
::| ::|@
@@
::::::\\@
::>-::<@
::::::/@
@@
,::::\\@
::| @
'::::/@
@@
::::::\\@
::| ::|@
::::::/@
@@
::::::|@
:::> @
::::::|@
@@
::::::|@
::::> @
::| @
@@
:::::\\@
::> ==@
:::::/@
@@
::| ::|@
::::::|@
::| ::|@
@@
::::::|@
::| @
::::::|@
@@
::|@
::> ::|@
::::/ @
@@
::| ::|@
:::::< @
::| ::|@
@@
::| @
::| @
::::::|@
@@
::::::|@
:::"::|@
::| ::|@
@@
::\\ ::|@
::::::|@
::| \\:|@
@@
::::\\ @
::| ::|@
::::/ @
@@
::::::\\@
::|_::|@
::|~~~ @
@@
::::\\ @
::|,::|@
:::::\\@
@@
::::::\\@
::|,::|@
::| ::\\@
@@
.:::::|@
\`:::::>@
,::::/ @
@@
::::::|@
::| @
::| @
@@
::| ::|@
::|_::|@
\`:::::|@
@@
::| ::|@
::::/ @
::/ @
@@
::| ::|@
:::"::|@
::::::|@
@@
::| ::|@
>:::< @
::| ::|@
@@
::| ::|@
::::/ @
::| @
@@
<::::\\@
,:::::/@
\`:::::>@
@@
::= @
:| @
::= @
@@
\`::\\ @
::\\ @
::\\,@
@@
=:| @
:| @
=:| @
@@
, @
/:\\ @
@
@@
@
@
::::::| @
@@
::|@
:|@
@
@@
@
.::\\ @
\`::| @
@@
:| @
::'| @
:::| @
@@
@
.::/ @
\`::\\ @
@@
:| @
:':| @
:::| @
@@
@
:~~/ @
:::, @
@@
,::| @
::| @
:| @
@@
@
/::| @
\\::| @
,.:/ @@
:| @
:::| @
:|:| @
@@
++ @
:| @
:| @
@@
++ @
, :| @
\\::/ @
@@
:| @
:|_/ @
:|~\\ @
@@
:| @
:| @
:| @
@@
@
:\\/| @
:::| @
@@
@
:::\\ @
:|:| @
@@
@
,::\\ @
\`::/ @
@@
@
:::\\ @
:::/ @
:| @@
@
/::| @
\\::| @
:| @@
@
:::| @
:| @
@@
@
<::< @
>::> @
@@
:| @
:::| @
:| @
@@
@
:\\:| @
\`::| @
@@
@
:\\:| @
:/ @
@@
@
:::| @
:/\\| @
@@
@
\\:/ @
/:\\ @
@@
@
:\\:| @
\`::| @
.,:' @@
@
>::> @
<::< @
@@
,:/ @
>= @
\`:\\ @
@@
::| @
- @
::| @
@@
\\:, @
=< @
/:' @
@@
,-:_, @
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
`
@@ -0,0 +1 @@
{"version":3,"names":["_arrayWithHoles","arr","Array","isArray"],"sources":["../../src/helpers/arrayWithHoles.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _arrayWithHoles<T>(arr: T[]) {\n if (Array.isArray(arr)) return arr;\n}\n"],"mappings":";;;;;;AAEe,SAASA,eAAeA,CAAIC,GAAQ,EAAE;EACnD,IAAIC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE,OAAOA,GAAG;AACpC","ignoreList":[]}
@@ -0,0 +1,85 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const code_1 = require("../code");
exports.error = {
message: ({ params: { property, depsCount, deps } }) => {
const property_ies = depsCount === 1 ? "property" : "properties";
return (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`;
},
params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._) `{property: ${property},
missingProperty: ${missingProperty},
depsCount: ${depsCount},
deps: ${deps}}`, // TODO change to reference
};
const def = {
keyword: "dependencies",
type: "object",
schemaType: "object",
error: exports.error,
code(cxt) {
const [propDeps, schDeps] = splitDependencies(cxt);
validatePropertyDeps(cxt, propDeps);
validateSchemaDeps(cxt, schDeps);
},
};
function splitDependencies({ schema }) {
const propertyDeps = {};
const schemaDeps = {};
for (const key in schema) {
if (key === "__proto__")
continue;
const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;
deps[key] = schema[key];
}
return [propertyDeps, schemaDeps];
}
function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
const { gen, data, it } = cxt;
if (Object.keys(propertyDeps).length === 0)
return;
const missing = gen.let("missing");
for (const prop in propertyDeps) {
const deps = propertyDeps[prop];
if (deps.length === 0)
continue;
const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);
cxt.setParams({
property: prop,
depsCount: deps.length,
deps: deps.join(", "),
});
if (it.allErrors) {
gen.if(hasProperty, () => {
for (const depProp of deps) {
(0, code_1.checkReportMissingProp)(cxt, depProp);
}
});
}
else {
gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);
(0, code_1.reportMissingProp)(cxt, missing);
gen.else();
}
}
}
exports.validatePropertyDeps = validatePropertyDeps;
function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
const { gen, data, keyword, it } = cxt;
const valid = gen.name("valid");
for (const prop in schemaDeps) {
if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))
continue;
gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => {
const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);
cxt.mergeValidEvaluated(schCxt, valid);
}, () => gen.var(valid, true) // TODO var
);
cxt.ok(valid);
}
}
exports.validateSchemaDeps = validateSchemaDeps;
exports.default = def;
//# sourceMappingURL=dependencies.js.map
@@ -0,0 +1,65 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseRecordDef = void 0;
const v3_1 = require("zod/v3");
const parseDef_js_1 = require("../parseDef.js");
const string_js_1 = require("./string.js");
const branded_js_1 = require("./branded.js");
const any_js_1 = require("./any.js");
function parseRecordDef(def, refs) {
if (refs.target === "openAi") {
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
}
if (refs.target === "openApi3" &&
def.keyType?._def.typeName === v3_1.ZodFirstPartyTypeKind.ZodEnum) {
return {
type: "object",
required: def.keyType._def.values,
properties: def.keyType._def.values.reduce((acc, key) => ({
...acc,
[key]: (0, parseDef_js_1.parseDef)(def.valueType._def, {
...refs,
currentPath: [...refs.currentPath, "properties", key],
}) ?? (0, any_js_1.parseAnyDef)(refs),
}), {}),
additionalProperties: refs.rejectedAdditionalProperties,
};
}
const schema = {
type: "object",
additionalProperties: (0, parseDef_js_1.parseDef)(def.valueType._def, {
...refs,
currentPath: [...refs.currentPath, "additionalProperties"],
}) ?? refs.allowedAdditionalProperties,
};
if (refs.target === "openApi3") {
return schema;
}
if (def.keyType?._def.typeName === v3_1.ZodFirstPartyTypeKind.ZodString &&
def.keyType._def.checks?.length) {
const { type, ...keyType } = (0, string_js_1.parseStringDef)(def.keyType._def, refs);
return {
...schema,
propertyNames: keyType,
};
}
else if (def.keyType?._def.typeName === v3_1.ZodFirstPartyTypeKind.ZodEnum) {
return {
...schema,
propertyNames: {
enum: def.keyType._def.values,
},
};
}
else if (def.keyType?._def.typeName === v3_1.ZodFirstPartyTypeKind.ZodBranded &&
def.keyType._def.type._def.typeName === v3_1.ZodFirstPartyTypeKind.ZodString &&
def.keyType._def.type._def.checks?.length) {
const { type, ...keyType } = (0, branded_js_1.parseBrandedDef)(def.keyType._def, refs);
return {
...schema,
propertyNames: keyType,
};
}
return schema;
}
exports.parseRecordDef = parseRecordDef;
@@ -0,0 +1 @@
{"version":3,"file":"linear.mjs","sources":["../../../../../src/animation/waapi/utils/linear.ts"],"sourcesContent":["import { EasingFunction } from \"motion-utils\"\n\nexport const generateLinearEasing = (\n easing: EasingFunction,\n duration: number, // as milliseconds\n resolution: number = 10 // as milliseconds\n): string => {\n let points = \"\"\n const numPoints = Math.max(Math.round(duration / resolution), 2)\n\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \"\n }\n\n return `linear(${points.substring(0, points.length - 2)})`\n}\n"],"names":[],"mappings":"MAEa,oBAAoB,GAAG,CAChC,MAAsB,EACtB,QAAgB;AAChB,UAAA,GAAqB,EAAE;KACf;IACR,IAAI,MAAM,GAAG,EAAE;AACf,IAAA,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;AAEhE,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;QAChC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI;IAC5E;AAEA,IAAA,OAAO,CAAA,OAAA,EAAU,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG;AAC9D;;;;"}
@@ -0,0 +1 @@
module.exports={C:{"59":0.01242,"115":0.06832,"120":0.57141,"121":1.14282,"122":0.00621,"123":0.01242,"124":0.02484,"125":0.01242,"128":0.01242,"130":0.00621,"131":0.00621,"132":0.00621,"133":0.00621,"134":0.00621,"135":0.00621,"136":0.01242,"138":0.00621,"139":0.00621,"140":0.08074,"141":0.00621,"142":0.00621,"143":0.00621,"144":0.00621,"146":0.01242,"147":0.01242,"148":0.00621,"149":0.00621,"150":0.02484,"151":0.01242,"152":0.01863,"153":0.03727,"154":0.18012,"155":0.53415,"156":0.54036,"157":0.01863,_:"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 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 108 109 110 111 112 113 114 116 117 118 119 126 127 129 137 145 158 159 160 3.5 3.6"},D:{"39":0.00621,"40":0.00621,"41":0.00621,"42":0.00621,"43":0.00621,"44":0.00621,"45":0.00621,"46":0.00621,"47":0.00621,"48":0.00621,"49":0.00621,"50":0.00621,"51":0.00621,"52":0.00621,"53":0.00621,"54":0.00621,"55":0.01242,"56":0.00621,"57":0.00621,"58":0.00621,"59":0.00621,"60":0.01242,"70":0.01242,"75":0.00621,"76":0.00621,"86":0.00621,"87":0.00621,"92":0.00621,"96":0.02484,"99":0.00621,"101":0.00621,"103":0.33539,"104":0.31055,"105":0.31055,"106":0.31055,"107":0.31055,"108":0.31055,"109":0.85091,"110":0.31055,"111":0.31055,"112":0.31055,"114":0.00621,"116":0.64594,"117":0.30434,"118":0.99997,"119":1.1304,"120":1.4658,"121":0.01863,"122":0.04348,"123":0.02484,"124":0.32918,"125":0.01863,"126":0.02484,"127":0.01242,"128":0.06211,"129":0.01242,"130":0.02484,"131":0.69563,"132":0.01863,"133":0.89438,"134":0.31676,"135":0.31055,"136":0.31676,"137":0.42235,"138":0.4534,"139":0.34782,"140":0.37887,"141":0.37887,"142":1.13661,"143":0.04969,"144":0.13043,"145":0.38508,"146":0.32297,"147":0.10559,"148":0.27328,"149":0.45961,"150":0.47204,"151":3.23593,"152":12.54622,"153":10.80093,"154":2.57135,"155":0.03727,_:"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 61 62 63 64 65 66 67 68 69 71 72 73 74 77 78 79 80 81 83 84 85 88 89 90 91 93 94 95 97 98 100 102 113 115 156 157"},F:{"54":0.00621,"56":0.00621,"95":0.01242,"101":0.00621,"105":0.01242,"106":0.01863,"107":0.00621,"114":0.00621,"115":0.00621,"116":0.00621,"119":0.00621,"120":0.00621,"121":0.00621,"122":0.00621,"133":0.00621,"134":0.46583,"135":1.73287,_:"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 55 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 96 97 98 99 100 102 103 104 108 109 110 111 112 113 117 118 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:{"92":0.01863,"109":0.01242,"119":0.5652,"120":0.57141,"122":0.01863,"123":0.00621,"124":0.00621,"131":0.00621,"132":0.00621,"133":0.00621,"136":0.00621,"137":0.00621,"138":0.00621,"139":0.00621,"140":0.01242,"141":0.00621,"142":0.00621,"143":0.01242,"144":0.01242,"145":0.02484,"146":0.01242,"147":0.02484,"148":0.03106,"149":0.02484,"150":0.09317,"151":0.22981,"152":2.3726,"153":2.67073,"154":0.67079,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 125 126 127 128 129 130 134 135"},E:{"27":0.09317,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 12.1 13.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 18.2 18.4 27.1 27.2 TP","11.1":0.01242,"14.1":0.01242,"15.6":0.00621,"16.6":0.01863,"17.1":0.01242,"17.2":0.00621,"17.3":0.00621,"17.4":0.00621,"17.5":0.00621,"17.6":0.03106,"18.0":0.00621,"18.1":0.00621,"18.3":0.00621,"18.5-18.7":0.00621,"26.0":0.00621,"26.1":0.00621,"26.2":0.01242,"26.3":0.01242,"26.4":0.01242,"26.5":0.08695,"26.6":0.34161},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00058,"5.0-5.1":0.00058,"6.0-6.1":0,"7.0-7.1":0.00116,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00578,"11.0-11.2":0.00058,"11.3-11.4":0.00116,"12.0-12.1":0,"12.2-12.5":0.01502,"13.0-13.1":0,"13.2":0.00289,"13.3":0,"13.4-13.7":0.00058,"14.0-14.4":0.00231,"14.5-14.8":0.00347,"15.0-15.1":0.00347,"15.2-15.3":0.00231,"15.4":0.00289,"15.5":0.00347,"15.6-15.8":0.0751,"16.0":0.00578,"16.1":0.0104,"16.2":0.00578,"16.3":0.01271,"16.4":0.00289,"16.5":0.00462,"16.6-16.7":0.10456,"17.0":0.00404,"17.1":0.00578,"17.2":0.00578,"17.3":0.00867,"17.4":0.01213,"17.5":0.02368,"17.6-17.7":0.06123,"18.0":0.01271,"18.1":0.02542,"18.2":0.03466,"18.3":0.06008,"18.4":0.03755,"18.5-18.7":0.77581,"26.0":0.03755,"26.1":0.03813,"26.2":0.09936,"26.3":0.10745,"26.4":0.07856,"26.5":0.52626,"26.6":3.24708,"27.0":0.24898,"27.1":0,"27.2":0.00635},P:{"23":0.00946,"25":0.00946,"26":0.03782,"27":0.00946,"28":0.02837,"29":0.03782,"30":1.0685,_:"4 20 21 22 24 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.0Line truncated
@@ -0,0 +1,717 @@
flf2a$ 7 7 16 -1 2
Relief by Nick Miners N.M.Miners@durham.ac.uk
June 1994
_____#
_____#
_____#
_____#
_____#
_____#
_____##
_____#
/~~\_#
/~~\_#
/~~\_#
_____#
/~~\_#
_____##
________#
/~\_/~\_#
/~\_/~\_#
________#
________#
________#
________##
____________#
__/~\_/~\___#
/~~~~~~~~~\_#
__/~\_/~\___#
/~~~~~~~~~\_#
__/~\_/~\___#
____________##
__________#
___/~~~~\_#
__/~~\____#
/~~~~~\___#
__/~~\____#
/~~~~~~~\_#
__________##
_________#
/~\_/~~\_#
___/~~\__#
__/~~\___#
_/~~\____#
/~~\_/~\_#
_________##
__________#
_/~~~~~\__#
/~~\______#
_/~~~~~~~\#
/~~\/~~\__#
_/~~~~~\__#
__________##
____#
/~\_#
/\__#
____#
____#
____#
____##
______#
_/~~\_#
/~~\__#
/~~\__#
/~~\__#
_/~~\_#
______##
______#
/~~\__#
_/~~\_#
_/~~\_#
_/~~\_#
/~~\__#
______##
__________#
___/~~\___#
/~\/~~\/~\#
_/~~~~~~\_#
/~\/~~\/~\#
___/~~\___#
__________##
___________#
___/~~\____#
___/~~\____#
/~~~~~~~~\_#
___/~~\____#
___/~~\____#
___________##
_____#
_____#
_____#
_____#
_____#
/~~\_#
/~\__##
__________#
__________#
__________#
/~~~~~~~\_#
__________#
__________#
__________##
_____#
_____#
_____#
_____#
_____#
/~~\_#
_____##
_________#
____/~~\_#
___/~~\__#
__/~~\___#
_/~~\____#
/~~\_____#
_________##
____________#
__/~~~~~\___#
_/~~\_/~~\__#
/~~\___/~~\_#
_/~~\_/~~\__#
__/~~~~~\___#
____________##
_________#
__/~~\___#
_/~~~\___#
__/~~\___#
__/~~\___#
/~~~~~~\_#
_________##
__________#
_/~~~~~~\_#
/~~\_/~~\_#
___/~~\___#
_/~~\_____#
/~~~~~~~\_#
__________##
__________#
_/~~~~~~\_#
/~~\_/~~\_#
___/~~~\__#
/~~\_/~~\_#
_/~~~~~~\_#
__________##
___________#
__/~~~~~\__#
_/~~\/~~\__#
/~~\_/~~\__#
/~~~~~~~~\_#
_____/~~\__#
___________##
_________#
/~~~~~~\_#
/~~\_____#
/~~~~~\__#
____/~~\_#
/~~~~~\__#
_________##
__________#
___/~~\___#
__/~~\____#
_/~~~~~\__#
/~~\_/~~\_#
_/~~~~~\__#
__________##
_________#
/~~~~~~\_#
___/~~\__#
__/~~\___#
_/~~\____#
/~~\_____#
_________##
__________#
_/~~~~~\__#
/~~\_/~~\_#
_/~~~~~\__#
/~~\_/~~\_#
_/~~~~~\__#
__________##
__________#
_/~~~~~\__#
/~~\_/~~\_#
_/~~~~~\__#
___/~~\___#
__/~~\____#
__________##
_____#
_____#
_____#
_/~~\#
_____#
_/~~\#
_____##
_____#
_____#
_____#
_/~~\#
_____#
_/~~\#
_/~\_##
_______#
__/~~\_#
_/~~\__#
/~~\___#
_/~~\__#
__/~~\_#
_______##
__________#
__________#
/~~~~~~~\_#
__________#
/~~~~~~~\_#
__________#
__________##
_______#
_/~~\__#
__/~~\_#
__/~~\_#
_/~~\__#
/~~\___#
_______##
_________#
_/~~~~\__#
____/~~\_#
___/~~\__#
_________#
___/~~\__#
_________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\/~~~~\_#
/~~\_______#
_/~~~~~~\__#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
___________##
___________#
/~~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~\__#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\_______#
/~~\__/~~\_#
_/~~~~~~\__#
___________##
___________#
/~~~~~~~\__#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
/~~~~~~~\__#
___________##
___________#
/~~~~~~~~\_#
/~~\_______#
/~~~~~~\___#
/~~\_______#
/~~~~~~~~\_#
___________##
___________#
/~~~~~~~~\_#
/~~\_______#
/~~~~~~\___#
/~~\_______#
/~~\_______#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\_______#
/~~\__/~~\_#
_/~~~~~~~\_#
______/~~\_##
___________#
/~~\__/~~\_#
/~~\__/~~\_#
/~~~~~~~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
___________##
_______#
/~~~~\_#
_/~~\__#
_/~~\__#
_/~~\__#
/~~~~\_#
_______##
_________#
__/~~~~\_#
___/~~\__#
___/~~\__#
___/~~\__#
/~~~~\___#
_________##
___________#
/~~\__/~~\_#
/~~\_/~~\__#
/~~~~~\____#
/~~\_/~~\__#
/~~\__/~~\_#
___________##
___________#
/~~\_______#
/~~\_______#
/~~\_______#
/~~\_______#
/~~~~~~~~\_#
___________##
___________#
/~~\__/~~\_#
/~~~\/~~~\_#
/~~~~~~~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
___________##
___________#
/~~\__/~~\_#
/~~~~\/~~\_#
/~~~~~~~~\_#
/~~\/~~~~\_#
/~~\__/~~\_#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
_/~~~~~~\__#
___________##
___________#
/~~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~\__#
/~~\_______#
/~~\_______#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\_/~~\__#
_/~~~~~~~\_#
___________##
___________#
/~~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~\__#
/~~\__/~~\_#
/~~\__/~~\_#
___________##
___________#
_/~~~~~~\__#
/~~\_______#
_/~~~~~~\__#
______/~~\_#
_/~~~~~~\__#
___________##
___________#
/~~~~~~~~\_#
___/~~\____#
___/~~\____#
___/~~\____#
___/~~\____#
___________##
___________#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
_/~~~~~~\__#
___________##
___________#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
_/~~\/~~\__#
__/~~~~\___#
___________##
_____________#
/~~\/~~\/~~\_#
/~~\/~~\/~~\_#
/~~\/~~\/~~\_#
/~~\/~~\/~~\_#
_/~~~~~~~~\__#
_____________##
___________#
/~~\__/~~\_#
_/~~\/~~\__#
__/~~~~\___#
_/~~\/~~\__#
/~~\__/~~\_#
___________##
___________#
/~~\__/~~\_#
_/~~\/~~\__#
__/~~~~\___#
___/~~\____#
___/~~\____#
___________##
___________#
/~~~~~~~~\_#
_____/~~\__#
___/~~\____#
_/~~\______#
/~~~~~~~~\_#
___________##
_______#
/~~~~\_#
/~~\___#
/~~\___#
/~~\___#
/~~~~\_#
_______##
_________#
/~~\_____#
_/~~\____#
__/~~\___#
___/~~\__#
____/~~\_#
_________##
_______#
/~~~~\_#
__/~~\_#
__/~~\_#
__/~~\_#
/~~~~\_#
_______##
___________#
____/\_____#
__/~~~~\___#
/~~\__/~~\_#
___________#
___________#
___________##
___________#
___________#
___________#
___________#
___________#
/~~~~~~~~\_#
___________##
____#
/~\_#
_/\_#
____#
____#
____#
____##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
___________##
___________#
/~~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~\__#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\_______#
/~~\__/~~\_#
_/~~~~~~\__#
___________##
___________#
/~~~~~~~\__#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
/~~~~~~~\__#
___________##
___________#
/~~~~~~~~\_#
/~~\_______#
/~~~~~~\___#
/~~\_______#
/~~~~~~~~\_#
___________##
___________#
/~~~~~~~~\_#
/~~\_______#
/~~~~~~\___#
/~~\_______#
/~~\_______#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\_______#
/~~\__/~~\_#
_/~~~~~~~\_#
______/~~\_##
___________#
/~~\__/~~\_#
/~~\__/~~\_#
/~~~~~~~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
___________##
_______#
/~~~~\_#
_/~~\__#
_/~~\__#
_/~~\__#
/~~~~\_#
_______##
_________#
__/~~~~\_#
___/~~\__#
___/~~\__#
___/~~\__#
/~~~~\___#
_________##
___________#
/~~\__/~~\_#
/~~\_/~~\__#
/~~~~~\____#
/~~\_/~~\__#
/~~\__/~~\_#
___________##
___________#
/~~\_______#
/~~\_______#
/~~\_______#
/~~\_______#
/~~~~~~~~\_#
___________##
___________#
/~~\__/~~\_#
/~~~\/~~~\_#
/~~~~~~~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
___________##
___________#
/~~\__/~~\_#
/~~~~\/~~\_#
/~~~~~~~~\_#
/~~\/~~~~\_#
/~~\__/~~\_#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
_/~~~~~~\__#
___________##
___________#
/~~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~\__#
/~~\_______#
/~~\_______#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\_/~~\__#
_/~~~~~~~\_#
___________##
___________#
/~~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~\__#
/~~\__/~~\_#
/~~\__/~~\_#
___________##
___________#
_/~~~~~~\__#
/~~\_______#
_/~~~~~~\__#
______/~~\_#
_/~~~~~~\__#
___________##
___________#
/~~~~~~~~\_#
___/~~\____#
___/~~\____#
___/~~\____#
___/~~\____#
___________##
___________#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
_/~~~~~~\__#
___________##
___________#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
_/~~\/~~\__#
__/~~~~\___#
___________##
_____________#
/~~\/~~\/~~\_#
/~~\/~~\/~~\_#
/~~\/~~\/~~\_#
/~~\/~~\/~~\_#
_/~~~~~~~~\__#
_____________##
___________#
/~~\__/~~\_#
_/~~\/~~\__#
__/~~~~\___#
_/~~\/~~\__#
/~~\__/~~\_#
___________##
___________#
/~~\__/~~\_#
_/~~\/~~\__#
__/~~~~\___#
___/~~\____#
___/~~\____#
___________##
___________#
/~~~~~~~~\_#
_____/~~\__#
___/~~\____#
_/~~\______#
/~~~~~~~~\_#
___________##
_________#
__/~~~~\_#
__/~~\___#
/~~~~\___#
__/~~\___#
__/~~~~\_#
_________##
_____#
/~~\_#
/~~\_#
/~~\_#
/~~\_#
/~~\_#
_____##
_________#
/~~~~\___#
__/~~\___#
__/~~~~\_#
__/~~\___#
/~~~~\___#
_________##
______________#
__/~~~\__/~~\_#
_/~~~~~~~~~\__#
/~~\__/~~~\___#
______________#
______________#
______________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
_/~~~~~~\__#
___________##
___________#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
_/~~~~~~\__#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~~~~~~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
_/~~~~~~\__#
___________##
___________#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
/~~\__/~~\_#
_/~~~~~~\__#
___________##
___________#
_/~~~~~~\__#
/~~\__/~~\_#
/~~\_/~~\__#
/~~\__/~~\_#
/~~\_/~~\__#
___________##
@@ -0,0 +1,16 @@
/**
* @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 Mouse = createLucideIcon("Mouse", [
["rect", { x: "5", y: "2", width: "14", height: "20", rx: "7", key: "11ol66" }],
["path", { d: "M12 6v4", key: "16clxf" }]
]);
export { Mouse as default };
//# sourceMappingURL=mouse.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_taggedTemplateLiteralLoose","strings","raw","slice"],"sources":["../../src/helpers/taggedTemplateLiteralLoose.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _taggedTemplateLiteralLoose(\n strings: readonly string[],\n raw?: readonly string[],\n): TemplateStringsArray {\n if (!raw) {\n raw = strings.slice(0);\n }\n // Loose: TemplateStringsArray['raw'] is readonly, so we have to cast it to any before assigning\n (strings as any).raw = raw;\n return strings as TemplateStringsArray;\n}\n"],"mappings":";;;;;;AAEe,SAASA,2BAA2BA,CACjDC,OAA0B,EAC1BC,GAAuB,EACD;EACtB,IAAI,CAACA,GAAG,EAAE;IACRA,GAAG,GAAGD,OAAO,CAACE,KAAK,CAAC,CAAC,CAAC;EACxB;EAECF,OAAO,CAASC,GAAG,GAAGA,GAAG;EAC1B,OAAOD,OAAO;AAChB","ignoreList":[]}
@@ -0,0 +1 @@
{"version":3,"file":"file-spreadsheet.js","sources":["../../../src/icons/file-spreadsheet.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileSpreadsheet\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMkg2YTIgMiAwIDAgMC0yIDJ2MTZhMiAyIDAgMCAwIDIgMmgxMmEyIDIgMCAwIDAgMi0yVjdaIiAvPgogIDxwYXRoIGQ9Ik0xNCAydjRhMiAyIDAgMCAwIDIgMmg0IiAvPgogIDxwYXRoIGQ9Ik04IDEzaDIiIC8+CiAgPHBhdGggZD0iTTE0IDEzaDIiIC8+CiAgPHBhdGggZD0iTTggMTdoMiIgLz4KICA8cGF0aCBkPSJNMTQgMTdoMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file-spreadsheet\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 FileSpreadsheet = createLucideIcon('FileSpreadsheet', [\n ['path', { d: 'M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z', key: '1rqfz7' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['path', { d: 'M8 13h2', key: 'yr2amv' }],\n ['path', { d: 'M14 13h2', key: 'un5t4a' }],\n ['path', { d: 'M8 17h2', key: '2yhykz' }],\n ['path', { d: 'M14 17h2', key: '10kma7' }],\n]);\n\nexport default FileSpreadsheet;\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,CAAA,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC3F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxD,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,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,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,18 @@
/**
* This is the Windows implementation of isexe, which uses the file
* extension and PATHEXT setting.
*
* @module
*/
import { IsexeOptions } from './options.js';
/**
* Determine whether a path is executable based on the file extension
* and PATHEXT environment variable (or specified pathExt option)
*/
export declare const isexe: (path: string, options?: IsexeOptions) => Promise<boolean>;
/**
* Synchronously determine whether a path is executable based on the file
* extension and PATHEXT environment variable (or specified pathExt option)
*/
export declare const sync: (path: string, options?: IsexeOptions) => boolean;
//# sourceMappingURL=win32.d.ts.map
@@ -0,0 +1,378 @@
import { S as SourceLocation, U as UserConfig, P as Plugin } from './types-CJYAW1ql.mjs';
import { V as Variant, C as Candidate } from './resolve-config-QUZ9b-Gn.mjs';
import './colors.mjs';
declare const enum ThemeOptions {
NONE = 0,
INLINE = 1,
REFERENCE = 2,
DEFAULT = 4,
STATIC = 8,
USED = 16
}
declare class Theme {
#private;
private values;
private keyframes;
prefix: string | null;
constructor(values?: Map<string, {
value: string;
options: ThemeOptions;
src: Declaration["src"];
}>, keyframes?: Set<AtRule>);
get size(): number;
add(key: string, value: string, options?: ThemeOptions, src?: Declaration['src']): void;
keysInNamespaces(themeKeys: Iterable<ThemeKey>): string[];
get(themeKeys: ThemeKey[]): string | null;
hasDefault(key: string): boolean;
getOptions(key: string): ThemeOptions;
entries(): IterableIterator<[string, {
value: string;
options: ThemeOptions;
src: Declaration["src"];
}]> | [string, {
value: string;
options: ThemeOptions;
src: Declaration["src"];
}][];
prefixKey(key: string): string;
clearNamespace(namespace: string, clearOptions: ThemeOptions): void;
markUsedVariable(themeKey: string): boolean;
resolve(candidateValue: string | null, themeKeys: ThemeKey[], options?: ThemeOptions): string | null;
resolveValue(candidateValue: string | null, themeKeys: ThemeKey[]): string | null;
resolveWith(candidateValue: string, themeKeys: ThemeKey[], nestedKeys?: `--${string}`[]): [string, Record<string, string>] | null;
namespace(namespace: string): Map<string | null, string>;
addKeyframes(value: AtRule): void;
getKeyframes(): AtRule[];
}
type ThemeKey = `--${string}`;
type VariantFn<T extends Variant['kind']> = (rule: Rule, variant: Extract<Variant, {
kind: T;
}>) => null | void;
type CompareFn = (a: Variant, z: Variant) => number;
declare const enum Compounds {
Never = 0,
AtRules = 1,
StyleRules = 2
}
declare class Variants {
compareFns: Map<number, CompareFn>;
variants: Map<string, {
kind: Variant["kind"];
order: number;
applyFn: VariantFn<any>;
compoundsWith: Compounds;
compounds: Compounds;
}>;
private completions;
/**
* Registering a group of variants should result in the same sort number for
* all the variants. This is to ensure that the variants are applied in the
* correct order.
*/
private groupOrder;
/**
* Keep track of the last sort order instead of using the size of the map to
* avoid unnecessarily skipping order numbers.
*/
private lastOrder;
static(name: string, applyFn: VariantFn<'static'>, { compounds, order }?: {
compounds?: Compounds;
order?: number;
}): void;
fromAst(name: string, ast: AstNode[], designSystem: DesignSystem): void;
functional(name: string, applyFn: VariantFn<'functional'>, { compounds, order }?: {
compounds?: Compounds;
order?: number;
}): void;
compound(name: string, compoundsWith: Compounds, applyFn: VariantFn<'compound'>, { compounds, order }?: {
compounds?: Compounds;
order?: number;
}): void;
group(fn: () => void, compareFn?: CompareFn): void;
has(name: string): boolean;
get(name: string): {
kind: Variant["kind"];
order: number;
applyFn: VariantFn<any>;
compoundsWith: Compounds;
compounds: Compounds;
} | undefined;
kind(name: string): "static" | "arbitrary" | "functional" | "compound";
compoundsWith(parent: string, child: string | Variant): boolean;
suggest(name: string, suggestions: () => string[]): void;
getCompletions(name: string): string[];
compare(a: Variant | null, z: Variant | null): number;
keys(): IterableIterator<string>;
entries(): IterableIterator<[string, {
kind: Variant["kind"];
order: number;
applyFn: VariantFn<any>;
compoundsWith: Compounds;
compounds: Compounds;
}]>;
private set;
private nextOrder;
}
declare function compileAstNodes(candidate: Candidate, designSystem: DesignSystem, flags: CompileAstFlags): {
node: AstNode;
propertySort: {
order: number[];
count: number;
};
}[];
interface CanonicalizeOptions {
/**
* The root font size in pixels. If provided, `rem` values will be normalized
* to `px` values.
*
* E.g.: `mt-[16px]` with `rem: 16` will become `mt-4` (assuming `--spacing: 0.25rem`).
*/
rem?: number;
/**
* Whether to collapse multiple utilities into a single utility if possible.
*
* E.g.: `mt-2 mr-2 mb-2 ml-2` → `m-2`
*/
collapse?: boolean;
/**
* Whether to convert between logical and physical properties when collapsing
* utilities.
*
* E.g.: `mr-2 ml-2` → `mx-2`
*/
logicalToPhysical?: boolean;
}
interface ClassMetadata {
modifiers: string[];
}
type ClassEntry = [string, ClassMetadata];
interface SelectorOptions {
modifier?: string;
value?: string;
}
interface VariantEntry {
name: string;
isArbitrary: boolean;
values: string[];
hasDash: boolean;
selectors: (options: SelectorOptions) => string[];
}
type CompileFn<T extends Candidate['kind']> = (value: Extract<Candidate, {
kind: T;
}>) => AstNode[] | undefined | null;
interface SuggestionGroup {
supportsNegative?: boolean;
values: (string | null)[];
modifiers: string[];
}
type UtilityOptions = {
types: string[];
};
type Utility = {
kind: 'static' | 'functional';
compileFn: CompileFn<any>;
options?: UtilityOptions;
};
declare class Utilities {
private utilities;
private completions;
static(name: string, compileFn: CompileFn<'static'>): void;
functional(name: string, compileFn: CompileFn<'functional'>, options?: UtilityOptions): void;
has(name: string, kind: 'static' | 'functional'): boolean;
get(name: string): Utility[];
getCompletions(name: string): SuggestionGroup[];
suggest(name: string, groups: () => SuggestionGroup[]): void;
keys(kind: 'static' | 'functional'): string[];
}
declare const enum CompileAstFlags {
None = 0,
RespectImportant = 1
}
type DesignSystem = {
theme: Theme;
utilities: Utilities;
variants: Variants;
invalidCandidates: Set<string>;
important: boolean;
getClassOrder(classes: string[]): [string, bigint | null][];
getClassList(): ClassEntry[];
getVariants(): VariantEntry[];
parseCandidate(candidate: string): Readonly<Candidate>[];
parseVariant(variant: string): Readonly<Variant> | null;
compileAstNodes(candidate: Candidate, flags?: CompileAstFlags): ReturnType<typeof compileAstNodes>;
printCandidate(candidate: Candidate): string;
printVariant(variant: Variant): string;
getVariantOrder(): Map<Variant, number>;
resolveThemeValue(path: string, forceInline?: boolean): string | undefined;
trackUsedVariables(raw: string): void;
canonicalizeCandidates(candidates: string[], options?: CanonicalizeOptions): string[];
candidatesToCss(classes: string[]): (string | null)[];
candidatesToAst(classes: string[]): AstNode[][];
storage: Record<symbol, unknown>;
};
type StyleRule = {
kind: 'rule';
selector: string;
nodes: AstNode[];
src?: SourceLocation;
dst?: SourceLocation;
};
type AtRule = {
kind: 'at-rule';
name: string;
params: string;
nodes: AstNode[];
src?: SourceLocation;
dst?: SourceLocation;
};
type Declaration = {
kind: 'declaration';
property: string;
value: string | undefined;
important: boolean;
src?: SourceLocation;
dst?: SourceLocation;
};
type Comment = {
kind: 'comment';
value: string;
src?: SourceLocation;
dst?: SourceLocation;
};
type Context = {
kind: 'context';
context: Record<string, string | boolean>;
nodes: AstNode[];
src?: undefined;
dst?: undefined;
};
type AtRoot = {
kind: 'at-root';
nodes: AstNode[];
src?: undefined;
dst?: undefined;
};
type Rule = StyleRule | AtRule;
type AstNode = StyleRule | AtRule | Declaration | Comment | Context | AtRoot;
/**
* Line offset tables are the key to generating our source maps. They allow us
* to store indexes with our AST nodes and later convert them into positions as
* when given the source that the indexes refer to.
*/
/**
* A position in source code
*
* https://tc39.es/ecma426/#sec-position-record-type
*/
interface Position {
/** The line number, one-based */
line: number;
/** The column/character number, one-based */
column: number;
}
interface OriginalPosition extends Position {
source: DecodedSource;
}
/**
* A "decoded" sourcemap
*
* @see https://tc39.es/ecma426/#decoded-source-map-record
*/
interface DecodedSourceMap {
file: string | null;
sources: DecodedSource[];
mappings: DecodedMapping[];
}
/**
* A "decoded" source
*
* @see https://tc39.es/ecma426/#decoded-source-record
*/
interface DecodedSource {
url: string | null;
content: string | null;
ignore: boolean;
}
/**
* A "decoded" mapping
*
* @see https://tc39.es/ecma426/#decoded-mapping-record
*/
interface DecodedMapping {
originalPosition: OriginalPosition | null;
generatedPosition: Position;
name: string | null;
}
type Config = UserConfig;
declare const enum Polyfills {
None = 0,
AtProperty = 1,
ColorMix = 2,
All = 3
}
type CompileOptions = {
base?: string;
from?: string;
polyfills?: Polyfills;
loadModule?: (id: string, base: string, resourceHint: 'plugin' | 'config') => Promise<{
path: string;
base: string;
module: Plugin | Config;
}>;
loadStylesheet?: (id: string, base: string) => Promise<{
path: string;
base: string;
content: string;
}>;
};
type Root = null | 'none' | {
base: string;
pattern: string;
};
declare const enum Features {
None = 0,
AtApply = 1,
AtImport = 2,
JsPluginCompat = 4,
ThemeFunction = 8,
Utilities = 16,
Variants = 32,
AtTheme = 64
}
declare function compileAst(input: AstNode[], opts?: CompileOptions): Promise<{
sources: {
base: string;
pattern: string;
negated: boolean;
}[];
root: Root;
features: Features;
build(candidates: string[]): AstNode[];
}>;
declare function compile(css: string, opts?: CompileOptions): Promise<{
sources: {
base: string;
pattern: string;
negated: boolean;
}[];
root: Root;
features: Features;
build(candidates: string[]): string;
buildSourceMap(): DecodedSourceMap;
}>;
declare function __unstable__loadDesignSystem(css: string, opts?: CompileOptions): Promise<DesignSystem>;
declare function postcssPluginWarning(): void;
export { type Config, type DecodedSourceMap, Features, Polyfills, __unstable__loadDesignSystem, compile, compileAst, postcssPluginWarning as default };
@@ -0,0 +1 @@
{"version":3,"file":"otpauth.node.min.cjs","sources":["../src/internal/encoding/uint.js","../src/internal/global-scope.js","../src/internal/crypto/hmac-digest.js","../src/internal/encoding/base32.js","../src/internal/encoding/hex.js","../src/internal/encoding/latin1.js","../src/internal/encoding/utf8.js","../src/secret.js","../src/internal/crypto/random-bytes.js","../src/hotp.js","../src/internal/crypto/timing-safe-equal.js","../src/totp.js","../src/uri.js","../src/version.js"],"sourcesContent":["/**\n * Converts an integer to an Uint8Array.\n * @param {number} num Integer.\n * @returns {Uint8Array} Uint8Array.\n */\nconst uintDecode = (num) => {\n const buf = new ArrayBuffer(8);\n const arr = new Uint8Array(buf);\n let acc = num;\n\n for (let i = 7; i >= 0; i--) {\n if (acc === 0) break;\n arr[i] = acc & 255;\n acc -= arr[i];\n acc /= 256;\n }\n\n return arr;\n};\n\n/**\n * Converts an Uint8Array to an integer.\n * @param {Uint8Array} arr Uint8Array.\n * @returns {number} Integer.\n */\nconst uintEncode = (arr) => {\n let num = 0;\n\n for (let i = 0; i < arr.length; i++) {\n num *= 256;\n num += arr[i];\n }\n\n return num;\n};\n\nexport { uintDecode, uintEncode };\n","/**\n * \"globalThis\" ponyfill.\n * @see [A horrifying globalThis polyfill in universal JavaScript](https://mathiasbynens.be/notes/globalthis)\n * @type {Object.<string, *>}\n */\nconst globalScope = (() => {\n if (typeof globalThis === \"object\") return globalThis;\n else {\n Object.defineProperty(Object.prototype, \"__GLOBALTHIS__\", {\n get() {\n return this;\n },\n configurable: true,\n });\n try {\n // @ts-expect-error\n // eslint-disable-next-line no-undef\n if (typeof __GLOBALTHIS__ !== \"undefined\") return __GLOBALTHIS__;\n } finally {\n // @ts-expect-error\n delete Object.prototype.__GLOBALTHIS__;\n }\n }\n\n // Still unable to determine \"globalThis\", fall back to a naive method.\n if (typeof self !== \"undefined\") return self;\n else if (typeof window !== \"undefined\") return window;\n else if (typeof global !== \"undefined\") return global;\n\n return undefined;\n})();\n\nexport { globalScope };\n","import * as crypto from \"node:crypto\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { sha1 } from \"@noble/hashes/legacy.js\";\nimport { sha224, sha256, sha384, sha512 } from \"@noble/hashes/sha2.js\";\nimport { sha3_224, sha3_256, sha3_384, sha3_512 } from \"@noble/hashes/sha3.js\";\nimport { globalScope } from \"../global-scope.js\";\n\n/**\n * @noble/hashes hash functions.\n * @type {Object.<string, sha1|sha224|sha256|sha384|sha512|sha3_224|sha3_256|sha3_384|sha3_512>}\n */\nconst nobleHashes = {\n SHA1: sha1,\n SHA224: sha224,\n SHA256: sha256,\n SHA384: sha384,\n SHA512: sha512,\n \"SHA3-224\": sha3_224,\n \"SHA3-256\": sha3_256,\n \"SHA3-384\": sha3_384,\n \"SHA3-512\": sha3_512,\n};\n\n/**\n * Canonicalizes a hash algorithm name.\n * @param {string} algorithm Hash algorithm name.\n * @returns {\"SHA1\"|\"SHA224\"|\"SHA256\"|\"SHA384\"|\"SHA512\"|\"SHA3-224\"|\"SHA3-256\"|\"SHA3-384\"|\"SHA3-512\"} Canonicalized hash algorithm name.\n */\nconst canonicalizeAlgorithm = (algorithm) => {\n switch (true) {\n case /^(?:SHA-?1|SSL3-SHA1)$/i.test(algorithm):\n return \"SHA1\";\n case /^SHA(?:2?-)?224$/i.test(algorithm):\n return \"SHA224\";\n case /^SHA(?:2?-)?256$/i.test(algorithm):\n return \"SHA256\";\n case /^SHA(?:2?-)?384$/i.test(algorithm):\n return \"SHA384\";\n case /^SHA(?:2?-)?512$/i.test(algorithm):\n return \"SHA512\";\n case /^SHA3-224$/i.test(algorithm):\n return \"SHA3-224\";\n case /^SHA3-256$/i.test(algorithm):\n return \"SHA3-256\";\n case /^SHA3-384$/i.test(algorithm):\n return \"SHA3-384\";\n case /^SHA3-512$/i.test(algorithm):\n return \"SHA3-512\";\n default:\n throw new TypeError(`Unknown hash algorithm: ${algorithm}`);\n }\n};\n\n/**\n * Calculates an HMAC digest.\n * @param {string} algorithm Algorithm.\n * @param {Uint8Array} key Key.\n * @param {Uint8Array} message Message.\n * @returns {Uint8Array} Digest.\n */\nconst hmacDigest = (algorithm, key, message) => {\n if (crypto?.createHmac) {\n const hmac = crypto.createHmac(algorithm, globalScope.Buffer.from(key));\n hmac.update(globalScope.Buffer.from(message));\n return hmac.digest();\n } else if (hmac) {\n const hash = nobleHashes[algorithm] ?? nobleHashes[canonicalizeAlgorithm(algorithm)];\n return hmac(hash, key, message);\n } else {\n throw new Error(\"Missing HMAC function\");\n }\n};\n\nexport { canonicalizeAlgorithm, hmacDigest };\n","/**\n * RFC 4648 base32 alphabet without pad.\n * @type {string}\n */\nconst ALPHABET = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\";\n\n/**\n * Converts a base32 string to an Uint8Array (RFC 4648).\n * @see [LinusU/base32-decode](https://github.com/LinusU/base32-decode)\n * @param {string} str Base32 Line truncated
@@ -0,0 +1,170 @@
declare var global: typeof globalThis;
declare var process: NodeJS.Process;
declare var console: Console;
interface ErrorConstructor {
/**
* Creates a `.stack` property on `targetObject`, which when accessed returns
* a string representing the location in the code at which
* `Error.captureStackTrace()` was called.
*
* ```js
* const myObject = {};
* Error.captureStackTrace(myObject);
* myObject.stack; // Similar to `new Error().stack`
* ```
*
* The first line of the trace will be prefixed with
* `${myObject.name}: ${myObject.message}`.
*
* The optional `constructorOpt` argument accepts a function. If given, all frames
* above `constructorOpt`, including `constructorOpt`, will be omitted from the
* generated stack trace.
*
* The `constructorOpt` argument is useful for hiding implementation
* details of error generation from the user. For instance:
*
* ```js
* function a() {
* b();
* }
*
* function b() {
* c();
* }
*
* function c() {
* // Create an error without stack trace to avoid calculating the stack trace twice.
* const { stackTraceLimit } = Error;
* Error.stackTraceLimit = 0;
* const error = new Error();
* Error.stackTraceLimit = stackTraceLimit;
*
* // Capture the stack trace above function b
* Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
* throw error;
* }
*
* a();
* ```
*/
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
/**
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
*/
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
/**
* The `Error.stackTraceLimit` property specifies the number of stack frames
* collected by a stack trace (whether generated by `new Error().stack` or
* `Error.captureStackTrace(obj)`).
*
* The default value is `10` but may be set to any valid JavaScript number. Changes
* will affect any stack trace captured _after_ the value has been changed.
*
* If set to a non-number value, or set to a negative number, stack traces will
* not capture any frames.
*/
stackTraceLimit: number;
}
/**
* Enable this API with the `--expose-gc` CLI flag.
*/
declare var gc: NodeJS.GCFunction | undefined;
declare namespace NodeJS {
interface CallSite {
getColumnNumber(): number | null;
getEnclosingColumnNumber(): number | null;
getEnclosingLineNumber(): number | null;
getEvalOrigin(): string | undefined;
getFileName(): string | null;
getFunction(): Function | undefined;
getFunctionName(): string | null;
getLineNumber(): number | null;
getMethodName(): string | null;
getPosition(): number;
getPromiseIndex(): number | null;
getScriptHash(): string;
getScriptNameOrSourceURL(): string | null;
getThis(): unknown;
getTypeName(): string | null;
isAsync(): boolean;
isConstructor(): boolean;
isEval(): boolean;
isNative(): boolean;
isPromiseAll(): boolean;
isToplevel(): boolean;
}
interface ErrnoException extends Error {
errno?: number | undefined;
code?: string | undefined;
path?: string | undefined;
syscall?: string | undefined;
}
interface ReadableStream extends EventEmitter {
readable: boolean;
read(size?: number): string | Buffer;
setEncoding(encoding: BufferEncoding): this;
pause(): this;
resume(): this;
isPaused(): boolean;
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
unpipe(destination?: WritableStream): this;
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
wrap(oldStream: ReadableStream): this;
[Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
}
interface WritableStream extends EventEmitter {
writable: boolean;
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
end(cb?: () => void): this;
end(data: string | Uint8Array, cb?: () => void): this;
end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
}
interface ReadWriteStream extends ReadableStream, WritableStream {}
interface RefCounted {
ref(): this;
unref(): this;
}
interface Dict<T> {
[key: string]: T | undefined;
}
interface ReadOnlyDict<T> {
readonly [key: string]: T | undefined;
}
type PartialOptions<T> = { [K in keyof T]?: T[K] | undefined };
interface GCFunction {
(minor?: boolean): void;
(options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;
(options: NodeJS.GCOptions): void;
}
interface GCOptions {
execution?: "sync" | "async" | undefined;
flavor?: "regular" | "last-resort" | undefined;
type?: "major-snapshot" | "major" | "minor" | undefined;
filename?: string | undefined;
}
/** An iterable iterator returned by the Node.js API. */
interface Iterator<T, TReturn = undefined, TNext = any> extends IteratorObject<T, TReturn, TNext> {
[Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
}
/** An async iterable iterator returned by the Node.js API. */
interface AsyncIterator<T, TReturn = undefined, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
[Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
}
}
@@ -0,0 +1,11 @@
"use client";
import { useContext } from 'react';
import { PresenceContext } from '../../context/PresenceContext.mjs';
function usePresenceData() {
const context = useContext(PresenceContext);
return context ? context.custom : undefined;
}
export { usePresenceData };
//# sourceMappingURL=use-presence-data.mjs.map
@@ -0,0 +1,107 @@
import * as z from 'zod/v4';
import express from 'express';
import cors from 'cors';
import { verifyChallenge } from 'pkce-challenge';
import { authenticateClient } from '../middleware/clientAuth.js';
import { rateLimit } from 'express-rate-limit';
import { allowedMethods } from '../middleware/allowedMethods.js';
import { InvalidRequestError, InvalidGrantError, UnsupportedGrantTypeError, ServerError, TooManyRequestsError, OAuthError } from '../errors.js';
const TokenRequestSchema = z.object({
grant_type: z.string()
});
const AuthorizationCodeGrantSchema = z.object({
code: z.string(),
code_verifier: z.string(),
redirect_uri: z.string().optional(),
resource: z.string().url().optional()
});
const RefreshTokenGrantSchema = z.object({
refresh_token: z.string(),
scope: z.string().optional(),
resource: z.string().url().optional()
});
export function tokenHandler({ provider, rateLimit: rateLimitConfig }) {
// Nested router so we can configure middleware and restrict HTTP method
const router = express.Router();
// Configure CORS to allow any origin, to make accessible to web-based MCP clients
router.use(cors());
router.use(allowedMethods(['POST']));
router.use(express.urlencoded({ extended: false }));
// Apply rate limiting unless explicitly disabled
if (rateLimitConfig !== false) {
router.use(rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 50, // 50 requests per windowMs
standardHeaders: true,
legacyHeaders: false,
message: new TooManyRequestsError('You have exceeded the rate limit for token requests').toResponseObject(),
...rateLimitConfig
}));
}
// Authenticate and extract client details
router.use(authenticateClient({ clientsStore: provider.clientsStore }));
router.post('/', async (req, res) => {
res.setHeader('Cache-Control', 'no-store');
try {
const parseResult = TokenRequestSchema.safeParse(req.body);
if (!parseResult.success) {
throw new InvalidRequestError(parseResult.error.message);
}
const { grant_type } = parseResult.data;
const client = req.client;
if (!client) {
// This should never happen
throw new ServerError('Internal Server Error');
}
switch (grant_type) {
case 'authorization_code': {
const parseResult = AuthorizationCodeGrantSchema.safeParse(req.body);
if (!parseResult.success) {
throw new InvalidRequestError(parseResult.error.message);
}
const { code, code_verifier, redirect_uri, resource } = parseResult.data;
const skipLocalPkceValidation = provider.skipLocalPkceValidation;
// Perform local PKCE validation unless explicitly skipped
// (e.g. to validate code_verifier in upstream server)
if (!skipLocalPkceValidation) {
const codeChallenge = await provider.challengeForAuthorizationCode(client, code);
if (!(await verifyChallenge(code_verifier, codeChallenge))) {
throw new InvalidGrantError('code_verifier does not match the challenge');
}
}
// Passes the code_verifier to the provider if PKCE validation didn't occur locally
const tokens = await provider.exchangeAuthorizationCode(client, code, skipLocalPkceValidation ? code_verifier : undefined, redirect_uri, resource ? new URL(resource) : undefined);
res.status(200).json(tokens);
break;
}
case 'refresh_token': {
const parseResult = RefreshTokenGrantSchema.safeParse(req.body);
if (!parseResult.success) {
throw new InvalidRequestError(parseResult.error.message);
}
const { refresh_token, scope, resource } = parseResult.data;
const scopes = scope?.split(' ');
const tokens = await provider.exchangeRefreshToken(client, refresh_token, scopes, resource ? new URL(resource) : undefined);
res.status(200).json(tokens);
break;
}
// Additional auth methods will not be added on the server side of the SDK.
case 'client_credentials':
default:
throw new UnsupportedGrantTypeError('The grant type is not supported by this authorization server.');
}
}
catch (error) {
if (error instanceof OAuthError) {
const status = error instanceof ServerError ? 500 : 400;
res.status(status).json(error.toResponseObject());
}
else {
const serverError = new ServerError('Internal Server Error');
res.status(500).json(serverError.toResponseObject());
}
}
});
return router;
}
//# sourceMappingURL=token.js.map
@@ -0,0 +1 @@
{"version":3,"file":"square-asterisk.js","sources":["../../../src/icons/square-asterisk.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareAsterisk\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0xMiA4djgiIC8+CiAgPHBhdGggZD0ibTguNSAxNCA3LTQiIC8+CiAgPHBhdGggZD0ibTguNSAxMCA3IDQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/square-asterisk\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 SquareAsterisk = createLucideIcon('SquareAsterisk', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M12 8v8', key: 'napkw2' }],\n ['path', { d: 'm8.5 14 7-4', key: '12hpby' }],\n ['path', { d: 'm8.5 10 7 4', key: 'wwy2dy' }],\n]);\n\nexport default SquareAsterisk;\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,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,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,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,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC9C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,17 @@
/**
* @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 LockKeyholeOpen = createLucideIcon("LockKeyholeOpen", [
["circle", { cx: "12", cy: "16", r: "1", key: "1au0dj" }],
["rect", { width: "18", height: "12", x: "3", y: "10", rx: "2", key: "l0tzu3" }],
["path", { d: "M7 10V7a5 5 0 0 1 9.33-2.5", key: "car5b7" }]
]);
export { LockKeyholeOpen as default };
//# sourceMappingURL=lock-keyhole-open.js.map
@@ -0,0 +1,316 @@
import { ReactiveFlags, createReactiveSystem } from './alien'
import type { ReactiveNode } from './alien'
import type {
Atom,
AtomOptions,
Observer,
ReadonlyAtom,
Subscription,
} from './types'
export function toObserver<T>(
nextHandler?: Observer<T> | ((value: T) => void),
errorHandler?: (error: any) => void,
completionHandler?: () => void,
): Observer<T> {
const isObserver = typeof nextHandler === 'object'
const self = isObserver ? nextHandler : undefined
return {
next: (isObserver ? nextHandler.next : nextHandler)?.bind(self),
error: (isObserver ? nextHandler.error : errorHandler)?.bind(self),
complete: (isObserver ? nextHandler.complete : completionHandler)?.bind(
self,
),
}
}
interface InternalAtom<T> extends ReactiveNode {
_snapshot: T
_update: (getValue?: T | ((snapshot: T) => T)) => boolean
get: () => T
subscribe: (observerOrFn: Observer<T> | ((value: T) => void)) => Subscription
}
const queuedEffects: Array<Effect | undefined> = []
let cycle = 0
const { link, unlink, propagate, checkDirty, shallowPropagate } =
createReactiveSystem({
update(atom: InternalAtom<any>): boolean {
return atom._update()
},
// eslint-disable-next-line no-shadow
notify(effect: Effect): void {
queuedEffects[queuedEffectsLength++] = effect
effect.flags &= ~ReactiveFlags.Watching
},
unwatched(atom: InternalAtom<any>): void {
if (atom.depsTail !== undefined) {
atom.depsTail = undefined
atom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty
purgeDeps(atom)
}
},
})
let notifyIndex = 0
let queuedEffectsLength = 0
let activeSub: ReactiveNode | undefined
let batchDepth = 0
export function batch(fn: () => void) {
try {
++batchDepth
fn()
} finally {
if (!--batchDepth) {
flush()
}
}
}
function purgeDeps(sub: ReactiveNode) {
const depsTail = sub.depsTail
let dep = depsTail !== undefined ? depsTail.nextDep : sub.deps
while (dep !== undefined) {
dep = unlink(dep, sub)
}
}
export function flush(): void {
if (batchDepth > 0) {
return
}
while (notifyIndex < queuedEffectsLength) {
// eslint-disable-next-line no-shadow
const effect = queuedEffects[notifyIndex]!
queuedEffects[notifyIndex++] = undefined
effect.notify()
}
notifyIndex = 0
queuedEffectsLength = 0
}
type AsyncAtomState<TData, TError = unknown> =
| { status: 'pending' }
| { status: 'done'; data: TData }
| { status: 'error'; error: TError }
export function createAsyncAtom<T>(
getValue: () => Promise<T>,
options?: AtomOptions<AsyncAtomState<T>>,
): ReadonlyAtom<AsyncAtomState<T>> {
const ref: { current?: InternalAtom<AsyncAtomState<T>> } = {}
const atom = createAtom<AsyncAtomState<T>>(() => {
getValue().then(
(data) => {
const internalAtom = ref.current!
if (internalAtom._update({ status: 'done', data })) {
const subs = internalAtom.subs
if (subs !== undefined) {
propagate(subs)
shallowPropagate(subs)
flush()
}
}
},
(error) => {
const internalAtom = ref.current!
if (internalAtom._update({ status: 'error', error })) {
const subs = internalAtom.subs
if (subs !== undefined) {
propagate(subs)
shallowPropagate(subs)
flush()
}
}
},
)
return { status: 'pending' }
}, options)
ref.current = atom as unknown as InternalAtom<AsyncAtomState<T>>
return atom
}
export function createAtom<T>(
getValue: (prev?: NoInfer<T>) => T,
options?: AtomOptions<T>,
): ReadonlyAtom<T>
export function createAtom<T>(
initialValue: T,
options?: AtomOptions<T>,
): Atom<T>
export function createAtom<T>(
valueOrFn: T | ((prev?: T) => T),
options?: AtomOptions<T>,
): Atom<T> | ReadonlyAtom<T> {
const isComputed = typeof valueOrFn === 'function'
const getter = valueOrFn as (prev?: T) => T
// Create plain object atom
const atom: InternalAtom<T> = {
_snapshot: isComputed ? undefined! : valueOrFn,
subs: undefined,
subsTail: undefined,
deps: undefined,
depsTail: undefined,
flags: isComputed ? ReactiveFlags.None : ReactiveFlags.Mutable,
get(): T {
if (activeSub !== undefined) {
link(atom, activeSub, cycle)
}
return atom._snapshot
},
subscribe(observerOrFn: Observer<T> | ((value: T) => void)) {
const obs = toObserver(observerOrFn)
const observed = { current: false }
const e = effect(() => {
atom.get()
if (!observed.current) {
observed.current = true
} else {
obs.next?.(atom._snapshot)
}
})
return {
unsubscribe: () => {
e.stop()
},
}
},
_update(getValue?: T | ((snapshot: T) => T)): boolean {
const prevSub = activeSub
const compare = options?.compare ?? Object.is
if (isComputed) {
activeSub = atom
++cycle
atom.depsTail = undefined
} else if (getValue === undefined) {
// Mutable atoms can be marked dirty by the reactive graph, but they should
// never be recomputed without an explicit value/updater.
return false
}
if (isComputed) {
atom.flags = ReactiveFlags.Mutable | ReactiveFlags.RecursedCheck
}
try {
const oldValue = atom._snapshot
const newValue =
typeof getValue === 'function'
? (getValue as (snapshot: T) => T)(oldValue)
: getValue === undefined && isComputed
? getter(oldValue)
: getValue!
if (oldValue === undefined || !compare(oldValue, newValue)) {
atom._snapshot = newValue
return true
}
return false
} finally {
activeSub = prevSub
if (isComputed) {
atom.flags &= ~ReactiveFlags.RecursedCheck
}
purgeDeps(atom)
}
},
}
if (isComputed) {
atom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty
atom.get = function (): T {
const flags = atom.flags
if (
flags & ReactiveFlags.Dirty ||
(flags & ReactiveFlags.Pending && checkDirty(atom.deps!, atom))
) {
if (atom._update()) {
const subs = atom.subs
if (subs !== undefined) {
shallowPropagate(subs)
}
}
} else if (flags & ReactiveFlags.Pending) {
atom.flags = flags & ~ReactiveFlags.Pending
}
if (activeSub !== undefined) {
link(atom, activeSub, cycle)
}
return atom._snapshot
}
} else {
;(atom as unknown as Atom<T>).set = function (
// eslint-disable-next-line no-shadow
valueOrFn: T | ((prev: T) => T),
): void {
if (atom._update(valueOrFn)) {
const subs = atom.subs
if (subs !== undefined) {
propagate(subs)
shallowPropagate(subs)
flush()
}
}
}
}
return atom as unknown as Atom<T> | ReadonlyAtom<T>
}
interface Effect extends ReactiveNode {
notify: () => void
stop: () => void
}
function effect<T>(fn: () => T): Effect {
const run = (): T => {
const prevSub = activeSub
activeSub = effectObj
++cycle
effectObj.depsTail = undefined
effectObj.flags = ReactiveFlags.Watching | ReactiveFlags.RecursedCheck
try {
return fn()
} finally {
activeSub = prevSub
effectObj.flags &= ~ReactiveFlags.RecursedCheck
purgeDeps(effectObj)
}
}
const effectObj: Effect = {
deps: undefined,
depsTail: undefined,
subs: undefined,
subsTail: undefined,
flags: ReactiveFlags.Watching | ReactiveFlags.RecursedCheck,
notify(): void {
const flags = this.flags
if (
flags & ReactiveFlags.Dirty ||
(flags & ReactiveFlags.Pending && checkDirty(this.deps!, this))
) {
run()
} else {
this.flags = ReactiveFlags.Watching
}
},
stop(): void {
this.flags = ReactiveFlags.None
this.depsTail = undefined
purgeDeps(this)
},
}
run()
return effectObj
}
@@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
const circleSet = new Set();
let depth = 0;
function deepClone(value, cache, allowCircle) {
if (value !== null) {
if (allowCircle) {
if (cache.has(value)) return cache.get(value);
} else if (++depth > 250) {
if (circleSet.has(value)) {
depth = 0;
circleSet.clear();
throw new Error("Babel-deepClone: Cycles are not allowed in AST");
}
circleSet.add(value);
}
let cloned;
if (Array.isArray(value)) {
cloned = new Array(value.length);
if (allowCircle) cache.set(value, cloned);
for (let i = 0; i < value.length; i++) {
cloned[i] = typeof value[i] !== "object" ? value[i] : deepClone(value[i], cache, allowCircle);
}
} else {
cloned = {};
if (allowCircle) cache.set(value, cloned);
const keys = Object.keys(value);
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
cloned[key] = typeof value[key] !== "object" ? value[key] : deepClone(value[key], cache, allowCircle || key === "leadingComments" || key === "innerComments" || key === "trailingComments" || key === "extra");
}
}
if (!allowCircle) {
if (depth-- > 250) circleSet.delete(value);
}
return cloned;
}
return value;
}
function _default(value) {
if (typeof value !== "object") return value;
try {
return deepClone(value, new Map(), true);
} catch (_) {
return structuredClone(value);
}
}
0 && 0;
//# sourceMappingURL=clone-deep.js.map
@@ -0,0 +1,47 @@
import units from "./units.mjs";
import { M as MS_IN_DAY } from "./constants-BuFquuHl.mjs";
import { n as normalizeUnit } from "./normalizeUnit-bp5SODxw.mjs";
const { DATE, DAY, HOUR, MILLISECOND, MINUTE, MONTH, SECOND, TIME, YEAR } = units;
const mapping = {
[YEAR]: "FullYear",
[MONTH]: "Month",
[DATE]: "Date",
[DAY]: "Day",
[HOUR]: "Hours",
[MINUTE]: "Minutes",
[SECOND]: "Seconds",
[MILLISECOND]: "Milliseconds",
[TIME]: "Time"
};
const setting = {};
const getting = {};
Object.entries(mapping).forEach(([key, method]) => {
if (key === DAY) {
setting[key] = function(date, val) {
const day = date.getDay();
if (val !== day) {
date.setTime(+date + (val - day) * MS_IN_DAY);
}
};
} else {
setting[key] = function(date, val) {
date[`set${method}`](val);
};
}
getting[key] = function(date) {
return date[`get${method}`]();
};
});
function get(date, unit) {
const fn = getting[normalizeUnit(unit)];
return fn ? fn(date) : 0;
}
function set(date, unit, val) {
const fn = setting[normalizeUnit(unit)];
fn && fn(date, val);
return date;
}
export {
get as g,
set as s
};
@@ -0,0 +1,142 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "tecken", verb: "att ha" },
file: { unit: "bytes", verb: "att ha" },
array: { unit: "objekt", verb: "att innehålla" },
set: { unit: "objekt", verb: "att innehålla" },
map: { unit: "objekt", verb: "att innehålla" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "reguljärt uttryck",
email: "e-postadress",
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: "ISO-datum och tid",
date: "ISO-datum",
time: "ISO-tid",
duration: "ISO-varaktighet",
ipv4: "IPv4-adress",
ipv6: "IPv6-adress",
mac: "MAC-adress",
cidrv4: "IPv4-spektrum",
cidrv6: "IPv6-spektrum",
base64: "base64-kodad sträng",
base64url: "base64url-kodad sträng",
json_string: "JSON-sträng",
e164: "E.164-nummer",
credit_card: "kreditkortsnummer",
currency_code: "valutakod",
iban: "IBAN",
jwt: "JWT",
template_literal: "mall-literal",
};
const TypeDictionary = {
nan: "NaN",
number: "antal",
array: "lista",
};
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 `Ogiltig inmatning: förväntat instanceof ${issue.expected}, fick ${received}`;
}
return `Ogiltig inmatning: förväntat ${expected}, fick ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Ogiltig inmatning: förväntat ${util.stringifyPrimitive(issue.values[0])}`;
return `Ogiltigt val: förväntade en av ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `För stor(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
}
return `För stor(t): förväntat ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Ogiltig sträng: måste börja med "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Ogiltig sträng: måste sluta med "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Ogiltig sträng: måste innehålla "${_issue.includes}"`;
if (_issue.format === "regex")
return `Ogiltig sträng: måste matcha mönstret "${_issue.pattern}"`;
return `Ogiltig(t) ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Ogiltigt tal: måste vara en multipel av ${issue.divisor}`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Okända nycklar" : "Okänd nyckel"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Ogiltig nyckel i ${issue.origin ?? "värdet"}`;
case "invalid_union":
return "Ogiltig input";
case "invalid_element":
return `Ogiltigt värde i ${issue.origin ?? "värdet"}`;
default:
return `Ogiltig input`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -0,0 +1 @@
{"version":3,"file":"user-round-minus.js","sources":["../../../src/icons/user-round-minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name UserRoundMinus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAyMWE4IDggMCAwIDEgMTMuMjkyLTYiIC8+CiAgPGNpcmNsZSBjeD0iMTAiIGN5PSI4IiByPSI1IiAvPgogIDxwYXRoIGQ9Ik0yMiAxOWgtNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/user-round-minus\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 UserRoundMinus = createLucideIcon('UserRoundMinus', [\n ['path', { d: 'M2 21a8 8 0 0 1 13.292-6', key: 'bjp14o' }],\n ['circle', { cx: '10', cy: '8', r: '5', key: 'o932ke' }],\n ['path', { d: 'M22 19h-6', key: 'vcuq98' }],\n]);\n\nexport default UserRoundMinus;\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,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,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,CACzD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACvD,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,141 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "znaków", verb: "mieć" },
file: { unit: "bajtów", verb: "mieć" },
array: { unit: "elementów", verb: "mieć" },
set: { unit: "elementów", verb: "mieć" },
map: { unit: "elementów", verb: "mieć" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "wyrażenie",
email: "adres 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: "data i godzina w formacie ISO",
date: "data w formacie ISO",
time: "godzina w formacie ISO",
duration: "czas trwania ISO",
ipv4: "adres IPv4",
ipv6: "adres IPv6",
mac: "adres MAC",
cidrv4: "zakres IPv4",
cidrv6: "zakres IPv6",
base64: "ciąg znaków zakodowany w formacie base64",
base64url: "ciąg znaków zakodowany w formacie base64url",
json_string: "ciąg znaków w formacie JSON",
e164: "liczba E.164",
credit_card: "numer karty kredytowej",
currency_code: "kod waluty",
iban: "IBAN",
jwt: "JWT",
template_literal: "wejście",
};
const TypeDictionary = {
nan: "NaN",
number: "liczba",
array: "tablica",
};
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 `Nieprawidłowe dane wejściowe: oczekiwano instanceof ${issue.expected}, otrzymano ${received}`;
}
return `Nieprawidłowe dane wejściowe: oczekiwano ${expected}, otrzymano ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Nieprawidłowe dane wejściowe: oczekiwano ${util.stringifyPrimitive(issue.values[0])}`;
return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Za duża wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementów"}`;
}
return `Zbyt duż(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Za mała wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.minimum.toString()} ${sizing.unit ?? "elementów"}`;
}
return `Zbyt mał(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Nieprawidłowy ciąg znaków: musi zaczynać się od "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Nieprawidłowy ciąg znaków: musi kończyć się na "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Nieprawidłowy ciąg znaków: musi zawierać "${_issue.includes}"`;
if (_issue.format === "regex")
return `Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${_issue.pattern}`;
return `Nieprawidłow(y/a/e) ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Nieprawidłowa liczba: musi być wielokrotnością ${issue.divisor}`;
case "unrecognized_keys":
return `Nierozpoznane klucze${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Nieprawidłowy klucz w ${issue.origin}`;
case "invalid_union":
return "Nieprawidłowe dane wejściowe";
case "invalid_element":
return `Nieprawidłowa wartość w ${issue.origin}`;
default:
return `Nieprawidłowe dane wejściowe`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/primitive.tsx"],
"sourcesContent": ["export {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n} from './primitive';\nexport type { PrimitivePropsWithRef } from './primitive';\n", "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createSlot } from '@radix-ui/react-slot';\n\ndeclare module 'react' {\n interface CSSProperties {\n [varName: `--radix-${string}`]: string | number | undefined | null;\n }\n}\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'select',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E> };\ntype PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent<\n E extends React.ElementType,\n> extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props: PrimitivePropsWithRef<typeof node>, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click \uD83D\uDC4E\n * target.dispatchEvent(new Event(\u2018click\u2019))\n *\n * dispatching a custom type within a non-discrete event \uD83D\uDC4E\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(\u2018customType\u2019))}\n *\n * dispatching a custom type within a `discrete` event \uD83D\uDC4D\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(\u2018customType\u2019))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,eAA0B;AAC1B,wBAA2B;AAmDhB;AA3CX,IAAM,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAeA,IAAM,YAAY,MAAM,OAAO,CAAC,WAAW,SAAS;AAClD,QAAM,WAAO,8BAAW,aAAa,IAAI,EAAE;AAC3C,QAAM,OAAa,iBAAW,CAAC,OAA2C,iBAAsB;AAC9F,UAAM,EAAE,SAAS,GAAG,eAAe,IAAI;AACvC,UAAM,OAAY,UAAU,OAAO;AAEnC,QAAI,OAAO,WAAW,aAAa;AACjC,MAAC,OAAe,OAAO,IAAI,UAAU,CAAC,IAAI;AAAA,IAC5C;AAEA,WAAO,4CAAC,QAAM,GAAG,gBAAgB,KAAK,cAAc;AAAA,EACtD,CAAC;AAED,OAAK,cAAc,aAAa,IAAI;AAEpC,SAAO,EAAE,GAAG,WAAW,CAAC,IAAI,GAAG,KAAK;AACtC,GAAG,CAAC,CAAe;AA2CnB,SAAS,4BAAmD,QAAqB,OAAU;AACzF,MAAI,OAAQ,CAAS,mBAAU,MAAM,OAAO,cAAc,KAAK,CAAC;AAClE;AAIA,IAAM,OAAO;",
"names": []
}
@@ -0,0 +1 @@
{"version":3,"file":"map-pinned.js","sources":["../../../src/icons/map-pinned.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MapPinned\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggOGMwIDMuNjEzLTMuODY5IDcuNDI5LTUuMzkzIDguNzk1YTEgMSAwIDAgMS0xLjIxNCAwQzkuODcgMTUuNDI5IDYgMTEuNjEzIDYgOGE2IDYgMCAwIDEgMTIgMCIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjgiIHI9IjIiIC8+CiAgPHBhdGggZD0iTTguNzE0IDE0aC0zLjcxYTEgMSAwIDAgMC0uOTQ4LjY4M2wtMi4wMDQgNkExIDEgMCAwIDAgMyAyMmgxOGExIDEgMCAwIDAgLjk0OC0xLjMxNmwtMi02YTEgMSAwIDAgMC0uOTQ5LS42ODRoLTMuNzEyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/map-pinned\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 MapPinned = createLucideIcon('MapPinned', [\n [\n 'path',\n {\n d: 'M18 8c0 3.613-3.869 7.429-5.393 8.795a1 1 0 0 1-1.214 0C9.87 15.429 6 11.613 6 8a6 6 0 0 1 12 0',\n key: '11u0oz',\n },\n ],\n ['circle', { cx: '12', cy: '8', r: '2', key: '1822b1' }],\n [\n 'path',\n {\n d: 'M8.714 14h-3.71a1 1 0 0 0-.948.683l-2.004 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .948-1.316l-2-6a1 1 0 0 0-.949-.684h-3.712',\n key: 'q8zwxj',\n },\n ],\n]);\n\nexport default MapPinned;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,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,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,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACvD,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;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;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,134 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const getESLintCoreRule_1 = require("../util/getESLintCoreRule");
const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-empty-function');
const defaultOptions = [
{
allow: [],
},
];
const schema = (0, util_1.deepMerge)(
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- https://github.com/microsoft/TypeScript/issues/17002
Array.isArray(baseRule.meta.schema)
? baseRule.meta.schema[0]
: baseRule.meta.schema, {
properties: {
allow: {
description: 'Locations and kinds of functions that are allowed to be empty.',
items: {
type: 'string',
enum: [
'functions',
'arrowFunctions',
'generatorFunctions',
'methods',
'generatorMethods',
'getters',
'setters',
'constructors',
'private-constructors',
'protected-constructors',
'asyncFunctions',
'asyncMethods',
'decoratedFunctions',
'overrideMethods',
],
},
},
},
});
exports.default = (0, util_1.createRule)({
name: 'no-empty-function',
meta: {
type: 'suggestion',
defaultOptions,
docs: {
description: 'Disallow empty functions',
extendsBaseRule: true,
recommended: 'stylistic',
},
hasSuggestions: baseRule.meta.hasSuggestions,
messages: baseRule.meta.messages,
schema: [schema],
},
defaultOptions,
create(context, [{ allow = [] }]) {
const rules = baseRule.create(context);
const isAllowedProtectedConstructors = allow.includes('protected-constructors');
const isAllowedPrivateConstructors = allow.includes('private-constructors');
const isAllowedDecoratedFunctions = allow.includes('decoratedFunctions');
const isAllowedOverrideMethods = allow.includes('overrideMethods');
/**
* Check if the method body is empty
* @param node the node to be validated
* @returns true if the body is empty
* @private
*/
function isBodyEmpty(node) {
return node.body.body.length === 0;
}
/**
* Check if method has parameter properties
* @param node the node to be validated
* @returns true if the body has parameter properties
* @private
*/
function hasParameterProperties(node) {
return node.params.some(param => param.type === utils_1.AST_NODE_TYPES.TSParameterProperty);
}
/**
* @param node the node to be validated
* @returns true if the constructor is allowed to be empty
* @private
*/
function isAllowedEmptyConstructor(node) {
const parent = node.parent;
if (isBodyEmpty(node) &&
parent.type === utils_1.AST_NODE_TYPES.MethodDefinition &&
parent.kind === 'constructor') {
const { accessibility } = parent;
return (
// allow protected constructors
(accessibility === 'protected' && isAllowedProtectedConstructors) ||
// allow private constructors
(accessibility === 'private' && isAllowedPrivateConstructors) ||
// allow constructors which have parameter properties
hasParameterProperties(node));
}
return false;
}
/**
* @param node the node to be validated
* @returns true if a function has decorators
* @private
*/
function isAllowedEmptyDecoratedFunctions(node) {
if (isAllowedDecoratedFunctions && isBodyEmpty(node)) {
const decorators = node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition
? node.parent.decorators
: undefined;
return !!decorators && !!decorators.length;
}
return false;
}
function isAllowedEmptyOverrideMethod(node) {
return (isAllowedOverrideMethods &&
isBodyEmpty(node) &&
node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition &&
node.parent.override);
}
return {
...rules,
FunctionExpression(node) {
if (isAllowedEmptyConstructor(node) ||
isAllowedEmptyDecoratedFunctions(node) ||
isAllowedEmptyOverrideMethod(node)) {
return;
}
rules.FunctionExpression(node);
},
};
},
});
@@ -0,0 +1,294 @@
import * as core from "./core.cjs";
import type * as errors from "./errors.cjs";
import type * as schemas from "./schemas.cjs";
import * as util from "./util.cjs";
export interface $ZodCheckDef {
check: string;
error?: errors.$ZodErrorMap<never> | undefined;
/** If true, no later checks will be executed if this check fails. Default `false`. */
abort?: boolean | undefined;
/** If provided, the check runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
when?: ((payload: schemas.ParsePayload) => boolean) | undefined;
}
export interface $ZodCheckInternals<T> {
def: $ZodCheckDef;
/** The set of issues this check might throw. */
issc?: errors.$ZodIssueBase;
check(payload: schemas.ParsePayload<T>): util.MaybeAsync<void>;
onattach: ((schema: schemas.$ZodType) => void)[];
}
export interface $ZodCheck<in T = never> {
_zod: $ZodCheckInternals<T>;
}
export declare const $ZodCheck: core.$constructor<$ZodCheck<any>>;
export interface $ZodCheckLessThanDef extends $ZodCheckDef {
check: "less_than";
value: util.Numeric;
inclusive: boolean;
}
export interface $ZodCheckLessThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {
def: $ZodCheckLessThanDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckLessThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {
_zod: $ZodCheckLessThanInternals<T>;
}
export declare const $ZodCheckLessThan: core.$constructor<$ZodCheckLessThan>;
export interface $ZodCheckGreaterThanDef extends $ZodCheckDef {
check: "greater_than";
value: util.Numeric;
inclusive: boolean;
}
export interface $ZodCheckGreaterThanInternals<T extends util.Numeric = util.Numeric> extends $ZodCheckInternals<T> {
def: $ZodCheckGreaterThanDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckGreaterThan<T extends util.Numeric = util.Numeric> extends $ZodCheck<T> {
_zod: $ZodCheckGreaterThanInternals<T>;
}
export declare const $ZodCheckGreaterThan: core.$constructor<$ZodCheckGreaterThan>;
export interface $ZodCheckMultipleOfDef<T extends number | bigint = number | bigint> extends $ZodCheckDef {
check: "multiple_of";
value: T;
}
export interface $ZodCheckMultipleOfInternals<T extends number | bigint = number | bigint> extends $ZodCheckInternals<T> {
def: $ZodCheckMultipleOfDef<T>;
issc: errors.$ZodIssueNotMultipleOf;
}
export interface $ZodCheckMultipleOf<T extends number | bigint = number | bigint> extends $ZodCheck<T> {
_zod: $ZodCheckMultipleOfInternals<T>;
}
export declare const $ZodCheckMultipleOf: core.$constructor<$ZodCheckMultipleOf<number | bigint>>;
export type $ZodNumberFormats = "int32" | "uint32" | "float32" | "float64" | "safeint";
export interface $ZodCheckNumberFormatDef<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheckDef {
check: "number_format";
format: Format;
}
export interface $ZodCheckNumberFormatInternals<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheckInternals<number> {
def: $ZodCheckNumberFormatDef<Format>;
issc: errors.$ZodIssueInvalidType | errors.$ZodIssueTooBig<"number"> | errors.$ZodIssueTooSmall<"number">;
}
export interface $ZodCheckNumberFormat<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheck<number> {
_zod: $ZodCheckNumberFormatInternals<Format>;
}
export declare const $ZodCheckNumberFormat: core.$constructor<$ZodCheckNumberFormat>;
export type $ZodBigIntFormats = "int64" | "uint64";
export interface $ZodCheckBigIntFormatDef<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheckDef {
check: "bigint_format";
format: Format;
}
export interface $ZodCheckBigIntFormatInternals<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheckInternals<bigint> {
def: $ZodCheckBigIntFormatDef<Format>;
issc: errors.$ZodIssueTooBig<"bigint"> | errors.$ZodIssueTooSmall<"bigint">;
}
export interface $ZodCheckBigIntFormat<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends $ZodCheck<bigint> {
_zod: $ZodCheckBigIntFormatInternals<Format>;
}
export declare const $ZodCheckBigIntFormat: core.$constructor<$ZodCheckBigIntFormat>;
export interface $ZodCheckMaxSizeDef extends $ZodCheckDef {
check: "max_size";
maximum: number;
}
export interface $ZodCheckMaxSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckMaxSizeDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckMaxSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckMaxSizeInternals<T>;
}
export declare const $ZodCheckMaxSize: core.$constructor<$ZodCheckMaxSize>;
export interface $ZodCheckMinSizeDef extends $ZodCheckDef {
check: "min_size";
minimum: number;
}
export interface $ZodCheckMinSizeInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckMinSizeDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckMinSize<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckMinSizeInternals<T>;
}
export declare const $ZodCheckMinSize: core.$constructor<$ZodCheckMinSize>;
export interface $ZodCheckSizeEqualsDef extends $ZodCheckDef {
check: "size_equals";
size: number;
}
export interface $ZodCheckSizeEqualsInternals<T extends util.HasSize = util.HasSize> extends $ZodCheckInternals<T> {
def: $ZodCheckSizeEqualsDef;
issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckSizeEquals<T extends util.HasSize = util.HasSize> extends $ZodCheck<T> {
_zod: $ZodCheckSizeEqualsInternals<T>;
}
export declare const $ZodCheckSizeEquals: core.$constructor<$ZodCheckSizeEquals>;
export interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
check: "max_length";
maximum: number;
}
export interface $ZodCheckMaxLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckMaxLengthDef;
issc: errors.$ZodIssueTooBig<T>;
}
export interface $ZodCheckMaxLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckMaxLengthInternals<T>;
}
export declare const $ZodCheckMaxLength: core.$constructor<$ZodCheckMaxLength>;
export interface $ZodCheckMinLengthDef extends $ZodCheckDef {
check: "min_length";
minimum: number;
}
export interface $ZodCheckMinLengthInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckMinLengthDef;
issc: errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckMinLength<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckMinLengthInternals<T>;
}
export declare const $ZodCheckMinLength: core.$constructor<$ZodCheckMinLength>;
export interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
check: "length_equals";
length: number;
}
export interface $ZodCheckLengthEqualsInternals<T extends util.HasLength = util.HasLength> extends $ZodCheckInternals<T> {
def: $ZodCheckLengthEqualsDef;
issc: errors.$ZodIssueTooBig<T> | errors.$ZodIssueTooSmall<T>;
}
export interface $ZodCheckLengthEquals<T extends util.HasLength = util.HasLength> extends $ZodCheck<T> {
_zod: $ZodCheckLengthEqualsInternals<T>;
}
export declare const $ZodCheckLengthEquals: core.$constructor<$ZodCheckLengthEquals>;
export type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "credit_card" | "iban" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
export interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
check: "string_format";
format: Format;
pattern?: RegExp | undefined;
}
export interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
def: $ZodCheckStringFormatDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckStringFormat extends $ZodCheck<string> {
_zod: $ZodCheckStringFormatInternals;
}
export declare const $ZodCheckStringFormat: core.$constructor<$ZodCheckStringFormat>;
export interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
format: "regex";
pattern: RegExp;
}
export interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
def: $ZodCheckRegexDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckRegex extends $ZodCheck<string> {
_zod: $ZodCheckRegexInternals;
}
export declare const $ZodCheckRegex: core.$constructor<$ZodCheckRegex>;
export interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {
}
export interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
def: $ZodCheckLowerCaseDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckLowerCase extends $ZodCheck<string> {
_zod: $ZodCheckLowerCaseInternals;
}
export declare const $ZodCheckLowerCase: core.$constructor<$ZodCheckLowerCase>;
export interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {
}
export interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
def: $ZodCheckUpperCaseDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckUpperCase extends $ZodCheck<string> {
_zod: $ZodCheckUpperCaseInternals;
}
export declare const $ZodCheckUpperCase: core.$constructor<$ZodCheckUpperCase>;
export interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
includes: string;
position?: number | undefined;
}
export interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
def: $ZodCheckIncludesDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckIncludes extends $ZodCheck<string> {
_zod: $ZodCheckIncludesInternals;
}
export declare const $ZodCheckIncludes: core.$constructor<$ZodCheckIncludes>;
export interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
prefix: string;
}
export interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
def: $ZodCheckStartsWithDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckStartsWith extends $ZodCheck<string> {
_zod: $ZodCheckStartsWithInternals;
}
export declare const $ZodCheckStartsWith: core.$constructor<$ZodCheckStartsWith>;
export interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
suffix: string;
}
export interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
def: $ZodCheckEndsWithDef;
issc: errors.$ZodIssueInvalidStringFormat;
}
export interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
_zod: $ZodCheckEndsWithInternals;
}
export declare const $ZodCheckEndsWith: core.$constructor<$ZodCheckEndsWith>;
export interface $ZodCheckPropertyDef extends $ZodCheckDef {
check: "property";
property: string;
schema: schemas.$ZodType;
}
export interface $ZodCheckPropertyInternals<T extends object = object> extends $ZodCheckInternals<T> {
def: $ZodCheckPropertyDef;
issc: errors.$ZodIssue;
}
export interface $ZodCheckProperty<T extends object = object> extends $ZodCheck<T> {
_zod: $ZodCheckPropertyInternals<T>;
}
export declare const $ZodCheckProperty: core.$constructor<$ZodCheckProperty>;
export interface $ZodCheckPropertiesDef<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheckDef {
check: "properties";
shape: Shape;
}
export type $ZodCheckPropertiesInput<Shape extends schemas.$ZodShape = schemas.$ZodShape> = {
-readonly [k in keyof Shape]: util.Widen<core.input<Shape[k]>>;
};
export interface $ZodCheckPropertiesInternals<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheckInternals<$ZodCheckPropertiesInput<Shape>> {
def: $ZodCheckPropertiesDef<Shape>;
issc: errors.$ZodIssue;
}
export interface $ZodCheckProperties<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheck<$ZodCheckPropertiesInput<Shape>> {
_zod: $ZodCheckPropertiesInternals<Shape>;
[Symbol.iterator](): Iterator<this>;
}
export declare const $ZodCheckProperties: core.$constructor<$ZodCheckProperties>;
export interface $ZodCheckMimeTypeDef extends $ZodCheckDef {
check: "mime_type";
mime: util.MimeTypes[];
}
export interface $ZodCheckMimeTypeInternals<T extends schemas.File = schemas.File> extends $ZodCheckInternals<T> {
def: $ZodCheckMimeTypeDef;
issc: errors.$ZodIssueInvalidValue;
}
export interface $ZodCheckMimeType<T extends schemas.File = schemas.File> extends $ZodCheck<T> {
_zod: $ZodCheckMimeTypeInternals<T>;
}
export declare const $ZodCheckMimeType: core.$constructor<$ZodCheckMimeType>;
export interface $ZodCheckOverwriteDef<T = unknown> extends $ZodCheckDef {
check: "overwrite";
tx(value: T): T;
}
export interface $ZodCheckOverwriteInternals<T = unknown> extends $ZodCheckInternals<T> {
def: $ZodCheckOverwriteDef<T>;
issc: never;
}
export interface $ZodCheckOverwrite<T = unknown> extends $ZodCheck<T> {
_zod: $ZodCheckOverwriteInternals<T>;
}
export declare const $ZodCheckOverwrite: core.$constructor<$ZodCheckOverwrite>;
export type $ZodChecks = $ZodCheckLessThan | $ZodCheckGreaterThan | $ZodCheckMultipleOf | $ZodCheckNumberFormat | $ZodCheckBigIntFormat | $ZodCheckMaxSize | $ZodCheckMinSize | $ZodCheckSizeEquals | $ZodCheckMaxLength | $ZodCheckMinLength | $ZodCheckLengthEquals | $ZodCheckStringFormat | $ZodCheckProperty | $ZodCheckMimeType | $ZodCheckOverwrite;
export type $ZodStringFormatChecks = $ZodCheckRegex | $ZodCheckLowerCase | $ZodCheckUpperCase | $ZodCheckIncludes | $ZodCheckStartsWith | $ZodCheckEndsWith | schemas.$ZodStringFormatTypes;
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2022: LibDefinition;
@@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./isArray"), exports);
__exportStar(require("./NoInfer"), exports);
@@ -0,0 +1 @@
{"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAAC;IAEtH;;;;;;OAMG;IACH,cAAc,CAAC,CACX,MAAM,EAAE,IAAI,CAAC,0BAA0B,EAAE,WAAW,GAAG,qBAAqB,CAAC,GAC9E,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;CACvE"}
@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const formats_1 = require("./formats");
const limit_1 = require("./limit");
const codegen_1 = require("ajv/dist/compile/codegen");
const fullName = new codegen_1.Name("fullFormats");
const fastName = new codegen_1.Name("fastFormats");
const formatsPlugin = (ajv, opts = { keywords: true }) => {
if (Array.isArray(opts)) {
addFormats(ajv, opts, formats_1.fullFormats, fullName);
return ajv;
}
const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
const list = opts.formats || formats_1.formatNames;
addFormats(ajv, list, formats, exportName);
if (opts.keywords)
(0, limit_1.default)(ajv);
return ajv;
};
formatsPlugin.get = (name, mode = "full") => {
const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
const f = formats[name];
if (!f)
throw new Error(`Unknown format "${name}"`);
return f;
};
function addFormats(ajv, list, fs, exportName) {
var _a;
var _b;
(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : (_b.formats = (0, codegen_1._) `require("ajv-formats/dist/formats").${exportName}`);
for (const f of list)
ajv.addFormat(f, fs[f]);
}
module.exports = exports = formatsPlugin;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = formatsPlugin;
//# sourceMappingURL=index.js.map
@@ -0,0 +1,68 @@
{
"name": "@radix-ui/react-primitive",
"version": "2.1.3",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"dependencies": {
"@radix-ui/react-slot": "1.2.3"
},
"devDependencies": {
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"typescript": "^5.7.3",
"@repo/builder": "0.0.0",
"@repo/typescript-config": "0.0.0",
"@repo/eslint-config": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1,318 @@
'use strict'
const { collectASequenceOfCodePointsFast } = require('../infra')
const { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')
const { isCTLExcludingHtab } = require('./util')
const assert = require('node:assert')
/**
* @description Parses the field-value attributes of a set-cookie header string.
* @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
* @param {string} header
* @returns {import('./index').Cookie|null} if the header is invalid, null will be returned
*/
function parseSetCookie (header) {
// 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
// character (CTL characters excluding HTAB): Abort these steps and
// ignore the set-cookie-string entirely.
if (isCTLExcludingHtab(header)) {
return null
}
let nameValuePair = ''
let unparsedAttributes = ''
let name = ''
let value = ''
// 2. If the set-cookie-string contains a %x3B (";") character:
if (header.includes(';')) {
// 1. The name-value-pair string consists of the characters up to,
// but not including, the first %x3B (";"), and the unparsed-
// attributes consist of the remainder of the set-cookie-string
// (including the %x3B (";") in question).
const position = { position: 0 }
nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
unparsedAttributes = header.slice(position.position)
} else {
// Otherwise:
// 1. The name-value-pair string consists of all the characters
// contained in the set-cookie-string, and the unparsed-
// attributes is the empty string.
nameValuePair = header
}
// 3. If the name-value-pair string lacks a %x3D ("=") character, then
// the name string is empty, and the value string is the value of
// name-value-pair.
if (!nameValuePair.includes('=')) {
value = nameValuePair
} else {
// Otherwise, the name string consists of the characters up to, but
// not including, the first %x3D ("=") character, and the (possibly
// empty) value string consists of the characters after the first
// %x3D ("=") character.
const position = { position: 0 }
name = collectASequenceOfCodePointsFast(
'=',
nameValuePair,
position
)
value = nameValuePair.slice(position.position + 1)
}
// 4. Remove any leading or trailing WSP characters from the name
// string and the value string.
name = name.trim()
value = value.trim()
// 5. If the sum of the lengths of the name string and the value string
// is more than 4096 octets, abort these steps and ignore the set-
// cookie-string entirely.
if (name.length + value.length > maxNameValuePairSize) {
return null
}
// 6. The cookie-name is the name string, and the cookie-value is the
// value string.
// https://datatracker.ietf.org/doc/html/rfc6265
// To maximize compatibility with user agents, servers that wish to
// store arbitrary data in a cookie-value SHOULD encode that data, for
// example, using Base64 [RFC4648].
return {
name, value, ...parseUnparsedAttributes(unparsedAttributes)
}
}
/**
* Parses the remaining attributes of a set-cookie header
* @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
* @param {string} unparsedAttributes
* @param {Object.<string, unknown>} [cookieAttributeList={}]
*/
function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
while (true) {
// 1. If the unparsed-attributes string is empty, skip the rest of
// these steps.
if (unparsedAttributes.length === 0) {
return cookieAttributeList
}
// 2. Discard the first character of the unparsed-attributes (which
// will be a %x3B (";") character).
assert(unparsedAttributes[0] === ';')
unparsedAttributes = unparsedAttributes.slice(1)
let cookieAv = ''
// 3. If the remaining unparsed-attributes contains a %x3B (";")
// character:
if (unparsedAttributes.includes(';')) {
// 1. Consume the characters of the unparsed-attributes up to, but
// not including, the first %x3B (";") character.
cookieAv = collectASequenceOfCodePointsFast(
';',
unparsedAttributes,
{ position: 0 }
)
unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
} else {
// Otherwise:
// 1. Consume the remainder of the unparsed-attributes.
cookieAv = unparsedAttributes
unparsedAttributes = ''
}
// Let the cookie-av string be the characters consumed in this step.
let attributeName = ''
let attributeValue = ''
// 4. If the cookie-av string contains a %x3D ("=") character:
if (cookieAv.includes('=')) {
// 1. The (possibly empty) attribute-name string consists of the
// characters up to, but not including, the first %x3D ("=")
// character, and the (possibly empty) attribute-value string
// consists of the characters after the first %x3D ("=")
// character.
const position = { position: 0 }
attributeName = collectASequenceOfCodePointsFast(
'=',
cookieAv,
position
)
attributeValue = cookieAv.slice(position.position + 1)
} else {
// Otherwise:
// 1. The attribute-name string consists of the entire cookie-av
// string, and the attribute-value string is empty.
attributeName = cookieAv
}
// 5. Remove any leading or trailing WSP characters from the attribute-
// name string and the attribute-value string.
attributeName = attributeName.trim()
attributeValue = attributeValue.trim()
// 6. If the attribute-value is longer than 1024 octets, ignore the
// cookie-av string and return to Step 1 of this algorithm.
if (attributeValue.length > maxAttributeValueSize) {
continue
}
// 7. Process the attribute-name and attribute-value according to the
// requirements in the following subsections. (Notice that
// attributes with unrecognized attribute-names are ignored.)
const attributeNameLowercase = attributeName.toLowerCase()
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
// If the attribute-name case-insensitively matches the string
// "Expires", the user agent MUST process the cookie-av as follows.
if (attributeNameLowercase === 'expires') {
// 1. Let the expiry-time be the result of parsing the attribute-value
// as cookie-date (see Section 5.1.1).
const expiryTime = new Date(attributeValue)
// 2. If the attribute-value failed to parse as a cookie date, ignore
// the cookie-av.
if (!Number.isNaN(expiryTime.getTime())) {
cookieAttributeList.expires = expiryTime
}
} else if (attributeNameLowercase === 'max-age') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
// If the attribute-name case-insensitively matches the string "Max-
// Age", the user agent MUST process the cookie-av as follows.
// 1. If the first character of the attribute-value is not a DIGIT or a
// "-" character, ignore the cookie-av.
const charCode = attributeValue.charCodeAt(0)
const startsWithDigit = charCode >= 48 && charCode <= 57
const startsWithSignedDigit = attributeValue[0] === '-' && attributeValue.length > 1
if (!startsWithDigit && !startsWithSignedDigit) {
continue
}
// 2. If the remainder of attribute-value contains a non-DIGIT
// character, ignore the cookie-av.
if (/[^\d]/.test(attributeValue.slice(1))) {
continue
}
// 3. Let delta-seconds be the attribute-value converted to an integer.
const deltaSeconds = Number(attributeValue)
// 4. Let cookie-age-limit be the maximum age of the cookie (which
// SHOULD be 400 days or less, see Section 4.1.2.2).
// 5. Set delta-seconds to the smaller of its present value and cookie-
// age-limit.
// deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
// 6. If delta-seconds is less than or equal to zero (0), let expiry-
// time be the earliest representable date and time. Otherwise, let
// the expiry-time be the current date and time plus delta-seconds
// seconds.
// const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
// 7. Append an attribute to the cookie-attribute-list with an
// attribute-name of Max-Age and an attribute-value of expiry-time.
cookieAttributeList.maxAge = deltaSeconds
} else if (attributeNameLowercase === 'domain') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
// If the attribute-name case-insensitively matches the string "Domain",
// the user agent MUST process the cookie-av as follows.
// 1. Let cookie-domain be the attribute-value.
let cookieDomain = attributeValue
// 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
// cookie-domain without its leading %x2E (".").
if (cookieDomain[0] === '.') {
cookieDomain = cookieDomain.slice(1)
}
// 3. Convert the cookie-domain to lower case.
cookieDomain = cookieDomain.toLowerCase()
// 4. Append an attribute to the cookie-attribute-list with an
// attribute-name of Domain and an attribute-value of cookie-domain.
cookieAttributeList.domain = cookieDomain
} else if (attributeNameLowercase === 'path') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
// If the attribute-name case-insensitively matches the string "Path",
// the user agent MUST process the cookie-av as follows.
// 1. If the attribute-value is empty or if the first character of the
// attribute-value is not %x2F ("/"):
let cookiePath = ''
if (attributeValue.length === 0 || attributeValue[0] !== '/') {
// 1. Let cookie-path be the default-path.
cookiePath = '/'
} else {
// Otherwise:
// 1. Let cookie-path be the attribute-value.
cookiePath = attributeValue
}
// 2. Append an attribute to the cookie-attribute-list with an
// attribute-name of Path and an attribute-value of cookie-path.
cookieAttributeList.path = cookiePath
} else if (attributeNameLowercase === 'secure') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
// If the attribute-name case-insensitively matches the string "Secure",
// the user agent MUST append an attribute to the cookie-attribute-list
// with an attribute-name of Secure and an empty attribute-value.
cookieAttributeList.secure = true
} else if (attributeNameLowercase === 'httponly') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
// If the attribute-name case-insensitively matches the string
// "HttpOnly", the user agent MUST append an attribute to the cookie-
// attribute-list with an attribute-name of HttpOnly and an empty
// attribute-value.
cookieAttributeList.httpOnly = true
} else if (attributeNameLowercase === 'samesite') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
// If the attribute-name case-insensitively matches the string
// "SameSite", the user agent MUST process the cookie-av as follows:
const attributeValueLowercase = attributeValue.toLowerCase()
// 1. If cookie-av's attribute-value is a case-insensitive match for
// "None", append an attribute to the cookie-attribute-list with an
// attribute-name of "SameSite" and an attribute-value of "None".
if (attributeValueLowercase === 'none') {
cookieAttributeList.sameSite = 'None'
} else if (attributeValueLowercase === 'strict') {
// 2. If cookie-av's attribute-value is a case-insensitive match for
// "Strict", append an attribute to the cookie-attribute-list with
// an attribute-name of "SameSite" and an attribute-value of
// "Strict".
cookieAttributeList.sameSite = 'Strict'
} else if (attributeValueLowercase === 'lax') {
// 3. If cookie-av's attribute-value is a case-insensitive match for
// "Lax", append an attribute to the cookie-attribute-list with an
// attribute-name of "SameSite" and an attribute-value of "Lax".
cookieAttributeList.sameSite = 'Lax'
}
} else {
cookieAttributeList.unparsed ??= []
cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
}
// 8. Return to Step 1 of this algorithm.
}
}
module.exports = {
parseSetCookie,
parseUnparsedAttributes
}
@@ -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 './triangle-alert.js';
//# sourceMappingURL=alert-triangle.js.map
@@ -0,0 +1 @@
{"version":3,"file":"book-image.js","sources":["../../../src/icons/book-image.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BookImage\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjAgMTMuNy0yLjEtMi4xYTIgMiAwIDAgMC0yLjggMEw5LjcgMTciIC8+CiAgPHBhdGggZD0iTTQgMTkuNXYtMTVBMi41IDIuNSAwIDAgMSA2LjUgMkgxOWExIDEgMCAwIDEgMSAxdjE4YTEgMSAwIDAgMS0xIDFINi41YTEgMSAwIDAgMSAwLTVIMjAiIC8+CiAgPGNpcmNsZSBjeD0iMTAiIGN5PSI4IiByPSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/book-image\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 BookImage = createLucideIcon('BookImage', [\n ['path', { d: 'm20 13.7-2.1-2.1a2 2 0 0 0-2.8 0L9.7 17', key: 'q6ojf0' }],\n [\n 'path',\n {\n d: 'M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20',\n key: 'k3hazp',\n },\n ],\n ['circle', { cx: '10', cy: '8', r: '2', key: '2qkj4p' }],\n]);\n\nexport default BookImage;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxE,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;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,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AACzD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,24 @@
/**
* @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 DnaOff = createLucideIcon("DnaOff", [
["path", { d: "M15 2c-1.35 1.5-2.092 3-2.5 4.5L14 8", key: "1bivrr" }],
["path", { d: "m17 6-2.891-2.891", key: "xu6p2f" }],
["path", { d: "M2 15c3.333-3 6.667-3 10-3", key: "nxix30" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
["path", { d: "m20 9 .891.891", key: "3xwk7g" }],
["path", { d: "M22 9c-1.5 1.35-3 2.092-4.5 2.5l-1-1", key: "18cutr" }],
["path", { d: "M3.109 14.109 4 15", key: "q76aoh" }],
["path", { d: "m6.5 12.5 1 1", key: "cs35ky" }],
["path", { d: "m7 18 2.891 2.891", key: "1sisit" }],
["path", { d: "M9 22c1.35-1.5 2.092-3 2.5-4.5L10 16", key: "rlvei3" }]
]);
export { DnaOff as default };
//# sourceMappingURL=dna-off.js.map
@@ -0,0 +1,18 @@
import { StructuralSharingOption, ValidateSelected } from './structuralSharing.js';
import { AnyRouter, RegisteredRouter, RouterState } from '@tanstack/router-core';
export interface UseLocationBaseOptions<TRouter extends AnyRouter, TSelected, TStructuralSharing extends boolean = boolean> {
select?: (state: RouterState<TRouter['routeTree']>['location']) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
}
export type UseLocationResult<TRouter extends AnyRouter, TSelected> = unknown extends TSelected ? RouterState<TRouter['routeTree']>['location'] : TSelected;
/**
* Read the current location from the router state with optional selection.
* Useful for subscribing to just the pieces of location you care about.
*
* Options:
* - `select`: Project the `location` object to a derived value
* - `structuralSharing`: Enable structural sharing for stable references
*
* @returns The current location (or selected value).
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLocationHook
*/
export declare function useLocation<TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts?: UseLocationBaseOptions<TRouter, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>): UseLocationResult<TRouter, TSelected>;
@@ -0,0 +1,99 @@
/**
* @fileoverview Rule to flag use of a leading/trailing decimal point in a numeric literal
* @author James Allardice
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "no-floating-decimal",
url: "https://eslint.style/rules/no-floating-decimal",
},
},
],
},
type: "suggestion",
docs: {
description:
"Disallow leading or trailing decimal points in numeric literals",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-floating-decimal",
},
schema: [],
fixable: "code",
messages: {
leading: "A leading decimal point can be confused with a dot.",
trailing: "A trailing decimal point can be confused with a dot.",
},
},
create(context) {
const sourceCode = context.sourceCode;
return {
Literal(node) {
if (typeof node.value === "number") {
if (node.raw.startsWith(".")) {
context.report({
node,
messageId: "leading",
fix(fixer) {
const tokenBefore =
sourceCode.getTokenBefore(node);
const needsSpaceBefore =
tokenBefore &&
tokenBefore.range[1] === node.range[0] &&
!astUtils.canTokensBeAdjacent(
tokenBefore,
`0${node.raw}`,
);
return fixer.insertTextBefore(
node,
needsSpaceBefore ? " 0" : "0",
);
},
});
}
if (node.raw.indexOf(".") === node.raw.length - 1) {
context.report({
node,
messageId: "trailing",
fix: fixer => fixer.insertTextAfter(node, "0"),
});
}
}
},
};
},
};
@@ -0,0 +1,31 @@
/**
* @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 Bug = createLucideIcon("Bug", [
["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
["path", { d: "M9 7.13v-1a3.003 3.003 0 1 1 6 0v1", key: "d7y7pr" }],
[
"path",
{
d: "M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",
key: "xs1cw7"
}
],
["path", { d: "M12 20v-9", key: "1qisl0" }],
["path", { d: "M6.53 9C4.6 8.8 3 7.1 3 5", key: "32zzws" }],
["path", { d: "M6 13H2", key: "82j7cp" }],
["path", { d: "M3 21c0-2.1 1.7-3.9 3.8-4", key: "4p0ekp" }],
["path", { d: "M20.97 5c0 2.1-1.6 3.8-3.5 4", key: "18gb23" }],
["path", { d: "M22 13h-4", key: "1jl80f" }],
["path", { d: "M17.2 17c2.1.1 3.8 1.9 3.8 4", key: "k3fwyw" }]
]);
export { Bug as default };
//# sourceMappingURL=bug.js.map
@@ -0,0 +1,360 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.$ZodCyclicError = void 0;
exports.isRecursiveSchema = isRecursiveSchema;
exports.memoizer = memoizer;
exports.isBackEdge = isBackEdge;
const util = __importStar(require("./util.cjs"));
class $ZodCyclicError extends Error {
constructor() {
super(`Cannot parse a reference cycle that closes through a transform`);
this.name = "ZodCyclicError";
}
}
exports.$ZodCyclicError = $ZodCyclicError;
/** Keyed off the context object every schema in one parse call already shares. */
const STATE = "~memo";
const NO_ISSUES = [];
// a value a cycle can close through
function isRef(value) {
return value !== null && typeof value === "object";
}
// Receivers prefix paths in place, so the cache and every hand-out need their own copies.
function cloneIssues(issues) {
return issues.map((iss) => (iss.path ? { ...iss, path: iss.path.slice() } : { ...iss }));
}
const recursive = /*@__PURE__*/ new WeakMap();
/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
const NONE = 0;
const ASSUMED = 1;
const PROVEN = 2;
/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
function isRecursive(inst, stack, resolve) {
const cached = recursive.get(inst);
if (cached !== undefined)
return cached ? PROVEN : NONE;
// Relative to the walk in progress, so not cached.
if (stack.has(inst))
return PROVEN;
stack.add(inst);
let result = NONE;
const check = (child) => {
if (result !== PROVEN && child?._zod) {
const answer = isRecursive(child, stack, resolve);
if (answer > result)
result = answer;
}
};
// `Reflect.ownKeys` rather than `Object.keys`, so a cycle through a declared symbol key is still seen
const shape = (sh, spread) => {
let answer = NONE;
for (const key of Reflect.ownKeys(sh)) {
const desc = Object.getOwnPropertyDescriptor(sh, key);
// an object resolves its shape by spread, so a key it does not enumerate is never parsed; `z.properties` reads every own key and so keeps them all
if (spread && !desc.enumerable)
continue;
// resolving runs user code, and a factory mints a fresh subtree per read, so an edge the walk can't follow counts as a cycle
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
if (child > answer)
answer = child;
}
return answer;
};
const merge = (answer) => {
if (answer > result)
result = answer;
};
const def = inst._zod.def;
const kind = def.type;
switch (kind) {
case "object": {
const raw = util.rawShape(def);
// a def with no raw shape answers `shape` from an accessor of its own, and running that can mint a whole fresh subtree
merge(raw ? shape(raw, true) : ASSUMED);
check(def.catchall);
break;
}
case "array":
check(def.element);
break;
case "tuple":
for (const el of def.items)
check(el);
check(def.rest);
break;
case "record":
case "map":
check(def.keyType);
check(def.valueType);
break;
case "set":
check(def.valueType);
break;
case "union":
for (const el of def.options)
check(el);
break;
case "intersection":
check(def.left);
check(def.right);
break;
case "optional":
case "nullable":
case "default":
case "prefault":
case "catch":
case "readonly":
case "nonoptional":
case "promise":
case "success":
check(def.innerType);
break;
case "pipe":
check(def.in);
check(def.out);
break;
case "function":
check(def.input);
check(def.output);
break;
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
case "lazy": {
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : undefined);
// walked with resolution off: one hop sees past the deferral, and a lazy that yields only another unresolved lazy is generative, so it stops there
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
break;
}
// a leaf by choice: `parts` are regex fragments, not data positions
case "template_literal":
// leaves
case "string":
case "number":
case "int":
case "boolean":
case "bigint":
case "symbol":
case "undefined":
case "null":
case "void":
case "never":
case "any":
case "unknown":
case "date":
case "nan":
case "enum":
case "literal":
case "file":
case "transform":
case "custom":
break;
default: {
// a new built-in kind becomes a compile error here
kind;
// a user-defined kind can still hold children, and only its author knows where, so fall back to scanning the def — skipping accessors, since reading one can run user code
for (const key in def) {
const desc = Object.getOwnPropertyDescriptor(def, key);
if (!desc || desc.get)
continue;
const value = desc.value;
if (!value || typeof value !== "object")
continue;
if (value._zod)
check(value);
else if (Array.isArray(value))
for (const el of value)
check(el);
}
}
}
stack.delete(inst);
return settle(inst, result);
}
/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */
function settle(inst, answer) {
if (answer !== ASSUMED)
recursive.set(inst, answer === PROVEN);
return answer;
}
/**
* Whether one parse can re-enter this schema, i.e. its subtree contains a cycle.
* Exported for `z.compile`, which refuses to compile such a schema: cycle
* breaking is driven from here off state keyed on the parse context, and a
* generated fast path has no context to key on.
*/
function isRecursiveSchema(inst) {
// z.compile never parses, so nothing would ever resolve a lazy for it; it runs once and already treats a throw here as recursive
return isRecursive(inst, new Set(), true) !== NONE;
}
function bucketFor(state, inst) {
let bucket = state.buckets.get(inst);
if (!bucket) {
bucket = new WeakMap();
state.buckets.set(inst, bucket);
}
return bucket;
}
// Set immediately before delegating to core and cleared immediately after, so `alloc` registers only for a visit this module is driving.
let handoff;
// Allocated but unfinished entries. `alloc` and the matching pop both happen in the synchronous part of a parse, so they nest even when children are async, and one stack serves every schema.
const open = [];
const memo = {
alloc(_inst, payload, empty) {
const bucket = handoff;
if (!bucket)
return empty;
handoff = undefined;
const entry = { value: empty, issues: null };
bucket.set(payload.value, entry);
open.push(entry);
return empty;
},
guard(inst) {
var _a;
(_a = inst._zod).deferred ?? (_a.deferred = []);
inst._zod.deferred.push(() => {
const base = inst._zod.parse;
const wrapped = (payload, ctx) => {
// The value is a placeholder a back-edge is still waiting on, so the cycle closes through this transform. Its output can't exist in time to bind.
if (ctx.direction !== "backward" && isBackEdge(ctx, payload.value))
throw new $ZodCyclicError();
return base(payload, ctx);
};
inst._zod.parse = wrapped;
if (inst._zod.run === base)
inst._zod.run = wrapped;
});
},
attach(inst) {
var _a;
let isRecursiveInst;
let rechecked = false;
// a recursive schema is re-entered many times per parse and its bucket never changes
let lastCtx;
let lastBucket;
// Wraps `parse` in a deferred so it sees the container's final parse. Core's own deferred copies `parse` into `run` when there are no checks, and it ran first, so `run` is patched to match; with checks, `run` reads `parse` dynamically.
(_a = inst._zod).deferred ?? (_a.deferred = []);
inst._zod.deferred.push(() => {
const base = inst._zod.parse;
const wrapped = (payload, ctx) => {
if (isRecursiveInst === undefined) {
const walked = isRecursive(inst, new Set(), false);
if (walked === NONE) {
// Nothing here can ever fire, so take it back out.
inst._zod.parse = base;
if (inst._zod.run === wrapped)
inst._zod.run = base;
return base(payload, ctx);
}
// this parse resolves the deferred edges on its own path, so ask once more before latching
if (walked === PROVEN || rechecked)
isRecursiveInst = true;
else
rechecked = true;
}
const input = payload.value;
if (!isRef(input))
return base(payload, ctx);
let state = ctx[STATE];
if (!state) {
state = { buckets: new WeakMap(), backEdges: undefined };
ctx[STATE] = state;
}
let bucket;
if (lastCtx === ctx) {
bucket = lastBucket;
}
else {
bucket = bucketFor(state, inst);
lastCtx = ctx;
lastBucket = bucket;
}
const hit = bucket.get(input);
if (hit) {
payload.value = hit.value;
if (hit.issues) {
if (hit.issues.length)
payload.issues.push(...cloneIssues(hit.issues));
}
else {
// Still being parsed: its own checks cover it, so skip them here.
payload.memo = true;
state.backEdges ?? (state.backEdges = new WeakSet());
state.backEdges.add(hit.value);
}
return payload;
}
handoff = bucket;
const depth = open.length;
const result = base(payload, ctx);
handoff = undefined;
// A container that rejected its input outright allocated nothing.
const entry = open.length > depth ? open.pop() : undefined;
// Both paths written out so the sync one allocates no closure. It runs once per node, and capturing here cost more than everything else combined.
if (result instanceof Promise) {
return result.then((r) => {
if (entry)
entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
return r;
});
}
if (entry)
entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;
return result;
};
inst._zod.parse = wrapped;
if (inst._zod.run === base)
inst._zod.run = wrapped;
});
},
};
/** The memoizer that gives containers cycle support. `zod` installs it by default; `zod/mini` opts in with `config({ memoizer: memoizer() })`. */
function memoizer() {
return memo;
}
/** Whether this value is a node a back-edge resolved to before it finished. */
function isBackEdge(ctx, value) {
const backEdges = ctx[STATE]?.backEdges;
return backEdges !== undefined && isRef(value) && backEdges.has(value);
}
// seal-cjs-exports
(function () {
var keys = Object.getOwnPropertyNames(exports);
for (var i = 0; i < keys.length; i++) {
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
if (!desc || !desc.get || !desc.configurable) continue;
var value;
try {
value = desc.get();
} catch (e) {
continue;
}
// a circular require may not have settled this one yet, so leave it live
if (value === undefined) continue;
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
}
Object.freeze(exports);
})();
@@ -0,0 +1,76 @@
import { ChildNode, Element, DataNode, Document, ParentNode } from "./node.js";
export * from "./node.js";
export interface DomHandlerOptions {
/**
* Add a `startIndex` property to nodes.
* When the parser is used in a non-streaming fashion, `startIndex` is an integer
* indicating the position of the start of the node in the document.
*
* @default false
*/
withStartIndices?: boolean;
/**
* Add an `endIndex` property to nodes.
* When the parser is used in a non-streaming fashion, `endIndex` is an integer
* indicating the position of the end of the node in the document.
*
* @default false
*/
withEndIndices?: boolean;
/**
* Treat the markup as XML.
*
* @default false
*/
xmlMode?: boolean;
}
interface ParserInterface {
startIndex: number | null;
endIndex: number | null;
}
declare type Callback = (error: Error | null, dom: ChildNode[]) => void;
declare type ElementCallback = (element: Element) => void;
export declare class DomHandler {
/** The elements of the DOM */
dom: ChildNode[];
/** The root element for the DOM */
root: Document;
/** Called once parsing has completed. */
private readonly callback;
/** Settings for the handler. */
private readonly options;
/** Callback whenever a tag is closed. */
private readonly elementCB;
/** Indicated whether parsing has been completed. */
private done;
/** Stack of open tags. */
protected tagStack: ParentNode[];
/** A data node that is still being written to. */
protected lastNode: DataNode | null;
/** Reference to the parser instance. Used for location information. */
private parser;
/**
* @param callback Called once parsing has completed.
* @param options Settings for the handler.
* @param elementCB Callback whenever a tag is closed.
*/
constructor(callback?: Callback | null, options?: DomHandlerOptions | null, elementCB?: ElementCallback);
onparserinit(parser: ParserInterface): void;
onreset(): void;
onend(): void;
onerror(error: Error): void;
onclosetag(): void;
onopentag(name: string, attribs: {
[key: string]: string;
}): void;
ontext(data: string): void;
oncomment(data: string): void;
oncommentend(): void;
oncdatastart(): void;
oncdataend(): void;
onprocessinginstruction(name: string, data: string): void;
protected handleCallback(error: Error | null): void;
protected addNode(node: ChildNode): void;
}
export default DomHandler;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,9 @@
MIT License
Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
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,626 @@
flf2a$ 6 5 13 15 13
HHscript by Shimrod (Herman Hiddema), based on his own .sig
Figlet release 2.0 -- August 5, 1993
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
6 - height of a character
5 - height of a character, not including descenders
15 - max line length (excluding comment lines) + a fudge factor
15 - default smushmode for this font (like "-m 15" on command line)
13 - number of comment lines
$$@
$$@
$$@
$$@
$$@
$$@@
.$@
|$@
|$@
$@
o$@
$@@
p q$@
$@
$@
$@
$@
$@@
| | $@
-+-+-$@
| | $@
-+-+-$@
| | $@
$@@
,+. $@
( | `$@
`+. $@
. | )$@
`+' $@
$@@
_ ,$@
(_)/ $@
/_ $@
/(_)$@
' $@
$@@
,-. $@
( ) $@
;-: ,$@
( X $@
`-' `$@
$@@
p$@
$@
$@
$@
$@
$@@
,$@
/ $@
| $@
\ $@
`$@
$@@
. $@
\$@
|$@
/$@
' $@
$@@
. $@
`.|,'$@
/ \ $@
$@
$@
$@@
$@
| $@
-+-$@
| $@
$@
$@@
$@
$@
$@
$@
p$@
$@@
$@
$@
---$@
$@
$@
$@@
$@
$@
$@
$@
o$@
$@@
/$@
/ $@
/ $@
/ $@
/ $@
$@@
,-. $@
/ /\$@
| / |$@
\/ /$@
`-' $@
$@@
,$@
'|$@
|$@
|$@
'$@
$@@
,-. $@
)$@
/ $@
/ $@
'--'$@
$@@
,--,$@
/ $@
`. $@
)$@
`-' $@
$@@
,.$@
/ |$@
'--|$@
|$@
'$@
$@@
;--'$@
| $@
`-. $@
)$@
`-' $@
$@@
,-. $@
/ $@
|,-. $@
( )$@
`-' $@
$@@
,---,$@
/ $@
/ $@
/ $@
' $@
$@@
,-. $@
( )$@
;-: $@
( )$@
`-' $@
$@@
,-. $@
( )$@
`-'|$@
/$@
`-' $@
$@@
$@
o$@
$@
o$@
$@
$@@
$@
o$@
$@
p$@
$@
$@@
$@
,'$@
< $@
`.$@
$@
$@@
$@
---$@
$@
---$@
$@
$@@
$@
`. $@
>$@
,' $@
$@
$@@
,-. $@
( )$@
,' $@
' $@
o $@
$@@
,-. $@
/ ,-\$@
| | |$@
\ `-'$@
`--'$@
$@@
,. $@
/ \$@
|--|$@
| |$@
' '$@
$@@
,-. $@
| )$@
|-< $@
| )$@
`-' $@
$@@
,-.$@
/ $@
| $@
\ $@
`-'$@
$@@
,-. $@
| \$@
| |$@
| /$@
`-' $@
$@@
,--.$@
| $@
|- $@
| $@
`--'$@
$@@
,--.$@
| $@
|- $@
| $@
' $@
$@@
,-.$@
/ $@
| -.$@
\ |$@
`-'$@
$@@
. .$@
| |$@
|--|$@
| |$@
' '$@
$@@
,$@
|$@
|$@
|$@
'$@
$@@
,$@
|$@
|$@
|$@
-'$@
$@@
, ,$@
| / $@
|< $@
| \ $@
' `$@
$@@
, $@
| $@
| $@
| $@
`--'$@
$@@
. ,$@
|\ /|$@
| V |$@
| |$@
' '$@
$@@
. .$@
|\ |$@
| \|$@
| |$@
' '$@
$@@
,-. $@
/ \$@
| |$@
\ /$@
`-' $@
$@@
;-. $@
| )$@
|-' $@
| $@
' $@
$@@
,-. $@
/ \ $@
| | $@
\ X $@
`-' `$@
$@@
,-. $@
| )$@
|-< $@
| \$@
' '$@
$@@
,-. $@
( `$@
`-. $@
. )$@
`-' $@
$@@
,---.$@
| $@
| $@
| $@
' $@
$@@
. .$@
| |$@
| |$@
| |$@
`--`$@
$@@
. ,$@
| / $@
| / $@
|/ $@
' $@
$@@
, .$@
| . |$@
| ) )$@
|/|/ $@
' ' $@
$@@
. ,$@
\ / $@
X $@
/ \ $@
' `$@
$@@
. ,$@
\ / $@
Y $@
| $@
' $@
$@@
,---,$@
/ $@
/ $@
/ $@
'---'$@
$@@
,-$@
| $@
| $@
| $@
`-$@
$@@
\ $@
\ $@
\ $@
\ $@
\$@
$@@
-.$@
|$@
|$@
|$@
-'$@
$@@
A $@
/ \$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
---$@@
q$@
$@
$@
$@
$@
$@@
$@
$@
,-:$@
| |$@
`-`$@
$@@
. $@
| $@
|-.$@
| |$@
`-'$@
$@@
$@
$@
,-.$@
| $@
`-'$@
$@@
.$@
|$@
,-|$@
| |$@
`-'$@
$@@
$@
$@
,-.$@
|-'$@
`-'$@
$@@
$@
,-$@
| $@
|-$@
| $@
-' $@@
$@
$@
,-:$@
| |$@
`-|$@
`-'$@@
. $@
| $@
|-.$@
| |$@
' '$@
$@@
$@
o$@
.$@
|$@
'$@
$@@
$@
o$@
,$@
|$@
|$@
-'$@@
, $@
| $@
| ,$@
|< $@
' `$@
$@@
.$@
|$@
|$@
|$@
'$@
$@@
$@
$@
;-.-.$@
| | |$@
' ' '$@
$@@
$@
$@
;-.$@
| |$@
' '$@
$@@
$@
$@
,-.$@
| |$@
`-'$@
$@@
$@
$@
;-.$@
| |$@
|-'$@
' $@@
$@
$@
,-:$@
| |$@
`-|$@
`$@@
$@
$@
;-.$@
| $@
' $@
$@@
$@
$@
,-.$@
`-.$@
`-'$@
$@@
. $@
| $@
|- $@
| $@
`-'$@
$@@
$@
$@
. .$@
| |$@
`-`$@
$@@
$@
$@
. ,$@
|/ $@
' $@
$@@
$@
$@
, , ,$@
|/|/ $@
' ' $@
$@@
$@
$@
. ,$@
X $@
' `$@
$@@
$@
$@
. .$@
| |$@
`-|$@
`-'$@@
$@
$@
,-,$@
/ $@
'-'$@
$@@
,-$@
\ $@
< $@
/ $@
`-$@
$@@
|$@
|$@
|$@
|$@
|$@
$@@
-.$@
/$@
>$@
\$@
-'$@
$@@
$@
'\,$@
$@
$@
$@
$@@
p,.q$@
/ \$@
|--|$@
| |$@
' '$@
$@@
p,-.q$@
/ \$@
| |$@
\ /$@
`-' $@
$@@
p q$@
| |$@
| |$@
| |$@
`--'$@
$@@
$@
p q$@
,-.$@
| |$@
`-'$@
$@@
$@
p q$@
,-.$@
| |$@
`-'$@
$@@
,-. $@
| )$@
| ( $@
| )$@
|-' $@
| $@@
$@
$@
$@
$@
$@
$@@
@@ -0,0 +1,184 @@
import { Transport, FetchLike } from '../shared/transport.js';
import { JSONRPCMessage } from '../types.js';
import { OAuthClientProvider } from './auth.js';
export declare class StreamableHTTPError extends Error {
readonly code: number | undefined;
constructor(code: number | undefined, message: string | undefined);
}
/**
* Options for starting or authenticating an SSE connection
*/
export interface StartSSEOptions {
/**
* The resumption token used to continue long-running requests that were interrupted.
*
* This allows clients to reconnect and continue from where they left off.
*/
resumptionToken?: string;
/**
* A callback that is invoked when the resumption token changes.
*
* This allows clients to persist the latest token for potential reconnection.
*/
onresumptiontoken?: (token: string) => void;
/**
* Override Message ID to associate with the replay message
* so that response can be associate with the new resumed request.
*/
replayMessageId?: string | number;
}
/**
* Configuration options for reconnection behavior of the StreamableHTTPClientTransport.
*/
export interface StreamableHTTPReconnectionOptions {
/**
* Maximum backoff time between reconnection attempts in milliseconds.
* Default is 30000 (30 seconds).
*/
maxReconnectionDelay: number;
/**
* Initial backoff time between reconnection attempts in milliseconds.
* Default is 1000 (1 second).
*/
initialReconnectionDelay: number;
/**
* The factor by which the reconnection delay increases after each attempt.
* Default is 1.5.
*/
reconnectionDelayGrowFactor: number;
/**
* Maximum number of reconnection attempts before giving up.
* Default is 2.
*/
maxRetries: number;
}
/**
* Configuration options for the `StreamableHTTPClientTransport`.
*/
export type StreamableHTTPClientTransportOptions = {
/**
* An OAuth client provider to use for authentication.
*
* When an `authProvider` is specified and the connection is started:
* 1. The connection is attempted with any existing access token from the `authProvider`.
* 2. If the access token has expired, the `authProvider` is used to refresh the token.
* 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`.
*
* After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `StreamableHTTPClientTransport.finishAuth` with the authorization code before retrying the connection.
*
* If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown.
*
* `UnauthorizedError` might also be thrown when sending any message over the transport, indicating that the session has expired, and needs to be re-authed and reconnected.
*/
authProvider?: OAuthClientProvider;
/**
* Customizes HTTP requests to the server.
*/
requestInit?: RequestInit;
/**
* Custom fetch implementation used for all network requests.
*/
fetch?: FetchLike;
/**
* How a redirect of one of the transport's requests is handled, including the OAuth requests it makes for `authProvider`.
*
* - `'same-origin'` (default): a redirect is followed only when it keeps the method and stays within the origin of the request, or goes from http to https on the same host with default ports; any other redirect is not followed and the request fails.
* - `'follow'`: redirects are left to the fetch implementation, as in earlier versions of the SDK.
*
* With either value, a `requestInit.redirect` of `'error'` or `'manual'` is passed to fetch unchanged for the POST requests that carry messages and for DELETE requests.
* The OAuth requests read `requestInit.redirect` only with `'follow'`, and GET requests do not read it.
*/
redirectPolicy?: 'same-origin' | 'follow';
/**
* Options to configure the reconnection behavior.
*/
reconnectionOptions?: StreamableHTTPReconnectionOptions;
/**
* Session ID for the connection. This is used to identify the session on the server.
* When not provided and connecting to a server that supports session IDs, the server will generate a new session ID.
*/
sessionId?: string;
};
/**
* Client transport for Streamable HTTP: this implements the MCP Streamable HTTP transport specification.
* It will connect to a server using HTTP POST for sending messages and HTTP GET with Server-Sent Events
* for receiving messages.
*/
export declare class StreamableHTTPClientTransport implements Transport {
private _abortController?;
private _url;
private _resourceMetadataUrl?;
private _scope?;
private _requestInit?;
private _authProvider?;
private _fetch?;
private _fetchWithInit;
private _followRedirects;
private _sessionId?;
private _reconnectionOptions;
private _protocolVersion?;
private _hasCompletedAuthFlow;
private _lastUpscopingHeader?;
private _serverRetryMs?;
private _reconnectionTimeout?;
onclose?: () => void;
onerror?: (error: Error) => void;
onmessage?: (message: JSONRPCMessage) => void;
constructor(url: URL, opts?: StreamableHTTPClientTransportOptions);
/** Error text for a redirect `response` that was not followed, or `undefined` for any other response. */
private _unfollowedRedirect;
private _authThenStart;
private _commonHeaders;
private _startOrAuthSse;
/**
* Calculates the next reconnection delay using backoff algorithm
*
* @param attempt Current reconnection attempt count for the specific stream
* @returns Time to wait in milliseconds before next reconnection attempt
*/
private _getNextReconnectionDelay;
/**
* Schedule a reconnection attempt using server-provided retry interval or backoff
*
* @param lastEventId The ID of the last received event for resumability
* @param attemptCount Current reconnection attempt count for this specific stream
*/
private _scheduleReconnection;
private _handleSseStream;
start(): Promise<void>;
/**
* Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth.
*/
finishAuth(authorizationCode: string): Promise<void>;
close(): Promise<void>;
send(message: JSONRPCMessage | JSONRPCMessage[], options?: {
resumptionToken?: string;
onresumptiontoken?: (token: string) => void;
}): Promise<void>;
get sessionId(): string | undefined;
/**
* Terminates the current session by sending a DELETE request to the server.
*
* Clients that no longer need a particular session
* (e.g., because the user is leaving the client application) SHOULD send an
* HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header to explicitly
* terminate the session.
*
* The server MAY respond with HTTP 405 Method Not Allowed, indicating that
* the server does not allow clients to terminate sessions.
*/
terminateSession(): Promise<void>;
setProtocolVersion(version: string): void;
get protocolVersion(): string | undefined;
/**
* Resume an SSE stream from a previous event ID.
* Opens a GET SSE connection with Last-Event-ID header to replay missed events.
*
* @param lastEventId The event ID to resume from
* @param options Optional callback to receive new resumption tokens
*/
resumeStream(lastEventId: string, options?: {
onresumptiontoken?: (token: string) => void;
}): Promise<void>;
}
//# sourceMappingURL=streamableHttp.d.ts.map
@@ -0,0 +1,85 @@
<div align="center">
<a href="https://hono.dev">
<img src="https://raw.githubusercontent.com/honojs/hono/main/docs/images/hono-title.png" width="500" height="auto" alt="Hono"/>
</a>
</div>
<hr />
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/honojs/hono/ci.yml?branch=main)](https://github.com/honojs/hono/actions)
[![GitHub](https://img.shields.io/github/license/honojs/hono)](https://github.com/honojs/hono/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/v/hono)](https://www.npmjs.com/package/hono)
[![npm](https://img.shields.io/npm/dm/hono)](https://www.npmjs.com/package/hono)
[![JSR](https://jsr.io/badges/@hono/hono)](https://jsr.io/@hono/hono)
[![Bundle Size](https://img.shields.io/bundlephobia/min/hono)](https://bundlephobia.com/result?p=hono)
[![Bundle Size](https://img.shields.io/bundlephobia/minzip/hono)](https://bundlephobia.com/result?p=hono)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/honojs/hono)](https://github.com/honojs/hono/pulse)
[![GitHub last commit](https://img.shields.io/github/last-commit/honojs/hono)](https://github.com/honojs/hono/commits/main)
[![codecov](https://codecov.io/github/honojs/hono/graph/badge.svg)](https://codecov.io/github/honojs/hono)
[![Discord badge](https://img.shields.io/discord/1011308539819597844?label=Discord&logo=Discord)](https://discord.gg/KMh2eNSdxV)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/honojs/hono)
Hono - _**means flame🔥 in Japanese**_ - is a small, simple, and ultrafast web framework built on Web Standards. It works on any JavaScript runtime: Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, AWS Lambda, Lambda@Edge, and Node.js.
Fast, but not only fast.
```ts
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hono!'))
export default app
```
## Quick Start
```bash
npm create hono@latest
```
## Features
- **Ultrafast** 🚀 - The router `RegExpRouter` is really fast. Not using linear loops. Fast.
- **Lightweight** 🪶 - The `hono/tiny` preset is under 12kB. Hono has zero dependencies and uses only the Web Standard API.
- **Multi-runtime** 🌍 - Works on Cloudflare Workers, Fastly Compute, Deno, Bun, AWS Lambda, Lambda@Edge, or Node.js. The same code runs on all platforms.
- **Batteries Included** 🔋 - Hono has built-in middleware, custom middleware, and third-party middleware. Batteries included.
- **Delightful DX** 😃 - Super clean APIs. First-class TypeScript support. Now, we've got "Types".
## Documentation
The documentation is available on [hono.dev](https://hono.dev).
## Migration
The migration guide is available on [docs/MIGRATION.md](docs/MIGRATION.md).
## Communication
[X](https://x.com/honojs) and [Discord channel](https://discord.gg/KMh2eNSdxV) are available.
## Contributing
Contributions Welcome! You can contribute in the following ways.
- Create an Issue - Propose a new feature. Report a bug.
- Pull Request - Fix a bug or typo. Refactor the code.
- Create third-party middleware - See [Third-party middleware](docs/CONTRIBUTING.md#third-party-middleware).
- Share - Share your thoughts on the Blog, X, and others.
- Make your application - Please try to use Hono.
For more details, see [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md).
## Contributors
Thanks to [all contributors](https://github.com/honojs/hono/graphs/contributors)!
## Authors
Yusuke Wada <https://github.com/yusukebe>
_RegExpRouter_, _SmartRouter_, _LinearRouter_, and _PatternRouter_ are created by Taku Amano <https://github.com/usualoma>
## License
Distributed under the MIT License. See [LICENSE](LICENSE) for more information.
@@ -0,0 +1,84 @@
/**
* @fileoverview Rule to flag references to undeclared variables.
* @author Mark Macdonald
*/
"use strict";
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Checks if the given node is the argument of a typeof operator.
* @param {ASTNode} node The AST node being checked.
* @returns {boolean} Whether or not the node is the argument of a typeof operator.
*/
function hasTypeOfOperator(node) {
const parent = node.parent;
return parent.type === "UnaryExpression" && parent.operator === "typeof";
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: [
{
typeof: false,
},
],
docs: {
description:
"Disallow the use of undeclared variables unless mentioned in `/*global */` comments",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-undef",
},
schema: [
{
type: "object",
properties: {
typeof: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
undef: "'{{name}}' is not defined.",
},
},
create(context) {
const [{ typeof: considerTypeOf }] = context.options;
const sourceCode = context.sourceCode;
return {
"Program:exit"(node) {
const globalScope = sourceCode.getScope(node);
globalScope.through.forEach(ref => {
const identifier = ref.identifier;
if (!considerTypeOf && hasTypeOfOperator(identifier)) {
return;
}
context.report({
node: identifier,
messageId: "undef",
data: identifier,
});
});
},
};
},
};
@@ -0,0 +1,826 @@
export default `flf2a$ 8 7 20 -1 8
ARROWS by Ron Fritz 8/94
Figlet Release 2.0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
>=>@
>=>@
>=>@
>>$@
>>$@
@
>=>@
@@
>> >>@
>> >>@
@
@
@
@
@
@@
@
>=> >=>$$$@
>=====>>===>$@
>=> >=>$$$@
>=> >=>$$$@
>=====>>===>$@
>=> >=>$$$@
@@
>=> $@
>=>>=>$@
>=> $@
>=> $@
>=> $@
>=>>==>$@
>=> $@
@@
@
>=> >=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> >=>$@
@@
>> $@
>=>>=>$@
>=> $@
>==> $@
>=> $@
>=>>=>$@
>> $@
@@
>=>$@
>>$@
@
@
@
@
@
@@
>=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=>$@
@@
>=> $@
>=> $@
>=>$@
>=>$@
>=>$@
>=> $@
>=> $@
@@
>=> $@
>> >=> >> $@
> >=> > $@
>===>>=>>===>$@
> >=> > $@
>> >=> >> $@
>=> $@
@@
@
>=> $@
>=> $@
>==> >====>$@
>=> $@
>=> $@
@
@@
@
@
@
@
@
@
>=>$@
>>$@@
@
@
@
>====>$@
@
@
@
@@
@
@
@
@
@
@
>=>$@
@@
>=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
@@
@
>=> $@
>=> >=> $@
>=> >=> $@
>=> >=>$@
>=> >=> $@
>==> $@
@@
@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>===>$@
@@
@
>=>>=> $@
>> >=>$@
>=> $@
>=> $@
>=> $@
>======>$@
@@
@
>=>>=> $@
>=> $@
>=> $@
>=> $@
>=>$@
>====> $@
@@
@
>=> $@
>>=> $@
> >=> $@
>=> >=> $@
>===>>=>>=>$@
>=> $@
$@@
@
>=>>==> $@
>=> $@
>==> $@
>=> $@
>=>$@
>==>>=> $@
@@
@
>=> $@
>=> $@
>=> $@
>=> >=> $@
>=> >=>$@
>=>>=> $@
@@
@
>====>>=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
@@
@
>=> $@
>> >=>$@
>> >>$@
>=>>=> $@
>> >>$@
>====> $@
@@
@
>> >=> $@
>=> >=>$@
>> >=>$@
>=> >=> $@
>=> $@
>=> $@
@@
@
@
@
@
>=>$@
$@
>=>$@
@@
@
@
@
@
>=>$@
$@
>=>$@
>>$@@
>=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=>$@
@@
$@
$@
>=====>$@
$@
>=====>$@
$@
$@
@@
>=> $@
>=> $@
>=> $@
>=>$@
>=> $@
>=> $@
>=> $@
@@
>==> $@
>=> $@
>=>$@
>=> $@
>=> $@
$@
>=> $@
@@
$@
>==> $@
>> >=> $@
>> >=> >=>$@
>=> >==> >=>$@
>=> \`\`\` $@
>=> $@
@@
>> $@
>>=> $@
>> >=> $@
>=> >=> $@
>=====>>=> $@
>=> >=> $@
>=> >=>$@
@@
>=>>=> $@
>> >=> $@
>> >=>$@
>==>>=> $@
>> >=>$@
>> >>$@
>===>>=> $@
@@
>=> $@
>=> >=>$@
>=> $@
>=> $@
>=> $@
>=> >=>$@
>===> $@
@@
>====> $@
>=> >=> $@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=> $@
>====> $@
@@
>=======>$@
>=> $@
>=> $@
>=====> $@
>=> $@
>=> $@
>=======>$@
@@
>=======>$@
>=> $@
>=> $@
>=====> $@
>=> $@
>=> $@
>=> $@
@@
>===> $@
>> >=> $@
>=> $@
>=> $@
>=> >===>$@
>=> >> $@
>====> $@
@@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=====>>=>$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
@@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
@@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>> >=>$@
>===> $@
@@
>=> >=> $@
>=> >=> $@
>=> >=> $@
>>=>> $@
>=> >=> $@
>=> >=> $@
>=> >=>$@
@@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=======>$@
@@
>=> >=>$@
>> >=> >>=>$@
>=> >=> > >=>$@
>=> >=> >=>$@
>=> >> >=>$@
>=> >=>$@
>=> >=>$@
@@
>==> >=>$@
>> >=> >=>$@
>=> >=> >=>$@
>=> >=>>=>$@
>=> > >=>$@
>=> >>=>$@
>=> >=>$@
@@
>===> $@
>=> >=> $@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=> $@
>===> $@
@@
>======> $@
>=> >=>$@
>=> >=>$@
>======> $@
>=> $@
>=> $@
>=> $@
@@
>===> $@
>=> >=> $@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >> >=> $@
>= >>=> $@
>> @@
>======> $@
>=> >=> $@
>=> >=> $@
>> >==> $@
>=> >=> $@
>=> >=> $@
>=> >=>$@
@@
>=>>=> $@
>=> >=>$@
>=> $@
>=> $@
>=> $@
>=> >=>$@
>=>>=> $@
@@
>===>>=====>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
@@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>====> $@
@@
>=> >=>$@
>=> >=> $@
>=> >=> $@
>=> >=> $@
>=> >=> $@
>===> $@
>=> $@
@@
>=> >=>$@
>=> >=>$@
>=> >> >=>$@
>=> >=> >=>$@
>=> >> >=> >=>$@
>> >> >===>$@
>=> >=>$@
@@
>=> >=>$@
>=> >=> $@
>=> >=> $@
>=> $@
>=> >=> $@
>=> >=> $@
>=> >=>$@
@@
>=> >=>$@
>=> >=> $@
>=> >=> $@
>=> $@
>=> $@
>=> $@
>=> $@
@@
>=======>>=>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>==========>$@
@@
>===>$@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>===>$@
@@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=> $@
>=>$@
@@
>===>$@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>===>$@
@@
>=> $@
>=> >=> $@
>=> >=>$@
$@
$@
$@
$@
@@
$@
$@
$@
$@
$@
$@
$@
>====>$@@
>=>$@
>> $@
$@
$@
$@
$@
$@
@@
$@
$@
>=> >=> $@
>=> >=> $@
>=> >=> $@
>=> >=> $@
>==>>>==>$@
@@
>=> $@
>=> $@
>=> $@
>=>>==> $@
>=> >=>$@
>=> >=>$@
>=>>==> $@
@@
$@
$@
>==>$@
>=> $@
>=> $@
>=> $@
>==>$@
@@
>=>$@
>=>$@
>=>$@
>=>>=>$@
>> >=>$@
>> >=>$@
>=>>=>$@
@@
$@
$@
>==> $@
>> >=> $@
>>===>>=>$@
>> $@
>====> $@
@@
>=>$@
>> $@
>=>> >>$@
>=> $@
>=> $@
>=> $@
>=> $@
@@
$@
$@
>=> $@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> $@
>=> $@@
$@
>=> $@
>=> $@
>=>>=> $@
>=> >=>$@
>> >=>$@
>=> >=>$@
@@
$@
>>$@
$@
>=>$@
>=>$@
>=>$@
>=>$@
@@
$@
>=>$@
$@
>=>$@
>=>$@
>=>$@
>=>$@
>==> $@@
>=> $@
>=> $@
>=> >=>$@
>=> >=> $@
>=>=> $@
>=> >=> $@
>=> >=>$@
@@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>=>$@
>==>$@
@@
$@
$@
>===>>=>>==> $@
>=> >> >=>$@
>=> >> >=>$@
>=> >> >=>$@
>==> >> >=>$@
@@
$@
$@
>==>>==> $@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>==> >=>$@
@@
$@
$@
>=> $@
>=> >=> $@
>=> >=>$@
>=> >=> $@
>=> $@
@@
$@
$@
>=> >=> $@
>> >=>$@
>> >=>$@
>=> >=> $@
>=> $@
>=> $@@
$@
$@
>=> $@
>> >=> $@
>> >=> $@
>==>=> $@
>=> $@
>==>$@@
$@
$@
>> >==>$@
>=> $@
>=> $@
>=> $@
>==> $@
@@
$@
$@
>===> $@
>=> $@
>==> $@
>=>$@
>=> >=>$@
@@
>=> $@
>=> $@
>=>>==>$@
>=> $@
>=> $@
>=> $@
>=> $@
@@
$@
$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>=> >=>$@
>==>=>$@
@@
$@
$@
>=> >=>$@
>=> >=> $@
>=> >=> $@
>=>=> $@
>=> $@
@@
$@
$@
>=> >=>$@
>=> > >=>$@
>=> >> >=>$@
>=>> >=>=>$@
>==> >==>$@
@@
$@
$@
>=> >=>$@
>> >=> $@
>> $@
>> >=> $@
>=> >=>$@
@@
$@
$@
>=> >=>$@
>=> >=> $@
>==> $@
>=> $@
>=> $@
>=> $@@
$@
$@
>====>>=>$@
>=> $@
>=> $@
>=> $@
>=======>$@
@@
<=<$@
<=< $@
<=< $@
<=< $@
<=< $@
<=< $@
<=<$@
@@
>>$@
>>$@
>>$@
$@
>>$@
>>$@
>>$@
@@
>=> $@
>=> $@
>=> $@
>=>$@
>=> $@
>=> $@
>=> $@
@@
>=> >> $@
>> >=>$@
$@
$@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/primitive.tsx"],
"sourcesContent": ["export * from './primitive';\nexport type * from './types';\n", "/* eslint-disable no-restricted-properties */\n\n/* eslint-disable no-restricted-globals */\nexport const canUseDOM = !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n/* eslint-enable no-restricted-globals */\n\nexport function composeEventHandlers<E extends { defaultPrevented: boolean }>(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {},\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n\nexport function getOwnerWindow(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access window outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument?.defaultView ?? window;\n}\n\nexport function getOwnerDocument(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access document outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument ?? document;\n}\n\n/**\n * Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37\n * MIT License, Copyright (c) AriaKit.\n */\nexport function getActiveElement(\n node: Node | null | undefined,\n activeDescendant = false,\n): HTMLElement | null {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n // `activeElement` might be an empty object if we're interacting with elements\n // inside of an iframe.\n return null;\n }\n\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n\n if (activeDescendant) {\n const id = activeElement.getAttribute('aria-activedescendant');\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n\n return activeElement as HTMLElement | null;\n}\n\nexport function isFrame(element: Element): element is HTMLIFrameElement {\n return element.tagName === 'IFRAME';\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,YAAY,CAAC,EACxB,OAAO,WAAW,eAClB,OAAO,YACP,OAAO,SAAS;AAIX,SAAS,qBACd,sBACA,iBACA,EAAE,2BAA2B,KAAK,IAAI,CAAC,GACvC;AACA,SAAO,SAAS,YAAY,OAAU;AACpC,2BAAuB,KAAK;AAE5B,QAAI,6BAA6B,SAAS,CAAC,SAAS,CAAC,MAAM,kBAAkB;AAC3E,aAAO,kBAAkB,KAAK;AAAA,IAChC;AAAA,EACF;AACF;AAEO,SAAS,eAAe,SAAkC;AAC/D,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC3D;AAEA,SAAO,SAAS,eAAe,eAAe;AAChD;AAEO,SAAS,iBAAiB,SAAkC;AACjE,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,2CAA2C;AAAA,EAC7D;AAEA,SAAO,SAAS,iBAAiB;AACnC;AAMO,SAAS,iBACd,MACA,mBAAmB,OACC;AACpB,QAAM,EAAE,cAAc,IAAI,iBAAiB,IAAI;AAC/C,MAAI,CAAC,eAAe,UAAU;AAG5B,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,aAAa,KAAK,cAAc,iBAAiB;AAC3D,WAAO,iBAAiB,cAAc,gBAAgB,MAAM,gBAAgB;AAAA,EAC9E;AAEA,MAAI,kBAAkB;AACpB,UAAM,KAAK,cAAc,aAAa,uBAAuB;AAC7D,QAAI,IAAI;AACN,YAAM,UAAU,iBAAiB,aAAa,EAAE,eAAe,EAAE;AACjE,UAAI,SAAS;AACX,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,QAAQ,SAAgD;AACtE,SAAO,QAAQ,YAAY;AAC7B;",
"names": []
}
@@ -0,0 +1,19 @@
/**
* @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 FileText = createLucideIcon("FileText", [
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["path", { d: "M10 9H8", key: "b1mrlr" }],
["path", { d: "M16 13H8", key: "t4e002" }],
["path", { d: "M16 17H8", key: "z1uh3a" }]
]);
export { FileText as default };
//# sourceMappingURL=file-text.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_tQ","132":"_K","322":"C"},C:{"1":"_QI","2":"_HF"},D:{"2":"_kJ","132":"_oO"},E:{"2":"_R"},F:{"2":"_T","132":"_a"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_G","132":"I"},J:{"2":"_B"},K:{"2":"_D","132":"H"},L:{"132":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"132":"bC"},P:{"2":"J","132":"_U"},Q:{"132":"JE"},R:{"132":"KE"},S:{"1":"_C"}},B:6,C:"asm.js",D:true};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_IB","132":"_LC"},B:{"1":"_K","132":"_I"},C:{"1":"_H _qT","2":"_pL","132":"_jC _JR _aF"},D:{"1":"_ZD","16":"_Y"},E:{"1":"_YQ","2":"_gG _oE"},F:{"1":"_a","132":"_T"},G:{"1":"_gL","2":"_AF _oE"},H:{"16":"1D"},I:{"16":"_P"},J:{"16":"_B"},K:{"1":"H","16":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"258":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"132":"_C"}},B:5,C:"CSS Paged Media (@page)",D:true};
@@ -0,0 +1 @@
{"version":3,"names":["_t","require","_util","BOOLEAN_NUMBER_BINARY_OPERATORS","createTypeAnnotationBasedOnTypeof","numberTypeAnnotation","voidTypeAnnotation","_default","node","isReferenced","binding","scope","getBinding","name","identifier","typeAnnotation","getTypeAnnotationBindingConstantViolations","path","types","functionConstantViolations","constantViolations","getConstantViolationsBefore","testType","getConditionalAnnotation","testConstantViolations","ifStatement","filter","includes","push","length","violation","getTypeAnnotation","createUnionType","functions","violations","slice","unshift","resolve","status","_guessExecutionStatusRelativeTo","inferAnnotationFromBinaryExpression","operator","right","get","left","target","isIdentifier","typeofPath","typePath","isUnaryExpression","isLiteral","typeValue","value","getParentConditionalPath","parentPath","isIfStatement","isConditionalExpression","key","isFunction","test","paths","i","isLogicalExpression","isBinaryExpression","type"],"sources":["../../../src/path/inference/inferer-reference.ts"],"sourcesContent":["import type NodePath from \"../index.ts\";\nimport {\n BOOLEAN_NUMBER_BINARY_OPERATORS,\n createTypeAnnotationBasedOnTypeof,\n numberTypeAnnotation,\n voidTypeAnnotation,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type Binding from \"../../scope/binding.ts\";\n\nimport { createUnionType } from \"./util.ts\";\n\nexport default function (this: NodePath<t.Identifier>, node: t.Identifier) {\n if (!this.isReferenced()) return;\n\n // check if a binding exists of this value and if so then return a union type of all\n // possible types that the binding could be\n const binding = this.scope.getBinding(node.name);\n if (binding) {\n if (binding.identifier.typeAnnotation) {\n return binding.identifier.typeAnnotation;\n } else {\n return getTypeAnnotationBindingConstantViolations(\n binding,\n this,\n node.name,\n );\n }\n }\n\n // built-in values\n if (node.name === \"undefined\") {\n return voidTypeAnnotation();\n } else if (node.name === \"NaN\" || node.name === \"Infinity\") {\n return numberTypeAnnotation();\n } else if (node.name === \"arguments\") {\n // todo\n }\n}\n\nfunction getTypeAnnotationBindingConstantViolations(\n binding: Binding,\n path: NodePath<t.Identifier>,\n name: string,\n) {\n const types = [];\n\n const functionConstantViolations: NodePath[] = [];\n let constantViolations = getConstantViolationsBefore(\n binding,\n path,\n functionConstantViolations,\n );\n\n const testType = getConditionalAnnotation(binding, path, name);\n if (testType) {\n const testConstantViolations = getConstantViolationsBefore(\n binding,\n testType.ifStatement,\n );\n\n // remove constant violations observed before the IfStatement\n constantViolations = constantViolations.filter(\n path => !testConstantViolations.includes(path),\n );\n\n // clear current types and add in observed test type\n types.push(testType.typeAnnotation);\n }\n\n if (constantViolations.length) {\n // pick one constant from each scope which will represent the last possible\n // control flow path that it could've taken/been\n /* This code is broken for the following problems:\n * It thinks that assignments can only happen in scopes.\n * What about conditionals, if statements without block,\n * or guarded assignments.\n * It also checks to see if one of the assignments is in the\n * same scope and uses that as the only \"violation\". However,\n * the binding is returned by `getConstantViolationsBefore` so we for\n * sure always going to return that as the only \"violation\".\n let rawConstantViolations = constantViolations.reverse();\n let visitedScopes = [];\n constantViolations = [];\n for (let violation of (rawConstantViolations: Array<NodePath>)) {\n let violationScope = violation.scope;\n if (visitedScopes.indexOf(violationScope) >= 0) continue;\n\n visitedScopes.push(violationScope);\n constantViolations.push(violation);\n\n if (violationScope === path.scope) {\n constantViolations = [violation];\n break;\n }\n }*/\n\n // add back on function constant violations since we can't track calls\n constantViolations.push(...functionConstantViolations);\n\n // push on inferred types of violated paths\n for (const violation of constantViolations) {\n types.push(violation.getTypeAnnotation());\n }\n }\n\n if (!types.length) {\n return;\n }\n\n return createUnionType(types);\n}\n\nfunction getConstantViolationsBefore(\n binding: Binding,\n path: NodePath,\n functions?: NodePath[],\n) {\n const violations = binding.constantViolations.slice();\n violations.unshift(binding.path);\n return violations.filter(violation => {\n violation = violation.resolve();\n const status = violation._guessExecutionStatusRelaLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"mcpServerOutputSchema.js","sourceRoot":"","sources":["../../../../src/examples/server/mcpServerOutputSchema.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IACzB,IAAI,EAAE,sCAAsC;IAC5C,OAAO,EAAE,OAAO;CACnB,CAAC,CAAC;AAEH,sDAAsD;AACtD,MAAM,CAAC,YAAY,CACf,aAAa,EACb;IACI,WAAW,EAAE,oCAAoC;IACjD,WAAW,EAAE;QACT,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;QACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;KAC9D;IACD,YAAY,EAAE;QACV,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YAClB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;YACnB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;SACzB,CAAC;QACF,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACnE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACpC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;YACX,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;YACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;SACxB,CAAC;KACL;CACJ,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IACxB,wDAAwD;IACxD,KAAK,IAAI,CAAC;IACV,KAAK,OAAO,CAAC;IACb,4BAA4B;IAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;IAC9D,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAElG,MAAM,iBAAiB,GAAG;QACtB,WAAW,EAAE;YACT,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE;SAC5D;QACD,UAAU;QACV,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;QACzC,IAAI,EAAE;YACF,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC;YACzC,SAAS,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;SACzF;KACJ,CAAC;IAEF,OAAO;QACH,OAAO,EAAE;YACL;gBACI,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;aACnD;SACJ;QACD,iBAAiB;KACpB,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,KAAK,UAAU,IAAI;IACf,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC9E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
import { Hono } from "../../hono.js";
//#region src/adapter/vercel/handler.d.ts
/**
* @deprecated `hono/vercel` will be removed in v5. Install `@hono/vercel` and import from there instead.
*/
export declare const handle: (app: Hono<any, any, any>) => (req: Request) => Response | Promise<Response>;
//#endregion
@@ -0,0 +1,8 @@
// packages/react/use-layout-effect/src/use-layout-effect.tsx
import * as React from "react";
var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
};
export {
useLayoutEffect2 as useLayoutEffect
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,70 @@
/**
* @fileoverview Rule to enforce description with the `Symbol` object
* @author Jarek Rencz
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Require symbol descriptions",
recommended: false,
url: "https://eslint.org/docs/latest/rules/symbol-description",
},
fixable: null,
schema: [],
messages: {
expected: "Expected Symbol to have a description.",
},
},
create(context) {
const sourceCode = context.sourceCode;
/**
* Reports if node does not conform the rule in case rule is set to
* report missing description
* @param {ASTNode} node A CallExpression node to check.
* @returns {void}
*/
function checkArgument(node) {
if (node.arguments.length === 0) {
context.report({
node,
messageId: "expected",
});
}
}
return {
"Program:exit"(node) {
const scope = sourceCode.getScope(node);
const variable = astUtils.getVariableByName(scope, "Symbol");
if (variable && variable.defs.length === 0) {
variable.references.forEach(reference => {
const idNode = reference.identifier;
if (astUtils.isCallee(idNode)) {
checkArgument(idNode.parent);
}
});
}
},
};
},
};