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

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

No files matched your search

@@ -0,0 +1,2 @@
import type { SchemaObjCxt } from "..";
export declare function assignDefaults(it: SchemaObjCxt, ty?: string): void;
@@ -0,0 +1 @@
{"version":3,"file":"uppercase.mjs","sources":["../../../../../src/matcher/dictionary/variants/scoring/uppercase.ts"],"sourcesContent":[null],"names":["getVariations","cleanedWord","wordArray","split","upperCaseCount","filter","char","match","ONE_UPPER","length","lowerCaseCount","ONE_LOWER","variations","variationLength","Math","min","i","utils","nCk","word","replace","ALPHA_INVERTED","ALL_LOWER_INVERTED","toLowerCase","commonCases","START_UPPER","END_UPPER","ALL_UPPER_INVERTED","commonCasesLength","regex"],"mappings":";;;AAWA,MAAMA,aAAa,GAAIC,WAAmB,IAAI;AAC5C,EAAA,MAAMC,SAAS,GAAGD,WAAW,CAACE,KAAK,CAAC,EAAE,CAAC;AACvC,EAAA,MAAMC,cAAc,GAAGF,SAAS,CAACG,MAAM,CAAEC,IAAI,IAC3CA,IAAI,CAACC,KAAK,CAACC,SAAS,CAAC,CACtB,CAACC,MAAM;AACR,EAAA,MAAMC,cAAc,GAAGR,SAAS,CAACG,MAAM,CAAEC,IAAI,IAC3CA,IAAI,CAACC,KAAK,CAACI,SAAS,CAAC,CACtB,CAACF,MAAM;EAER,IAAIG,UAAU,GAAG,CAAC;EAClB,MAAMC,eAAe,GAAGC,IAAI,CAACC,GAAG,CAACX,cAAc,EAAEM,cAAc,CAAC;AAChE,EAAA,KAAK,IAAIM,CAAC,GAAG,CAAC,EAAEA,CAAC,IAAIH,eAAe,EAAEG,CAAC,IAAI,CAAC,EAAE;IAC5CJ,UAAU,IAAIK,KAAK,CAACC,GAAG,CAACd,cAAc,GAAGM,cAAc,EAAEM,CAAC,CAAC;AAC7D,EAAA;AACA,EAAA,OAAOJ,UAAU;AACnB,CAAC;AAED,uBAAgBO,IAAY,IAAI;AAC9B;EACA,MAAMlB,WAAW,GAAGkB,IAAI,CAACC,OAAO,CAACC,cAAc,EAAE,EAAE,CAAC;AACpD,EAAA,IACEpB,WAAW,CAACM,KAAK,CAACe,kBAAkB,CAAC,IACrCrB,WAAW,CAACsB,WAAW,EAAE,KAAKtB,WAAW,EACzC;AACA,IAAA,OAAO,CAAC;AACV,EAAA;AACA;AACA;AACA;EACA,MAAMuB,WAAW,GAAG,CAACC,WAAW,EAAEC,SAAS,EAAEC,kBAAkB,CAAC;AAChE,EAAA,MAAMC,iBAAiB,GAAGJ,WAAW,CAACf,MAAM;AAC5C,EAAA,KAAK,IAAIO,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGY,iBAAiB,EAAEZ,CAAC,IAAI,CAAC,EAAE;AAC7C,IAAA,MAAMa,KAAK,GAAGL,WAAW,CAACR,CAAC,CAAC;AAC5B,IAAA,IAAIf,WAAW,CAACM,KAAK,CAACsB,KAAK,CAAC,EAAE;AAC5B,MAAA,OAAO,CAAC;AACV,IAAA;AACF,EAAA;AAEA;AACA;AACA;EACA,OAAO7B,aAAa,CAACC,WAAW,CAAC;AACnC,CAAC;;;;"}
@@ -0,0 +1,33 @@
/*! *****************************************************************************
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 PromiseWithResolvers<T> {
promise: Promise<T>;
resolve: (value: T | PromiseLike<T>) => void;
reject: (reason?: any) => void;
}
interface PromiseConstructor {
/**
* Creates a new Promise and returns it in an object, along with its resolve and reject functions.
* @returns An object with the properties `promise`, `resolve`, and `reject`.
*
* ```ts
* const { promise, resolve, reject } = Promise.withResolvers<T>();
* ```
*/
withResolvers<T>(): PromiseWithResolvers<T>;
}
@@ -0,0 +1 @@
{"version":3,"file":"badge-euro.js","sources":["../../../src/icons/badge-euro.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BadgeEuro\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMy44NSA4LjYyYTQgNCAwIDAgMSA0Ljc4LTQuNzcgNCA0IDAgMCAxIDYuNzQgMCA0IDQgMCAwIDEgNC43OCA0Ljc4IDQgNCAwIDAgMSAwIDYuNzQgNCA0IDAgMCAxLTQuNzcgNC43OCA0IDQgMCAwIDEtNi43NSAwIDQgNCAwIDAgMS00Ljc4LTQuNzcgNCA0IDAgMCAxIDAtNi43NloiIC8+CiAgPHBhdGggZD0iTTcgMTJoNSIgLz4KICA8cGF0aCBkPSJNMTUgOS40YTQgNCAwIDEgMCAwIDUuMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/badge-euro\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 BadgeEuro = createLucideIcon('BadgeEuro', [\n [\n 'path',\n {\n d: 'M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z',\n key: '3c2336',\n },\n ],\n ['path', { d: 'M7 12h5', key: 'gblrwe' }],\n ['path', { d: 'M15 9.4a4 4 0 1 0 0 5.2', key: '1makmb' }],\n]);\n\nexport default BadgeEuro;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,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,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"scoring.cjs","sources":["../../../src/matcher/regex/scoring.ts"],"sourcesContent":[null],"names":["regexName","regexMatch","token","charClassBases","alphaLower","alphaUpper","alpha","alphanumeric","digits","symbols","length","Math","max","abs","parseInt","REFERENCE_YEAR","MIN_YEAR_SPACE"],"mappings":";;;;AAGA,mBAAe,CAAC;EACdA,SAAS;EACTC,UAAU;AACVC,EAAAA;AAAK,CAC0B,KAAI;AACnC,EAAA,MAAMC,cAAc,GAAG;AACrBC,IAAAA,UAAU,EAAE,EAAE;AACdC,IAAAA,UAAU,EAAE,EAAE;AACdC,IAAAA,KAAK,EAAE,EAAE;AACTC,IAAAA,YAAY,EAAE,EAAE;AAChBC,IAAAA,MAAM,EAAE,EAAE;AACVC,IAAAA,OAAO,EAAE;GACV;EACD,IAAIT,SAAS,IAAIG,cAAc,EAAE;AAC/B,IAAA,OACEA,cAAc,CAACH,SAAwC,CAAC,IAAIE,KAAK,CAACQ,MAAM;AAE5E,EAAA;AACA;AAEA,EAAA,QAAQV,SAAS;AACf,IAAA,KAAK,YAAY;AACf;AACA;MACA,OAAOW,IAAI,CAACC,GAAG,CACbD,IAAI,CAACE,GAAG,CAACC,QAAQ,CAACb,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAGc,qBAAc,CAAC,EACtDC,qBAAc,CACf;AACL;AACA,EAAA,OAAO,CAAC;AACV,CAAC;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"variant-props.mjs","sources":["../../../../src/render/utils/variant-props.ts"],"sourcesContent":["import type { AnimationType } from \"../types\"\n\nexport const variantPriorityOrder: AnimationType[] = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n]\n\nexport const variantProps = [\"initial\", ...variantPriorityOrder]\n"],"names":[],"mappings":"AAEO,MAAM,oBAAoB,GAAoB;IACjD,SAAS;IACT,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,WAAW;IACX,MAAM;;AAGH,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,GAAG,oBAAoB;;;;"}
@@ -0,0 +1,117 @@
/**
* @fileoverview Rule for disallowing require() outside of the top-level module context
* @author Jamund Ferguson
* @deprecated in ESLint v7.0.0
*/
"use strict";
const ACCEPTABLE_PARENTS = new Set([
"AssignmentExpression",
"VariableDeclarator",
"MemberExpression",
"ExpressionStatement",
"CallExpression",
"ConditionalExpression",
"Program",
"VariableDeclaration",
"ChainExpression",
]);
/**
* Finds the eslint-scope reference in the given scope.
* @param {Object} scope The scope to search.
* @param {ASTNode} node The identifier node.
* @returns {Reference|null} Returns the found reference or null if none were found.
*/
function findReference(scope, node) {
const references = scope.references.filter(
reference =>
reference.identifier.range[0] === node.range[0] &&
reference.identifier.range[1] === node.range[1],
);
if (references.length === 1) {
return references[0];
}
/* c8 ignore next */
return null;
}
/**
* Checks if the given identifier node is shadowed in the given scope.
* @param {Object} scope The current scope.
* @param {ASTNode} node The identifier node to check.
* @returns {boolean} Whether or not the name is shadowed.
*/
function isShadowed(scope, node) {
const reference = findReference(scope, node);
return (
reference && reference.resolved && reference.resolved.defs.length > 0
);
}
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Node.js rules were moved out of ESLint core.",
url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
deprecatedSince: "7.0.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"eslint-plugin-n now maintains deprecated Node.js-related rules.",
plugin: {
name: "eslint-plugin-n",
url: "https://github.com/eslint-community/eslint-plugin-n",
},
rule: {
name: "global-require",
url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/global-require.md",
},
},
],
},
type: "suggestion",
docs: {
description:
"Require `require()` calls to be placed at top-level module scope",
recommended: false,
url: "https://eslint.org/docs/latest/rules/global-require",
},
schema: [],
messages: {
unexpected: "Unexpected require().",
},
},
create(context) {
const sourceCode = context.sourceCode;
return {
CallExpression(node) {
const currentScope = sourceCode.getScope(node);
if (
node.callee.name === "require" &&
!isShadowed(currentScope, node.callee)
) {
const isGoodRequire = sourceCode
.getAncestors(node)
.every(parent => ACCEPTABLE_PARENTS.has(parent.type));
if (!isGoodRequire) {
context.report({ node, messageId: "unexpected" });
}
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"visual-element.mjs","sources":["../../../../src/animation/interfaces/visual-element.ts"],"sourcesContent":["import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport { animateVariant } from \"./visual-element-variant\"\n\nexport function animateVisualElement(\n visualElement: VisualElement,\n definition: AnimationDefinition,\n options: VisualElementAnimationOptions = {}\n) {\n visualElement.notify(\"AnimationStart\", definition)\n let animation: Promise<any>\n\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) =>\n animateVariant(visualElement, variant, options)\n )\n animation = Promise.all(animations)\n } else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options)\n } else {\n const resolvedDefinition =\n typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition\n\n animation = Promise.all(\n animateTarget(visualElement, resolvedDefinition, options)\n )\n }\n\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition)\n })\n}\n"],"names":[],"mappings":";;;;AAOM,SAAU,oBAAoB,CAChC,aAA4B,EAC5B,UAA+B,EAC/B,UAAyC,EAAE,EAAA;AAE3C,IAAA,aAAa,CAAC,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;AAClD,IAAA,IAAI,SAAuB;AAE3B,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,KACtC,cAAc,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC,CAClD;AACD,QAAA,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;IACvC;AAAO,SAAA,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QACvC,SAAS,GAAG,cAAc,CAAC,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC;IAClE;SAAO;AACH,QAAA,MAAM,kBAAkB,GACpB,OAAO,UAAU,KAAK;cAChB,cAAc,CAAC,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM;cACxD,UAAU;AAEpB,QAAA,SAAS,GAAG,OAAO,CAAC,GAAG,CACnB,aAAa,CAAC,aAAa,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAC5D;IACL;AAEA,IAAA,OAAO,SAAS,CAAC,IAAI,CAAC,MAAK;AACvB,QAAA,aAAa,CAAC,MAAM,CAAC,mBAAmB,EAAE,UAAU,CAAC;AACzD,IAAA,CAAC,CAAC;AACN;;;;"}
@@ -0,0 +1,44 @@
import { JOSENotSupported, JWEInvalid } from '../util/errors.js';
import { concat } from './buffer_utils.js';
function supported(name) {
if (typeof globalThis[name] === 'undefined') {
throw new JOSENotSupported(`JWE "zip" (Compression Algorithm) Header Parameter requires the ${name} API.`);
}
}
export async function compress(input) {
supported('CompressionStream');
const cs = new CompressionStream('deflate-raw');
const writer = cs.writable.getWriter();
writer.write(input).catch(() => { });
writer.close().catch(() => { });
const chunks = [];
const reader = cs.readable.getReader();
for (;;) {
const { value, done } = await reader.read();
if (done)
break;
chunks.push(value);
}
return concat(...chunks);
}
export async function decompress(input, maxLength) {
supported('DecompressionStream');
const ds = new DecompressionStream('deflate-raw');
const writer = ds.writable.getWriter();
writer.write(input).catch(() => { });
writer.close().catch(() => { });
const chunks = [];
let length = 0;
const reader = ds.readable.getReader();
for (;;) {
const { value, done } = await reader.read();
if (done)
break;
chunks.push(value);
length += value.byteLength;
if (maxLength !== Infinity && length > maxLength) {
throw new JWEInvalid('Decompressed plaintext exceeded the configured limit');
}
}
return concat(...chunks);
}
@@ -0,0 +1,117 @@
{
"name": "react-dom",
"version": "19.2.5",
"description": "React package for working with the DOM.",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",
"directory": "packages/react-dom"
},
"keywords": [
"react"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/facebook/react/issues"
},
"homepage": "https://react.dev/",
"dependencies": {
"scheduler": "^0.27.0"
},
"peerDependencies": {
"react": "^19.2.5"
},
"files": [
"LICENSE",
"README.md",
"client.js",
"client.react-server.js",
"index.js",
"profiling.js",
"profiling.react-server.js",
"react-dom.react-server.js",
"server.browser.js",
"server.bun.js",
"server.edge.js",
"server.js",
"server.node.js",
"server.react-server.js",
"static.browser.js",
"static.edge.js",
"static.js",
"static.node.js",
"static.react-server.js",
"test-utils.js",
"cjs/"
],
"exports": {
".": {
"react-server": "./react-dom.react-server.js",
"default": "./index.js"
},
"./client": {
"react-server": "./client.react-server.js",
"default": "./client.js"
},
"./server": {
"react-server": "./server.react-server.js",
"workerd": "./server.edge.js",
"bun": "./server.bun.js",
"deno": "./server.browser.js",
"worker": "./server.browser.js",
"node": "./server.node.js",
"edge-light": "./server.edge.js",
"browser": "./server.browser.js",
"default": "./server.node.js"
},
"./server.browser": {
"react-server": "./server.react-server.js",
"default": "./server.browser.js"
},
"./server.bun": {
"react-server": "./server.react-server.js",
"default": "./server.bun.js"
},
"./server.edge": {
"react-server": "./server.react-server.js",
"default": "./server.edge.js"
},
"./server.node": {
"react-server": "./server.react-server.js",
"default": "./server.node.js"
},
"./static": {
"react-server": "./static.react-server.js",
"workerd": "./static.edge.js",
"deno": "./static.browser.js",
"worker": "./static.browser.js",
"node": "./static.node.js",
"edge-light": "./static.edge.js",
"browser": "./static.browser.js",
"default": "./static.node.js"
},
"./static.browser": {
"react-server": "./static.react-server.js",
"default": "./static.browser.js"
},
"./static.edge": {
"react-server": "./static.react-server.js",
"default": "./static.edge.js"
},
"./static.node": {
"react-server": "./static.react-server.js",
"default": "./static.node.js"
},
"./profiling": {
"react-server": "./profiling.react-server.js",
"default": "./profiling.js"
},
"./test-utils": "./test-utils.js",
"./package.json": "./package.json"
},
"browser": {
"./server.js": "./server.browser.js",
"./static.js": "./static.browser.js"
}
}
@@ -0,0 +1,19 @@
# @babel/helper-validator-identifier
> Validate identifier/keywords name
See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/babel-helper-validator-identifier) for more information.
## Install
Using npm:
```sh
npm install --save @babel/helper-validator-identifier
```
or using yarn:
```sh
yarn add @babel/helper-validator-identifier
```
@@ -0,0 +1,823 @@
flf2a$ 8 7 20 -1 6
Katakana.flf by Vinney Thai <ssfiit@eris.cs.umb.edu> Date: August 11, 1994
based on Banner by Ryan Youck <youck@cs.uregina.ca>
a-A i-B u-C e-D o-E ka-F ki-G ku-H ke-I ko-J sa-K shi-L su-M se-N so-O ta-P
chi-Q tsu-R te-S to-T na-U ni-V nu-W ne-X no-Y ha-Z hi-a fu-b he-c ho-d ma-e
mi-f mu-g me-h mo-i ya-j yu-k e-l yo-m ra-n ri-o ru-p re-q ro-r wa-s i-t wo-u
n-v
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@@
###$@
###$@
###$@
# $@
$@
###$@
###$@
$@@
### ###$@
### ###$@
# # $@
$ $@
$ $@
$@
$@
$@@
# # $@
# # $@
#######$@
# # $@
#######$@
# # $@
# # $@
$@@
##### $@
# # #$@
# # $@
##### $@
# #$@
# # #$@
##### $@
$@@
### #$@
# # # $@
### # $@
# $@
# ###$@
# # #$@
# ###$@
$@@
## $@
# # $@
## $@
### $@
# # #$@
# # $@
### #$@
$@@
###$@
###$@
# $@
# $@
$@
$@
$@
$@@
##$@
# $@
# $@
# $@
# $@
# $@
##$@
$@@
## $@
# $@
#$@
#$@
#$@
# $@
## $@
$@@
$@
# # $@
# # $@
#######$@
# # $@
# # $@
$@
$@@
$@
# $@
# $@
#####$@
# $@
# $@
$@
$@@
$@
$@
$@
$@
###$@
###$@
# $@
# $@@
$@
$@
$@
#####$@
$@
$@
$@
$@@
$@
$@
$@
$@
###$@
###$@
###$@
$@@
#$@
# $@
# $@
# $@
# $@
# $@
# $@
$@@
### $@
# # $@
# #$@
# #$@
# #$@
# # $@
### $@
$@@
# $@
## $@
# # $@
# $@
# $@
# $@
#####$@
$@@
##### $@
# #$@
#$@
##### $@
# $@
# $@
#######$@
$@@
##### $@
# #$@
#$@
##### $@
#$@
# #$@
##### $@
$@@
# $@
# # $@
# # $@
# # $@
#######$@
# $@
# $@
$@@
#######$@
# $@
# $@
###### $@
#$@
# #$@
##### $@
$@@
##### $@
# #$@
# $@
###### $@
# #$@
# #$@
##### $@
$@@
#######$@
# # $@
# $@
# $@
# $@
# $@
# $@
$@@
##### $@
# #$@
# #$@
##### $@
# #$@
# #$@
##### $@
$@@
##### $@
# #$@
# #$@
######$@
#$@
# #$@
##### $@
$@@
# $@
###$@
# $@
$@
# $@
###$@
# $@
$@@
$@
###$@
###$@
$@
###$@
###$@
# $@
# $@@
#$@
# $@
# $@
# $@
# $@
# $@
#$@
$@@
$@
$@
#####$@
$@
#####$@
$@
$@
$@@
# $@
# $@
# $@
#$@
# $@
# $@
# $@
$@@
##### $@
# #$@
#$@
### $@
# $@
$@
# $@
$@@
##### $@
# #$@
# ### #$@
# ### #$@
# #### $@
# $@
##### $@
$@@
##########$@
### $@
# $@
# $@
# $@
# $@
# $@
$@@
##$@
## $@
## # $@
## # $@
# $@
# $@
# $@
$@@
# $@
##########$@
# #$@
## $@
## $@
## $@
## $@
$@@
$@
####### $@
# $@
# $@
# $@
# $@
##########$@
$@@
# $@
##########$@
## $@
## # $@
## # $@
## ## $@
# $@
$@@
# $@
##########$@
# #$@
# #$@
# #$@
# # # $@
# # $@
$@@
# # $@
# # $@
# # # $@
# $@
# # $@
# # $@
#$@
$@@
# $@
########$@
# #$@
# ## $@
## $@
## $@
## $@
$@@
# $@
########$@
# # $@
# # $@
# $@
# $@
# $@
$@@
$@
##########$@
#$@
#$@
#$@
#$@
######### $@
$@@
# # $@
##########$@
# # $@
# $@
# $@
# $@
# $@
$@@
# #$@
# # # $@
# # $@
## $@
## $@
## $@
## $@
$@@
########$@
#$@
# $@
## $@
## # $@
## # $@
# #$@
$@@
# $@
# $@
##########$@
# # $@
# $@
# $@
###### $@
$@@
# #$@
# #$@
# $@
# $@
## $@
## $@
## $@
$@@
# $@
#######$@
# # $@
# # # $@
### $@
## $@
## $@
$@@
## $@
###### $@
# $@
##########$@
# $@
# $@
## $@
$@@
# # #$@
# # #$@
# $@
# $@
## $@
## $@
## $@
$@@
###### $@
$@
##########$@
# $@
# $@
# $@
## $@
$@@
# $@
# $@
## $@
# # $@
# #$@
# $@
# $@
$@@
# $@
##########$@
# $@
# $@
# $@
# $@
## $@
$@@
$@
$@
###### $@
$@
$@
##########$@
$@
$@@
##########$@
#$@
# # $@
# ## $@
## $@
## # $@
## # $@
$@@
# $@
##########$@
# $@
### $@
###### $@
## # ##$@
# $@
$@@
#$@
#$@
# $@
# $@
## $@
## $@
## $@
$@@
$@
$@
# # $@
# # $@
# #$@
# $@
$@
$@@
#####$@
# $@
# $@
# $@
# $@
# $@
#####$@
$@@
# $@
# $@
# $@
# $@
# $@
# $@
#$@
$@@
#####$@
#$@
#$@
#$@
#$@
#$@
#####$@
$@@
# $@
# # $@
# #$@
$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
$@
$@
#######$@@
###$@
###$@
# $@
#$@
$@
$@
$@
$@@
# $@
# ### $@
#### $@
# $@
# $@
# $@
#######$@
$@@
########$@
#$@
#$@
# $@
## $@
## $@
## $@
$@@
$@
$@
## $@
# ## $@
# ## $@
##$@
$@
$@@
# $@
##########$@
# $@
# # # $@
# # # $@
# ## #$@
# $@
$@@
$@
##########$@
# $@
# $@
# # $@
# $@
# $@
$@@
#### $@
##$@
### $@
###$@
$@
### $@
###$@
$@@
# $@
# $@
# $@
# $@
# # $@
######### $@
#$@
$@@
#$@
# $@
# # $@
# # $@
# $@
## # $@
## # $@
$@@
###### $@
# $@
##########$@
# $@
# $@
# $@
#### $@
$@@
# ## $@
# ## # $@
### $@
# # $@
# $@
# $@
# $@
$@@
$@
###### $@
# $@
# $@
# $@
##########$@
$@
$@@
$@
###### $@
# $@
# $@
# $@
##########$@
$@
$@@
#########$@
#$@
#$@
######## $@
# $@
# $@
######## $@
$@@
###### $@
$@
##########$@
# #$@
## $@
## $@
## $@
$@@
# #$@
# #$@
# #$@
# #$@
# $@
# $@
## $@
$@@
# # $@
# # $@
# # $@
# # #$@
# # # $@
# # # $@
# ## $@
$@@
# $@
# $@
# $@
# ##$@
# ## $@
# ## $@
## $@
$@@
$@
#########$@
# #$@
# #$@
# #$@
#########$@
$@
$@@
##########$@
# #$@
# $@
# $@
# $@
## $@
## $@
$@@
# $@
####### $@
# # $@
# # $@
##########$@
# $@
# $@
$@@
##########$@
#$@
# $@
######## $@
## $@
## $@
## $@
$@@
#$@
# #$@
# # $@
# $@
## $@
## $@
## $@
$@@
$@
$@
$@
$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
$@
$@
$@@
###$@
# $@
# $@
## $@
# $@
# $@
###$@
$@@
#$@
#$@
#$@
$@
#$@
#$@
#$@
$@@
### $@
# $@
# $@
##$@
# $@
# $@
### $@
$@@
## $@
# # #$@
## $@
$@
$@
$@
$@
$@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@@ -0,0 +1,21 @@
/**
* @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 Phone = createLucideIcon("Phone", [
[
"path",
{
d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",
key: "foiqr5"
}
]
]);
export { Phone as default };
//# sourceMappingURL=phone.js.map
@@ -0,0 +1,124 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
var options_1 = require("./options");
var delay_factory_1 = require("./delay/delay.factory");
/**
* Executes a function with exponential backoff.
* @param request the function to be executed
* @param options options to customize the backoff behavior
* @returns Promise that resolves to the result of the `request` function
*/
function backOff(request, options) {
if (options === void 0) { options = {}; }
return __awaiter(this, void 0, void 0, function () {
var sanitizedOptions, backOff;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
sanitizedOptions = options_1.getSanitizedOptions(options);
backOff = new BackOff(request, sanitizedOptions);
return [4 /*yield*/, backOff.execute()];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
}
exports.backOff = backOff;
var BackOff = /** @class */ (function () {
function BackOff(request, options) {
this.request = request;
this.options = options;
this.attemptNumber = 0;
}
BackOff.prototype.execute = function () {
return __awaiter(this, void 0, void 0, function () {
var e_1, shouldRetry;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!!this.attemptLimitReached) return [3 /*break*/, 7];
_a.label = 1;
case 1:
_a.trys.push([1, 4, , 6]);
return [4 /*yield*/, this.applyDelay()];
case 2:
_a.sent();
return [4 /*yield*/, this.request()];
case 3: return [2 /*return*/, _a.sent()];
case 4:
e_1 = _a.sent();
this.attemptNumber++;
return [4 /*yield*/, this.options.retry(e_1, this.attemptNumber)];
case 5:
shouldRetry = _a.sent();
if (!shouldRetry || this.attemptLimitReached) {
throw e_1;
}
return [3 /*break*/, 6];
case 6: return [3 /*break*/, 0];
case 7: throw new Error("Something went wrong.");
}
});
});
};
Object.defineProperty(BackOff.prototype, "attemptLimitReached", {
get: function () {
return this.attemptNumber >= this.options.numOfAttempts;
},
enumerable: true,
configurable: true
});
BackOff.prototype.applyDelay = function () {
return __awaiter(this, void 0, void 0, function () {
var delay;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
delay = delay_factory_1.DelayFactory(this.options, this.attemptNumber);
return [4 /*yield*/, delay.apply()];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
};
return BackOff;
}());
//# sourceMappingURL=backoff.js.map
@@ -0,0 +1,78 @@
/**
* @fileoverview Rule to flag labels that are the same as an identifier
* @author Ian Christian Myers
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow labels that share a name with a variable",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-label-var",
},
schema: [],
messages: {
identifierClashWithLabel:
"Found identifier with same name as label.",
},
},
create(context) {
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Check if the identifier is present inside current scope
* @param {Object} scope current scope
* @param {string} name To evaluate
* @returns {boolean} True if its present
* @private
*/
function findIdentifier(scope, name) {
return astUtils.getVariableByName(scope, name) !== null;
}
//--------------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------------
return {
LabeledStatement(node) {
// Fetch the innermost scope.
const scope = sourceCode.getScope(node);
/*
* Recursively find the identifier walking up the scope, starting
* with the innermost scope.
*/
if (findIdentifier(scope, node.label.name)) {
context.report({
node,
messageId: "identifierClashWithLabel",
});
}
},
};
},
};
@@ -0,0 +1,14 @@
const require_cfWorkerProvider = require('./cfWorkerProvider-B3dvjU3F.cjs');
//#region src/shimsBrowser.ts
/**
* Whether `fetch()` may throw `TypeError` due to CORS. Only true in browser contexts
* (including Web Workers / Service Workers). In Node.js and Cloudflare Workers, a
* `TypeError` from `fetch` is always a real network/configuration error.
*/
const CORS_IS_POSSIBLE = true;
//#endregion
exports.CORS_IS_POSSIBLE = CORS_IS_POSSIBLE;
exports.DefaultJsonSchemaValidator = require_cfWorkerProvider.CfWorkerJsonSchemaValidator;
//# sourceMappingURL=shimsBrowser.cjs.map
@@ -0,0 +1,235 @@
// based on https://github.com/Ethan-Arrowood/undici-fetch/blob/249269714db874351589d2d364a0645d5160ae71/index.d.ts (MIT license)
// and https://github.com/node-fetch/node-fetch/blob/914ce6be5ec67a8bab63d68510aabf07cb818b6d/index.d.ts (MIT license)
/// <reference types="node" />
import { Blob } from 'node:buffer'
import { URL, URLSearchParams } from 'node:url'
import { ReadableStream } from 'node:stream/web'
import { FormData } from './formdata'
import { HeaderRecord } from './header'
import Dispatcher from './dispatcher'
export type RequestInfo = string | URL | Request
export declare function fetch (
input: RequestInfo,
init?: RequestInit
): Promise<Response>
export type BodyInit =
| ArrayBuffer
| AsyncIterable<Uint8Array>
| Blob
| FormData
| Iterable<Uint8Array>
| NodeJS.ArrayBufferView
| URLSearchParams
| null
| string
export class BodyMixin {
readonly body: ReadableStream | null
readonly bodyUsed: boolean
readonly arrayBuffer: () => Promise<ArrayBuffer>
readonly blob: () => Promise<Blob>
readonly bytes: () => Promise<Uint8Array>
/**
* @deprecated This method is not recommended for parsing multipart/form-data bodies in server environments.
* Calling body.formData() buffers and parses the entire body. Since this is dictated by the spec,
* this method must only be called on responses from trusted servers.
* For responses from untrusted or user-controlled servers, use a dedicated streaming parser such as
* [@fastify/busboy](https://www.npmjs.com/package/@fastify/busboy) and apply application-specific limits as follows:
*
* @example
* ```js
* import { Busboy } from '@fastify/busboy'
* import { Readable } from 'node:stream'
*
* const response = await fetch('...')
* const busboy = new Busboy({ headers: { 'content-type': response.headers.get('content-type') } })
*
* // handle events emitted from `busboy`
*
* Readable.fromWeb(response.body).pipe(busboy)
* ```
*/
readonly formData: () => Promise<FormData>
readonly json: () => Promise<unknown>
readonly text: () => Promise<string>
readonly textStream: () => ReadableStream<string>
}
export interface SpecIterator<T, TReturn = any, TNext = undefined> {
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
}
export interface SpecIteratorObject<T, TReturn = undefined, TNext = unknown> extends SpecIterator<T, TReturn, TNext> {
[Symbol.iterator](): SpecIteratorObject<T, TReturn, TNext>;
map<U>(callbackfn: (value: T, index: number) => U): SpecIteratorObject<U>;
filter<S extends T>(predicate: (value: T, index: number) => value is S): SpecIteratorObject<S>;
filter(predicate: (value: T, index: number) => unknown): SpecIteratorObject<T>;
take(limit: number): SpecIteratorObject<T>;
drop(count: number): SpecIteratorObject<T>;
flatMap<U>(callbackfn: (value: T, index: number) => Iterator<U> | Iterable<U>): SpecIteratorObject<U>;
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T): T;
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T, initialValue: T): T;
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;
toArray(): T[];
forEach(callbackfn: (value: T, index: number) => void): void;
some(predicate: (value: T, index: number) => unknown): boolean;
every(predicate: (value: T, index: number) => unknown): boolean;
find<S extends T>(predicate: (value: T, index: number) => value is S): S | undefined;
find(predicate: (value: T, index: number) => unknown): T | undefined;
readonly [Symbol.toStringTag]: string;
}
export interface SpecIterableIterator<T> extends SpecIteratorObject<T> {
[Symbol.iterator](): SpecIterableIterator<T>;
}
export interface SpecIterable<T> {
[Symbol.iterator](): SpecIterableIterator<T>;
}
export type HeadersInit = [string, string][] | HeaderRecord | Headers
export declare class Headers implements SpecIterable<[string, string]> {
constructor (init?: HeadersInit)
readonly append: (name: string, value: string) => void
readonly delete: (name: string) => void
readonly get: (name: string) => string | null
readonly has: (name: string) => boolean
readonly set: (name: string, value: string) => void
readonly getSetCookie: () => string[]
readonly forEach: (
callbackfn: (value: string, key: string, iterable: Headers) => void,
thisArg?: unknown
) => void
readonly keys: () => SpecIterableIterator<string>
readonly values: () => SpecIterableIterator<string>
readonly entries: () => SpecIterableIterator<[string, string]>
readonly [Symbol.iterator]: () => SpecIterableIterator<[string, string]>
}
export type RequestCache =
| 'default'
| 'force-cache'
| 'no-cache'
| 'no-store'
| 'only-if-cached'
| 'reload'
export type RequestCredentials = 'omit' | 'include' | 'same-origin'
type RequestDestination =
| ''
| 'audio'
| 'audioworklet'
| 'document'
| 'embed'
| 'font'
| 'image'
| 'manifest'
| 'object'
| 'paintworklet'
| 'report'
| 'script'
| 'sharedworker'
| 'style'
| 'track'
| 'video'
| 'worker'
| 'xslt'
export interface RequestInit {
body?: BodyInit | null
cache?: RequestCache
credentials?: RequestCredentials
dispatcher?: Dispatcher
duplex?: RequestDuplex
headers?: HeadersInit
integrity?: string
keepalive?: boolean
method?: string
mode?: RequestMode
redirect?: RequestRedirect
referrer?: string
referrerPolicy?: ReferrerPolicy
signal?: AbortSignal | null
window?: null
}
export type ReferrerPolicy =
| ''
| 'no-referrer'
| 'no-referrer-when-downgrade'
| 'origin'
| 'origin-when-cross-origin'
| 'same-origin'
| 'strict-origin'
| 'strict-origin-when-cross-origin'
| 'unsafe-url'
export type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
export type RequestRedirect = 'error' | 'follow' | 'manual'
export type RequestDuplex = 'half'
export declare class Request extends BodyMixin {
constructor (input: RequestInfo, init?: RequestInit)
readonly cache: RequestCache
readonly credentials: RequestCredentials
readonly destination: RequestDestination
readonly headers: Headers
readonly integrity: string
readonly method: string
readonly mode: RequestMode
readonly redirect: RequestRedirect
readonly referrer: string
readonly referrerPolicy: ReferrerPolicy
readonly url: string
readonly keepalive: boolean
readonly signal: AbortSignal
readonly duplex: RequestDuplex
public clone (): Request
}
export interface ResponseInit {
readonly status?: number
readonly statusText?: string
readonly headers?: HeadersInit
}
export type ResponseType =
| 'basic'
| 'cors'
| 'default'
| 'error'
| 'opaque'
| 'opaqueredirect'
export type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308
export declare class Response extends BodyMixin {
constructor (body?: BodyInit, init?: ResponseInit)
readonly headers: Headers
readonly ok: boolean
readonly status: number
readonly statusText: string
readonly type: ResponseType
readonly url: string
readonly redirected: boolean
public clone (): Response
static error (): Response
static json (data: any, init?: ResponseInit): Response
static redirect (url: string | URL, status?: ResponseRedirectStatus): Response
}
@@ -0,0 +1 @@
{"version":3,"file":"ipv4.js","sourceRoot":"","sources":["../src/ipv4.ts"],"names":[],"mappings":";AAAA,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,iDAAmC;AACnC,0DAA4C;AAC5C,mDAA+C;AAE/C,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAEpD;;;GAGG;AACH,MAAa,QAAQ;IAWnB,YAAY,OAAe;QAT3B,uBAAkB,GAAW,EAAE,CAAC;QAChC,WAAM,GAAW,SAAS,CAAC,MAAM,CAAC;QAClC,kBAAa,GAAa,EAAE,CAAC;QAC7B,iBAAY,GAAW,EAAE,CAAC;QAC1B,WAAM,GAAW,KAAK,CAAC;QACvB,eAAU,GAAW,EAAE,CAAC;QACxB,OAAE,GAAY,IAAI,CAAC;QAmFnB;;;WAGG;QACH,cAAS,GAAG,UAAU,CAAC;QA+YvB;;;;;WAKG;QACH,eAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAE/B;;;;;;;;;WASG;QACH,mBAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QApfrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,MAAM,MAAM,GAAG,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAExD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC/C,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;YAClD,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAEpC,IAAI,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;gBAC5D,MAAM,IAAI,4BAAY,CAAC,sBAAsB,CAAC,CAAC;YACjD,CAAC;YAED,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;QAC5D,CAAC;QAED,0EAA0E;QAC1E,yEAAyE;QACzE,yBAAyB;QACzB,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;QAEzC,IAAI,OAAO,CAAC,MAAM,GAAG,OAAO,EAAE,CAAC;YAC7B,MAAM,IAAI,4BAAY,CAAC,8BAA8B,OAAO,cAAc,CAAC,CAAC;QAC9E,CAAC;QAED,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC;QAElC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,OAAe;QAC5B,IAAI,CAAC;YACH,kCAAkC;YAClC,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;YAEtB,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAe;QACnB,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAElC,0EAA0E;QAC1E,2DAA2D;QAC3D,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,4BAAY,CAAC,2CAA2C,CAAC,CAAC;QACtE,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,4BAAY,CAAC,uBAAuB,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxE,CAAC;IAQD;;;;;;;;OAQG;IACH,MAAM,CAAC,kBAAkB,CAAC,OAAe,EAAE,IAAY;QACrD,MAAM,IAAI,GAAG,MAAM,CAAC,oBAAoB,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACtF,OAAO,IAAI,QAAQ,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,0BAA0B,CAAC,OAAe,EAAE,YAAoB;QACrE,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC;QACrD,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC;QAChC,MAAM,IAAI,GAAG,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QAC/D,OAAO,IAAI,QAAQ,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,YAAY,CAAC,KAAa;QAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEhC,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,EAAE,CAAC;YACvC,MAAM,IAAI,4BAAY,CAAC,qCAAqC,CAAC,CAAC;QAChE,CAAC;QAED,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC;QAEvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;gBACtB,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE,CAAC;oBACzB,aAAa,GAAG,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC;iBAAM,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE,CAAC;gBAChC,MAAM,IAAI,4BAAY,CACpB,uEAAuE,CACxE,CAAC;YACJ,CAAC;QACH,CAAC;QAED,MAAM,QAAQ,GAAG,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,aAAa,CAAC;QAC1E,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,GAAG,QAAQ,GAAG,CAAC,CAAC;QAEjD,OAAO,IAAI,QAAQ,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,GAAW;QACxB,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAEvC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,4BAAY,CAAC,uCAAuC,CAAC,CAAC;QAClE,CAAC;QAED,MAAM,MAAM,GAAG,EAAE,CAAC;QAElB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACtD,CAAC;QAED,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,OAAe;QAChC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,UAAU,EAAE,CAAC;YACtE,MAAM,IAAI,4BAAY,CAAC,kDAAkD,CAAC,CAAC;QAC7E,CAAC;QAED,OAAO,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAQ,CAAC,eAAuB;QACrC,0EAA0E;QAC1E,qEAAqE;QACrE,8DAA8D;QAC9D,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CALine truncated
@@ -0,0 +1 @@
module.exports={C:{"52":0.10004,"92":0.00556,"102":0.00556,"115":0.22788,"120":0.43908,"121":0.96153,"122":0.00556,"123":0.05002,"124":0.01667,"125":0.00556,"128":0.00556,"131":0.00556,"132":0.00556,"134":0.00556,"136":0.00556,"137":0.00556,"138":0.03891,"139":0.00556,"140":0.19453,"142":0.00556,"143":0.00556,"145":0.01667,"146":0.01112,"147":0.01112,"148":0.00556,"149":0.00556,"150":0.02779,"151":0.01112,"152":0.01667,"153":0.08893,"154":0.20565,"155":0.57803,"156":0.4891,"157":0.01667,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 126 127 129 130 133 135 141 144 158 159 160 3.5 3.6"},D:{"49":0.00556,"62":0.00556,"64":0.00556,"70":0.00556,"79":0.00556,"80":0.00556,"92":0.01112,"97":0.00556,"101":0.00556,"102":0.02779,"103":0.23344,"104":0.22232,"105":0.23344,"106":0.31681,"107":0.22232,"108":0.23344,"109":2.49554,"110":0.21676,"111":0.27234,"112":0.22232,"116":0.46687,"117":0.23899,"118":1.24499,"119":0.96153,"120":1.25055,"121":0.03335,"122":0.07225,"123":0.05558,"124":0.24455,"126":0.01112,"127":0.01112,"128":0.02223,"129":0.00556,"130":0.01112,"131":0.47243,"132":0.03891,"133":0.64473,"134":0.25567,"135":0.20565,"136":0.21676,"137":0.26678,"138":0.27234,"139":0.2112,"140":0.26123,"141":0.26678,"142":0.82258,"143":0.06114,"144":0.21676,"145":0.1723,"146":0.11672,"147":0.07781,"148":0.23344,"149":0.42797,"150":0.55024,"151":5.4524,"152":9.47083,"153":8.17026,"154":1.82858,"155":0.00556,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 63 65 66 67 68 69 71 72 73 74 75 76 77 78 81 83 84 85 86 87 88 89 90 91 93 94 95 96 98 99 100 113 114 115 125 156 157"},F:{"46":0.00556,"52":0.00556,"53":0.00556,"55":0.00556,"56":0.00556,"72":0.00556,"79":0.1723,"85":0.10004,"87":0.00556,"90":0.00556,"95":0.20565,"101":0.01667,"102":0.00556,"105":0.00556,"106":0.01112,"107":0.00556,"109":0.00556,"112":0.00556,"113":0.00556,"116":0.00556,"119":0.00556,"120":0.00556,"121":0.00556,"122":0.00556,"126":0.00556,"133":0.02223,"134":0.16118,"135":1.65628,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 54 57 58 60 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 78 80 81 82 83 84 86 88 89 91 92 93 94 96 97 98 99 100 103 104 108 110 111 114 115 117 118 123 124 125 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.01112,"99":0.00556,"109":0.00556,"118":0.02223,"119":0.45576,"120":0.4502,"122":0.01112,"124":0.00556,"131":0.00556,"132":0.00556,"136":0.00556,"137":0.00556,"138":0.01667,"139":0.00556,"140":0.00556,"141":0.00556,"142":0.00556,"143":0.01112,"144":0.00556,"145":0.01667,"146":0.02223,"147":0.01667,"148":0.01667,"149":0.00556,"150":0.03891,"151":0.07781,"152":0.86705,"153":0.91707,"154":0.24455,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 121 123 125 126 127 128 129 130 133 134 135"},E:{"14":0.00556,"27":0.0667,_:"4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 16.5 17.2 17.4 26.1 27.1 TP","14.1":0.00556,"15.6":0.03335,"16.1":0.00556,"16.3":0.01112,"16.4":0.01667,"16.6":0.05558,"17.0":0.01112,"17.1":0.01112,"17.3":0.00556,"17.5":0.01112,"17.6":0.06114,"18.0":0.01667,"18.1":0.00556,"18.2":0.01667,"18.3":0.00556,"18.4":0.00556,"18.5-18.7":0.01667,"26.0":0.01667,"26.2":0.01667,"26.3":0.02779,"26.4":0.01667,"26.5":0.1056,"26.6":0.45576,"27.2":0.00556},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00102,"5.0-5.1":0.00102,"6.0-6.1":0,"7.0-7.1":0.00204,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01021,"11.0-11.2":0.00102,"11.3-11.4":0.00204,"12.0-12.1":0,"12.2-12.5":0.02655,"13.0-13.1":0,"13.2":0.00511,"13.3":0,"13.4-13.7":0.00102,"14.0-14.4":0.00408,"14.5-14.8":0.00613,"15.0-15.1":0.00613,"15.2-15.3":0.00408,"15.4":0.00511,"15.5":0.00613,"15.6-15.8":0.13273,"16.0":0.01021,"16.1":0.01838,"16.2":0.01021,"16.3":0.02246,"16.4":0.00511,"16.5":0.00817,"16.6-16.7":0.1848,"17.0":0.00715,"17.1":0.01021,"17.2":0.01021,"17.3":0.01532,"17.4":0.02144,"17.5":0.04186,"17.6-17.7":0.10823,"18.0":0.02246,"18.1":0.04492,"18.2":0.06126,"18.3":0.10618,"18.4":0.06637,"18.5-18.7":1.3712,"26.0":0.06637,"26.1":0.06739,"26.2":0.17561,"26.3":0.18991,"26.4":0.13886,"26.5":0.93013,"26.6":5.73905,"27.0":0.44005,"27.1":0,"27.2":0.01123},P:{"20":0.00962,"23":0.00962,"24":0.02885,"25":0.02885,"26":0.02885,"27":0.02885,"28":0.12501,"29":0.06731,"30":1.77903,_:"4 21 22 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.01776,"3":0,"4":0,"2.1":0,"2.2":0,Line truncated
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const PhoneCall = createLucideIcon("PhoneCall", [
[
"path",
{
d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",
key: "foiqr5"
}
],
["path", { d: "M14.05 2a9 9 0 0 1 8 7.94", key: "vmijpz" }],
["path", { d: "M14.05 6A5 5 0 0 1 18 10", key: "13nbpp" }]
]);
export { PhoneCall as default };
//# sourceMappingURL=phone-call.js.map
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ShieldCheck = createLucideIcon("ShieldCheck", [
[
"path",
{
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
key: "oel41y"
}
],
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
]);
export { ShieldCheck as default };
//# sourceMappingURL=shield-check.js.map
@@ -0,0 +1,64 @@
import { isSVGElement } from '../utils/is-svg-element.mjs';
import { resolveElements } from '../utils/resolve-elements.mjs';
const resizeHandlers = new WeakMap();
let observer;
const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => {
if (borderBoxSize && borderBoxSize[0]) {
return borderBoxSize[0][(borderBoxAxis + "Size")];
}
else if (isSVGElement(target) && "getBBox" in target) {
return target.getBBox()[svgAxis];
}
else {
return target[htmlAxis];
}
};
const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth");
const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight");
function notifyTarget({ target, borderBoxSize }) {
resizeHandlers.get(target)?.forEach((handler) => {
handler(target, {
get width() {
return getWidth(target, borderBoxSize);
},
get height() {
return getHeight(target, borderBoxSize);
},
});
});
}
function notifyAll(entries) {
entries.forEach(notifyTarget);
}
function createResizeObserver() {
if (typeof ResizeObserver === "undefined")
return;
observer = new ResizeObserver(notifyAll);
}
function resizeElement(target, handler) {
if (!observer)
createResizeObserver();
const elements = resolveElements(target);
elements.forEach((element) => {
let elementHandlers = resizeHandlers.get(element);
if (!elementHandlers) {
elementHandlers = new Set();
resizeHandlers.set(element, elementHandlers);
}
elementHandlers.add(handler);
observer?.observe(element);
});
return () => {
elements.forEach((element) => {
const elementHandlers = resizeHandlers.get(element);
elementHandlers?.delete(handler);
if (!elementHandlers?.size) {
observer?.unobserve(element);
}
});
};
}
export { resizeElement };
//# sourceMappingURL=handle-element.mjs.map
@@ -0,0 +1,39 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const _path = require('./shared/pathe.BSlhyZSM.cjs');
const delimiter = /* @__PURE__ */ (() => globalThis.process?.platform === "win32" ? ";" : ":")();
const _platforms = { posix: void 0, win32: void 0 };
const mix = (del = delimiter) => {
return new Proxy(_path._path, {
get(_, prop) {
if (prop === "delimiter") return del;
if (prop === "posix") return posix;
if (prop === "win32") return win32;
return _platforms[prop] || _path._path[prop];
}
});
};
const posix = /* @__PURE__ */ mix(":");
const win32 = /* @__PURE__ */ mix(";");
exports.basename = _path.basename;
exports.dirname = _path.dirname;
exports.extname = _path.extname;
exports.format = _path.format;
exports.isAbsolute = _path.isAbsolute;
exports.join = _path.join;
exports.matchesGlob = _path.matchesGlob;
exports.normalize = _path.normalize;
exports.normalizeString = _path.normalizeString;
exports.parse = _path.parse;
exports.relative = _path.relative;
exports.resolve = _path.resolve;
exports.sep = _path.sep;
exports.toNamespacedPath = _path.toNamespacedPath;
exports.default = posix;
exports.delimiter = delimiter;
exports.posix = posix;
exports.win32 = win32;
@@ -0,0 +1,61 @@
import { DateInput, Unit } from './types';
/**
* Checks if a date is the same as or before another date or a specified time unit.
* 检查一个日期是否与另一个日期或指定的时间单位相同或在其之前。
*
* @param date - The date to compare. (要比较的日期。)
* @param input - The date or time unit to compare against. (要比较的日期或时间单位。)
* @param unit - The unit of time to compare (e.g., 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond').
* (要比较的时间单位,例如 'year'、'month'、'day'、'hour'、'minute'、'second'、'millisecond'。)
* @returns A boolean indicating whether the first date is the same as or before the second date or time unit.
* (布尔值,表示第一个日期是否与第二个日期或时间单位相同或在其之前。)
* @example
* ```ts
* // Checking if a date is the same as or before another date (检查一个日期是否与另一个日期相同或在其之前)
* const date1 = new Date('2023-10-01');
* const date2 = new Date('2023-10-01');
* const isSameOrBeforeDate = isSameOrBefore(date1, date2, 'day');
* console.log(isSameOrBeforeDate); // Outputs: true (输出: true)
*
* // Checking if a date is before another date (检查一个日期是否在另一个日期之前)
* const date3 = new Date('2023-09-30');
* const isSameOrBeforeDate2 = isSameOrBefore(date3, date2, 'day');
* console.log(isSameOrBeforeDate2); // Outputs: true (输出: true)
*
* // Checking if a date is the same as or before a specific year (检查一个日期是否与特定年份相同或在其之前)
* const date4 = new Date('2022-12-31');
* const isSameOrBeforeYear = isSameOrBefore(date4, 2023, 'year');
* console.log(isSameOrBeforeYear); // Outputs: true (输出: true)
*
* // Checking if a date is the same as or before a specific month (检查一个日期是否与特定月份相同或在其之前)
* const date5 = new Date('2023-09-30');
* const isSameOrBeforeMonth = isSameOrBefore(date5, '2023-10', 'month');
* console.log(isSameOrBeforeMonth); // Outputs: true (输出: true)
*
* // Checking if a date is the same as or before a specific day (检查一个日期是否与特定天数相同或在其之前)
* const date6 = new Date('2023-10-01');
* const isSameOrBeforeDay = isSameOrBefore(date6, '2023-10-01', 'day');
* console.log(isSameOrBeforeDay); // Outputs: true (输出: true)
*
* // Checking if a date is the same as or before a specific hour (检查一个日期是否与特定小时相同或在其之前)
* const date7 = new Date('2023-10-01T12:00:00');
* const isSameOrBeforeHour = isSameOrBefore(date7, '2023-10-01T12:00:00', 'hour');
* console.log(isSameOrBeforeHour); // Outputs: true (输出: true)
*
* // Checking if a date is the same as or before a specific minute (检查一个日期是否与特定分钟相同或在其之前)
* const date8 = new Date('2023-10-01T12:00:00');
* const isSameOrBeforeMinute = isSameOrBefore(date8, '2023-10-01T12:00:00', 'minute');
* console.log(isSameOrBeforeMinute); // Outputs: true (输出: true)
*
* // Checking if a date is the same as or before a specific second (检查一个日期是否与特定秒数相同或在其之前)
* const date9 = new Date('2023-10-01T12:00:00');
* const isSameOrBeforeSecond = isSameOrBefore(date9, '2023-10-01T12:00:00', 'second');
* console.log(isSameOrBeforeSecond); // Outputs: true (输出: true)
*
* // Checking if a date is the same as or before a specific millisecond (检查一个日期是否与特定毫秒数相同或在其之前)
* const date10 = new Date('2023-10-01T12:00:00.000');
* const isSameOrBeforeMillisecond = isSameOrBefore(date10, '2023-10-01T12:00:00.000', 'millisecond');
* console.log(isSameOrBeforeMillisecond); // Outputs: true (输出: true)
* ```
*/
export default function isSameOrBefore(date: Date, input: DateInput, unit?: Unit): boolean;
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACpC,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,GACnC,MAAM,cAAc,CAAA;AAErB,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,aAAa,CAAA;AACzC,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,cAAc,CAAA;AAC3C,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,IAAI,IAAI,CAAC,EAAE,MAAM,WAAW,CAAA;AAErC,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,aAAa,CAAA;AACzC,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,13 @@
# `react-direction`
## Installation
```sh
$ yarn add @radix-ui/react-direction
# or
$ npm install @radix-ui/react-direction
```
## Usage
View docs [here](https://radix-ui.com/primitives/docs/utilities/direction).
@@ -0,0 +1,16 @@
//#region src/middleware/secure-headers/permissions-policy.d.ts
export type PermissionsPolicyDirective = StandardizedFeatures | ProposedFeatures | ExperimentalFeatures;
/**
* These features have been declared in a published version of the respective specification.
*/
type StandardizedFeatures = 'accelerometer' | 'ambientLightSensor' | 'attributionReporting' | 'autoplay' | 'battery' | 'bluetooth' | 'camera' | 'chUa' | 'chUaArch' | 'chUaBitness' | 'chUaFullVersion' | 'chUaFullVersionList' | 'chUaHighEntropyValues' | 'chUaMobile' | 'chUaModel' | 'chUaPlatform' | 'chUaPlatformVersion' | 'chUaWow64' | 'computePressure' | 'crossOriginIsolated' | 'directSockets' | 'displayCapture' | 'encryptedMedia' | 'executionWhileNotRendered' | 'executionWhileOutOfViewport' | 'fullscreen' | 'geolocation' | 'gyroscope' | 'hid' | 'identityCredentialsGet' | 'idleDetection' | 'keyboardMap' | 'magnetometer' | 'mediasession' | 'microphone' | 'midi' | 'navigationOverride' | 'otpCredentials' | 'payment' | 'pictureInPicture' | 'publickeyCredentialsGet' | 'screenWakeLock' | 'serial' | 'storageAccess' | 'syncXhr' | 'tools' | 'usb' | 'webShare' | 'windowManagement' | 'xrSpatialTracking';
/**
* These features have been proposed, but the definitions have not yet been integrated into their respective specs.
*/
type ProposedFeatures = 'autofill' | 'clipboardRead' | 'clipboardWrite' | 'deferredFetch' | 'gamepad' | 'languageDetector' | 'languageModel' | 'manualText' | 'rewriter' | 'sharedAutofill' | 'speakerSelection' | 'summarizer' | 'translator' | 'writer';
/**
* These features generally have an explainer only, but may be available for experimentation by web developers.
*/
type ExperimentalFeatures = 'allScreensCapture' | 'browsingTopics' | 'capturedSurfaceControl' | 'conversionMeasurement' | 'digitalCredentialsCreate' | 'digitalCredentialsGet' | 'focusWithoutUserActivation' | 'joinAdInterestGroup' | 'localFonts' | 'monetization' | 'runAdAuction' | 'smartCard' | 'syncScript' | 'trustTokenRedemption' | 'unload' | 'verticalScroll';
//#endregion
export {};
@@ -0,0 +1,21 @@
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
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,186 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.phrases = void 0;
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.phrases = {
[utils_1.AST_NODE_TYPES.TSInterfaceDeclaration]: 'Interface',
[utils_1.AST_NODE_TYPES.TSTypeLiteral]: 'Type literal',
};
exports.default = (0, util_1.createRule)({
name: 'prefer-function-type',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce using function types instead of interfaces with call signatures',
recommended: 'stylistic',
},
fixable: 'code',
messages: {
functionTypeOverCallableType: '{{ literalOrInterface }} only has a call signature, you should use a function type instead.',
unexpectedThisOnFunctionOnlyInterface: "`this` refers to the function type '{{ interfaceName }}', did you intend to use a generic `this` parameter like `<Self>(this: Self, ...) => Self` instead?",
},
schema: [],
},
defaultOptions: [],
create(context) {
/**
* Checks if there the interface has exactly one supertype that isn't named 'Function'
* @param node The node being checked
*/
function hasOneSupertype(node) {
if (node.extends.length === 0) {
return false;
}
if (node.extends.length !== 1) {
return true;
}
const expr = node.extends[0].expression;
return (expr.type !== utils_1.AST_NODE_TYPES.Identifier || expr.name !== 'Function');
}
/**
* @param parent The parent of the call signature causing the diagnostic
*/
function shouldWrapSuggestion(parent) {
if (!parent) {
return false;
}
switch (parent.type) {
case utils_1.AST_NODE_TYPES.TSUnionType:
case utils_1.AST_NODE_TYPES.TSIntersectionType:
case utils_1.AST_NODE_TYPES.TSArrayType:
return true;
default:
return false;
}
}
/**
* @param member The TypeElement being checked
* @param node The parent of member being checked
*/
function checkMember(member, node, tsThisTypes = null) {
if ((member.type === utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration ||
member.type === utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration) &&
member.returnType != null) {
if (tsThisTypes?.length &&
node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration) {
// the message can be confusing if we don't point directly to the `this` node instead of the whole member
// and in favour of generating at most one error we'll only report the first occurrence of `this` if there are multiple
context.report({
node: tsThisTypes[0],
messageId: 'unexpectedThisOnFunctionOnlyInterface',
data: {
interfaceName: node.id.name,
},
});
return;
}
const fixable = node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration;
const fix = fixable
? null
: (fixer) => {
const fixes = [];
const start = member.range[0];
// https://github.com/microsoft/TypeScript/pull/56908
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const colonPos = member.returnType.range[0] - start;
const text = context.sourceCode
.getText()
.slice(start, member.range[1]);
const comments = [
...context.sourceCode.getCommentsBefore(member),
...context.sourceCode.getCommentsAfter(member),
];
let suggestion = `${text.slice(0, colonPos)} =>${text.slice(colonPos + 1)}`;
const lastChar = suggestion.endsWith(';') ? ';' : '';
if (lastChar) {
suggestion = suggestion.slice(0, -1);
}
if (shouldWrapSuggestion(node.parent)) {
suggestion = `(${suggestion})`;
}
if (node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration) {
if (node.typeParameters != null) {
suggestion = `type ${context.sourceCode
.getText()
.slice(node.id.range[0], node.typeParameters.range[1])} = ${suggestion}${lastChar}`;
}
else {
suggestion = `type ${node.id.name} = ${suggestion}${lastChar}`;
}
}
const isParentExported = node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration;
if (node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration &&
isParentExported) {
const commentsText = comments
.map(({ type, value }) => type === utils_1.AST_TOKEN_TYPES.Line
? `//${value}\n`
: `/*${value}*/\n`)
.join('');
// comments should move before export and not between export and interface declaration
fixes.push(fixer.insertTextBefore(node.parent, commentsText));
}
else {
comments.forEach(comment => {
let commentText = comment.type === utils_1.AST_TOKEN_TYPES.Line
? `//${comment.value}`
: `/*${comment.value}*/`;
const isCommentOnTheSameLine = comment.loc.start.line === member.loc.start.line;
if (!isCommentOnTheSameLine) {
commentText += '\n';
}
else {
commentText += ' ';
}
suggestion = commentText + suggestion;
});
}
const fixStart = node.range[0];
fixes.push(fixer.replaceTextRange([fixStart, node.range[1]], suggestion));
return fixes;
};
context.report({
node: member,
messageId: 'functionTypeOverCallableType',
data: {
literalOrInterface: exports.phrases[node.type],
},
fix,
});
}
}
let tsThisTypes = null;
let literalNesting = 0;
return {
TSInterfaceDeclaration() {
// when entering an interface reset the count of `this`s to empty.
tsThisTypes = [];
},
'TSInterfaceDeclaration:exit'(node) {
if (!hasOneSupertype(node) && node.body.body.length === 1) {
checkMember(node.body.body[0], node, tsThisTypes);
}
// on exit check member and reset the array to nothing.
tsThisTypes = null;
},
'TSInterfaceDeclaration TSThisType'(node) {
// inside an interface keep track of all ThisType references.
// unless it's inside a nested type literal in which case it's invalid code anyway
// we don't want to incorrectly say "it refers to name" while typescript says it's completely invalid.
if (literalNesting === 0 && tsThisTypes != null) {
tsThisTypes.push(node);
}
},
// keep track of nested literals to avoid complaining about invalid `this` uses
'TSInterfaceDeclaration TSTypeLiteral'() {
literalNesting += 1;
},
'TSInterfaceDeclaration TSTypeLiteral:exit'() {
literalNesting -= 1;
},
'TSTypeLiteral[members.length = 1]'(node) {
checkMember(node.members[0], node);
},
};
},
});
@@ -0,0 +1 @@
{"version":3,"file":"translations.cjs","sources":["../src/translations.ts"],"sourcesContent":[null],"names":["warnings","straightRow","keyPattern","simpleRepeat","extendedRepeat","sequences","recentYears","dates","topTen","topHundred","common","similarToCommon","wordByItself","namesByThemselves","commonNames","userInputs","pwned","suggestions","l33t","reverseWords","allUppercase","capitalization","associatedYears","repeated","longerKeyboardPattern","anotherWord","useWords","noNeed","timeEstimation","ltSecond","second","seconds","minute","minutes","hour","hours","day","days","month","months","year","years","centuries"],"mappings":";;AAAA,mBAAe;AACbA,EAAAA,QAAQ,EAAE;AACRC,IAAAA,WAAW,EAAE,2DAA2D;AACxEC,IAAAA,UAAU,EAAE,4CAA4C;AACxDC,IAAAA,YAAY,EAAE,mDAAmD;AACjEC,IAAAA,cAAc,EACZ,iEAAiE;AACnEC,IAAAA,SAAS,EAAE,0DAA0D;AACrEC,IAAAA,WAAW,EAAE,iCAAiC;AAC9CC,IAAAA,KAAK,EAAE,0BAA0B;AACjCC,IAAAA,MAAM,EAAE,kCAAkC;AAC1CC,IAAAA,UAAU,EAAE,qCAAqC;AACjDC,IAAAA,MAAM,EAAE,mCAAmC;AAC3CC,IAAAA,eAAe,EAAE,8CAA8C;AAC/DC,IAAAA,YAAY,EAAE,iCAAiC;AAC/CC,IAAAA,iBAAiB,EAAE,6CAA6C;AAChEC,IAAAA,WAAW,EAAE,8CAA8C;AAC3DC,IAAAA,UAAU,EAAE,wDAAwD;AACpEC,IAAAA,KAAK,EAAE;GACR;AACDC,EAAAA,WAAW,EAAE;AACXC,IAAAA,IAAI,EAAE,0DAA0D;AAChEC,IAAAA,YAAY,EAAE,2CAA2C;AACzDC,IAAAA,YAAY,EAAE,uCAAuC;AACrDC,IAAAA,cAAc,EAAE,wCAAwC;AACxDd,IAAAA,KAAK,EAAE,qDAAqD;AAC5DD,IAAAA,WAAW,EAAE,qBAAqB;AAClCgB,IAAAA,eAAe,EAAE,2CAA2C;AAC5DjB,IAAAA,SAAS,EAAE,mCAAmC;AAC9CkB,IAAAA,QAAQ,EAAE,sCAAsC;AAChDC,IAAAA,qBAAqB,EACnB,0EAA0E;AAC5EC,IAAAA,WAAW,EAAE,sCAAsC;AACnDC,IAAAA,QAAQ,EAAE,+CAA+C;AACzDC,IAAAA,MAAM,EACJ,uFAAuF;AACzFX,IAAAA,KAAK,EAAE;GACR;AACDY,EAAAA,cAAc,EAAE;AACdC,IAAAA,QAAQ,EAAE,oBAAoB;AAC9BC,IAAAA,MAAM,EAAE,eAAe;AACvBC,IAAAA,OAAO,EAAE,gBAAgB;AACzBC,IAAAA,MAAM,EAAE,eAAe;AACvBC,IAAAA,OAAO,EAAE,gBAAgB;AACzBC,IAAAA,IAAI,EAAE,aAAa;AACnBC,IAAAA,KAAK,EAAE,cAAc;AACrBC,IAAAA,GAAG,EAAE,YAAY;AACjBC,IAAAA,IAAI,EAAE,aAAa;AACnBC,IAAAA,KAAK,EAAE,cAAc;AACrBC,IAAAA,MAAM,EAAE,eAAe;AACvBC,IAAAA,IAAI,EAAE,aAAa;AACnBC,IAAAA,KAAK,EAAE,cAAc;AACrBC,IAAAA,SAAS,EAAE;AACZ;CACF;;;;"}
@@ -0,0 +1,555 @@
import AtRule = require('./at-rule.js')
import { AtRuleProps } from './at-rule.js'
import Comment, { CommentProps } from './comment.js'
import Container, { NewChild } from './container.js'
import CssSyntaxError from './css-syntax-error.js'
import Declaration, { DeclarationProps } from './declaration.js'
import Document from './document.js'
import Input from './input.js'
import { Stringifier, Syntax } from './postcss.js'
import Result from './result.js'
import Root from './root.js'
import Rule, { RuleProps } from './rule.js'
import Warning, { WarningOptions } from './warning.js'
declare namespace Node {
export type ChildNode = AtRule.default | Comment | Declaration | Rule
export type AnyNode =
| AtRule.default
| Comment
| Declaration
| Document
| Root
| Rule
export type ChildProps =
| AtRuleProps
| CommentProps
| DeclarationProps
| RuleProps
export interface Position {
/**
* Source column in file. It starts from 1.
*/
column: number
/**
* Source line in file. It starts from 1.
*/
line: number
/**
* Source offset in file. It starts from 0.
*/
offset: number
}
export interface Range {
/**
* End position, exclusive.
*/
end: Position
/**
* Start position, inclusive.
*/
start: Position
}
/**
* Source represents an interface for the {@link Node.source} property.
*/
export interface Source {
/**
* The inclusive ending position for the source
* code of a node.
*
* However, `end.offset` of a non `Root` node is the exclusive position.
* See https://github.com/postcss/postcss/pull/1879 for details.
*
* ```js
* const root = postcss.parse('a { color: black }')
* const a = root.first
* const color = a.first
*
* // The offset of `Root` node is the inclusive position
* css.source.end // { line: 1, column: 19, offset: 18 }
*
* // The offset of non `Root` node is the exclusive position
* a.source.end // { line: 1, column: 18, offset: 18 }
* color.source.end // { line: 1, column: 16, offset: 16 }
* ```
*/
end?: Position
/**
* The source file from where a node has originated.
*/
input: Input
/**
* The inclusive starting position for the source
* code of a node.
*/
start?: Position
}
/**
* Interface represents an interface for an object received
* as parameter by Node class constructor.
*/
export interface NodeProps {
source?: Source
}
export interface NodeErrorOptions {
/**
* An ending index inside a node's string that should be highlighted as
* source of error.
*/
endIndex?: number
/**
* An index inside a node's string that should be highlighted as source
* of error.
*/
index?: number
/**
* Plugin name that created this error. PostCSS will set it automatically.
*/
plugin?: string
/**
* A word inside a node's string, that should be highlighted as source
* of error.
*/
word?: string
}
class Node extends Node_ {}
export { Node as default }
}
/**
* It represents an abstract class that handles common
* methods for other CSS abstract syntax tree nodes.
*
* Any node that represents CSS selector or value should
* not extend the `Node` class.
*/
declare abstract class Node_ {
/**
* It represents parent of the current node.
*
* ```js
* root.nodes[0].parent === root //=> true
* ```
*/
parent: Container | Document | undefined
/**
* It represents unnecessary whitespace and characters present
* in the css source code.
*
* Information to generate byte-to-byte equal node string as it was
* in the origin input.
*
* The properties of the raws object are decided by parser,
* the default parser uses the following properties:
*
* * `before`: the space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
* * `after`: the space symbols after the last child of the node
* to the end of the node.
* * `between`: the symbols between the property and value
* for declarations, selector and `{` for rules, or last parameter
* and `{` for at-rules.
* * `semicolon`: contains true if the last child has
* an (optional) semicolon.
* * `afterName`: the space between the at-rule name and its parameters.
* * `left`: the space symbols between `/*` and the comment’s text.
* * `right`: the space symbols between the comment’s text
* and <code>*&#47;</code>.
* - `important`: the content of the important statement,
* if it is not just `!important`.
*
* PostCSS filters out the comments inside selectors, declaration values
* and at-rule parameters but it stores the origin content in raws.
*
* ```js
* const root = postcss.parse('a {\n color:black\n}')
* root.first.first.raws //=> { before: '\n ', between: ':' }
* ```
*/
raws: any
/**
* It represents information related to origin of a node and is required
* for generating source maps.
*
* The nodes that are created manually using the public APIs
* provided by PostCSS will have `source` undefined and
* will be absent in the source map.
*
* For this reason, the plugin developer should consider
* duplicating nodes as the duplicate node will have the
* same source as the original node by default or assign
* source to a node created manually.
*
* ```js
* decl.source.input.from //=> '/home/ai/source.css'
* decl.source.start //=> { line: 10, column: 2 }
* decl.source.end //=> { line: 10, column: 12 }
* ```
*
* ```js
* // Incorrect method, source not specified!
* const prefixed = postcss.decl({
* prop: '-moz-' + decl.prop,
* value: decl.value
* })
*
* // Correct method, source is inherited when duplicating.
* const prefixed = decl.clone({
* prop: '-moz-' + decl.prop
* })
* ```
*
* ```js
* if (atrule.name === 'add-link') {
* const rule = postcss.rule({
* selector: 'a',
* source: atrule.source
* })
*
* atrule.parent.insertBefore(atrule, rule)
* }
* ```
*/
source?: Node.Source
/**
* It represents type of a node in
* an abstract syntax tree.
*
* A type of node helps in identification of a node
* and perform operation based on it's type.
*
* ```js
* const declaration = new Declaration({
* prop: 'color',
* value: 'black'
* })
*
* declaration.type //=> 'decl'
* ```
*/
type: string
constructor(defaults?: object)
/**
* Insert new node after current node to current node’s parent.
*
* Just alias for `node.parent.insertAfter(node, add)`.
*
* ```js
* decl.after('color: black')
* ```
*
* @param newNode New node.
* @return This node for methods chain.
*/
after(
newNode: Node | Node.ChildProps | readonly Node[] | string | undefined
): this
/**
* It assigns properties to an existing node instance.
*
* ```js
* decl.assign({ prop: 'word-wrap', value: 'break-word' })
* ```
*
* @param overrides New properties to override the node.
*
* @return `this` for method chaining.
*/
assign(overrides: object): this
/**
* Insert new node before current node to current node’s parent.
*
* Just alias for `node.parent.insertBefore(node, add)`.
*
* ```js
* decl.before('content: ""')
* ```
*
* @param newNode New node.
* @return This node for methods chain.
*/
before(
newNode: Node | Node.ChildProps | readonly Node[] | string | undefined
): this
/**
* Clear the code style properties for the node and its children.
*
* ```js
* node.raws.before //=> ' '
* node.cleanRaws()
* node.raws.before //=> undefined
* ```
*
* @param keepBetween Keep the `raws.between` symbols.
*/
cleanRaws(keepBetween?: boolean): void
/**
* It creates clone of an existing node, which includes all the properties
* and their values, that includes `raws` but not `type`.
*
* ```js
* decl.raws.before //=> "\n "
* const cloned = decl.clone({ prop: '-moz-' + decl.prop })
* cloned.raws.before //=> "\n "
* cloned.toString() //=> -moz-transform: scale(0)
* ```
*
* @param overrides New properties to override in the clone.
*
* @return Duplicate of the node instance.
*/
clone(overrides?: object): this
/**
* Shortcut to clone the node and insert the resulting cloned node
* after the current node.
*
* @param overrides New properties to override in the clone.
* @return New node.
*/
cloneAfter(overrides?: object): this
/**
* Shortcut to clone the node and insert the resulting cloned node
* before the current node.
*
* ```js
* decl.cloneBefore({ prop: '-moz-' + decl.prop })
* ```
*
* @param overrides Mew properties to override in the clone.
*
* @return New node
*/
cloneBefore(overrides?: object): this
/**
* It creates an instance of the class `CssSyntaxError` and parameters passed
* to this method are assigned to the error instance.
*
* The error instance will have description for the
* error, original position of the node in the
* source, showing line and column number.
*
* If any previous map is present, it would be used
* to get original position of the source.
*
* The Previous Map here is referred to the source map
* generated by previous compilation, example: Less,
* Stylus and Sass.
*
* This method returns the error instance instead of
* throwing it.
*
* ```js
* if (!variables[name]) {
* throw decl.error(`Unknown variable ${name}`, { word: name })
* // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
* // color: $black
* // a
* // ^
* // background: white
* }
* ```
*
* @param message Description for the error instance.
* @param options Options for the error instance.
*
* @return Error instance is returned.
*/
error(message: string, options?: Node.NodeErrorOptions): CssSyntaxError
/**
* Returns the next child of the node’s parent.
* Returns `undefined` if the current node is the last child.
*
* ```js
* if (comment.text === 'delete next') {
* const next = comment.next()
* if (next) {
* next.remove()
* }
* }
* ```
*
* @return Next node.
*/
next(): Node.ChildNode | undefined
/**
* Get the position for a word or an index inside the node.
*
* @param opts Options.
* @return Position.
*/
positionBy(opts?: Pick<WarningOptions, 'index' | 'word'>): Node.Position
/**
* Convert string index to line/column.
*
* @param index The symbol number in the node’s string.
* @return Symbol position in file.
*/
positionInside(index: number): Node.Position
/**
* Returns the previous child of the node’s parent.
* Returns `undefined` if the current node is the first child.
*
* ```js
* const annotation = decl.prev()
* if (annotation.type === 'comment') {
* readAnnotation(annotation.text)
* }
* ```
*
* @return Previous node.
*/
prev(): Node.ChildNode | undefined
/**
* Get the range for a word or start and end index inside the node.
* The start index is inclusive; the end index is exclusive.
*
* @param opts Options.
* @return Range.
*/
rangeBy(
opts?: Pick<WarningOptions, 'end' | 'endIndex' | 'index' | 'start' | 'word'>
): Node.Range
/**
* Returns a `raws` value. If the node is missing
* the code style property (because the node was manually built or cloned),
* PostCSS will try to autodetect the code style property by looking
* at other nodes in the tree.
*
* ```js
* const root = postcss.parse('a { background: white }')
* root.nodes[0].append({ prop: 'color', value: 'black' })
* root.nodes[0].nodes[1].raws.before //=> undefined
* root.nodes[0].nodes[1].raw('before') //=> ' '
* ```
*
* @param prop Name of code style property.
* @param defaultType Name of default value, it can be missed
* if the value is the same as prop.
* @return {string} Code style value.
*/
raw(prop: string, defaultType?: string): string
/**
* It removes the node from its parent and deletes its parent property.
*
* ```js
* if (decl.prop.match(/^-webkit-/)) {
* decl.remove()
* }
* ```
*
* @return `this` for method chaining.
*/
remove(): this
/**
* Inserts node(s) before the current node and removes the current node.
*
* ```js
* AtRule: {
* mixin: atrule => {
* atrule.replaceWith(mixinRules[atrule.params])
* }
* }
* ```
*
* @param nodes Mode(s) to replace current one.
* @return Current node to methods chain.
*/
replaceWith(...nodes: NewChild[]): this
/**
* Finds the Root instance of the node’s tree.
*
* ```js
* root.nodes[0].nodes[0].root() === root
* ```
*
* @return Root parent.
*/
root(): Root
/**
* Fix circular links on `JSON.stringify()`.
*
* @return Cleaned object.
*/
toJSON(): object
/**
* It compiles the node to browser readable cascading style sheets string
* depending on it's type.
*
* ```js
* new Rule({ selector: 'a' }).toString() //=> "a {}"
* ```
*
* @param stringifier A syntax to use in string generation.
* @return CSS string of this node.
*/
toString(stringifier?: Stringifier | Syntax): string
/**
* It is a wrapper for {@link Result#warn}, providing convenient
* way of generating warnings.
*
* ```js
* Declaration: {
* bad: (decl, { result }) => {
* decl.warn(result, 'Deprecated property: bad')
* }
* }
* ```
*
* @param result The `Result` instance that will receive the warning.
* @param message Description for the warning.
* @param options Options for the warning.
*
* @return `Warning` instance is returned
*/
warn(result: Result, message: string, options?: WarningOptions): Warning
/**
* If this node isn't already dirty, marks it and its ancestors as such. This
* indicates to the LazyResult processor that the {@link Root} has been
* modified by the current plugin and may need to be processed again by other
* plugins.
*/
protected markDirty(): void
}
declare class Node extends Node_ {}
export = Node
@@ -0,0 +1,186 @@
#ifndef SRC_NAPI_INL_DEPRECATED_H_
#define SRC_NAPI_INL_DEPRECATED_H_
////////////////////////////////////////////////////////////////////////////////
// PropertyDescriptor class
////////////////////////////////////////////////////////////////////////////////
template <typename Getter>
inline PropertyDescriptor PropertyDescriptor::Accessor(
const char* utf8name,
Getter getter,
napi_property_attributes attributes,
void* /*data*/) {
using CbData = details::CallbackData<Getter, Napi::Value>;
// TODO: Delete when the function is destroyed
auto callbackData = new CbData({getter, nullptr});
return PropertyDescriptor({utf8name,
nullptr,
nullptr,
CbData::Wrapper,
nullptr,
nullptr,
attributes,
callbackData});
}
template <typename Getter>
inline PropertyDescriptor PropertyDescriptor::Accessor(
const std::string& utf8name,
Getter getter,
napi_property_attributes attributes,
void* data) {
return Accessor(utf8name.c_str(), getter, attributes, data);
}
template <typename Getter>
inline PropertyDescriptor PropertyDescriptor::Accessor(
napi_value name,
Getter getter,
napi_property_attributes attributes,
void* /*data*/) {
using CbData = details::CallbackData<Getter, Napi::Value>;
// TODO: Delete when the function is destroyed
auto callbackData = new CbData({getter, nullptr});
return PropertyDescriptor({nullptr,
name,
nullptr,
CbData::Wrapper,
nullptr,
nullptr,
attributes,
callbackData});
}
template <typename Getter>
inline PropertyDescriptor PropertyDescriptor::Accessor(
Name name, Getter getter, napi_property_attributes attributes, void* data) {
napi_value nameValue = name;
return PropertyDescriptor::Accessor(nameValue, getter, attributes, data);
}
template <typename Getter, typename Setter>
inline PropertyDescriptor PropertyDescriptor::Accessor(
const char* utf8name,
Getter getter,
Setter setter,
napi_property_attributes attributes,
void* /*data*/) {
using CbData = details::AccessorCallbackData<Getter, Setter>;
// TODO: Delete when the function is destroyed
auto callbackData = new CbData({getter, setter, nullptr});
return PropertyDescriptor({utf8name,
nullptr,
nullptr,
CbData::GetterWrapper,
CbData::SetterWrapper,
nullptr,
attributes,
callbackData});
}
template <typename Getter, typename Setter>
inline PropertyDescriptor PropertyDescriptor::Accessor(
const std::string& utf8name,
Getter getter,
Setter setter,
napi_property_attributes attributes,
void* data) {
return Accessor(utf8name.c_str(), getter, setter, attributes, data);
}
template <typename Getter, typename Setter>
inline PropertyDescriptor PropertyDescriptor::Accessor(
napi_value name,
Getter getter,
Setter setter,
napi_property_attributes attributes,
void* /*data*/) {
using CbData = details::AccessorCallbackData<Getter, Setter>;
// TODO: Delete when the function is destroyed
auto callbackData = new CbData({getter, setter, nullptr});
return PropertyDescriptor({nullptr,
name,
nullptr,
CbData::GetterWrapper,
CbData::SetterWrapper,
nullptr,
attributes,
callbackData});
}
template <typename Getter, typename Setter>
inline PropertyDescriptor PropertyDescriptor::Accessor(
Name name,
Getter getter,
Setter setter,
napi_property_attributes attributes,
void* data) {
napi_value nameValue = name;
return PropertyDescriptor::Accessor(
nameValue, getter, setter, attributes, data);
}
template <typename Callable>
inline PropertyDescriptor PropertyDescriptor::Function(
const char* utf8name,
Callable cb,
napi_property_attributes attributes,
void* /*data*/) {
using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr)));
using CbData = details::CallbackData<Callable, ReturnType>;
// TODO: Delete when the function is destroyed
auto callbackData = new CbData({cb, nullptr});
return PropertyDescriptor({utf8name,
nullptr,
CbData::Wrapper,
nullptr,
nullptr,
nullptr,
attributes,
callbackData});
}
template <typename Callable>
inline PropertyDescriptor PropertyDescriptor::Function(
const std::string& utf8name,
Callable cb,
napi_property_attributes attributes,
void* data) {
return Function(utf8name.c_str(), cb, attributes, data);
}
template <typename Callable>
inline PropertyDescriptor PropertyDescriptor::Function(
napi_value name,
Callable cb,
napi_property_attributes attributes,
void* /*data*/) {
using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr)));
using CbData = details::CallbackData<Callable, ReturnType>;
// TODO: Delete when the function is destroyed
auto callbackData = new CbData({cb, nullptr});
return PropertyDescriptor({nullptr,
name,
CbData::Wrapper,
nullptr,
nullptr,
nullptr,
attributes,
callbackData});
}
template <typename Callable>
inline PropertyDescriptor PropertyDescriptor::Function(
Name name, Callable cb, napi_property_attributes attributes, void* data) {
napi_value nameValue = name;
return PropertyDescriptor::Function(nameValue, cb, attributes, data);
}
#endif // !SRC_NAPI_INL_DEPRECATED_H_
@@ -0,0 +1,619 @@
/**
* We strongly discourage the use of the `async_hooks` API.
* Other APIs that can cover most of its use cases include:
*
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v24.x/api/async_context.html#class-asynclocalstorage) tracks async context
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v24.x/api/process.html#processgetactiveresourcesinfo) tracks active resources
*
* The `node:async_hooks` module provides an API to track asynchronous resources.
* It can be accessed using:
*
* ```js
* import async_hooks from 'node:async_hooks';
* ```
* @experimental
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/async_hooks.js)
*/
declare module "async_hooks" {
/**
* ```js
* import { executionAsyncId } from 'node:async_hooks';
* import fs from 'node:fs';
*
* console.log(executionAsyncId()); // 1 - bootstrap
* const path = '.';
* fs.open(path, 'r', (err, fd) => {
* console.log(executionAsyncId()); // 6 - open()
* });
* ```
*
* The ID returned from `executionAsyncId()` is related to execution timing, not
* causality (which is covered by `triggerAsyncId()`):
*
* ```js
* const server = net.createServer((conn) => {
* // Returns the ID of the server, not of the new connection, because the
* // callback runs in the execution scope of the server's MakeCallback().
* async_hooks.executionAsyncId();
*
* }).listen(port, () => {
* // Returns the ID of a TickObject (process.nextTick()) because all
* // callbacks passed to .listen() are wrapped in a nextTick().
* async_hooks.executionAsyncId();
* });
* ```
*
* Promise contexts may not get precise `executionAsyncIds` by default.
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#promise-execution-tracking).
* @since v8.1.0
* @return The `asyncId` of the current execution context. Useful to track when something calls.
*/
function executionAsyncId(): number;
/**
* Resource objects returned by `executionAsyncResource()` are most often internal
* Node.js handle objects with undocumented APIs. Using any functions or properties
* on the object is likely to crash your application and should be avoided.
*
* Using `executionAsyncResource()` in the top-level execution context will
* return an empty object as there is no handle or request object to use,
* but having an object representing the top-level can be helpful.
*
* ```js
* import { open } from 'node:fs';
* import { executionAsyncId, executionAsyncResource } from 'node:async_hooks';
*
* console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
* open(new URL(import.meta.url), 'r', (err, fd) => {
* console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap
* });
* ```
*
* This can be used to implement continuation local storage without the
* use of a tracking `Map` to store the metadata:
*
* ```js
* import { createServer } from 'node:http';
* import {
* executionAsyncId,
* executionAsyncResource,
* createHook,
* } from 'node:async_hooks';
* const sym = Symbol('state'); // Private symbol to avoid pollution
*
* createHook({
* init(asyncId, type, triggerAsyncId, resource) {
* const cr = executionAsyncResource();
* if (cr) {
* resource[sym] = cr[sym];
* }
* },
* }).enable();
*
* const server = createServer((req, res) => {
* executionAsyncResource()[sym] = { state: req.url };
* setTimeout(function() {
* res.end(JSON.stringify(executionAsyncResource()[sym]));
* }, 100);
* }).listen(3000);
* ```
* @since v13.9.0, v12.17.0
* @return The resource representing the current execution. Useful to store data within the resource.
*/
function executionAsyncResource(): object;
/**
* ```js
* const server = net.createServer((conn) => {
* // The resource that caused (or triggered) this callback to be called
* // was that of the new connection. Thus the return value of triggerAsyncId()
* // is the asyncId of "conn".
* async_hooks.triggerAsyncId();
*
* }).listen(port, () => {
* // Even though all callbacks passed to .listen() are wrapped in a nextTick()
* // the callback itself exists because the call to the server's .listen()
* // was made. So the return value would be the ID of the server.
* async_hooks.triggerAsyncId();
* });
* ```
*
* Promise contexts may not get valid `triggerAsyncId`s by default. See
* the section on [promise execution tracking](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#promise-execution-tracking).
* @return The ID of the resource responsible for calling the callback that is currently being executed.
*/
function triggerAsyncId(): number;
interface HookCallbacks {
/**
* The [`init` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#initasyncid-type-triggerasyncid-resource).
*/
init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
/**
* The [`before` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#beforeasyncid).
*/
before?(asyncId: number): void;
/**
* The [`after` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#afterasyncid).
*/
after?(asyncId: number): void;
/**
* The [`promiseResolve` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#promiseresolveasyncid).
*/
promiseResolve?(asyncId: number): void;
/**
* The [`destroy` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#destroyasyncid).
*/
destroy?(asyncId: number): void;
/**
* Whether the hook should track `Promise`s. Cannot be `false` if
* `promiseResolve` is set.
* @default true
*/
trackPromises?: boolean | undefined;
}
interface AsyncHook {
/**
* Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
*/
enable(): this;
/**
* Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
*/
disable(): this;
}
/**
* Registers functions to be called for different lifetime events of each async
* operation.
*
* The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the
* respective asynchronous event during a resource's lifetime.
*
* All callbacks are optional. For example, if only resource cleanup needs to
* be tracked, then only the `destroy` callback needs to be passed. The
* specifics of all functions that can be passed to `callbacks` is in the
* [Hook Callbacks](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#hook-callbacks) section.
*
* ```js
* import { createHook } from 'node:async_hooks';
*
* const asyncHook = createHook({
* init(asyncId, type, triggerAsyncId, resource) { },
* destroy(asyncId) { },
* });
* ```
*
* The callbacks will be inherited via the prototype chain:
*
* ```js
* class MyAsyncCallbacks {
* init(asyncId, type, triggerAsyncId, resource) { }
* destroy(asyncId) {}
* }
*
* class MyAddedCallbacks extends MyAsyncCallbacks {
* before(asyncId) { }
* after(asyncId) { }
* }
*
* const asyncHook = async_hooks.createHook(new MyAddedCallbacks());
* ```
*
* Because promises are asynchronous resources whose lifecycle is tracked
* via the async hooks mechanism, the `init()`, `before()`, `after()`, and
* `destroy()` callbacks _must not_ be async functions that return promises.
* @since v8.1.0
* @param options The [Hook Callbacks](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#hook-callbacks) to register
* @returns Instance used for disabling and enabling hooks
*/
function createHook(options: HookCallbacks): AsyncHook;
interface AsyncResourceOptions {
/**
* The ID of the execution context that created this async event.
* @default executionAsyncId()
*/
triggerAsyncId?: number | undefined;
/**
* Disables automatic `emitDestroy` when the object is garbage collected.
* This usually does not need to be set (even if `emitDestroy` is called
* manually), unless the resource's `asyncId` is retrieved and the
* sensitive API's `emitDestroy` is called with it.
* @default false
*/
requireManualDestroy?: boolean | undefined;
}
/**
* The class `AsyncResource` is designed to be extended by the embedder's async
* resources. Using this, users can easily trigger the lifetime events of their
* own resources.
*
* The `init` hook will trigger when an `AsyncResource` is instantiated.
*
* The following is an overview of the `AsyncResource` API.
*
* ```js
* import { AsyncResource, executionAsyncId } from 'node:async_hooks';
*
* // AsyncResource() is meant to be extended. Instantiating a
* // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
* // async_hook.executionAsyncId() is used.
* const asyncResource = new AsyncResource(
* type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false },
* );
*
* // Run a function in the execution context of the resource. This will
* // * establish the context of the resource
* // * trigger the AsyncHooks before callbacks
* // * call the provided function `fn` with the supplied arguments
* // * trigger the AsyncHooks after callbacks
* // * restore the original execution context
* asyncResource.runInAsyncScope(fn, thisArg, ...args);
*
* // Call AsyncHooks destroy callbacks.
* asyncResource.emitDestroy();
*
* // Return the unique ID assigned to the AsyncResource instance.
* asyncResource.asyncId();
*
* // Return the trigger ID for the AsyncResource instance.
* asyncResource.triggerAsyncId();
* ```
*/
class AsyncResource {
/**
* AsyncResource() is meant to be extended. Instantiating a
* new AsyncResource() also triggers init. If triggerAsyncId is omitted then
* async_hook.executionAsyncId() is used.
* @param type The type of async event.
* @param triggerAsyncId The ID of the execution context that created
* this async event (default: `executionAsyncId()`), or an
* AsyncResourceOptions object (since v9.3.0)
*/
constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
/**
* Binds the given function to the current execution context.
* @since v14.8.0, v12.19.0
* @param fn The function to bind to the current execution context.
* @param type An optional name to associate with the underlying `AsyncResource`.
*/
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
fn: Func,
type?: string,
thisArg?: ThisArg,
): Func;
/**
* Binds the given function to execute to this `AsyncResource`'s scope.
* @since v14.8.0, v12.19.0
* @param fn The function to bind to the current `AsyncResource`.
*/
bind<Func extends (...args: any[]) => any>(fn: Func): Func;
/**
* Call the provided function with the provided arguments in the execution context
* of the async resource. This will establish the context, trigger the AsyncHooks
* before callbacks, call the function, trigger the AsyncHooks after callbacks, and
* then restore the original execution context.
* @since v9.6.0
* @param fn The function to call in the execution context of this async resource.
* @param thisArg The receiver to be used for the function call.
* @param args Optional arguments to pass to the function.
*/
runInAsyncScope<This, Result>(
fn: (this: This, ...args: any[]) => Result,
thisArg?: This,
...args: any[]
): Result;
/**
* Call all `destroy` hooks. This should only ever be called once. An error will
* be thrown if it is called more than once. This **must** be manually called. If
* the resource is left to be collected by the GC then the `destroy` hooks will
* never be called.
* @return A reference to `asyncResource`.
*/
emitDestroy(): this;
/**
* @return The unique `asyncId` assigned to the resource.
*/
asyncId(): number;
/**
* @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
*/
triggerAsyncId(): number;
}
interface AsyncLocalStorageOptions {
/**
* The default value to be used when no store is provided.
*/
defaultValue?: any;
/**
* A name for the `AsyncLocalStorage` value.
*/
name?: string | undefined;
}
/**
* This class creates stores that stay coherent through asynchronous operations.
*
* While you can create your own implementation on top of the `node:async_hooks` module, `AsyncLocalStorage` should be preferred as it is a performant and memory
* safe implementation that involves significant optimizations that are non-obvious
* to implement.
*
* The following example uses `AsyncLocalStorage` to build a simple logger
* that assigns IDs to incoming HTTP requests and includes them in messages
* logged within each request.
*
* ```js
* import http from 'node:http';
* import { AsyncLocalStorage } from 'node:async_hooks';
*
* const asyncLocalStorage = new AsyncLocalStorage();
*
* function logWithId(msg) {
* const id = asyncLocalStorage.getStore();
* console.log(`${id !== undefined ? id : '-'}:`, msg);
* }
*
* let idSeq = 0;
* http.createServer((req, res) => {
* asyncLocalStorage.run(idSeq++, () => {
* logWithId('start');
* // Imagine any chain of async operations here
* setImmediate(() => {
* logWithId('finish');
* res.end();
* });
* });
* }).listen(8080);
*
* http.get('http://localhost:8080');
* http.get('http://localhost:8080');
* // Prints:
* // 0: start
* // 0: finish
* // 1: start
* // 1: finish
* ```
*
* Each instance of `AsyncLocalStorage` maintains an independent storage context.
* Multiple instances can safely exist simultaneously without risk of interfering
* with each other's data.
* @since v13.10.0, v12.17.0
*/
class AsyncLocalStorage<T> {
/**
* Creates a new instance of `AsyncLocalStorage`. Store is only provided within a
* `run()` call or after an `enterWith()` call.
*/
constructor(options?: AsyncLocalStorageOptions);
/**
* Binds the given function to the current execution context.
* @since v19.8.0
* @param fn The function to bind to the current execution context.
* @return A new function that calls `fn` within the captured execution context.
*/
static bind<Func extends (...args: any[]) => any>(fn: Func): Func;
/**
* Captures the current execution context and returns a function that accepts a
* function as an argument. Whenever the returned function is called, it
* calls the function passed to it within the captured context.
*
* ```js
* const asyncLocalStorage = new AsyncLocalStorage();
* const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot());
* const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore()));
* console.log(result); // returns 123
* ```
*
* AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple
* async context tracking purposes, for example:
*
* ```js
* class Foo {
* #runInAsyncScope = AsyncLocalStorage.snapshot();
*
* get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); }
* }
*
* const foo = asyncLocalStorage.run(123, () => new Foo());
* console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123
* ```
* @since v19.8.0
* @return A new function with the signature `(fn: (...args) : R, ...args) : R`.
*/
static snapshot(): <R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs) => R;
/**
* Disables the instance of `AsyncLocalStorage`. All subsequent calls
* to `asyncLocalStorage.getStore()` will return `undefined` until `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.
*
* When calling `asyncLocalStorage.disable()`, all current contexts linked to the
* instance will be exited.
*
* Calling `asyncLocalStorage.disable()` is required before the `asyncLocalStorage` can be garbage collected. This does not apply to stores
* provided by the `asyncLocalStorage`, as those objects are garbage collected
* along with the corresponding async resources.
*
* Use this method when the `asyncLocalStorage` is not in use anymore
* in the current process.
* @since v13.10.0, v12.17.0
* @experimental
*/
disable(): void;
/**
* Returns the current store.
* If called outside of an asynchronous context initialized by
* calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it
* returns `undefined`.
* @since v13.10.0, v12.17.0
*/
getStore(): T | undefined;
/**
* The name of the `AsyncLocalStorage` instance if provided.
* @since v24.0.0
*/
readonly name: string;
/**
* Runs a function synchronously within a context and returns its
* return value. The store is not accessible outside of the callback function.
* The store is accessible to any asynchronous operations created within the
* callback.
*
* The optional `args` are passed to the callback function.
*
* If the callback function throws an error, the error is thrown by `run()` too.
* The stacktrace is not impacted by this call and the context is exited.
*
* Example:
*
* ```js
* const store = { id: 2 };
* try {
* asyncLocalStorage.run(store, () => {
* asyncLocalStorage.getStore(); // Returns the store object
* setTimeout(() => {
* asyncLocalStorage.getStore(); // Returns the store object
* }, 200);
* throw new Error();
* });
* } catch (e) {
* asyncLocalStorage.getStore(); // Returns undefined
* // The error will be caught here
* }
* ```
* @since v13.10.0, v12.17.0
*/
run<R>(store: T, callback: () => R): R;
run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;
/**
* Runs a function synchronously outside of a context and returns its
* return value. The store is not accessible within the callback function or
* the asynchronous operations created within the callback. Any `getStore()` call done within the callback function will always return `undefined`.
*
* The optional `args` are passed to the callback function.
*
* If the callback function throws an error, the error is thrown by `exit()` too.
* The stacktrace is not impacted by this call and the context is re-entered.
*
* Example:
*
* ```js
* // Within a call to run
* try {
* asyncLocalStorage.getStore(); // Returns the store object or value
* asyncLocalStorage.exit(() => {
* asyncLocalStorage.getStore(); // Returns undefined
* throw new Error();
* });
* } catch (e) {
* asyncLocalStorage.getStore(); // Returns the same object or value
* // The error will be caught here
* }
* ```
* @since v13.10.0, v12.17.0
* @experimental
*/
exit<R, TArgs extends any[]>(callback: (...args: TArgs) => R, ...args: TArgs): R;
/**
* Transitions into the context for the remainder of the current
* synchronous execution and then persists the store through any following
* asynchronous calls.
*
* Example:
*
* ```js
* const store = { id: 1 };
* // Replaces previous store with the given store object
* asyncLocalStorage.enterWith(store);
* asyncLocalStorage.getStore(); // Returns the store object
* someAsyncOperation(() => {
* asyncLocalStorage.getStore(); // Returns the same object
* });
* ```
*
* This transition will continue for the _entire_ synchronous execution.
* This means that if, for example, the context is entered within an event
* handler subsequent event handlers will also run within that context unless
* specifically bound to another context with an `AsyncResource`. That is why `run()` should be preferred over `enterWith()` unless there are strong reasons
* to use the latter method.
*
* ```js
* const store = { id: 1 };
*
* emitter.on('my-event', () => {
* asyncLocalStorage.enterWith(store);
* });
* emitter.on('my-event', () => {
* asyncLocalStorage.getStore(); // Returns the same object
* });
*
* asyncLocalStorage.getStore(); // Returns undefined
* emitter.emit('my-event');
* asyncLocalStorage.getStore(); // Returns the same object
* ```
* @since v13.11.0, v12.17.0
* @experimental
*/
enterWith(store: T): void;
}
/**
* @since v17.2.0, v16.14.0
* @return A map of provider types to the corresponding numeric id.
* This map contains all the event types that might be emitted by the `async_hooks.init()` event.
*/
namespace asyncWrapProviders {
const NONE: number;
const DIRHANDLE: number;
const DNSCHANNEL: number;
const ELDHISTOGRAM: number;
const FILEHANDLE: number;
const FILEHANDLECLOSEREQ: number;
const FIXEDSIZEBLOBCOPY: number;
const FSEVENTWRAP: number;
const FSREQCALLBACK: number;
const FSREQPROMISE: number;
const GETADDRINFOREQWRAP: number;
const GETNAMEINFOREQWRAP: number;
const HEAPSNAPSHOT: number;
const HTTP2SESSION: number;
const HTTP2STREAM: number;
const HTTP2PING: number;
const HTTP2SETTINGS: number;
const HTTPINCOMINGMESSAGE: number;
const HTTPCLIENTREQUEST: number;
const JSSTREAM: number;
const JSUDPWRAP: number;
const MESSAGEPORT: number;
const PIPECONNECTWRAP: number;
const PIPESERVERWRAP: number;
const PIPEWRAP: number;
const PROCESSWRAP: number;
const PROMISE: number;
const QUERYWRAP: number;
const SHUTDOWNWRAP: number;
const SIGNALWRAP: number;
const STATWATCHER: number;
const STREAMPIPE: number;
const TCPCONNECTWRAP: number;
const TCPSERVERWRAP: number;
const TCPWRAP: number;
const TTYWRAP: number;
const UDPSENDWRAP: number;
const UDPWRAP: number;
const SIGINTWATCHDOG: number;
const WORKER: number;
const WORKERHEAPSNAPSHOT: number;
const WRITEWRAP: number;
const ZLIB: number;
const CHECKPRIMEREQUEST: number;
const PBKDF2REQUEST: number;
const KEYPAIRGENREQUEST: number;
const KEYGENREQUEST: number;
const KEYEXPORTREQUEST: number;
const CIPHERREQUEST: number;
const DERIVEBITSREQUEST: number;
const HASHREQUEST: number;
const RANDOMBYTESREQUEST: number;
const RANDOMPRIMEREQUEST: number;
const SCRYPTREQUEST: number;
const SIGNREQUEST: number;
const TLSWRAP: number;
const VERIFYREQUEST: number;
}
}
declare module "node:async_hooks" {
export * from "async_hooks";
}
@@ -0,0 +1 @@
{"version":3,"names":["_is","require","_isValidIdentifier","_helperValidatorIdentifier","_helperStringParser","_index","_utils","classMethodOrPropertyUnionShapeCommon","allowPrivateName","unionShape","discriminator","shapes","name","value","properties","key","validate","assertNodeType","exports","defineType","defineAliasedType","fields","elements","arrayOf","assertNodeOrValueType","default","process","env","BABEL_TYPES_8_BREAKING","undefined","visitor","aliases","operator","assertValueType","Object","assign","identifier","assertOneOf","ASSIGNMENT_OPERATORS","pattern","node","val","validator","is","left","oneOf","right","builder","BINARY_OPERATORS","expression","inOp","oneOfNodeTypes","directives","arrayOfType","body","validateArrayOfType","label","optional","callee","arguments","typeArguments","typeParameters","param","test","consequent","alternate","program","comments","each","assertEach","tokens","type","init","update","functionCommon","params","generator","async","functionTypeAnnotationCommon","returnType","functionDeclarationCommon","declare","id","predicate","parent","inherits","patternLikeCommon","typeAnnotation","decorators","chain","isValidIdentifier","TypeError","match","exec","toString","parentKey","nonComp","computed","imported","meta","isKeyword","isReservedWord","deprecatedAlias","Number","isFinite","error","Error","flags","invalid","LOGICAL_OPERATORS","property","object","normal","sourceType","interpreter","kind","shorthand","argument","listKey","index","length","expressions","discriminant","cases","block","handler","finalizer","prefix","UNARY_OPERATORS","UPDATE_OPERATORS","declarations","withoutInit","constOrLetOrVar","usingOrAwaitUsing","parentIsForX","decl","definite","superClass","implements","mixins","abstract","importAttributes","attributes","assertions","deprecated","source","exportKind","validateOptional","declaration","validateType","specifiers","sourced","sourceless","local","exported","lval","await","module","phase","importKind","options","classMethodOrPropertyCommon","accessibility","static","override","classMethodOrDeclareMethodCommon","access","tag","quasi","assertShape","raw","cooked","templateElementCookedValidator","unterminatedCalled","str","firstInvalidLoc","readStringContents","unterminated","strictNumericEscape","invalidEscapeSequence","numericSeparatorInEscapeSequence","unexpectedNumericSeparator","invalidDigit","invalidCodePoint","tail","quasis","delegate","assertOptionalChainStart","readonly","variance"],"sources":["../../src/definitions/core.ts"],"sourcesContent":["import is from \"../validators/is.ts\";\nimport isValidIdentifier from \"../validators/isValidIdentifier.ts\";\nimport { isKeyword, isReservedWord } from \"@babel/helper-validator-identifier\";\nimport type * as t from \"../index.ts\";\nimport { readStringContents } from \"@babel/helper-string-parser\";\n\nimport {\n BINARY_OPERATORS,\n LOGICAL_OPERATORS,\n ASSIGNMENT_OPERATORS,\n UNARY_OPERATORS,\n UPDATE_OPERATORS,\n} from \"../constants/index.ts\";\n\nimport {\n defineAliasedType,\n assertShape,\n assertOptionalChainStart,\n assertValueType,\n assertNodeType,\n assertNodeOrValueType,\n assertEach,\n chain,\n assertOneOf,\n validateOptional,\n arrayOf,\n arrayOfType,\n validateArrayOfType,\n validateType,\n type Validator,\n type ValidatorImpl,\n type ValidatorOneOfNodeTypes,\n type ValidatorType,\n} from \"./utils.ts\";\n\nexport const classMethodOrPropertyUnionShapeCommon = (\n allowPrivateName = false,\n) => ({\n unionShape: {\n discriminator: \"computed\",\n shapes: [\n {\n name: \"computed\",\n value: [true],\n properties: {\n key: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n },\n {\n name: \"nonComputed\",\n value: [false],\n properties: {\n key: {\n validate: allowPrivateName\n ? assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n \"BigIntLiteral\",\n \"PrivateName\",\n )\n : assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n \"BigIntLiteral\",\n ),\n },\n },\n },\n ],\n },\n});\n\nconst defineType = defineAliasedType(\"Standardized\");\n\ndefineType(\"ArrayExpression\", {\n fields: {\n elements: {\n validate: arrayOf(\n assertNodeOrValueType(\"null\", \"Expression\", \"SpreadElement\"),\n ),\n default:\n !process.env.BABEL_8_BREAKING && !process.env.BABEL_TYPES_8_BREAKING\n ? []\n : undefined,\n },\n },\n visitor: [\"elements\"],\n aliases: [\"Expression\"],\n});\n\ndefineType(\"AssignmentExpression\", {\n fields: {\n operator: {\n validate:\n !process.env.BABEL_8_BREAKING && !process.envLine truncated
@@ -0,0 +1,124 @@
import { n as __toESM, t as require_binding } from "./binding-TuFFIE_J.mjs";
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-BHRSI0R7.mjs";
//#region src/utils/minify.ts
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
/**
* Minify asynchronously.
*
* Note: This function can be slower than {@linkcode minifySync} due to the overhead of spawning a thread.
*
* @category Utilities
* @experimental
*/
async function minify(filename, sourceText, options) {
const inputMap = bindingifySourcemap(options?.inputMap);
const result = await (0, import_binding.minify)(filename, sourceText, options);
if (result.map && inputMap) result.map = {
version: 3,
...(0, import_binding.collapseSourcemaps)([inputMap, bindingifySourcemap(result.map)])
};
return result;
}
/**
* Minify synchronously.
*
* @category Utilities
* @experimental
*/
function minifySync(filename, sourceText, options) {
const inputMap = bindingifySourcemap(options?.inputMap);
const result = (0, import_binding.minifySync)(filename, sourceText, options);
if (result.map && inputMap) result.map = {
version: 3,
...(0, import_binding.collapseSourcemaps)([inputMap, bindingifySourcemap(result.map)])
};
return result;
}
//#endregion
//#region src/utils/transform.ts
const yarnPnp$1 = typeof process === "object" && !!process.versions?.pnp;
function normalizeBindingWarning(warning) {
if (warning.type === "JsError") return warning.field0;
return {
code: warning.field0.kind,
message: warning.field0.message,
id: warning.field0.id,
exporter: warning.field0.exporter,
loc: warning.field0.loc,
pos: warning.field0.pos
};
}
/**
* Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
*
* Note: This function can be slower than `transformSync` due to the overhead of spawning a thread.
*
* @param filename The name of the file being transformed. If this is a
* relative path, consider setting the {@linkcode TransformOptions#cwd} option.
* @param sourceText The source code to transform.
* @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
* Only used when `options.tsconfig` is `true`.
*
* @returns a promise that resolves to an object containing the transformed code,
* source maps, and any errors that occurred during parsing or transformation.
*
* @category Utilities
* @experimental
*/
async function transform(filename, sourceText, options, cache) {
const result = await (0, import_binding.enhancedTransform)(filename, sourceText, options, cache, yarnPnp$1);
return {
...result,
errors: result.errors.map(normalizeBindingError),
warnings: result.warnings.map(normalizeBindingWarning)
};
}
/**
* Transpile a JavaScript or TypeScript into a target ECMAScript version.
*
* @param filename The name of the file being transformed. If this is a
* relative path, consider setting the {@linkcode TransformOptions#cwd} option.
* @param sourceText The source code to transform.
* @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
* Only used when `options.tsconfig` is `true`.
*
* @returns an object containing the transformed code, source maps, and any errors
* that occurred during parsing or transformation.
*
* @category Utilities
* @experimental
*/
function transformSync(filename, sourceText, options, cache) {
const result = (0, import_binding.enhancedTransformSync)(filename, sourceText, options, cache, yarnPnp$1);
return {
...result,
errors: result.errors.map(normalizeBindingError),
warnings: result.warnings.map(normalizeBindingWarning)
};
}
//#endregion
//#region src/utils/resolve-tsconfig.ts
const yarnPnp = typeof process === "object" && !!process.versions?.pnp;
/**
* Cache for tsconfig resolution to avoid redundant file system operations.
*
* The cache stores resolved tsconfig configurations keyed by their file paths.
* When transforming multiple files in the same project, tsconfig lookups are
* deduplicated, improving performance.
*
* @category Utilities
* @experimental
*/
var TsconfigCache = class extends import_binding.TsconfigCache {
constructor() {
super(yarnPnp);
}
};
/** @hidden This is only expected to be used by Vite */
function resolveTsconfig(filename, cache) {
return (0, import_binding.resolveTsconfig)(filename, cache, yarnPnp);
}
//#endregion
export { minify as a, transformSync as i, resolveTsconfig as n, minifySync as o, transform as r, TsconfigCache as t };
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const BadgePlus = createLucideIcon("BadgePlus", [
[
"path",
{
d: "M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",
key: "3c2336"
}
],
["line", { x1: "12", x2: "12", y1: "8", y2: "16", key: "10p56q" }],
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
]);
export { BadgePlus as default };
//# sourceMappingURL=badge-plus.js.map
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION = void 0;
exports.validateDefaultProjectForFilesGlob = validateDefaultProjectForFilesGlob;
exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION = `
Having many files run with the default project is known to cause performance issues and slow down linting.
See https://tseslint.com/allowdefaultproject-glob-too-wide
`;
function validateDefaultProjectForFilesGlob(allowDefaultProject) {
if (!allowDefaultProject?.length) {
return;
}
for (const glob of allowDefaultProject) {
if (glob === '*') {
throw new Error(`allowDefaultProject contains the overly wide '*'.${exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION}`);
}
if (glob.includes('**')) {
throw new Error(`allowDefaultProject glob '${glob}' contains a disallowed '**'.${exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION}`);
}
}
}
@@ -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 './scale-3d.js';
//# sourceMappingURL=scale-3-d.js.map
@@ -0,0 +1,852 @@
/** Generic JSON Web Key Parameters. */
export interface JWKParameters {
/** JWK "kty" (Key Type) Parameter */
kty?: string
/**
* JWK "alg" (Algorithm) Parameter
*
* @see {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}
*/
alg?: string
/** JWK "key_ops" (Key Operations) Parameter */
key_ops?: string[]
/** JWK "ext" (Extractable) Parameter */
ext?: boolean
/** JWK "use" (Public Key Use) Parameter */
use?: string
/** JWK "x5c" (X.509 Certificate Chain) Parameter */
x5c?: string[]
/** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter */
x5t?: string
/** JWK "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter */
'x5t#S256'?: string
/** JWK "x5u" (X.509 URL) Parameter */
x5u?: string
/** JWK "kid" (Key ID) Parameter */
kid?: string
}
/** Convenience interface for Public OKP JSON Web Keys */
export interface JWK_OKP_Public extends JWKParameters {
/** OKP JWK "crv" (The Subtype of Key Pair) Parameter */
crv: string
/** OKP JWK "x" (The public key) Parameter */
x: string
}
/** Convenience interface for Private OKP JSON Web Keys */
export interface JWK_OKP_Private extends JWK_OKP_Public {
/** OKP JWK "d" (The Private Key) Parameter */
d: string
}
/** Convenience interface for Public AKP JSON Web Keys */
export interface JWK_AKP_Public extends JWKParameters {
/** JWK "alg" (Algorithm) Parameter */
alg: string
/** AKP JWK "pub" (The Public key) Parameter */
pub: string
}
/** Convenience interface for Private AKP JSON Web Keys */
export interface JWK_AKP_Private extends JWK_AKP_Public {
/** AKP JWK "priv" (The Private Key) Parameter */
priv: string
}
/** Convenience interface for Public EC JSON Web Keys */
export interface JWK_EC_Public extends JWKParameters {
/** EC JWK "crv" (Curve) Parameter */
crv: string
/** EC JWK "x" (X Coordinate) Parameter */
x: string
/** EC JWK "y" (Y Coordinate) Parameter */
y: string
}
/** Convenience interface for Private EC JSON Web Keys */
export interface JWK_EC_Private extends JWK_EC_Public {
/** EC JWK "d" (ECC Private Key) Parameter */
d: string
}
/** Convenience interface for Public RSA JSON Web Keys */
export interface JWK_RSA_Public extends JWKParameters {
/** RSA JWK "e" (Exponent) Parameter */
e: string
/** RSA JWK "n" (Modulus) Parameter */
n: string
}
/** Convenience interface for Private RSA JSON Web Keys */
export interface JWK_RSA_Private extends JWK_RSA_Public {
/** RSA JWK "d" (Private Exponent) Parameter */
d: string
/** RSA JWK "dp" (First Factor CRT Exponent) Parameter */
dp: string
/** RSA JWK "dq" (Second Factor CRT Exponent) Parameter */
dq: string
/** RSA JWK "p" (First Prime Factor) Parameter */
p: string
/** RSA JWK "q" (Second Prime Factor) Parameter */
q: string
/** RSA JWK "qi" (First CRT Coefficient) Parameter */
qi: string
}
/** Convenience interface for oct JSON Web Keys */
export interface JWK_oct extends JWKParameters {
/** Oct JWK "k" (Key Value) Parameter */
k: string
}
/**
* JSON Web Key ({@link https://www.rfc-editor.org/rfc/rfc7517 JWK}). "RSA", "EC", "OKP", "AKP", and
* "oct" key types are supported.
*
* @see {@link JWK_AKP_Public}
* @see {@link JWK_AKP_Private}
* @see {@link JWK_OKP_Public}
* @see {@link JWK_OKP_Private}
* @see {@link JWK_EC_Public}
* @see {@link JWK_EC_Private}
* @see {@link JWK_RSA_Public}
* @see {@link JWK_RSA_Private}
* @see {@link JWK_oct}
*/
export interface JWK extends JWKParameters {
/**
* - EC JWK "crv" (Curve) Parameter
* - OKP JWK "crv" (The Subtype of Key Pair) Parameter
*/
crv?: string
/**
* - Private RSA JWK "d" (Private Exponent) Parameter
* - Private EC JWK "d" (ECC Private Key) Parameter
* - Private OKP JWK "d" (The Private Key) Parameter
*/
d?: string
/** Private RSA JWK "dp" (First Factor CRT Exponent) Parameter */
dp?: string
/** Private RSA JWK "dq" (Second Factor CRT Exponent) Parameter */
dq?: string
/** RSA JWK "e" (Exponent) Parameter */
e?: string
/** Oct JWK "k" (Key Value) Parameter */
k?: string
/** RSA JWK "n" (Modulus) Parameter */
n?: string
/** Private RSA JWK "p" (First Prime Factor) Parameter */
p?: string
/** Private RSA JWK "q" (Second Prime Factor) Parameter */
q?: string
/** Private RSA JWK "qi" (First CRT Coefficient) Parameter */
qi?: string
/**
* - EC JWK "x" (X Coordinate) Parameter
* - OKP JWK "x" (The public key) Parameter
*/
x?: string
/** EC JWK "y" (Y Coordinate) Parameter */
y?: string
/** AKP JWK "pub" (Public Key) Parameter */
pub?: string
/** AKP JWK "priv" (Private key) Parameter */
priv?: string
}
/**
* @private
*
* @internal
*/
export interface GenericGetKeyFunction<IProtectedHeader, IToken, ReturnKeyTypes> {
/**
* Dynamic key resolution function. No token components have been verified at the time of this
* function call.
*
* If a suitable key for the token cannot be matched, throw an error instead.
*
* @param protectedHeader JWE or JWS Protected Header.
* @param token The consumed JWE or JWS token.
*/
(protectedHeader: IProtectedHeader, token: IToken): Promise<ReturnKeyTypes> | ReturnKeyTypes
}
/**
* Generic Interface for consuming operations dynamic key resolution.
*
* @param IProtectedHeader Type definition of the JWE or JWS Protected Header.
* @param IToken Type definition of the consumed JWE or JWS token.
*/
export interface GetKeyFunction<IProtectedHeader, IToken> extends GenericGetKeyFunction<
IProtectedHeader,
IToken,
CryptoKey | KeyObject | JWK | Uint8Array
> {}
/**
* Flattened JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for
* detached signature validation.
*/
export interface FlattenedJWSInput {
/**
* The "header" member MUST be present and contain the value JWS Unprotected Header when the JWS
* Unprotected Header value is non- empty; otherwise, it MUST be absent. This value is represented
* as an unencoded JSON object, rather than as a string. These Header Parameter values are not
* integrity protected.
*/
header?: JWSHeaderParameters
/**
* The "payload" member MUST be present and contain the value BASE64URL(JWS Payload). When RFC7797
* "b64": false is used the value passed may also be a {@link !Uint8Array}.
*/
payload: string | Uint8Array
/**
* The "protected" member MUST be present and contain the value BASE64URL(UTF8(JWS Protected
* Header)) when the JWS Protected Header value is non-empty; otherwise, it MUST be absent. These
* Header Parameter values are integrity protected.
*/
protected?: string
/** The "signature" member MUST be present and contain the value BASE64URL(JWS Signature). */
signature: string
}
/**
* General JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for
* detached signature validation.
*/
export interface GeneralJWSInput {
/**
* The "payload" member MUST be present and contain the value BASE64URL(JWS Payload). When when
* JWS Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) "b64": false is
* used the value passed may also be a {@link !Uint8Array}.
*/
payload: string | Uint8Array
/**
* The "signatures" member value MUST be an array of JSON objects. Each object represents a
* signature or MAC over the JWS Payload and the JWS Protected Header.
*/
signatures: Omit<FlattenedJWSInput, 'payload'>[]
}
/**
* Flattened JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS
* Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used.
*/
export interface FlattenedJWS extends Partial<FlattenedJWSInput> {
payload: string
signature: string
}
/**
* General JWS JSON Serialization Syntax token. Payload is returned as an empty string when JWS
* Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used.
*/
export interface GeneralJWS {
payload: string
signatures: Omit<FlattenedJWSInput, 'payload'>[]
}
/** Header Parameters common to JWE and JWS */
export interface JoseHeaderParameters {
/** "kid" (Key ID) Header Parameter */
kid?: string
/** "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter */
x5t?: string
/** "x5c" (X.509 Certificate Chain) Header Parameter */
x5c?: string[]
/** "x5u" (X.509 URL) Header Parameter */
x5u?: string
/** "jku" (JWK Set URL) Header Parameter */
jku?: string
/** "jwk" (JSON Web Key) Header Parameter */
jwk?: Pick<JWK, 'kty' | 'crv' | 'x' | 'y' | 'e' | 'n' | 'alg' | 'pub'>
/** "typ" (Type) Header Parameter */
typ?: string
/** "cty" (Content Type) Header Parameter */
cty?: string
}
/** Recognized JWS Header Parameters, any other Header Members may also be present. */
export interface JWSHeaderParameters extends JoseHeaderParameters {
/**
* JWS "alg" (Algorithm) Header Parameter
*
* @see {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}
*/
alg?: string
/**
* This JWS Extension Header Parameter modifies the JWS Payload representation and the JWS Signing
* Input computation as per {@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}.
*/
b64?: boolean
/** JWS "crit" (Critical) Header Parameter */
crit?: string[]
/** Any other JWS Header member. */
[propName: string]: unknown
}
/** Recognized JWE Key Management-related Header Parameters. */
export interface JWEKeyManagementHeaderParameters {
/**
* ECDH-ES "apu" (Agreement PartyUInfo). This will be used as a JOSE Header Parameter and will be
* used in ECDH's ConcatKDF.
*/
apu?: Uint8Array
/**
* ECDH-ES "apv" (Agreement PartyVInfo). This will be used as a JOSE Header Parameter and will be
* used in ECDH's ConcatKDF.
*/
apv?: Uint8Array
/**
* @deprecated You should not use this parameter. It is only intended for testing and vector
* validation purposes.
*/
p2c?: number
/**
* @deprecated You should not use this parameter. It is only intended for testing and vector
* validation purposes.
*/
p2s?: Uint8Array
/**
* @deprecated You should not use this parameter. It is only intended for testing and vector
* validation purposes.
*/
iv?: Uint8Array
/**
* @deprecated You should not use this parameter. It is only intended for testing and vector
* validation purposes.
*/
epk?: CryptoKey | KeyObject
}
/** Flattened JWE JSON Serialization Syntax token. */
export interface FlattenedJWE {
/**
* The "aad" member MUST be present and contain the value BASE64URL(JWE AAD)) when the JWE AAD
* value is non-empty; otherwise, it MUST be absent. A JWE AAD value can be included to supply a
* base64url-encoded value to be integrity protected but not encrypted.
*/
aad?: string
/** The "ciphertext" member MUST be present and contain the value BASE64URL(JWE Ciphertext). */
ciphertext: string
/**
* The "encrypted_key" member MUST be present and contain the value BASE64URL(JWE Encrypted Key)
* when the JWE Encrypted Key value is non-empty; otherwise, it MUST be absent.
*/
encrypted_key?: string
/**
* The "header" member MUST be present and contain the value JWE Per- Recipient Unprotected Header
* when the JWE Per-Recipient Unprotected Header value is non-empty; otherwise, it MUST be absent.
* This value is represented as an unencoded JSON object, rather than as a string. These Header
* Parameter values are not integrity protected.
*/
header?: JWEHeaderParameters
/**
* The "iv" member MUST be present and contain the value BASE64URL(JWE Initialization Vector) when
* the JWE Initialization Vector value is non-empty; otherwise, it MUST be absent.
*/
iv?: string
/**
* The "protected" member MUST be present and contain the value BASE64URL(UTF8(JWE Protected
* Header)) when the JWE Protected Header value is non-empty; otherwise, it MUST be absent. These
* Header Parameter values are integrity protected.
*/
protected?: string
/**
* The "tag" member MUST be present and contain the value BASE64URL(JWE Authentication Tag) when
* the JWE Authentication Tag value is non-empty; otherwise, it MUST be absent.
*/
tag?: string
/**
* The "unprotected" member MUST be present and contain the value JWE Shared Unprotected Header
* when the JWE Shared Unprotected Header value is non-empty; otherwise, it MUST be absent. This
* value is represented as an unencoded JSON object, rather than as a string. These Header
* Parameter values are not integrity protected.
*/
unprotected?: JWEHeaderParameters
}
/** General JWE JSON Serialization Syntax token. */
export interface GeneralJWE extends Omit<FlattenedJWE, 'encrypted_key' | 'header'> {
recipients: Pick<FlattenedJWE, 'encrypted_key' | 'header'>[]
}
/** Recognized JWE Header Parameters, any other Header members may also be present. */
export interface JWEHeaderParameters extends JoseHeaderParameters {
/**
* JWE "alg" (Algorithm) Header Parameter
*
* @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
*/
alg?: string
/**
* JWE "enc" (Encryption Algorithm) Header Parameter
*
* @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
*/
enc?: string
/** JWE "crit" (Critical) Header Parameter */
crit?: string[]
/**
* JWE "zip" (Compression Algorithm) Header Parameter.
*
* The only supported value is `"DEF"` (DEFLATE). Requires the `CompressionStream` /
* `DecompressionStream` APIs to be available in the runtime.
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7516#section-4.1.3 JWE "zip" Header Parameter}
*/
zip?: string
/** Any other JWE Header member. */
[propName: string]: unknown
}
/** Shared Interface with a "crit" property for all sign, verify, encrypt and decrypt operations. */
export interface CritOption {
/**
* An object with keys representing recognized "crit" (Critical) Header Parameter names. The value
* for those is either `true` or `false`. `true` when the Header Parameter MUST be integrity
* protected, `false` when it's irrelevant.
*
* This makes the "Extension Header Parameter "..." is not recognized" error go away.
*
* Use this when a given JWS/JWT/JWE profile requires the use of proprietary non-registered "crit"
* (Critical) Header Parameters. This will only make sure the Header Parameter is syntactically
* correct when provided and that it is optionally integrity protected. It will not process the
* Header Parameter in any way or reject the operation if it is missing. You MUST still verify the
* Header Parameter was present and process it according to the profile's validation steps after
* the operation succeeds.
*
* The JWS extension Header Parameter `b64` is always recognized and processed properly. No other
* registered Header Parameters that need this kind of default built-in treatment are currently
* available.
*/
crit?: {
[propName: string]: boolean
}
}
/** JWE Decryption options. */
export interface DecryptOptions extends CritOption {
/**
* A list of accepted JWE "alg" (Algorithm) Header Parameter values. By default all "alg"
* (Algorithm) Header Parameter values applicable for the used key/secret are allowed except for
* all PBES2 Key Management Algorithms, these need to be explicitly allowed using this option.
*/
keyManagementAlgorithms?: string[]
/**
* A list of accepted JWE "enc" (Encryption Algorithm) Header Parameter values. By default all
* "enc" (Encryption Algorithm) values applicable for the used key/secret are allowed.
*/
contentEncryptionAlgorithms?: string[]
/**
* (PBES2 Key Management Algorithms only) Maximum allowed "p2c" (PBES2 Count) Header Parameter
* value. The PBKDF2 iteration count defines the algorithm's computational expense. By default
* this value is set to 10000.
*/
maxPBES2Count?: number
/**
* Maximum allowed size (in bytes) of the decompressed plaintext when the JWE `"zip"` (Compression
* Algorithm) Header Parameter is present. By default this value is set to 250000 (250 KB). The
* value must be `0`, a positive safe integer, or `Infinity`.
*
* Set to `0` to reject all compressed JWEs during decryption.
*
* Set to `Infinity` to disable the decompressed size limit.
*/
maxDecompressedLength?: number
}
/** JWE Encryption options. */
export interface EncryptOptions extends CritOption {}
/** JWT Claims Set verification options. */
export interface JWTClaimVerificationOptions {
/**
* Expected JWT "aud" (Audience) Claim value(s).
*
* This option makes the JWT "aud" (Audience) Claim presence required.
*/
audience?: string | string[]
/**
* Clock skew tolerance
*
* - In seconds when number (e.g. 5)
* - Resolved into a number of seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
*
* Used when validating the JWT "nbf" (Not Before) and "exp" (Expiration Time) claims, and when
* validating the "iat" (Issued At) claim if the {@link maxTokenAge `maxTokenAge` option} is set.
*/
clockTolerance?: string | number
/**
* Expected JWT "iss" (Issuer) Claim value(s).
*
* This option makes the JWT "iss" (Issuer) Claim presence required.
*/
issuer?: string | string[]
/**
* Maximum time elapsed (in seconds) from the JWT "iat" (Issued At) Claim value.
*
* - In seconds when number (e.g. 5)
* - Resolved into a number of seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
*
* This option makes the JWT "iat" (Issued At) Claim presence required.
*/
maxTokenAge?: string | number
/**
* Expected JWT "sub" (Subject) Claim value.
*
* This option makes the JWT "sub" (Subject) Claim presence required.
*/
subject?: string
/**
* Expected JWT "typ" (Type) Header Parameter value.
*
* This option makes the JWT "typ" (Type) Header Parameter presence required.
*/
typ?: string
/** Date to use when comparing NumericDate claims, defaults to `new Date()`. */
currentDate?: Date
/**
* Array of required Claim Names that must be present in the JWT Claims Set. Default is that: if
* the {@link issuer `issuer` option} is set, then JWT "iss" (Issuer) Claim must be present; if the
* {@link audience `audience` option} is set, then JWT "aud" (Audience) Claim must be present; if
* the {@link subject `subject` option} is set, then JWT "sub" (Subject) Claim must be present; if
* the {@link maxTokenAge `maxTokenAge` option} is set, then JWT "iat" (Issued At) Claim must be
* present.
*/
requiredClaims?: string[]
}
/** JWS Verification options. */
export interface VerifyOptions extends CritOption {
/**
* A list of accepted JWS "alg" (Algorithm) Header Parameter values. By default all "alg"
* (Algorithm) values applicable for the used key/secret are allowed.
*
* > [!NOTE]\
* > Unsecured JWTs (`{ "alg": "none" }`) are never accepted by this API.
*/
algorithms?: string[]
}
/** JWS Signing options. */
export interface SignOptions extends CritOption {}
/** Recognized JWT Claims Set members, any other members may also be present. */
export interface JWTPayload {
/**
* JWT Issuer
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1 RFC7519#section-4.1.1}
*/
iss?: string
/**
* JWT Subject
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.2 RFC7519#section-4.1.2}
*/
sub?: string
/**
* JWT Audience
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.3 RFC7519#section-4.1.3}
*/
aud?: string | string[]
/**
* JWT ID
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.7 RFC7519#section-4.1.7}
*/
jti?: string
/**
* JWT Not Before
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.5 RFC7519#section-4.1.5}
*/
nbf?: number
/**
* JWT Expiration Time
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4 RFC7519#section-4.1.4}
*/
exp?: number
/**
* JWT Issued At
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6 RFC7519#section-4.1.6}
*/
iat?: number
/** Any other JWT Claim Set member. */
[propName: string]: unknown
}
/** Flattened JWE JSON Serialization Syntax decryption result */
export interface FlattenedDecryptResult {
/** JWE AAD. */
additionalAuthenticatedData?: Uint8Array
/** Plaintext. */
plaintext: Uint8Array
/** JWE Protected Header. */
protectedHeader?: JWEHeaderParameters
/** JWE Shared Unprotected Header. */
sharedUnprotectedHeader?: JWEHeaderParameters
/** JWE Per-Recipient Unprotected Header. */
unprotectedHeader?: JWEHeaderParameters
}
/** General JWE JSON Serialization Syntax decryption result */
export interface GeneralDecryptResult extends FlattenedDecryptResult {}
/** Compact JWE decryption result */
export interface CompactDecryptResult {
/** Plaintext. */
plaintext: Uint8Array
/** JWE Protected Header. */
protectedHeader: CompactJWEHeaderParameters
}
/** Flattened JWS JSON Serialization Syntax verification result */
export interface FlattenedVerifyResult {
/** JWS Payload. */
payload: Uint8Array
/** JWS Protected Header. */
protectedHeader?: JWSHeaderParameters
/** JWS Unprotected Header. */
unprotectedHeader?: JWSHeaderParameters
}
/** General JWS JSON Serialization Syntax verification result */
export interface GeneralVerifyResult extends FlattenedVerifyResult {}
/** Compact JWS verification result */
export interface CompactVerifyResult {
/** JWS Payload. */
payload: Uint8Array
/** JWS Protected Header. */
protectedHeader: CompactJWSHeaderParameters
}
/** Signed JSON Web Token (JWT) verification result */
export interface JWTVerifyResult<PayloadType = JWTPayload> {
/** JWT Claims Set. */
payload: PayloadType & JWTPayload
/** JWS Protected Header. */
protectedHeader: JWTHeaderParameters
}
/** Encrypted JSON Web Token (JWT) decryption result */
export interface JWTDecryptResult<PayloadType = JWTPayload> {
/** JWT Claims Set. */
payload: PayloadType & JWTPayload
/** JWE Protected Header. */
protectedHeader: CompactJWEHeaderParameters
}
/** When key resolver functions are used this becomes part of successful resolves */
export interface ResolvedKey {
/** Key resolved from the key resolver function. */
key: CryptoKey | Uint8Array
}
/** Recognized Compact JWS Header Parameters, any other Header Members may also be present. */
export interface CompactJWSHeaderParameters extends JWSHeaderParameters {
alg: string
}
/** Recognized Signed JWT Header Parameters, any other Header Members may also be present. */
export interface JWTHeaderParameters extends CompactJWSHeaderParameters {
b64?: true
}
/** Recognized Compact JWE Header Parameters, any other Header Members may also be present. */
export interface CompactJWEHeaderParameters extends JWEHeaderParameters {
alg: string
enc: string
}
/** JSON Web Key Set */
export interface JSONWebKeySet {
keys: JWK[]
}
/**
* {@link !KeyObject} is a representation of a key/secret available in the Node.js runtime. You may
* use the Node.js runtime APIs {@link !createPublicKey}, {@link !createPrivateKey}, and
* {@link !createSecretKey} to obtain a {@link !KeyObject} from your existing key material.
*/
export interface KeyObject {
type: string
}
/**
* {@link !CryptoKey} is a representation of a key/secret available in all supported runtimes. In
* addition to the {@link key/import Key Import Functions} you may use the
* {@link !SubtleCrypto.importKey} API to obtain a {@link !CryptoKey} from your existing key
* material.
*/
export type CryptoKey = Extract<
Awaited<ReturnType<typeof crypto.subtle.generateKey>>,
{ type: string }
>
/** Generic interface for JWT producing classes. */
export interface ProduceJWT {
/**
* Set the "iss" (Issuer) Claim.
*
* @param issuer "Issuer" Claim value to set on the JWT Claims Set.
*/
setIssuer(issuer: string): this
/**
* Set the "sub" (Subject) Claim.
*
* @param subject "sub" (Subject) Claim value to set on the JWT Claims Set.
*/
setSubject(subject: string): this
/**
* Set the "aud" (Audience) Claim.
*
* @param audience "aud" (Audience) Claim value to set on the JWT Claims Set.
*/
setAudience(audience: string | string[]): this
/**
* Set the "jti" (JWT ID) Claim.
*
* @param jwtId "jti" (JWT ID) Claim value to set on the JWT Claims Set.
*/
setJti(jwtId: string): this
/**
* Set the "nbf" (Not Before) Claim.
*
* - If a `number` is passed as an argument it is used as the claim directly.
* - If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the
* claim.
* - If a `string` is passed as an argument it is resolved to a time span, and then added to the
* current unix timestamp and used as the claim.
*
* Format used for time span should be a number followed by a unit, such as "5 minutes" or "1
* day".
*
* Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins",
* "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year",
* "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an
* alias for a year.
*
* If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets
* subtracted from the current unix timestamp. A "from now" suffix can also be used for
* readability when adding to the current unix timestamp.
*
* @param input "nbf" (Not Before) Claim value to set on the JWT Claims Set.
*/
setNotBefore(input: number | string | Date): this
/**
* Set the "exp" (Expiration Time) Claim.
*
* - If a `number` is passed as an argument it is used as the claim directly.
* - If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the
* claim.
* - If a `string` is passed as an argument it is resolved to a time span, and then added to the
* current unix timestamp and used as the claim.
*
* Format used for time span should be a number followed by a unit, such as "5 minutes" or "1
* day".
*
* Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins",
* "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year",
* "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an
* alias for a year.
*
* If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets
* subtracted from the current unix timestamp. A "from now" suffix can also be used for
* readability when adding to the current unix timestamp.
*
* @param input "exp" (Expiration Time) Claim value to set on the JWT Claims Set.
*/
setExpirationTime(input: number | string | Date): this
/**
* Set the "iat" (Issued At) Claim.
*
* - If no argument is used the current unix timestamp is used as the claim.
* - If a `number` is passed as an argument it is used as the claim directly.
* - If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the
* claim.
* - If a `string` is passed as an argument it is resolved to a time span, and then added to the
* current unix timestamp and used as the claim.
*
* Format used for time span should be a number followed by a unit, such as "5 minutes" or "1
* day".
*
* Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins",
* "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year",
* "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an
* alias for a year.
*
* If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets
* subtracted from the current unix timestamp. A "from now" suffix can also be used for
* readability when adding to the current unix timestamp.
*
* @param input "iat" (Expiration Time) Claim value to set on the JWT Claims Set.
*/
setIssuedAt(input?: number | string | Date): this
}
@@ -0,0 +1 @@
module.exports={C:{"52":0.00421,"59":0.00421,"67":0.00421,"78":0.00841,"115":0.06308,"118":0.00841,"120":0.00421,"121":0.00841,"123":0.00421,"124":0.00421,"128":0.00421,"134":0.00421,"135":0.00421,"136":0.00421,"140":0.03785,"146":0.00421,"147":0.00421,"148":0.00421,"149":0.00421,"150":0.00421,"151":0.00421,"152":0.01682,"153":0.02944,"154":0.164,"155":0.57609,"156":0.5046,"157":0.01682,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 60 61 62 63 64 65 66 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 119 122 125 126 127 129 130 131 132 133 137 138 139 141 142 143 144 145 158 159 160 3.5 3.6"},D:{"49":0.00421,"66":0.00421,"70":0.00421,"76":0.00421,"87":0.00841,"91":0.00421,"92":0.00421,"93":0.00841,"101":0.00421,"102":0.00421,"103":0.10933,"104":0.03364,"105":0.03364,"106":0.03364,"107":0.03364,"108":0.03785,"109":0.21866,"110":0.03364,"111":0.04205,"112":0.03364,"114":0.01262,"116":0.11354,"117":0.03364,"118":0.03364,"119":0.01262,"120":0.05887,"121":0.00421,"122":0.02944,"123":0.00841,"124":0.04626,"125":0.00841,"126":0.05887,"127":0.00841,"128":0.05887,"129":0.00421,"130":0.00841,"131":0.0841,"132":0.00841,"133":0.09672,"134":0.03785,"135":0.03785,"136":0.04626,"137":0.05046,"138":0.164,"139":0.04205,"140":0.04626,"141":0.06308,"142":0.21866,"143":0.04205,"144":0.09251,"145":0.03785,"146":0.164,"147":0.07149,"148":0.14297,"149":0.21025,"150":0.55506,"151":2.15717,"152":6.8962,"153":6.01736,"154":1.48016,"155":0.01682,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 67 68 69 71 72 73 74 75 77 78 79 80 81 83 84 85 86 88 89 90 94 95 96 97 98 99 100 113 115 156 157"},F:{"46":0.00421,"95":0.00421,"101":0.00841,"106":0.00421,"116":0.00421,"133":0.00421,"134":0.08831,"135":0.47937,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 102 103 104 105 107 108 109 110 111 112 113 114 115 117 118 119 120 121 122 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00421,"109":0.02944,"114":0.00421,"119":0.00421,"120":0.00421,"122":0.00421,"131":0.00421,"133":0.00841,"135":0.00421,"136":0.00841,"138":0.00421,"139":0.00421,"140":0.00421,"141":0.00421,"142":0.00421,"143":0.00841,"144":0.00841,"145":0.00841,"146":0.01682,"147":0.00841,"148":0.01262,"149":0.02944,"150":0.18502,"151":0.56768,"152":4.19659,"153":5.26046,"154":1.32458,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 121 123 124 125 126 127 128 129 130 132 134 137"},E:{"13":0.00421,"14":0.01262,"15":0.00421,"27":0.20184,_:"4 5 6 7 8 9 10 11 12 3.1 3.2 5.1 6.1 7.1 9.1 15.1 27.1 TP","10.1":0.00421,"11.1":0.00421,"12.1":0.00421,"13.1":0.02944,"14.1":0.03785,"15.2-15.3":0.00421,"15.4":0.00421,"15.5":0.00421,"15.6":0.22707,"16.0":0.00421,"16.1":0.00841,"16.2":0.00841,"16.3":0.02103,"16.4":0.00421,"16.5":0.00841,"16.6":0.29435,"17.0":0.01682,"17.1":0.32379,"17.2":0.00841,"17.3":0.02103,"17.4":0.02103,"17.5":0.03785,"17.6":0.19343,"18.0":0.01262,"18.1":0.03364,"18.2":0.01262,"18.3":0.07149,"18.4":0.01682,"18.5-18.7":0.07149,"26.0":0.01682,"26.1":0.02103,"26.2":0.08831,"26.3":0.09251,"26.4":0.08831,"26.5":0.44994,"26.6":3.13693,"27.2":0.00421},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00238,"5.0-5.1":0.00238,"6.0-6.1":0,"7.0-7.1":0.00477,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.02385,"11.0-11.2":0.00238,"11.3-11.4":0.00477,"12.0-12.1":0,"12.2-12.5":0.062,"13.0-13.1":0,"13.2":0.01192,"13.3":0,"13.4-13.7":0.00238,"14.0-14.4":0.00954,"14.5-14.8":0.01431,"15.0-15.1":0.01431,"15.2-15.3":0.00954,"15.4":0.01192,"15.5":0.01431,"15.6-15.8":0.31,"16.0":0.02385,"16.1":0.04292,"16.2":0.02385,"16.3":0.05246,"16.4":0.01192,"16.5":0.01908,"16.6-16.7":0.43162,"17.0":0.01669,"17.1":0.02385,"17.2":0.02385,"17.3":0.03577,"17.4":0.05008,"17.5":0.09777,"17.6-17.7":0.25277,"18.0":0.05246,"18.1":0.10492,"18.2":0.14308,"18.3":0.248,"18.4":0.155,"18.5-18.7":3.20257,"26.0":0.155,"26.1":0.15739,"26.2":0.41016,"26.3":0.44354,"26.4":0.32431,"26.5":2.17241,"26.6":13.40408,"27.0":1.02778,"27.1":0,"27.2":0.02623},P:{"21":0.00966,"22":0.01933,"23":0.00966,"24":0.01933,"25":0.01933,"26":0.06764,"27":0.02899,"28":0.06764,"29":0.11596,"30":3.27592,_:"4 20 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.02316,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.20283,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10Line truncated
@@ -0,0 +1,321 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-useless-default-assignment',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow default values that will never be used',
recommended: 'strict',
requiresTypeChecking: true,
},
fixable: 'code',
messages: {
noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.',
preferOptionalSyntax: 'Using `= undefined` to make a parameter optional adds unnecessary runtime logic. Use the `?` optional syntax instead.',
uselessDefaultAssignment: 'Default value is useless because the {{ type }} is not optional.',
uselessUndefined: 'Default value is useless because it is undefined. Optional {{ type }}s are already undefined by default.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: {
type: 'boolean',
description: 'Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.',
},
},
},
],
},
defaultOptions: [
{
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
},
],
create(context, [{ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing }]) {
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
const compilerOptions = services.program.getCompilerOptions();
const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks');
if (!isStrictNullChecks &&
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) {
context.report({
loc: {
start: { column: 0, line: 0 },
end: { column: 0, line: 0 },
},
messageId: 'noStrictNullCheck',
});
}
function canBeUndefined(type) {
if ((0, util_1.isTypeAnyType)(type) || (0, util_1.isTypeUnknownType)(type)) {
return true;
}
return tsutils
.unionConstituents(type)
.some(part => (0, util_1.isTypeFlagSet)(part, ts.TypeFlags.Undefined));
}
function getArrayElementType(arrayType, elementIndex) {
if (checker.isTupleType(arrayType)) {
const tupleArgs = checker.getTypeArguments(arrayType);
if (elementIndex < tupleArgs.length) {
return tupleArgs[elementIndex];
}
}
return arrayType.getNumberIndexType() ?? null;
}
function checkAssignmentPattern(node) {
if (node.right.type === utils_1.AST_NODE_TYPES.Identifier &&
node.right.name === 'undefined') {
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
if (ts.isParameter(tsNode) &&
tsNode.type &&
canBeUndefined(checker.getTypeFromTypeNode(tsNode.type))) {
reportPreferOptionalSyntax(node);
return;
}
const type = node.parent.type === utils_1.AST_NODE_TYPES.Property ||
node.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern
? 'property'
: 'parameter';
reportUselessUndefined(node, type);
return;
}
const parent = node.parent;
if (parent.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression ||
parent.type === utils_1.AST_NODE_TYPES.FunctionExpression) {
const paramIndex = parent.params.indexOf(node);
if (paramIndex !== -1) {
const tsFunc = services.esTreeNodeToTSNodeMap.get(parent);
// tsFunc is already a FunctionLike subtype; defensive runtime check
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (ts.isFunctionLike(tsFunc)) {
const contextualType = checker.getContextualType(tsFunc);
if (!contextualType) {
return;
}
const signatures = contextualType.getCallSignatures();
if (signatures.length === 0 ||
signatures[0].getDeclaration() === tsFunc) {
return;
}
const params = signatures[0].getParameters();
if (paramIndex < params.length) {
const paramSymbol = params[paramIndex];
if (paramSymbol.valueDeclaration &&
ts.isParameter(paramSymbol.valueDeclaration) &&
paramSymbol.valueDeclaration.dotDotDotToken != null) {
return;
}
if (!tsutils.isSymbolFlagSet(paramSymbol, ts.SymbolFlags.Optional)) {
const paramType = checker.getTypeOfSymbol(paramSymbol);
if (!tsutils.isTypeParameter(paramType) &&
!canBeUndefined(paramType)) {
reportUselessDefaultAssignment(node, 'parameter');
}
}
}
}
}
return;
}
if (parent.type === utils_1.AST_NODE_TYPES.Property) {
const propertyType = getTypeOfProperty(parent);
if (!propertyType) {
return;
}
if (!canBeUndefined(propertyType)) {
reportUselessDefaultAssignment(node, 'property');
}
}
else if (parent.type === utils_1.AST_NODE_TYPES.ArrayPattern) {
const sourceType = getSourceTypeForPattern(parent);
if (!sourceType) {
return;
}
if (!checker.isTupleType(sourceType)) {
return;
}
const tupleArgs = checker.getTypeArguments(sourceType);
const elementIndex = parent.elements.indexOf(node);
if (elementIndex < 0 || elementIndex >= tupleArgs.length) {
return;
}
const elementType = tupleArgs[elementIndex];
if (!canBeUndefined(elementType)) {
reportUselessDefaultAssignment(node, 'property');
}
}
}
function getTypeOfProperty(node) {
const objectPattern = node.parent;
const sourceType = getSourceTypeForPattern(objectPattern);
if (!sourceType) {
return null;
}
const propertyName = getPropertyName(node.key);
if (!propertyName) {
return null;
}
const symbol = sourceType.getProperty(propertyName);
if (!symbol) {
return null;
}
if (tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Optional)) {
const parent = objectPattern.parent;
if (parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator &&
parent.init &&
hasConditionalInitializer(objectPattern)) {
const propertyName = getPropertyName(node.key);
if (!propertyName ||
!hasPropertyInAllBranches(parent.init, propertyName)) {
return null;
}
}
}
return checker.getTypeOfSymbol(symbol);
}
function hasConditionalInitializer(node) {
const parent = node.parent;
if (!parent) {
return false;
}
if (parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator && parent.init) {
return (parent.init.type === utils_1.AST_NODE_TYPES.ConditionalExpression ||
parent.init.type === utils_1.AST_NODE_TYPES.LogicalExpression);
}
return hasConditionalInitializer(parent);
}
function getSourceTypeForPattern(pattern) {
const parent = (0, util_1.nullThrows)(pattern.parent, util_1.NullThrowsReasons.MissingParent);
if (parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator && parent.init) {
const tsNode = services.esTreeNodeToTSNodeMap.get(parent.init);
return checker.getTypeAtLocation(tsNode);
}
if ((0, util_1.isFunction)(parent)) {
let paramIndex = parent.params.indexOf(pattern);
const tsFunc = services.esTreeNodeToTSNodeMap.get(parent);
const signature = (0, util_1.nullThrows)(checker.getSignatureFromDeclaration(tsFunc), util_1.NullThrowsReasons.MissingToken('signature', 'function'));
const params = signature.getParameters();
if (signature.thisParameter) {
paramIndex--;
}
if (paramIndex < 0 || paramIndex >= params.length) {
return null;
}
return checker.getTypeOfSymbol(params[paramIndex]);
}
if (parent.type === utils_1.AST_NODE_TYPES.AssignmentPattern) {
return getSourceTypeForPattern(parent);
}
if (parent.type === utils_1.AST_NODE_TYPES.Property) {
return getTypeOfProperty(parent);
}
if (parent.type === utils_1.AST_NODE_TYPES.ArrayPattern) {
const arrayType = getSourceTypeForPattern(parent);
if (!arrayType) {
return null;
}
const elementIndex = parent.elements.indexOf(pattern);
return getArrayElementType(arrayType, elementIndex);
}
return null;
}
function getPropertyName(key) {
switch (key.type) {
case utils_1.AST_NODE_TYPES.Identifier:
return key.name;
case utils_1.AST_NODE_TYPES.Literal:
return String(key.value);
case utils_1.AST_NODE_TYPES.TemplateLiteral:
return key.expressions.length ? null : key.quasis[0].value.cooked;
default:
return null;
}
}
function reportUselessDefaultAssignment(node, type) {
context.report({
node: node.right,
messageId: 'uselessDefaultAssignment',
data: { type },
fix: fixer => removeDefault(fixer, node),
});
}
function reportUselessUndefined(node, type) {
context.report({
node: node.right,
messageId: 'uselessUndefined',
data: { type },
fix: fixer => removeDefault(fixer, node),
});
}
function reportPreferOptionalSyntax(node) {
context.report({
node: node.right,
messageId: 'preferOptionalSyntax',
*fix(fixer) {
yield removeDefault(fixer, node);
const { left } = node;
if (left.type === utils_1.AST_NODE_TYPES.Identifier) {
yield fixer.insertTextAfterRange([left.range[0], left.range[0] + left.name.length], '?');
}
},
});
}
function removeDefault(fixer, node) {
const start = node.left.range[1];
const end = node.range[1];
return fixer.removeRange([start, end]);
}
function hasPropertyInAllBranches(expression, propertyName) {
return ((expression.type === utils_1.AST_NODE_TYPES.ObjectExpression &&
expression.properties.some(prop => prop.type === utils_1.AST_NODE_TYPES.Property &&
getPropertyName(prop.key) === propertyName)) ||
(expression.type === utils_1.AST_NODE_TYPES.ConditionalExpression &&
hasPropertyInAllBranches(expression.consequent, propertyName) &&
hasPropertyInAllBranches(expression.alternate, propertyName)));
}
return {
AssignmentPattern: checkAssignmentPattern,
};
},
});
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","130":"_b"},B:{"1":"_J"},C:{"1":"_SL _XC","257":"_g _wB _L"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_c"},G:{"1":"_M"},H:{"1":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"EventTarget.addEventListener()",D:true};
@@ -0,0 +1,20 @@
/**
* @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 Dice5 = createLucideIcon("Dice5", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
["path", { d: "M16 8h.01", key: "cr5u4v" }],
["path", { d: "M8 8h.01", key: "1e4136" }],
["path", { d: "M8 16h.01", key: "18s6g9" }],
["path", { d: "M16 16h.01", key: "1f9h7w" }],
["path", { d: "M12 12h.01", key: "1mp3jc" }]
]);
export { Dice5 as default };
//# sourceMappingURL=dice-5.js.map
@@ -0,0 +1,37 @@
/**
* @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 Croissant = createLucideIcon("Croissant", [
[
"path",
{
d: "m4.6 13.11 5.79-3.21c1.89-1.05 4.79 1.78 3.71 3.71l-3.22 5.81C8.8 23.16.79 15.23 4.6 13.11Z",
key: "1ozxlb"
}
],
[
"path",
{
d: "m10.5 9.5-1-2.29C9.2 6.48 8.8 6 8 6H4.5C2.79 6 2 6.5 2 8.5a7.71 7.71 0 0 0 2 4.83",
key: "ffuyb5"
}
],
["path", { d: "M8 6c0-1.55.24-4-2-4-2 0-2.5 2.17-2.5 4", key: "osnpzi" }],
[
"path",
{
d: "m14.5 13.5 2.29 1c.73.3 1.21.7 1.21 1.5v3.5c0 1.71-.5 2.5-2.5 2.5a7.71 7.71 0 0 1-4.83-2",
key: "1vubaw"
}
],
["path", { d: "M18 16c1.55 0 4-.24 4 2 0 2-2.17 2.5-4 2.5", key: "wxr772" }]
]);
export { Croissant as default };
//# sourceMappingURL=croissant.js.map
@@ -0,0 +1,923 @@
export default `flf2a$ 9 8 19 0 3 0 64 0
Font Author: CoSMiC cHiLD
FIGFont created by patorjk.com's FIGFont Editor: http://patorjk.com/figfont-editor
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
▄████████$@
███ ███$@
███ ███$@
███ ███$@
▀███████████$@
███ ███$@
███ ███$@
███ █▀ $@
@@
▀█████████▄ $@
███ ███$@
███ ███$@
▄███▄▄▄██▀ $@
▀▀███▀▀▀██▄ $@
███ ██▄$@
███ ███$@
▄█████████▀ $@
@@
▄████████$@
███ ███$@
███ █▀ $@
███ $@
███ $@
███ █▄ $@
███ ███$@
████████▀ $@
@@
████████▄ $@
███ ▀███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ▄███$@
████████▀ $@
@@
▄████████$@
███ ███$@
███ █▀ $@
▄███▄▄▄ $@
▀▀███▀▀▀ $@
███ █▄ $@
███ ███$@
██████████$@
@@
▄████████$@
███ ███$@
███ █▀ $@
▄███▄▄▄ $@
▀▀███▀▀▀ $@
███ $@
███ $@
███ $@
@@
▄██████▄ $@
███ ███$@
███ █▀ $@
▄███ $@
▀▀███ ████▄ $@
███ ███$@
███ ███$@
████████▀ $@
@@
▄█ █▄ $@
███ ███ $@
███ ███ $@
▄███▄▄▄▄███▄▄$@
▀▀███▀▀▀▀███▀ $@
███ ███ $@
███ ███ $@
███ █▀ $@
@@
▄█ $@
███ $@
███▌$@
███▌$@
███▌$@
███ $@
███ $@
█▀ $@
@@
▄█$@
███$@
███$@
███$@
███$@
███$@
███$@
█▄ ▄███$@
▀▀▀▀▀▀ $@@
▄█ ▄█▄$@
███ ▄███▀$@
███▐██▀ $@
▄█████▀ $@
▀▀█████▄ $@
███▐██▄ $@
███ ▀███▄$@
███ ▀█▀$@
▀ $@@
▄█ $@
███ $@
███ $@
███ $@
███ $@
███ $@
███▌ ▄$@
█████▄▄██$@
▀ $@@
▄▄▄▄███▄▄▄▄ $@
▄██▀▀▀███▀▀▀██▄$@
███ ███ ███$@
███ ███ ███$@
███ ███ ███$@
███ ███ ███$@
███ ███ ███$@
▀█ ███ █▀ $@
@@
███▄▄▄▄ $@
███▀▀▀██▄$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
▀█ █▀ $@
@@
▄██████▄ $@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
▀██████▀ $@
@@
▄███████▄$@
███ ███$@
███ ███$@
███ ███$@
▀█████████▀ $@
███ $@
███ $@
▄████▀ $@
@@
████████▄ $@
███ ███ $@
███ ███ $@
███ ███ $@
███ ███ $@
███ ███ $@
███ ▀ ███ $@
▀██████▀▄█$@
@@
▄████████$@
███ ███$@
███ ███$@
▄███▄▄▄▄██▀$@
▀▀███▀▀▀▀▀ $@
▀███████████$@
███ ███$@
███ ███$@
███ ███$@@
▄████████$@
███ ███$@
███ █▀ $@
███ $@
▀███████████$@
███$@
▄█ ███$@
▄████████▀ $@
@@
███ $@
▀█████████▄$@
▀███▀▀██$@
███ ▀$@
███ $@
███ $@
███ $@
▄████▀ $@
@@
███ █▄ $@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
████████▀ $@
@@
▄█ █▄ $@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
▀██████▀ $@
@@
▄█ █▄ $@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ▄█▄ ███$@
▀███▀███▀ $@
@@
▀████ ▐████▀$@
███▌ ████▀ $@
███ ▐███ $@
▀███▄███▀ $@
████▀██▄ $@
▐███ ▀███ $@
▄███ ███▄ $@
████ ███▄$@
@@
▄██ ▄ $@
███ ██▄$@
███▄▄▄███$@
▀▀▀▀▀▀███$@
▄██ ███$@
███ ███$@
███ ███$@
▀█████▀ $@
@@
▄███████▄ $@
██▀ ▄██$@
▄███▀$@
▀█▀▄███▀▄▄$@
▄███▀ ▀$@
▄███▀ $@
███▄ ▄█$@
▀████████▀$@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
▄████████$@
███ ███$@
███ ███$@
███ ███$@
▀███████████$@
███ ███$@
███ ███$@
███ █▀ $@
@@
▀█████████▄ $@
███ ███$@
███ ███$@
▄███▄▄▄██▀ $@
▀▀███▀▀▀██▄ $@
███ ██▄$@
███ ███$@
▄█████████▀ $@
@@
▄████████$@
███ ███$@
███ █▀ $@
███ $@
███ $@
███ █▄ $@
███ ███$@
████████▀ $@
@@
████████▄ $@
███ ▀███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ▄███$@
████████▀ $@
@@
▄████████$@
███ ███$@
███ █▀ $@
▄███▄▄▄ $@
▀▀███▀▀▀ $@
███ █▄ $@
███ ███$@
██████████$@
@@
▄████████$@
███ ███$@
███ █▀ $@
▄███▄▄▄ $@
▀▀███▀▀▀ $@
███ $@
███ $@
███ $@
@@
▄██████▄ $@
███ ███$@
███ █▀ $@
▄███ $@
▀▀███ ████▄ $@
███ ███$@
███ ███$@
████████▀ $@
@@
▄█ █▄ $@
███ ███ $@
███ ███ $@
▄███▄▄▄▄███▄▄$@
▀▀███▀▀▀▀███▀ $@
███ ███ $@
███ ███ $@
███ █▀ $@
@@
▄█ $@
███ $@
███▌$@
███▌$@
███▌$@
███ $@
███ $@
█▀ $@
@@
▄█$@
███$@
███$@
███$@
███$@
███$@
███$@
█▄ ▄███$@
▀▀▀▀▀▀ $@@
▄█ ▄█▄$@
███ ▄███▀$@
███▐██▀ $@
▄█████▀ $@
▀▀█████▄ $@
███▐██▄ $@
███ ▀███▄$@
███ ▀█▀$@
▀ $@@
▄█ $@
███ $@
███ $@
███ $@
███ $@
███ $@
███▌ ▄$@
█████▄▄██$@
▀ $@@
▄▄▄▄███▄▄▄▄ $@
▄██▀▀▀███▀▀▀██▄$@
███ ███ ███$@
███ ███ ███$@
███ ███ ███$@
███ ███ ███$@
███ ███ ███$@
▀█ ███ █▀ $@
@@
███▄▄▄▄ $@
███▀▀▀██▄$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
▀█ █▀ $@
@@
▄██████▄ $@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
▀██████▀ $@
@@
▄███████▄$@
███ ███$@
███ ███$@
███ ███$@
▀█████████▀ $@
███ $@
███ $@
▄████▀ $@
@@
████████▄ $@
███ ███ $@
███ ███ $@
███ ███ $@
███ ███ $@
███ ███ $@
███ ▀ ███ $@
▀██████▀▄█$@
@@
▄████████$@
███ ███$@
███ ███$@
▄███▄▄▄▄██▀$@
▀▀███▀▀▀▀▀ $@
▀███████████$@
███ ███$@
███ ███$@
███ ███$@@
▄████████$@
███ ███$@
███ █▀ $@
███ $@
▀███████████$@
███$@
▄█ ███$@
▄████████▀ $@
@@
███ $@
▀█████████▄$@
▀███▀▀██$@
███ ▀$@
███ $@
███ $@
███ $@
▄████▀ $@
@@
███ █▄ $@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
████████▀ $@
@@
▄█ █▄ $@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
▀██████▀ $@
@@
▄█ █▄ $@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ███$@
███ ▄█▄ ███$@
▀███▀███▀ $@
@@
▀████ ▐████▀$@
███▌ ████▀ $@
███ ▐███ $@
▀███▄███▀ $@
████▀██▄ $@
▐███ ▀███ $@
▄███ ███▄ $@
████ ███▄$@
@@
▄██ ▄ $@
███ ██▄$@
███▄▄▄███$@
▀▀▀▀▀▀███$@
▄██ ███$@
███ ███$@
███ ███$@
▀█████▀ $@
@@
▄███████▄ $@
██▀ ▄██$@
▄███▀$@
▀█▀▄███▀▄▄$@
▄███▀ ▀$@
▄███▀ $@
███▄ ▄█$@
▀████████▀$@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_9C","2":"_aB"},C:{"1":"_4L","2":"_5D","132":"_rB _2Q"},D:{"1":"_aE","2":"_rG"},E:{"1":"_JB","2":"_RB"},F:{"1":"_BF","2":"_9G"},G:{"1":"_9","2":"_iB"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_U","2":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"URLSearchParams",D:true};
@@ -0,0 +1,24 @@
import { observeTimeline } from 'motion-dom';
import { scrollInfo } from './track.mjs';
import { getTimeline } from './utils/get-timeline.mjs';
/**
* If the onScroll function has two arguments, it's expecting
* more specific information about the scroll from scrollInfo.
*/
function isOnScrollWithInfo(onScroll) {
return onScroll.length === 2;
}
function attachToFunction(onScroll, options) {
if (isOnScrollWithInfo(onScroll)) {
return scrollInfo((info) => {
onScroll(info[options.axis].progress, info);
}, options);
}
else {
return observeTimeline(onScroll, getTimeline(options));
}
}
export { attachToFunction };
//# sourceMappingURL=attach-function.mjs.map
@@ -0,0 +1,55 @@
#!/usr/bin/env node
let { nanoid, customAlphabet } = require('..')
function print(msg) {
process.stdout.write(msg + '\n')
}
function error(msg) {
process.stderr.write(msg + '\n')
process.exit(1)
}
if (process.argv.includes('--help') || process.argv.includes('-h')) {
print(`
Usage
$ nanoid [options]
Options
-s, --size Generated ID size
-a, --alphabet Alphabet to use
-h, --help Show this help
Examples
$ nanoid --s 15
S9sBF77U6sDB8Yg
$ nanoid --size 10 --alphabet abc
bcabababca`)
process.exit()
}
let alphabet, size
for (let i = 2; i < process.argv.length; i++) {
let arg = process.argv[i]
if (arg === '--size' || arg === '-s') {
size = Number(process.argv[i + 1])
i += 1
if (Number.isNaN(size) || size <= 0) {
error('Size must be positive integer')
}
} else if (arg === '--alphabet' || arg === '-a') {
alphabet = process.argv[i + 1]
i += 1
} else {
error('Unknown argument ' + arg)
}
}
if (alphabet) {
let customNanoid = customAlphabet(alphabet, size)
print(customNanoid())
} else {
print(nanoid(size))
}
@@ -0,0 +1,801 @@
/*!
* GridStack 12.6.0
* https://gridstackjs.com/
*
* Copyright (c) 2021-2025 Alain Dumesny
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
*/
import { GridStackEngine } from './gridstack-engine';
import { Utils } from './utils';
import { ColumnOptions, GridItemHTMLElement, GridStackElement, GridStackEventHandlerCallback, GridStackNode, GridStackWidget, numberOrString, DDDragOpt, GridStackOptions, GridStackEventHandler, GridStackNodesHandler, AddRemoveFcn, SaveFcn, CompactOptions, ResizeToContentFcn, GridStackDroppedHandler, GridStackElementHandler, Position, RenderFcn } from './types';
import { DDGridStack } from './dd-gridstack';
export * from './types';
export * from './utils';
export * from './gridstack-engine';
export * from './dd-gridstack';
export * from './dd-manager';
export * from './dd-element';
export * from './dd-draggable';
export * from './dd-droppable';
export * from './dd-resizable';
export * from './dd-resizable-handle';
export * from './dd-base-impl';
export interface GridHTMLElement extends HTMLElement {
gridstack?: GridStack;
}
/** list of possible events, or space separated list of them */
export type GridStackEvent = 'added' | 'change' | 'disable' | 'drag' | 'dragstart' | 'dragstop' | 'dropped' | 'enable' | 'removed' | 'resize' | 'resizestart' | 'resizestop' | 'resizecontent';
/** Defines the coordinates of an object */
export interface MousePosition {
top: number;
left: number;
}
/** Defines the position of a cell inside the grid*/
export interface CellPosition {
x: number;
y: number;
}
/**
* Main gridstack class - you will need to call `GridStack.init()` first to initialize your grid.
* Note: your grid elements MUST have the following classes for the CSS layout to work:
* @example
* <div class="grid-stack">
* <div class="grid-stack-item">
* <div class="grid-stack-item-content">Item 1</div>
* </div>
* </div>
*/
export declare class GridStack {
el: GridHTMLElement;
opts: GridStackOptions;
/**
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support
* multiple grids initialization at once. Or you can use addGrid() to create the entire grid from JSON.
* @param options grid options (optional)
* @param elOrString element or CSS selector (first one used) to convert to a grid (default to '.grid-stack' class selector)
*
* @example
* const grid = GridStack.init();
*
* Note: the HTMLElement (of type GridHTMLElement) will store a `gridstack: GridStack` value that can be retrieve later
* const grid = document.querySelector('.grid-stack').gridstack;
*/
static init(options?: GridStackOptions, elOrString?: GridStackElement): GridStack;
/**
* Will initialize a list of elements (given a selector) and return an array of grids.
* @param options grid options (optional)
* @param selector elements selector to convert to grids (default to '.grid-stack' class selector)
*
* @example
* const grids = GridStack.initAll();
* grids.forEach(...)
*/
static initAll(options?: GridStackOptions, selector?: string): GridStack[];
/**
* call to create a grid with the given options, including loading any children from JSON structure. This will call GridStack.init(), then
* grid.load() on any passed children (recursively). Great alternative to calling init() if you want entire grid to come from
* JSON serialized data, including options.
* @param parent HTML element parent to the grid
* @param opt grids options used to initialize the grid, and list of children
*/
static addGrid(parent: HTMLElement, opt?: GridStackOptions): GridStack;
/** call this method to register your engine instead of the default one.
* See instead `GridStackOptions.engineClass` if you only need to
* replace just one instance.
*/
static registerEngine(engineClass: typeof GridStackEngine): void;
/**
* callback method use when new items|grids needs to be created or deleted, instead of the default
* item: <div class="grid-stack-item"><div class="grid-stack-item-content">w.content</div></div>
* grid: <div class="grid-stack">grid content...</div>
* add = true: the returned DOM element will then be converted to a GridItemHTMLElement using makeWidget()|GridStack:init().
* add = false: the item will be removed from DOM (if not already done)
* grid = true|false for grid vs grid-items
*/
static addRemoveCB?: AddRemoveFcn;
/**
* callback during saving to application can inject extra data for each widget, on top of the grid layout properties
*/
static saveCB?: SaveFcn;
/**
* callback to create the content of widgets so the app can control how to store and restore it
* By default this lib will do 'el.textContent = w.content' forcing text only support for avoiding potential XSS issues.
*/
static renderCB?: RenderFcn;
/** called after a widget has been updated (eg: load() into an existing list of children) so application can do extra work */
static updateCB?: (w: GridStackNode) => void;
/** callback to use for resizeToContent instead of the built in one */
static resizeToContentCB?: ResizeToContentFcn;
/** parent class for sizing content. defaults to '.grid-stack-item-content' */
static resizeToContentParent: string;
/** scoping so users can call GridStack.Utils.sort() for example */
static Utils: typeof Utils;
/** scoping so users can call new GridStack.Engine(12) for example */
static Engine: typeof GridStackEngine;
/** engine used to implement non DOM grid functionality */
engine: GridStackEngine;
/** point to a parent grid item if we're nested (inside a grid-item in between 2 Grids) */
parentGridNode?: GridStackNode;
/** time to wait for animation (if enabled) to be done so content sizing can happen */
animationDelay: number;
protected static engineClass: typeof GridStackEngine;
protected resizeObserver: ResizeObserver;
protected responseLayout: ColumnOptions;
private _skipInitialResize;
/**
* Construct a grid item from the given element and options
* @param el the HTML element tied to this grid after it's been initialized
* @param opts grid options - public for classes to access, but use methods to modify!
*/
constructor(el: GridHTMLElement, opts?: GridStackOptions);
private _updateColumnVar;
/**
* add a new widget and returns it.
*
* Widget will be always placed even if result height is more than actual grid height.
* You need to use `willItFit()` before calling addWidget for additional check.
* See also `makeWidget(el)` for DOM element.
*
* @example
* const grid = GridStack.init();
* grid.addWidget({w: 3, content: 'hello'});
*
* @param w GridStackWidget definition. used MakeWidget(el) if you have dom element instead.
*/
addWidget(w: GridStackWidget): GridItemHTMLElement;
/**
* Create the default grid item divs and content (possibly lazy loaded) by using GridStack.renderCB().
*
* @param n GridStackNode definition containing widget configuration
* @returns the created HTML element with proper grid item structure
*
* @example
* const element = grid.createWidgetDivs({ w: 2, h: 1, content: 'Hello World' });
*/
createWidgetDivs(n: GridStackNode): HTMLElement;
/**
* Convert an existing gridItem element into a sub-grid with the given (optional) options, else inherit them
* from the parent's subGrid options.
* @param el gridItem element to convert
* @param ops (optional) sub-grid options, else default to node, then parent settings, else defaults
* @param nodeToAdd (optional) node to add to the newly created sub grid (used when dragging over existing regular item)
* @param saveContent if true (default) the html inside .grid-stack-content will be saved to child widget
* @returns newly created grid
*/
makeSubGrid(el: GridItemHTMLElement, ops?: GridStackOptions, nodeToAdd?: GridStackNode, saveContent?: boolean): GridStack;
/**
* called when an item was converted into a nested grid to accommodate a dragged over item, but then item leaves - return back
* to the original grid-item. Also called to remove empty sub-grids when last item is dragged out (since re-creating is simple)
*/
removeAsSubGrid(nodeThatRemoved?: GridStackNode): void;
/**
* saves the current layout returning a list of widgets for serialization which might include any nested grids.
* @param saveContent if true (default) the latest html inside .grid-stack-content will be saved to GridStackWidget.content field, else it will
* be removed.
* @param saveGridOpt if true (default false), save the grid options itself, so you can call the new GridStack.addGrid()
* to recreate everything from scratch. GridStackOptions.children would then contain the widget list instead.
* @param saveCB callback for each node -> widget, so application can insert additional data to be saved into the widget data structure.
* @param column if provided, the grid will be saved for the given column size (IFF we have matching internal saved layout, or current layout).
* Otherwise it will use the largest possible layout (say 12 even if rendering at 1 column) so we can restore to all layouts.
* NOTE: if you want to save to currently display layout, pass this.getColumn() as column.
* NOTE2: nested grids will ALWAYS save to the container size to be in sync with parent.
* @returns list of widgets or full grid option, including .children list of widgets
*/
save(saveContent?: boolean, saveGridOpt?: boolean, saveCB?: SaveFcn, column?: number): GridStackWidget[] | GridStackOptions;
/**
* Load widgets from a list. This will call update() on each (matching by id) or add/remove widgets that are not there.
* Used to restore a grid layout for a saved layout list (see `save()`).
*
* @param items list of widgets definition to update/create
* @param addRemove boolean (default true) or callback method can be passed to control if and how missing widgets can be added/removed, giving
* the user control of insertion.
* @returns the grid instance for chaining
*
* @example
* // Basic usage with saved layout
* const savedLayout = grid.save(); // Save current layout
* // ... later restore it
* grid.load(savedLayout);
*
* // Load with custom add/remove callback
* grid.load(layout, (items, grid, add) => {
* if (add) {
* // Custom logic for adding new widgets
* items.forEach(item => {
* const el = document.createElement('div');
* el.innerHTML = item.content || '';
* grid.addWidget(el, item);
* });
* } else {
* // Custom logic for removing widgets
* items.forEach(item => grid.removeWidget(item.el));
* }
* });
*
* // Load without adding/removing missing widgets
* grid.load(layout, false);
*
* @see {@link http://gridstackjs.com/demo/serialization.html} for complete example
*/
load(items: GridStackWidget[], addRemove?: boolean | AddRemoveFcn): GridStack;
/**
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
* and get a single event callback. You will see no changes until `batchUpdate(false)` is called.
*/
batchUpdate(flag?: boolean): GridStack;
/**
* Gets the current cell height in pixels. This takes into account the unit type and converts to pixels if necessary.
*
* @param forcePixel if true, forces conversion to pixels even when cellHeight is specified in other units
* @returns the cell height in pixels
*
* @example
* const height = grid.getCellHeight();
* console.log('Cell height:', height, 'px');
*
* // Force pixel conversion
* const pixelHeight = grid.getCellHeight(true);
*/
getCellHeight(forcePixel?: boolean): number;
/**
* Update current cell height - see `GridStackOptions.cellHeight` for format by updating eh Browser CSS variable.
*
* @param val the cell height. Options:
* - `undefined`: cells content will be made square (match width minus margin)
* - `0`: the CSS will be generated by the application instead
* - number: height in pixels
* - string: height with units (e.g., '70px', '5rem', '2em')
* @returns the grid instance for chaining
*
* @example
* grid.cellHeight(100); // 100px height
* grid.cellHeight('70px'); // explicit pixel height
* grid.cellHeight('5rem'); // relative to root font size
* grid.cellHeight(grid.cellWidth() * 1.2); // aspect ratio
* grid.cellHeight('auto'); // auto-size based on content
*/
cellHeight(val?: numberOrString): GridStack;
/** Gets current cell width. */
/**
* Gets the current cell width in pixels. This is calculated based on the grid container width divided by the number of columns.
*
* @returns the cell width in pixels
*
* @example
* const width = grid.cellWidth();
* console.log('Cell width:', width, 'px');
*
* // Use cell width to calculate widget dimensions
* const widgetWidth = width * 3; // For a 3-column wide widget
*/
cellWidth(): number;
/** return our expected width (or parent) , and optionally of window for dynamic column check */
protected _widthOrContainer(forBreakpoint?: boolean): number;
/** checks for dynamic column count for our current size, returning true if changed */
protected checkDynamicColumn(): boolean;
/**
* Re-layout grid items to reclaim any empty space. This is useful after removing widgets
* or when you want to optimize the layout.
*
* @param layout layout type. Options:
* - 'compact' (default): might re-order items to fill any empty space
* - 'list': keep the widget left->right order the same, even if that means leaving an empty slot if things don't fit
* @param doSort re-sort items first based on x,y position. Set to false to do your own sorting ahead (default: true)
* @returns the grid instance for chaining
*
* @example
* // Compact layout after removing widgets
* grid.removeWidget('.widget-to-remove');
* grid.compact();
*
* // Use list layout (preserve order)
* grid.compact('list');
*
* // Compact without sorting first
* grid.compact('compact', false);
*/
compact(layout?: CompactOptions, doSort?: boolean): GridStack;
/**
* Set the number of columns in the grid. Will update existing widgets to conform to new number of columns,
* as well as cache the original layout so you can revert back to previous positions without loss.
*
* Requires `gridstack-extra.css` or `gridstack-extra.min.css` for [2-11] columns,
* else you will need to generate correct CSS.
* See: https://github.com/gridstack/gridstack.js#change-grid-columns
*
* @param column Integer > 0 (default 12)
* @param layout specify the type of re-layout that will happen. Options:
* - 'moveScale' (default): scale widget positions and sizes
* - 'move': keep widget sizes, only move positions
* - 'scale': keep widget positions, only scale sizes
* - 'none': don't change widget positions or sizes
* Note: items will never be outside of the current column boundaries.
* Ignored for `column=1` as we always want to vertically stack.
* @returns the grid instance for chaining
*
* @example
* // Change to 6 columns with default scaling
* grid.column(6);
*
* // Change to 4 columns, only move positions
* grid.column(4, 'move');
*
* // Single column layout (vertical stack)
* grid.column(1);
*/
column(column: number, layout?: ColumnOptions): GridStack;
/**
* Get the number of columns in the grid (default 12).
*
* @returns the current number of columns in the grid
*
* @example
* const columnCount = grid.getColumn(); // returns 12 by default
*/
getColumn(): number;
/**
* Returns an array of grid HTML elements (no placeholder) - used to iterate through our children in DOM order.
* This method excludes placeholder elements and returns only actual grid items.
*
* @returns array of GridItemHTMLElement instances representing all grid items
*
* @example
* const items = grid.getGridItems();
* items.forEach(item => {
* console.log('Item ID:', item.gridstackNode.id);
* });
*/
getGridItems(): GridItemHTMLElement[];
/**
* Returns true if change callbacks should be ignored due to column change, sizeToContent, loading, etc.
* This is useful for callers who want to implement dirty flag functionality.
*
* @returns true if change callbacks are currently being ignored
*
* @example
* if (!grid.isIgnoreChangeCB()) {
* // Process the change event
* console.log('Grid layout changed');
* }
*/
isIgnoreChangeCB(): boolean;
/**
* Destroys a grid instance. DO NOT CALL any methods or access any vars after this as it will free up members.
* @param removeDOM if `false` grid and items HTML elements will not be removed from the DOM (Optional. Default `true`).
*/
destroy(removeDOM?: boolean): GridStack;
/**
* Enable/disable floating widgets (default: `false`). When enabled, widgets can float up to fill empty spaces.
* See [example](http://gridstackjs.com/demo/float.html)
*
* @param val true to enable floating, false to disable
* @returns the grid instance for chaining
*
* @example
* grid.float(true); // Enable floating
* grid.float(false); // Disable floating (default)
*/
float(val: boolean): GridStack;
/**
* Get the current float mode setting.
*
* @returns true if floating is enabled, false otherwise
*
* @example
* const isFloating = grid.getFloat();
* console.log('Floating enabled:', isFloating);
*/
getFloat(): boolean;
/**
* Get the position of the cell under a pixel on screen.
* @param position the position of the pixel to resolve in
* absolute coordinates, as an object with top and left properties
* @param useDocRelative if true, value will be based on document position vs parent position (Optional. Default false).
* Useful when grid is within `position: relative` element
*
* Returns an object with properties `x` and `y` i.e. the column and row in the grid.
*/
getCellFromPixel(position: MousePosition, useDocRelative?: boolean): CellPosition;
/**
* Returns the current number of rows, which will be at least `minRow` if set.
* The row count is based on the highest positioned widget in the grid.
*
* @returns the current number of rows in the grid
*
* @example
* const rowCount = grid.getRow();
* console.log('Grid has', rowCount, 'rows');
*/
getRow(): number;
/**
* Checks if the specified rectangular area is empty (no widgets occupy any part of it).
*
* @param x the x coordinate (column) of the area to check
* @param y the y coordinate (row) of the area to check
* @param w the width in columns of the area to check
* @param h the height in rows of the area to check
* @returns true if the area is completely empty, false if any widget overlaps
*
* @example
* // Check if a 2x2 area at position (1,1) is empty
* if (grid.isAreaEmpty(1, 1, 2, 2)) {
* console.log('Area is available for placement');
* }
*/
isAreaEmpty(x: number, y: number, w: number, h: number): boolean;
/**
* If you add elements to your grid by hand (or have some framework creating DOM), you have to tell gridstack afterwards to make them widgets.
* If you want gridstack to add the elements for you, use `addWidget()` instead.
* Makes the given element a widget and returns it.
*
* @param els widget or single selector to convert.
* @param options widget definition to use instead of reading attributes or using default sizing values
* @returns the converted GridItemHTMLElement
*
* @example
* const grid = GridStack.init();
*
* // Create HTML content manually, possibly looking like:
* // <div id="item-1" gs-x="0" gs-y="0" gs-w="3" gs-h="2"></div>
* grid.el.innerHTML = '<div id="item-1" gs-w="3"></div><div id="item-2"></div>';
*
* // Convert existing elements to widgets
* grid.makeWidget('#item-1'); // Uses gs-* attributes from DOM
* grid.makeWidget('#item-2', {w: 2, h: 1, content: 'Hello World'});
*
* // Or pass DOM element directly
* const element = document.getElementById('item-3');
* grid.makeWidget(element, {x: 0, y: 1, w: 4, h: 2});
*/
makeWidget(els: GridStackElement, options?: GridStackWidget): GridItemHTMLElement;
/**
* Register event handler for grid events. You can call this on a single event name, or space separated list.
*
* Supported events:
* - `added`: Called when widgets are being added to a grid
* - `change`: Occurs when widgets change their position/size due to constraints or direct changes
* - `disable`: Called when grid becomes disabled
* - `dragstart`: Called when grid item starts being dragged
* - `drag`: Called while grid item is being dragged (for each new row/column value)
* - `dragstop`: Called after user is done moving the item, with updated DOM attributes
* - `dropped`: Called when an item has been dropped and accepted over a grid
* - `enable`: Called when grid becomes enabled
* - `removed`: Called when items are being removed from the grid
* - `resizestart`: Called before user starts resizing an item
* - `resize`: Called while grid item is being resized (for each new row/column value)
* - `resizestop`: Called after user is done resizing the item, with updated DOM attributes
*
* @param name event name(s) to listen for (space separated for multiple)
* @param callback function to call when event occurs
* @returns the grid instance for chaining
*
* @example
* // Listen to multiple events at once
* grid.on('added removed change', (event, items) => {
* items.forEach(item => console.log('Item changed:', item));
* });
*
* // Listen to individual events
* grid.on('added', (event, items) => {
* items.forEach(item => console.log('Added item:', item));
* });
*/
on(name: 'dropped', callback: GridStackDroppedHandler): GridStack;
on(name: 'enable' | 'disable', callback: GridStackEventHandler): GridStack;
on(name: 'change' | 'added' | 'removed' | 'resizecontent', callback: GridStackNodesHandler): GridStack;
on(name: 'resizestart' | 'resize' | 'resizestop' | 'dragstart' | 'drag' | 'dragstop', callback: GridStackElementHandler): GridStack;
on(name: string, callback: GridStackEventHandlerCallback): GridStack;
/**
* unsubscribe from the 'on' event GridStackEvent
* @param name of the event (see possible values) or list of names space separated
*/
off(name: GridStackEvent | string): GridStack;
/**
* Remove all event handlers from the grid. This is useful for cleanup when destroying a grid.
*
* @returns the grid instance for chaining
*
* @example
* grid.offAll(); // Remove all event listeners
*/
offAll(): GridStack;
/**
* Removes widget from the grid.
* @param el widget or selector to modify
* @param removeDOM if `false` DOM element won't be removed from the tree (Default? true).
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
*/
removeWidget(els: GridStackElement, removeDOM?: boolean, triggerEvent?: boolean): GridStack;
/**
* Removes all widgets from the grid.
* @param removeDOM if `false` DOM elements won't be removed from the tree (Default? `true`).
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
*/
removeAll(removeDOM?: boolean, triggerEvent?: boolean): GridStack;
/**
* Toggle the grid animation state. Toggles the `grid-stack-animate` class.
* @param doAnimate if true the grid will animate.
* @param delay if true setting will be set on next event loop.
*/
setAnimation(doAnimate?: boolean, delay?: boolean): GridStack;
/**
* Toggle the grid static state, which permanently removes/add Drag&Drop support, unlike disable()/enable() that just turns it off/on.
* Also toggle the grid-stack-static class.
* @param val if true the grid become static.
* @param updateClass true (default) if css class gets updated
* @param recurse true (default) if sub-grids also get updated
*/
setStatic(val: boolean, updateClass?: boolean, recurse?: boolean): GridStack;
/**
* Updates the passed in options on the grid (similar to update(widget) for for the grid options).
* @param options PARTIAL grid options to update - only items specified will be updated.
* NOTE: not all options updating are currently supported (lot of code, unlikely to change)
*/
updateOptions(o: GridStackOptions): GridStack;
/**
* Updates widget position/size and other info. This is used to change widget properties after creation.
* Can update position, size, content, and other widget properties.
*
* Note: If you need to call this on all nodes, use load() instead which will update what changed.
* Setting the same x,y for multiple items will be indeterministic and likely unwanted.
*
* @param els widget element(s) or selector to modify
* @param opt new widget options (x,y,w,h, etc.). Only those set will be updated.
* @returns the grid instance for chaining
*
* @example
* // Update widget size and position
* grid.update('.my-widget', { x: 2, y: 1, w: 3, h: 2 });
*
* // Update widget content
* grid.update(widget, { content: '<p>New content</p>' });
*
* // Update multiple properties
* grid.update('#my-widget', {
* w: 4,
* h: 3,
* noResize: true,
* locked: true
* });
*/
update(els: GridStackElement, opt: GridStackWidget): GridStack;
private moveNode;
/**
* Updates widget height to match the content height to avoid vertical scrollbars or dead space.
* This automatically adjusts the widget height based on its content size.
*
* Note: This assumes only 1 child under resizeToContentParent='.grid-stack-item-content'
* (sized to gridItem minus padding) that represents the entire content size.
*
* @param el the grid item element to resize
*
* @example
* // Resize a widget to fit its content
* const widget = document.querySelector('.grid-stack-item');
* grid.resizeToContent(widget);
*
* // This is commonly used with dynamic content:
* widget.querySelector('.content').innerHTML = 'New longer content...';
* grid.resizeToContent(widget);
*/
resizeToContent(el: GridItemHTMLElement): void;
/** call the user resize (so they can do extra work) else our build in version */
private resizeToContentCBCheck;
/**
* Rotate widgets by swapping their width and height. This is typically called when the user presses 'r' during dragging.
* The rotation swaps the w/h dimensions and adjusts min/max constraints accordingly.
*
* @param els widget element(s) or selector to rotate
* @param relative optional pixel coordinate relative to upper/left corner to rotate around (keeps that cell under cursor)
* @returns the grid instance for chaining
*
* @example
* // Rotate a specific widget
* grid.rotate('.my-widget');
*
* // Rotate with relative positioning during drag
* grid.rotate(widget, { left: 50, top: 30 });
*/
rotate(els: GridStackElement, relative?: Position): GridStack;
/**
* Updates the margins which will set all 4 sides at once - see `GridStackOptions.margin` for format options.
* Supports CSS string format of 1, 2, or 4 values or a single number.
*
* @param value margin value - can be:
* - Single number: `10` (applies to all sides)
* - Two values: `'10px 20px'` (top/bottom, left/right)
* - Four values: `'10px 20px 5px 15px'` (top, right, bottom, left)
* @returns the grid instance for chaining
*
* @example
* grid.margin(10); // 10px all sides
* grid.margin('10px 20px'); // 10px top/bottom, 20px left/right
* grid.margin('5px 10px 15px 20px'); // Different for each side
*/
margin(value: numberOrString): GridStack;
/**
* Returns the current margin value as a number (undefined if the 4 sides don't match).
* This only returns a number if all sides have the same margin value.
*
* @returns the margin value in pixels, or undefined if sides have different values
*
* @example
* const margin = grid.getMargin();
* if (margin !== undefined) {
* console.log('Uniform margin:', margin, 'px');
* } else {
* console.log('Margins are different on different sides');
* }
*/
getMargin(): number;
/**
* Returns true if the height of the grid will be less than the vertical
* constraint. Always returns true if grid doesn't have height constraint.
* @param node contains x,y,w,h,auto-position options
*
* @example
* if (grid.willItFit(newWidget)) {
* grid.addWidget(newWidget);
* } else {
* alert('Not enough free space to place the widget');
* }
*/
willItFit(node: GridStackWidget): boolean;
/**
* called when we are being resized - check if the one Column Mode needs to be turned on/off
* and remember the prev columns we used, or get our count from parent, as well as check for cellHeight==='auto' (square)
* or `sizeToContent` gridItem options.
*/
onResize(clientWidth?: number): GridStack;
/** resizes content for given node (or all) if shouldSizeToContent() is true */
private resizeToContentCheck;
/** add or remove the grid element size event handler */
protected _updateResizeEvent(forceRemove?: boolean): GridStack;
/**
* Get the global drag & drop implementation instance.
* This provides access to the underlying drag & drop functionality.
*
* @returns the DDGridStack instance used for drag & drop operations
*
* @example
* const dd = GridStack.getDD();
* // Access drag & drop functionality
*/
static getDD(): DDGridStack;
/**
* call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
* Called during GridStack.init() as options, but can also be called directly (last param are used) in case the toolbar
* is dynamically create and needs to be set later.
* @param dragIn string selector (ex: '.sidebar-item') or list of dom elements
* @param dragInOptions options - see DDDragOpt. (default: {handle: '.grid-stack-item-content', appendTo: 'body'}
* @param widgets GridStackWidget def to assign to each element which defines what to create on drop
* @param root optional root which defaults to document (for shadow dom pass the parent HTMLDocument)
*/
static setupDragIn(dragIn?: string | HTMLElement[], dragInOptions?: DDDragOpt, widgets?: GridStackWidget[], root?: HTMLElement | Document): void;
/**
* Enables/Disables dragging by the user for specific grid elements.
* For all items and future items, use enableMove() instead. No-op for static grids.
*
* Note: If you want to prevent an item from moving due to being pushed around by another
* during collision, use the 'locked' property instead.
*
* @param els widget element(s) or selector to modify
* @param val if true widget will be draggable, assuming the parent grid isn't noMove or static
* @returns the grid instance for chaining
*
* @example
* // Make specific widgets draggable
* grid.movable('.my-widget', true);
*
* // Disable dragging for specific widgets
* grid.movable('#fixed-widget', false);
*/
movable(els: GridStackElement, val: boolean): GridStack;
/**
* Enables/Disables user resizing for specific grid elements.
* For all items and future items, use enableResize() instead. No-op for static grids.
*
* @param els widget element(s) or selector to modify
* @param val if true widget will be resizable, assuming the parent grid isn't noResize or static
* @returns the grid instance for chaining
*
* @example
* // Make specific widgets resizable
* grid.resizable('.my-widget', true);
*
* // Disable resizing for specific widgets
* grid.resizable('#fixed-size-widget', false);
*/
resizable(els: GridStackElement, val: boolean): GridStack;
/**
* Temporarily disables widgets moving/resizing.
* If you want a more permanent way (which freezes up resources) use `setStatic(true)` instead.
*
* Note: This is a no-op for static grids.
*
* This is a shortcut for:
* ```typescript
* grid.enableMove(false);
* grid.enableResize(false);
* ```
*
* @param recurse if true (default), sub-grids also get updated
* @returns the grid instance for chaining
*
* @example
* // Disable all interactions
* grid.disable();
*
* // Disable only this grid, not sub-grids
* grid.disable(false);
*/
disable(recurse?: boolean): GridStack;
/**
* Re-enables widgets moving/resizing - see disable().
* Note: This is a no-op for static grids.
*
* This is a shortcut for:
* ```typescript
* grid.enableMove(true);
* grid.enableResize(true);
* ```
*
* @param recurse if true (default), sub-grids also get updated
* @returns the grid instance for chaining
*
* @example
* // Re-enable all interactions
* grid.enable();
*
* // Enable only this grid, not sub-grids
* grid.enable(false);
*/
enable(recurse?: boolean): GridStack;
/**
* Enables/disables widget moving for all widgets. No-op for static grids.
* Note: locally defined items (with noMove property) still override this setting.
*
* @param doEnable if true widgets will be movable, if false moving is disabled
* @param recurse if true (default), sub-grids also get updated
* @returns the grid instance for chaining
*
* @example
* // Enable moving for all widgets
* grid.enableMove(true);
*
* // Disable moving for all widgets
* grid.enableMove(false);
*
* // Enable only this grid, not sub-grids
* grid.enableMove(true, false);
*/
enableMove(doEnable: boolean, recurse?: boolean): GridStack;
/**
* Enables/disables widget resizing for all widgets. No-op for static grids.
* Note: locally defined items (with noResize property) still override this setting.
*
* @param doEnable if true widgets will be resizable, if false resizing is disabled
* @param recurse if true (default), sub-grids also get updated
* @returns the grid instance for chaining
*
* @example
* // Enable resizing for all widgets
* grid.enableResize(true);
*
* // Disable resizing for all widgets
* grid.enableResize(false);
*
* // Enable only this grid, not sub-grids
* grid.enableResize(true, false);
*/
enableResize(doEnable: boolean, recurse?: boolean): GridStack;
/**
* prepares the element for drag&drop - this is normally called by makeWidget() unless are are delay loading
* @param el GridItemHTMLElement of the widget
* @param [force=false]
* */
prepareDragDrop(el: GridItemHTMLElement, force?: boolean): GridStack;
/** call given event callback on our main top-most grid (if we're nested) */
protected triggerEvent(event: Event, target: GridItemHTMLElement): void;
}
@@ -0,0 +1 @@
{"version":3,"file":"stream.js","sources":["../src/stream.ts"],"sourcesContent":["import {createParser} from './parse.ts'\nimport type {EventSourceMessage, EventSourceParser} from './types.ts'\n\n/**\n * Options for the EventSourceParserStream.\n *\n * @public\n */\nexport interface StreamOptions {\n /**\n * Behavior when a parsing error occurs.\n *\n * - A custom function can be provided to handle the error.\n * - `'terminate'` will error the stream and stop parsing.\n * - Any other value will ignore the error and continue parsing.\n *\n * @defaultValue `undefined`\n */\n onError?: ('terminate' | ((error: Error) => void)) | undefined\n\n /**\n * Callback for when a reconnection interval is sent from the server.\n *\n * @param retry - The number of milliseconds to wait before reconnecting.\n */\n onRetry?: ((retry: number) => void) | undefined\n\n /**\n * Callback for when a comment is encountered in the stream.\n *\n * @param comment - The comment encountered in the stream.\n */\n onComment?: ((comment: string) => void) | undefined\n\n /**\n * Maximum number of characters the parser is allowed to buffer across calls to `feed()`.\n * See {@link ParserConfig.maxBufferSize} for details.\n *\n * When the limit is exceeded, the stream is always errored (regardless of the `onError`\n * setting) since the underlying parser is unrecoverable without a `reset()`.\n *\n * @defaultValue `undefined` (unbounded)\n */\n maxBufferSize?: number | undefined\n}\n\n/**\n * A TransformStream that ingests a stream of strings and produces a stream of `EventSourceMessage`.\n *\n * @example Basic usage\n * ```\n * const eventStream =\n * response.body\n * .pipeThrough(new TextDecoderStream())\n * .pipeThrough(new EventSourceParserStream())\n * ```\n *\n * @example Terminate stream on parsing errors\n * ```\n * const eventStream =\n * response.body\n * .pipeThrough(new TextDecoderStream())\n * .pipeThrough(new EventSourceParserStream({onError: 'terminate'}))\n * ```\n *\n * @public\n */\nexport class EventSourceParserStream extends TransformStream<string, EventSourceMessage> {\n constructor({onError, onRetry, onComment, maxBufferSize}: StreamOptions = {}) {\n let parser!: EventSourceParser\n\n super({\n start(controller) {\n parser = createParser({\n onEvent: (event) => {\n controller.enqueue(event)\n },\n onError(error) {\n if (typeof onError === 'function') {\n onError(error)\n }\n\n // `max-buffer-size-exceeded` is fatal — the parser is unusable until\n // `reset()`, which the stream wrapper has no way to call. Always\n // terminate the stream in that case so consumers see the meaningful\n // `ParseError` instead of an opaque \"cannot feed terminated parser\"\n // throw from the next chunk.\n if (onError === 'terminate' || error.type === 'max-buffer-size-exceeded') {\n controller.error(error)\n }\n\n // Ignore by default\n },\n onRetry,\n onComment,\n maxBufferSize,\n })\n },\n transform(chunk) {\n parser.feed(chunk)\n },\n })\n }\n}\n\nexport {type ErrorType, ParseError} from './errors.ts'\nexport type {EventSourceMessage} from './types.ts'\n"],"names":[],"mappings":";;AAmEO,MAAM,gCAAgC,gBAA4C;AAAA,EACvF,YAAY,EAAC,SAAS,SAAS,WAAW,cAAA,IAAgC,IAAI;AAC5E,QAAI;AAEJ,UAAM;AAAA,MACJ,MAAM,YAAY;AAChB,iBAAS,aAAa;AAAA,UACpB,SAAS,CAAC,UAAU;AAClB,uBAAW,QAAQ,KAAK;AAAA,UAC1B;AAAA,UACA,QAAQ,OAAO;AACT,mBAAO,WAAY,cACrB,QAAQ,KAAK,IAQX,YAAY,eAAe,MAAM,SAAS,+BAC5C,WAAW,MAAM,KAAK;AAAA,UAI1B;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,CACD;AAAA,MACH;AAAA,MACA,UAAU,OAAO;AACf,eAAO,KAAK,KAAK;AAAA,MACnB;AAAA,IAAA,CACD;AAAA,EACH;AACF;"}
@@ -0,0 +1,272 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
var RestTypeKind;
(function (RestTypeKind) {
RestTypeKind[RestTypeKind["Array"] = 0] = "Array";
RestTypeKind[RestTypeKind["Tuple"] = 1] = "Tuple";
RestTypeKind[RestTypeKind["Other"] = 2] = "Other";
})(RestTypeKind || (RestTypeKind = {}));
class FunctionSignature {
paramTypes;
restType;
hasConsumedArguments = false;
parameterTypeIndex = 0;
constructor(paramTypes, restType) {
this.paramTypes = paramTypes;
this.restType = restType;
}
static create(checker, tsNode) {
const signature = checker.getResolvedSignature(tsNode);
if (!signature) {
return null;
}
const paramTypes = [];
let restType = null;
const parameters = signature.getParameters();
for (let i = 0; i < parameters.length; i += 1) {
const param = parameters[i];
const type = checker.getTypeOfSymbolAtLocation(param, tsNode);
const decl = param.getDeclarations()?.[0];
if (decl && (0, util_1.isRestParameterDeclaration)(decl)) {
// is a rest param
if (checker.isArrayType(type)) {
restType = {
type: checker.getTypeArguments(type)[0],
index: i,
kind: RestTypeKind.Array,
};
}
else if (checker.isTupleType(type)) {
restType = {
index: i,
kind: RestTypeKind.Tuple,
typeArguments: checker.getTypeArguments(type),
};
}
else {
restType = {
type,
index: i,
kind: RestTypeKind.Other,
};
}
break;
}
paramTypes.push(type);
}
return new this(paramTypes, restType);
}
consumeRemainingArguments() {
this.hasConsumedArguments = true;
}
getNextParameterType() {
const index = this.parameterTypeIndex;
this.parameterTypeIndex += 1;
if (index >= this.paramTypes.length || this.hasConsumedArguments) {
if (this.restType == null) {
return null;
}
switch (this.restType.kind) {
case RestTypeKind.Tuple: {
const typeArguments = this.restType.typeArguments;
if (this.hasConsumedArguments) {
// all types consumed by a rest - just assume it's the last type
// there is one edge case where this is wrong, but we ignore it because
// it's rare and really complicated to handle
// eg: function foo(...a: [number, ...string[], number])
return typeArguments[typeArguments.length - 1];
}
const typeIndex = index - this.restType.index;
if (typeIndex >= typeArguments.length) {
return typeArguments[typeArguments.length - 1];
}
return typeArguments[typeIndex];
}
case RestTypeKind.Array:
case RestTypeKind.Other:
return this.restType.type;
}
}
return this.paramTypes[index];
}
}
exports.default = (0, util_1.createRule)({
name: 'no-unsafe-argument',
meta: {
type: 'problem',
docs: {
description: 'Disallow calling a function with a value with type `any`',
recommended: 'recommended',
requiresTypeChecking: true,
},
messages: {
unsafeArgument: 'Unsafe argument of type {{sender}} assigned to a parameter of type {{receiver}}.',
unsafeArraySpread: 'Unsafe spread of an {{sender}} array type.',
unsafeSpread: 'Unsafe spread of an {{sender}} type.',
unsafeTupleSpread: 'Unsafe spread of a tuple type. The argument is {{sender}} and is assigned to a parameter of type {{receiver}}.',
},
schema: [],
},
defaultOptions: [],
create(context) {
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
function describeType(type) {
if (tsutils.isIntrinsicErrorType(type)) {
return 'error typed';
}
return `\`${checker.typeToString(type)}\``;
}
function describeTypeForSpread(type) {
if (checker.isArrayType(type) &&
tsutils.isIntrinsicErrorType(checker.getTypeArguments(type)[0])) {
return 'error';
}
return describeType(type);
}
function describeTypeForTuple(type) {
if (tsutils.isIntrinsicErrorType(type)) {
return 'error typed';
}
return `of type \`${checker.typeToString(type)}\``;
}
function checkUnsafeArguments(args, callee, node) {
if (args.length === 0) {
return;
}
// ignore any-typed calls as these are caught by no-unsafe-call
if ((0, util_1.isTypeAnyType)(services.getTypeAtLocation(callee))) {
return;
}
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
const signature = (0, util_1.nullThrows)(FunctionSignature.create(checker, tsNode), 'Expected to a signature resolved');
if (node.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression) {
// Consumes the first parameter (TemplateStringsArray) of the function called with TaggedTemplateExpression.
signature.getNextParameterType();
}
for (const argument of args) {
switch (argument.type) {
// spreads consume
case utils_1.AST_NODE_TYPES.SpreadElement: {
const spreadArgType = services.getTypeAtLocation(argument.argument);
if ((0, util_1.isTypeAnyType)(spreadArgType)) {
// foo(...any)
context.report({
node: argument,
messageId: 'unsafeSpread',
data: { sender: describeType(spreadArgType) },
});
}
else if ((0, util_1.isTypeAnyArrayType)(spreadArgType, checker)) {
// foo(...any[])
// TODO - we could break down the spread and compare the array type against each argument
context.report({
node: argument,
messageId: 'unsafeArraySpread',
data: { sender: describeTypeForSpread(spreadArgType) },
});
}
else if (checker.isTupleType(spreadArgType)) {
// foo(...[tuple1, tuple2])
const spreadTypeArguments = checker.getTypeArguments(spreadArgType);
for (const tupleType of spreadTypeArguments) {
const parameterType = signature.getNextParameterType();
if (parameterType == null) {
continue;
}
const result = (0, util_1.isUnsafeAssignment)(tupleType, parameterType, checker,
// we can't pass the individual tuple members in here as this will most likely be a spread variable
// not a spread array
null);
if (result) {
context.report({
node: argument,
messageId: 'unsafeTupleSpread',
data: {
receiver: describeType(parameterType),
sender: describeTypeForTuple(tupleType),
},
});
}
}
if (spreadArgType.target.combinedFlags & ts.ElementFlags.Variable) {
// the last element was a rest - so all remaining defined arguments can be considered "consumed"
// all remaining arguments should be compared against the rest type (if one exists)
signature.consumeRemainingArguments();
}
}
else {
// something that's iterable
// handling this will be pretty complex - so we ignore it for now
// TODO - handle generic iterable case
}
break;
}
default: {
const parameterType = signature.getNextParameterType();
if (parameterType == null) {
continue;
}
const argumentType = services.getTypeAtLocation(argument);
const result = (0, util_1.isUnsafeAssignment)(argumentType, parameterType, checker, argument);
if (result) {
context.report({
node: argument,
messageId: 'unsafeArgument',
data: {
receiver: describeType(parameterType),
sender: describeType(argumentType),
},
});
}
}
}
}
}
return {
'CallExpression, NewExpression'(node) {
checkUnsafeArguments(node.arguments, node.callee, node);
},
TaggedTemplateExpression(node) {
checkUnsafeArguments(node.quasi.expressions, node.tag, node);
},
};
},
});
@@ -0,0 +1,6 @@
"use strict";
const { rules } = require("./index.js");
exports.name = "config-prettier";
exports.rules = rules;
@@ -0,0 +1,8 @@
import type { TSESTree } from '@typescript-eslint/types';
import { DefinitionBase } from './DefinitionBase';
import { DefinitionType } from './DefinitionType';
export declare class FunctionNameDefinition extends DefinitionBase<DefinitionType.FunctionName, TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.TSDeclareFunction | TSESTree.TSEmptyBodyFunctionExpression, null, TSESTree.Identifier> {
readonly isTypeDefinition = false;
readonly isVariableDefinition = true;
constructor(name: TSESTree.Identifier, node: FunctionNameDefinition['node']);
}
@@ -0,0 +1,24 @@
import { ReactiveNode } from './alien.cjs';
export { ReactiveFlags, createReactiveSystem } from './alien.cjs';
export type { Link, ReactiveNode } from './alien.cjs';
export declare function getActiveSub(): ReactiveNode | undefined;
export declare function setActiveSub(sub?: ReactiveNode): ReactiveNode | undefined;
export declare function getBatchDepth(): number;
export declare function startBatch(): void;
export declare function endBatch(): void;
export declare function isSignal(fn: () => void): boolean;
export declare function isComputed(fn: () => void): boolean;
export declare function isEffect(fn: () => void): boolean;
export declare function isEffectScope(fn: () => void): boolean;
export declare function signal<T>(): {
(): T | undefined;
(value: T | undefined): void;
};
export declare function signal<T>(initialValue: T): {
(): T;
(value: T): void;
};
export declare function computed<T>(getter: (previousValue?: T) => T): () => T;
export declare function effect(fn: () => void): () => void;
export declare function effectScope(fn: () => void): () => void;
export declare function trigger(fn: () => void): void;
@@ -0,0 +1 @@
{"version":3,"file":"separator-horizontal.js","sources":["../../../src/icons/separator-horizontal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SeparatorHorizontal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iMyIgeDI9IjIxIiB5MT0iMTIiIHkyPSIxMiIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSI4IDggMTIgNCAxNiA4IiAvPgogIDxwb2x5bGluZSBwb2ludHM9IjE2IDE2IDEyIDIwIDggMTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/separator-horizontal\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 SeparatorHorizontal = createLucideIcon('SeparatorHorizontal', [\n ['line', { x1: '3', x2: '21', y1: '12', y2: '12', key: '10d38w' }],\n ['polyline', { points: '8 8 12 4 16 8', key: 'zo8t4w' }],\n ['polyline', { points: '16 16 12 20 8 16', key: '1oyrid' }],\n]);\n\nexport default SeparatorHorizontal;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsB,iBAAiB,qBAAuB,CAAA,CAAA,CAAA;AAAA,CAClE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACjE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAoB,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;AAC5D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,85 @@
{
"name": "@modelcontextprotocol/core",
"version": "2.3.1",
"description": "Model Context Protocol for TypeScript — public Zod schemas (spec + OAuth/OpenID)",
"license": "Apache-2.0",
"author": "Anthropic, PBC (https://anthropic.com)",
"homepage": "https://modelcontextprotocol.io",
"bugs": "https://github.com/modelcontextprotocol/typescript-sdk/issues",
"type": "module",
"repository": {
"type": "git",
"url": "git+https://github.com/modelcontextprotocol/typescript-sdk.git"
},
"engines": {
"node": ">=20"
},
"keywords": [
"modelcontextprotocol",
"mcp",
"schemas",
"zod"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./internal": {
"import": {
"types": "./dist/internal.d.mts",
"default": "./dist/internal.mjs"
},
"require": {
"types": "./dist/internal.d.cts",
"default": "./dist/internal.cjs"
}
}
},
"typesVersions": {
"*": {
"internal": [
"dist/internal.d.mts"
]
}
},
"main": "./dist/index.cjs",
"types": "./dist/index.d.mts",
"files": [
"dist"
],
"dependencies": {
"zod": "^4.2.0"
},
"devDependencies": {
"@eslint/js": "^9.39.2",
"@typescript/native-preview": "^7.0.0-dev.20251217.1",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-n": "^17.23.1",
"prettier": "3.6.2",
"tsdown": "^0.18.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.48.1",
"vitest": "^4.0.15",
"@modelcontextprotocol/eslint-config": "^2.0.0",
"@modelcontextprotocol/tsconfig": "^2.0.0",
"@modelcontextprotocol/vitest-config": "^2.0.0"
},
"scripts": {
"typecheck": "tsgo -p tsconfig.json --noEmit",
"build": "tsdown",
"build:watch": "tsdown --watch",
"lint": "eslint src/ && prettier --ignore-path ../../.prettierignore --check .",
"lint:fix": "eslint src/ --fix && prettier --ignore-path ../../.prettierignore --write .",
"check": "pnpm run typecheck && pnpm run lint",
"test": "vitest run",
"test:watch": "vitest"
}
}
@@ -0,0 +1,32 @@
'use strict'
module.exports = {
kAgent: Symbol('agent'),
kOptions: Symbol('options'),
kFactory: Symbol('factory'),
kDispatches: Symbol('dispatches'),
kDispatchKey: Symbol('dispatch key'),
kDefaultHeaders: Symbol('default headers'),
kDefaultTrailers: Symbol('default trailers'),
kContentLength: Symbol('content length'),
kMockAgent: Symbol('mock agent'),
kMockAgentSet: Symbol('mock agent set'),
kMockAgentGet: Symbol('mock agent get'),
kMockDispatch: Symbol('mock dispatch'),
kClose: Symbol('close'),
kOriginalClose: Symbol('original agent close'),
kOriginalDispatch: Symbol('original dispatch'),
kOrigin: Symbol('origin'),
kIsMockActive: Symbol('is mock active'),
kNetConnect: Symbol('net connect'),
kGetNetConnect: Symbol('get net connect'),
kConnected: Symbol('connected'),
kIgnoreTrailingSlash: Symbol('ignore trailing slash'),
kMockAgentMockCallHistoryInstance: Symbol('mock agent mock call history name'),
kMockAgentRegisterCallHistory: Symbol('mock agent register mock call history'),
kMockAgentAddCallHistoryLog: Symbol('mock agent add call history log'),
kMockAgentIsCallHistoryEnabled: Symbol('mock agent is call history enabled'),
kMockAgentAcceptsNonStandardSearchParameters: Symbol('mock agent accepts non standard search parameters'),
kMockCallHistoryAddLog: Symbol('mock call history add log'),
kTotalDispatchCount: Symbol('total dispatch count')
}
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ensureBlock;
var _toBlock = require("./toBlock.js");
function ensureBlock(node, key = "body") {
const result = (0, _toBlock.default)(node[key], node);
node[key] = result;
return result;
}
//# sourceMappingURL=ensureBlock.js.map
@@ -0,0 +1,17 @@
"use strict";
const constants = require("./constants-DR3SPJ7u.js");
const daysOfYear = require("./daysOfYear-Bif7I3Cq.js");
function dayOfYear(date, val) {
const monthDays = daysOfYear.daysOfYear(date.getFullYear());
const currentMonth = date.getMonth();
let dayCount = date.getDate();
for (let i = 0; i < currentMonth; i++) {
dayCount += monthDays[i];
}
if (val === void 0) {
return dayCount;
}
date.setTime(+date + (val - dayCount) * constants.MS_IN_DAY);
return date;
}
module.exports = dayOfYear;
@@ -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 './clipboard-pen-line.js';
//# sourceMappingURL=clipboard-signature.js.map
@@ -0,0 +1 @@
{"version":3,"file":"footprints.js","sources":["../../../src/icons/footprints.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Footprints\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAxNnYtMi4zOEM0IDExLjUgMi45NyAxMC41IDMgOGMuMDMtMi43MiAxLjQ5LTYgNC41LTZDOS4zNyAyIDEwIDMuOCAxMCA1LjVjMCAzLjExLTIgNS42Ni0yIDguNjhWMTZhMiAyIDAgMSAxLTQgMFoiIC8+CiAgPHBhdGggZD0iTTIwIDIwdi0yLjM4YzAtMi4xMiAxLjAzLTMuMTIgMS01LjYyLS4wMy0yLjcyLTEuNDktNi00LjUtNkMxNC42MyA2IDE0IDcuOCAxNCA5LjVjMCAzLjExIDIgNS42NiAyIDguNjhWMjBhMiAyIDAgMSAwIDQgMFoiIC8+CiAgPHBhdGggZD0iTTE2IDE3aDQiIC8+CiAgPHBhdGggZD0iTTQgMTNoNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/footprints\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 Footprints = createLucideIcon('Footprints', [\n [\n 'path',\n {\n d: 'M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z',\n key: '1dudjm',\n },\n ],\n [\n 'path',\n {\n d: 'M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z',\n key: 'l2t8xc',\n },\n ],\n ['path', { d: 'M16 17h4', key: '1dejxt' }],\n ['path', { d: 'M4 13h4', key: '1bwh8b' }],\n]);\n\nexport default Footprints;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAChD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,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;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,32 @@
"use strict";
// Get the appropriate flag to use for creating files
// We use fmap on Windows platforms for files less than
// 512kb. This is a fairly low limit, but avoids making
// things slower in some cases. Since most of what this
// library is used for is extracting tarballs of many
// relatively small files in npm packages and the like,
// it can be a big boost on Windows platforms.
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWriteFlag = void 0;
const fs_1 = __importDefault(require("fs"));
const platform = process.env.__FAKE_PLATFORM__ || process.platform;
const isWindows = platform === 'win32';
/* c8 ignore start */
const { O_CREAT, O_NOFOLLOW, O_TRUNC, O_WRONLY } = fs_1.default.constants;
const UV_FS_O_FILEMAP = Number(process.env.__FAKE_FS_O_FILENAME__) ||
fs_1.default.constants.UV_FS_O_FILEMAP ||
0;
/* c8 ignore stop */
const fMapEnabled = isWindows && !!UV_FS_O_FILEMAP;
const fMapLimit = 512 * 1024;
const fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY;
const noFollowFlag = !isWindows && typeof O_NOFOLLOW === 'number' ?
O_NOFOLLOW | O_TRUNC | O_CREAT | O_WRONLY
: null;
exports.getWriteFlag = noFollowFlag !== null ? () => noFollowFlag
: !fMapEnabled ? () => 'w'
: (size) => (size < fMapLimit ? fMapFlag : 'w');
//# sourceMappingURL=get-write-flag.js.map
@@ -0,0 +1 @@
{"version":3,"file":"stretch-horizontal.js","sources":["../../../src/icons/stretch-horizontal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name StretchHorizontal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMjAiIGhlaWdodD0iNiIgeD0iMiIgeT0iNCIgcng9IjIiIC8+CiAgPHJlY3Qgd2lkdGg9IjIwIiBoZWlnaHQ9IjYiIHg9IjIiIHk9IjE0IiByeD0iMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/stretch-horizontal\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 StretchHorizontal = createLucideIcon('StretchHorizontal', [\n ['rect', { width: '20', height: '6', x: '2', y: '4', rx: '2', key: 'qdearl' }],\n ['rect', { width: '20', height: '6', x: '2', y: '14', rx: '2', key: '1xrn6j' }],\n]);\n\nexport default StretchHorizontal;\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,CAAK,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,CAC7E,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,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,128 @@
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: "tegn", verb: "havde" },
file: { unit: "bytes", verb: "havde" },
array: { unit: "elementer", verb: "indeholdt" },
set: { unit: "elementer", verb: "indeholdt" },
map: { unit: "elementer", verb: "indeholdt" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "input",
email: "e-mailadresse",
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 dato- og klokkeslæt",
date: "ISO-dato",
time: "ISO-klokkeslæt",
duration: "ISO-varighed",
ipv4: "IPv4-adresse",
ipv6: "IPv6-adresse",
mac: "MAC-adresse",
cidrv4: "IPv4-spektrum",
cidrv6: "IPv6-spektrum",
base64: "base64-kodet streng",
base64url: "base64url-kodet streng",
json_string: "JSON-streng",
e164: "E.164-nummer",
credit_card: "kreditkortnummer",
currency_code: "valutakode",
iban: "IBAN",
jwt: "JWT",
template_literal: "input",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
string: "streng",
number: "tal",
boolean: "boolean",
array: "liste",
object: "objekt",
set: "sæt",
file: "fil",
};
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 `Ugyldigt input: forventede instanceof ${issue.expected}, fik ${received}`;
}
return `Ugyldigt input: forventede ${expected}, fik ${received}`;
}
case "invalid_value":
if (issue.values.length === 1) return `Ugyldig værdi: forventede ${util.stringifyPrimitive(issue.values[0])}`;
return `Ugyldigt valg: forventede en af følgende ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
const origin = TypeDictionary[issue.origin] ?? issue.origin;
if (sizing)
return `For stor: forventede ${origin ?? "value"} ${sizing.verb} ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "elementer"}`;
return `For stor: forventede ${origin ?? "value"} havde ${adj} ${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
const origin = TypeDictionary[issue.origin] ?? issue.origin;
if (sizing) {
return `For lille: forventede ${origin} ${sizing.verb} ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
}
return `For lille: forventede ${origin} havde ${adj} ${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `Ugyldig streng: skal starte med "${_issue.prefix}"`;
if (_issue.format === "ends_with") return `Ugyldig streng: skal ende med "${_issue.suffix}"`;
if (_issue.format === "includes") return `Ugyldig streng: skal indeholde "${_issue.includes}"`;
if (_issue.format === "regex") return `Ugyldig streng: skal matche mønsteret ${_issue.pattern}`;
return `Ugyldig ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Ugyldigt tal: skal være deleligt med ${issue.divisor}`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Ukendte nøgler" : "Ukendt nøgle"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Ugyldig nøgle i ${issue.origin}`;
case "invalid_union":
return "Ugyldigt input: matcher ingen af de tilladte typer";
case "invalid_element":
return `Ugyldig værdi i ${issue.origin}`;
default:
return `Ugyldigt input`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -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 ListVideo = createLucideIcon("ListVideo", [
["path", { d: "M12 12H3", key: "18klou" }],
["path", { d: "M16 6H3", key: "1wxfjs" }],
["path", { d: "M12 18H3", key: "11ftsu" }],
["path", { d: "m16 12 5 3-5 3v-6Z", key: "zpskkp" }]
]);
export { ListVideo as default };
//# sourceMappingURL=list-video.js.map
@@ -0,0 +1,141 @@
var _a;
import { members as installMembers } from "./util.js";
/** A special constant with type `never` */
export const NEVER = /*@__PURE__*/ Object.freeze({
status: "aborted",
});
/* Shared descriptor for installing `_zod`; defineProperty reads it
* synchronously, so reusing one object avoids a per-instance allocation. */
const _zodDesc = { value: undefined, enumerable: false };
// null where suppressing the capture would be unrecoverable: `parse()` puts the frames back with `captureStackTrace`, so without it the throw would lose its stack. also latched to null once `stackTraceLimit` proves unassignable, which a realm can do at any point by hardening Error
let _E = "captureStackTrace" in Error ? Error : null;
// v8 captures a stack trace inside the Error constructor, which dominates a failed parse; costs only the frames, and parse() restores those. the constructor must RUN: Object.create is cheaper and passes instanceof, but Error.isError and util.types.isNativeError check an internal slot
function newError(Definition) {
const E = _E;
if (E) {
const saved = E.stackTraceLimit;
if (typeof saved === "number") {
try {
E.stackTraceLimit = 0;
}
catch {
_E = null;
return new Definition();
}
try {
return new Definition();
}
finally {
E.stackTraceLimit = saved;
}
}
}
return new Definition();
}
export /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer,
/** This trait's members, installed once on every prototype that composes it. They cannot be declared in the initializer above: that runs per instance, and the prototype is shared. */
proto, params) {
// Prototype for this constructor's `_zod` internals. Lazily-derived fields (`values`, `pattern`, `optin`, …) install here once rather than as an accessor on every instance.
const zodProto = {};
// Assigning the fields in the constructor body is what gives instances in-object slots; building the object literally and reparenting it costs a second allocation and a generic property copy.
function Internals(def) {
this.def = def;
this.constr = _;
this.traits = new Set();
}
Internals.prototype = zodProto;
const protoMembers = proto;
// One trait's members land on every prototype whose chain composes it, so the answer is per prototype rather than per trait.
const initialized = protoMembers && new WeakSet();
function init(inst, def) {
if (!inst._zod) {
_zodDesc.value = new Internals(def);
try {
Object.defineProperty(inst, "_zod", _zodDesc);
}
finally {
// Cleared even on throw, so the shared descriptor never leaks one instance's internals into the next.
_zodDesc.value = undefined;
}
}
else if (inst._zod.traits.has(name)) {
return;
}
inst._zod.traits.add(name);
initializer(inst, def);
if (initialized) {
// `super(def)` from a user subclass gives `this` a prototype the subclass owns, and installing there would overwrite whatever the subclass declared. `constr` built the instance, so its prototype is the one below the subclass's that should carry the members. A receiver whose chain never reaches that prototype installs on its own, which for a plain object handed straight to `init` means `Object.prototype` — unchanged from before.
const own = Object.getPrototypeOf(inst);
const ctorProto = inst._zod.constr.prototype;
let up = own;
while (up && up !== ctorProto)
up = Object.getPrototypeOf(up);
const target = up ?? own;
if (!initialized.has(target)) {
initialized.add(target);
installMembers(target, protoMembers);
}
}
// support prototype modifications; for-in avoids the array allocation of Object.keys on the (usually empty) prototype
const proto = _.prototype;
for (const k in proto) {
if (!Object.prototype.hasOwnProperty.call(proto, k))
continue;
if (!(k in inst)) {
inst[k] = proto[k].bind(inst);
}
}
}
// doesn't work if Parent has a constructor with arguments
const Parent = params?.Parent ?? Object;
class Definition extends Parent {
}
Object.defineProperty(Definition, "name", { value: name });
function _(def) {
const inst = params?.Parent ? newError(Definition) : this;
init(inst, def);
const deferred = inst._zod.deferred;
if (deferred) {
for (const fn of deferred) {
fn();
}
// Released: initializers run once, and the list would otherwise be retained for the schema's lifetime.
inst._zod.deferred = undefined;
}
// Global post-processor hook. Internal: installed by `import "zod/compile"` to enable AOT compilation for every constructed schema. Runs last, once the instance is fully built, because it hands the instance to compile(). The post-processor is expected to be reentrancy-guarded by its own implementation.
const pp = globalThis.__zod_globalConfig?.postProcessor;
if (pp)
pp(inst);
return inst;
}
Object.defineProperty(_, "init", { value: init });
Object.defineProperty(_, Symbol.hasInstance, {
value: (inst) => {
if (params?.Parent && inst instanceof params.Parent)
return true;
return inst?._zod?.traits?.has(name);
},
});
Object.defineProperty(_, "name", { value: name });
return _;
}
////////////////////////////// UTILITIES ///////////////////////////////////////
export const $brand = /*@__PURE__*/ Symbol("zod_brand");
export class $ZodAsyncError extends Error {
constructor() {
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
}
}
export class $ZodEncodeError extends Error {
constructor(name) {
super(`Encountered unidirectional transform during encode: ${name}`);
this.name = "ZodEncodeError";
}
}
(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
export const globalConfig = globalThis.__zod_globalConfig;
export function config(newConfig) {
if (newConfig)
Object.assign(globalConfig, newConfig);
return globalConfig;
}
@@ -0,0 +1,32 @@
import * as React from 'react';
import { Primitive } from '@radix-ui/react-primitive';
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
interface FocusScopeProps extends PrimitiveDivProps {
/**
* When `true`, tabbing from last item will focus first tabbable
* and shift+tab from first item will focus last tababble.
* @defaultValue false
*/
loop?: boolean;
/**
* When `true`, focus cannot escape the focus scope via keyboard,
* pointer, or a programmatic focus.
* @defaultValue false
*/
trapped?: boolean;
/**
* Event handler called when auto-focusing on mount.
* Can be prevented.
*/
onMountAutoFocus?: (event: Event) => void;
/**
* Event handler called when auto-focusing on unmount.
* Can be prevented.
*/
onUnmountAutoFocus?: (event: Event) => void;
}
declare const FocusScope: React.ForwardRefExoticComponent<FocusScopeProps & React.RefAttributes<HTMLDivElement>>;
declare const Root: React.ForwardRefExoticComponent<FocusScopeProps & React.RefAttributes<HTMLDivElement>>;
export { FocusScope, type FocusScopeProps, Root };