docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped

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,951 @@
export default `flf2a$ 9 7 13 15 30
NTGreek by Bruce Jakeway--based on Standard by Glenn Chappell & Ian Chai
Questions and comments regarding ntgreek.flf to pbjakeway@neumann.uwaterloo.ca
For figlet release 2.0
Date: 1994 Apr 2
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
9 - height of a character
7 - height of a character, not including descenders
13 - max line length (excluding comment lines) + a fudge factor
15 - default smushmode for this font (like "-m 15" on command line)
30 - number of comment lines
Greek keyboard maps:
All keys map to those in standard except:
alpha = A,a lambda = L,l phi = F,f rough breathing = (
beta = B,b mu = M,m chi = C,c smooth breathing = )
gamma = G,g nu = N,n psi = Y,y acute accent = '
delta = D,d xi = X,x omega = w,w grave accent = \`
epsilon = E,e omicron = O,o script theta = J diaresis = ^
zeta = Z,z pi = P,p script phi = j
eta = H,h rho = R,r final sigma = V
theta = Q,q sigma = S,s omega bar = v
iota = I,i tau = T,t raised period = :
kappa = K,k upsilon = U,u iota subscript = _
$@
$@
$@
$@
$@
$@
$@
$@
$@@
@
_ @
| |@
| |@
|_|@
_ @
(_)@
@
@@
@
_ _ @
( )( )@
V V @
@
@
$ @
@
@@
@
_ _ @
_| |_| |_ @
(_ _ _)@
_| |_| |_ @
(_ _ _)@
|_| |_| @
@
@@
_ @
_| |_ @
/ _) @
( (| |_ @
\\_ \\ @
_| |) )@
(_ _/ @
|_| @
@@
@
_ __@
(_) / /@
/ / @
/ / @
/ / _ @
/_/ (_)@
@
@@
@
___ @
/ \\ @
\\ O / @
/ _ \\/\\@
( (_> <@
\\___/\\/@
@
@@
@
@
//@
// @
@
@
@
@
@@
@
@
@
((@
@
@
@
@
@@
@
@
@
))@
@
@
@
@
@@
@
@
__/\\__@
\\ /@
/_ _\\@
\\/ @
@
@
@@
@
@
_ @
_| |_ @
(_ _)@
|_| @
@
@
@@
@
@
$ @
@
@
_ @
( )@
|/ @
@@
@
@
@
_____ @
(_____)@
@
$ @
@
@@
@
@
$ @
@
@
_ @
(_)@
@
@@
@
__@
/ /@
/ / @
/ / @
/ / @
/_/ @
@
@@
@
___ @
/ _ \\ @
| | | |@
| | | |@
| |_| |@
\\___/ @
@
@@
@
_ @
/ |@
- |@
| |@
| |@
|_|@
@
@@
@
____ @
(___ \\ @
__) )@
/ __/ @
| |___ @
|_____)@
@
@@
@
_____ @
(__ / @
/ / @
(__ \\ @
___) )@
(____/ @
@
@@
@
_ @
/ | @
/ o |_ @
/__ _)@
| | @
|_| @
@
@@
@
____ @
| __) @
| |__ @
|___ \\ @
___) )@
(____/ @
@
@@
@
__ @
/ / @
/ /_ @
| '_ \\ @
| (_) )@
\\___/ @
@
@@
@
_____ @
(___ )@
_/ / @
( _) @
/ / @
/_/ @
@
@@
@
___ @
/ \\ @
\\ O / @
/ _ \\ @
( (_) )@
\\___/ @
@
@@
@
___ @
/ _ \\ @
( (_) |@
\\__, |@
/ / @
/_/ @
@
@@
@
@
$ @
_ @
(_)@
@
$ @
@
@@
@
@
@
_ @
(_)@
_ @
( )@
|/ @
@@
@
__@
/ /@
/ / @
< < @
\\ \\ @
\\_\\@
@
@@
@
@
_____ @
(_____)@
_____ @
(_____)@
@
@
@@
@
__ @
\\ \\ @
\\ \\ @
> >@
/ / @
/_/ @
@
@@
@
___ @
(__ \\@
/ /@
|_| @
_ @
(_) @
@
@@
@
_____ @
/ ___ \\ @
/ / | |@
( ( () | |@
\\ \\____/_@
\\______/@
@
@@
@
___ @
/ _ \\ @
| |_| |@
| _ |@
| | | |@
|_| |_|@
@
@@
@
____ @
| _ \\ @
| |_) )@
| _ ( @
| |_) )@
|____/ @
@
@@
@
__ __@
\\ \\ / /@
\\ v / @
> < @
/ ^ \\ @
/_/ \\_\\@
@
@@
@
@
/\\ @
/ \\ @
/ /\\ \\ @
/ /__\\ \\ @
/________\\@
@
@@
@
_____ @
| ___)@
| |_ @
| _) @
| |___ @
|_____)@
@
@@
@
_ @
_| |_ @
/ \\ @
( (| |) )@
\\_ _/ @
|_| @
@
@@
@
_____ @
| ___)@
| |$ @
| |$ @
| | @
|_| @
@
@@
@
_ _ @
| | | |@
| |_| |@
| _ |@
| | | |@
|_| |_|@
@
@@
@
___ @
( )@
| | @
| | @
| | @
(___)@
@
@@
@
___ @
/ _ \\ @
( (_| |_ @
_ \\ _ _)@
| |___| | @
\\_____/ @
@
@@
@
_ __@
| | / /@
| |/ / @
| < @
| |\\ \\ @
|_| \\_\\@
@
@@
@
@
/\\ @
/ \\ @
/ /\\ \\ @
/ / \\ \\ @
/_/ \\_\\@
@
@@
@
__ __ @
| \\ / |@
| v |@
| |\\_/| |@
| | | |@
|_| |_|@
@
@@
@
_ _ @
| \\ | |@
| \\| |@
| |@
| |\\ |@
|_| \\_|@
@
@@
@
___ @
/ _ \\ @
| | | |@
| | | |@
| |_| |@
\\___/ @
@
@@
@
_______ @
( _ )@
| | | | @
| | | | @
| | | | @
|_| |_| @
@
@@
@
____ @
/ __ \\ @
| |__| |@
| __ |@
| |__| |@
\\____/ @
@
@@
@
____ @
| _ \\ @
| |_) )@
| __/ @
| | @
|_| @
@
@@
@
______ @
\\ ___)@
\\ \\ @
> > @
/ /__ @
/_____)@
@
@@
@
_____ @
(_ _)@
| | @
| | @
| | @
|_| @
@
@@
@
__ __ @
(_ \\ / _)@
\\ v / @
| | @
| | @
|_| @
@
@@
@
@
@
____ @
/ ___)@
( (__ @
\\__ \\ @
_) )@
(__/ @@
@
____ @
/ __ \\ @
| | | | @
| | | | @
_\\ \\/ /_ @
(___||___)@
@
@@
@
_____ @
(_____)@
___ @
(___) @
_____ @
(_____)@
@
@@
@
_ _ _ @
| || || |@
| \\| |/ |@
\\_ _/ @
| | @
|_| @
@
@@
@
______@
(___ /@
/ / @
/ / @
/ /__ @
/_____)@
@
@@
___ @
| _)@
| | @
| | @
| | @
| | @
| |_ @
|___)@
@@
@
__ @
\\ \\ @
\\ \\ @
\\ \\ @
\\ \\ @
\\_\\@
@
@@
___ @
(_ |@
| |@
| |@
| |@
| |@
_| |@
(___|@
@@
@
_ _ @
(_) (_)@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
||@@
@
@
\\\\ @
\\\\@
@
@
@
@
@@
@
@
@
__ __@
/ \\/ /@
( () < @
\\__/\\_\\@
@
@@
@
___ @
/ _ \\ @
| |_) )@
| _ < @
| |_) )@
| __/ @
| | @
|_| @@
@
@
@
__ __@
\\ \\ / /@
\\ v / @
> < @
/ ^ \\ @
/_/ \\_\\@@
@
__ @
/ _) @
\\ \\ @
/ _ \\ @
( (_) )@
\\___/ @
@
@@
@
@
@
___ @
/ __)@
> _) @
\\___)@
@
@@
@
_ @
| | @
_| |_ @
/ \\ @
( (| |) )@
\\_ _/ @
| | @
|_| @@
@
@
@
_ _ @
( \\ / )@
\\ v / @
| | @
| | @
|_| @@
@
@
@
_ __ @
| '_ \\ @
| | | |@
|_| | |@
| |@
|_|@@
@
@
@
_ @
| | @
| | @
\\_)@
@
@@
@
@
@
_ __ @
| | / \\ @
| || || )@
\\_ _/ @
| | @
|_| @@
@
@
@
_ __@
| |/ /@
| < @
|_|\\_\\@
@
@@
@
__ @
\\ \\ @
\\ \\ @
> \\ @
/ ^ \\ @
/_/ \\_\\@
@
@@
@
@
@
_ _ @
| | | |@
| |_| |@
| ._,_|@
| | @
|_| @@
@
@
@
_ __@
| |/ /@
| / / @
|__/ @
@
@@
@
@
@
___ @
/ _ \\ @
( (_) )@
\\___/ @
@
@@
@
@
@
______ @
( __ )@
| || | @
|_||_| @
@
@@
@
___ @
/ _ \\ @
| |_| |@
| _ |@
| |_| |@
\\___/ @
@
@@
@
@
@
___ @
/ _ \\ @
| |_) )@
| __/ @
| | @
|_| @@
@
@
@
____ @
/ ._)@
( () ) @
\\__/ @
@
@@
@
@
@
___ @
( )@
| | @
\\_)@
@
@@
@
@
@
_ _ @
| | | |@
| |_| |@
\\___/ @
@
@@
@
@
@
_________ @
( _____ )@
| |_/ \\_| |@
\\___^___/ @
@
@@
@
@
@
__ __ @
/ / _ \\ \\ @
| |_/ \\_| |@
\\___^___/ @
@
@@
__ @
\\ \\__ @
> __) @
( (_ @
> _) @
( (__ @
\\__ \\ @
) )@
(_/ @@
@
@
@
_ _ _ @
| || || |@
| \\| |/ |@
\\_ _/ @
| | @
|_| @@
@
_____ @
\\__ ) @
/ / @
/ / @
| |__ @
\\__ \\ @
) )@
(_/ @@
__@
/ /@
| | @
| | @
< < @
| | @
| | @
\\_\\@
@@
_ @
| |@
| |@
| |@
| |@
| |@
| |@
|_|@
@@
__ @
\\ \\ @
| | @
| | @
> >@
| | @
| | @
/_/ @
@@
@
/\\/|@
|/\\/ @
@
@
@
@
@
@@
_ _ @
(_)_(_)@
/ _ \\ @
| |_| |@
| _ |@
| | | |@
|_| |_|@
@
@@
_ _ @
(_)_(_)@
/ _ \\ @
| | | |@
| | | |@
| |_| |@
\\___/ @
@
@@
_ _ @
(_) (_)@
| | | |@
| | | |@
| | | |@
| |_| |@
\\___/ @
@
@@
@
@
_ _ @
(_)_(_)@
/ _\` |@
( (_| |@
\\__,_|@
@
@@
@
@
_ _ @
(_)_(_)@
/ _ \\ @
( (_) )@
\\___/ @
@
@@
@
@
_ _ @
(_) (_)@
| | | |@
| |_| |@
\\__,_|@
@
@@
@
___ @
/ _ \\ @
| | ) )@
| |< < @
| | ) )@
| ||_/ @
|_| @
@@
`
@@ -0,0 +1,20 @@
import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';
const isBrowser = typeof window !== "undefined";
function initPrefersReducedMotion() {
hasReducedMotionListener.current = true;
if (!isBrowser)
return;
if (window.matchMedia) {
const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)");
const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);
motionMediaQuery.addEventListener("change", setReducedMotionPreferences);
setReducedMotionPreferences();
}
else {
prefersReducedMotion.current = false;
}
}
export { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion };
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ref_1 = require("./ref");
const type_1 = require("./type");
const enum_1 = require("./enum");
const elements_1 = require("./elements");
const properties_1 = require("./properties");
const optionalProperties_1 = require("./optionalProperties");
const discriminator_1 = require("./discriminator");
const values_1 = require("./values");
const union_1 = require("./union");
const metadata_1 = require("./metadata");
const jtdVocabulary = [
"definitions",
ref_1.default,
type_1.default,
enum_1.default,
elements_1.default,
properties_1.default,
optionalProperties_1.default,
discriminator_1.default,
values_1.default,
union_1.default,
metadata_1.default,
{ keyword: "additionalProperties", schemaType: "boolean" },
{ keyword: "nullable", schemaType: "boolean" },
];
exports.default = jtdVocabulary;
//# sourceMappingURL=index.js.map
@@ -0,0 +1,228 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const util_1 = require("../util");
const getForStatementHeadLoc_1 = require("../util/getForStatementHeadLoc");
const isPromiseAggregatorMethod_1 = require("../util/isPromiseAggregatorMethod");
exports.default = (0, util_1.createRule)({
name: 'await-thenable',
meta: {
type: 'problem',
docs: {
description: 'Disallow awaiting a value that is not a Thenable',
recommended: 'recommended',
requiresTypeChecking: true,
},
hasSuggestions: true,
messages: {
await: 'Unexpected `await` of a non-Promise (non-"Thenable") value.',
awaitUsingOfNonAsyncDisposable: 'Unexpected `await using` of a value that is not async disposable.',
convertToOrdinaryFor: 'Convert to an ordinary `for...of` loop.',
forAwaitOfNonAsyncIterable: 'Unexpected `for await...of` of a value that is not async iterable.',
invalidPromiseAggregatorInput: 'Unexpected iterable of non-Promise (non-"Thenable") values passed to promise aggregator.',
removeAwait: 'Remove unnecessary `await`.',
},
schema: [],
},
defaultOptions: [],
create(context) {
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
return {
AwaitExpression(node) {
const awaitArgumentEsNode = node.argument;
const awaitArgumentType = services.getTypeAtLocation(awaitArgumentEsNode);
const awaitArgumentTsNode = services.esTreeNodeToTSNodeMap.get(awaitArgumentEsNode);
const certainty = (0, util_1.needsToBeAwaited)(checker, awaitArgumentTsNode, awaitArgumentType);
if (certainty === util_1.Awaitable.Never) {
context.report({
node,
messageId: 'await',
suggest: [
{
messageId: 'removeAwait',
fix(fixer) {
const awaitKeyword = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isAwaitKeyword), util_1.NullThrowsReasons.MissingToken('await', 'await expression'));
return fixer.remove(awaitKeyword);
},
},
],
});
}
},
CallExpression(node) {
if (!(0, isPromiseAggregatorMethod_1.isPromiseAggregatorMethod)(context, services, node)) {
return;
}
const argument = node.arguments.at(0);
if (argument == null) {
return;
}
if (argument.type === utils_1.TSESTree.AST_NODE_TYPES.ArrayExpression) {
for (const element of argument.elements) {
if (element == null) {
continue;
}
const type = (0, util_1.getConstrainedTypeAtLocation)(services, element);
const tsNode = services.esTreeNodeToTSNodeMap.get(element);
if (isAlwaysNonAwaitableType(type, tsNode, checker)) {
context.report({
node: element,
messageId: 'invalidPromiseAggregatorInput',
});
}
}
return;
}
const type = (0, util_1.getConstrainedTypeAtLocation)(services, argument);
if (isInvalidPromiseAggregatorInput(checker, services.esTreeNodeToTSNodeMap.get(argument), type)) {
context.report({
node: argument,
messageId: 'invalidPromiseAggregatorInput',
});
}
},
'ForOfStatement[await=true]'(node) {
const type = services.getTypeAtLocation(node.right);
if ((0, util_1.isTypeAnyType)(type)) {
return;
}
const hasAsyncIteratorSymbol = tsutils
.unionConstituents(type)
.some(typePart => tsutils.getWellKnownSymbolPropertyOfType(typePart, 'asyncIterator', checker) != null);
if (!hasAsyncIteratorSymbol) {
context.report({
loc: (0, getForStatementHeadLoc_1.getForStatementHeadLoc)(context.sourceCode, node),
messageId: 'forAwaitOfNonAsyncIterable',
suggest: [
// Note that this suggestion causes broken code for sync iterables
// of promises, since the loop variable is not awaited.
{
messageId: 'convertToOrdinaryFor',
fix(fixer) {
const awaitToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isAwaitKeyword), util_1.NullThrowsReasons.MissingToken('await', 'for await loop'));
return fixer.remove(awaitToken);
},
},
],
});
}
},
'VariableDeclaration[kind="await using"]'(node) {
for (const declarator of node.declarations) {
const init = declarator.init;
if (init == null) {
continue;
}
const type = services.getTypeAtLocation(init);
if ((0, util_1.isTypeAnyType)(type)) {
continue;
}
const hasAsyncDisposeSymbol = tsutils
.unionConstituents(type)
.some(typePart => tsutils.getWellKnownSymbolPropertyOfType(typePart, 'asyncDispose', checker) != null);
if (!hasAsyncDisposeSymbol) {
context.report({
node: init,
messageId: 'awaitUsingOfNonAsyncDisposable',
// let the user figure out what to do if there's
// await using a = b, c = d, e = f;
// it's rare and not worth the complexity to handle.
...(0, util_1.getFixOrSuggest)({
fixOrSuggest: node.declarations.length === 1 ? 'suggest' : 'none',
suggestion: {
messageId: 'removeAwait',
fix(fixer) {
const awaitToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node, util_1.isAwaitKeyword), util_1.NullThrowsReasons.MissingToken('await', 'await using'));
return fixer.remove(awaitToken);
},
},
}),
});
}
}
},
};
},
});
function isInvalidPromiseAggregatorInput(checker, node, type) {
// non array/tuple/iterable types already show up as a type error
if (!isIterable(type, checker)) {
return false;
}
for (const part of tsutils.unionConstituents(type)) {
const valueTypes = getValueTypesOfArrayLike(part, checker);
if (valueTypes != null) {
for (const typeArgument of valueTypes) {
if (containsNonAwaitableType(typeArgument, node, checker)) {
return true;
}
}
}
}
return false;
}
function getValueTypesOfArrayLike(type, checker) {
if (checker.isTupleType(type)) {
return checker.getTypeArguments(type);
}
if (checker.isArrayLikeType(type)) {
return [
(0, util_1.nullThrows)(type.getNumberIndexType(), 'number index type should exist on an array-like'),
];
}
// `Iterable<...>`
if (tsutils.isTypeReference(type)) {
return checker.getTypeArguments(type).slice(0, 1);
}
return null;
}
function isAlwaysNonAwaitableType(type, node, checker) {
return tsutils
.unionConstituents(type)
.every(typeArgumentPart => (0, util_1.needsToBeAwaited)(checker, node, typeArgumentPart) === util_1.Awaitable.Never);
}
function containsNonAwaitableType(type, node, checker) {
return tsutils
.unionConstituents(type)
.some(typeArgumentPart => (0, util_1.needsToBeAwaited)(checker, node, typeArgumentPart) === util_1.Awaitable.Never);
}
function isIterable(type, checker) {
return tsutils
.unionConstituents(type)
.every(part => !!tsutils.getWellKnownSymbolPropertyOfType(part, 'iterator', checker));
}
@@ -0,0 +1,3 @@
# `react-select`
View docs [here](https://radix-ui.com/primitives/docs/components/select).
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/collection-legacy.tsx", "../src/collection.tsx", "../src/ordered-dictionary.ts"],
"sourcesContent": ["import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createSlot, type Slot } from '@radix-ui/react-slot';\n\ntype SlotProps = React.ComponentPropsWithoutRef<typeof Slot>;\ntype CollectionElement = HTMLElement;\ninterface CollectionProps extends SlotProps {\n scope: any;\n}\n\n// We have resorted to returning slots directly rather than exposing primitives that can then\n// be slotted like `<CollectionItem as={Slot}>\u2026</CollectionItem>`.\n// This is because we encountered issues with generic types that cannot be statically analysed\n// due to creating them dynamically via createCollection.\n\nfunction createCollection<ItemElement extends HTMLElement, ItemData = {}>(name: string) {\n /* -----------------------------------------------------------------------------------------------\n * CollectionProvider\n * ---------------------------------------------------------------------------------------------*/\n\n const PROVIDER_NAME = name + 'CollectionProvider';\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n\n type ContextValue = {\n collectionRef: React.RefObject<CollectionElement | null>;\n itemMap: Map<\n React.RefObject<ItemElement | null>,\n { ref: React.RefObject<ItemElement | null> } & ItemData\n >;\n };\n\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext<ContextValue>(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: new Map() },\n );\n\n const CollectionProvider: React.FC<{ children?: React.ReactNode; scope: any }> = (props) => {\n const { scope, children } = props;\n const ref = React.useRef<CollectionElement>(null);\n const itemMap = React.useRef<ContextValue['itemMap']>(new Map()).current;\n return (\n <CollectionProviderImpl scope={scope} itemMap={itemMap} collectionRef={ref}>\n {children}\n </CollectionProviderImpl>\n );\n };\n\n CollectionProvider.displayName = PROVIDER_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionSlot\n * ---------------------------------------------------------------------------------------------*/\n\n const COLLECTION_SLOT_NAME = name + 'CollectionSlot';\n\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef<CollectionElement, CollectionProps>(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return <CollectionSlotImpl ref={composedRefs}>{children}</CollectionSlotImpl>;\n },\n );\n\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionItem\n * ---------------------------------------------------------------------------------------------*/\n\n const ITEM_SLOT_NAME = name + 'CollectionItemSlot';\n const ITEM_DATA_ATTR = 'data-radix-collection-item';\n\n type CollectionItemSlotProps = ItemData & {\n children: React.ReactNode;\n scope: any;\n };\n\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef<ItemElement, CollectionItemSlotProps>(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef<ItemElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...(itemData as unknown as ItemData) });\n return () => void context.itemMap.delete(ref);\n });\n\n return (\n <CollectionItemSlotImpl {...{ [ITEM_DATA_ATTR]: '' }} ref={composedRefs}>\n {children}\n </CollectionItemSlotImpl>\n );\n },\n );\n\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * useCollection\n * ---------------------------------------------------------------------------------------------*/\n\n function useCollection(scope: any) {\n const context = useCollectionContext(name + 'CollectionConsumer', scope);\n\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current!) - orderedNodes.indexOf(b.refLine truncated
"mappings": "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 truncated
"names": ["React", "createContextScope", "useComposedRefs", "createSlot", "jsx", "createCollection", "createContextScope", "useComposedRefs", "createSlot", "itemData"]
}
@@ -0,0 +1,37 @@
import type {Vocabulary} from "../../types"
import refKeyword from "./ref"
import typeKeyword, {JTDTypeError} from "./type"
import enumKeyword, {JTDEnumError} from "./enum"
import elements, {JTDElementsError} from "./elements"
import properties, {JTDPropertiesError} from "./properties"
import optionalProperties from "./optionalProperties"
import discriminator, {JTDDiscriminatorError} from "./discriminator"
import values, {JTDValuesError} from "./values"
import union from "./union"
import metadata from "./metadata"
const jtdVocabulary: Vocabulary = [
"definitions",
refKeyword,
typeKeyword,
enumKeyword,
elements,
properties,
optionalProperties,
discriminator,
values,
union,
metadata,
{keyword: "additionalProperties", schemaType: "boolean"},
{keyword: "nullable", schemaType: "boolean"},
]
export default jtdVocabulary
export type JTDErrorObject =
| JTDTypeError
| JTDEnumError
| JTDElementsError
| JTDPropertiesError
| JTDDiscriminatorError
| JTDValuesError
@@ -0,0 +1,88 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _genMapping = require("@jridgewell/gen-mapping");
var _traceMapping = require("@jridgewell/trace-mapping");
class SourceMap {
constructor(opts, code) {
var _opts$sourceFileName;
this._map = void 0;
this._rawMappings = void 0;
this._sourceFileName = void 0;
this._lastGenLine = 0;
this._lastSourceLine = 0;
this._lastSourceColumn = 0;
this._inputMap = null;
const map = this._map = new _genMapping.GenMapping({
sourceRoot: opts.sourceRoot
});
this._sourceFileName = (_opts$sourceFileName = opts.sourceFileName) == null ? void 0 : _opts$sourceFileName.replace(/\\/g, "/");
this._rawMappings = undefined;
if (opts.inputSourceMap) {
this._inputMap = new _traceMapping.TraceMap(opts.inputSourceMap);
const resolvedSources = this._inputMap.resolvedSources;
if (resolvedSources.length) {
for (let i = 0; i < resolvedSources.length; i++) {
var _this$_inputMap$sourc;
(0, _genMapping.setSourceContent)(map, resolvedSources[i], (_this$_inputMap$sourc = this._inputMap.sourcesContent) == null ? void 0 : _this$_inputMap$sourc[i]);
}
}
}
if (typeof code === "string" && !opts.inputSourceMap) {
(0, _genMapping.setSourceContent)(map, this._sourceFileName, code);
} else if (typeof code === "object") {
for (const sourceFileName of Object.keys(code)) {
(0, _genMapping.setSourceContent)(map, sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
}
}
}
get() {
return (0, _genMapping.toEncodedMap)(this._map);
}
getDecoded() {
return (0, _genMapping.toDecodedMap)(this._map);
}
getRawMappings() {
return this._rawMappings || (this._rawMappings = (0, _genMapping.allMappings)(this._map));
}
mark(generated, line, column, identifierName, identifierNamePos, filename) {
var _originalMapping;
this._rawMappings = undefined;
let originalMapping;
if (line != null) {
if (this._inputMap) {
originalMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, {
line,
column: column
});
if (originalMapping.name && (identifierNamePos || identifierName != null && originalMapping.column === column)) {
identifierName = originalMapping.name;
} else if (identifierNamePos) {
const originalIdentifierMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, identifierNamePos);
if (originalIdentifierMapping.name) {
identifierName = originalIdentifierMapping.name;
}
}
} else {
originalMapping = {
name: null,
source: (filename == null ? void 0 : filename.replace(/\\/g, "/")) || this._sourceFileName,
line: line,
column: column
};
}
}
(0, _genMapping.maybeAddMapping)(this._map, {
name: identifierName,
generated,
source: (_originalMapping = originalMapping) == null ? void 0 : _originalMapping.source,
original: originalMapping
});
}
}
exports.default = SourceMap;
//# sourceMappingURL=source-map.js.map
@@ -0,0 +1,22 @@
import type * as TSESLint from '../ts-eslint';
import type { ParserServices, ParserServicesWithTypeInformation } from '../ts-estree';
/**
* Try to retrieve type-aware parser service from context.
* This **_will_** throw if it is not available.
*/
export declare function getParserServices<MessageIds extends string, Options extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<MessageIds, Options>>): ParserServicesWithTypeInformation;
/**
* Try to retrieve type-aware parser service from context.
* This **_will_** throw if it is not available.
*/
export declare function getParserServices<MessageIds extends string, Options extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<MessageIds, Options>>, allowWithoutFullTypeInformation: false): ParserServicesWithTypeInformation;
/**
* Try to retrieve type-aware parser service from context.
* This **_will not_** throw if it is not available.
*/
export declare function getParserServices<MessageIds extends string, Options extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<MessageIds, Options>>, allowWithoutFullTypeInformation: true): ParserServices;
/**
* Try to retrieve type-aware parser service from context.
* This may or may not throw if it is not available, depending on if `allowWithoutFullTypeInformation` is `true`
*/
export declare function getParserServices<MessageIds extends string, Options extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<MessageIds, Options>>, allowWithoutFullTypeInformation: boolean): ParserServices;
@@ -0,0 +1,10 @@
"use client";
import { useConstant } from '../../utils/use-constant.mjs';
import { WillChangeMotionValue } from './WillChangeMotionValue.mjs';
function useWillChange() {
return useConstant(() => new WillChangeMotionValue("auto"));
}
export { useWillChange };
//# sourceMappingURL=index.mjs.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 CalendarMinus2 = createLucideIcon("CalendarMinus2", [
["path", { d: "M8 2v4", key: "1cmpym" }],
["path", { d: "M16 2v4", key: "4m81vk" }],
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
["path", { d: "M3 10h18", key: "8toen8" }],
["path", { d: "M10 16h4", key: "17e571" }]
]);
export { CalendarMinus2 as default };
//# sourceMappingURL=calendar-minus-2.js.map
@@ -0,0 +1,14 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es7 = void 0;
const es2015_1 = require("./es2015");
const es2016_array_include_1 = require("./es2016.array.include");
const es2016_intl_1 = require("./es2016.intl");
exports.es7 = {
libs: [es2015_1.es2015, es2016_array_include_1.es2016_array_include, es2016_intl_1.es2016_intl],
variables: [],
};
@@ -0,0 +1,10 @@
import Options from '../../Options';
import { DictionaryMatch, MatcherBaseClass } from '../../types';
import { DictionaryMatchOptions } from './types';
declare class MatchDictionary extends MatcherBaseClass {
protected wordSequenceCheck?: boolean | undefined;
constructor(options: Options, wordSequenceCheck?: boolean | undefined);
private getRangedDictionaries;
match({ password, userInputsOptions, useLevenshtein, }: DictionaryMatchOptions): DictionaryMatch[];
}
export default MatchDictionary;
@@ -0,0 +1,277 @@
# cors
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Build Status][github-actions-ci-image]][github-actions-ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
CORS is a [Node.js](https://nodejs.org/en/) middleware for [Express](https://expressjs.com/)/[Connect](https://github.com/senchalabs/connect) that sets [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS) response headers. These headers tell browsers which origins can read responses from your server.
> [!IMPORTANT]
> **How CORS Works:** This package sets response headers—it doesn't block requests. CORS is enforced by browsers: they check the headers and decide if JavaScript can read the response. Non-browser clients (curl, Postman, other servers) ignore CORS entirely. See the [MDN CORS guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS) for details.
* [Installation](#installation)
* [Usage](#usage)
* [Simple Usage](#simple-usage-enable-all-cors-requests)
* [Enable CORS for a Single Route](#enable-cors-for-a-single-route)
* [Configuring CORS](#configuring-cors)
* [Configuring CORS w/ Dynamic Origin](#configuring-cors-w-dynamic-origin)
* [Enabling CORS Pre-Flight](#enabling-cors-pre-flight)
* [Customizing CORS Settings Dynamically per Request](#customizing-cors-settings-dynamically-per-request)
* [Configuration Options](#configuration-options)
* [Common Misconceptions](#common-misconceptions)
* [License](#license)
* [Original Author](#original-author)
## Installation
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/downloading-and-installing-packages-locally):
```sh
$ npm install cors
```
## Usage
### Simple Usage (Enable *All* CORS Requests)
```javascript
var express = require('express')
var cors = require('cors')
var app = express()
// Adds headers: Access-Control-Allow-Origin: *
app.use(cors())
app.get('/products/:id', function (req, res, next) {
res.json({msg: 'Hello'})
})
app.listen(80, function () {
console.log('web server listening on port 80')
})
```
### Enable CORS for a Single Route
```javascript
var express = require('express')
var cors = require('cors')
var app = express()
// Adds headers: Access-Control-Allow-Origin: *
app.get('/products/:id', cors(), function (req, res, next) {
res.json({msg: 'Hello'})
})
app.listen(80, function () {
console.log('web server listening on port 80')
})
```
### Configuring CORS
See the [configuration options](#configuration-options) for details.
```javascript
var express = require('express')
var cors = require('cors')
var app = express()
var corsOptions = {
origin: 'http://example.com',
optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204
}
// Adds headers: Access-Control-Allow-Origin: http://example.com, Vary: Origin
app.get('/products/:id', cors(corsOptions), function (req, res, next) {
res.json({msg: 'Hello'})
})
app.listen(80, function () {
console.log('web server listening on port 80')
})
```
### Configuring CORS w/ Dynamic Origin
This module supports validating the origin dynamically using a function provided
to the `origin` option. This function will be passed a string that is the origin
(or `undefined` if the request has no origin), and a `callback` with the signature
`callback(error, origin)`.
The `origin` argument to the callback can be any value allowed for the `origin`
option of the middleware, except a function. See the
[configuration options](#configuration-options) section for more information on all
the possible value types.
This function is designed to allow the dynamic loading of allowed origin(s) from
a backing datasource, like a database.
```javascript
var express = require('express')
var cors = require('cors')
var app = express()
var corsOptions = {
origin: function (origin, callback) {
// db.loadOrigins is an example call to load
// a list of origins from a backing database
db.loadOrigins(function (error, origins) {
callback(error, origins)
})
}
}
// Adds headers: Access-Control-Allow-Origin: <matched origin>, Vary: Origin
app.get('/products/:id', cors(corsOptions), function (req, res, next) {
res.json({msg: 'Hello'})
})
app.listen(80, function () {
console.log('web server listening on port 80')
})
```
### Enabling CORS Pre-Flight
Certain CORS requests are considered 'complex' and require an initial
`OPTIONS` request (called the "pre-flight request"). An example of a
'complex' CORS request is one that uses an HTTP verb other than
GET/HEAD/POST (such as DELETE) or that uses custom headers. To enable
pre-flighting, you must add a new OPTIONS handler for the route you want
to support:
```javascript
var express = require('express')
var cors = require('cors')
var app = express()
app.options('/products/:id', cors()) // preflight for DELETE
app.del('/products/:id', cors(), function (req, res, next) {
res.json({msg: 'Hello'})
})
app.listen(80, function () {
console.log('web server listening on port 80')
})
```
You can also enable pre-flight across-the-board like so:
```javascript
app.options('*', cors()) // include before other routes
```
NOTE: When using this middleware as an application level middleware (for
example, `app.use(cors())`), pre-flight requests are already handled for all
routes.
### Customizing CORS Settings Dynamically per Request
For APIs that require different CORS configurations for specific routes or requests, you can dynamically generate CORS options based on the incoming request. The `cors` middleware allows you to achieve this by passing a function instead of static options. This function is called for each incoming request and must use the callback pattern to return the appropriate CORS options.
The function accepts:
1. **`req`**:
- The incoming request object.
2. **`callback(error, corsOptions)`**:
- A function used to return the computed CORS options.
- **Arguments**:
- **`error`**: Pass `null` if there’s no error, or an error object to indicate a failure.
- **`corsOptions`**: An object specifying the CORS policy for the current request.
Here’s an example that handles both public routes and restricted, credential-sensitive routes:
```javascript
var dynamicCorsOptions = function(req, callback) {
var corsOptions;
if (req.path.startsWith('/auth/connect/')) {
// Access-Control-Allow-Origin: http://mydomain.com, Access-Control-Allow-Credentials: true, Vary: Origin
corsOptions = {
origin: 'http://mydomain.com',
credentials: true
};
} else {
// Access-Control-Allow-Origin: *
corsOptions = { origin: '*' };
}
callback(null, corsOptions);
};
app.use(cors(dynamicCorsOptions));
app.get('/auth/connect/twitter', function (req, res) {
res.send('Hello');
});
app.get('/public', function (req, res) {
res.send('Hello');
});
app.listen(80, function () {
console.log('web server listening on port 80')
})
```
## Configuration Options
* `origin`: Configures the **Access-Control-Allow-Origin** CORS header. Possible values:
- `Boolean` - set `origin` to `true` to reflect the [request origin](https://datatracker.ietf.org/doc/html/draft-abarth-origin-09), as defined by `req.header('Origin')`, or set it to `false` to disable CORS.
- `String` - set `origin` to a specific origin. For example, if you set it to
- `"http://example.com"` only requests from "http://example.com" will be allowed.
- `"*"` for all domains to be allowed.
- `RegExp` - set `origin` to a regular expression pattern which will be used to test the request origin. If it's a match, the request origin will be reflected. For example the pattern `/example\.com$/` will reflect any request that is coming from an origin ending with "example.com".
- `Array` - set `origin` to an array of valid origins. Each origin can be a `String` or a `RegExp`. For example `["http://example1.com", /\.example2\.com$/]` will accept any request from "http://example1.com" or from a subdomain of "example2.com".
- `Function` - set `origin` to a function implementing some custom logic. The function takes the request origin as the first parameter and a callback (called as `callback(err, origin)`, where `origin` is a non-function value of the `origin` option) as the second.
* `methods`: Configures the **Access-Control-Allow-Methods** CORS header. Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: `['GET', 'PUT', 'POST']`).
* `allowedHeaders`: Configures the **Access-Control-Allow-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Type,Authorization') or an array (ex: `['Content-Type', 'Authorization']`). If not specified, defaults to reflecting the headers specified in the request's **Access-Control-Request-Headers** header.
* `exposedHeaders`: Configures the **Access-Control-Expose-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Range,X-Content-Range') or an array (ex: `['Content-Range', 'X-Content-Range']`). If not specified, no custom headers are exposed.
* `credentials`: Configures the **Access-Control-Allow-Credentials** CORS header. Set to `true` to pass the header, otherwise it is omitted.
* `maxAge`: Configures the **Access-Control-Max-Age** CORS header. Set to an integer to pass the header, otherwise it is omitted.
* `preflightContinue`: Pass the CORS preflight response to the next handler.
* `optionsSuccessStatus`: Provides a status code to use for successful `OPTIONS` requests, since some legacy browsers (IE11, various SmartTVs) choke on `204`.
The default configuration is the equivalent of:
```json
{
"origin": "*",
"methods": "GET,HEAD,PUT,PATCH,POST,DELETE",
"preflightContinue": false,
"optionsSuccessStatus": 204
}
```
## Common Misconceptions
### "CORS blocks requests from disallowed origins"
**No.** Your server receives and processes every request. CORS headers tell the browser whether JavaScript can read the response—not whether the request is allowed.
### "CORS protects my API from unauthorized access"
**No.** CORS is not access control. Any HTTP client (curl, Postman, another server) can call your API regardless of CORS settings. Use authentication and authorization to protect your API.
### "Setting `origin: 'http://example.com'` means only that domain can access my server"
**No.** It means browsers will only let JavaScript from that origin read responses. The server still responds to all requests.
## License
[MIT License](http://www.opensource.org/licenses/mit-license.php)
## Original Author
[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com))
[coveralls-image]: https://img.shields.io/coveralls/expressjs/cors/master.svg
[coveralls-url]: https://coveralls.io/r/expressjs/cors?branch=master
[downloads-image]: https://img.shields.io/npm/dm/cors.svg
[downloads-url]: https://npmjs.com/package/cors
[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/expressjs/cors/ci.yml?branch=master&label=ci
[github-actions-ci-url]: https://github.com/expressjs/cors?query=workflow%3Aci
[npm-image]: https://img.shields.io/npm/v/cors.svg
[npm-url]: https://npmjs.com/package/cors
@@ -0,0 +1,33 @@
import { WSContext, defineWebSocketHelper } from "../../helper/websocket/index.js";
//#region src/adapter/cloudflare-workers/websocket.ts
/**
* @deprecated `hono/cloudflare-workers` will be removed in v5. Install `@hono/cloudflare-workers` and import from there instead.
*/
const upgradeWebSocket = defineWebSocketHelper(async (c, events) => {
if (c.req.header("Upgrade") !== "websocket") return;
const webSocketPair = new WebSocketPair();
const client = webSocketPair[0];
const server = webSocketPair[1];
const wsContext = new WSContext({
close: (code, reason) => server.close(code, reason),
get protocol() {
return server.protocol;
},
raw: server,
get readyState() {
return server.readyState;
},
url: server.url ? new URL(server.url) : null,
send: (source) => server.send(source)
});
if (events.onClose) server.addEventListener("close", (evt) => events.onClose?.(evt, wsContext));
if (events.onMessage) server.addEventListener("message", (evt) => events.onMessage?.(evt, wsContext));
if (events.onError) server.addEventListener("error", (evt) => events.onError?.(evt, wsContext));
server.accept?.();
return new Response(null, {
status: 101,
webSocket: client
});
});
//#endregion
export { upgradeWebSocket };
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019-2025 Alain Dumesny. v0.4.0 and older (c) 2014-2018 Pavel Reznikov, Dylan Weiss
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,340 @@
/**
* @license React
* react-dom.react-server.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
function noop() {}
function getCrossOriginStringAs(as, input) {
if ("font" === as) return "";
if ("string" === typeof input)
return "use-credentials" === input ? input : "";
}
function getValueDescriptorExpectingObjectForWarning(thing) {
return null === thing
? "`null`"
: void 0 === thing
? "`undefined`"
: "" === thing
? "an empty string"
: 'something with type "' + typeof thing + '"';
}
function getValueDescriptorExpectingEnumForWarning(thing) {
return null === thing
? "`null`"
: void 0 === thing
? "`undefined`"
: "" === thing
? "an empty string"
: "string" === typeof thing
? JSON.stringify(thing)
: "number" === typeof thing
? "`" + thing + "`"
: 'something with type "' + typeof thing + '"';
}
var React = require("react"),
Internals = {
d: {
f: noop,
r: function () {
throw Error(
"Invalid form element. requestFormReset must be passed a form that was rendered by React."
);
},
D: noop,
C: noop,
L: noop,
m: noop,
X: noop,
S: noop,
M: noop
},
p: 0,
findDOMNode: null
};
if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)
throw Error(
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
);
("function" === typeof Map &&
null != Map.prototype &&
"function" === typeof Map.prototype.forEach &&
"function" === typeof Set &&
null != Set.prototype &&
"function" === typeof Set.prototype.clear &&
"function" === typeof Set.prototype.forEach) ||
console.error(
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
);
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
Internals;
exports.preconnect = function (href, options) {
"string" === typeof href && href
? null != options && "object" !== typeof options
? console.error(
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
getValueDescriptorExpectingEnumForWarning(options)
)
: null != options &&
"string" !== typeof options.crossOrigin &&
console.error(
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
)
: console.error(
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
getValueDescriptorExpectingObjectForWarning(href)
);
"string" === typeof href &&
(options
? ((options = options.crossOrigin),
(options =
"string" === typeof options
? "use-credentials" === options
? options
: ""
: void 0))
: (options = null),
Internals.d.C(href, options));
};
exports.prefetchDNS = function (href) {
if ("string" !== typeof href || !href)
console.error(
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
getValueDescriptorExpectingObjectForWarning(href)
);
else if (1 < arguments.length) {
var options = arguments[1];
"object" === typeof options && options.hasOwnProperty("crossOrigin")
? console.error(
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
getValueDescriptorExpectingEnumForWarning(options)
)
: console.error(
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
getValueDescriptorExpectingEnumForWarning(options)
);
}
"string" === typeof href && Internals.d.D(href);
};
exports.preinit = function (href, options) {
"string" === typeof href && href
? null == options || "object" !== typeof options
? console.error(
"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
getValueDescriptorExpectingEnumForWarning(options)
)
: "style" !== options.as &&
"script" !== options.as &&
console.error(
'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
getValueDescriptorExpectingEnumForWarning(options.as)
)
: console.error(
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
getValueDescriptorExpectingObjectForWarning(href)
);
if (
"string" === typeof href &&
options &&
"string" === typeof options.as
) {
var as = options.as,
crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),
integrity =
"string" === typeof options.integrity ? options.integrity : void 0,
fetchPriority =
"string" === typeof options.fetchPriority
? options.fetchPriority
: void 0;
"style" === as
? Internals.d.S(
href,
"string" === typeof options.precedence
? options.precedence
: void 0,
{
crossOrigin: crossOrigin,
integrity: integrity,
fetchPriority: fetchPriority
}
)
: "script" === as &&
Internals.d.X(href, {
crossOrigin: crossOrigin,
integrity: integrity,
fetchPriority: fetchPriority,
nonce: "string" === typeof options.nonce ? options.nonce : void 0
});
}
};
exports.preinitModule = function (href, options) {
var encountered = "";
("string" === typeof href && href) ||
(encountered +=
" The `href` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(href) +
".");
void 0 !== options && "object" !== typeof options
? (encountered +=
" The `options` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(options) +
".")
: options &&
"as" in options &&
"script" !== options.as &&
(encountered +=
" The `as` option encountered was " +
getValueDescriptorExpectingEnumForWarning(options.as) +
".");
if (encountered)
console.error(
"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
encountered
);
else
switch (
((encountered =
options && "string" === typeof options.as ? options.as : "script"),
encountered)
) {
case "script":
break;
default:
(encountered =
getValueDescriptorExpectingEnumForWarning(encountered)),
console.error(
'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
encountered,
href
);
}
if ("string" === typeof href)
if ("object" === typeof options && null !== options) {
if (null == options.as || "script" === options.as)
(encountered = getCrossOriginStringAs(
options.as,
options.crossOrigin
)),
Internals.d.M(href, {
crossOrigin: encountered,
integrity:
"string" === typeof options.integrity
? options.integrity
: void 0,
nonce:
"string" === typeof options.nonce ? options.nonce : void 0
});
} else null == options && Internals.d.M(href);
};
exports.preload = function (href, options) {
var encountered = "";
("string" === typeof href && href) ||
(encountered +=
" The `href` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(href) +
".");
null == options || "object" !== typeof options
? (encountered +=
" The `options` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(options) +
".")
: ("string" === typeof options.as && options.as) ||
(encountered +=
" The `as` option encountered was " +
getValueDescriptorExpectingObjectForWarning(options.as) +
".");
encountered &&
console.error(
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
encountered
);
if (
"string" === typeof href &&
"object" === typeof options &&
null !== options &&
"string" === typeof options.as
) {
encountered = options.as;
var crossOrigin = getCrossOriginStringAs(
encountered,
options.crossOrigin
);
Internals.d.L(href, encountered, {
crossOrigin: crossOrigin,
integrity:
"string" === typeof options.integrity ? options.integrity : void 0,
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
type: "string" === typeof options.type ? options.type : void 0,
fetchPriority:
"string" === typeof options.fetchPriority
? options.fetchPriority
: void 0,
referrerPolicy:
"string" === typeof options.referrerPolicy
? options.referrerPolicy
: void 0,
imageSrcSet:
"string" === typeof options.imageSrcSet
? options.imageSrcSet
: void 0,
imageSizes:
"string" === typeof options.imageSizes
? options.imageSizes
: void 0,
media: "string" === typeof options.media ? options.media : void 0
});
}
};
exports.preloadModule = function (href, options) {
var encountered = "";
("string" === typeof href && href) ||
(encountered +=
" The `href` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(href) +
".");
void 0 !== options && "object" !== typeof options
? (encountered +=
" The `options` argument encountered was " +
getValueDescriptorExpectingObjectForWarning(options) +
".")
: options &&
"as" in options &&
"string" !== typeof options.as &&
(encountered +=
" The `as` option encountered was " +
getValueDescriptorExpectingObjectForWarning(options.as) +
".");
encountered &&
console.error(
'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
encountered
);
"string" === typeof href &&
(options
? ((encountered = getCrossOriginStringAs(
options.as,
options.crossOrigin
)),
Internals.d.m(href, {
as:
"string" === typeof options.as && "script" !== options.as
? options.as
: void 0,
crossOrigin: encountered,
integrity:
"string" === typeof options.integrity
? options.integrity
: void 0
}))
: Internals.d.m(href));
};
exports.version = "19.2.5";
})();
@@ -0,0 +1,123 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "எழுத்துக்கள்", verb: "கொண்டிருக்க வேண்டும்" },
file: { unit: "பைட்டுகள்", verb: "கொண்டிருக்க வேண்டும்" },
array: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
set: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
map: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "உள்ளீடு",
email: "மின்னஞ்சல் முகவரி",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "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: "input",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
number: "எண்",
array: "அணி",
null: "வெறுமை",
};
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 as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `தவறான சரம்: "${_issue.prefix}" இல் தொடங்க வேண்டும்`;
if (_issue.format === "ends_with") return `தவறான சரம்: "${_issue.suffix}" இல் முடிவடைய வேண்டும்`;
if (_issue.format === "includes") return `தவறான சரம்: "${_issue.includes}" ஐ உள்ளடக்க வேண்டும்`;
if (_issue.format === "regex") return `தவறான சரம்: ${_issue.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;
return `தவறான ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `தவறான எண்: ${issue.divisor} இன் பலமாக இருக்க வேண்டும்`;
case "unrecognized_keys":
return `அடையாளம் தெரியாத விசை${issue.keys.length > 1 ? "கள்" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `${issue.origin} இல் தவறான விசை`;
case "invalid_union":
return "தவறான உள்ளீடு";
case "invalid_element":
return `${issue.origin} இல் தவறான மதிப்பு`;
default:
return `தவறான உள்ளீடு`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1,84 @@
'use strict';
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var toStr = Object.prototype.toString;
var max = Math.max;
var funcType = '[object Function]';
var concatty = function concatty(a, b) {
var arr = [];
for (var i = 0; i < a.length; i += 1) {
arr[i] = a[i];
}
for (var j = 0; j < b.length; j += 1) {
arr[j + a.length] = b[j];
}
return arr;
};
var slicy = function slicy(arrLike, offset) {
var arr = [];
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
arr[j] = arrLike[i];
}
return arr;
};
var joiny = function (arr, joiner) {
var str = '';
for (var i = 0; i < arr.length; i += 1) {
str += arr[i];
if (i + 1 < arr.length) {
str += joiner;
}
}
return str;
};
module.exports = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
var args = slicy(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
concatty(args, arguments)
);
if (Object(result) === result) {
return result;
}
return this;
}
return target.apply(
that,
concatty(args, arguments)
);
};
var boundLength = max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs[i] = '$' + i;
}
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
Empty.prototype = target.prototype;
bound.prototype = new Empty();
Empty.prototype = null;
}
return bound;
};
@@ -0,0 +1 @@
{"version":3,"file":"bomb.js","sources":["../../../src/icons/bomb.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Bomb\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMSIgY3k9IjEzIiByPSI5IiAvPgogIDxwYXRoIGQ9Ik0xNC4zNSA0LjY1IDE2LjMgMi43YTIuNDEgMi40MSAwIDAgMSAzLjQgMGwxLjYgMS42YTIuNCAyLjQgMCAwIDEgMCAzLjRsLTEuOTUgMS45NSIgLz4KICA8cGF0aCBkPSJtMjIgMi0xLjUgMS41IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/bomb\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 Bomb = createLucideIcon('Bomb', [\n ['circle', { cx: '11', cy: '13', r: '9', key: 'hd149' }],\n [\n 'path',\n {\n d: 'M14.35 4.65 16.3 2.7a2.41 2.41 0 0 1 3.4 0l1.6 1.6a2.4 2.4 0 0 1 0 3.4l-1.95 1.95',\n key: 'jp4j1b',\n },\n ],\n ['path', { d: 'm22 2-1.5 1.5', key: 'ay92ug' }],\n]);\n\nexport default Bomb;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CACpC,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAS,CAAA,CAAA;AAAA,CACvD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,2 @@
import { LinearRouter } from "./router.js";
export { LinearRouter };
@@ -0,0 +1,25 @@
'use strict';
var utils = require('./utils-CylcaoNQ.cjs');
require('magic-string');
require('mlly');
function cjsExportsDtsMatcher(info) {
return info.type === "chunk" && info.exports?.length > 0 && info.exports.includes("default") && /\.d\.c?ts$/.test(info.fileName);
}
function defaultCjsExportsDtsMatcher(info) {
return cjsExportsDtsMatcher(info) && info.isEntry;
}
function FixDtsDefaultCjsExportsPlugin(options = {}) {
const { matcher = defaultCjsExportsDtsMatcher } = options;
return {
name: "fix-dts-default-cjs-exports-plugin",
renderChunk(code, info) {
return matcher(info) ? utils.internalFixDefaultCJSExports(code, info, options) : void 0;
}
};
}
exports.FixDtsDefaultCjsExportsPlugin = FixDtsDefaultCjsExportsPlugin;
exports.cjsExportsDtsMatcher = cjsExportsDtsMatcher;
exports.defaultCjsExportsDtsMatcher = defaultCjsExportsDtsMatcher;
@@ -0,0 +1,23 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
interface String {
/**
* Returns a new String consisting of the single UTF-16 code unit located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): string | undefined;
}
@@ -0,0 +1,396 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "buildDynamicImport", {
enumerable: true,
get: function () {
return _dynamicImport.buildDynamicImport;
}
});
exports.buildNamespaceInitStatements = buildNamespaceInitStatements;
exports.ensureStatementsHoisted = ensureStatementsHoisted;
Object.defineProperty(exports, "getModuleName", {
enumerable: true,
get: function () {
return _getModuleName.default;
}
});
Object.defineProperty(exports, "hasExports", {
enumerable: true,
get: function () {
return _normalizeAndLoadMetadata.hasExports;
}
});
Object.defineProperty(exports, "isModule", {
enumerable: true,
get: function () {
return _helperModuleImports.isModule;
}
});
Object.defineProperty(exports, "isSideEffectImport", {
enumerable: true,
get: function () {
return _normalizeAndLoadMetadata.isSideEffectImport;
}
});
exports.rewriteModuleStatementsAndPrepareHeader = rewriteModuleStatementsAndPrepareHeader;
Object.defineProperty(exports, "rewriteThis", {
enumerable: true,
get: function () {
return _rewriteThis.default;
}
});
exports.wrapInterop = wrapInterop;
var _assert = require("assert");
var _core = require("@babel/core");
var _helperModuleImports = require("@babel/helper-module-imports");
var _rewriteThis = require("./rewrite-this.js");
var _rewriteLiveReferences = require("./rewrite-live-references.js");
var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js");
var Lazy = require("./lazy-modules.js");
var _dynamicImport = require("./dynamic-import.js");
var _getModuleName = require("./get-module-name.js");
exports.getDynamicImportSource = require("./dynamic-import").getDynamicImportSource;
function rewriteModuleStatementsAndPrepareHeader(path, {
exportName,
strict,
allowTopLevelThis,
strictMode,
noInterop,
importInterop = noInterop ? "none" : "babel",
lazy,
getWrapperPayload = Lazy.toGetWrapperPayload(lazy != null ? lazy : false),
wrapReference = Lazy.wrapReference,
esNamespaceOnly,
filename,
constantReexports = arguments[1].loose,
enumerableModuleMeta = arguments[1].loose,
noIncompleteNsImportDetection
}) {
(0, _normalizeAndLoadMetadata.validateImportInteropOption)(importInterop);
_assert((0, _helperModuleImports.isModule)(path), "Cannot process module statements in a script");
path.node.sourceType = "script";
const meta = (0, _normalizeAndLoadMetadata.default)(path, exportName, {
importInterop,
initializeReexports: constantReexports,
getWrapperPayload,
esNamespaceOnly,
filename
});
if (!allowTopLevelThis) {
(0, _rewriteThis.default)(path);
}
(0, _rewriteLiveReferences.default)(path, meta, wrapReference);
if (strictMode !== false) {
const hasStrict = path.node.directives.some(directive => {
return directive.value.value === "use strict";
});
if (!hasStrict) {
path.unshiftContainer("directives", _core.types.directive(_core.types.directiveLiteral("use strict")));
}
}
const headers = [];
if ((0, _normalizeAndLoadMetadata.hasExports)(meta) && !strict) {
headers.push(buildESModuleHeader(meta, enumerableModuleMeta));
}
const nameList = buildExportNameListDeclaration(path, meta);
if (nameList) {
meta.exportNameListName = nameList.name;
headers.push(nameList.statement);
}
headers.push(...buildExportInitializationStatements(path, meta, wrapReference, constantReexports, noIncompleteNsImportDetection));
return {
meta,
headers
};
}
function ensureStatementsHoisted(statements) {
statements.forEach(header => {
header._blockHoist = 3;
});
}
function wrapInterop(programPath, expr, type) {
if (type === "none") {
return null;
}
if (type === "node-namespace") {
return _core.types.callExpression(programPath.hub.addHelper("interopRequireWildcard"), [expr, _core.types.booleanLiteral(true)]);
} else if (type === "node-default") {
return null;
}
let helper;
if (type === "default") {
helper = "interopRequireDefault";
} else if (type === "namespace") {
helper = "interopRequireWildcard";
} else {
throw new Error(`Unknown interop: ${type}`);
}
return _core.types.callExpression(programPath.hub.addHelper(helper), [expr]);
}
function buildNamespaceInitStatements(metadata, sourceMetadata, constantReexports = false, wrapReference = Lazy.wrapReference) {
var _wrapReference;
const statements = [];
const srcNamespaceId = _core.types.identifier(sourceMetadata.name);
for (const localName of sourceMetadata.importsNamespace) {
if (localName === sourceMetadata.name) continue;
statements.push(_core.template.statement`var NAME = SOURCE;`({
NAME: localName,
SOURCE: _core.types.cloneNode(srcNamespaceId)
}));
}
const srcNamespace = (_wrapReference = wrapReference(srcNamespaceId, sourceMetadata.wrap)) != null ? _wrapReference : srcNamespaceId;
if (constantReexports) {
statements.push(...buildReexportsFromMeta(metadata, sourceMetadata, true, wrapReference));
}
for (const exportName of sourceMetadata.reexportNamespace) {
statements.push((!_core.types.isIdentifier(srcNamespace) ? _core.template.statement`
Object.defineProperty(EXPORTS, "NAME", {
enumerable: true,
get: function() {
return NAMESPACE;
}
});
` : _core.template.statement`EXPORTS.NAME = NAMESPACE;`)({
EXPORTS: metadata.exportName,
NAME: exportName,
NAMESPACE: _core.types.cloneNode(srcNamespace)
}));
}
if (sourceMetadata.reexportAll) {
const statement = buildNamespaceReexport(metadata, _core.types.cloneNode(srcNamespace), constantReexports);
statement.loc = sourceMetadata.reexportAll.loc;
statements.push(statement);
}
return statements;
}
const ReexportTemplate = {
constant: ({
exports,
exportName,
namespaceImport
}) => _core.template.statement.ast`
${exports}.${exportName} = ${namespaceImport};
`,
constantComputed: ({
exports,
exportName,
namespaceImport
}) => _core.template.statement.ast`
${exports}["${exportName}"] = ${namespaceImport};
`,
spec: ({
exports,
exportName,
namespaceImport
}) => _core.template.statement.ast`
Object.defineProperty(${exports}, "${exportName}", {
enumerable: true,
get: function() {
return ${namespaceImport};
},
});
`
};
function buildReexportsFromMeta(meta, metadata, constantReexports, wrapReference) {
var _wrapReference2;
let namespace = _core.types.identifier(metadata.name);
namespace = (_wrapReference2 = wrapReference(namespace, metadata.wrap)) != null ? _wrapReference2 : namespace;
const {
stringSpecifiers
} = meta;
return Array.from(metadata.reexports, ([exportName, importName]) => {
let namespaceImport = _core.types.cloneNode(namespace);
if (importName === "default" && metadata.interop === "node-default") {} else if (stringSpecifiers.has(importName)) {
namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.stringLiteral(importName), true);
} else {
namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.identifier(importName));
}
const astNodes = {
exports: meta.exportName,
exportName,
namespaceImport
};
if (constantReexports || _core.types.isIdentifier(namespaceImport)) {
if (stringSpecifiers.has(exportName)) {
return ReexportTemplate.constantComputed(astNodes);
} else {
return ReexportTemplate.constant(astNodes);
}
} else {
return ReexportTemplate.spec(astNodes);
}
});
}
function buildESModuleHeader(metadata, enumerableModuleMeta = false) {
return (enumerableModuleMeta ? _core.template.statement`
EXPORTS.__esModule = true;
` : _core.template.statement`
Object.defineProperty(EXPORTS, "__esModule", {
value: true,
});
`)({
EXPORTS: metadata.exportName
});
}
function buildNamespaceReexport(metadata, namespace, constantReexports) {
return (constantReexports ? _core.template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
EXPORTS[key] = NAMESPACE[key];
});
` : _core.template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
Object.defineProperty(EXPORTS, key, {
enumerable: true,
get: function() {
return NAMESPACE[key];
},
});
});
`)({
NAMESPACE: namespace,
EXPORTS: metadata.exportName,
VERIFY_NAME_LIST: metadata.exportNameListName ? (0, _core.template)`
if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;
`({
EXPORTS_LIST: metadata.exportNameListName
}) : null
});
}
function buildExportNameListDeclaration(programPath, metadata) {
const exportedVars = Object.create(null);
for (const data of metadata.local.values()) {
for (const name of data.names) {
exportedVars[name] = true;
}
}
let hasReexport = false;
for (const data of metadata.source.values()) {
for (const exportName of data.reexports.keys()) {
exportedVars[exportName] = true;
}
for (const exportName of data.reexportNamespace) {
exportedVars[exportName] = true;
}
hasReexport = hasReexport || !!data.reexportAll;
}
if (!hasReexport || Object.keys(exportedVars).length === 0) return null;
const name = programPath.scope.generateUidIdentifier("exportNames");
delete exportedVars.default;
return {
name: name.name,
statement: _core.types.variableDeclaration("var", [_core.types.variableDeclarator(name, _core.types.valueToNode(exportedVars))])
};
}
function buildExportInitializationStatements(programPath, metadata, wrapReference, constantReexports = false, noIncompleteNsImportDetection = false) {
const initStatements = [];
for (const [localName, data] of metadata.local) {
if (data.kind === "import") {} else if (data.kind === "hoisted") {
initStatements.push([data.names[0], buildInitStatement(metadata, data.names, _core.types.identifier(localName))]);
} else if (!noIncompleteNsImportDetection) {
for (const exportName of data.names) {
initStatements.push([exportName, null]);
}
}
}
for (const data of metadata.source.values()) {
if (!constantReexports) {
const reexportsStatements = buildReexportsFromMeta(metadata, data, false, wrapReference);
const reexports = [...data.reexports.keys()];
for (let i = 0; i < reexportsStatements.length; i++) {
initStatements.push([reexports[i], reexportsStatements[i]]);
}
}
if (!noIncompleteNsImportDetection) {
for (const exportName of data.reexportNamespace) {
initStatements.push([exportName, null]);
}
}
}
initStatements.sort(([a], [b]) => {
if (a < b) return -1;
if (b < a) return 1;
return 0;
});
const results = [];
if (noIncompleteNsImportDetection) {
for (const [, initStatement] of initStatements) {
results.push(initStatement);
}
} else {
const chunkSize = 100;
for (let i = 0; i < initStatements.length; i += chunkSize) {
let uninitializedExportNames = [];
for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) {
const [exportName, initStatement] = initStatements[i + j];
if (initStatement !== null) {
if (uninitializedExportNames.length > 0) {
results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode()));
uninitializedExportNames = [];
}
results.push(initStatement);
} else {
uninitializedExportNames.push(exportName);
}
}
if (uninitializedExportNames.length > 0) {
results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode()));
}
}
}
return results;
}
const InitTemplate = {
computed: ({
exports,
name,
value
}) => _core.template.expression.ast`${exports}["${name}"] = ${value}`,
default: ({
exports,
name,
value
}) => _core.template.expression.ast`${exports}.${name} = ${value}`,
define: ({
exports,
name,
value
}) => _core.template.expression.ast`
Object.defineProperty(${exports}, "${name}", {
enumerable: true,
value: void 0,
writable: true
})["${name}"] = ${value}`
};
function buildInitStatement(metadata, exportNames, initExpr) {
const {
stringSpecifiers,
exportName: exports
} = metadata;
return _core.types.expressionStatement(exportNames.reduce((value, name) => {
const params = {
exports,
name,
value
};
if (name === "__proto__") {
return InitTemplate.define(params);
}
if (stringSpecifiers.has(name)) {
return InitTemplate.computed(params);
}
return InitTemplate.default(params);
}, initExpr));
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
import { a as addObject, b as addNumber } from "./addObject-CJjLNrjF.mjs";
function add(date, num, unit) {
return typeof num === "object" && num !== null ? addObject(date, num, 1) : addNumber(date, num, unit);
}
export {
add as default
};
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const SquareSquare = createLucideIcon("SquareSquare", [
["rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", key: "h1oib" }],
["rect", { x: "8", y: "8", width: "8", height: "8", rx: "1", key: "z9xiuo" }]
]);
export { SquareSquare as default };
//# sourceMappingURL=square-square.js.map
@@ -0,0 +1,151 @@
import { a as namespaces, i as enabled, n as disable, o as humanize, r as enable$1, s as selectColor, t as createDebug$1 } from "./core.js";
import { isatty } from "node:tty";
import { formatWithOptions, inspect } from "node:util";
const colors = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [
20,
21,
26,
27,
32,
33,
38,
39,
40,
41,
42,
43,
44,
45,
56,
57,
62,
63,
68,
69,
74,
75,
76,
77,
78,
79,
80,
81,
92,
93,
98,
99,
112,
113,
128,
129,
134,
135,
148,
149,
160,
161,
162,
163,
164,
165,
166,
167,
168,
169,
170,
171,
172,
173,
178,
179,
184,
185,
196,
197,
198,
199,
200,
201,
202,
203,
204,
205,
206,
207,
208,
209,
214,
215,
220,
221
] : [
6,
2,
3,
4,
5,
1
];
const inspectOpts = Object.keys(process.env).filter((key) => /^debug_/i.test(key)).reduce((obj, key) => {
const prop = key.slice(6).toLowerCase().replace(/_([a-z])/g, (_, k) => k.toUpperCase());
let value = process.env[key];
const lowerCase = typeof value === "string" && value.toLowerCase();
if (value === "null") value = null;
else if (lowerCase === "yes" || lowerCase === "on" || lowerCase === "true" || lowerCase === "enabled") value = true;
else if (lowerCase === "no" || lowerCase === "off" || lowerCase === "false" || lowerCase === "disabled") value = false;
else value = Number(value);
obj[prop] = value;
return obj;
}, {});
function useColors() {
return "colors" in inspectOpts ? Boolean(inspectOpts.colors) : isatty(process.stderr.fd);
}
function getDate() {
if (inspectOpts.hideDate) return "";
return `${(/* @__PURE__ */ new Date()).toISOString()} `;
}
function formatArgs(diff, args) {
const { namespace: name, useColors: useColors$1 } = this;
if (useColors$1) {
const c = this.color;
const colorCode = `\u001B[3${c < 8 ? c : `8;5;${c}`}`;
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
args[0] = prefix + args[0].split("\n").join(`\n${prefix}`);
args.push(`${colorCode}m+${this.humanize(diff)}\u001B[0m`);
} else args[0] = `${getDate()}${name} ${args[0]}`;
}
function log(...args) {
process.stderr.write(`${formatWithOptions(this.inspectOpts, ...args)}\n`);
}
const defaultOptions = {
useColors: useColors(),
formatArgs,
formatters: {
o(v) {
this.inspectOpts.colors = this.useColors;
return inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
},
O(v) {
this.inspectOpts.colors = this.useColors;
return inspect(v, this.inspectOpts);
}
},
inspectOpts,
log,
humanize
};
function createDebug(namespace, options) {
var _ref;
const color = (_ref = options && options.color) !== null && _ref !== void 0 ? _ref : selectColor(colors, namespace);
return createDebug$1(namespace, Object.assign(defaultOptions, { color }, options));
}
function save(namespaces$1) {
if (namespaces$1) process.env.DEBUG = namespaces$1;
else delete process.env.DEBUG;
}
function enable(namespaces$1) {
save(namespaces$1);
enable$1(namespaces$1);
}
enable$1(process.env.DEBUG || "");
export { createDebug, disable, enable, enabled, namespaces };
@@ -0,0 +1,191 @@
export declare const _resetIOSDetectionForTests: () => void;
export { approxEqual, debounce, memo, notUndefined } from './utils.cjs';
export type { NoInfer, PartialKeys } from './utils.cjs';
type ScrollDirection = 'forward' | 'backward';
type ScrollAlignment = 'start' | 'center' | 'end' | 'auto';
type ScrollBehavior = 'auto' | 'smooth' | 'instant';
type ScrollAnchor = 'start' | 'end';
type FollowOnAppend = boolean | ScrollBehavior;
export interface ScrollToOptions {
align?: ScrollAlignment;
behavior?: ScrollBehavior;
}
type ScrollToOffsetOptions = ScrollToOptions;
type ScrollToIndexOptions = ScrollToOptions;
type ScrollToEndOptions = Pick<ScrollToOptions, 'behavior'>;
export interface Range {
startIndex: number;
endIndex: number;
overscan: number;
count: number;
}
type Key = number | string | bigint;
export interface VirtualItem {
key: Key;
index: number;
start: number;
end: number;
size: number;
lane: number;
}
export interface Rect {
width: number;
height: number;
}
export declare const defaultKeyExtractor: (index: number) => number;
export declare const defaultRangeExtractor: (range: Range) => number[];
export declare const observeElementRect: <T extends Element>(instance: Virtualizer<T, any>, cb: (rect: Rect) => void) => (() => void) | undefined;
export declare const observeWindowRect: (instance: Virtualizer<Window, any>, cb: (rect: Rect) => void) => (() => void) | undefined;
type ObserveOffsetCallBack = (offset: number, isScrolling: boolean) => void;
export declare const observeElementOffset: <T extends Element>(instance: Virtualizer<T, any>, cb: ObserveOffsetCallBack) => (() => void) | undefined;
export declare const observeWindowOffset: (instance: Virtualizer<Window, any>, cb: ObserveOffsetCallBack) => (() => void) | undefined;
export declare const measureElement: <TItemElement extends Element>(element: TItemElement, entry: ResizeObserverEntry | undefined, instance: Virtualizer<any, TItemElement>) => number;
export declare const windowScroll: <T extends Window>(offset: number, options: {
adjustments?: number;
behavior?: ScrollBehavior;
}, instance: Virtualizer<T, any>) => void;
export declare const elementScroll: <T extends Element>(offset: number, options: {
adjustments?: number;
behavior?: ScrollBehavior;
}, instance: Virtualizer<T, any>) => void;
type LaneAssignmentMode = 'estimate' | 'measured';
export interface VirtualizerOptions<TScrollElement extends Element | Window, TItemElement extends Element> {
count: number;
getScrollElement: () => TScrollElement | null;
estimateSize: (index: number) => number;
scrollToFn: (offset: number, options: {
adjustments?: number;
behavior?: ScrollBehavior;
}, instance: Virtualizer<TScrollElement, TItemElement>) => void;
observeElementRect: (instance: Virtualizer<TScrollElement, TItemElement>, cb: (rect: Rect) => void) => void | (() => void);
observeElementOffset: (instance: Virtualizer<TScrollElement, TItemElement>, cb: ObserveOffsetCallBack) => void | (() => void);
debug?: boolean;
initialRect?: Rect;
onChange?: (instance: Virtualizer<TScrollElement, TItemElement>, sync: boolean) => void;
measureElement?: (element: TItemElement, entry: ResizeObserverEntry | undefined, instance: Virtualizer<TScrollElement, TItemElement>) => number;
overscan?: number;
horizontal?: boolean;
paddingStart?: number;
paddingEnd?: number;
scrollPaddingStart?: number;
scrollPaddingEnd?: number;
initialOffset?: number | (() => number);
getItemKey?: (index: number) => Key;
rangeExtractor?: (range: Range) => Array<number>;
scrollMargin?: number;
gap?: number;
indexAttribute?: string;
initialMeasurementsCache?: Array<VirtualItem>;
lanes?: number;
anchorTo?: ScrollAnchor;
followOnAppend?: FollowOnAppend;
scrollEndThreshold?: number;
isScrollingResetDelay?: number;
useScrollendEvent?: boolean;
enabled?: boolean;
isRtl?: boolean;
useAnimationFrameWithResizeObserver?: boolean;
laneAssignmentMode?: LaneAssignmentMode;
useCachedMeasurements?: boolean;
}
export declare class Virtualizer<TScrollElement extends Element | Window, TItemElement extends Element> {
private unsubs;
options: Required<VirtualizerOptions<TScrollElement, TItemElement>>;
scrollElement: TScrollElement | null;
targetWindow: (Window & typeof globalThis) | null;
isScrolling: boolean;
private scrollState;
measurementsCache: Array<VirtualItem>;
private _flatMeasurements;
itemSizeCache: Map<Key, number>;
private itemSizeCacheVersion;
private laneAssignments;
private pendingMin;
private prevLanes;
private lanesChangedFlag;
private lanesSettling;
private pendingScrollAnchor;
scrollRect: Rect | null;
scrollOffset: number | null;
scrollDirection: ScrollDirection | null;
private scrollAdjustments;
private _iosDeferredAdjustment;
private _iosTouching;
private _iosJustTouchEnded;
private _iosTouchEndTimerId;
private _intendedScrollOffset;
shouldAdjustScrollPositionOnItemSizeChange: undefined | ((item: VirtualItem, delta: number, instance: Virtualizer<TScrollElement, TItemElement>) => boolean);
elementsCache: Map<Key, TItemElement>;
private now;
private observer;
range: {
startIndex: number;
endIndex: number;
} | null;
constructor(opts: VirtualizerOptions<TScrollElement, TItemElement>);
setOptions: (opts: VirtualizerOptions<TScrollElement, TItemElement>) => void;
private notify;
private applyScrollAdjustment;
private maybeNotify;
private cleanup;
_didMount: () => () => void;
_willUpdate: () => void;
private _flushIosDeferredIfReady;
private rafId;
private scheduleScrollReconcile;
private reconcileScroll;
private getSize;
private getScrollOffset;
private getFurthestMeasurement;
private getMeasurementOptions;
private getMeasurements;
calculateRange: {
(): {
startIndex: number;
endIndex: number;
} | null;
updateDeps(newDeps: [VirtualItem[], number, number, number]): void;
};
getVirtualIndexes: {
(): number[];
updateDeps(newDeps: [(range: Range) => Array<number>, number, number, number | null, number | null]): void;
};
indexFromElement: (node: TItemElement) => number;
/**
* Determines if an item at the given index should be measured during smooth scroll.
* During smooth scroll, only items within a buffer range around the target are measured
* to prevent items far from the target from pushing it away.
*/
private shouldMeasureDuringScroll;
measureElement: (node: TItemElement | null) => void;
resizeItem: (index: number, size: number) => void;
getVirtualItems: {
(): VirtualItem[];
updateDeps(newDeps: [number[], VirtualItem[]]): void;
};
getVirtualItemForOffset: (offset: number) => VirtualItem | undefined;
private getMaxScrollOffset;
private getVirtualDistanceFromEnd;
getDistanceFromEnd: () => number;
isAtEnd: (threshold?: number) => boolean;
getOffsetForAlignment: (toOffset: number, align: ScrollAlignment, itemSize?: number) => number;
getOffsetForIndex: (index: number, align?: ScrollAlignment) => readonly [number, "auto"] | readonly [number, "start" | "center" | "end"] | undefined;
scrollToOffset: (toOffset: number, { align, behavior }?: ScrollToOffsetOptions) => void;
scrollToIndex: (index: number, { align: initialAlign, behavior, }?: ScrollToIndexOptions) => void;
scrollBy: (delta: number, { behavior }?: ScrollToOffsetOptions) => void;
scrollToEnd: ({ behavior }?: ScrollToEndOptions) => void;
getTotalSize: () => number;
/**
* Returns a snapshot of currently-measured items suitable for round-
* tripping through state storage (sessionStorage, history, etc.) and
* passing back as `initialMeasurementsCache` on remount. Pair with the
* current `scrollOffset` to restore exact scroll position after navigation.
*
* Only items the consumer has actually rendered (and thus measured) appear
* in the snapshot; unmeasured items will fall back to `estimateSize` on
* restore. Returns an empty array if no items have been measured.
*/
takeSnapshot: () => Array<VirtualItem>;
private _scrollToOffset;
measure: () => void;
}
@@ -0,0 +1,56 @@
'use strict';
var $defineProperty = require('../');
var test = require('tape');
var gOPD = require('gopd');
test('defineProperty: supported', { skip: !$defineProperty }, function (t) {
t.plan(4);
t.equal(typeof $defineProperty, 'function', 'defineProperty is supported');
if ($defineProperty && gOPD) { // this `if` check is just to shut TS up
/** @type {{ a: number, b?: number, c?: number }} */
var o = { a: 1 };
$defineProperty(o, 'b', { enumerable: true, value: 2 });
t.deepEqual(
gOPD(o, 'b'),
{
configurable: false,
enumerable: true,
value: 2,
writable: false
},
'property descriptor is as expected'
);
$defineProperty(o, 'c', { enumerable: false, value: 3, writable: true });
t.deepEqual(
gOPD(o, 'c'),
{
configurable: false,
enumerable: false,
value: 3,
writable: true
},
'property descriptor is as expected'
);
}
t.equal($defineProperty, Object.defineProperty, 'defineProperty is Object.defineProperty');
t.end();
});
test('defineProperty: not supported', { skip: !!$defineProperty }, function (t) {
t.notOk($defineProperty, 'defineProperty is not supported');
t.match(
typeof $defineProperty,
/^(?:undefined|boolean)$/,
'`typeof defineProperty` is `undefined` or `boolean`'
);
t.end();
});
@@ -0,0 +1,23 @@
"use client";
// src/portal.tsx
import * as React from "react";
import ReactDOM from "react-dom";
import { Primitive } from "@radix-ui/react-primitive";
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
import { jsx } from "react/jsx-runtime";
var PORTAL_NAME = "Portal";
var Portal = React.forwardRef((props, forwardedRef) => {
const { container: containerProp, ...portalProps } = props;
const [mounted, setMounted] = React.useState(false);
useLayoutEffect(() => setMounted(true), []);
const container = containerProp || mounted && globalThis?.document?.body;
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
});
Portal.displayName = PORTAL_NAME;
var Root = Portal;
export {
Portal,
Root
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,127 @@
'use strict'
const { runtimeFeatures } = require('../../util/runtime-features')
const { maxUnsigned16Bit, opcodes } = require('./constants')
const BUFFER_SIZE = 8 * 1024
let buffer = null
let bufIdx = BUFFER_SIZE
const randomFillSync = runtimeFeatures.has('crypto')
? require('node:crypto').randomFillSync
: null
function generateMask () {
if (bufIdx === BUFFER_SIZE) {
bufIdx = 0
randomFillSync((buffer ??= Buffer.allocUnsafeSlow(BUFFER_SIZE)), 0, BUFFER_SIZE)
}
return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]
}
class WebsocketFrameSend {
/**
* @param {Buffer|undefined} data
*/
constructor (data) {
this.frameData = data
}
createFrame (opcode) {
const frameData = this.frameData
const maskKey = generateMask()
const bodyLength = frameData?.byteLength ?? 0
/** @type {number} */
let payloadLength = bodyLength // 0-125
let offset = 6
if (bodyLength > maxUnsigned16Bit) {
offset += 8 // payload length is next 8 bytes
payloadLength = 127
} else if (bodyLength > 125) {
offset += 2 // payload length is next 2 bytes
payloadLength = 126
}
const buffer = Buffer.allocUnsafe(bodyLength + offset)
// Clear first 2 bytes, everything else is overwritten
buffer[0] = buffer[1] = 0
buffer[0] |= 0x80 // FIN
buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
buffer[offset - 4] = maskKey[0]
buffer[offset - 3] = maskKey[1]
buffer[offset - 2] = maskKey[2]
buffer[offset - 1] = maskKey[3]
buffer[1] = payloadLength
if (payloadLength === 126) {
buffer.writeUInt16BE(bodyLength, 2)
} else if (payloadLength === 127) {
// Clear extended payload length
buffer[2] = buffer[3] = 0
buffer.writeUIntBE(bodyLength, 4, 6)
}
buffer[1] |= 0x80 // MASK
// mask body
for (let i = 0; i < bodyLength; ++i) {
buffer[offset + i] = frameData[i] ^ maskKey[i & 3]
}
return buffer
}
/**
* @param {Uint8Array} buffer
*/
static createFastTextFrame (buffer) {
const maskKey = generateMask()
const bodyLength = buffer.length
// mask body
for (let i = 0; i < bodyLength; ++i) {
buffer[i] ^= maskKey[i & 3]
}
let payloadLength = bodyLength
let offset = 6
if (bodyLength > maxUnsigned16Bit) {
offset += 8 // payload length is next 8 bytes
payloadLength = 127
} else if (bodyLength > 125) {
offset += 2 // payload length is next 2 bytes
payloadLength = 126
}
const head = Buffer.allocUnsafeSlow(offset)
head[0] = 0x80 /* FIN */ | opcodes.TEXT /* opcode TEXT */
head[1] = payloadLength | 0x80 /* MASK */
head[offset - 4] = maskKey[0]
head[offset - 3] = maskKey[1]
head[offset - 2] = maskKey[2]
head[offset - 1] = maskKey[3]
if (payloadLength === 126) {
head.writeUInt16BE(bodyLength, 2)
} else if (payloadLength === 127) {
head[2] = head[3] = 0
head.writeUIntBE(bodyLength, 4, 6)
}
return [head, buffer]
}
}
module.exports = {
WebsocketFrameSend,
generateMask // for benchmark
}
@@ -0,0 +1 @@
{"version":3,"names":["_classApplyDescriptorSet","require","_assertClassBrand","_classCheckPrivateStaticFieldDescriptor","_classStaticPrivateFieldSpecSet","receiver","classConstructor","descriptor","value","assertClassBrand","classCheckPrivateStaticFieldDescriptor","classApplyDescriptorSet"],"sources":["../../src/helpers/classStaticPrivateFieldSpecSet.js"],"sourcesContent":["/* @minVersion 7.0.2 */\n/* @onlyBabel7 */\n\nimport classApplyDescriptorSet from \"classApplyDescriptorSet\";\nimport assertClassBrand from \"assertClassBrand\";\nimport classCheckPrivateStaticFieldDescriptor from \"classCheckPrivateStaticFieldDescriptor\";\nexport default function _classStaticPrivateFieldSpecSet(\n receiver,\n classConstructor,\n descriptor,\n value,\n) {\n assertClassBrand(classConstructor, receiver);\n classCheckPrivateStaticFieldDescriptor(descriptor, \"set\");\n classApplyDescriptorSet(receiver, descriptor, value);\n return value;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,uCAAA,GAAAF,OAAA;AACe,SAASG,+BAA+BA,CACrDC,QAAQ,EACRC,gBAAgB,EAChBC,UAAU,EACVC,KAAK,EACL;EACAC,iBAAgB,CAACH,gBAAgB,EAAED,QAAQ,CAAC;EAC5CK,uCAAsC,CAACH,UAAU,EAAE,KAAK,CAAC;EACzDI,wBAAuB,CAACN,QAAQ,EAAEE,UAAU,EAAEC,KAAK,CAAC;EACpD,OAAOA,KAAK;AACd","ignoreList":[]}
@@ -0,0 +1,97 @@
# html-escaper [![Build Status](https://travis-ci.org/WebReflection/html-escaper.svg?branch=master)](https://travis-ci.org/WebReflection/html-escaper) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/html-escaper/badge.svg?branch=master)](https://coveralls.io/github/WebReflection/html-escaper?branch=master)
A simple module to escape/unescape common problematic entities.
### How
This package is available in npm so `npm install html-escaper` is all you need to do, using eventually the global flag too.
Once the module is present
```js
var html = require('html-escaper');
// two basic methods
html.escape('string');
html.unescape('escaped string');
```
### Why
there is basically one rule only: do not **ever** replace one char after another if you are transforming a string into another.
```js
// WARNING: THIS IS WRONG
// if you are that kind of dev that does this
function escape(s) {
return s.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/'/g, "&#39;")
.replace(/"/g, "&quot;");
}
// you might be the same dev that does this too
function unescape(s) {
return s.replace(/&amp;/g, "&")
.replace(/&lt;/g, "<")
.replace(/&gt;/g, ">")
.replace(/&#39;/g, "'")
.replace(/&quot;/g, '"');
}
// guess what we have here ?
unescape('&amp;lt;');
// now guess this XSS too ...
unescape('&amp;lt;script&amp;gt;alert("yo")&amp;lt;/script&amp;gt;');
```
The last example will produce `<script>alert("yo")</script>` instead of the expected `&lt;script&gt;alert("yo")&lt;/script&gt;`.
Nothing like this could possibly happen if we grab all chars at once and either ways.
It's just a fortunate case that after swapping `&` with `&amp;` no other replace will be affected, but it's not portable and universally a bad practice.
Grab all chars at once, no excuses!
**more details**
As somebody might think it's an `unescape` issue only, it's not. Being an anti-pattern with side effects works both ways.
As example, changing the order of the replacement in escaping would produce the unexpected:
```js
function escape(s) {
return s.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/'/g, "&#39;")
.replace(/"/g, "&quot;")
.replace(/&/g, "&amp;");
}
escape('<'); // &amp;lt; instead of &lt;
```
If we do not want to code with the fear that the order wasn't perfect or that our order in either escaping or unescaping is different from the order another method or function used, if we understand the issue and we agree it's potentially a disaster prone approach, if we add the fact in this case creating 4 RegExp objects each time and invoking 4 times `.replace` trough the `String.prototype` is also potentially slower than creating one function only holding one object, or holding the function too, we should agree there is not absolutely any valid reason to keep proposing a char-by-char implementation.
We have proofs this approach can fail already so ... why should we risk? Just avoid and grab all chars at once or simply use this tiny utility.
### Backtick
Internt explorer < 9 has [some backtick issue](https://html5sec.org/#102)
For compatibility sake with common server-side HTML entities encoders and decoders, and in order to have the most reliable I/O, this little utility will NOT fix this IE < 9 problem.
It is also important to note that if we create valid HTML and we set attributes at runtime through this utility, backticks in strings cannot possibly affect attribute behaviors.
```js
var img = new Image();
img.src = html.escape(
'x` `<script>alert(1)</script>"` `'
);
// it won't cause problems even in IE < 9
```
**However**, if you use `innerHTML` and you target IE < 9 then [this **might** be a problem](https://github.com/nette/nette/issues/1496).
Accordingly, if you need more chars and/or backticks to be escaped and unescaped, feel free to use alternatives like [lodash](https://github.com/lodash/lodash) or [he](https://www.npmjs.com/package/he)
Here a bit more of [my POV](https://github.com/WebReflection/html-escaper/commit/52d554fc6e8583b6ffdd357967cf71962fc07cf6#commitcomment-10625122) and why I haven't implemented same thing alternatives did. Good news: those are alternatives ;-)
@@ -0,0 +1,38 @@
import { ensureType } from "./ensureType.mjs";
import { getType } from "./getType.mjs";
import { isAbsoluteURL } from "./isAbsoluteURL.mjs";
import { isArrayLike } from "./isArrayLike.mjs";
import { isAsyncFunction } from "./isAsyncFunction.mjs";
import { isESModule } from "./isESModule.mjs";
import { isError } from "./isError.mjs";
import { isFunction } from "./isFunction.mjs";
import { isIterable } from "./isIterable.mjs";
import { isLeapYear } from "./isLeapYear.mjs";
import { isLength } from "./isLength.mjs";
import { isNil } from "./isNil.mjs";
import { isNumber } from "./isNumber.mjs";
import { isObject } from "./isObject.mjs";
import { isPlainObject } from "./isPlainObject.mjs";
import { isPromiseLike } from "./isPromiseLike.mjs";
import { isValidDate } from "./isValidDate.mjs";
import { isWhat } from "./isWhat.mjs";
export {
ensureType,
getType,
isAbsoluteURL,
isArrayLike,
isAsyncFunction,
isESModule,
isError,
isFunction,
isIterable,
isLeapYear,
isLength,
isNil,
isNumber,
isObject,
isPlainObject,
isPromiseLike,
isValidDate,
isWhat
};
@@ -0,0 +1 @@
{"version":3,"file":"decode.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,122 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _assert = require("assert");
var _t = require("@babel/types");
const {
callExpression,
cloneNode,
expressionStatement,
identifier,
importDeclaration,
importDefaultSpecifier,
importNamespaceSpecifier,
importSpecifier,
memberExpression,
stringLiteral,
variableDeclaration,
variableDeclarator
} = _t;
class ImportBuilder {
constructor(importedSource, scope, hub) {
this._statements = [];
this._resultName = null;
this._importedSource = void 0;
this._scope = scope;
this._hub = hub;
this._importedSource = importedSource;
}
done() {
return {
statements: this._statements,
resultName: this._resultName
};
}
import() {
this._statements.push(importDeclaration([], stringLiteral(this._importedSource)));
return this;
}
require() {
this._statements.push(expressionStatement(callExpression(identifier("require"), [stringLiteral(this._importedSource)])));
return this;
}
namespace(name = "namespace") {
const local = this._scope.generateUidIdentifier(name);
const statement = this._statements[this._statements.length - 1];
_assert(statement.type === "ImportDeclaration");
_assert(statement.specifiers.length === 0);
statement.specifiers = [importNamespaceSpecifier(local)];
this._resultName = cloneNode(local);
return this;
}
default(name) {
const id = this._scope.generateUidIdentifier(name);
const statement = this._statements[this._statements.length - 1];
_assert(statement.type === "ImportDeclaration");
_assert(statement.specifiers.length === 0);
statement.specifiers = [importDefaultSpecifier(id)];
this._resultName = cloneNode(id);
return this;
}
named(name, importName) {
if (importName === "default") return this.default(name);
const id = this._scope.generateUidIdentifier(name);
const statement = this._statements[this._statements.length - 1];
_assert(statement.type === "ImportDeclaration");
_assert(statement.specifiers.length === 0);
statement.specifiers = [importSpecifier(id, identifier(importName))];
this._resultName = cloneNode(id);
return this;
}
var(name) {
const id = this._scope.generateUidIdentifier(name);
let statement = this._statements[this._statements.length - 1];
if (statement.type !== "ExpressionStatement") {
_assert(this._resultName);
statement = expressionStatement(this._resultName);
this._statements.push(statement);
}
this._statements[this._statements.length - 1] = variableDeclaration("var", [variableDeclarator(id, statement.expression)]);
this._resultName = cloneNode(id);
return this;
}
defaultInterop() {
return this._interop(this._hub.addHelper("interopRequireDefault"));
}
wildcardInterop() {
return this._interop(this._hub.addHelper("interopRequireWildcard"));
}
_interop(callee) {
const statement = this._statements[this._statements.length - 1];
if (statement.type === "ExpressionStatement") {
statement.expression = callExpression(callee, [statement.expression]);
} else if (statement.type === "VariableDeclaration") {
_assert(statement.declarations.length === 1);
statement.declarations[0].init = callExpression(callee, [statement.declarations[0].init]);
} else {
_assert.fail("Unexpected type.");
}
return this;
}
prop(name) {
const statement = this._statements[this._statements.length - 1];
if (statement.type === "ExpressionStatement") {
statement.expression = memberExpression(statement.expression, identifier(name));
} else if (statement.type === "VariableDeclaration") {
_assert(statement.declarations.length === 1);
statement.declarations[0].init = memberExpression(statement.declarations[0].init, identifier(name));
} else {
_assert.fail("Unexpected type:" + statement.type);
}
return this;
}
read(name) {
this._resultName = memberExpression(this._resultName, identifier(name));
}
}
exports.default = ImportBuilder;
//# sourceMappingURL=import-builder.js.map
@@ -0,0 +1 @@
{"version":3,"file":"store.cjs","sources":["../../src/store.ts"],"sourcesContent":["import { createAtom, toObserver } from './atom'\nimport type { Atom, Observer, Subscription } from './types'\n\nexport class Store<T> {\n private atom: Atom<T>\n constructor(getValue: (prev?: NoInfer<T>) => T)\n constructor(initialValue: T)\n constructor(valueOrFn: T | ((prev?: T) => T)) {\n // createAtom has overloads that return ReadonlyAtom<T> for functions and Atom<T> for values\n // Store always needs Atom<T> for setState, so we assert the return type\n this.atom = createAtom(\n valueOrFn as T | ((prev?: NoInfer<T>) => T),\n ) as Atom<T>\n }\n public setState(updater: (prev: T) => T) {\n this.atom.set(updater)\n }\n public get state() {\n return this.atom.get()\n }\n public get() {\n return this.state\n }\n public subscribe(\n observerOrFn: Observer<T> | ((value: T) => void),\n ): Subscription {\n return this.atom.subscribe(toObserver(observerOrFn))\n }\n}\n\nexport class ReadonlyStore<T> implements Omit<Store<T>, 'setState'> {\n private atom: Atom<T>\n constructor(getValue: (prev?: NoInfer<T>) => T)\n constructor(initialValue: T)\n constructor(valueOrFn: T | ((prev?: T) => T)) {\n // createAtom has overloads that return ReadonlyAtom<T> for functions and Atom<T> for values\n // Store always needs Atom<T> for setState, so we assert the return type\n this.atom = createAtom(\n valueOrFn as T | ((prev?: NoInfer<T>) => T),\n ) as Atom<T>\n }\n public get state() {\n return this.atom.get()\n }\n public get() {\n return this.state\n }\n public subscribe(\n observerOrFn: Observer<T> | ((value: T) => void),\n ): Subscription {\n return this.atom.subscribe(toObserver(observerOrFn))\n }\n}\n\nexport function createStore<T>(\n getValue: (prev?: NoInfer<T>) => T,\n): ReadonlyStore<T>\nexport function createStore<T>(initialValue: T): Store<T>\nexport function createStore<T>(\n valueOrFn: T | ((prev?: T) => T),\n): Store<T> | ReadonlyStore<T> {\n if (typeof valueOrFn === 'function') {\n return new ReadonlyStore(valueOrFn as (prev?: NoInfer<T>) => T)\n }\n return new Store(valueOrFn)\n}\n"],"names":["createAtom","toObserver"],"mappings":";;;AAGO,MAAM,MAAS;AAAA,EAIpB,YAAY,WAAkC;AAG5C,SAAK,OAAOA,KAAAA;AAAAA,MACV;AAAA,IAAA;AAAA,EAEJ;AAAA,EACO,SAAS,SAAyB;AACvC,SAAK,KAAK,IAAI,OAAO;AAAA,EACvB;AAAA,EACA,IAAW,QAAQ;AACjB,WAAO,KAAK,KAAK,IAAA;AAAA,EACnB;AAAA,EACO,MAAM;AACX,WAAO,KAAK;AAAA,EACd;AAAA,EACO,UACL,cACc;AACd,WAAO,KAAK,KAAK,UAAUC,KAAAA,WAAW,YAAY,CAAC;AAAA,EACrD;AACF;AAEO,MAAM,cAAuD;AAAA,EAIlE,YAAY,WAAkC;AAG5C,SAAK,OAAOD,KAAAA;AAAAA,MACV;AAAA,IAAA;AAAA,EAEJ;AAAA,EACA,IAAW,QAAQ;AACjB,WAAO,KAAK,KAAK,IAAA;AAAA,EACnB;AAAA,EACO,MAAM;AACX,WAAO,KAAK;AAAA,EACd;AAAA,EACO,UACL,cACc;AACd,WAAO,KAAK,KAAK,UAAUC,KAAAA,WAAW,YAAY,CAAC;AAAA,EACrD;AACF;AAMO,SAAS,YACd,WAC6B;AAC7B,MAAI,OAAO,cAAc,YAAY;AACnC,WAAO,IAAI,cAAc,SAAqC;AAAA,EAChE;AACA,SAAO,IAAI,MAAM,SAAS;AAC5B;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"alarm-clock.js","sources":["../../../src/icons/alarm-clock.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name AlarmClock\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEzIiByPSI4IiAvPgogIDxwYXRoIGQ9Ik0xMiA5djRsMiAyIiAvPgogIDxwYXRoIGQ9Ik01IDMgMiA2IiAvPgogIDxwYXRoIGQ9Im0yMiA2LTMtMyIgLz4KICA8cGF0aCBkPSJNNi4zOCAxOC43IDQgMjEiIC8+CiAgPHBhdGggZD0iTTE3LjY0IDE4LjY3IDIwIDIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/alarm-clock\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 AlarmClock = createLucideIcon('AlarmClock', [\n ['circle', { cx: '12', cy: '13', r: '8', key: '3y4lt7' }],\n ['path', { d: 'M12 9v4l2 2', key: '1c63tq' }],\n ['path', { d: 'M5 3 2 6', key: '18tl5t' }],\n ['path', { d: 'm22 6-3-3', key: '1opdir' }],\n ['path', { d: 'M6.38 18.7 4 21', key: '17xu3x' }],\n ['path', { d: 'M17.64 18.67 20 21', key: 'kv2oe2' }],\n]);\n\nexport default AlarmClock;\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,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACrD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
const b=/^(?:( )+|\t+)/,d="space",h="tab";function g(e,t){const n=new Map;let i=0,s,o;for(const c of e.split(/\n/g)){if(!c)continue;let f,a,l,p,r;const y=c.match(b);if(y===null)i=0,s="";else{if(f=y[0].length,a=y[1]?d:h,t&&a===d&&f===1)continue;a!==s&&(i=0),s=a,l=1,p=0;const u=f-i;if(i=f,u===0)l=0,p=1;else{const I=u>0?u:-u;o=T(a,I)}r=n.get(o),r=r===void 0?[1,0]:[r[0]+l,r[1]+p],n.set(o,r)}}return n}function T(e,t){return(e===d?"s":"t")+String(t)}function w(e){const n=e[0]==="s"?d:h,i=Number(e.slice(1));return{type:n,amount:i}}function E(e){let t,n=0,i=0;for(const[s,[o,c]]of e)(o>n||o===n&&c>i)&&(n=o,i=c,t=s);return t}function S(e,t){return(e===d?" ":" ").repeat(t)}function _(e){if(typeof e!="string")throw new TypeError("Expected a string");let t=g(e,!0);t.size===0&&(t=g(e,!1));const n=E(t);let i,s=0,o="";return n!==void 0&&({type:i,amount:s}=w(n),o=S(i,s)),{amount:s,type:i,indent:o}}const m=Symbol.for("__confbox_fmt__"),k=/^(\s+)/,v=/(\s+)$/;function x(e,t={}){const n=t.indent===void 0&&t.preserveIndentation!==!1&&e.slice(0,t?.sampleSize||1024),i=t.preserveWhitespace===!1?void 0:{start:k.exec(e)?.[0]||"",end:v.exec(e)?.[0]||""};return{sample:n,whiteSpace:i}}function N(e,t,n){!t||typeof t!="object"||Object.defineProperty(t,m,{enumerable:!1,configurable:!0,writable:!0,value:x(e,n)})}function C(e,t){if(!e||typeof e!="object"||!(m in e))return{indent:t?.indent,whitespace:{start:"",end:""}};const n=e[m];return{indent:t?.indent||_(n.sample||"").indent,whitespace:n.whiteSpace||{start:"",end:""}}}export{C as g,N as s};
@@ -0,0 +1,70 @@
import { AnyRoute } from './route.js';
import { RouterState } from './router.js';
import { FullSearchSchema } from './routeInfo.js';
import { ParsedLocation } from './location.js';
import { AnyRedirect } from './redirect.js';
import { AnyRouteMatch } from './Matches.js';
export interface RouterReadableStore<TValue> {
get: () => TValue;
}
export interface RouterWritableStore<TValue> extends RouterReadableStore<TValue> {
set: ((updater: (prev: TValue) => TValue) => void) & ((value: TValue) => void);
}
export type RouterBatchFn = (fn: () => void) => void;
export type MutableStoreFactory = <TValue>(initialValue: TValue) => RouterWritableStore<TValue>;
export type ReadonlyStoreFactory = <TValue>(read: () => TValue) => RouterReadableStore<TValue>;
export type GetStoreConfig = (opts: {
isServer?: boolean;
}) => StoreConfig;
export type StoreConfig = {
createMutableStore: MutableStoreFactory;
createReadonlyStore: ReadonlyStoreFactory;
batch: RouterBatchFn;
init?: (stores: RouterStores<AnyRoute>) => void;
};
type MatchStore = RouterWritableStore<AnyRouteMatch> & {
routeId?: string;
};
type ReadableStore<TValue> = RouterReadableStore<TValue>;
/** SSR non-reactive createMutableStore */
export declare function createNonReactiveMutableStore<TValue>(initialValue: TValue): RouterWritableStore<TValue>;
/** SSR non-reactive createReadonlyStore */
export declare function createNonReactiveReadonlyStore<TValue>(read: () => TValue): RouterReadableStore<TValue>;
export interface RouterStores<in out TRouteTree extends AnyRoute> {
status: RouterWritableStore<RouterState<TRouteTree>['status']>;
loadedAt: RouterWritableStore<number>;
isLoading: RouterWritableStore<boolean>;
isTransitioning: RouterWritableStore<boolean>;
location: RouterWritableStore<ParsedLocation<FullSearchSchema<TRouteTree>>>;
resolvedLocation: RouterWritableStore<ParsedLocation<FullSearchSchema<TRouteTree>> | undefined>;
statusCode: RouterWritableStore<number>;
redirect: RouterWritableStore<AnyRedirect | undefined>;
matchesId: RouterWritableStore<Array<string>>;
pendingIds: RouterWritableStore<Array<string>>;
matches: ReadableStore<Array<AnyRouteMatch>>;
pendingMatches: ReadableStore<Array<AnyRouteMatch>>;
cachedMatches: ReadableStore<Array<AnyRouteMatch>>;
firstId: ReadableStore<string | undefined>;
hasPending: ReadableStore<boolean>;
matchRouteDeps: ReadableStore<{
locationHref: string;
resolvedLocationHref: string | undefined;
status: RouterState<TRouteTree>['status'];
}>;
__store: RouterReadableStore<RouterState<TRouteTree>>;
matchStores: Map<string, MatchStore>;
pendingMatchStores: Map<string, MatchStore>;
cachedMatchStores: Map<string, MatchStore>;
/**
* Get a computed store that resolves a routeId to its current match state.
* Returns the same cached store instance for repeated calls with the same key.
* The computed depends on matchesId + the individual match store, so
* subscribers are only notified when the resolved match state changes.
*/
getRouteMatchStore: (routeId: string) => RouterReadableStore<AnyRouteMatch | undefined>;
setMatches: (nextMatches: Array<AnyRouteMatch>) => void;
setPending: (nextMatches: Array<AnyRouteMatch>) => void;
setCached: (nextMatches: Array<AnyRouteMatch>) => void;
}
export declare function createRouterStores<TRouteTree extends AnyRoute>(initialState: RouterState<TRouteTree>, config: StoreConfig): RouterStores<TRouteTree>;
export {};
@@ -0,0 +1,6 @@
{
"private": true,
"types": "../dist/mini.d.ts",
"main": "../dist/cjs/mini.js",
"module": "../dist/es/mini.mjs"
}
@@ -0,0 +1,3 @@
import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/utils';
import type { RuleContext } from '@typescript-eslint/utils/ts-eslint';
export declare function isPromiseAggregatorMethod(context: RuleContext<string, unknown[]>, services: ParserServicesWithTypeInformation, node: TSESTree.CallExpression): boolean;
@@ -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 Table = createLucideIcon("Table", [
["path", { d: "M12 3v18", key: "108xh3" }],
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M3 9h18", key: "1pudct" }],
["path", { d: "M3 15h18", key: "5xshup" }]
]);
export { Table as default };
//# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
{"version":3,"file":"panel-bottom-dashed.js","sources":["../../../src/icons/panel-bottom-dashed.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PanelBottomDashed\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0xNCAxNWgxIiAvPgogIDxwYXRoIGQ9Ik0xOSAxNWgyIiAvPgogIDxwYXRoIGQ9Ik0zIDE1aDIiIC8+CiAgPHBhdGggZD0iTTkgMTVoMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/panel-bottom-dashed\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst PanelBottomDashed = createLucideIcon('PanelBottomDashed', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M14 15h1', key: '171nev' }],\n ['path', { d: 'M19 15h2', key: '1vnucp' }],\n ['path', { d: 'M3 15h2', key: '8bym0q' }],\n ['path', { d: 'M9 15h1', key: '1tg3ks' }],\n]);\n\nexport default PanelBottomDashed;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,iBAAiB,mBAAqB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,92 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _types = require('../parser/tokenizer/types');
/**
* Determine information about this named import or named export specifier.
*
* This syntax is the `a` from statements like these:
* import {A} from "./foo";
* export {A};
* export {A} from "./foo";
*
* As it turns out, we can exactly characterize the syntax meaning by simply
* counting the number of tokens, which can be from 1 to 4:
* {A}
* {type A}
* {A as B}
* {type A as B}
*
* In the type case, we never actually need the names in practice, so don't get
* them.
*
* TODO: There's some redundancy with the type detection here and the isType
* flag that's already present on tokens in TS mode. This function could
* potentially be simplified and/or pushed to the call sites to avoid the object
* allocation.
*/
function getImportExportSpecifierInfo(
tokens,
index = tokens.currentIndex(),
) {
let endIndex = index + 1;
if (isSpecifierEnd(tokens, endIndex)) {
// import {A}
const name = tokens.identifierNameAtIndex(index);
return {
isType: false,
leftName: name,
rightName: name,
endIndex,
};
}
endIndex++;
if (isSpecifierEnd(tokens, endIndex)) {
// import {type A}
return {
isType: true,
leftName: null,
rightName: null,
endIndex,
};
}
endIndex++;
if (isSpecifierEnd(tokens, endIndex)) {
// import {A as B}
return {
isType: false,
leftName: tokens.identifierNameAtIndex(index),
rightName: tokens.identifierNameAtIndex(index + 2),
endIndex,
};
}
endIndex++;
if (isSpecifierEnd(tokens, endIndex)) {
// import {type A as B}
return {
isType: true,
leftName: null,
rightName: null,
endIndex,
};
}
throw new Error(`Unexpected import/export specifier at ${index}`);
} exports.default = getImportExportSpecifierInfo;
function isSpecifierEnd(tokens, index) {
const token = tokens.tokens[index];
return token.type === _types.TokenType.braceR || token.type === _types.TokenType.comma;
}
@@ -0,0 +1,115 @@
import type { Implementation } from "@modelcontextprotocol/client";
import { App, AppOptions, McpUiAppCapabilities } from "../app.js";
export * from "../app.js";
/**
* Options for configuring the {@link useApp `useApp`} hook.
*
* The `autoResize` and `strict` options are forwarded to the underlying
* {@link App `App`} instance. For other {@link AppOptions `AppOptions`},
* create the `App` manually instead of using this hook.
*
* @see {@link useApp `useApp`} for the hook that uses these options
* @see {@link useAutoResize `useAutoResize`} for manual auto-resize control with custom `App` options
*/
export interface UseAppOptions extends Pick<AppOptions, "autoResize" | "strict"> {
/** App identification (name and version) */
appInfo: Implementation;
/**
* Declares what features this app supports.
*/
capabilities: McpUiAppCapabilities;
/**
* Called after {@link App `App`} is created but before connection.
*
* Use this to register request/notification handlers that need to be in place
* before the initialization handshake completes.
*
* @param app - The newly created `App` instance
*
* @example Register an event handler
* ```tsx source="./useApp.examples.tsx#useApp_registerHandler"
* useApp({
* appInfo: { name: "MyApp", version: "1.0.0" },
* capabilities: {},
* onAppCreated: (app) => {
* app.ontoolresult = (result) => {
* console.log("Tool result:", result);
* };
* },
* });
* ```
*/
onAppCreated?: (app: App) => void;
}
/**
* State returned by the {@link useApp `useApp`} hook.
*/
export interface AppState {
/** The connected {@link App `App`} instance, null during initialization */
app: App | null;
/** Whether initialization completed successfully */
isConnected: boolean;
/** Connection error if initialization failed, null otherwise */
error: Error | null;
}
/**
* React hook to create and connect an MCP App.
*
* This hook manages {@link App `App`} creation and connection. It automatically
* creates a {@link PostMessageTransport `PostMessageTransport`} to window.parent and handles
* initialization.
*
* This hook is part of the optional React integration. The core SDK (`App`,
* `PostMessageTransport`) is framework-agnostic and can be used with any UI
* framework or vanilla JavaScript.
*
* **Important**: The hook intentionally does NOT re-run when options change
* to avoid reconnection loops. Options are only used during the initial mount.
* Furthermore, the `App` instance is NOT closed on unmount. This avoids cleanup
* issues during React Strict Mode's double-mount cycle. If you need to
* explicitly close the `App`, call {@link App.close `App.close`} manually.
*
* @param options - Configuration for the app
* @returns Current connection state and app instance. If connection fails during
* initialization, the `error` field will contain the error (typically connection
* timeouts, initialization handshake failures, or transport errors).
*
* @example Basic usage of useApp hook with common event handlers
* ```tsx source="./useApp.examples.tsx#useApp_basicUsage"
* function MyApp() {
* const [hostContext, setHostContext] = useState<
* McpUiHostContext | undefined
* >(undefined);
*
* const { app, isConnected, error } = useApp({
* appInfo: { name: "MyApp", version: "1.0.0" },
* capabilities: {},
* onAppCreated: (app) => {
* app.ontoolinput = (input) => {
* console.log("Tool input:", input);
* };
* app.ontoolresult = (result) => {
* console.log("Tool result:", result);
* };
* app.ontoolcancelled = (params) => {
* console.log("Tool cancelled:", params.reason);
* };
* app.onerror = (error) => {
* console.log("Error:", error);
* };
* app.onhostcontextchanged = (ctx) => {
* setHostContext((prev) => ({ ...prev, ...ctx }));
* };
* },
* });
*
* if (error) return <div>Error: {error.message}</div>;
* if (!isConnected) return <div>Connecting...</div>;
* return <div>Theme: {hostContext?.theme}</div>;
* }
* ```
*
* @see {@link App.connect `App.connect`} for the underlying connection method
* @see {@link useAutoResize `useAutoResize`} for manual auto-resize control when using custom App options
*/
export declare function useApp({ appInfo, capabilities, onAppCreated, autoResize, strict, }: UseAppOptions): AppState;
@@ -0,0 +1 @@
{"version":3,"file":"codesandbox.js","sources":["../../../src/icons/codesandbox.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Codesandbox\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTZWOGEyIDIgMCAwIDAtMS0xLjczbC03LTRhMiAyIDAgMCAwLTIgMGwtNyA0QTIgMiAwIDAgMCAzIDh2OGEyIDIgMCAwIDAgMSAxLjczbDcgNGEyIDIgMCAwIDAgMiAwbDctNEEyIDIgMCAwIDAgMjEgMTZ6IiAvPgogIDxwb2x5bGluZSBwb2ludHM9IjcuNSA0LjIxIDEyIDYuODEgMTYuNSA0LjIxIiAvPgogIDxwb2x5bGluZSBwb2ludHM9IjcuNSAxOS43OSA3LjUgMTQuNiAzIDEyIiAvPgogIDxwb2x5bGluZSBwb2ludHM9IjIxIDEyIDE2LjUgMTQuNiAxNi41IDE5Ljc5IiAvPgogIDxwb2x5bGluZSBwb2ludHM9IjMuMjcgNi45NiAxMiAxMi4wMSAyMC43MyA2Ljk2IiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMjIuMDgiIHkyPSIxMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/codesandbox\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 * @deprecated Brand icons have been deprecated and are due to be removed, please refer to https://github.com/lucide-icons/lucide/issues/670. We recommend using https://simpleicons.org/?q=codesandbox instead. This icon will be removed in v1.0\n */\nconst Codesandbox = createLucideIcon('Codesandbox', [\n [\n 'path',\n {\n d: 'M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z',\n key: 'yt0hxn',\n },\n ],\n ['polyline', { points: '7.5 4.21 12 6.81 16.5 4.21', key: 'fabo96' }],\n ['polyline', { points: '7.5 19.79 7.5 14.6 3 12', key: 'z377f1' }],\n ['polyline', { points: '21 12 16.5 14.6 16.5 19.79', key: '9nrev1' }],\n ['polyline', { points: '3.27 6.96 12 12.01 20.73 6.96', key: '1180pa' }],\n ['line', { x1: '12', x2: '12', y1: '22.08', y2: '12', key: '3z3uq6' }],\n]);\n\nexport default Codesandbox;\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,48 @@
/* auto-generated by NAPI-RS */
/* eslint-disable */
export declare class Scanner {
constructor(opts: ScannerOptions)
scan(): Array<string>
scanFiles(input: Array<ChangedContent>): Array<string>
getCandidatesWithPositions(input: ChangedContent): Array<CandidateWithPosition>
get files(): Array<string>
get globs(): Array<GlobEntry>
get normalizedSources(): Array<GlobEntry>
}
export interface CandidateWithPosition {
/** The candidate string */
candidate: string
/** The position of the candidate inside the content file */
position: number
}
export interface ChangedContent {
/** File path to the changed file */
file?: string
/** Contents of the changed file */
content?: string
/** File extension */
extension: string
}
export interface GlobEntry {
/** Base path of the glob */
base: string
/** Glob pattern */
pattern: string
}
export interface ScannerOptions {
/** Glob sources */
sources?: Array<SourceEntry>
}
export interface SourceEntry {
/** Base path of the glob */
base: string
/** Glob pattern */
pattern: string
/** Negated flag */
negated: boolean
}
@@ -0,0 +1,33 @@
/* c8 ignore start */
// duplicated from transform-file so we do not have to import anything here
type TransformFile = {
(filename: string, callback: (error: Error, file: null) => void): void;
(
filename: string,
opts: any,
callback: (error: Error, file: null) => void,
): void;
};
export const transformFile: TransformFile = function transformFile(
filename,
opts,
callback?: (error: Error, file: null) => void,
) {
if (typeof opts === "function") {
callback = opts;
}
callback(new Error("Transforming files is not supported in browsers"), null);
};
export function transformFileSync(): never {
throw new Error("Transforming files is not supported in browsers");
}
export function transformFileAsync() {
return Promise.reject(
new Error("Transforming files is not supported in browsers"),
);
}
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './chart-candlestick.js';
//# sourceMappingURL=candlestick-chart.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_newArrowCheck","innerThis","boundThis","TypeError"],"sources":["../../src/helpers/newArrowCheck.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _newArrowCheck(innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError(\"Cannot instantiate an arrow function\");\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,cAAcA,CAACC,SAAS,EAAEC,SAAS,EAAE;EAC3D,IAAID,SAAS,KAAKC,SAAS,EAAE;IAC3B,MAAM,IAAIC,SAAS,CAAC,sCAAsC,CAAC;EAC7D;AACF","ignoreList":[]}
@@ -0,0 +1 @@
{"version":3,"file":"ucs2length.js","sourceRoot":"","sources":["../../lib/runtime/ucs2length.ts"],"names":[],"mappings":";;AAAA,qDAAqD;AACrD,iEAAiE;AACjE,SAAwB,UAAU,CAAC,GAAW;IAC5C,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAA;IACtB,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,IAAI,GAAG,GAAG,CAAC,CAAA;IACX,IAAI,KAAa,CAAA;IACjB,OAAO,GAAG,GAAG,GAAG,EAAE,CAAC;QACjB,MAAM,EAAE,CAAA;QACR,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAA;QAC7B,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;YACpD,gDAAgD;YAChD,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YAC3B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,MAAM;gBAAE,GAAG,EAAE,CAAA,CAAC,gBAAgB;QACzD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAfD,6BAeC;AAED,UAAU,CAAC,IAAI,GAAG,gDAAgD,CAAA"}
@@ -0,0 +1,69 @@
{
"name": "@jridgewell/resolve-uri",
"version": "3.1.2",
"description": "Resolve a URI relative to an optional base URI",
"keywords": [
"resolve",
"uri",
"url",
"path"
],
"author": "Justin Ridgewell <justin@ridgewell.name>",
"license": "MIT",
"repository": "https://github.com/jridgewell/resolve-uri",
"main": "dist/resolve-uri.umd.js",
"module": "dist/resolve-uri.mjs",
"types": "dist/types/resolve-uri.d.ts",
"exports": {
".": [
{
"types": "./dist/types/resolve-uri.d.ts",
"browser": "./dist/resolve-uri.umd.js",
"require": "./dist/resolve-uri.umd.js",
"import": "./dist/resolve-uri.mjs"
},
"./dist/resolve-uri.umd.js"
],
"./package.json": "./package.json"
},
"files": [
"dist"
],
"engines": {
"node": ">=6.0.0"
},
"scripts": {
"prebuild": "rm -rf dist",
"build": "run-s -n build:*",
"build:rollup": "rollup -c rollup.config.js",
"build:ts": "tsc --project tsconfig.build.json",
"lint": "run-s -n lint:*",
"lint:prettier": "npm run test:lint:prettier -- --write",
"lint:ts": "npm run test:lint:ts -- --fix",
"pretest": "run-s build:rollup",
"test": "run-s -n test:lint test:only",
"test:debug": "mocha --inspect-brk",
"test:lint": "run-s -n test:lint:*",
"test:lint:prettier": "prettier --check '{src,test}/**/*.ts'",
"test:lint:ts": "eslint '{src,test}/**/*.ts'",
"test:only": "mocha",
"test:coverage": "c8 mocha",
"test:watch": "mocha --watch",
"prepublishOnly": "npm run preversion",
"preversion": "run-s test build"
},
"devDependencies": {
"@jridgewell/resolve-uri-latest": "npm:@jridgewell/resolve-uri@*",
"@rollup/plugin-typescript": "8.3.0",
"@typescript-eslint/eslint-plugin": "5.10.0",
"@typescript-eslint/parser": "5.10.0",
"c8": "7.11.0",
"eslint": "8.7.0",
"eslint-config-prettier": "8.3.0",
"mocha": "9.2.0",
"npm-run-all": "4.1.5",
"prettier": "2.5.1",
"rollup": "2.66.0",
"typescript": "4.5.5"
}
}
@@ -0,0 +1,98 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}
{{## def.validateItems:startFrom:
for (var {{=$idx}} = {{=startFrom}}; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) {
{{
$it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
var $passData = $data + '[' + $idx + ']';
$it.dataPathArr[$dataNxt] = $idx;
}}
{{# def.generateSubschemaCode }}
{{# def.optimizeValidate }}
{{? $breakOnError }}
if (!{{=$nextValid}}) break;
{{?}}
}
#}}
{{
var $idx = 'i' + $lvl
, $dataNxt = $it.dataLevel = it.dataLevel + 1
, $nextData = 'data' + $dataNxt
, $currentBaseId = it.baseId;
}}
var {{=$errs}} = errors;
var {{=$valid}};
{{? Array.isArray($schema) }}
{{ /* 'items' is an array of schemas */}}
{{ var $additionalItems = it.schema.additionalItems; }}
{{? $additionalItems === false }}
{{=$valid}} = {{=$data}}.length <= {{= $schema.length }};
{{
var $currErrSchemaPath = $errSchemaPath;
$errSchemaPath = it.errSchemaPath + '/additionalItems';
}}
{{# def.checkError:'additionalItems' }}
{{ $errSchemaPath = $currErrSchemaPath; }}
{{# def.elseIfValid}}
{{?}}
{{~ $schema:$sch:$i }}
{{? {{# def.nonEmptySchema:$sch }} }}
{{=$nextValid}} = true;
if ({{=$data}}.length > {{=$i}}) {
{{
var $passData = $data + '[' + $i + ']';
$it.schema = $sch;
$it.schemaPath = $schemaPath + '[' + $i + ']';
$it.errSchemaPath = $errSchemaPath + '/' + $i;
$it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);
$it.dataPathArr[$dataNxt] = $i;
}}
{{# def.generateSubschemaCode }}
{{# def.optimizeValidate }}
}
{{# def.ifResultValid }}
{{?}}
{{~}}
{{? typeof $additionalItems == 'object' && {{# def.nonEmptySchema:$additionalItems }} }}
{{
$it.schema = $additionalItems;
$it.schemaPath = it.schemaPath + '.additionalItems';
$it.errSchemaPath = it.errSchemaPath + '/additionalItems';
}}
{{=$nextValid}} = true;
if ({{=$data}}.length > {{= $schema.length }}) {
{{# def.validateItems: $schema.length }}
}
{{# def.ifResultValid }}
{{?}}
{{?? {{# def.nonEmptySchema:$schema }} }}
{{ /* 'items' is a single schema */}}
{{
$it.schema = $schema;
$it.schemaPath = $schemaPath;
$it.errSchemaPath = $errSchemaPath;
}}
{{# def.validateItems: 0 }}
{{?}}
{{? $breakOnError }}
{{= $closingBraces }}
if ({{=$errs}} == errors) {
{{?}}
@@ -0,0 +1 @@
{"version":3,"file":"power-square.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,7 @@
export { Address4 } from './ipv4';
export { Address6 } from './ipv6';
export { AddressError } from './address-error';
import * as helpers from './v6/helpers';
export declare const v6: {
helpers: typeof helpers;
};
@@ -0,0 +1,607 @@
/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex" }] */
'use strict';
const { Duplex } = require('stream');
const { randomFillSync } = require('crypto');
const {
types: { isUint8Array }
} = require('util');
const PerMessageDeflate = require('./permessage-deflate');
const { EMPTY_BUFFER, kWebSocket, NOOP } = require('./constants');
const { isBlob, isValidStatusCode } = require('./validation');
const { mask: applyMask, toBuffer } = require('./buffer-util');
const kByteLength = Symbol('kByteLength');
const maskBuffer = Buffer.alloc(4);
const RANDOM_POOL_SIZE = 8 * 1024;
let randomPool;
let randomPoolPointer = RANDOM_POOL_SIZE;
const DEFAULT = 0;
const DEFLATING = 1;
const GET_BLOB_DATA = 2;
/**
* HyBi Sender implementation.
*/
class Sender {
/**
* Creates a Sender instance.
*
* @param {Duplex} socket The connection socket
* @param {Object} [extensions] An object containing the negotiated extensions
* @param {Function} [generateMask] The function used to generate the masking
* key
*/
constructor(socket, extensions, generateMask) {
this._extensions = extensions || {};
if (generateMask) {
this._generateMask = generateMask;
this._maskBuffer = Buffer.alloc(4);
}
this._socket = socket;
this._firstFragment = true;
this._compress = false;
this._bufferedBytes = 0;
this._queue = [];
this._state = DEFAULT;
this.onerror = NOOP;
this[kWebSocket] = undefined;
}
/**
* Frames a piece of data according to the HyBi WebSocket protocol.
*
* @param {(Buffer|String)} data The data to frame
* @param {Object} options Options object
* @param {Boolean} [options.fin=false] Specifies whether or not to set the
* FIN bit
* @param {Function} [options.generateMask] The function used to generate the
* masking key
* @param {Boolean} [options.mask=false] Specifies whether or not to mask
* `data`
* @param {Buffer} [options.maskBuffer] The buffer used to store the masking
* key
* @param {Number} options.opcode The opcode
* @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
* modified
* @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
* RSV1 bit
* @return {(Buffer|String)[]} The framed data
* @public
*/
static frame(data, options) {
let mask;
let merge = false;
let offset = 2;
let skipMasking = false;
if (options.mask) {
mask = options.maskBuffer || maskBuffer;
if (options.generateMask) {
options.generateMask(mask);
} else {
if (randomPoolPointer === RANDOM_POOL_SIZE) {
/* istanbul ignore else */
if (randomPool === undefined) {
//
// This is lazily initialized because server-sent frames must not
// be masked so it may never be used.
//
randomPool = Buffer.alloc(RANDOM_POOL_SIZE);
}
randomFillSync(randomPool, 0, RANDOM_POOL_SIZE);
randomPoolPointer = 0;
}
mask[0] = randomPool[randomPoolPointer++];
mask[1] = randomPool[randomPoolPointer++];
mask[2] = randomPool[randomPoolPointer++];
mask[3] = randomPool[randomPoolPointer++];
}
skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0;
offset = 6;
}
let dataLength;
if (typeof data === 'string') {
if (
(!options.mask || skipMasking) &&
options[kByteLength] !== undefined
) {
dataLength = options[kByteLength];
} else {
data = Buffer.from(data);
dataLength = data.length;
}
} else {
dataLength = data.length;
merge = options.mask && options.readOnly && !skipMasking;
}
let payloadLength = dataLength;
if (dataLength >= 65536) {
offset += 8;
payloadLength = 127;
} else if (dataLength > 125) {
offset += 2;
payloadLength = 126;
}
const target = Buffer.allocUnsafe(merge ? dataLength + offset : offset);
target[0] = options.fin ? options.opcode | 0x80 : options.opcode;
if (options.rsv1) target[0] |= 0x40;
target[1] = payloadLength;
if (payloadLength === 126) {
target.writeUInt16BE(dataLength, 2);
} else if (payloadLength === 127) {
target[2] = target[3] = 0;
target.writeUIntBE(dataLength, 4, 6);
}
if (!options.mask) return [target, data];
target[1] |= 0x80;
target[offset - 4] = mask[0];
target[offset - 3] = mask[1];
target[offset - 2] = mask[2];
target[offset - 1] = mask[3];
if (skipMasking) return [target, data];
if (merge) {
applyMask(data, mask, target, offset, dataLength);
return [target];
}
applyMask(data, mask, data, 0, dataLength);
return [target, data];
}
/**
* Sends a close message to the other peer.
*
* @param {Number} [code] The status code component of the body
* @param {(String|Buffer)} [data] The message component of the body
* @param {Boolean} [mask=false] Specifies whether or not to mask the message
* @param {Function} [cb] Callback
* @public
*/
close(code, data, mask, cb) {
let buf;
if (code === undefined) {
buf = EMPTY_BUFFER;
} else if (typeof code !== 'number' || !isValidStatusCode(code)) {
throw new TypeError('First argument must be a valid error code number');
} else if (data === undefined || !data.length) {
buf = Buffer.allocUnsafe(2);
buf.writeUInt16BE(code, 0);
} else {
const length = Buffer.byteLength(data);
if (length > 123) {
throw new RangeError('The message must not be greater than 123 bytes');
}
buf = Buffer.allocUnsafe(2 + length);
buf.writeUInt16BE(code, 0);
if (typeof data === 'string') {
buf.write(data, 2);
} else if (isUint8Array(data)) {
buf.set(data, 2);
} else {
throw new TypeError('Second argument must be a string or a Uint8Array');
}
}
const options = {
[kByteLength]: buf.length,
fin: true,
generateMask: this._generateMask,
mask,
maskBuffer: this._maskBuffer,
opcode: 0x08,
readOnly: false,
rsv1: false
};
if (this._state !== DEFAULT) {
this.enqueue([this.dispatch, buf, false, options, cb]);
} else {
this.sendFrame(Sender.frame(buf, options), cb);
}
}
/**
* Sends a ping message to the other peer.
*
* @param {*} data The message to send
* @param {Boolean} [mask=false] Specifies whether or not to mask `data`
* @param {Function} [cb] Callback
* @public
*/
ping(data, mask, cb) {
let byteLength;
let readOnly;
if (typeof data === 'string') {
byteLength = Buffer.byteLength(data);
readOnly = false;
} else if (isBlob(data)) {
byteLength = data.size;
readOnly = false;
} else {
data = toBuffer(data);
byteLength = data.length;
readOnly = toBuffer.readOnly;
}
if (byteLength > 125) {
throw new RangeError('The data size must not be greater than 125 bytes');
}
const options = {
[kByteLength]: byteLength,
fin: true,
generateMask: this._generateMask,
mask,
maskBuffer: this._maskBuffer,
opcode: 0x09,
readOnly,
rsv1: false
};
if (isBlob(data)) {
if (this._state !== DEFAULT) {
this.enqueue([this.getBlobData, data, false, options, cb]);
} else {
this.getBlobData(data, false, options, cb);
}
} else if (this._state !== DEFAULT) {
this.enqueue([this.dispatch, data, false, options, cb]);
} else {
this.sendFrame(Sender.frame(data, options), cb);
}
}
/**
* Sends a pong message to the other peer.
*
* @param {*} data The message to send
* @param {Boolean} [mask=false] Specifies whether or not to mask `data`
* @param {Function} [cb] Callback
* @public
*/
pong(data, mask, cb) {
let byteLength;
let readOnly;
if (typeof data === 'string') {
byteLength = Buffer.byteLength(data);
readOnly = false;
} else if (isBlob(data)) {
byteLength = data.size;
readOnly = false;
} else {
data = toBuffer(data);
byteLength = data.length;
readOnly = toBuffer.readOnly;
}
if (byteLength > 125) {
throw new RangeError('The data size must not be greater than 125 bytes');
}
const options = {
[kByteLength]: byteLength,
fin: true,
generateMask: this._generateMask,
mask,
maskBuffer: this._maskBuffer,
opcode: 0x0a,
readOnly,
rsv1: false
};
if (isBlob(data)) {
if (this._state !== DEFAULT) {
this.enqueue([this.getBlobData, data, false, options, cb]);
} else {
this.getBlobData(data, false, options, cb);
}
} else if (this._state !== DEFAULT) {
this.enqueue([this.dispatch, data, false, options, cb]);
} else {
this.sendFrame(Sender.frame(data, options), cb);
}
}
/**
* Sends a data message to the other peer.
*
* @param {*} data The message to send
* @param {Object} options Options object
* @param {Boolean} [options.binary=false] Specifies whether `data` is binary
* or text
* @param {Boolean} [options.compress=false] Specifies whether or not to
* compress `data`
* @param {Boolean} [options.fin=false] Specifies whether the fragment is the
* last one
* @param {Boolean} [options.mask=false] Specifies whether or not to mask
* `data`
* @param {Function} [cb] Callback
* @public
*/
send(data, options, cb) {
const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
let opcode = options.binary ? 2 : 1;
let rsv1 = options.compress;
let byteLength;
let readOnly;
if (typeof data === 'string') {
byteLength = Buffer.byteLength(data);
readOnly = false;
} else if (isBlob(data)) {
byteLength = data.size;
readOnly = false;
} else {
data = toBuffer(data);
byteLength = data.length;
readOnly = toBuffer.readOnly;
}
if (this._firstFragment) {
this._firstFragment = false;
if (
rsv1 &&
perMessageDeflate &&
perMessageDeflate.params[
perMessageDeflate._isServer
? 'server_no_context_takeover'
: 'client_no_context_takeover'
]
) {
rsv1 = byteLength >= perMessageDeflate._threshold;
}
this._compress = rsv1;
} else {
rsv1 = false;
opcode = 0;
}
if (options.fin) this._firstFragment = true;
const opts = {
[kByteLength]: byteLength,
fin: options.fin,
generateMask: this._generateMask,
mask: options.mask,
maskBuffer: this._maskBuffer,
opcode,
readOnly,
rsv1
};
if (isBlob(data)) {
if (this._state !== DEFAULT) {
this.enqueue([this.getBlobData, data, this._compress, opts, cb]);
} else {
this.getBlobData(data, this._compress, opts, cb);
}
} else if (this._state !== DEFAULT) {
this.enqueue([this.dispatch, data, this._compress, opts, cb]);
} else {
this.dispatch(data, this._compress, opts, cb);
}
}
/**
* Gets the contents of a blob as binary data.
*
* @param {Blob} blob The blob
* @param {Boolean} [compress=false] Specifies whether or not to compress
* the data
* @param {Object} options Options object
* @param {Boolean} [options.fin=false] Specifies whether or not to set the
* FIN bit
* @param {Function} [options.generateMask] The function used to generate the
* masking key
* @param {Boolean} [options.mask=false] Specifies whether or not to mask
* `data`
* @param {Buffer} [options.maskBuffer] The buffer used to store the masking
* key
* @param {Number} options.opcode The opcode
* @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
* modified
* @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
* RSV1 bit
* @param {Function} [cb] Callback
* @private
*/
getBlobData(blob, compress, options, cb) {
this._bufferedBytes += options[kByteLength];
this._state = GET_BLOB_DATA;
blob
.arrayBuffer()
.then((arrayBuffer) => {
if (this._socket.destroyed) {
const err = new Error(
'The socket was closed while the blob was being read'
);
//
// `callCallbacks` is called in the next tick to ensure that errors
// that might be thrown in the callbacks behave like errors thrown
// outside the promise chain.
//
process.nextTick(callCallbacks, this, err, cb);
return;
}
this._bufferedBytes -= options[kByteLength];
const data = toBuffer(arrayBuffer);
if (!compress) {
this._state = DEFAULT;
this.sendFrame(Sender.frame(data, options), cb);
this.dequeue();
} else {
this.dispatch(data, compress, options, cb);
}
})
.catch((err) => {
//
// `onError` is called in the next tick for the same reason that
// `callCallbacks` above is.
//
process.nextTick(onError, this, err, cb);
});
}
/**
* Dispatches a message.
*
* @param {(Buffer|String)} data The message to send
* @param {Boolean} [compress=false] Specifies whether or not to compress
* `data`
* @param {Object} options Options object
* @param {Boolean} [options.fin=false] Specifies whether or not to set the
* FIN bit
* @param {Function} [options.generateMask] The function used to generate the
* masking key
* @param {Boolean} [options.mask=false] Specifies whether or not to mask
* `data`
* @param {Buffer} [options.maskBuffer] The buffer used to store the masking
* key
* @param {Number} options.opcode The opcode
* @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
* modified
* @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
* RSV1 bit
* @param {Function} [cb] Callback
* @private
*/
dispatch(data, compress, options, cb) {
if (!compress) {
this.sendFrame(Sender.frame(data, options), cb);
return;
}
const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
this._bufferedBytes += options[kByteLength];
this._state = DEFLATING;
perMessageDeflate.compress(data, options.fin, (_, buf) => {
if (this._socket.destroyed) {
const err = new Error(
'The socket was closed while data was being compressed'
);
callCallbacks(this, err, cb);
return;
}
this._bufferedBytes -= options[kByteLength];
this._state = DEFAULT;
options.readOnly = false;
this.sendFrame(Sender.frame(buf, options), cb);
this.dequeue();
});
}
/**
* Executes queued send operations.
*
* @private
*/
dequeue() {
while (this._state === DEFAULT && this._queue.length) {
const params = this._queue.shift();
this._bufferedBytes -= params[3][kByteLength];
Reflect.apply(params[0], this, params.slice(1));
}
}
/**
* Enqueues a send operation.
*
* @param {Array} params Send operation parameters.
* @private
*/
enqueue(params) {
this._bufferedBytes += params[3][kByteLength];
this._queue.push(params);
}
/**
* Sends a frame.
*
* @param {(Buffer | String)[]} list The frame to send
* @param {Function} [cb] Callback
* @private
*/
sendFrame(list, cb) {
if (list.length === 2) {
this._socket.cork();
this._socket.write(list[0]);
this._socket.write(list[1], cb);
this._socket.uncork();
} else {
this._socket.write(list[0], cb);
}
}
}
module.exports = Sender;
/**
* Calls queued callbacks with an error.
*
* @param {Sender} sender The `Sender` instance
* @param {Error} err The error to call the callbacks with
* @param {Function} [cb] The first callback
* @private
*/
function callCallbacks(sender, err, cb) {
if (typeof cb === 'function') cb(err);
for (let i = 0; i < sender._queue.length; i++) {
const params = sender._queue[i];
const callback = params[params.length - 1];
if (typeof callback === 'function') callback(err);
}
}
/**
* Handles a `Sender` error.
*
* @param {Sender} sender The `Sender` instance
* @param {Error} err The error
* @param {Function} [cb] The first pending callback
* @private
*/
function onError(sender, err, cb) {
callCallbacks(sender, err, cb);
sender.onerror(err);
}
@@ -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 PanelBottomOpen = createLucideIcon("PanelBottomOpen", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M3 15h18", key: "5xshup" }],
["path", { d: "m9 10 3-3 3 3", key: "11gsxs" }]
]);
export { PanelBottomOpen as default };
//# sourceMappingURL=panel-bottom-open.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../src/util/location.ts","../src/parse-error/module-errors.ts","../src/parse-error/to-node-description.ts","../src/parse-error/standard-errors.ts","../src/parse-error/strict-mode-errors.ts","../src/parse-error/parse-expression-errors.ts","../src/parse-error/pipeline-operator-errors.ts","../src/parse-error.ts","../src/options.ts","../src/plugins/estree.ts","../src/tokenizer/context.ts","../src/tokenizer/types.ts","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.ts","../src/util/scope.ts","../src/plugins/flow/scope.ts","../src/plugins/flow/index.ts","../src/plugins/jsx/xhtml.ts","../src/util/whitespace.ts","../src/plugins/jsx/index.ts","../src/plugins/typescript/scope.ts","../src/util/production-parameter.ts","../src/parser/base.ts","../src/parser/comments.ts","../src/tokenizer/state.ts","../../babel-helper-string-parser/src/index.ts","../src/tokenizer/index.ts","../src/util/class-scope.ts","../src/util/expression-scope.ts","../src/parser/util.ts","../src/parser/node.ts","../src/parser/lval.ts","../src/plugins/typescript/index.ts","../src/plugins/placeholders.ts","../src/plugins/v8intrinsic.ts","../src/plugin-utils.ts","../src/parser/expression.ts","../src/parser/statement.ts","../src/parser/index.ts","../src/index.ts"],"sourcesContent":["export type Pos = {\n start: number;\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n index: number;\n\n constructor(line: number, col: number, index: number) {\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string | undefined;\n identifierName: string | undefined | null;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // (may start as null, but initialized later)\n this.end = end!;\n }\n}\n\n/**\n * creates a new position with a non-zero column offset from the given position.\n * This function should be only be used when we create AST node out of the token\n * boundaries, such as TemplateElement ends before tt.templateNonTail. This\n * function does not skip whitespaces.\n */\nexport function createPositionWithColumnOffset(\n position: Position,\n columnOffset: number,\n) {\n const { line, column, index } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\n\nconst code = \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\";\n\nexport default {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code,\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code,\n },\n} satisfies ParseErrorTemplates;\n","const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = keyof Omit<\n typeof NodeDescriptions,\n \"UpdateExpression\"\n>;\n\ntype NodeWithDescription =\n | {\n type: \"UpdateExpression\";\n prefix: boolean;\n }\n | {\n type: NodeTypesWithDescriptions;\n };\n\nconst toNodeDescription = (node: NodeWithDescription) =>\n node.type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[`${node.prefix}`]\n : NodeDescriptions[node.type];\n\nexport default toNodeDescription;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\nimport toNodeDescription from \"./to-node-description.ts\";\n\nexport type LValAncestor =\n | { type: \"UpdateExpression\"; prefix: boolean }\n | {\n type:\n | \"ArrayPattern\"\n | \"AssignmentExpression\"\n | \"CatchClause\"\n | \"ForOfStatement\"\n | \"FormalParameters\"\n | \"ForInStatement\"\n | \"ForStatement\"\n | \"ImportSpecifier\Line truncated
@@ -0,0 +1 @@
{"version":3,"names":["toPrimitive","input","hint","prim","Symbol","undefined","res","call","TypeError","String","Number"],"sources":["../../src/helpers/toPrimitive.ts"],"sourcesContent":["/* @minVersion 7.1.5 */\n\n// https://tc39.es/ecma262/#sec-toprimitive\nexport default function toPrimitive(\n input: unknown,\n hint?: \"default\" | \"string\" | \"number\",\n) {\n if (typeof input !== \"object\" || !input) return input;\n // @ts-expect-error Symbol.toPrimitive might not index {}\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\n"],"mappings":";;;;;;AAGe,SAASA,WAAWA,CACjCC,KAAc,EACdC,IAAsC,EACtC;EACA,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,CAACA,KAAK,EAAE,OAAOA,KAAK;EAErD,IAAIE,IAAI,GAAGF,KAAK,CAACG,MAAM,CAACJ,WAAW,CAAC;EACpC,IAAIG,IAAI,KAAKE,SAAS,EAAE;IACtB,IAAIC,GAAG,GAAGH,IAAI,CAACI,IAAI,CAACN,KAAK,EAAEC,IAAI,IAAI,SAAS,CAAC;IAC7C,IAAI,OAAOI,GAAG,KAAK,QAAQ,EAAE,OAAOA,GAAG;IACvC,MAAM,IAAIE,SAAS,CAAC,8CAA8C,CAAC;EACrE;EACA,OAAO,CAACN,IAAI,KAAK,QAAQ,GAAGO,MAAM,GAAGC,MAAM,EAAET,KAAK,CAAC;AACrD","ignoreList":[]}
@@ -0,0 +1,36 @@
'use strict';
var test = require('tape');
var gOPD = require('../');
test('gOPD', function (t) {
t.test('supported', { skip: !gOPD }, function (st) {
st.equal(typeof gOPD, 'function', 'is a function');
var obj = { x: 1 };
st.ok('x' in obj, 'property exists');
// @ts-expect-error TS can't figure out narrowing from `skip`
var desc = gOPD(obj, 'x');
st.deepEqual(
desc,
{
configurable: true,
enumerable: true,
value: 1,
writable: true
},
'descriptor is as expected'
);
st.end();
});
t.test('not supported', { skip: !!gOPD }, function (st) {
st.notOk(gOPD, 'is falsy');
st.end();
});
t.end();
});
@@ -0,0 +1,70 @@
{
"name": "csstype",
"version": "3.2.3",
"main": "",
"types": "index.d.ts",
"description": "Strict TypeScript and Flow types for style based on MDN data",
"repository": "https://github.com/frenic/csstype",
"author": "Fredrik Nicol <fredrik.nicol@gmail.com>",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.28.5",
"@babel/preset-env": "^7.28.5",
"@babel/preset-typescript": "^7.28.5",
"@eslint/js": "^9.39.1",
"@mdn/browser-compat-data": "7.1.21",
"@tsconfig/node24": "^24.0.2",
"@types/chokidar": "^2.1.7",
"@types/css-tree": "^2.3.11",
"@types/jest": "^30.0.0",
"@types/jsdom": "^27.0.0",
"@types/node": "^24.10.1",
"@types/prettier": "^3.0.0",
"@types/turndown": "^5.0.6",
"babel-jest": "^30.2.0",
"chalk": "^5.6.2",
"chokidar": "^4.0.3",
"css-tree": "^3.1.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"flow-bin": "^0.291.0",
"jest": "^30.2.0",
"jsdom": "^27.2.0",
"mdn-data": "2.25.0",
"prettier": "^3.6.2",
"release-it": "^19.0.6",
"tsx": "^4.20.6",
"turndown": "^7.2.2",
"typescript": "~5.9.3",
"typescript-eslint": "^8.46.4"
},
"overrides": {
"js-yaml": ">=4.1.1"
},
"scripts": {
"prepublish": "npm install --no-save --prefix __tests__ && npm install --no-save --prefix __tests__/__fixtures__",
"release": "release-it",
"update": "tsx update.ts",
"build": "tsx --inspect build.ts --start",
"watch": "tsx build.ts --watch",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
"pretty": "prettier --write build.ts **/*.{ts,js,json,md}",
"lazy": "tsc && npm run lint",
"test": "jest --runInBand",
"test:src": "jest src.*.ts",
"test:dist": "jest dist.*.ts --runInBand"
},
"files": [
"index.d.ts",
"index.js.flow"
],
"keywords": [
"css",
"style",
"typescript",
"flow",
"typings",
"types",
"definitions"
]
}
@@ -0,0 +1,60 @@
//#region rolldown:runtime
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
var __exportAll = (all, symbols) => {
let target = {};
for (var name in all) {
__defProp(target, name, {
get: all[name],
enumerable: true
});
}
if (symbols) {
__defProp(target, Symbol.toStringTag, { value: "Module" });
}
return target;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) {
__defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
}
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
//#endregion
Object.defineProperty(exports, '__commonJSMin', {
enumerable: true,
get: function () {
return __commonJSMin;
}
});
Object.defineProperty(exports, '__exportAll', {
enumerable: true,
get: function () {
return __exportAll;
}
});
Object.defineProperty(exports, '__toESM', {
enumerable: true,
get: function () {
return __toESM;
}
});
@@ -0,0 +1 @@
{"version":3,"file":"server.cjs","names":[],"sources":["../../../src/scroll-restoration-script/server.ts"],"sourcesContent":["import minifiedScrollRestorationScript from '../scroll-restoration-inline?script-string'\nimport {\n defaultGetScrollRestorationKey,\n storageKey,\n} from '../scroll-restoration'\nimport { escapeHtml } from '../utils'\nimport type { AnyRouter } from '../router'\n\ntype InlineScrollRestorationScriptOptions = {\n storageKey: string\n key?: string\n behavior?: ScrollToOptions['behavior']\n shouldScrollRestoration?: boolean\n}\n\nconst defaultInlineScrollRestorationScript = `(${minifiedScrollRestorationScript})(${escapeHtml(\n JSON.stringify({\n storageKey,\n shouldScrollRestoration: true,\n } satisfies InlineScrollRestorationScriptOptions),\n)})`\n\nfunction getScrollRestorationScript(\n options: InlineScrollRestorationScriptOptions,\n) {\n if (\n options.storageKey === storageKey &&\n options.shouldScrollRestoration === true &&\n options.key === undefined &&\n options.behavior === undefined\n ) {\n return defaultInlineScrollRestorationScript\n }\n\n return `(${minifiedScrollRestorationScript})(${escapeHtml(JSON.stringify(options))})`\n}\n\nexport function getScrollRestorationScriptForRouter(router: AnyRouter) {\n if (\n typeof router.options.scrollRestoration === 'function' &&\n !router.options.scrollRestoration({ location: router.latestLocation })\n ) {\n return null\n }\n\n const getKey = router.options.getScrollRestorationKey\n if (!getKey) {\n return defaultInlineScrollRestorationScript\n }\n\n const location = router.latestLocation\n const userKey = getKey(location)\n const defaultKey = defaultGetScrollRestorationKey(location)\n\n if (userKey === defaultKey) {\n return defaultInlineScrollRestorationScript\n }\n\n return getScrollRestorationScript({\n storageKey,\n shouldScrollRestoration: true,\n key: userKey,\n })\n}\n"],"mappings":";;;;;AAeA,MAAM,uCAAuC,IAAI,kCAAA,QAAgC,IAAI,cAAA,WACnF,KAAK,UAAU;CACb,YAAA,2BAAA;CACA,yBAAyB;CAC1B,CAAgD,CAClD,CAAC;AAEF,SAAS,2BACP,SACA;AACA,KACE,QAAQ,eAAA,iCACR,QAAQ,4BAA4B,QACpC,QAAQ,QAAQ,KAAA,KAChB,QAAQ,aAAa,KAAA,EAErB,QAAO;AAGT,QAAO,IAAI,kCAAA,QAAgC,IAAI,cAAA,WAAW,KAAK,UAAU,QAAQ,CAAC,CAAC;;AAGrF,SAAgB,oCAAoC,QAAmB;AACrE,KACE,OAAO,OAAO,QAAQ,sBAAsB,cAC5C,CAAC,OAAO,QAAQ,kBAAkB,EAAE,UAAU,OAAO,gBAAgB,CAAC,CAEtE,QAAO;CAGT,MAAM,SAAS,OAAO,QAAQ;AAC9B,KAAI,CAAC,OACH,QAAO;CAGT,MAAM,WAAW,OAAO;CACxB,MAAM,UAAU,OAAO,SAAS;AAGhC,KAAI,YAFe,2BAAA,+BAA+B,SAAS,CAGzD,QAAO;AAGT,QAAO,2BAA2B;EAChC,YAAA,2BAAA;EACA,yBAAyB;EACzB,KAAK;EACN,CAAC"}
@@ -0,0 +1,37 @@
#ifndef BACKEND_H
#define BACKEND_H
#include "Event.hh"
#include "Watcher.hh"
#include "Signal.hh"
#include <thread>
class Backend {
public:
virtual ~Backend();
void run();
void notifyStarted();
virtual void start();
virtual void writeSnapshot(WatcherRef watcher, std::string *snapshotPath) = 0;
virtual void getEventsSince(WatcherRef watcher, std::string *snapshotPath) = 0;
virtual void subscribe(WatcherRef watcher) = 0;
virtual void unsubscribe(WatcherRef watcher) = 0;
static std::shared_ptr<Backend> getShared(std::string backend);
void watch(WatcherRef watcher);
void unwatch(WatcherRef watcher);
void unref();
void handleWatcherError(WatcherError &err);
std::mutex mMutex;
std::thread mThread;
private:
std::unordered_set<WatcherRef> mSubscriptions;
Signal mStartedSignal;
void handleError(std::exception &err);
};
#endif
@@ -0,0 +1,115 @@
export var charCodes; (function (charCodes) {
const backSpace = 8; charCodes[charCodes["backSpace"] = backSpace] = "backSpace";
const lineFeed = 10; charCodes[charCodes["lineFeed"] = lineFeed] = "lineFeed"; // '\n'
const tab = 9; charCodes[charCodes["tab"] = tab] = "tab"; // '\t'
const carriageReturn = 13; charCodes[charCodes["carriageReturn"] = carriageReturn] = "carriageReturn"; // '\r'
const shiftOut = 14; charCodes[charCodes["shiftOut"] = shiftOut] = "shiftOut";
const space = 32; charCodes[charCodes["space"] = space] = "space";
const exclamationMark = 33; charCodes[charCodes["exclamationMark"] = exclamationMark] = "exclamationMark"; // '!'
const quotationMark = 34; charCodes[charCodes["quotationMark"] = quotationMark] = "quotationMark"; // '"'
const numberSign = 35; charCodes[charCodes["numberSign"] = numberSign] = "numberSign"; // '#'
const dollarSign = 36; charCodes[charCodes["dollarSign"] = dollarSign] = "dollarSign"; // '$'
const percentSign = 37; charCodes[charCodes["percentSign"] = percentSign] = "percentSign"; // '%'
const ampersand = 38; charCodes[charCodes["ampersand"] = ampersand] = "ampersand"; // '&'
const apostrophe = 39; charCodes[charCodes["apostrophe"] = apostrophe] = "apostrophe"; // '''
const leftParenthesis = 40; charCodes[charCodes["leftParenthesis"] = leftParenthesis] = "leftParenthesis"; // '('
const rightParenthesis = 41; charCodes[charCodes["rightParenthesis"] = rightParenthesis] = "rightParenthesis"; // ')'
const asterisk = 42; charCodes[charCodes["asterisk"] = asterisk] = "asterisk"; // '*'
const plusSign = 43; charCodes[charCodes["plusSign"] = plusSign] = "plusSign"; // '+'
const comma = 44; charCodes[charCodes["comma"] = comma] = "comma"; // ','
const dash = 45; charCodes[charCodes["dash"] = dash] = "dash"; // '-'
const dot = 46; charCodes[charCodes["dot"] = dot] = "dot"; // '.'
const slash = 47; charCodes[charCodes["slash"] = slash] = "slash"; // '/'
const digit0 = 48; charCodes[charCodes["digit0"] = digit0] = "digit0"; // '0'
const digit1 = 49; charCodes[charCodes["digit1"] = digit1] = "digit1"; // '1'
const digit2 = 50; charCodes[charCodes["digit2"] = digit2] = "digit2"; // '2'
const digit3 = 51; charCodes[charCodes["digit3"] = digit3] = "digit3"; // '3'
const digit4 = 52; charCodes[charCodes["digit4"] = digit4] = "digit4"; // '4'
const digit5 = 53; charCodes[charCodes["digit5"] = digit5] = "digit5"; // '5'
const digit6 = 54; charCodes[charCodes["digit6"] = digit6] = "digit6"; // '6'
const digit7 = 55; charCodes[charCodes["digit7"] = digit7] = "digit7"; // '7'
const digit8 = 56; charCodes[charCodes["digit8"] = digit8] = "digit8"; // '8'
const digit9 = 57; charCodes[charCodes["digit9"] = digit9] = "digit9"; // '9'
const colon = 58; charCodes[charCodes["colon"] = colon] = "colon"; // ':'
const semicolon = 59; charCodes[charCodes["semicolon"] = semicolon] = "semicolon"; // ';'
const lessThan = 60; charCodes[charCodes["lessThan"] = lessThan] = "lessThan"; // '<'
const equalsTo = 61; charCodes[charCodes["equalsTo"] = equalsTo] = "equalsTo"; // '='
const greaterThan = 62; charCodes[charCodes["greaterThan"] = greaterThan] = "greaterThan"; // '>'
const questionMark = 63; charCodes[charCodes["questionMark"] = questionMark] = "questionMark"; // '?'
const atSign = 64; charCodes[charCodes["atSign"] = atSign] = "atSign"; // '@'
const uppercaseA = 65; charCodes[charCodes["uppercaseA"] = uppercaseA] = "uppercaseA"; // 'A'
const uppercaseB = 66; charCodes[charCodes["uppercaseB"] = uppercaseB] = "uppercaseB"; // 'B'
const uppercaseC = 67; charCodes[charCodes["uppercaseC"] = uppercaseC] = "uppercaseC"; // 'C'
const uppercaseD = 68; charCodes[charCodes["uppercaseD"] = uppercaseD] = "uppercaseD"; // 'D'
const uppercaseE = 69; charCodes[charCodes["uppercaseE"] = uppercaseE] = "uppercaseE"; // 'E'
const uppercaseF = 70; charCodes[charCodes["uppercaseF"] = uppercaseF] = "uppercaseF"; // 'F'
const uppercaseG = 71; charCodes[charCodes["uppercaseG"] = uppercaseG] = "uppercaseG"; // 'G'
const uppercaseH = 72; charCodes[charCodes["uppercaseH"] = uppercaseH] = "uppercaseH"; // 'H'
const uppercaseI = 73; charCodes[charCodes["uppercaseI"] = uppercaseI] = "uppercaseI"; // 'I'
const uppercaseJ = 74; charCodes[charCodes["uppercaseJ"] = uppercaseJ] = "uppercaseJ"; // 'J'
const uppercaseK = 75; charCodes[charCodes["uppercaseK"] = uppercaseK] = "uppercaseK"; // 'K'
const uppercaseL = 76; charCodes[charCodes["uppercaseL"] = uppercaseL] = "uppercaseL"; // 'L'
const uppercaseM = 77; charCodes[charCodes["uppercaseM"] = uppercaseM] = "uppercaseM"; // 'M'
const uppercaseN = 78; charCodes[charCodes["uppercaseN"] = uppercaseN] = "uppercaseN"; // 'N'
const uppercaseO = 79; charCodes[charCodes["uppercaseO"] = uppercaseO] = "uppercaseO"; // 'O'
const uppercaseP = 80; charCodes[charCodes["uppercaseP"] = uppercaseP] = "uppercaseP"; // 'P'
const uppercaseQ = 81; charCodes[charCodes["uppercaseQ"] = uppercaseQ] = "uppercaseQ"; // 'Q'
const uppercaseR = 82; charCodes[charCodes["uppercaseR"] = uppercaseR] = "uppercaseR"; // 'R'
const uppercaseS = 83; charCodes[charCodes["uppercaseS"] = uppercaseS] = "uppercaseS"; // 'S'
const uppercaseT = 84; charCodes[charCodes["uppercaseT"] = uppercaseT] = "uppercaseT"; // 'T'
const uppercaseU = 85; charCodes[charCodes["uppercaseU"] = uppercaseU] = "uppercaseU"; // 'U'
const uppercaseV = 86; charCodes[charCodes["uppercaseV"] = uppercaseV] = "uppercaseV"; // 'V'
const uppercaseW = 87; charCodes[charCodes["uppercaseW"] = uppercaseW] = "uppercaseW"; // 'W'
const uppercaseX = 88; charCodes[charCodes["uppercaseX"] = uppercaseX] = "uppercaseX"; // 'X'
const uppercaseY = 89; charCodes[charCodes["uppercaseY"] = uppercaseY] = "uppercaseY"; // 'Y'
const uppercaseZ = 90; charCodes[charCodes["uppercaseZ"] = uppercaseZ] = "uppercaseZ"; // 'Z'
const leftSquareBracket = 91; charCodes[charCodes["leftSquareBracket"] = leftSquareBracket] = "leftSquareBracket"; // '['
const backslash = 92; charCodes[charCodes["backslash"] = backslash] = "backslash"; // '\ '
const rightSquareBracket = 93; charCodes[charCodes["rightSquareBracket"] = rightSquareBracket] = "rightSquareBracket"; // ']'
const caret = 94; charCodes[charCodes["caret"] = caret] = "caret"; // '^'
const underscore = 95; charCodes[charCodes["underscore"] = underscore] = "underscore"; // '_'
const graveAccent = 96; charCodes[charCodes["graveAccent"] = graveAccent] = "graveAccent"; // '`'
const lowercaseA = 97; charCodes[charCodes["lowercaseA"] = lowercaseA] = "lowercaseA"; // 'a'
const lowercaseB = 98; charCodes[charCodes["lowercaseB"] = lowercaseB] = "lowercaseB"; // 'b'
const lowercaseC = 99; charCodes[charCodes["lowercaseC"] = lowercaseC] = "lowercaseC"; // 'c'
const lowercaseD = 100; charCodes[charCodes["lowercaseD"] = lowercaseD] = "lowercaseD"; // 'd'
const lowercaseE = 101; charCodes[charCodes["lowercaseE"] = lowercaseE] = "lowercaseE"; // 'e'
const lowercaseF = 102; charCodes[charCodes["lowercaseF"] = lowercaseF] = "lowercaseF"; // 'f'
const lowercaseG = 103; charCodes[charCodes["lowercaseG"] = lowercaseG] = "lowercaseG"; // 'g'
const lowercaseH = 104; charCodes[charCodes["lowercaseH"] = lowercaseH] = "lowercaseH"; // 'h'
const lowercaseI = 105; charCodes[charCodes["lowercaseI"] = lowercaseI] = "lowercaseI"; // 'i'
const lowercaseJ = 106; charCodes[charCodes["lowercaseJ"] = lowercaseJ] = "lowercaseJ"; // 'j'
const lowercaseK = 107; charCodes[charCodes["lowercaseK"] = lowercaseK] = "lowercaseK"; // 'k'
const lowercaseL = 108; charCodes[charCodes["lowercaseL"] = lowercaseL] = "lowercaseL"; // 'l'
const lowercaseM = 109; charCodes[charCodes["lowercaseM"] = lowercaseM] = "lowercaseM"; // 'm'
const lowercaseN = 110; charCodes[charCodes["lowercaseN"] = lowercaseN] = "lowercaseN"; // 'n'
const lowercaseO = 111; charCodes[charCodes["lowercaseO"] = lowercaseO] = "lowercaseO"; // 'o'
const lowercaseP = 112; charCodes[charCodes["lowercaseP"] = lowercaseP] = "lowercaseP"; // 'p'
const lowercaseQ = 113; charCodes[charCodes["lowercaseQ"] = lowercaseQ] = "lowercaseQ"; // 'q'
const lowercaseR = 114; charCodes[charCodes["lowercaseR"] = lowercaseR] = "lowercaseR"; // 'r'
const lowercaseS = 115; charCodes[charCodes["lowercaseS"] = lowercaseS] = "lowercaseS"; // 's'
const lowercaseT = 116; charCodes[charCodes["lowercaseT"] = lowercaseT] = "lowercaseT"; // 't'
const lowercaseU = 117; charCodes[charCodes["lowercaseU"] = lowercaseU] = "lowercaseU"; // 'u'
const lowercaseV = 118; charCodes[charCodes["lowercaseV"] = lowercaseV] = "lowercaseV"; // 'v'
const lowercaseW = 119; charCodes[charCodes["lowercaseW"] = lowercaseW] = "lowercaseW"; // 'w'
const lowercaseX = 120; charCodes[charCodes["lowercaseX"] = lowercaseX] = "lowercaseX"; // 'x'
const lowercaseY = 121; charCodes[charCodes["lowercaseY"] = lowercaseY] = "lowercaseY"; // 'y'
const lowercaseZ = 122; charCodes[charCodes["lowercaseZ"] = lowercaseZ] = "lowercaseZ"; // 'z'
const leftCurlyBrace = 123; charCodes[charCodes["leftCurlyBrace"] = leftCurlyBrace] = "leftCurlyBrace"; // '{'
const verticalBar = 124; charCodes[charCodes["verticalBar"] = verticalBar] = "verticalBar"; // '|'
const rightCurlyBrace = 125; charCodes[charCodes["rightCurlyBrace"] = rightCurlyBrace] = "rightCurlyBrace"; // '}'
const tilde = 126; charCodes[charCodes["tilde"] = tilde] = "tilde"; // '~'
const nonBreakingSpace = 160; charCodes[charCodes["nonBreakingSpace"] = nonBreakingSpace] = "nonBreakingSpace";
// eslint-disable-next-line no-irregular-whitespace
const oghamSpaceMark = 5760; charCodes[charCodes["oghamSpaceMark"] = oghamSpaceMark] = "oghamSpaceMark"; // ' '
const lineSeparator = 8232; charCodes[charCodes["lineSeparator"] = lineSeparator] = "lineSeparator";
const paragraphSeparator = 8233; charCodes[charCodes["paragraphSeparator"] = paragraphSeparator] = "paragraphSeparator";
})(charCodes || (charCodes = {}));
export function isDigit(code) {
return (
(code >= charCodes.digit0 && code <= charCodes.digit9) ||
(code >= charCodes.lowercaseA && code <= charCodes.lowercaseF) ||
(code >= charCodes.uppercaseA && code <= charCodes.uppercaseF)
);
}