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,171 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
function removeSpaces(str) {
return str.replaceAll(/\s/g, '');
}
function stringifyNode(node, sourceCode) {
return removeSpaces(sourceCode.getText(node));
}
function getCustomMessage(bannedType) {
if (!bannedType || bannedType === true) {
return '';
}
if (typeof bannedType === 'string') {
return ` ${bannedType}`;
}
if (bannedType.message) {
return ` ${bannedType.message}`;
}
return '';
}
const TYPE_KEYWORDS = {
bigint: utils_1.AST_NODE_TYPES.TSBigIntKeyword,
boolean: utils_1.AST_NODE_TYPES.TSBooleanKeyword,
never: utils_1.AST_NODE_TYPES.TSNeverKeyword,
null: utils_1.AST_NODE_TYPES.TSNullKeyword,
number: utils_1.AST_NODE_TYPES.TSNumberKeyword,
object: utils_1.AST_NODE_TYPES.TSObjectKeyword,
string: utils_1.AST_NODE_TYPES.TSStringKeyword,
symbol: utils_1.AST_NODE_TYPES.TSSymbolKeyword,
undefined: utils_1.AST_NODE_TYPES.TSUndefinedKeyword,
unknown: utils_1.AST_NODE_TYPES.TSUnknownKeyword,
void: utils_1.AST_NODE_TYPES.TSVoidKeyword,
};
exports.default = (0, util_1.createRule)({
name: 'no-restricted-types',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow certain types',
},
fixable: 'code',
hasSuggestions: true,
messages: {
bannedTypeMessage: "Don't use `{{name}}` as a type.{{customMessage}}",
bannedTypeReplacement: 'Replace `{{name}}` with `{{replacement}}`.',
},
schema: [
{
type: 'object',
$defs: {
banConfig: {
oneOf: [
{
type: 'boolean',
description: 'Bans the type with the default message.',
enum: [true],
},
{
type: 'string',
description: 'Bans the type with a custom message.',
},
{
type: 'object',
additionalProperties: false,
description: 'Bans a type.',
properties: {
fixWith: {
type: 'string',
description: 'Type to autofix replace with. Note that autofixers can be applied automatically - so you need to be careful with this option.',
},
message: {
type: 'string',
description: 'Custom error message.',
},
suggest: {
type: 'array',
description: 'Types to suggest replacing with.',
items: { type: 'string' },
},
},
},
],
},
},
additionalProperties: false,
properties: {
types: {
type: 'object',
additionalProperties: {
$ref: '#/items/0/$defs/banConfig',
},
description: 'An object whose keys are the types you want to ban, and the values are error messages.',
},
},
},
],
},
defaultOptions: [{}],
create(context, [{ types = {} }]) {
const bannedTypes = new Map(Object.entries(types).map(([type, data]) => [removeSpaces(type), data]));
function checkBannedTypes(typeNode, name = stringifyNode(typeNode, context.sourceCode)) {
const bannedType = bannedTypes.get(name);
if (bannedType == null || bannedType === false) {
return;
}
const customMessage = getCustomMessage(bannedType);
const fixWith = bannedType && typeof bannedType === 'object' && bannedType.fixWith;
const suggest = bannedType && typeof bannedType === 'object'
? bannedType.suggest
: undefined;
context.report({
node: typeNode,
messageId: 'bannedTypeMessage',
data: {
name,
customMessage,
},
fix: fixWith
? (fixer) => fixer.replaceText(typeNode, fixWith)
: null,
suggest: suggest?.map(replacement => ({
messageId: 'bannedTypeReplacement',
data: {
name,
replacement,
},
fix: (fixer) => fixer.replaceText(typeNode, replacement),
})),
});
}
const keywordSelectors = (0, util_1.objectReduceKey)(TYPE_KEYWORDS, (acc, keyword) => {
if (bannedTypes.has(keyword)) {
acc[TYPE_KEYWORDS[keyword]] = (node) => checkBannedTypes(node, keyword);
}
return acc;
}, {});
return {
...keywordSelectors,
TSClassImplements(node) {
checkBannedTypes(node.expression);
if (node.typeArguments) {
checkBannedTypes(node);
}
},
TSInterfaceHeritage(node) {
checkBannedTypes(node.expression);
if (node.typeArguments) {
checkBannedTypes(node);
}
},
TSTupleType(node) {
if (!node.elementTypes.length) {
checkBannedTypes(node);
}
},
TSTypeLiteral(node) {
if (!node.members.length) {
checkBannedTypes(node);
}
},
TSTypeReference(node) {
checkBannedTypes(node.typeName);
if (node.typeArguments) {
checkBannedTypes(node);
}
},
};
},
});
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_ZE","260":"C","514":"_CC G"},C:{"1":"_5J","2":"_MP","194":"_6I _QF"},D:{"1":"_4J","2":"_8N","260":"_iE _QF"},E:{"2":"_5C","260":"E PD","1028":"_AS","2052":"_XQ","3076":"_FS _mK _lJ"},F:{"1":"_3G","2":"_j _fF _O","260":"_hN"},G:{"1":"_fL","2":"_EB","260":"_lC","1028":"_UI _lJ"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"Srcset and sizes attributes",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"lazyRouteComponent.js","names":[],"sources":["../../src/lazyRouteComponent.tsx"],"sourcesContent":["import * as React from 'react'\nimport { isModuleNotFoundError } from '@tanstack/router-core'\nimport { reactUse } from './utils'\nimport type { AsyncRouteComponent } from './route'\n\n/**\n * Wrap a dynamic import to create a route component that supports\n * `.preload()` and friendly reload-on-module-missing behavior.\n *\n * @param importer Function returning a module promise\n * @param exportName Named export to use (default: `default`)\n * @returns A lazy route component compatible with TanStack Router\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/lazyRouteComponentFunction\n */\nexport function lazyRouteComponent<\n T extends Record<string, any>,\n TKey extends keyof T = 'default',\n>(\n importer: () => Promise<T>,\n exportName?: TKey,\n): T[TKey] extends (props: infer TProps) => any\n ? AsyncRouteComponent<TProps>\n : never {\n let loadPromise: Promise<any> | undefined\n let comp: T[TKey] | T['default']\n let error: any\n let reload: boolean\n\n const load = () => {\n if (!loadPromise) {\n loadPromise = importer()\n .then((res) => {\n loadPromise = undefined\n comp = res[exportName ?? 'default']\n })\n .catch((err) => {\n // We don't want an error thrown from preload in this case, because\n // there's nothing we want to do about module not found during preload.\n // Record the error, the rest is handled during the render path.\n error = err\n // If the load fails due to module not found, it may mean a new version of\n // the build was deployed and the user's browser is still using an old version.\n // If this happens, the old version in the user's browser would have an outdated\n // URL to the lazy module.\n // In that case, we want to attempt one window refresh to get the latest.\n if (isModuleNotFoundError(error)) {\n if (\n error instanceof Error &&\n typeof window !== 'undefined' &&\n typeof sessionStorage !== 'undefined'\n ) {\n // Again, we want to reload one time on module not found error and not enter\n // a reload loop if there is some other issue besides an old deploy.\n // That's why we store our reload attempt in sessionStorage.\n // Use error.message as key because it contains the module path that failed.\n const storageKey = `tanstack_router_reload:${error.message}`\n if (!sessionStorage.getItem(storageKey)) {\n sessionStorage.setItem(storageKey, '1')\n reload = true\n }\n }\n }\n })\n }\n\n return loadPromise\n }\n\n const lazyComp = function Lazy(props: any) {\n // Now that we're out of preload and into actual render path,\n if (reload) {\n // If it was a module loading error,\n // throw eternal suspense while we wait for window to reload\n window.location.reload()\n throw new Promise(() => {})\n }\n if (error) {\n // Otherwise, just throw the error\n throw error\n }\n\n if (!comp) {\n if (reactUse) {\n reactUse(load())\n } else {\n throw load()\n }\n }\n\n return React.createElement(comp, props)\n }\n\n ;(lazyComp as any).preload = load\n\n return lazyComp as any\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgB,mBAId,UACA,YAGQ;CACR,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,MAAM,aAAa;AACjB,MAAI,CAAC,YACH,eAAc,UAAU,CACrB,MAAM,QAAQ;AACb,iBAAc,KAAA;AACd,UAAO,IAAI,cAAc;IACzB,CACD,OAAO,QAAQ;AAId,WAAQ;AAMR,OAAI,sBAAsB,MAAM;QAE5B,iBAAiB,SACjB,OAAO,WAAW,eAClB,OAAO,mBAAmB,aAC1B;KAKA,MAAM,aAAa,0BAA0B,MAAM;AACnD,SAAI,CAAC,eAAe,QAAQ,WAAW,EAAE;AACvC,qBAAe,QAAQ,YAAY,IAAI;AACvC,eAAS;;;;IAIf;AAGN,SAAO;;CAGT,MAAM,WAAW,SAAS,KAAK,OAAY;AAEzC,MAAI,QAAQ;AAGV,UAAO,SAAS,QAAQ;AACxB,SAAM,IAAI,cAAc,GAAG;;AAE7B,MAAI,MAEF,OAAM;AAGR,MAAI,CAAC,KACH,KAAI,SACF,UAAS,MAAM,CAAC;MAEhB,OAAM,MAAM;AAIhB,SAAO,QAAM,cAAc,MAAM,MAAM;;AAGvC,UAAiB,UAAU;AAE7B,QAAO"}
@@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../../compile/util");
const codegen_1 = require("../../compile/codegen");
const metadata_1 = require("./metadata");
const nullable_1 = require("./nullable");
const error_1 = require("./error");
const def = {
keyword: "values",
schemaType: "object",
error: (0, error_1.typeError)("object"),
code(cxt) {
(0, metadata_1.checkMetadata)(cxt);
const { gen, data, schema, it } = cxt;
const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data);
if ((0, util_1.alwaysValidSchema)(it, schema)) {
gen.if((0, codegen_1.not)((0, codegen_1.or)(cond, valid)), () => cxt.error());
}
else {
gen.if(cond);
gen.assign(valid, validateMap());
gen.elseIf((0, codegen_1.not)(valid));
cxt.error();
gen.endIf();
}
cxt.ok(valid);
function validateMap() {
const _valid = gen.name("valid");
if (it.allErrors) {
const validMap = gen.let("valid", true);
validateValues(() => gen.assign(validMap, false));
return validMap;
}
gen.var(_valid, true);
validateValues(() => gen.break());
return _valid;
function validateValues(notValid) {
gen.forIn("key", data, (key) => {
cxt.subschema({
keyword: "values",
dataProp: key,
dataPropType: util_1.Type.Str,
}, _valid);
gen.if((0, codegen_1.not)(_valid), notValid);
});
}
}
},
};
exports.default = def;
//# sourceMappingURL=values.js.map
@@ -0,0 +1,206 @@
# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions)
> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save is-glob
```
You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob).
## Usage
```js
var isGlob = require('is-glob');
```
### Default behavior
**True**
Patterns that have glob characters or regex patterns will return `true`:
```js
isGlob('!foo.js');
isGlob('*.js');
isGlob('**/abc.js');
isGlob('abc/*.js');
isGlob('abc/(aaa|bbb).js');
isGlob('abc/[a-z].js');
isGlob('abc/{a,b}.js');
//=> true
```
Extglobs
```js
isGlob('abc/@(a).js');
isGlob('abc/!(a).js');
isGlob('abc/+(a).js');
isGlob('abc/*(a).js');
isGlob('abc/?(a).js');
//=> true
```
**False**
Escaped globs or extglobs return `false`:
```js
isGlob('abc/\\@(a).js');
isGlob('abc/\\!(a).js');
isGlob('abc/\\+(a).js');
isGlob('abc/\\*(a).js');
isGlob('abc/\\?(a).js');
isGlob('\\!foo.js');
isGlob('\\*.js');
isGlob('\\*\\*/abc.js');
isGlob('abc/\\*.js');
isGlob('abc/\\(aaa|bbb).js');
isGlob('abc/\\[a-z].js');
isGlob('abc/\\{a,b}.js');
//=> false
```
Patterns that do not have glob patterns return `false`:
```js
isGlob('abc.js');
isGlob('abc/def/ghi.js');
isGlob('foo.js');
isGlob('abc/@.js');
isGlob('abc/+.js');
isGlob('abc/?.js');
isGlob();
isGlob(null);
//=> false
```
Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)):
```js
isGlob(['**/*.js']);
isGlob(['foo.js']);
//=> false
```
### Option strict
When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that
some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not.
**True**
Patterns that have glob characters or regex patterns will return `true`:
```js
isGlob('!foo.js', {strict: false});
isGlob('*.js', {strict: false});
isGlob('**/abc.js', {strict: false});
isGlob('abc/*.js', {strict: false});
isGlob('abc/(aaa|bbb).js', {strict: false});
isGlob('abc/[a-z].js', {strict: false});
isGlob('abc/{a,b}.js', {strict: false});
//=> true
```
Extglobs
```js
isGlob('abc/@(a).js', {strict: false});
isGlob('abc/!(a).js', {strict: false});
isGlob('abc/+(a).js', {strict: false});
isGlob('abc/*(a).js', {strict: false});
isGlob('abc/?(a).js', {strict: false});
//=> true
```
**False**
Escaped globs or extglobs return `false`:
```js
isGlob('\\!foo.js', {strict: false});
isGlob('\\*.js', {strict: false});
isGlob('\\*\\*/abc.js', {strict: false});
isGlob('abc/\\*.js', {strict: false});
isGlob('abc/\\(aaa|bbb).js', {strict: false});
isGlob('abc/\\[a-z].js', {strict: false});
isGlob('abc/\\{a,b}.js', {strict: false});
//=> false
```
## About
<details>
<summary><strong>Contributing</strong></summary>
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
</details>
<details>
<summary><strong>Running Tests</strong></summary>
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
</details>
<details>
<summary><strong>Building docs</strong></summary>
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
</details>
### Related projects
You might also be interested in these projects:
* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit")
* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks")
* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.")
* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.")
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 47 | [jonschlinkert](https://github.com/jonschlinkert) |
| 5 | [doowb](https://github.com/doowb) |
| 1 | [phated](https://github.com/phated) |
| 1 | [danhper](https://github.com/danhper) |
| 1 | [paulmillr](https://github.com/paulmillr) |
### Author
**Jon Schlinkert**
* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
### License
Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._
@@ -0,0 +1 @@
{"version":3,"file":"webhook.js","sources":["../../../src/icons/webhook.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Webhook\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggMTYuOThoLTUuOTljLTEuMSAwLTEuOTUuOTQtMi40OCAxLjlBNCA0IDAgMCAxIDIgMTdjLjAxLS43LjItMS40LjU3LTIiIC8+CiAgPHBhdGggZD0ibTYgMTcgMy4xMy01Ljc4Yy41My0uOTcuMS0yLjE4LS41LTMuMWE0IDQgMCAxIDEgNi44OS00LjA2IiAvPgogIDxwYXRoIGQ9Im0xMiA2IDMuMTMgNS43M0MxNS42NiAxMi43IDE2LjkgMTMgMTggMTNhNCA0IDAgMCAxIDAgOCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/webhook\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 Webhook = createLucideIcon('Webhook', [\n [\n 'path',\n {\n d: 'M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2',\n key: 'q3hayz',\n },\n ],\n ['path', { d: 'm6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06', key: '1go1hn' }],\n ['path', { d: 'm12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8', key: 'qlwsc0' }],\n]);\n\nexport default Webhook;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAA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,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC1F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACzF,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: "karaktrojn", verb: "havi" },
file: { unit: "bajtojn", verb: "havi" },
array: { unit: "elementojn", verb: "havi" },
set: { unit: "elementojn", verb: "havi" },
map: { unit: "elementojn", verb: "havi" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "enigo",
email: "retadreso",
url: "URL",
emoji: "emoĝio",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO-datotempo",
date: "ISO-dato",
time: "ISO-tempo",
duration: "ISO-daŭro",
ipv4: "IPv4-adreso",
ipv6: "IPv6-adreso",
mac: "MAC-adreso",
cidrv4: "IPv4-rango",
cidrv6: "IPv6-rango",
base64: "64-ume kodita karaktraro",
base64url: "URL-64-ume kodita karaktraro",
json_string: "JSON-karaktraro",
e164: "E.164-nombro",
credit_card: "kreditkarta numero",
currency_code: "valuta kodo",
iban: "IBAN",
jwt: "JWT",
template_literal: "enigo",
};
const TypeDictionary = {
nan: "NaN",
number: "nombro",
array: "tabelo",
null: "senvalora",
};
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 `Nevalida enigo: atendiĝis instanceof ${issue.expected}, riceviĝis ${received}`;
}
return `Nevalida enigo: atendiĝis ${expected}, riceviĝis ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Nevalida enigo: atendiĝis ${util.stringifyPrimitive(issue.values[0])}`;
return `Nevalida opcio: atendiĝis unu el ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Tro granda: atendiĝis ke ${issue.origin ?? "valoro"} havu ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementojn"}`;
return `Tro granda: atendiĝis ke ${issue.origin ?? "valoro"} havu ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Tro malgranda: atendiĝis ke ${issue.origin} havu ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Tro malgranda: atendiĝis ke ${issue.origin} estu ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Nevalida karaktraro: devas komenciĝi per "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Nevalida karaktraro: devas finiĝi per "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`;
if (_issue.format === "regex")
return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`;
return `Nevalida ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Nevalida nombro: devas esti oblo de ${issue.divisor}`;
case "unrecognized_keys":
return `Nekonata${issue.keys.length > 1 ? "j" : ""} ŝlosilo${issue.keys.length > 1 ? "j" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Nevalida ŝlosilo en ${issue.origin}`;
case "invalid_union":
return "Nevalida enigo";
case "invalid_element":
return `Nevalida valoro en ${issue.origin}`;
default:
return `Nevalida enigo`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -0,0 +1,923 @@
export default `flf2a$ 9 9 23 0 3 0 128 0
Font Author: Aiden Neuding
FIGFont created with: http://patorjk.com/figfont-editor
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
░▒▓█▓▒░ @
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
░▒▓██▓▒░ @
░▒▓██▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
░▒▓██▓▒░ @
░▒▓██▓▒░ @
@
@@
@
@
@
@
@
@
@
@
@@
░▒▓████████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓████████▓▒░ @
@
@@
░▒▓█▓▒░ @
░▒▓████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓████████▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓███████▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓████████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓████████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓███████▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓████████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
@
░▒▓██▓▒░ @
░▒▓██▓▒░ @
@
░▒▓██▓▒░ @
░▒▓██▓▒░ @
@
@
@@
@
░▒▓██▓▒░ @
░▒▓██▓▒░ @
@
░▒▓██▓▒░ @
░▒▓██▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓████▓▒░ @
@
@
░▒▓█▓▒░ @
@
@@
@
@
@
@
@
@
@
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓████████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
@
@@
░▒▓████████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓████████▓▒░ @
@
@@
░▒▓████████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒▒▓███▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓████████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓████████▓▒░ @
@
@@
░▒▓██████████████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░ @
░▒▓██▓▒░ @@
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓███████▓▒░ @
@
@@
░▒▓████████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒▒▓█▓▒░ @
░▒▓█▓▒▒▓█▓▒░ @
░▒▓█▓▓█▓▒░ @
░▒▓█▓▓█▓▒░ @
░▒▓██▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█████████████▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓████████▓▒░ @
░▒▓█▓▒░ @
░▒▓██▓▒░ @
░▒▓██▓▒░ @
░▒▓██▓▒░ @
░▒▓█▓▒░ @
░▒▓████████▓▒░ @
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓████████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
@
@@
░▒▓████████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓████████▓▒░ @
@
@@
░▒▓████████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒▒▓███▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓████████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓████████▓▒░ @
@
@@
░▒▓██████████████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░ @
░▒▓██▓▒░ @@
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓███████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓███████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓███████▓▒░ @
@
@@
░▒▓████████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒▒▓█▓▒░ @
░▒▓█▓▒▒▓█▓▒░ @
░▒▓█▓▓█▓▒░ @
░▒▓█▓▓█▓▒░ @
░▒▓██▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█████████████▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
@
@@
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓█▓▒░░▒▓█▓▒░ @
░▒▓██████▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
░▒▓█▓▒░ @
@
@@
░▒▓████████▓▒░ @
░▒▓█▓▒░ @
░▒▓██▓▒░ @
░▒▓██▓▒░ @
░▒▓██▓▒░ @
░▒▓█▓▒░ @
░▒▓████████▓▒░ @
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,52 @@
{
"name": "fast-json-stable-stringify",
"version": "2.1.0",
"description": "deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify",
"main": "index.js",
"types": "index.d.ts",
"dependencies": {},
"devDependencies": {
"benchmark": "^2.1.4",
"coveralls": "^3.0.0",
"eslint": "^6.7.0",
"fast-stable-stringify": "latest",
"faster-stable-stringify": "latest",
"json-stable-stringify": "latest",
"nyc": "^14.1.0",
"pre-commit": "^1.2.2",
"tape": "^4.11.0"
},
"scripts": {
"eslint": "eslint index.js test",
"test-spec": "tape test/*.js",
"test": "npm run eslint && nyc npm run test-spec"
},
"repository": {
"type": "git",
"url": "git://github.com/epoberezkin/fast-json-stable-stringify.git"
},
"homepage": "https://github.com/epoberezkin/fast-json-stable-stringify",
"keywords": [
"json",
"stringify",
"deterministic",
"hash",
"stable"
],
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"license": "MIT",
"nyc": {
"exclude": [
"test",
"node_modules"
],
"reporter": [
"lcov",
"text-summary"
]
}
}
@@ -0,0 +1 @@
{"version":3,"file":"folder-sync.js","sources":["../../../src/icons/folder-sync.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FolderSync\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOSAyMEg0YTIgMiAwIDAgMS0yLTJWNWEyIDIgMCAwIDEgMi0yaDMuOWEyIDIgMCAwIDEgMS42OS45bC44MSAxLjJhMiAyIDAgMCAwIDEuNjcuOUgyMGEyIDIgMCAwIDEgMiAydi41IiAvPgogIDxwYXRoIGQ9Ik0xMiAxMHY0aDQiIC8+CiAgPHBhdGggZD0ibTEyIDE0IDEuNTM1LTEuNjA1YTUgNSAwIDAgMSA4IDEuNSIgLz4KICA8cGF0aCBkPSJNMjIgMjJ2LTRoLTQiIC8+CiAgPHBhdGggZD0ibTIyIDE4LTEuNTM1IDEuNjA1YTUgNSAwIDAgMS04LTEuNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/folder-sync\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 FolderSync = createLucideIcon('FolderSync', [\n [\n 'path',\n {\n d: 'M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v.5',\n key: '1dkoa9',\n },\n ],\n ['path', { d: 'M12 10v4h4', key: '1czhmt' }],\n ['path', { d: 'm12 14 1.535-1.605a5 5 0 0 1 8 1.5', key: 'lvuxfi' }],\n ['path', { d: 'M22 22v-4h-4', key: '1ewp4q' }],\n ['path', { d: 'm22 18-1.535 1.605a5 5 0 0 1-8-1.5', key: '14ync0' }],\n]);\n\nexport default FolderSync;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAChD,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,C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CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,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,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACrE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,8 @@
{
"private": true,
"main": "../dist/es5/UI.js",
"jsnext:main": "../dist/es2015/UI.js",
"module": "../dist/es2015/UI.js",
"types": "UI.d.ts",
"sideEffects": false
}
@@ -0,0 +1,4 @@
const isMotionValue = (value) => Boolean(value && value.getVelocity);
export { isMotionValue };
//# sourceMappingURL=is-motion-value.mjs.map
@@ -0,0 +1 @@
"use strict";var s=require("node:path"),r=require("node:os");const{geteuid:e}=process,t=e?e():r.userInfo().username,i=s.join(r.tmpdir(),`tsx-${t}`);exports.tmpdir=i;
@@ -0,0 +1,41 @@
function isSecure(wsComponents) {
return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
}
//RFC 6455
const handler = {
scheme: "ws",
domainHost: true,
parse: function (components, options) {
const wsComponents = components;
//indicate if the secure flag is set
wsComponents.secure = isSecure(wsComponents);
//construct resouce name
wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
wsComponents.path = undefined;
wsComponents.query = undefined;
return wsComponents;
},
serialize: function (wsComponents, options) {
//normalize the default port
if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
wsComponents.port = undefined;
}
//ensure scheme matches secure flag
if (typeof wsComponents.secure === 'boolean') {
wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');
wsComponents.secure = undefined;
}
//reconstruct path from resource name
if (wsComponents.resourceName) {
const [path, query] = wsComponents.resourceName.split('?');
wsComponents.path = (path && path !== '/' ? path : undefined);
wsComponents.query = query;
wsComponents.resourceName = undefined;
}
//forbid fragment component
wsComponents.fragment = undefined;
return wsComponents;
}
};
export default handler;
//# sourceMappingURL=ws.js.map
@@ -0,0 +1 @@
{"version":3,"file":"parking-circle-off.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"folder-open-dot.js","sources":["../../../src/icons/folder-open-dot.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FolderOpenDot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNiAxNCAxLjQ1LTIuOUEyIDIgMCAwIDEgOS4yNCAxMEgyMGEyIDIgMCAwIDEgMS45NCAyLjVsLTEuNTUgNmEyIDIgMCAwIDEtMS45NCAxLjVINGEyIDIgMCAwIDEtMi0yVjVjMC0xLjEuOS0yIDItMmgzLjkzYTIgMiAwIDAgMSAxLjY2LjlsLjgyIDEuMmEyIDIgMCAwIDAgMS42Ni45SDE4YTIgMiAwIDAgMSAyIDJ2MiIgLz4KICA8Y2lyY2xlIGN4PSIxNCIgY3k9IjE1IiByPSIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/folder-open-dot\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 FolderOpenDot = createLucideIcon('FolderOpenDot', [\n [\n 'path',\n {\n d: 'm6 14 1.45-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H18a2 2 0 0 1 2 2v2',\n key: '1nmvlm',\n },\n ],\n ['circle', { cx: '14', cy: '15', r: '1', key: '1gm4qj' }],\n]);\n\nexport default FolderOpenDot;\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,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CACtD,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,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A,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,33 @@
'use strict';
/*
Copyright 2012-2015, Yahoo Inc.
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
const { ReportBase } = require('istanbul-lib-report');
const LcovOnlyReport = require('../lcovonly');
const HtmlReport = require('../html');
class LcovReport extends ReportBase {
constructor(opts) {
super();
this.lcov = new LcovOnlyReport({ file: 'lcov.info', ...opts });
this.html = new HtmlReport({ subdir: 'lcov-report' });
}
}
['Start', 'End', 'Summary', 'SummaryEnd', 'Detail'].forEach(what => {
const meth = 'on' + what;
LcovReport.prototype[meth] = function(...args) {
const lcov = this.lcov;
const html = this.html;
if (lcov[meth]) {
lcov[meth](...args);
}
if (html[meth]) {
html[meth](...args);
}
};
});
module.exports = LcovReport;
@@ -0,0 +1,60 @@
'use strict'
const { makeRequest } = require('../fetch/request')
/**
* Checks if the given value is a valid LastEventId.
* @param {string} value
* @returns {boolean}
*/
function isValidLastEventId (value) {
// LastEventId should not contain U+0000 NULL
return value.indexOf('\u0000') === -1
}
/**
* Checks if the given value is a base 10 digit.
* @param {string} value
* @returns {boolean}
*/
function isASCIINumber (value) {
if (value.length === 0) return false
for (let i = 0; i < value.length; i++) {
if (value.charCodeAt(i) < 0x30 || value.charCodeAt(i) > 0x39) return false
}
return true
}
function createPotentialCORSRequest (url, destination, corsAttributeState, sameOriginFallback) {
// 1. Let mode be "no-cors" if corsAttributeState is No CORS, and "cors" otherwise.
let mode = corsAttributeState === 'no cors' ? 'no-cors' : 'cors'
// 2. If same-origin fallback flag is set and mode is "no-cors", set mode to "same-origin".
if (sameOriginFallback && mode === 'no-cors') {
mode = 'same-origin'
}
// 3. Let credentialsMode be "include".
let credentialsMode = 'include'
// 4. If corsAttributeState is Anonymous, set credentialsMode to "same-origin".
if (corsAttributeState === 'anonymous') {
credentialsMode = 'same-origin'
}
// 5. Return a new request whose URL is url, destination is destination, mode is mode,
// credentials mode is credentialsMode, and whose use-URL-credentials flag is set.
return makeRequest({
urlList: [url],
destination,
mode,
credentials: credentialsMode,
useURLCredentials: true
})
}
module.exports = {
isValidLastEventId,
isASCIINumber,
createPotentialCORSRequest
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_z","2052":"B"},B:{"1":"_J"},C:{"1":"_CF","132":"_g _VF _L","260":"_CC _JG"},D:{"1":"_aE","260":"_vF","772":"_6B _8G","1028":"_aC _cG"},E:{"1":"_pB","260":"_5 A _e mC","772":"_RC _UD"},F:{"1":"_BF","2":"_mB","132":"B ZD _oI _tB","644":"_FL","772":"_DN","1028":"_MG _9D"},G:{"1":"_AB","260":"_d _jD","772":"_wD _gC"},H:{"644":"1D"},I:{"1":"I","16":"_m","260":"4D","772":"_nJ"},J:{"772":"_B"},K:{"1":"H","132":"_gB","644":"_DL"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"B","2":"A"},O:{"1":"bC"},P:{"1":"_U","1028":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:6,C:"const",D:true};
@@ -0,0 +1,4 @@
import { RemoveScrollBar } from './component';
import { zeroRightClassName, fullWidthClassName, noScrollbarsClassName, removedBarSizeVariable } from './constants';
import { getGapWidth } from './utils';
export { RemoveScrollBar, zeroRightClassName, fullWidthClassName, noScrollbarsClassName, removedBarSizeVariable, getGapWidth, };
@@ -0,0 +1 @@
{"version":3,"file":"state.mjs","sources":["../../../../../src/render/utils/reduced-motion/state.ts"],"sourcesContent":["interface ReducedMotionState {\n current: boolean | null\n}\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion: ReducedMotionState = { current: null }\n\nexport const hasReducedMotionListener = { current: false }\n"],"names":[],"mappings":"AAIA;MACa,oBAAoB,GAAuB,EAAE,OAAO,EAAE,IAAI;MAE1D,wBAAwB,GAAG,EAAE,OAAO,EAAE,KAAK;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"watch.js","sources":["../../../src/icons/watch.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Watch\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI2IiAvPgogIDxwb2x5bGluZSBwb2ludHM9IjEyIDEwIDEyIDEyIDEzIDEzIiAvPgogIDxwYXRoIGQ9Im0xNi4xMyA3LjY2LS44MS00LjA1YTIgMiAwIDAgMC0yLTEuNjFoLTIuNjhhMiAyIDAgMCAwLTIgMS42MWwtLjc4IDQuMDUiIC8+CiAgPHBhdGggZD0ibTcuODggMTYuMzYuOCA0YTIgMiAwIDAgMCAyIDEuNjFoMi43MmEyIDIgMCAwIDAgMi0xLjYxbC44MS00LjA1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/watch\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 Watch = createLucideIcon('Watch', [\n ['circle', { cx: '12', cy: '12', r: '6', key: '1vlfrh' }],\n ['polyline', { points: '12 10 12 12 13 13', key: '19dquz' }],\n [\n 'path',\n { d: 'm16.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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA0E,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC/F,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAClG,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,68 @@
'use strict'
const { promisify } = require('node:util')
const Client = require('../dispatcher/client')
const { buildMockDispatch } = require('./mock-utils')
const {
kDispatches,
kMockAgent,
kClose,
kOriginalClose,
kOrigin,
kOriginalDispatch,
kConnected,
kIgnoreTrailingSlash
} = require('./mock-symbols')
const { MockInterceptor } = require('./mock-interceptor')
const Symbols = require('../core/symbols')
const { InvalidArgumentError } = require('../core/errors')
/**
* MockClient provides an API that extends the Client to influence the mockDispatches.
*/
class MockClient extends Client {
constructor (origin, opts) {
if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
throw new InvalidArgumentError('Argument opts.agent must implement Agent')
}
super(origin, opts)
this[kMockAgent] = opts.agent
this[kOrigin] = origin
this[kIgnoreTrailingSlash] = opts.ignoreTrailingSlash ?? false
this[kDispatches] = []
this[kConnected] = 1
this[kOriginalDispatch] = this.dispatch
this[kOriginalClose] = this.close.bind(this)
this.dispatch = buildMockDispatch.call(this)
this.close = this[kClose]
}
get [Symbols.kConnected] () {
return this[kConnected]
}
/**
* Sets up the base interceptor for mocking replies from undici.
*/
intercept (opts) {
return new MockInterceptor(
opts && { ignoreTrailingSlash: this[kIgnoreTrailingSlash], ...opts },
this[kDispatches]
)
}
cleanMocks () {
this[kDispatches] = []
}
async [kClose] () {
await promisify(this[kOriginalClose])()
this[kConnected] = 0
this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
}
}
module.exports = MockClient
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_OJ _bF","2":"_UN _hD _L"},D:{"1":"_6J","2":"_aD"},E:{"1":"_PB","2":"_UB"},F:{"1":"_nO","2":"_SK"},G:{"1":"_s","2":"_3"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:6,C:"String.prototype.includes",D:true};
@@ -0,0 +1,73 @@
declare class Promise <R> implements Promise.Thenable <R> {
/**
* If you call resolve in the body of the callback passed to the constructor,
* your promise is fulfilled with result object passed to resolve.
* If you call reject your promise is rejected with the object passed to resolve.
* For consistency and debugging (eg stack traces), obj should be an instanceof Error.
* Any errors thrown in the constructor callback will be implicitly passed to reject().
*/
constructor (callback: (resolve : (value?: R | Promise.Thenable<R>) => void, reject: (error?: any) => void) => void);
/**
* onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects.
* Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called.
* Both callbacks have a single parameter , the fulfillment value or rejection reason.
* "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve.
* If an error is thrown in the callback, the returned promise rejects with that error.
*
* @param onFulfilled called when/if "promise" resolves
* @param onRejected called when/if "promise" rejects
*/
then <U> (onFulfilled?: (value: R) => U | Promise.Thenable<U>, onRejected?: (error: any) => U | Promise.Thenable<U>): Promise<U>;
then <U> (onFulfilled?: (value: R) => U | Promise.Thenable<U>, onRejected?: (error: any) => void): Promise<U>;
/**
* Sugar for promise.then(undefined, onRejected)
*
* @param onRejected called when/if "promise" rejects
*/
catch <U> (onRejected?: (error: any) => U | Promise.Thenable<U>): Promise<U>;
/**
* Make a new promise from the thenable.
* A thenable is promise-like in as far as it has a "then" method.
*/
static resolve (): Promise<void>;
static resolve <R> (value: R | Promise.Thenable<R>): Promise<R>;
/**
* Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error
*/
static reject <R> (error: any): Promise<R>;
/**
* Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects.
* the array passed to all can be a mixture of promise-like objects and other objects.
* The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value.
*/
static all <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> (values: [T1 | Promise.Thenable<T1>, T2 | Promise.Thenable<T2>, T3 | Promise.Thenable<T3>, T4 | Promise.Thenable <T4>, T5 | Promise.Thenable<T5>, T6 | Promise.Thenable<T6>, T7 | Promise.Thenable<T7>, T8 | Promise.Thenable<T8>, T9 | Promise.Thenable<T9>, T10 | Promise.Thenable<T10>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
static all <T1, T2, T3, T4, T5, T6, T7, T8, T9> (values: [T1 | Promise.Thenable<T1>, T2 | Promise.Thenable<T2>, T3 | Promise.Thenable<T3>, T4 | Promise.Thenable <T4>, T5 | Promise.Thenable<T5>, T6 | Promise.Thenable<T6>, T7 | Promise.Thenable<T7>, T8 | Promise.Thenable<T8>, T9 | Promise.Thenable<T9>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
static all <T1, T2, T3, T4, T5, T6, T7, T8> (values: [T1 | Promise.Thenable<T1>, T2 | Promise.Thenable<T2>, T3 | Promise.Thenable<T3>, T4 | Promise.Thenable <T4>, T5 | Promise.Thenable<T5>, T6 | Promise.Thenable<T6>, T7 | Promise.Thenable<T7>, T8 | Promise.Thenable<T8>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>;
static all <T1, T2, T3, T4, T5, T6, T7> (values: [T1 | Promise.Thenable<T1>, T2 | Promise.Thenable<T2>, T3 | Promise.Thenable<T3>, T4 | Promise.Thenable <T4>, T5 | Promise.Thenable<T5>, T6 | Promise.Thenable<T6>, T7 | Promise.Thenable<T7>]): Promise<[T1, T2, T3, T4, T5, T6, T7]>;
static all <T1, T2, T3, T4, T5, T6> (values: [T1 | Promise.Thenable<T1>, T2 | Promise.Thenable<T2>, T3 | Promise.Thenable<T3>, T4 | Promise.Thenable <T4>, T5 | Promise.Thenable<T5>, T6 | Promise.Thenable<T6>]): Promise<[T1, T2, T3, T4, T5, T6]>;
static all <T1, T2, T3, T4, T5> (values: [T1 | Promise.Thenable<T1>, T2 | Promise.Thenable<T2>, T3 | Promise.Thenable<T3>, T4 | Promise.Thenable <T4>, T5 | Promise.Thenable<T5>]): Promise<[T1, T2, T3, T4, T5]>;
static all <T1, T2, T3, T4> (values: [T1 | Promise.Thenable<T1>, T2 | Promise.Thenable<T2>, T3 | Promise.Thenable<T3>, T4 | Promise.Thenable <T4>]): Promise<[T1, T2, T3, T4]>;
static all <T1, T2, T3> (values: [T1 | Promise.Thenable<T1>, T2 | Promise.Thenable<T2>, T3 | Promise.Thenable<T3>]): Promise<[T1, T2, T3]>;
static all <T1, T2> (values: [T1 | Promise.Thenable<T1>, T2 | Promise.Thenable<T2>]): Promise<[T1, T2]>;
static all <T1> (values: [T1 | Promise.Thenable<T1>]): Promise<[T1]>;
static all <TAll> (values: Array<TAll | Promise.Thenable<TAll>>): Promise<TAll[]>;
/**
* Make a Promise that fulfills when any item fulfills, and rejects if any item rejects.
*/
static race <R> (promises: (R | Promise.Thenable<R>)[]): Promise<R>;
}
declare namespace Promise {
export interface Thenable <R> {
then <U> (onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
then <U> (onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
}
}
export = Promise;
@@ -0,0 +1,99 @@
#!/usr/bin/env python3
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the input.py file."""
import unittest
import gyp.input
class TestFindCycles(unittest.TestCase):
def setUp(self):
self.nodes = {}
for x in ("a", "b", "c", "d", "e"):
self.nodes[x] = gyp.input.DependencyGraphNode(x)
def _create_dependency(self, dependent, dependency):
dependent.dependencies.append(dependency)
dependency.dependents.append(dependent)
def test_no_cycle_empty_graph(self):
for label, node in self.nodes.items():
self.assertEqual([], node.FindCycles())
def test_no_cycle_line(self):
self._create_dependency(self.nodes["a"], self.nodes["b"])
self._create_dependency(self.nodes["b"], self.nodes["c"])
self._create_dependency(self.nodes["c"], self.nodes["d"])
for label, node in self.nodes.items():
self.assertEqual([], node.FindCycles())
def test_no_cycle_dag(self):
self._create_dependency(self.nodes["a"], self.nodes["b"])
self._create_dependency(self.nodes["a"], self.nodes["c"])
self._create_dependency(self.nodes["b"], self.nodes["c"])
for label, node in self.nodes.items():
self.assertEqual([], node.FindCycles())
def test_cycle_self_reference(self):
self._create_dependency(self.nodes["a"], self.nodes["a"])
self.assertEqual(
[[self.nodes["a"], self.nodes["a"]]], self.nodes["a"].FindCycles()
)
def test_cycle_two_nodes(self):
self._create_dependency(self.nodes["a"], self.nodes["b"])
self._create_dependency(self.nodes["b"], self.nodes["a"])
self.assertEqual(
[[self.nodes["a"], self.nodes["b"], self.nodes["a"]]],
self.nodes["a"].FindCycles(),
)
self.assertEqual(
[[self.nodes["b"], self.nodes["a"], self.nodes["b"]]],
self.nodes["b"].FindCycles(),
)
def test_two_cycles(self):
self._create_dependency(self.nodes["a"], self.nodes["b"])
self._create_dependency(self.nodes["b"], self.nodes["a"])
self._create_dependency(self.nodes["b"], self.nodes["c"])
self._create_dependency(self.nodes["c"], self.nodes["b"])
cycles = self.nodes["a"].FindCycles()
self.assertTrue([self.nodes["a"], self.nodes["b"], self.nodes["a"]] in cycles)
self.assertTrue([self.nodes["b"], self.nodes["c"], self.nodes["b"]] in cycles)
self.assertEqual(2, len(cycles))
def test_big_cycle(self):
self._create_dependency(self.nodes["a"], self.nodes["b"])
self._create_dependency(self.nodes["b"], self.nodes["c"])
self._create_dependency(self.nodes["c"], self.nodes["d"])
self._create_dependency(self.nodes["d"], self.nodes["e"])
self._create_dependency(self.nodes["e"], self.nodes["a"])
self.assertEqual(
[
[
self.nodes["a"],
self.nodes["b"],
self.nodes["c"],
self.nodes["d"],
self.nodes["e"],
self.nodes["a"],
]
],
self.nodes["a"].FindCycles(),
)
if __name__ == "__main__":
unittest.main()
@@ -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 BookImage = createLucideIcon("BookImage", [
["path", { d: "m20 13.7-2.1-2.1a2 2 0 0 0-2.8 0L9.7 17", key: "q6ojf0" }],
[
"path",
{
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",
key: "k3hazp"
}
],
["circle", { cx: "10", cy: "8", r: "2", key: "2qkj4p" }]
]);
export { BookImage as default };
//# sourceMappingURL=book-image.js.map
@@ -0,0 +1,53 @@
import { f as createRule } from "../utils.js";
var no_mixed_spaces_and_tabs_default = createRule({
name: "no-mixed-spaces-and-tabs",
meta: {
type: "layout",
docs: { description: "Disallow mixed spaces and tabs for indentation" },
schema: [{ oneOf: [{
type: "string",
enum: ["smart-tabs"]
}, { type: "boolean" }] }],
defaultOptions: [false],
messages: { mixedSpacesAndTabs: "Mixed spaces and tabs." }
},
create(context, [style]) {
const sourceCode = context.sourceCode;
const smartTabs = typeof style === "boolean" ? style : style === "smart-tabs";
return { "Program:exit": function(node) {
const lines = sourceCode.lines;
const comments = sourceCode.getAllComments();
const ignoredCommentLines = /* @__PURE__ */ new Set();
comments.forEach((comment) => {
for (let i = comment.loc.start.line + 1; i <= comment.loc.end.line; i++) ignoredCommentLines.add(i);
});
let regex = /^(?=( +|\t+))\1(?:\t| )/u;
if (smartTabs) regex = /^(?=(\t*))\1(?=( +))\2\t/u;
lines.forEach((line, i) => {
const match = regex.exec(line);
if (match) {
const lineNumber = i + 1;
const loc = {
start: {
line: lineNumber,
column: match[0].length - 2
},
end: {
line: lineNumber,
column: match[0].length
}
};
if (!ignoredCommentLines.has(lineNumber)) {
const containingNode = sourceCode.getNodeByRangeIndex(sourceCode.getIndexFromLoc(loc.start));
if (!(containingNode && ["Literal", "TemplateElement"].includes(containingNode.type))) context.report({
node,
loc,
messageId: "mixedSpacesAndTabs"
});
}
}
});
} };
}
});
export { no_mixed_spaces_and_tabs_default as t };
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"2":"_S"},D:{"1":"_AH","2":"_tJ","66":"BC _RF _ED"},E:{"2":"_R"},F:{"1":"_HI","2":"_GM","66":"_aC _WN"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_yB","2":"_pC"},Q:{"2":"JE"},R:{"1":"KE"},S:{"2":"_C"}},B:7,C:"WebUSB",D:true};
@@ -0,0 +1,75 @@
{
"name": "@radix-ui/react-compose-refs",
"version": "1.1.2",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"publishConfig": {
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"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"
}
}
}
},
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"version": "yarn version"
},
"devDependencies": {
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"typescript": "^5.7.3"
},
"peerDependencies": {
"@types/react": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"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"
},
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"types": "./dist/index.d.ts"
}
@@ -0,0 +1,138 @@
"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: "حرف", verb: "أن يحوي" },
file: { unit: "بايت", verb: "أن يحوي" },
array: { unit: "عنصر", verb: "أن يحوي" },
set: { unit: "عنصر", verb: "أن يحوي" },
map: { unit: "عنصر", verb: "أن يحوي" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "مدخل",
email: "بريد إلكتروني",
url: "رابط",
emoji: "إيموجي",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "تاريخ ووقت بمعيار ISO",
date: "تاريخ بمعيار ISO",
time: "وقت بمعيار ISO",
duration: "مدة بمعيار ISO",
ipv4: "عنوان IPv4",
ipv6: "عنوان IPv6",
mac: "عنوان MAC",
cidrv4: "مدى عناوين بصيغة IPv4",
cidrv6: "مدى عناوين بصيغة IPv6",
base64: "نَص بترميز base64-encoded",
base64url: "نَص بترميز base64url-encoded",
json_string: "نَص على هيئة JSON",
e164: "رقم هاتف بمعيار E.164",
credit_card: "رقم بطاقة الائتمان",
currency_code: "رمز العملة",
iban: "IBAN",
jwt: "JWT",
template_literal: "مدخل",
};
const TypeDictionary = {
nan: "NaN",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `مدخلات غير مقبولة: يفترض إدخال instanceof ${issue.expected}، ولكن تم إدخال ${received}`;
}
return `مدخلات غير مقبولة: يفترض إدخال ${expected}، ولكن تم إدخال ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `مدخلات غير مقبولة: يفترض إدخال ${util.stringifyPrimitive(issue.values[0])}`;
return `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return ` أكبر من اللازم: يفترض أن تكون ${issue.origin ?? "القيمة"} ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "عنصر"}`;
return `أكبر من اللازم: يفترض أن تكون ${issue.origin ?? "القيمة"} ${adj} ${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
}
return `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `نَص غير مقبول: يجب أن يبدأ بـ "${issue.prefix}"`;
if (_issue.format === "ends_with")
return `نَص غير مقبول: يجب أن ينتهي بـ "${_issue.suffix}"`;
if (_issue.format === "includes")
return `نَص غير مقبول: يجب أن يتضمَّن "${_issue.includes}"`;
if (_issue.format === "regex")
return `نَص غير مقبول: يجب أن يطابق النمط ${_issue.pattern}`;
return `${FormatDictionary[_issue.format] ?? issue.format} غير مقبول`;
}
case "not_multiple_of":
return `رقم غير مقبول: يجب أن يكون من مضاعفات ${issue.divisor}`;
case "unrecognized_keys":
return `معرف${issue.keys.length > 1 ? "ات" : ""} غريب${issue.keys.length > 1 ? "ة" : ""}: ${util.joinValues(issue.keys, "، ")}`;
case "invalid_key":
return `معرف غير مقبول في ${issue.origin}`;
case "invalid_union":
return "مدخل غير مقبول";
case "invalid_element":
return `مدخل غير مقبول في ${issue.origin}`;
default:
return "مدخل غير مقبول";
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -0,0 +1,140 @@
/**
* @fileoverview Rule to require sorting of variables within a single Variable Declaration block
* @author Ilya Volodin
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
ignoreCase: false,
},
],
docs: {
description:
"Require variables within the same declaration block to be sorted",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/sort-vars",
},
schema: [
{
type: "object",
properties: {
ignoreCase: {
type: "boolean",
},
},
additionalProperties: false,
},
],
fixable: "code",
messages: {
sortVars:
"Variables within the same declaration block should be sorted alphabetically.",
},
},
create(context) {
const [{ ignoreCase }] = context.options;
const sourceCode = context.sourceCode;
return {
VariableDeclaration(node) {
const idDeclarations = node.declarations.filter(
decl => decl.id.type === "Identifier",
);
const getSortableName = ignoreCase
? decl => decl.id.name.toLowerCase()
: decl => decl.id.name;
const unfixable = idDeclarations.some(
decl => decl.init !== null && decl.init.type !== "Literal",
);
let fixed = false;
idDeclarations.slice(1).reduce((memo, decl) => {
const lastVariableName = getSortableName(memo),
currentVariableName = getSortableName(decl);
if (currentVariableName < lastVariableName) {
context.report({
node: decl,
messageId: "sortVars",
fix(fixer) {
if (unfixable || fixed) {
return null;
}
return fixer.replaceTextRange(
[
idDeclarations[0].range[0],
idDeclarations.at(-1).range[1],
],
idDeclarations
// Clone the idDeclarations array to avoid mutating it
.slice()
// Sort the array into the desired order
.sort((declA, declB) => {
const aName =
getSortableName(declA);
const bName =
getSortableName(declB);
return aName > bName ? 1 : -1;
})
// Build a string out of the sorted list of identifier declarations and the text between the originals
.reduce(
(sourceText, identifier, index) => {
const textAfterIdentifier =
index ===
idDeclarations.length - 1
? ""
: sourceCode
.getText()
.slice(
idDeclarations[
index
].range[1],
idDeclarations[
index +
1
].range[0],
);
return (
sourceText +
sourceCode.getText(
identifier,
) +
textAfterIdentifier
);
},
"",
),
);
},
});
fixed = true;
return memo;
}
return decl;
}, idDeclarations[0]);
},
};
},
};
@@ -0,0 +1,9 @@
import { AllContext, RouteById } from './routeInfo.cjs';
import { AnyRouter } from './router.cjs';
import { Expand, StrictOrFrom } from './utils.cjs';
export interface UseRouteContextBaseOptions<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> {
select?: (search: ResolveUseRouteContext<TRouter, TFrom, TStrict>) => TSelected;
}
export type UseRouteContextOptions<TRouter extends AnyRouter, TFrom extends string | undefined, TStrict extends boolean, TSelected> = StrictOrFrom<TRouter, TFrom, TStrict> & UseRouteContextBaseOptions<TRouter, TFrom, TStrict, TSelected>;
export type ResolveUseRouteContext<TRouter extends AnyRouter, TFrom, TStrict extends boolean> = TStrict extends false ? AllContext<TRouter['routeTree']> : Expand<RouteById<TRouter['routeTree'], TFrom>['types']['allContext']>;
export type UseRouteContextResult<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> = unknown extends TSelected ? ResolveUseRouteContext<TRouter, TFrom, TStrict> : TSelected;
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _getPrototypeOf;
function _getPrototypeOf(o) {
exports.default = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
//# sourceMappingURL=getPrototypeOf.js.map
@@ -0,0 +1,202 @@
import { f as createRule } from "../utils.js";
var jsx_closing_bracket_location_default = createRule({
name: "jsx-closing-bracket-location",
meta: {
type: "layout",
docs: { description: "Enforce closing bracket location in JSX" },
fixable: "code",
schema: [{ anyOf: [
{
type: "string",
enum: [
"after-props",
"props-aligned",
"tag-aligned",
"line-aligned"
]
},
{
type: "object",
properties: { location: {
type: "string",
enum: [
"after-props",
"props-aligned",
"tag-aligned",
"line-aligned"
]
} },
additionalProperties: false
},
{
type: "object",
properties: {
nonEmpty: { oneOf: [{
type: "string",
enum: [
"after-props",
"props-aligned",
"tag-aligned",
"line-aligned"
]
}, {
type: "boolean",
enum: [false]
}] },
selfClosing: { oneOf: [{
type: "string",
enum: [
"after-props",
"props-aligned",
"tag-aligned",
"line-aligned"
]
}, {
type: "boolean",
enum: [false]
}] }
},
additionalProperties: false
}
] }],
defaultOptions: ["tag-aligned"],
messages: { bracketLocation: "The closing bracket must be {{location}}{{details}}" }
},
create(context, [config]) {
const MESSAGE_LOCATION = {
"after-props": "placed after the last prop",
"after-tag": "placed after the opening tag",
"props-aligned": "aligned with the last prop",
"tag-aligned": "aligned with the opening tag",
"line-aligned": "aligned with the line containing the opening tag"
};
const { nonEmpty = "tag-aligned", selfClosing = "tag-aligned" } = typeof config === "string" ? {
nonEmpty: config,
selfClosing: config
} : "location" in config ? {
nonEmpty: config.location,
selfClosing: config.location
} : config;
function getExpectedLocation(tokens) {
let location;
if (typeof tokens.lastProp === "undefined") location = "after-tag";
else if (tokens.opening.line === tokens.lastProp.lastLine) location = "after-props";
else location = tokens.selfClosing ? selfClosing : nonEmpty;
return location;
}
function getCorrectColumn(tokens, expectedLocation) {
switch (expectedLocation) {
case "props-aligned": return tokens.lastProp.column;
case "tag-aligned": return tokens.opening.column;
case "line-aligned": return tokens.openingStartOfLine.column;
default: return null;
}
}
function hasCorrectLocation(tokens, expectedLocation) {
switch (expectedLocation) {
case "after-tag": return tokens.tag.line === tokens.closing.line;
case "after-props": return tokens.lastProp.lastLine === tokens.closing.line;
case "props-aligned":
case "tag-aligned":
case "line-aligned": return getCorrectColumn(tokens, expectedLocation) === tokens.closing.column;
default: return true;
}
}
function getIndentation(tokens, expectedLocation, correctColumn) {
const newColumn = correctColumn || 0;
let indentation;
let spaces = [];
switch (expectedLocation) {
case "props-aligned":
indentation = /^\s*/.exec(context.sourceCode.lines[tokens.lastProp.firstLine - 1])[0];
break;
case "tag-aligned":
case "line-aligned":
indentation = /^\s*/.exec(context.sourceCode.lines[tokens.opening.line - 1])[0];
break;
default: indentation = "";
}
if (indentation.length + 1 < newColumn) spaces = Array.from({ length: +correctColumn + 1 - indentation.length });
return indentation + spaces.join(" ");
}
function getTokensLocations(node) {
const sourceCode = context.sourceCode;
const opening = sourceCode.getFirstToken(node).loc.start;
const closing = sourceCode.getLastTokens(node, node.selfClosing ? 2 : 1)[0].loc.start;
const tag = sourceCode.getFirstToken(node.name).loc.start;
let lastProp;
if (node.attributes.length) {
lastProp = node.attributes[node.attributes.length - 1];
lastProp = {
column: sourceCode.getFirstToken(lastProp).loc.start.column,
firstLine: sourceCode.getFirstToken(lastProp).loc.start.line,
lastLine: sourceCode.getLastToken(lastProp).loc.end.line
};
}
const openingLine = sourceCode.lines[opening.line - 1];
const closingLine = sourceCode.lines[closing.line - 1];
const isTab = {
openTab: /^\t/.test(openingLine),
closeTab: /^\t/.test(closingLine)
};
const openingStartOfLine = {
column: /^\s*/.exec(openingLine)?.[0].length,
line: opening.line
};
return {
isTab,
tag,
opening,
closing,
lastProp,
selfClosing: node.selfClosing,
openingStartOfLine
};
}
return { "JSXOpeningElement:exit": function(node) {
const lastAttributeNode = node.attributes.at(-1);
const cachedLastAttributeEndPos = lastAttributeNode ? lastAttributeNode.range[1] : null;
let expectedNextLine;
const tokens = getTokensLocations(node);
let expectedLocation = getExpectedLocation(tokens);
let usingSameIndentation = true;
if (expectedLocation === "tag-aligned") usingSameIndentation = tokens.isTab.openTab === tokens.isTab.closeTab;
const lastComment = context.sourceCode.getCommentsInside(node).at(-1);
const hasTrailingComment = lastComment && lastComment.range[0] > (lastAttributeNode ?? node.name).range[1];
if ((expectedLocation === "after-props" || expectedLocation === "after-tag") && !(hasCorrectLocation(tokens, expectedLocation) && usingSameIndentation) && hasTrailingComment) expectedLocation = "line-aligned";
if (hasCorrectLocation(tokens, expectedLocation) && usingSameIndentation) return;
const data = {
location: MESSAGE_LOCATION[expectedLocation],
details: ""
};
const correctColumn = getCorrectColumn(tokens, expectedLocation);
if (correctColumn !== null) {
expectedNextLine = tokens.lastProp && tokens.lastProp.lastLine === tokens.closing.line;
data.details = ` (expected column ${correctColumn + 1}${expectedNextLine ? " on the next line)" : ")"}`;
}
context.report({
node,
messageId: "bracketLocation",
loc: tokens.closing,
data,
fix(fixer) {
const closingTag = tokens.selfClosing ? "/>" : ">";
switch (expectedLocation) {
case "after-tag":
if (cachedLastAttributeEndPos) return fixer.replaceTextRange([cachedLastAttributeEndPos, node.range[1]], (expectedNextLine ? "\n" : "") + closingTag);
return fixer.replaceTextRange([node.name.range[1], node.range[1]], (expectedNextLine ? "\n" : " ") + closingTag);
case "after-props": return fixer.replaceTextRange([cachedLastAttributeEndPos, node.range[1]], (expectedNextLine ? "\n" : "") + closingTag);
case "props-aligned":
case "tag-aligned":
case "line-aligned": {
const rangeStart = hasTrailingComment ? lastComment.range[1] : cachedLastAttributeEndPos;
return fixer.replaceTextRange([rangeStart, node.range[1]], `\n${getIndentation(tokens, expectedLocation, correctColumn)}${closingTag}`);
}
}
return null;
}
});
} };
}
});
export { jsx_closing_bracket_location_default as t };
@@ -0,0 +1,5 @@
declare function validTimestamp(str: string, allowDate: boolean): boolean;
declare namespace validTimestamp {
var code: string;
}
export default validTimestamp;
@@ -0,0 +1 @@
{"version":3,"file":"check.js","sources":["../../../src/icons/check.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Check\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgNiA5IDE3bC01LTUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/check\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 Check = createLucideIcon('Check', [['path', { d: 'M20 6 9 17l-5-5', key: '1gmf2c' }]]);\n\nexport default Check;\n"],"names":[],"mappings":";;;;;;;;;AAaA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,OAAS,CAAA,CAAA,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,EAAE,CAAA,CAAA,CAAG,iBAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,8 @@
import Options from '../../Options'
export default (options: Options) => {
return {
warning: options.translations.warnings.dates,
suggestions: [options.translations.suggestions.dates],
}
}
@@ -0,0 +1 @@
{"version":3,"file":"m.js","sources":["../../src/context/LayoutGroupContext.ts","../../src/context/LazyContext.ts","../../src/context/MotionConfigContext.tsx","../../src/context/MotionContext/index.ts","../../src/context/MotionContext/utils.ts","../../src/context/MotionContext/create.ts","../../src/render/html/utils/create-render-state.ts","../../src/render/html/use-props.ts","../../src/render/svg/utils/create-render-state.ts","../../src/render/svg/use-props.ts","../../src/motion/utils/valid-prop.ts","../../src/render/dom/utils/filter-props.ts","../../src/render/svg/lowercase-elements.ts","../../src/render/dom/utils/is-svg-component.ts","../../src/render/dom/use-render.ts","../../src/context/PresenceContext.ts","../../src/utils/use-constant.ts","../../src/motion/utils/use-visual-state.ts","../../src/render/html/use-html-visual-state.ts","../../src/render/svg/use-svg-visual-state.ts","../../src/motion/features/definitions.ts","../../src/motion/utils/symbol.ts","../../src/motion/utils/use-motion-ref.ts","../../src/context/SwitchLayoutGroupContext.ts","../../src/utils/is-ref-object.ts","../../src/utils/is-browser.ts","../../src/utils/use-isomorphic-effect.ts","../../src/motion/utils/use-visual-element.ts","../../src/motion/index.tsx","../../src/render/components/m/create.ts","../../src/render/components/m/elements.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport type { NodeGroup } from \"motion-dom\"\n\nexport interface LayoutGroupContextProps {\n id?: string\n group?: NodeGroup\n forceRender?: VoidFunction\n}\n\nexport const LayoutGroupContext = createContext<LayoutGroupContextProps>({})\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport { CreateVisualElement } from \"../render/types\"\n\nexport interface LazyContextProps {\n renderer?: CreateVisualElement\n strict: boolean\n}\n\nexport const LazyContext = createContext<LazyContextProps>({ strict: false })\n","\"use client\"\n\nimport type { Transition } from \"motion-dom\"\nimport { TransformPoint } from \"motion-utils\"\nimport { createContext } from \"react\"\n\nexport type ReducedMotionConfig = \"always\" | \"never\" | \"user\"\n\n/**\n * @public\n */\nexport interface MotionConfigContext {\n /**\n * Internal, exported only for usage in Framer\n */\n transformPagePoint: TransformPoint\n\n /**\n * Internal. Determines whether this is a static context ie the Framer canvas. If so,\n * it'll disable all dynamic functionality.\n */\n isStatic: boolean\n\n /**\n * Defines a new default transition for the entire tree.\n *\n * @public\n */\n transition?: Transition\n\n /**\n * If true, will respect the device prefersReducedMotion setting by switching\n * transform animations off.\n *\n * @public\n */\n reducedMotion?: ReducedMotionConfig\n\n /**\n * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP).\n * For more details see:\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles\n *\n * @public\n */\n nonce?: string\n\n /**\n * If true, all animations will be skipped and values will be set instantly.\n * Useful for E2E tests and visual regression testing.\n *\n * @public\n */\n skipAnimations?: boolean\n\n}\n\n/**\n * @public\n */\nexport const MotionConfigContext = createContext<MotionConfigContext>({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n})\n","\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface MotionContextProps<Instance = unknown> {\n visualElement?: VisualElement<Instance>\n initial?: false | string | string[]\n animate?: string | string[]\n}\n\nexport const MotionContext = /* @__PURE__ */ createContext<MotionContextProps>(\n {}\n)\n","import { isControllingVariants, isVariantLabel } from \"motion-dom\"\nimport type { MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\n\nexport function getCurrentTreeVariants(\n props: MotionProps,\n context: MotionContextProps\n): MotionContextProps {\n if (isControllingVariants(props)) {\n const { initial, animate } = props\n return {\n initial:\n initial === false || isVariantLabel(initial)\n ? (initial as any)\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n }\n }\n return props.inherit !== false ? context : {}\n}\n","\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { MotionContext, type MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getCurrentTreeVariants } from \"./utils\"\n\nexport function useCreateMotionContext<Instance>(\n props: MoLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["import { createLazyMeasurementsView } from './lazy-measurements'\nimport { approxEqual, debounce, memo, notUndefined } from './utils'\n\n// Browser-aware iOS detection. Programmatic `scrollTo`/`scrollTop` writes\n// during a momentum-scroll cancel the momentum on iOS WebKit, so we defer\n// scroll-position adjustments triggered by mid-scroll resizes until the\n// scroll settles. SSR-safe (returns false when navigator is unavailable).\nlet _isIOSResult: boolean | undefined\nconst isIOSWebKit = (): boolean => {\n if (_isIOSResult !== undefined) return _isIOSResult\n if (typeof navigator === 'undefined') return (_isIOSResult = false)\n if (/iP(hone|od|ad)/.test(navigator.userAgent)) return (_isIOSResult = true)\n // iPadOS 13+ reports as MacIntel; touch-points distinguishes it from desktop.\n const mtp = (navigator as Navigator & { maxTouchPoints?: number })\n .maxTouchPoints\n return (_isIOSResult =\n navigator.platform === 'MacIntel' && mtp !== undefined && mtp > 0)\n}\n\n// Test hook: reset the iOS detection cache. Not exported.\nexport const _resetIOSDetectionForTests = () => {\n _isIOSResult = undefined\n}\n\nexport { approxEqual, debounce, memo, notUndefined } from './utils'\nexport type { NoInfer, PartialKeys } from './utils'\n\n//\n\ntype ScrollDirection = 'forward' | 'backward'\n\ntype ScrollAlignment = 'start' | 'center' | 'end' | 'auto'\n\ntype ScrollBehavior = 'auto' | 'smooth' | 'instant'\n\ntype ScrollAnchor = 'start' | 'end'\n\ntype FollowOnAppend = boolean | ScrollBehavior\n\nexport interface ScrollToOptions {\n align?: ScrollAlignment\n behavior?: ScrollBehavior\n}\n\ntype ScrollToOffsetOptions = ScrollToOptions\n\ntype ScrollToIndexOptions = ScrollToOptions\n\ntype ScrollToEndOptions = Pick<ScrollToOptions, 'behavior'>\n\nexport interface Range {\n startIndex: number\n endIndex: number\n overscan: number\n count: number\n}\n\ntype Key = number | string | bigint\n\nexport interface VirtualItem {\n key: Key\n index: number\n start: number\n end: number\n size: number\n lane: number\n}\n\nexport interface Rect {\n width: number\n height: number\n}\n\n//\n\nconst getRect = (element: HTMLElement): Rect => {\n const { offsetWidth, offsetHeight } = element\n return { width: offsetWidth, height: offsetHeight }\n}\n\nexport const defaultKeyExtractor = (index: number) => index\n\nexport const defaultRangeExtractor = (range: Range) => {\n const start = Math.max(range.startIndex - range.overscan, 0)\n const end = Math.min(range.endIndex + range.overscan, range.count - 1)\n const len = end - start + 1\n\n const arr = new Array<number>(len)\n for (let i = 0; i < len; i++) {\n arr[i] = start + i\n }\n return arr\n}\n\nexport const observeElementRect = <T extends Element>(\n instance: Virtualizer<T, any>,\n cb: (rect: Rect) => void,\n) => {\n const element = instance.scrollElement\n if (!element) {\n return\n }\n const targetWindow = instance.targetWindow\n if (!targetWindow) {\n return\n }\n\n const handler = (rect: Rect) => {\n const { width, height } = rect\n cb({ width: Math.round(width), height: Math.round(height) })\n }\n\n handler(getRect(element as unknown as HTMLElement))\n\n if (!targetWindow.ResizeObserver) {\n return () => {}\n }\n\n const observer = new targetWindow.ResizeObserver((entries) => {\n const run = () => {\n const entry = entries[0]\n if (entry?.borderBoxSize) {\n const box = entry.borderBoxSize[0]\n if (box) {\n handler({ width: box.inlineSize, height: box.blockSize })\n return\n }\n }\n handler(getRect(element as unknown as HTMLElement))\n }\n\n instance.options.useAnimationFrameWithResizeObserver\n ? requestAnimationFrame(run)\n : run()\n })\n\n observer.observe(element, { box: 'border-box' })\n\n return () => {\n observer.unobserve(element)\n }\n}\n\nconst addEventListenerOptions = {\n passive: true,\n}\n\nexport const observeWindowRect = (\n instance: Virtualizer<Window, any>,\n cb: (rect: Rect) => void,\n) => {\n const element = instance.scrollElement\n if (!element) {\n return\n }\n\n const handler = () => {\n cb({ width: element.innerWidth, height: element.innerHeight })\n }\n handler()\n\n element.addEventListener('resize', handler, addEventListenerOptions)\n\n return () => {\n element.removeEventListener('resize', handler)\n }\n}\n\nconst supportsScrollend =\n typeof window == 'undefined' ? true : 'onscrollend' in window\n\ntype ObserveOffsetCallBack = (offset: number, isScrolling: boolean) => void\n\n// Shared core: both element and window variants attach scroll/scrollend\n// listeners with the same lifecycle; they only differ in how to read the\n// current offset from the scroll target.\nconst observeOffset = <T extends Element | Window>(\n instance: Virtualizer<T, any>,\n cb: ObserveOffsetCallBack,\n readOffset: (Line truncated
@@ -0,0 +1 @@
{"version":3,"names":["_checkInRHS","require","_setFunctionName","_toPropertyKey","applyDecs2301Factory","createAddInitializerMethod","initializers","decoratorFinishedRef","addInitializer","initializer","assertNotFinished","assertCallable","push","assertInstanceIfPrivate","has","target","TypeError","memberDec","dec","name","desc","kind","isStatic","isPrivate","value","hasPrivateBrand","kindStr","ctx","toPropertyKey","static","private","v","get","set","t","call","bind","access","fnName","Error","fn","hint","assertValidReturnValue","type","undefined","init","curryThis1","curryThis2","applyMemberDec","ret","base","decInfo","decs","prefix","setFunctionName","Object","getOwnPropertyDescriptor","newValue","i","length","newInit","instance","ownInitializers","originalInitializer","args","defineProperty","applyMemberDecs","Class","decInfos","instanceBrand","protoInitializers","staticInitializers","staticBrand","existingProtoNonFields","Map","existingStaticNonFields","Array","isArray","_","checkInRHS","prototype","existingNonFields","existingKind","pushInitializers","applyClassDecs","targetClass","classDecs","newClass","nextNewClass","applyDecs2301","memberDecs","e","c","exports","default"],"sources":["../../src/helpers/applyDecs2301.js"],"sourcesContent":["/* @minVersion 7.21.0 */\n/* @onlyBabel7 */\n\nimport checkInRHS from \"checkInRHS\";\nimport setFunctionName from \"setFunctionName\";\nimport toPropertyKey from \"toPropertyKey\";\n\n/**\n Enums are used in this file, but not assigned to vars to avoid non-hoistable values\n\n CONSTRUCTOR = 0;\n PUBLIC = 1;\n PRIVATE = 2;\n\n FIELD = 0;\n ACCESSOR = 1;\n METHOD = 2;\n GETTER = 3;\n SETTER = 4;\n\n STATIC = 5;\n\n CLASS = 10; // only used in assertValidReturnValue\n*/\n\nfunction applyDecs2301Factory() {\n function createAddInitializerMethod(initializers, decoratorFinishedRef) {\n return function addInitializer(initializer) {\n assertNotFinished(decoratorFinishedRef, \"addInitializer\");\n assertCallable(initializer, \"An initializer\");\n initializers.push(initializer);\n };\n }\n\n function assertInstanceIfPrivate(has, target) {\n if (!has(target)) {\n throw new TypeError(\n \"Attempted to access private element on non-instance\",\n );\n }\n }\n\n function memberDec(\n dec,\n name,\n desc,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n hasPrivateBrand,\n ) {\n var kindStr;\n\n switch (kind) {\n case 1 /* ACCESSOR */:\n kindStr = \"accessor\";\n break;\n case 2 /* METHOD */:\n kindStr = \"method\";\n break;\n case 3 /* GETTER */:\n kindStr = \"getter\";\n break;\n case 4 /* SETTER */:\n kindStr = \"setter\";\n break;\n default:\n kindStr = \"field\";\n }\n\n var ctx = {\n kind: kindStr,\n name: isPrivate ? \"#\" + name : toPropertyKey(name),\n static: isStatic,\n private: isPrivate,\n };\n\n var decoratorFinishedRef = { v: false };\n\n if (kind !== 0 /* FIELD */) {\n ctx.addInitializer = createAddInitializerMethod(\n initializers,\n decoratorFinishedRef,\n );\n }\n\n var get, set;\n if (!isPrivate && (kind === 0 /* FIELD */ || kind === 2) /* METHOD */) {\n get = function (target) {\n return target[name];\n };\n if (kind === 0 /* FIELD */) {\n set = function (target, v) {\n target[name] = v;\n };\n }\n } else if (kind === 2 /* METHOD */) {\n // Assert: isPrivate is true.\n get = function (target) {\n assertInstanceIfPrivate(hasPrivateBrand, target);\n return desc.value;\n };\n } else {\n // Assert: If kind === 0, then isPrivate is true.\n var t = kind === 0 /* FIELD */ || kind === 1; /* ACCESSOR */\n if (t || kind === 3 /* GETTER */) {\n if (isPrivate) {\n get = function (target) {\n assertInstanceIfPrivate(hasPrivateBrand, target);\n return desc.get.call(target);\n };\n } else {\n get = function (target) {\n return desc.get.call(target);\n };\n }\n }\n if (t || kind === 4 /* SETTER */) {\n if (isPrivate) {\n set = function (target, value) {\n assertInstanceIfPrivate(hasPrivateBrand, target);\n desc.set.call(target, value);\n };\n } else {\n set = function (target, value) {\n desc.set.call(target, value);\n };\n }\n }\n }\n var has = isPrivate\n ? hasPrivateBrand.bind()\n : function (target) {\n return name in target;\n };\n ctx.access =\n get && set\n ? { get: get, set: set, has: has }\n : get\n ? { get: get, has: has }\n : { set: set, has: has };\n\n try {\n return dec(value, ctx);\n } finally {\n decoratorFinishedRef.v = true;Line truncated
@@ -0,0 +1 @@
{"version":3,"names":["_debug","data","require","_t","_convertSourceMap","_readInputSourceMapFile","_file","_index","_cloneDeep","file","traverseFast","debug","buildDebug","INLINE_SOURCEMAP_REGEX","EXTERNAL_SOURCEMAP_REGEX","normalizeFile","pluginPasses","options","code","ast","type","Error","cloneInputAst","cloneDeep","parser","inputMap","inputSourceMap","convertSourceMap","fromObject","lastComment","extractComments","fromComment","err","filename","inputMapURL","exec","readInputSourceMapFile","root","File","extractCommentsFromList","regex","comments","filter","value","test","node","leadingComments","innerComments","trailingComments"],"sources":["../../src/transformation/normalize-file.ts"],"sourcesContent":["import buildDebug from \"debug\";\nimport type { Handler } from \"gensync\";\nimport { file, traverseFast } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { PluginPasses } from \"../config/index.ts\";\nimport convertSourceMap from \"convert-source-map\";\nimport type { SourceMapConverter as Converter } from \"convert-source-map\";\nimport readInputSourceMapFile from \"./read-input-source-map-file.ts\";\nimport File from \"./file/file.ts\";\nimport parser from \"../parser/index.ts\";\nimport cloneDeep from \"./util/clone-deep.ts\";\nimport type { ResolvedOptions } from \"../config/validation/options.ts\";\n\nconst debug = buildDebug(\"babel:transform:file\");\n\n// These regexps are copied from the convert-source-map package,\n// but without // or /* at the beginning of the comment.\n\nconst INLINE_SOURCEMAP_REGEX =\n /^[@#]\\s+sourceMappingURL=data:(?:application|text)\\/json;(?:charset[:=]\\S+?;)?base64,.*$/;\nconst EXTERNAL_SOURCEMAP_REGEX =\n /^[@#][ \\t]+sourceMappingURL=([^\\s'\"`]+)[ \\t]*$/;\n\nexport type NormalizedFile = {\n code: string;\n ast: t.File;\n inputMap: Converter | null;\n};\n\nexport default function* normalizeFile(\n pluginPasses: PluginPasses,\n options: ResolvedOptions,\n code: string,\n ast?: t.File | t.Program | null,\n): Handler<File> {\n code = `${code || \"\"}`;\n\n if (ast) {\n if (ast.type === \"Program\") {\n ast = file(ast, [], []);\n } else if (ast.type !== \"File\") {\n throw new Error(\"AST root must be a Program or File node\");\n }\n\n if (options.cloneInputAst) {\n ast = cloneDeep(ast);\n }\n } else {\n ast = yield* parser(pluginPasses, options, code);\n }\n\n let inputMap = null;\n if (options.inputSourceMap !== false) {\n // If an explicit object is passed in, it overrides the processing of\n // source maps that may be in the file itself.\n if (typeof options.inputSourceMap === \"object\") {\n inputMap = convertSourceMap.fromObject(options.inputSourceMap);\n }\n\n if (!inputMap) {\n const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast);\n if (lastComment) {\n try {\n inputMap = convertSourceMap.fromComment(\"//\" + lastComment);\n } catch (err) {\n if (process.env.BABEL_8_BREAKING) {\n console.warn(\n \"discarding unknown inline input sourcemap\",\n options.filename,\n err,\n );\n } else {\n debug(\"discarding unknown inline input sourcemap\");\n }\n }\n }\n }\n\n if (!inputMap) {\n const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);\n if (typeof options.filename === \"string\" && lastComment) {\n try {\n // when `lastComment` is non-null, EXTERNAL_SOURCEMAP_REGEX must have matches\n const inputMapURL: string =\n EXTERNAL_SOURCEMAP_REGEX.exec(lastComment)[1];\n inputMap = readInputSourceMapFile(\n options.filename,\n options.root,\n inputMapURL,\n );\n } catch (err) {\n debug(\"discarding unknown file input sourcemap\", err);\n }\n } else if (lastComment) {\n debug(\"discarding un-loadable file input sourcemap\");\n }\n }\n }\n\n return new File(options, {\n code,\n ast: ast,\n inputMap,\n });\n}\n\nfunction extractCommentsFromList(\n regex: RegExp,\n comments: t.Comment[],\n lastComment: string | null,\n): [t.Comment[], string | null] {\n if (comments) {\n comments = comments.filter(({ value }) => {\n if (regex.test(value)) {\n lastComment = value;\n return false;\n }\n return true;\n });\n }\n return [comments, lastComment];\n}\n\nfunction extractComments(regex: RegExp, ast: t.Node) {\n let lastComment: string = null;\n traverseFast(ast, node => {\n [node.leadingComments, lastComment] = extractCommentsFromList(\n regex,\n node.leadingComments,\n lastComment,\n );\n [node.innerComments, lastComment] = extractCommentsFromList(\n regex,\n node.innerComments,\n lastComment,\n );\n [node.trailingComments, lastComment] = extractCommentsFromList(\n regeLine truncated
@@ -0,0 +1,37 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Hook = require("./Hook");
const HookCodeFactory = require("./HookCodeFactory");
class AsyncSeriesHookCodeFactory extends HookCodeFactory {
content({ onError, onDone }) {
return this.callTapsSeries({
onError: (i, err, next, doneBreak) => onError(err) + doneBreak(true),
onDone
});
}
}
const factory = new AsyncSeriesHookCodeFactory();
function COMPILE(options) {
factory.setup(this, options);
return factory.create(options);
}
function AsyncSeriesHook(args = [], name = undefined) {
const hook = new Hook(args, name);
hook.constructor = AsyncSeriesHook;
hook.compile = COMPILE;
hook._call = undefined;
hook.call = undefined;
return hook;
}
AsyncSeriesHook.prototype = null;
module.exports = AsyncSeriesHook;
@@ -0,0 +1,6 @@
import * as equal from "fast-deep-equal";
type Equal = typeof equal & {
code: string;
};
declare const _default: Equal;
export default _default;
@@ -0,0 +1,8 @@
/**
* Removes everything after the last "/", but leaves the slash.
*/
export default function stripFilename(path: string | undefined | null): string {
if (!path) return '';
const index = path.lastIndexOf('/');
return path.slice(0, index + 1);
}
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/pan/index.ts"],"sourcesContent":["import { Feature, frame, type PanInfo } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { PanSession } from \"./PanSession\"\n\ntype PanEventHandler = (event: PointerEvent, info: PanInfo) => void\nconst asyncHandler =\n (handler?: PanEventHandler) => (event: PointerEvent, info: PanInfo) => {\n if (handler) {\n frame.update(() => handler(event, info), false, true)\n }\n }\n\nexport class PanGesture extends Feature<Element> {\n private session?: PanSession\n\n private removePointerDownListener: Function = noop\n\n onPointerDown(pointerDownEvent: PointerEvent) {\n this.session = new PanSession(\n pointerDownEvent,\n this.createPanHandlers(),\n {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n }\n )\n }\n\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } =\n this.node.getProps()\n\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: asyncHandler(onPan),\n onEnd: (event: PointerEvent, info: PanInfo) => {\n delete this.session\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info))\n }\n },\n }\n }\n\n mount() {\n this.removePointerDownListener = addPointerEvent(\n this.node.current!,\n \"pointerdown\",\n (event: PointerEvent) => this.onPointerDown(event)\n )\n }\n\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers())\n }\n\n unmount() {\n this.removePointerDownListener()\n this.session && this.session.end()\n }\n}\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,YAAY,GACd,CAAC,OAAyB,KAAK,CAAC,KAAmB,EAAE,IAAa,KAAI;IAClE,IAAI,OAAO,EAAE;AACT,QAAA,KAAK,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC;IACzD;AACJ,CAAC;AAEC,MAAO,UAAW,SAAQ,OAAgB,CAAA;AAAhD,IAAA,WAAA,GAAA;;QAGY,IAAA,CAAA,yBAAyB,GAAa,IAAI;IA8CtD;AA5CI,IAAA,aAAa,CAAC,gBAA8B,EAAA;AACxC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,UAAU,CACzB,gBAAgB,EAChB,IAAI,CAAC,iBAAiB,EAAE,EACxB;AACI,YAAA,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE;AACrD,YAAA,aAAa,EAAE,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;AAC7C,SAAA,CACJ;IACL;IAEA,iBAAiB,GAAA;AACb,QAAA,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,GACpD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QAExB,OAAO;AACH,YAAA,cAAc,EAAE,YAAY,CAAC,iBAAiB,CAAC;AAC/C,YAAA,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC;AACjC,YAAA,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC;AAC3B,YAAA,KAAK,EAAE,CAAC,KAAmB,EAAE,IAAa,KAAI;gBAC1C,OAAO,IAAI,CAAC,OAAO;gBACnB,IAAI,QAAQ,EAAE;AACV,oBAAA,KAAK,CAAC,UAAU,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBACjD;YACJ,CAAC;SACJ;IACL;IAEA,KAAK,GAAA;QACD,IAAI,CAAC,yBAAyB,GAAG,eAAe,CAC5C,IAAI,CAAC,IAAI,CAAC,OAAQ,EAClB,aAAa,EACb,CAAC,KAAmB,KAAK,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CACrD;IACL;IAEA,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACzE;IAEA,OAAO,GAAA;QACH,IAAI,CAAC,yBAAyB,EAAE;QAChC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;IACtC;AACH;;;;"}
@@ -0,0 +1,13 @@
import { progress } from 'motion-utils';
import { mixNumber } from '../../../utils/mix/number.mjs';
function fillOffset(offset, remaining) {
const min = offset[offset.length - 1];
for (let i = 1; i <= remaining; i++) {
const offsetProgress = progress(0, remaining, i);
offset.push(mixNumber(min, 1, offsetProgress));
}
}
export { fillOffset };
//# sourceMappingURL=fill.mjs.map
@@ -0,0 +1,26 @@
import { getStoreFactory } from "./routerStores.js";
import { RouterCore } from "@tanstack/router-core";
//#region src/router.ts
/**
* Creates a new Router instance for React.
*
* Pass the returned router to `RouterProvider` to enable routing.
* Notable options: `routeTree` (your route definitions) and `context`
* (required if the root route was created with `createRootRouteWithContext`).
*
* @param options Router options used to configure the router.
* @returns A Router instance to be provided to `RouterProvider`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction
*/
var createRouter = (options) => {
return new Router(options);
};
var Router = class extends RouterCore {
constructor(options) {
super(options, getStoreFactory);
}
};
//#endregion
export { Router, createRouter };
//# sourceMappingURL=router.js.map
@@ -0,0 +1,24 @@
{
"name": "cookie-signature",
"version": "1.2.2",
"main": "index.js",
"description": "Sign and unsign cookies",
"keywords": ["cookie", "sign", "unsign"],
"author": "TJ Holowaychuk <tj@learnboost.com>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/visionmedia/node-cookie-signature.git"
},
"dependencies": {},
"engines": {
"node": ">=6.6.0"
},
"devDependencies": {
"mocha": "*",
"should": "*"
},
"scripts": {
"test": "mocha --require should --reporter spec"
}
}
@@ -0,0 +1 @@
{"version":3,"file":"elicitationFormExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/elicitationFormExample.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/dismissable-layer.tsx"],
"sourcesContent": ["import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useEscapeKeydown } from '@radix-ui/react-use-escape-keydown';\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayer\n * -----------------------------------------------------------------------------------------------*/\n\nconst DISMISSABLE_LAYER_NAME = 'DismissableLayer';\nconst CONTEXT_UPDATE = 'dismissableLayer.update';\nconst POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';\nconst FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';\n\nlet originalBodyPointerEvents: string;\n\nconst DismissableLayerContext = React.createContext({\n layers: new Set<DismissableLayerElement>(),\n layersWithOutsidePointerEventsDisabled: new Set<DismissableLayerElement>(),\n branches: new Set<DismissableLayerBranchElement>(),\n});\n\ntype DismissableLayerElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface DismissableLayerProps extends PrimitiveDivProps {\n /**\n * When `true`, hover/focus/click interactions will be disabled on elements outside\n * the `DismissableLayer`. Users will need to click twice on outside elements to\n * interact with them: once to close the `DismissableLayer`, and again to trigger the element.\n */\n disableOutsidePointerEvents?: boolean;\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;\n /**\n * Event handler called when the focus moves outside of the `DismissableLayer`.\n * Can be prevented.\n */\n onFocusOutside?: (event: FocusOutsideEvent) => void;\n /**\n * Event handler called when an interaction happens outside the `DismissableLayer`.\n * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.\n * Can be prevented.\n */\n onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;\n /**\n * Handler called when the `DismissableLayer` should be dismissed\n */\n onDismiss?: () => void;\n}\n\nconst DismissableLayer = React.forwardRef<DismissableLayerElement, DismissableLayerProps>(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState<DismissableLayerElement | null>(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node) => setNode(node));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); // prettier-ignore\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled!); // prettier-ignore\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target as HTMLElement;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n\n const focusOutside = useFocusOutside((event) => {\n const target = event.target as HTMLElement;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\nLine truncated
"mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,WAAW,mCAAmC;AACvD,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AAqJ3B;AA/IN,IAAM,yBAAyB;AAC/B,IAAM,iBAAiB;AACvB,IAAM,uBAAuB;AAC7B,IAAM,gBAAgB;AAEtB,IAAI;AAEJ,IAAM,0BAAgC,oBAAc;AAAA,EAClD,QAAQ,oBAAI,IAA6B;AAAA,EACzC,wCAAwC,oBAAI,IAA6B;AAAA,EACzE,UAAU,oBAAI,IAAmC;AACnD,CAAC;AAsCD,IAAM,mBAAyB;AAAA,EAC7B,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,8BAA8B;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;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ACpC,QAAM,QAAQ,IAAI,YAAY,MAAM,EAAE,SAAS,OAAO,YAAY,MAAM,OAAO,CAAC;AAChF,MAAI,QAAS,QAAO,iBAAiB,MAAM,SAA0B,EAAE,MAAM,KAAK,CAAC;AAEnF,MAAI,UAAU;AACZ,gCAA4B,QAAQ,KAAK;AAAA,EAC3C,OAAO;AACL,WAAO,cAAc,KAAK;AAAA,EAC5B;AACF;AAEA,IAAM,OAAO;AACb,IAAM,SAAS;",
"names": ["node", "handleAndDispatchPointerDownOutsideEvent"]
}
@@ -0,0 +1,43 @@
import { MiddlewareHandler } from "../../types.js";
import { Context } from "../../context.js";
//#region src/middleware/body-limit/index.d.ts
type OnError = (c: Context) => Response | Promise<Response>;
type BodyLimitOptions = {
maxSize: number;
onError?: OnError;
};
/**
* Body Limit Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/body-limit}
*
* @param {BodyLimitOptions} options - The options for the body limit middleware.
* @param {number} options.maxSize - The maximum body size allowed.
* @param {OnError} [options.onError] - The error handler to be invoked if the specified body size is exceeded.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
*
* app.post(
* '/upload',
* bodyLimit({
* maxSize: 50 * 1024, // 50kb
* onError: (c) => {
* return c.text('overflow :(', 413)
* },
* }),
* async (c) => {
* const body = await c.req.parseBody()
* if (body['file'] instanceof File) {
* console.log(`Got file sized: ${body['file'].size}`)
* }
* return c.text('pass :)')
* }
* )
* ```
*/
export declare const bodyLimit: (options: BodyLimitOptions) => MiddlewareHandler;
//#endregion
export {};
@@ -0,0 +1,530 @@
/**
* SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.
* SHA256 is the fastest hash implementable in JS, even faster than Blake3.
* Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and
* {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.
* @module
*/
import { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts';
import * as u64 from './_u64.ts';
import { type CHash, clean, createHasher, oidNist, rotr, type TRet } from './utils.ts';
/**
* SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits
* of the cube roots of the first 64 primes (2..311).
*/
// prettier-ignore
const SHA256_K = /* @__PURE__ */ Uint32Array.from([
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
]);
/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */
const SHA256_W = /* @__PURE__ */ new Uint32Array(64);
/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */
abstract class SHA2_32B<T extends SHA2_32B<T>> extends HashMD<T> {
// We cannot use array here since array allows indexing by variable
// which means optimizer/compiler cannot use registers.
protected abstract A: number;
protected abstract B: number;
protected abstract C: number;
protected abstract D: number;
protected abstract E: number;
protected abstract F: number;
protected abstract G: number;
protected abstract H: number;
constructor(outputLen: number) {
super(64, outputLen, 8, false);
}
protected get(): [number, number, number, number, number, number, number, number] {
const { A, B, C, D, E, F, G, H } = this;
return [A, B, C, D, E, F, G, H];
}
// prettier-ignore
protected set(
A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number
): void {
this.A = A | 0;
this.B = B | 0;
this.C = C | 0;
this.D = D | 0;
this.E = E | 0;
this.F = F | 0;
this.G = G | 0;
this.H = H | 0;
}
protected process(view: DataView, offset: number): void {
// Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array
for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);
for (let i = 16; i < 64; i++) {
const W15 = SHA256_W[i - 15];
const W2 = SHA256_W[i - 2];
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);
SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;
}
// Compression function main loop, 64 rounds
let { A, B, C, D, E, F, G, H } = this;
for (let i = 0; i < 64; i++) {
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;
const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
const T2 = (sigma0 + Maj(A, B, C)) | 0;
H = G;
G = F;
F = E;
E = (D + T1) | 0;
D = C;
C = B;
B = A;
A = (T1 + T2) | 0;
}
// Add the compressed chunk to the current hash value
A = (A + this.A) | 0;
B = (B + this.B) | 0;
C = (C + this.C) | 0;
D = (D + this.D) | 0;
E = (E + this.E) | 0;
F = (F + this.F) | 0;
G = (G + this.G) | 0;
H = (H + this.H) | 0;
this.set(A, B, C, D, E, F, G, H);
}
protected roundClean(): void {
clean(SHA256_W);
}
destroy(): void {
// HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves
// update()/digest() callable on reused instances.
this.destroyed = true;
this.set(0, 0, 0, 0, 0, 0, 0, 0);
clean(this.buffer);
}
}
/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */
export class _SHA256 extends SHA2_32B<_SHA256> {
// We cannot use array here since array allows indexing by variable
// which means optimizer/compiler cannot use registers.
protected A: number = SHA256_IV[0] | 0;
protected B: number = SHA256_IV[1] | 0;
protected C: number = SHA256_IV[2] | 0;
protected D: number = SHA256_IV[3] | 0;
protected E: number = SHA256_IV[4] | 0;
protected F: number = SHA256_IV[5] | 0;
protected G: number = SHA256_IV[6] | 0;
protected H: number = SHA256_IV[7] | 0;
constructor() {
super(32);
}
}
/** Internal SHA-224 hash class grounded in RFC 6234 §6.2 and §8.5. */
export class _SHA224 extends SHA2_32B<_SHA224> {
protected A: number = SHA224_IV[0] | 0;
protected B: number = SHA224_IV[1] | 0;
protected C: number = SHA224_IV[2] | 0;
protected D: number = SHA224_IV[3] | 0;
protected E: number = SHA224_IV[4] | 0;
protected F: number = SHA224_IV[5] | 0;
protected G: number = SHA224_IV[6] | 0;
protected H: number = SHA224_IV[7] | 0;
constructor() {
super(28);
}
}
// SHA2-512 is slower than sha256 in js because u64 operations are slow.
// SHA-384 / SHA-512 round constants from RFC 6234 §5.2:
// 80 full 64-bit words split into high/low halves.
// prettier-ignore
const K512 = /* @__PURE__ */ (() => u64.split([
'0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',
'0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',
'0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',
'0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',
'0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',
'0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',
'0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',
'0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',
'0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',
'0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',
'0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',
'0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',
'0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',
'0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',
'0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',
'0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',
'0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',
'0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',
'0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',
'0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'
].map(n => BigInt(n))))();
const SHA512_Kh = /* @__PURE__ */ (() => K512[0])();
const SHA512_Kl = /* @__PURE__ */ (() => K512[1])();
// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.
const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);
// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.
const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);
/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */
abstract class SHA2_64B<T extends SHA2_64B<T>> extends HashMD<T> {
// We cannot use array here since array allows indexing by variable
// which means optimizer/compiler cannot use registers.
// h -- high 32 bits, l -- low 32 bits
protected abstract Ah: number;
protected abstract Al: number;
protected abstract Bh: number;
protected abstract Bl: number;
protected abstract Ch: number;
protected abstract Cl: number;
protected abstract Dh: number;
protected abstract Dl: number;
protected abstract Eh: number;
protected abstract El: number;
protected abstract Fh: number;
protected abstract Fl: number;
protected abstract Gh: number;
protected abstract Gl: number;
protected abstract Hh: number;
protected abstract Hl: number;
constructor(outputLen: number) {
super(128, outputLen, 16, false);
}
// prettier-ignore
protected get(): [
number, number, number, number, number, number, number, number,
number, number, number, number, number, number, number, number
] {
const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];
}
// prettier-ignore
protected set(
Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number,
Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number
): void {
this.Ah = Ah | 0;
this.Al = Al | 0;
this.Bh = Bh | 0;
this.Bl = Bl | 0;
this.Ch = Ch | 0;
this.Cl = Cl | 0;
this.Dh = Dh | 0;
this.Dl = Dl | 0;
this.Eh = Eh | 0;
this.El = El | 0;
this.Fh = Fh | 0;
this.Fl = Fl | 0;
this.Gh = Gh | 0;
this.Gl = Gl | 0;
this.Hh = Hh | 0;
this.Hl = Hl | 0;
}
protected process(view: DataView, offset: number): void {
// Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array
for (let i = 0; i < 16; i++, offset += 4) {
SHA512_W_H[i] = view.getUint32(offset);
SHA512_W_L[i] = view.getUint32((offset += 4));
}
for (let i = 16; i < 80; i++) {
// s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)
const W15h = SHA512_W_H[i - 15] | 0;
const W15l = SHA512_W_L[i - 15] | 0;
const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);
const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);
// s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)
const W2h = SHA512_W_H[i - 2] | 0;
const W2l = SHA512_W_L[i - 2] | 0;
const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);
const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);
// SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16];
const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
SHA512_W_H[i] = SUMh | 0;
SHA512_W_L[i] = SUMl | 0;
}
let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
// Compression function main loop, 80 rounds
for (let i = 0; i < 80; i++) {
// S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)
const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);
const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);
//const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;
const CHIh = (Eh & Fh) ^ (~Eh & Gh);
const CHIl = (El & Fl) ^ (~El & Gl);
// T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]
// prettier-ignore
const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
const T1l = T1ll | 0;
// S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)
const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);
const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);
const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);
const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);
Hh = Gh | 0;
Hl = Gl | 0;
Gh = Fh | 0;
Gl = Fl | 0;
Fh = Eh | 0;
Fl = El | 0;
({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
Dh = Ch | 0;
Dl = Cl | 0;
Ch = Bh | 0;
Cl = Bl | 0;
Bh = Ah | 0;
Bl = Al | 0;
const All = u64.add3L(T1l, sigma0l, MAJl);
Ah = u64.add3H(All, T1h, sigma0h, MAJh);
Al = All | 0;
}
// Add the compressed chunk to the current hash value
({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
}
protected roundClean(): void {
clean(SHA512_W_H, SHA512_W_L);
}
destroy(): void {
// HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves
// update()/digest() callable on reused instances.
this.destroyed = true;
clean(this.buffer);
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
}
/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */
export class _SHA512 extends SHA2_64B<_SHA512> {
protected Ah: number = SHA512_IV[0] | 0;
protected Al: number = SHA512_IV[1] | 0;
protected Bh: number = SHA512_IV[2] | 0;
protected Bl: number = SHA512_IV[3] | 0;
protected Ch: number = SHA512_IV[4] | 0;
protected Cl: number = SHA512_IV[5] | 0;
protected Dh: number = SHA512_IV[6] | 0;
protected Dl: number = SHA512_IV[7] | 0;
protected Eh: number = SHA512_IV[8] | 0;
protected El: number = SHA512_IV[9] | 0;
protected Fh: number = SHA512_IV[10] | 0;
protected Fl: number = SHA512_IV[11] | 0;
protected Gh: number = SHA512_IV[12] | 0;
protected Gl: number = SHA512_IV[13] | 0;
protected Hh: number = SHA512_IV[14] | 0;
protected Hl: number = SHA512_IV[15] | 0;
constructor() {
super(64);
}
}
/** Internal SHA-384 hash class grounded in RFC 6234 §6.3 and §6.4. */
export class _SHA384 extends SHA2_64B<_SHA384> {
protected Ah: number = SHA384_IV[0] | 0;
protected Al: number = SHA384_IV[1] | 0;
protected Bh: number = SHA384_IV[2] | 0;
protected Bl: number = SHA384_IV[3] | 0;
protected Ch: number = SHA384_IV[4] | 0;
protected Cl: number = SHA384_IV[5] | 0;
protected Dh: number = SHA384_IV[6] | 0;
protected Dl: number = SHA384_IV[7] | 0;
protected Eh: number = SHA384_IV[8] | 0;
protected El: number = SHA384_IV[9] | 0;
protected Fh: number = SHA384_IV[10] | 0;
protected Fl: number = SHA384_IV[11] | 0;
protected Gh: number = SHA384_IV[12] | 0;
protected Gl: number = SHA384_IV[13] | 0;
protected Hh: number = SHA384_IV[14] | 0;
protected Hl: number = SHA384_IV[15] | 0;
constructor() {
super(48);
}
}
/**
* Truncated SHA512/256 and SHA512/224.
* SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as "intermediary" IV of SHA512/t.
* Then t hashes string to produce result IV.
* See the repo-side derivation recipe in `test/misc/sha2-gen-iv.js`.
* These IV literals are checked against that script rather than a dedicated
* local RFC section.
*/
/** SHA-512/224 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and
* stored as sixteen big-endian 32-bit halves. */
const T224_IV = /* @__PURE__ */ Uint32Array.from([
0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,
0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,
]);
/** SHA-512/256 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and
* stored as sixteen big-endian 32-bit halves. */
const T256_IV = /* @__PURE__ */ Uint32Array.from([
0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,
0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,
]);
/** Internal SHA-512/224 hash class using the derived `T224_IV` and the shared
* RFC 6234 §6.4 compression engine. */
export class _SHA512_224 extends SHA2_64B<_SHA512_224> {
protected Ah: number = T224_IV[0] | 0;
protected Al: number = T224_IV[1] | 0;
protected Bh: number = T224_IV[2] | 0;
protected Bl: number = T224_IV[3] | 0;
protected Ch: number = T224_IV[4] | 0;
protected Cl: number = T224_IV[5] | 0;
protected Dh: number = T224_IV[6] | 0;
protected Dl: number = T224_IV[7] | 0;
protected Eh: number = T224_IV[8] | 0;
protected El: number = T224_IV[9] | 0;
protected Fh: number = T224_IV[10] | 0;
protected Fl: number = T224_IV[11] | 0;
protected Gh: number = T224_IV[12] | 0;
protected Gl: number = T224_IV[13] | 0;
protected Hh: number = T224_IV[14] | 0;
protected Hl: number = T224_IV[15] | 0;
constructor() {
super(28);
}
}
/** Internal SHA-512/256 hash class using the derived `T256_IV` and the shared
* RFC 6234 §6.4 compression engine. */
export class _SHA512_256 extends SHA2_64B<_SHA512_256> {
protected Ah: number = T256_IV[0] | 0;
protected Al: number = T256_IV[1] | 0;
protected Bh: number = T256_IV[2] | 0;
protected Bl: number = T256_IV[3] | 0;
protected Ch: number = T256_IV[4] | 0;
protected Cl: number = T256_IV[5] | 0;
protected Dh: number = T256_IV[6] | 0;
protected Dl: number = T256_IV[7] | 0;
protected Eh: number = T256_IV[8] | 0;
protected El: number = T256_IV[9] | 0;
protected Fh: number = T256_IV[10] | 0;
protected Fl: number = T256_IV[11] | 0;
protected Gh: number = T256_IV[12] | 0;
protected Gl: number = T256_IV[13] | 0;
protected Hh: number = T256_IV[14] | 0;
protected Hl: number = T256_IV[15] | 0;
constructor() {
super(32);
}
}
/**
* SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:
*
* - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.
* - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.
* - Each sha256 hash is executing 2^18 bit operations.
* - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA2-256.
* ```ts
* sha256(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha256: TRet<CHash<_SHA256>> = /* @__PURE__ */ createHasher(
() => new _SHA256(),
/* @__PURE__ */ oidNist(0x01)
);
/**
* SHA2-224 hash function from RFC 4634.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA2-224.
* ```ts
* sha224(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha224: TRet<CHash<_SHA224>> = /* @__PURE__ */ createHasher(
() => new _SHA224(),
/* @__PURE__ */ oidNist(0x04)
);
/**
* SHA2-512 hash function from RFC 4634.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA2-512.
* ```ts
* sha512(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha512: TRet<CHash<_SHA512>> = /* @__PURE__ */ createHasher(
() => new _SHA512(),
/* @__PURE__ */ oidNist(0x03)
);
/**
* SHA2-384 hash function from RFC 4634.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA2-384.
* ```ts
* sha384(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha384: TRet<CHash<_SHA384>> = /* @__PURE__ */ createHasher(
() => new _SHA384(),
/* @__PURE__ */ oidNist(0x02)
);
/**
* SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks.
* See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA2-512/256.
* ```ts
* sha512_256(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha512_256: TRet<CHash<_SHA512_256>> = /* @__PURE__ */ createHasher(
() => new _SHA512_256(),
/* @__PURE__ */ oidNist(0x06)
);
/**
* SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks.
* See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA2-512/224.
* ```ts
* sha512_224(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha512_224: TRet<CHash<_SHA512_224>> = /* @__PURE__ */ createHasher(
() => new _SHA512_224(),
/* @__PURE__ */ oidNist(0x05)
);
@@ -0,0 +1,57 @@
import contentType from 'content-type';
/**
* Extracts the media type (the lowercased `type/subtype` pair, without
* parameters) from a raw `Content-Type` header value, or `undefined` when the
* header is missing or empty.
*
* Content-Type comparisons must use the parsed media type, never a substring
* search of the raw header: a value like `text/plain; a=application/json`
* contains the substring `application/json` but its media type is
* `text/plain`, and case variants or parameters make naive string comparison
* wrong in both directions.
*
* "Essence" is the WHATWG MIME Sniffing standard's term for the bare
* `type/subtype` pair (https://mimesniff.spec.whatwg.org/#mime-type-essence);
* the Fetch standard's request classification is defined against it
* (https://fetch.spec.whatwg.org/#cors-safelisted-request-header).
*
* Parsing is RFC 9110 (`content-type` package) first. When the parameter
* section is malformed (`application/json;`, `application/json; charset=`),
* browsers and most HTTP stacks still derive the media type from the segment
* before the first `;` — the fallback matches that widely-implemented
* behavior, so a header whose media type is unambiguous is not rejected for
* a sloppy parameter section.
*/
export function mediaTypeEssence(header) {
if (!header) {
return undefined;
}
try {
return contentType.parse(header).type;
}
catch {
const essence = (header.split(';', 1)[0] ?? '').trim().toLowerCase();
// A comma in the parameter tail of an unparseable value indicates
// joined duplicate headers — ambiguous, so no essence at all (keeps
// duplicate-header handling uniform whether or not the first copy
// carries parameters).
if (essence === '' || header.slice(essence.length).includes(',')) {
return undefined;
}
return essence;
}
}
/**
* Whether a raw `Content-Type` header value denotes `application/json`.
* Parameters (for example `charset=utf-8`) are allowed and ignored; malformed
* parameter sections do not reject a header whose media type is unambiguously
* `application/json` (see `mediaTypeEssence` for the exact grammar).
*/
export function isJsonContentType(header) {
// Fast path: the exact literal is what SDK clients send on every POST.
if (header === 'application/json') {
return true;
}
return mediaTypeEssence(header) === 'application/json';
}
//# sourceMappingURL=mediaType.js.map
@@ -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 FileChartColumnIncreasing = createLucideIcon("FileChartColumnIncreasing", [
["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: "M8 18v-2", key: "qcmpov" }],
["path", { d: "M12 18v-4", key: "q1q25u" }],
["path", { d: "M16 18v-6", key: "15y0np" }]
]);
export { FileChartColumnIncreasing as default };
//# sourceMappingURL=file-chart-column-increasing.js.map
@@ -0,0 +1,164 @@
import { describe, it, expect, vi } from "vitest";
import { Parser, Tokenizer } from "./index.js";
import type { Handler } from "./Parser.js";
describe("API", () => {
it("should work without callbacks", () => {
const cbs: Partial<Handler> = { onerror: vi.fn() };
const p = new Parser(cbs, {
xmlMode: true,
lowerCaseAttributeNames: true,
});
p.end("<a foo><bar></a><!-- --><![CDATA[]]]><?foo?><!bar><boo/>boohay");
p.write("foo");
// Check for an error
p.end();
p.write("foo");
expect(cbs.onerror).toHaveBeenLastCalledWith(
new Error(".write() after done!"),
);
p.end();
expect(cbs.onerror).toHaveBeenLastCalledWith(
new Error(".end() after done!"),
);
// Should ignore the error if there is no callback
delete cbs.onerror;
p.write("foo");
p.reset();
// Remove method
cbs.onopentag = vi.fn();
p.write("<a foo");
delete cbs.onopentag;
p.write(">");
// Pause/resume
const onText = vi.fn();
cbs.ontext = onText;
p.pause();
p.write("foo");
expect(onText).not.toHaveBeenCalled();
p.resume();
expect(onText).toHaveBeenLastCalledWith("foo");
p.pause();
expect(onText).toHaveBeenCalledTimes(1);
p.resume();
expect(onText).toHaveBeenCalledTimes(1);
p.pause();
p.end("bar");
expect(onText).toHaveBeenCalledTimes(1);
p.resume();
expect(onText).toHaveBeenCalledTimes(2);
expect(onText).toHaveBeenLastCalledWith("bar");
});
it("should back out of numeric entities (#125)", () => {
const onend = vi.fn();
let text = "";
const p = new Parser({
ontext(data) {
text += data;
},
onend,
});
p.end("id=770&#anchor");
expect(onend).toHaveBeenCalledTimes(1);
expect(text).toBe("id=770&#anchor");
p.reset();
text = "";
p.end("0&#xn");
expect(onend).toHaveBeenCalledTimes(2);
expect(text).toBe("0&#xn");
});
it("should not have the start index be greater than the end index", () => {
const onopentag = vi.fn();
const onclosetag = vi.fn();
const p = new Parser({
onopentag(tag) {
expect(p.startIndex).toBeLessThanOrEqual(p.endIndex);
onopentag(tag, p.startIndex, p.endIndex);
},
onclosetag(tag) {
expect(p.startIndex).toBeLessThanOrEqual(p.endIndex);
onclosetag(tag, p.endIndex);
},
});
p.write("<p>");
expect(onopentag).toHaveBeenLastCalledWith("p", 0, 2);
expect(onclosetag).not.toHaveBeenCalled();
p.write("Foo");
p.write("<hr>");
expect(onopentag).toHaveBeenLastCalledWith("hr", 6, 9);
expect(onclosetag).toHaveBeenCalledTimes(2);
expect(onclosetag).toHaveBeenNthCalledWith(1, "p", 9);
expect(onclosetag).toHaveBeenNthCalledWith(2, "hr", 9);
});
it("should update the position when a single tag is spread across multiple chunks", () => {
let called = false;
const p = new Parser({
onopentag() {
called = true;
expect(p.startIndex).toBe(0);
expect(p.endIndex).toBe(12);
},
});
p.write("<div ");
p.write("foo=bar>");
expect(called).toBe(true);
});
it("should have the correct position for implied opening tags", () => {
let called = false;
const p = new Parser({
onopentag() {
called = true;
expect(p.startIndex).toBe(0);
expect(p.endIndex).toBe(3);
},
});
p.write("</p>");
expect(called).toBe(true);
});
it("should parse <__proto__> (#387)", () => {
const p = new Parser(null);
// Should not throw
p.parseChunk("<__proto__>");
});
it("should support custom tokenizer", () => {
class CustomTokenizer extends Tokenizer {}
const p = new Parser(
{
onparserinit(parser: Parser) {
// @ts-expect-error Accessing private tokenizer here
expect(parser.tokenizer).toBeInstanceOf(CustomTokenizer);
},
},
{ Tokenizer: CustomTokenizer },
);
p.done();
});
});
@@ -0,0 +1,9 @@
//! otpauth 9.5.1 | (c) Héctor Molinero Fernández | MIT | https://github.com/hectorm/otpauth
/// <reference types="./otpauth.d.ts" />
// @ts-nocheck
import*as e from"node:crypto";const t=(()=>{if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"__GLOBALTHIS__",{get(){return this},configurable:!0});try{if("undefined"!=typeof __GLOBALTHIS__)return __GLOBALTHIS__}finally{delete Object.prototype.__GLOBALTHIS__}return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0})(),r=e=>{switch(!0){case/^(?:SHA-?1|SSL3-SHA1)$/i.test(e):return"SHA1";case/^SHA(?:2?-)?224$/i.test(e):return"SHA224";case/^SHA(?:2?-)?256$/i.test(e):return"SHA256";case/^SHA(?:2?-)?384$/i.test(e):return"SHA384";case/^SHA(?:2?-)?512$/i.test(e):return"SHA512";case/^SHA3-224$/i.test(e):return"SHA3-224";case/^SHA3-256$/i.test(e):return"SHA3-256";case/^SHA3-384$/i.test(e):return"SHA3-384";case/^SHA3-512$/i.test(e):return"SHA3-512";default:throw new TypeError(`Unknown hash algorithm: ${e}`)}},i=(r,i,s)=>{if(e?.createHmac){const n=e.createHmac(r,t.Buffer.from(i));return n.update(t.Buffer.from(s)),n.digest()}throw new Error("Missing HMAC function")},s="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",n=e=>{let t=(e=e.replace(/ /g,"")).length;for(;"="===e[t-1];)--t;e=(t<e.length?e.substring(0,t):e).toUpperCase();const r=new ArrayBuffer(5*e.length/8|0),i=new Uint8Array(r);let n=0,a=0,o=0;for(let t=0;t<e.length;t++){const r=s.indexOf(e[t]);if(-1===r)throw new TypeError(`Invalid character found: ${e[t]}`);a=a<<5|r,n+=5,n>=8&&(n-=8,i[o++]=a>>>n)}return i},a=e=>{let t=0,r=0,i="";for(let n=0;n<e.length;n++)for(r=r<<8|e[n],t+=8;t>=5;)i+=s[r>>>t-5&31],t-=5;return t>0&&(i+=s[r<<5-t&31]),i},o=e=>{e=e.replace(/ /g,"");const t=new ArrayBuffer(e.length/2),r=new Uint8Array(t);for(let t=0;t<e.length;t+=2)r[t/2]=parseInt(e.substring(t,t+2),16);return r},l=e=>{let t="";for(let r=0;r<e.length;r++){const i=e[r].toString(16);1===i.length&&(t+="0"),t+=i}return t.toUpperCase()},u=e=>{const t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let t=0;t<e.length;t++)r[t]=255&e.charCodeAt(t);return r},h=e=>{let t=""
;for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},c=t.TextEncoder?new t.TextEncoder:null,d=t.TextDecoder?new t.TextDecoder:null,f=e=>{if(!c)throw new Error("Encoding API not available");return c.encode(e)},g=e=>{if(!d)throw new Error("Encoding API not available");return d.decode(e)};class m{static fromLatin1(e){return new m({buffer:u(e).buffer})}static fromUTF8(e){return new m({buffer:f(e).buffer})}static fromBase32(e){return new m({buffer:n(e).buffer})}static fromHex(e){return new m({buffer:o(e).buffer})}get buffer(){return this.bytes.buffer}get latin1(){return Object.defineProperty(this,"latin1",{enumerable:!0,writable:!1,configurable:!1,value:h(this.bytes)}),this.latin1}get utf8(){return Object.defineProperty(this,"utf8",{enumerable:!0,writable:!1,configurable:!1,value:g(this.bytes)}),this.utf8}get base32(){return Object.defineProperty(this,"base32",{enumerable:!0,writable:!1,configurable:!1,value:a(this.bytes)}),this.base32}get hex(){return Object.defineProperty(this,"hex",{enumerable:!0,writable:!1,configurable:!1,value:l(this.bytes)}),this.hex}constructor({buffer:r,size:i=20}={}){this.bytes=void 0===r?(r=>{if(e?.randomBytes)return e.randomBytes(r);if(t.crypto?.getRandomValues)return t.crypto.getRandomValues(new Uint8Array(r));throw new Error("Cryptography API not available")})(i):new Uint8Array(r),Object.defineProperty(this,"bytes",{enumerable:!0,writable:!1,configurable:!1,value:this.bytes})}}class p{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,counter:0,window:1}}static generate({secret:e,algorithm:t=p.defaults.algorithm,digits:r=p.defaults.digits,counter:s=p.defaults.counter,hmac:n=i}){const a=(e=>{const t=new ArrayBuffer(8),r=new Uint8Array(t);let i=e;for(let e=7;e>=0&&0!==i;e--)r[e]=255&i,i-=r[e],i/=256;return r})(s),o=n(t,e.bytes,a);if(!o?.byteLength||o.byteLength<19)throw new TypeError("Return value must be at least 19 bytes");const l=15&o[o.byteLength-1]
;return(((127&o[l])<<24|(255&o[l+1])<<16|(255&o[l+2])<<8|255&o[l+3])%10**r).toString().padStart(r,"0")}generate({counter:e=this.counter++}={}){return p.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:e,hmac:this.hmac})}static validate({token:r,secret:s,algorithm:n,digits:a=p.defaults.digits,counter:o=p.defaults.counter,window:l=p.defaults.window,hmac:u=i}){if(r.length!==a)return null;let h=null;const c=i=>{const l=p.generate({secret:s,algorithm:n,digits:a,counter:i,hmac:u});((r,i)=>{if(e?.timingSafeEqual)return e.timingSafeEqual(t.Buffer.from(r),t.Buffer.from(i));{if(r.length!==i.length)throw new TypeError("Input strings must have the same length");let e=-1,t=0;for(;++e<r.length;)t|=r.charCodeAt(e)^i.charCodeAt(e);return 0===t}})(r,l)&&(h=i-o)};c(o);for(let e=1;e<=l&&null===h&&(c(o-e),null===h)&&(c(o+e),null===h);++e);return h}validate({token:e,counter:t=this.counter,window:r}){return p.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,counter:t,window:r,hmac:this.hmac})}toString(){const e=encodeURIComponent;return"otpauth://hotp/"+(this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`)+`secret=${e(this.secret.base32)}&`+`algorithm=${e(this.algorithm)}&`+`digits=${e(this.digits)}&`+`counter=${e(this.counter)}`}constructor({issuer:e=p.defaults.issuer,label:t=p.defaults.label,issuerInLabel:i=p.defaults.issuerInLabel,secret:s=new m,algorithm:n=p.defaults.algorithm,digits:a=p.defaults.digits,counter:o=p.defaults.counter,hmac:l}={}){this.issuer=e,this.label=t,this.issuerInLabel=i,this.secret="string"==typeof s?m.fromBase32(s):s,this.algorithm=l?n:r(n),this.digits=a,this.counter=o,this.hmac=l}}class b{static get defaults(){return{issuer:"",label:"OTPAuth",issuerInLabel:!0,algorithm:"SHA1",digits:6,period:30,window:1}}static counter({period:e=b.defaults.period,timestamp:t=Date.now()}={}){return Math.floor(t/1e3/e)}
counter({timestamp:e=Date.now()}={}){return b.counter({period:this.period,timestamp:e})}static remaining({period:e=b.defaults.period,timestamp:t=Date.now()}={}){return 1e3*e-t%(1e3*e)}remaining({timestamp:e=Date.now()}={}){return b.remaining({period:this.period,timestamp:e})}static generate({secret:e,algorithm:t,digits:r,period:i=b.defaults.period,timestamp:s=Date.now(),hmac:n}){return p.generate({secret:e,algorithm:t,digits:r,counter:b.counter({period:i,timestamp:s}),hmac:n})}generate({timestamp:e=Date.now()}={}){return b.generate({secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:e,hmac:this.hmac})}static validate({token:e,secret:t,algorithm:r,digits:i,period:s=b.defaults.period,timestamp:n=Date.now(),window:a,hmac:o}){return p.validate({token:e,secret:t,algorithm:r,digits:i,counter:b.counter({period:s,timestamp:n}),window:a,hmac:o})}validate({token:e,timestamp:t,window:r}){return b.validate({token:e,secret:this.secret,algorithm:this.algorithm,digits:this.digits,period:this.period,timestamp:t,window:r,hmac:this.hmac})}toString(){const e=encodeURIComponent;return"otpauth://totp/"+(this.issuer.length>0?this.issuerInLabel?`${e(this.issuer)}:${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?issuer=${e(this.issuer)}&`:`${e(this.label)}?`)+`secret=${e(this.secret.base32)}&`+`algorithm=${e(this.algorithm)}&`+`digits=${e(this.digits)}&`+`period=${e(this.period)}`}constructor({issuer:e=b.defaults.issuer,label:t=b.defaults.label,issuerInLabel:i=b.defaults.issuerInLabel,secret:s=new m,algorithm:n=b.defaults.algorithm,digits:a=b.defaults.digits,period:o=b.defaults.period,hmac:l}={}){this.issuer=e,this.label=t,this.issuerInLabel=i,this.secret="string"==typeof s?m.fromBase32(s):s,this.algorithm=l?n:r(n),this.digits=a,this.period=o,this.hmac=l}}
const w=/^otpauth:\/\/([ht]otp)\/(.+)\?([A-Z0-9.~_-]+=[^?&]*(?:&[A-Z0-9.~_-]+=[^?&]*)*)$/i,y=/^[2-7A-Z]+=*$/i,A=/^SHA(?:1|224|256|384|512|3-224|3-256|3-384|3-512)$/i,S=/^[A-Z0-9]+(?:[_-][A-Z0-9]+)*$/i,I=/^[+-]?\d+$/,$=/^\+?[1-9]\d*$/;class v{static parse(e,{hmac:t}={}){let r;try{r=e.match(w)}catch(e){}if(!Array.isArray(r))throw new URIError("Invalid URI format");const i=r[1].toLowerCase(),s=r[2].split(/(?::|%3A) *(.+)/i,2).map(decodeURIComponent),n=r[3].split("&").reduce((e,t)=>{const r=t.split(/=(.*)/,2).map(decodeURIComponent),i=r[0].toLowerCase(),s=r[1],n=e;return n[i]=s,n},{});let a;const o={};if("hotp"===i){if(a=p,void 0===n.counter||!I.test(n.counter))throw new TypeError("Missing or invalid 'counter' parameter");o.counter=parseInt(n.counter,10)}else{if("totp"!==i)throw new TypeError("Unknown OTP type");if(a=b,void 0!==n.period){if(!$.test(n.period))throw new TypeError("Invalid 'period' parameter");o.period=parseInt(n.period,10)}}if(void 0!==n.issuer&&(o.issuer=n.issuer),2===s.length?(o.label=s[1],void 0===o.issuer||""===o.issuer?o.issuer=s[0]:""===s[0]&&(o.issuerInLabel=!1)):(o.label=s[0],void 0!==o.issuer&&""!==o.issuer&&(o.issuerInLabel=!1)),void 0===n.secret||!y.test(n.secret))throw new TypeError("Missing or invalid 'secret' parameter");if(o.secret=n.secret,void 0!==n.algorithm){if(!(t?S:A).test(n.algorithm))throw new TypeError("Invalid 'algorithm' parameter");o.algorithm=n.algorithm}if(void 0!==n.digits){if(!$.test(n.digits))throw new TypeError("Invalid 'digits' parameter");o.digits=parseInt(n.digits,10)}return void 0!==t&&(o.hmac=t),new a(o)}static stringify(e){if(e instanceof p||e instanceof b)return e.toString();throw new TypeError("Invalid 'HOTP/TOTP' object")}}const H="9.5.1";export{p as HOTP,m as Secret,b as TOTP,v as URI,H as version};
//# sourceMappingURL=otpauth.node.min.mjs.map
@@ -0,0 +1,13 @@
/**
* Compares two identifiers, must be numeric strings or truthy/falsy values.
*
* Sorts in ascending order when passed to `Array.sort()`.
*/
export function compareIdentifiers(a: string | null | undefined, b: string | null | undefined): 1 | 0 | -1;
/**
* The reverse of compareIdentifiers.
*
* Sorts in descending order when passed to `Array.sort()`.
*/
export function rcompareIdentifiers(a: string | null | undefined, b: string | null | undefined): 1 | 0 | -1;
@@ -0,0 +1,423 @@
flf2a$ 4 3 11 0 13
Maxfour by Randall Ransom 1/94 <suaac@csv.warwick.ac.uk>
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
4 - height of a character
3 - height of a character, not including descenders
11 - max line length (excluding comment lines) + a fudge factor
0 - default smushmode for this font (like "-m 0" on command line)
13 - number of comment lines
$$@
$$@
$$@
$$@@
|@
|@
.@
$@@
||@
$$@
$$@
$$@@
. .$@
-|-|-@
-|-|-@
' '$@@
||@
(~@
_)@
||@@
o /@
$/$@
/ o@
$ $@@
$|@
(~@
(_@
$|@@
/@
$@
$@
$@@
/@
| @
| @
\@@
\ @
|@
|@
/ @@
\ /@
-X-@
/ \@
$ $@@
$.$@
-+-@
$'$@
$ $@@
$@
$@
o@
/@@
$ $@
---@
$ $@
$ $@@
$@
$@
o@
$@@
/@
/ @
/ @
@@
/~~\ @
| |@
\__/ @
@@
/| @
| @
_|_@
@@
/~\@
./@
/__@
@@
/~\@
<@
\_/@
@@
/| @
/_|_@
| @
@@
|~~@
'~\@
__/@
@@
/~~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| @
~|~@
| @
@@
@
| |@
\_/|@
@@
@
\ /@
\/ @
@@
@
\ /@
\/\/ @
@@
@
\/@
/\@
@@
@
\ /@
\/ @
_/ @@
@
~/@
/_@
@@
|~@
/ @
\ @
|_@@
|@
|@
|@
|@@
~| @
\@
/@
_| @@
@
_-_-@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@@ -0,0 +1,57 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isNodesEquivalent;
var _index = require("../definitions/index.js");
function isNodesEquivalent(a, b) {
if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) {
return a === b;
}
if (a.type !== b.type) {
return false;
}
const fields = Object.keys(_index.NODE_FIELDS[a.type] || a.type);
const visitorKeys = _index.VISITOR_KEYS[a.type];
for (const field of fields) {
const val_a = a[field];
const val_b = b[field];
if (typeof val_a !== typeof val_b) {
return false;
}
if (val_a == null && val_b == null) {
continue;
} else if (val_a == null || val_b == null) {
return false;
}
if (Array.isArray(val_a)) {
if (!Array.isArray(val_b)) {
return false;
}
if (val_a.length !== val_b.length) {
return false;
}
for (let i = 0; i < val_a.length; i++) {
if (!isNodesEquivalent(val_a[i], val_b[i])) {
return false;
}
}
continue;
}
if (typeof val_a === "object" && !(visitorKeys != null && visitorKeys.includes(field))) {
for (const key of Object.keys(val_a)) {
if (val_a[key] !== val_b[key]) {
return false;
}
}
continue;
}
if (!isNodesEquivalent(val_a, val_b)) {
return false;
}
}
return true;
}
//# sourceMappingURL=isNodesEquivalent.js.map
@@ -0,0 +1 @@
{"version":3,"file":"calendar-range.js","sources":["../../../src/icons/calendar-range.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CalendarRange\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjQiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0xNiAydjQiIC8+CiAgPHBhdGggZD0iTTMgMTBoMTgiIC8+CiAgPHBhdGggZD0iTTggMnY0IiAvPgogIDxwYXRoIGQ9Ik0xNyAxNGgtNiIgLz4KICA8cGF0aCBkPSJNMTMgMThINyIgLz4KICA8cGF0aCBkPSJNNyAxNGguMDEiIC8+CiAgPHBhdGggZD0iTTE3IDE4aC4wMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/calendar-range\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 CalendarRange = createLucideIcon('CalendarRange', [\n ['rect', { width: '18', height: '18', x: '3', y: '4', rx: '2', key: '1hopcy' }],\n ['path', { d: 'M16 2v4', key: '4m81vk' }],\n ['path', { d: 'M3 10h18', key: '8toen8' }],\n ['path', { d: 'M8 2v4', key: '1cmpym' }],\n ['path', { d: 'M17 14h-6', key: 'bkmgh3' }],\n ['path', { d: 'M13 18H7', key: 'bb0bb7' }],\n ['path', { d: 'M7 14h.01', key: '1qa3f1' }],\n ['path', { d: 'M17 18h.01', key: '1bdyru' }],\n]);\n\nexport default CalendarRange;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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AAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Server = createLucideIcon("Server", [
["rect", { width: "20", height: "8", x: "2", y: "2", rx: "2", ry: "2", key: "ngkwjq" }],
["rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", ry: "2", key: "iecqi9" }],
["line", { x1: "6", x2: "6.01", y1: "6", y2: "6", key: "16zg32" }],
["line", { x1: "6", x2: "6.01", y1: "18", y2: "18", key: "nzw8ys" }]
]);
export { Server as default };
//# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
{"version":3,"file":"calendar-sync.js","sources":["../../../src/icons/calendar-sync.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CalendarSync\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEgMTB2NGg0IiAvPgogIDxwYXRoIGQ9Im0xMSAxNCAxLjUzNS0xLjYwNWE1IDUgMCAwIDEgOCAxLjUiIC8+CiAgPHBhdGggZD0iTTE2IDJ2NCIgLz4KICA8cGF0aCBkPSJtMjEgMTgtMS41MzUgMS42MDVhNSA1IDAgMCAxLTgtMS41IiAvPgogIDxwYXRoIGQ9Ik0yMSAyMnYtNGgtNCIgLz4KICA8cGF0aCBkPSJNMjEgOC41VjZhMiAyIDAgMCAwLTItMkg1YTIgMiAwIDAgMC0yIDJ2MTRhMiAyIDAgMCAwIDIgMmg0LjMiIC8+CiAgPHBhdGggZD0iTTMgMTBoNCIgLz4KICA8cGF0aCBkPSJNOCAydjQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/calendar-sync\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 CalendarSync = createLucideIcon('CalendarSync', [\n ['path', { d: 'M11 10v4h4', key: '172dkj' }],\n ['path', { d: 'm11 14 1.535-1.605a5 5 0 0 1 8 1.5', key: 'vu0qm5' }],\n ['path', { d: 'M16 2v4', key: '4m81vk' }],\n ['path', { d: 'm21 18-1.535 1.605a5 5 0 0 1-8-1.5', key: '1qgeyt' }],\n ['path', { d: 'M21 22v-4h-4', key: 'hrummi' }],\n ['path', { d: 'M21 8.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h4.3', key: 'mctw84' }],\n ['path', { d: 'M3 10h4', key: '1el30a' }],\n ['path', { d: 'M8 2v4', key: '1cmpym' }],\n]);\n\nexport default CalendarSync;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACnE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAA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CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7F,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,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACzC,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,22 @@
/**
* @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 Blocks = createLucideIcon("Blocks", [
["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
[
"path",
{
d: "M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",
key: "1fpvtg"
}
]
]);
export { Blocks as default };
//# sourceMappingURL=blocks.js.map
@@ -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 SearchCheck = createLucideIcon("SearchCheck", [
["path", { d: "m8 11 2 2 4-4", key: "1sed1v" }],
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
]);
export { SearchCheck as default };
//# sourceMappingURL=search-check.js.map
@@ -0,0 +1,496 @@
import { ReadableStream } from 'node:stream/web'
import { Readable } from 'node:stream'
import { TSR_SCRIPT_BARRIER_ID } from './constants'
import type { AnyRouter } from '../router'
export function transformReadableStreamWithRouter(
router: AnyRouter,
routerStream: ReadableStream,
) {
return transformStreamWithRouter(router, routerStream)
}
export function transformPipeableStreamWithRouter(
router: AnyRouter,
routerStream: Readable,
) {
return Readable.fromWeb(
transformStreamWithRouter(router, Readable.toWeb(routerStream)),
)
}
// Use string constants for simple indexOf matching
const BODY_END_TAG = '</body>'
const HTML_END_TAG = '</html>'
// Minimum length of a valid closing tag: </a> = 4 characters
const MIN_CLOSING_TAG_LENGTH = 4
// Default timeout values (in milliseconds)
const DEFAULT_SERIALIZATION_TIMEOUT_MS = 60000
const DEFAULT_LIFETIME_TIMEOUT_MS = 60000
// Module-level encoder (stateless, safe to reuse)
const textEncoder = new TextEncoder()
/**
* Finds the position just after the last valid HTML closing tag in the string.
*
* Valid closing tags match the pattern: </[a-zA-Z][\w:.-]*>
* Examples: </div>, </my-component>, </slot:name.nested>
*
* @returns Position after the last closing tag, or -1 if none found
*/
function findLastClosingTagEnd(str: string): number {
const len = str.length
if (len < MIN_CLOSING_TAG_LENGTH) return -1
let i = len - 1
while (i >= MIN_CLOSING_TAG_LENGTH - 1) {
// Look for > (charCode 62)
if (str.charCodeAt(i) === 62) {
// Look backwards for valid tag name characters
let j = i - 1
// Skip through valid tag name characters
while (j >= 1) {
const code = str.charCodeAt(j)
// Check if it's a valid tag name char: [a-zA-Z0-9_:.-]
if (
(code >= 97 && code <= 122) || // a-z
(code >= 65 && code <= 90) || // A-Z
(code >= 48 && code <= 57) || // 0-9
code === 95 || // _
code === 58 || // :
code === 46 || // .
code === 45 // -
) {
j--
} else {
break
}
}
// Check if the first char after </ is a valid start char (letter only)
const tagNameStart = j + 1
if (tagNameStart < i) {
const startCode = str.charCodeAt(tagNameStart)
// Tag name must start with a letter (a-z or A-Z)
if (
(startCode >= 97 && startCode <= 122) ||
(startCode >= 65 && startCode <= 90)
) {
// Check for </ (charCodes: < = 60, / = 47)
if (
j >= 1 &&
str.charCodeAt(j) === 47 &&
str.charCodeAt(j - 1) === 60
) {
return i + 1 // Return position after the closing >
}
}
}
}
i--
}
return -1
}
export function transformStreamWithRouter(
router: AnyRouter,
appStream: ReadableStream,
opts?: {
/** Timeout for serialization to complete after app render finishes (default: 60000ms) */
timeoutMs?: number
/** Maximum lifetime of the stream transform (default: 60000ms). Safety net for cleanup. */
lifetimeMs?: number
},
) {
// Check upfront if serialization already finished synchronously
// This is the fast path for routes with no deferred data
const serializationAlreadyFinished =
router.serverSsr?.isSerializationFinished() ?? false
// Take any HTML that was buffered before we started listening
const initialBufferedHtml = router.serverSsr?.takeBufferedHtml()
// True passthrough: if serialization already finished and nothing buffered,
// we can avoid any decoding/scanning while still honoring cleanup + setRenderFinished.
if (serializationAlreadyFinished && !initialBufferedHtml) {
let cleanedUp = false
let controller: ReadableStreamDefaultController<Uint8Array> | undefined
let isStreamClosed = false
let lifetimeTimeoutHandle: ReturnType<typeof setTimeout> | undefined
const cleanup = () => {
if (cleanedUp) return
cleanedUp = true
if (lifetimeTimeoutHandle !== undefined) {
clearTimeout(lifetimeTimeoutHandle)
lifetimeTimeoutHandle = undefined
}
router.serverSsr?.cleanup()
}
const safeClose = () => {
if (isStreamClosed) return
isStreamClosed = true
try {
controller?.close()
} catch {
// ignore
}
}
const safeError = (error: unknown) => {
if (isStreamClosed) return
isStreamClosed = true
try {
controller?.error(error)
} catch {
// ignore
}
}
const lifetimeMs = opts?.lifetimeMs ?? DEFAULT_LIFETIME_TIMEOUT_MS
lifetimeTimeoutHandle = setTimeout(() => {
if (!cleanedUp && !isStreamClosed) {
console.warn(
`SSR stream transform exceeded maximum lifetime (${lifetimeMs}ms), forcing cleanup`,
)
safeError(new Error('Stream lifetime exceeded'))
cleanup()
}
}, lifetimeMs)
const stream = new ReadableStream<Uint8Array>({
start(c: ReadableStreamDefaultController<Uint8Array>) {
controller = c
},
cancel() {
isStreamClosed = true
cleanup()
},
})
;(async () => {
const reader = appStream.getReader()
try {
while (true) {
const { done, value } = await reader.read()
if (done) break
if (cleanedUp || isStreamClosed) return
controller?.enqueue(value as unknown as Uint8Array)
}
if (cleanedUp || isStreamClosed) return
router.serverSsr?.setRenderFinished()
safeClose()
cleanup()
} catch (error) {
if (cleanedUp) return
console.error('Error reading appStream:', error)
router.serverSsr?.setRenderFinished()
safeError(error)
cleanup()
} finally {
reader.releaseLock()
}
})().catch((error) => {
if (cleanedUp) return
console.error('Error in stream transform:', error)
safeError(error)
cleanup()
})
return stream
}
let stopListeningToInjectedHtml: (() => void) | undefined
let stopListeningToSerializationFinished: (() => void) | undefined
let serializationTimeoutHandle: ReturnType<typeof setTimeout> | undefined
let lifetimeTimeoutHandle: ReturnType<typeof setTimeout> | undefined
let cleanedUp = false
let controller: ReadableStreamDefaultController<any>
let isStreamClosed = false
const textDecoder = new TextDecoder()
// concat'd router HTML; avoids array joins on each flush
let pendingRouterHtml = initialBufferedHtml ?? ''
// between-chunk text buffer; keep bounded to avoid unbounded memory
let leftover = ''
// captured closing tags from </body> onward
let pendingClosingTags = ''
// conservative cap: enough to hold any partial closing tag + a bit
const MAX_LEFTOVER_CHARS = 2048
let isAppRendering = true
let streamBarrierLifted = false
let serializationFinished = serializationAlreadyFinished
function safeEnqueue(chunk: string | Uint8Array) {
if (isStreamClosed) return
if (typeof chunk === 'string') {
controller.enqueue(textEncoder.encode(chunk))
} else {
controller.enqueue(chunk)
}
}
function safeClose() {
if (isStreamClosed) return
isStreamClosed = true
try {
controller.close()
} catch {
// ignore
}
}
function safeError(error: unknown) {
if (isStreamClosed) return
isStreamClosed = true
try {
controller.error(error)
} catch {
// ignore
}
}
/**
* Cleanup with guards; must be idempotent.
*/
function cleanup() {
if (cleanedUp) return
cleanedUp = true
try {
stopListeningToInjectedHtml?.()
stopListeningToSerializationFinished?.()
} catch {
// ignore
}
stopListeningToInjectedHtml = undefined
stopListeningToSerializationFinished = undefined
if (serializationTimeoutHandle !== undefined) {
clearTimeout(serializationTimeoutHandle)
serializationTimeoutHandle = undefined
}
if (lifetimeTimeoutHandle !== undefined) {
clearTimeout(lifetimeTimeoutHandle)
lifetimeTimeoutHandle = undefined
}
pendingRouterHtml = ''
leftover = ''
pendingClosingTags = ''
router.serverSsr?.cleanup()
}
const stream = new ReadableStream({
start(c: ReadableStreamDefaultController<any>) {
controller = c
},
cancel() {
isStreamClosed = true
cleanup()
},
})
function flushPendingRouterHtml() {
if (!pendingRouterHtml) return
safeEnqueue(pendingRouterHtml)
pendingRouterHtml = ''
}
function appendRouterHtml(html: string) {
if (!html) return
pendingRouterHtml += html
}
/**
* Finish only when app done and serialization complete.
*/
function tryFinish() {
if (isAppRendering || !serializationFinished) return
if (cleanedUp || isStreamClosed) return
if (serializationTimeoutHandle !== undefined) {
clearTimeout(serializationTimeoutHandle)
serializationTimeoutHandle = undefined
}
// Flush any remaining bytes in the TextDecoder
const decoderRemainder = textDecoder.decode()
if (leftover) safeEnqueue(leftover)
if (decoderRemainder) safeEnqueue(decoderRemainder)
flushPendingRouterHtml()
if (pendingClosingTags) safeEnqueue(pendingClosingTags)
safeClose()
cleanup()
}
// Safety net: cleanup even if consumer never reads
const lifetimeMs = opts?.lifetimeMs ?? DEFAULT_LIFETIME_TIMEOUT_MS
lifetimeTimeoutHandle = setTimeout(() => {
if (!cleanedUp && !isStreamClosed) {
console.warn(
`SSR stream transform exceeded maximum lifetime (${lifetimeMs}ms), forcing cleanup`,
)
safeError(new Error('Stream lifetime exceeded'))
cleanup()
}
}, lifetimeMs)
if (!serializationAlreadyFinished) {
stopListeningToInjectedHtml = router.subscribe('onInjectedHtml', () => {
if (cleanedUp || isStreamClosed) return
const html = router.serverSsr?.takeBufferedHtml()
if (!html) return
// If we've already captured </body> (pendingClosingTags), we must keep appending
// so injection stays before the stored closing tags.
if (isAppRendering || leftover || pendingClosingTags) {
appendRouterHtml(html)
} else {
// App is done rendering - flush any pending buffer first to maintain order,
// then write the new HTML directly
flushPendingRouterHtml()
safeEnqueue(html)
}
})
stopListeningToSerializationFinished = router.subscribe(
'onSerializationFinished',
() => {
serializationFinished = true
tryFinish()
},
)
}
// Transform the appStream
;(async () => {
const reader = appStream.getReader()
try {
while (true) {
const { done, value } = await reader.read()
if (done) break
if (cleanedUp || isStreamClosed) return
const text =
value instanceof Uint8Array
? textDecoder.decode(value, { stream: true })
: String(value)
// Fast path: most chunks have no pending left-over.
const chunkString = leftover ? leftover + text : text
if (!streamBarrierLifted) {
if (chunkString.includes(TSR_SCRIPT_BARRIER_ID)) {
streamBarrierLifted = true
router.serverSsr?.liftScriptBarrier()
}
}
// If we already saw </body>, everything else is part of tail; buffer it.
if (pendingClosingTags) {
pendingClosingTags += chunkString
leftover = ''
continue
}
const bodyEndIndex = chunkString.indexOf(BODY_END_TAG)
const htmlEndIndex = chunkString.indexOf(HTML_END_TAG)
if (
bodyEndIndex !== -1 &&
htmlEndIndex !== -1 &&
bodyEndIndex < htmlEndIndex
) {
pendingClosingTags = chunkString.slice(bodyEndIndex)
safeEnqueue(chunkString.slice(0, bodyEndIndex))
flushPendingRouterHtml()
leftover = ''
continue
}
const lastClosingTagEnd = findLastClosingTagEnd(chunkString)
if (lastClosingTagEnd > 0) {
safeEnqueue(chunkString.slice(0, lastClosingTagEnd))
flushPendingRouterHtml()
leftover = chunkString.slice(lastClosingTagEnd)
if (leftover.length > MAX_LEFTOVER_CHARS) {
// Ensure bounded memory even if a consumer streams long text sequences
// without any closing tags. This may reduce injection granularity but is correct.
safeEnqueue(leftover.slice(0, leftover.length - MAX_LEFTOVER_CHARS))
leftover = leftover.slice(-MAX_LEFTOVER_CHARS)
}
} else {
// No closing tag found; keep small tail to handle split closing tags,
// but stream older bytes to prevent unbounded buffering.
const combined = chunkString
if (combined.length > MAX_LEFTOVER_CHARS) {
const flushUpto = combined.length - MAX_LEFTOVER_CHARS
safeEnqueue(combined.slice(0, flushUpto))
leftover = combined.slice(flushUpto)
} else {
leftover = combined
}
}
}
if (cleanedUp || isStreamClosed) return
isAppRendering = false
router.serverSsr?.setRenderFinished()
if (serializationFinished) {
tryFinish()
} else {
const timeoutMs = opts?.timeoutMs ?? DEFAULT_SERIALIZATION_TIMEOUT_MS
serializationTimeoutHandle = setTimeout(() => {
if (!cleanedUp && !isStreamClosed) {
console.error('Serialization timeout after app render finished')
safeError(
new Error('Serialization timeout after app render finished'),
)
cleanup()
}
}, timeoutMs)
}
} catch (error) {
if (cleanedUp) return
console.error('Error reading appStream:', error)
isAppRendering = false
router.serverSsr?.setRenderFinished()
safeError(error)
cleanup()
} finally {
reader.releaseLock()
}
})().catch((error) => {
if (cleanedUp) return
console.error('Error in stream transform:', error)
safeError(error)
cleanup()
})
return stream
}
@@ -0,0 +1 @@
{"version":3,"file":"ear-off.js","sources":["../../../src/icons/ear-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name EarOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAxOC41YTMuNSAzLjUgMCAxIDAgNyAwYzAtMS41Ny45Mi0yLjUyIDIuMDQtMy40NiIgLz4KICA8cGF0aCBkPSJNNiA4LjVjMC0uNzUuMTMtMS40Ny4zNi0yLjE0IiAvPgogIDxwYXRoIGQ9Ik04LjggMy4xNUE2LjUgNi41IDAgMCAxIDE5IDguNWMwIDEuNjMtLjQ0IDIuODEtMS4wOSAzLjc2IiAvPgogIDxwYXRoIGQ9Ik0xMi41IDZBMi41IDIuNSAwIDAgMSAxNSA4LjVNMTAgMTNhMiAyIDAgMCAwIDEuODItMS4xOCIgLz4KICA8bGluZSB4MT0iMiIgeDI9IjIyIiB5MT0iMiIgeTI9IjIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/ear-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst EarOff = createLucideIcon('EarOff', [\n ['path', { d: 'M6 18.5a3.5 3.5 0 1 0 7 0c0-1.57.92-2.52 2.04-3.46', key: '1qngmn' }],\n ['path', { d: 'M6 8.5c0-.75.13-1.47.36-2.14', key: 'b06bma' }],\n ['path', { d: 'M8.8 3.15A6.5 6.5 0 0 1 19 8.5c0 1.63-.44 2.81-1.09 3.76', key: 'g10hsz' }],\n ['path', { d: 'M12.5 6A2.5 2.5 0 0 1 15 8.5M10 13a2 2 0 0 0 1.82-1.18', key: 'ygzou7' }],\n ['line', { x1: '2', x2: '22', y1: '2', y2: '22', key: 'a6p6uj' }],\n]);\n\nexport default EarOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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