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 @@
{"version":3,"names":["_t","require","blockStatement","cloneNode","emptyStatement","expressionStatement","identifier","isStatement","isStringLiteral","stringLiteral","validate","populatePlaceholders","metadata","replacements","ast","placeholders","forEach","placeholder","hasOwnProperty","call","name","placeholderName","Error","Object","keys","key","placeholderNames","has","slice","reverse","_ref","applyReplacement","e","message","replacement","isDuplicate","Array","isArray","map","node","parent","index","resolve","type","undefined","set","value","typeAnnotation","optional","decorators","items","splice"],"sources":["../src/populate.ts"],"sourcesContent":["import {\n blockStatement,\n cloneNode,\n emptyStatement,\n expressionStatement,\n identifier,\n isStatement,\n isStringLiteral,\n stringLiteral,\n validate,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nimport type { TemplateReplacements } from \"./options.ts\";\nimport type { Metadata, Placeholder } from \"./parse.ts\";\n\nexport default function populatePlaceholders(\n metadata: Metadata,\n replacements: TemplateReplacements,\n): t.File {\n const ast = cloneNode(metadata.ast);\n\n if (replacements) {\n metadata.placeholders.forEach(placeholder => {\n if (!Object.hasOwn(replacements, placeholder.name)) {\n const placeholderName = placeholder.name;\n\n throw new Error(\n `Error: No substitution given for \"${placeholderName}\". If this is not meant to be a\n placeholder you may want to consider passing one of the following options to @babel/template:\n - { placeholderPattern: false, placeholderWhitelist: new Set(['${placeholderName}'])}\n - { placeholderPattern: /^${placeholderName}$/ }`,\n );\n }\n });\n Object.keys(replacements).forEach(key => {\n if (!metadata.placeholderNames.has(key)) {\n throw new Error(`Unknown substitution \"${key}\" given`);\n }\n });\n }\n\n // Process in reverse order so AST mutation doesn't change indices that\n // will be needed for later calls to `placeholder.resolve()`.\n metadata.placeholders\n .slice()\n .reverse()\n .forEach(placeholder => {\n try {\n applyReplacement(\n placeholder,\n ast,\n (replacements && replacements[placeholder.name]) ?? null,\n );\n } catch (e) {\n e.message = `@babel/template placeholder \"${placeholder.name}\": ${e.message}`;\n throw e;\n }\n });\n\n return ast;\n}\n\nfunction applyReplacement(\n placeholder: Placeholder,\n ast: t.File,\n replacement: any,\n) {\n // Track inserted nodes and clone them if they are inserted more than\n // once to avoid injecting the same node multiple times.\n if (placeholder.isDuplicate) {\n if (Array.isArray(replacement)) {\n replacement = replacement.map(node => cloneNode(node));\n } else if (typeof replacement === \"object\") {\n replacement = cloneNode(replacement);\n }\n }\n\n const { parent, key, index } = placeholder.resolve(ast);\n\n if (placeholder.type === \"string\") {\n if (typeof replacement === \"string\") {\n replacement = stringLiteral(replacement);\n }\n if (!replacement || !isStringLiteral(replacement)) {\n throw new Error(\"Expected string substitution\");\n }\n } else if (placeholder.type === \"statement\") {\n if (index === undefined) {\n if (!replacement) {\n replacement = emptyStatement();\n } else if (Array.isArray(replacement)) {\n replacement = blockStatement(replacement);\n } else if (typeof replacement === \"string\") {\n replacement = expressionStatement(identifier(replacement));\n } else if (!isStatement(replacement)) {\n replacement = expressionStatement(replacement);\n }\n } else {\n if (replacement && !Array.isArray(replacement)) {\n if (typeof replacement === \"string\") {\n replacement = identifier(replacement);\n }\n if (!isStatement(replacement)) {\n replacement = expressionStatement(replacement);\n }\n }\n }\n } else if (placeholder.type === \"param\") {\n if (typeof replacement === \"string\") {\n replacement = identifier(replacement);\n }\n\n if (index === undefined) throw new Error(\"Assertion failure.\");\n } else {\n if (typeof replacement === \"string\") {\n replacement = identifier(replacement);\n }\n if (Array.isArray(replacement)) {\n throw new Error(\"Cannot replace single expression with an array.\");\n }\n }\n\n function set(parent: any, key: any, value: any) {\n const node = parent[key] as t.Node;\n parent[key] = value;\n if (node.type === \"Identifier\" || node.type === \"Placeholder\") {\n if (node.typeAnnotation) {\n value.typeAnnotation = node.typeAnnotation;\n }\n if (node.optional) {\n value.optional = node.optional;\n }\n if (nodeLine truncated
@@ -0,0 +1,17 @@
const invisibleValues = new Set(["none", "hidden"]);
/**
* Returns a function that, when provided a progress value between 0 and 1,
* will return the "none" or "hidden" string only when the progress is that of
* the origin or target.
*/
function mixVisibility(origin, target) {
if (invisibleValues.has(origin)) {
return (p) => (p <= 0 ? origin : target);
}
else {
return (p) => (p >= 1 ? target : origin);
}
}
export { invisibleValues, mixVisibility };
//# sourceMappingURL=visibility.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/helpers.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAuBH,sEAoBC;AAaD,8EA0BC;AAtED;;;;;;;;;;GAUG;AACH,SAAgB,6BAA6B,CACzC,QAA4C,EAC5C,MAAc,EACd,UAA+B;IAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,iDAAiD,MAAM,GAAG,CAAC,CAAC;IAC7F,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,YAAY;YACb,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,gEAAgE,MAAM,GAAG,CAAC,CAAC;YAC5G,CAAC;YACD,MAAM;QAEV;YACI,yDAAyD;YACzD,MAAM;IACd,CAAC;AACL,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,iCAAiC,CAC7C,QAA4C,EAC5C,MAAc,EACd,UAA+B;IAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,iDAAiD,MAAM,GAAG,CAAC,CAAC;IAC7F,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,wBAAwB;YACzB,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAC;gBACpC,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,4EAA4E,MAAM,GAAG,CAAC,CAAC;YACxH,CAAC;YACD,MAAM;QAEV,KAAK,oBAAoB;YACrB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,wEAAwE,MAAM,GAAG,CAAC,CAAC;YACpH,CAAC;YACD,MAAM;QAEV;YACI,yDAAyD;YACzD,MAAM;IACd,CAAC;AACL,CAAC"}
@@ -0,0 +1,7 @@
'use strict'
module.exports = {
SemVer: require('./semver.js'),
Range: require('./range.js'),
Comparator: require('./comparator.js'),
}
@@ -0,0 +1,4 @@
import { g } from "./set-C8keYf_N.mjs";
export {
g as default
};
@@ -0,0 +1 @@
{"version":3,"names":[],"sources":["../src/types.ts"],"sourcesContent":["import type * as t from \"@babel/types\";\nimport type { NodePath } from \"./index.ts\";\nimport type { VirtualTypeAliases } from \"./path/lib/virtual-types.ts\";\nimport type {\n ExplVisitorBase,\n VisitorBaseNodes,\n VisitorBaseAliases,\n} from \"./generated/visitor-types.d.ts\";\n\nexport type VisitPhase = \"enter\" | \"exit\";\n\ninterface VisitNodeObject<S, P extends t.Node> {\n enter?: VisitNodeFunction<S, P>;\n exit?: VisitNodeFunction<S, P>;\n}\n\nexport interface ExplVisitNode<S, P extends t.Node> {\n enter?: VisitNodeFunction<S, P>[];\n exit?: VisitNodeFunction<S, P>[];\n}\n\nexport interface ExplodedVisitor<S = unknown>\n extends ExplVisitorBase<S>,\n ExplVisitNode<S, t.Node> {\n _exploded: true;\n _verified: true;\n}\n\n// TODO: Assert that the keys of this are the keys of VirtualTypeAliases without\n// the keys of VisitorBaseNodes and VisitorBaseAliases\n// prettier-ignore\ninterface VisitorVirtualAliases<S> {\n BindingIdentifier?: VisitNode<S, VirtualTypeAliases[\"BindingIdentifier\"]>;\n BlockScoped?: VisitNode<S, VirtualTypeAliases[\"BlockScoped\"]>;\n ExistentialTypeParam?: VisitNode<S, VirtualTypeAliases[\"ExistentialTypeParam\"]>;\n Expression?: VisitNode<S, VirtualTypeAliases[\"Expression\"]>;\n //Flow?: VisitNode<S, VirtualTypeAliases[\"Flow\"]>;\n ForAwaitStatement?: VisitNode<S, VirtualTypeAliases[\"ForAwaitStatement\"]>;\n Generated?: VisitNode<S, VirtualTypeAliases[\"Generated\"]>;\n NumericLiteralTypeAnnotation?: VisitNode<S, VirtualTypeAliases[\"NumericLiteralTypeAnnotation\"]>;\n Pure?: VisitNode<S, VirtualTypeAliases[\"Pure\"]>;\n Referenced?: VisitNode<S, VirtualTypeAliases[\"Referenced\"]>;\n ReferencedIdentifier?: VisitNode<S, VirtualTypeAliases[\"ReferencedIdentifier\"]>;\n ReferencedMemberExpression?: VisitNode<S, VirtualTypeAliases[\"ReferencedMemberExpression\"]>;\n //RestProperty?: VisitNode<S, VirtualTypeAliases[\"RestProperty\"]>;\n Scope?: VisitNode<S, VirtualTypeAliases[\"Scope\"]>;\n //SpreadProperty?: VisitNode<S, VirtualTypeAliases[\"SpreadProperty\"]>;\n Statement?: VisitNode<S, VirtualTypeAliases[\"Statement\"]>;\n User?: VisitNode<S, VirtualTypeAliases[\"User\"]>;\n Var?: VisitNode<S, VirtualTypeAliases[\"Var\"]>;\n}\n\n// TODO: Do not export this? Or give it a better name?\nexport interface VisitorBase<S>\n extends VisitNodeObject<S, t.Node>,\n VisitorBaseNodes<S>,\n VisitorBaseAliases<S>,\n VisitorVirtualAliases<S>,\n // Babel supports `NodeTypesWithoutComment | NodeTypesWithoutComment | ... ` but it is\n // too complex for TS. So we type it as a general visitor only if the key contains `|`\n // this is good enough for non-visitor traverse options e.g. `noScope`\n Record<`${string}|${string}`, VisitNode<S, t.Node>> {}\n\nexport type Visitor<S = unknown> = VisitorBase<S> | ExplodedVisitor<S>;\n\nexport type VisitNode<S, P extends t.Node> =\n | VisitNodeFunction<S, P>\n | VisitNodeObject<S, P>;\n\nexport type VisitNodeFunction<S, P extends t.Node> = (\n this: S,\n path: NodePath<P>,\n state: S,\n) => void;\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _isNativeReflectConstruct;
function _isNativeReflectConstruct() {
try {
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
} catch (_) {}
return (exports.default = _isNativeReflectConstruct = function () {
return !!result;
})();
}
//# sourceMappingURL=isNativeReflectConstruct.js.map
@@ -0,0 +1 @@
{"version":3,"file":"volume-off.js","sources":["../../../src/icons/volume-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name VolumeOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgOWE1IDUgMCAwIDEgLjk1IDIuMjkzIiAvPgogIDxwYXRoIGQ9Ik0xOS4zNjQgNS42MzZhOSA5IDAgMCAxIDEuODg5IDkuOTYiIC8+CiAgPHBhdGggZD0ibTIgMiAyMCAyMCIgLz4KICA8cGF0aCBkPSJtNyA3LS41ODcuNTg3QTEuNCAxLjQgMCAwIDEgNS40MTYgOEgzYTEgMSAwIDAgMC0xIDF2NmExIDEgMCAwIDAgMSAxaDIuNDE2YTEuNCAxLjQgMCAwIDEgLjk5Ny40MTNsMy4zODMgMy4zODRBLjcwNS43MDUgMCAwIDAgMTEgMTkuMjk4VjExIiAvPgogIDxwYXRoIGQ9Ik05LjgyOCA0LjE3MkEuNjg2LjY4NiAwIDAgMSAxMSA0LjY1N3YuNjg2IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/volume-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst VolumeOff = createLucideIcon('VolumeOff', [\n ['path', { d: 'M16 9a5 5 0 0 1 .95 2.293', key: '1fgyg8' }],\n ['path', { d: 'M19.364 5.636a9 9 0 0 1 1.889 9.96', key: 'l3zxae' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n [\n 'path',\n {\n d: 'm7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11',\n key: '1gbwow',\n },\n ],\n ['path', { d: 'M9.828 4.172A.686.686 0 0 1 11 4.657v.686', key: 's2je0y' }],\n]);\n\nexport default VolumeOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACnE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC3C,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;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,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5E,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,47 @@
import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';
import { transformPropOrder } from '../../../render/utils/keys-transform.mjs';
import { number } from '../../../value/types/numbers/index.mjs';
import { px } from '../../../value/types/numbers/units.mjs';
const isNumOrPxType = (v) => v === number || v === px;
const transformKeys = new Set(["x", "y", "z"]);
const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
function removeNonTranslationalTransform(visualElement) {
const removedTransforms = [];
nonTranslationalTransformKeys.forEach((key) => {
const value = visualElement.getValue(key);
if (value !== undefined) {
removedTransforms.push([key, value.get()]);
value.set(key.startsWith("scale") ? 1 : 0);
}
});
return removedTransforms;
}
const positionalValues = {
// Dimensions
width: ({ x }, { paddingLeft = "0", paddingRight = "0", boxSizing }) => {
const width = x.max - x.min;
return boxSizing === "border-box"
? width
: width - parseFloat(paddingLeft) - parseFloat(paddingRight);
},
height: ({ y }, { paddingTop = "0", paddingBottom = "0", boxSizing }) => {
const height = y.max - y.min;
return boxSizing === "border-box"
? height
: height - parseFloat(paddingTop) - parseFloat(paddingBottom);
},
top: (_bbox, { top }) => parseFloat(top),
left: (_bbox, { left }) => parseFloat(left),
bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),
right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),
// Transform
x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"),
y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"),
};
// Alias translate longform names
positionalValues.translateX = positionalValues.x;
positionalValues.translateY = positionalValues.y;
export { isNumOrPxType, positionalValues, removeNonTranslationalTransform };
//# sourceMappingURL=unit-conversion.mjs.map
@@ -0,0 +1,171 @@
# EnvHttpProxyAgent
<!--introduced_in=v6.14.0-->
<!--type=module-->
<!-- source_link=lib/dispatcher/env-http-proxy-agent.js -->
> Stability: 2 - Stable
`EnvHttpProxyAgent` is a [`Dispatcher`][] that reads its proxy configuration from
the `http_proxy`, `https_proxy`, and `no_proxy` environment variables and routes
requests through the appropriate proxy automatically. Import it from `undici`:
```mjs
import { EnvHttpProxyAgent } from 'undici'
```
When `http_proxy` and `https_proxy` are both set, `http_proxy` is used for HTTP
requests and `https_proxy` is used for HTTPS requests. If only `http_proxy` is
set, it is used for both HTTP and HTTPS requests. If only `https_proxy` is set,
it is used only for HTTPS requests.
`no_proxy` is a comma- or space-separated list of hosts that must not be
proxied. Each entry may include a leading dot or `*.` wildcard (for example
`.example.com`) to match subdomains, and an optional `:port` suffix to restrict
the match to a specific port. A request bypasses the proxy when its host equals
an entry or is a subdomain of one. A trailing dot is ignored on both sides, so
`example.com.` and `example.com` match each other. Setting `no_proxy` to `*`
bypasses the proxy for every request.
The uppercase variants `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` are also
honored. When both the lowercase and uppercase forms of a variable are set, the
lowercase form takes precedence and the uppercase form is ignored. The `no_proxy`
value is re-read from the environment on demand, so changes to it after the agent
is created take effect on subsequent requests; this does not apply when `noProxy`
is passed as an option.
## Class: `EnvHttpProxyAgent`
<!-- YAML
added: v6.14.0
-->
* Extends: {Dispatcher}
### `new EnvHttpProxyAgent([options])`
<!-- YAML
added: v6.14.0
-->
* `options` {EnvHttpProxyAgentOptions} Extends the [`ProxyAgent`][] options
(except `uri`). (optional)
* `httpProxy` {string} When set, overrides the `http_proxy` and `HTTP_PROXY`
environment variables. (optional)
* `httpsProxy` {string} When set, overrides the `https_proxy` and
`HTTPS_PROXY` environment variables. (optional)
* `noProxy` {string} When set, overrides the `no_proxy` and `NO_PROXY`
environment variables. (optional)
* Returns: {EnvHttpProxyAgent}
Creates a new `EnvHttpProxyAgent`. Any options other than `httpProxy`,
`httpsProxy`, and `noProxy` are forwarded to the underlying [`Agent`][] and
[`ProxyAgent`][] instances. Constructing the agent only configures it; it does
not affect any request until it is registered as a dispatcher, either globally
with `setGlobalDispatcher()` or per-request through the `dispatcher` option.
```mjs
import { EnvHttpProxyAgent } from 'undici'
const envHttpProxyAgent = new EnvHttpProxyAgent()
// or, overriding the environment variables explicitly:
const envHttpProxyAgentWithOpts = new EnvHttpProxyAgent({
httpProxy: 'my.proxy.server:8080',
httpsProxy: 'my.proxy.server:8443',
noProxy: 'localhost'
})
```
#### Example - Proxied `fetch()` with the global dispatcher
```mjs
import { setGlobalDispatcher, fetch, EnvHttpProxyAgent } from 'undici'
const envHttpProxyAgent = new EnvHttpProxyAgent()
setGlobalDispatcher(envHttpProxyAgent)
const response = await fetch('http://localhost:3000/foo')
console.log('response received', response.status) // response received 200
const data = await response.json() // data { foo: 'bar' }
```
#### Example - Proxied `request()` with the global dispatcher
```mjs
import { setGlobalDispatcher, request, EnvHttpProxyAgent } from 'undici'
const envHttpProxyAgent = new EnvHttpProxyAgent()
setGlobalDispatcher(envHttpProxyAgent)
const { statusCode, body } = await request('http://localhost:3000/foo')
console.log('response received', statusCode) // response received 200
for await (const data of body) {
console.log('data', data.toString('utf8')) // data foo
}
```
#### Example - Proxied `request()` with a local dispatcher
```mjs
import { EnvHttpProxyAgent, request } from 'undici'
const envHttpProxyAgent = new EnvHttpProxyAgent()
const { statusCode, body } = await request('http://localhost:3000/foo', {
dispatcher: envHttpProxyAgent
})
console.log('response received', statusCode) // response received 200
for await (const data of body) {
console.log('data', data.toString('utf8')) // data foo
}
```
#### Example - Proxied `fetch()` with a local dispatcher
```mjs
import { EnvHttpProxyAgent, fetch } from 'undici'
const envHttpProxyAgent = new EnvHttpProxyAgent()
const response = await fetch('http://localhost:3000/foo', {
dispatcher: envHttpProxyAgent
})
console.log('response received', response.status) // response received 200
const data = await response.json() // data { foo: 'bar' }
```
### `envHttpProxyAgent.dispatch(options, handler)`
<!-- YAML
added: v6.14.0
-->
* `options` {AgentDispatchOptions}
* `origin` {string|URL}
* `handler` {DispatchHandler}
* Returns: {boolean}
Dispatches a request through the proxy selected for `options.origin`. The origin's
protocol, host, and port are compared against the `no_proxy` configuration: when
the host should be proxied, the request is routed to the HTTPS proxy agent for
`https:` origins or the HTTP proxy agent otherwise; when the host is excluded by
`no_proxy`, the request is sent directly through a non-proxying [`Agent`][].
This method is not normally called directly. Use the higher-level
[`Dispatcher`][] methods such as [`dispatcher.request()`][] or the top-level
`request()` and `fetch()` helpers instead.
[`Agent`]: Agent.md#class-agent
[`Dispatcher`]: Dispatcher.md#class-dispatcher
[`ProxyAgent`]: ProxyAgent.md#class-proxyagent
[`dispatcher.request()`]: Dispatcher.md#dispatcherrequestoptions-callback
@@ -0,0 +1 @@
{"version":3,"file":"message-square-more.js","sources":["../../../src/icons/message-square-more.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageSquareMore\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTVhMiAyIDAgMCAxLTIgMkg3bC00IDRWNWEyIDIgMCAwIDEgMi0yaDE0YTIgMiAwIDAgMSAyIDJ6IiAvPgogIDxwYXRoIGQ9Ik04IDEwaC4wMSIgLz4KICA8cGF0aCBkPSJNMTIgMTBoLjAxIiAvPgogIDxwYXRoIGQ9Ik0xNiAxMGguMDEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/message-square-more\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 MessageSquareMore = createLucideIcon('MessageSquareMore', [\n ['path', { d: 'M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z', key: '1lielz' }],\n ['path', { d: 'M8 10h.01', key: '19clt8' }],\n ['path', { d: 'M12 10h.01', key: '1nrarc' }],\n ['path', { d: 'M16 10h.01', key: '1m94wz' }],\n]);\n\nexport default MessageSquareMore;\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,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,145 @@
import { HtmlEscapedCallbackPhase, raw, resolveCallback } from "../utils/html.js";
import { DOM_RENDERER } from "./constants.js";
import { captureRenderContext, useContext } from "./context.js";
import { Fragment, isUntrustedObject, jsx, renderChildren, renderUntrustedObject } from "./base.js";
import { ErrorBoundary as ErrorBoundary$1 } from "./dom/components.js";
import { StreamingContext } from "./streaming.js";
//#region src/jsx/components.ts
let errorBoundaryCounter = 0;
const childrenToString = async (children) => {
try {
return children.flat().map(resolveChildEarly);
} catch (e) {
if (e instanceof Promise) {
const resume = captureRenderContext();
await e;
return resume(() => childrenToString(children));
} else throw e;
}
};
const resolveChildEarly = (child) => {
if (child == null || typeof child === "boolean") return "";
else if (typeof child === "string" || Array.isArray(child)) return renderChildren([child]);
else if (isUntrustedObject(child)) return renderUntrustedObject(child);
else {
const str = child.toString();
return str instanceof Promise ? str : raw(str);
}
};
/**
* @experimental
* `ErrorBoundary` is an experimental feature.
* The API might be changed.
*/
const ErrorBoundary = async ({ children, fallback, fallbackRender, onError }) => {
if (!children) return raw("");
if (!Array.isArray(children)) children = [children];
const nonce = useContext(StreamingContext)?.scriptNonce;
let resume;
const getResume = () => resume ||= captureRenderContext();
let fallbackStrPromise;
const resolveFallbackStr = () => fallbackStrPromise ||= (async () => {
const awaitedFallback = await fallback;
if (awaitedFallback === null || awaitedFallback === void 0) return;
if (typeof awaitedFallback === "string" || Array.isArray(awaitedFallback)) return getResume()(() => renderChildren([awaitedFallback]));
if (isUntrustedObject(awaitedFallback)) return getResume()(() => renderUntrustedObject(awaitedFallback));
const fallbackResult = await getResume()(() => awaitedFallback.toString());
return raw(fallbackResult, fallbackResult.callbacks || awaitedFallback.callbacks);
})();
const renderFallback = async (error) => {
const fallbackStr = await resolveFallbackStr();
return getResume()(async () => {
onError?.(error);
const fallbackRes = fallbackStr !== void 0 ? fallbackStr : fallbackRender && jsx(Fragment, {}, fallbackRender(error)) || "";
const fallbackResString = await Fragment({ children: fallbackRes }).toString();
return raw(fallbackResString, fallbackResString.callbacks || fallbackRes.callbacks);
});
};
let resArray = [];
try {
resArray = children.map(resolveChildEarly);
} catch (e) {
const resume = getResume();
if (e instanceof Promise) resArray = [e.then(() => resume(() => childrenToString(children))).catch((e) => renderFallback(e))];
else resArray = [await renderFallback(e)];
}
if (resArray.some((res) => res instanceof Promise)) {
getResume();
const index = errorBoundaryCounter++;
const replaceRe = RegExp(`(<template id="E:${index}"></template>)(.*?)(<!--E:${index}-->)`, "s");
let caught = false;
const catchCallback = async ({ error, buffer }) => {
if (caught) return "";
caught = true;
const fallbackResString = await renderFallback(error);
const fallbackCallbacks = fallbackResString.callbacks;
if (buffer) {
buffer[0] = buffer[0].replace(replaceRe, () => fallbackResString);
return fallbackCallbacks?.length ? raw("", fallbackCallbacks) : "";
}
return raw(`<template data-hono-target="E:${index}">${fallbackResString}</template><script>
((d,c,n) => {
c=d.currentScript.previousSibling
d=d.getElementById('E:${index}')
if(!d)return
do{n=d.nextSibling;n.remove()}while(n.nodeType!=8||n.nodeValue!='E:${index}')
d.replaceWith(c.content)
})(document)
<\/script>`, fallbackCallbacks);
};
let error;
const promiseAll = Promise.all(resArray).catch((e) => error = e);
return raw(`<template id="E:${index}"></template><!--E:${index}-->`, [({ phase, buffer, context }) => {
if (phase === HtmlEscapedCallbackPhase.BeforeStream) return;
return promiseAll.then(async (htmlArray) => {
if (error) throw error;
htmlArray = htmlArray.flat();
const content = htmlArray.join("");
let html = buffer ? "" : `<template data-hono-target="E:${index}">${content}</template><script${nonce ? ` nonce="${nonce}"` : ""}>
((d,c) => {
c=d.currentScript.previousSibling
d=d.getElementById('E:${index}')
if(!d)return
d.parentElement.insertBefore(c.content,d.nextSibling)
})(document)
<\/script>`;
if (htmlArray.every((html) => !html.callbacks?.length)) {
if (buffer) buffer[0] = buffer[0].replace(replaceRe, () => content);
return html;
}
if (buffer) buffer[0] = buffer[0].replace(replaceRe, (_all, pre, _, post) => `${pre}${content}${post}`);
const callbacks = htmlArray.map((html) => html.callbacks || []).flat();
if (phase === HtmlEscapedCallbackPhase.Stream) html = await resolveCallback(html, HtmlEscapedCallbackPhase.BeforeStream, true, context);
let resolvedCount = 0;
const promises = callbacks.map((c) => (...args) => c(...args)?.then((content) => {
resolvedCount++;
if (buffer) {
if (resolvedCount === callbacks.length) buffer[0] = buffer[0].replace(replaceRe, (_all, _pre, content) => content);
buffer[0] += content;
return raw("", content.callbacks);
}
return raw(content + (resolvedCount !== callbacks.length ? "" : `<script>
((d,c,n) => {
d=d.getElementById('E:${index}')
if(!d)return
n=d.nextSibling
while(n.nodeType!=8||n.nodeValue!='E:${index}'){n=n.nextSibling}
n.remove()
d.remove()
})(document)
<\/script>`), content.callbacks);
}).catch((error) => catchCallback({
error,
buffer
})));
return raw(html, promises);
}).catch((error) => catchCallback({
error,
buffer
}));
}]);
} else return Fragment({ children: resArray });
};
ErrorBoundary[DOM_RENDERER] = ErrorBoundary$1;
//#endregion
export { ErrorBoundary, childrenToString };
@@ -0,0 +1,418 @@
/**
* @fileoverview Rule to require braces in arrow function body.
* @author Alberto Rodríguez
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: ["as-needed"],
docs: {
description: "Require braces around arrow function bodies",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/arrow-body-style",
},
schema: {
anyOf: [
{
type: "array",
items: [
{
enum: ["always", "never"],
},
],
minItems: 0,
maxItems: 1,
},
{
type: "array",
items: [
{
enum: ["as-needed"],
},
{
type: "object",
properties: {
requireReturnForObjectLiteral: {
type: "boolean",
},
},
additionalProperties: false,
},
],
minItems: 0,
maxItems: 2,
},
],
},
fixable: "code",
messages: {
unexpectedOtherBlock:
"Unexpected block statement surrounding arrow body.",
unexpectedEmptyBlock:
"Unexpected block statement surrounding arrow body; put a value of `undefined` immediately after the `=>`.",
unexpectedObjectBlock:
"Unexpected block statement surrounding arrow body; parenthesize the returned value and move it immediately after the `=>`.",
unexpectedSingleBlock:
"Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.",
expectedBlock: "Expected block statement surrounding arrow body.",
},
},
create(context) {
const options = context.options;
const always = options[0] === "always";
const asNeeded = options[0] === "as-needed";
const never = options[0] === "never";
const requireReturnForObjectLiteral =
options[1] && options[1].requireReturnForObjectLiteral;
const sourceCode = context.sourceCode;
let funcInfo = null;
/**
* Checks whether the given node has ASI problem or not.
* @param {Token} token The token to check.
* @returns {boolean} `true` if it changes semantics if `;` or `}` followed by the token are removed.
*/
function hasASIProblem(token) {
return (
token &&
token.type === "Punctuator" &&
/^[([/`+-]/u.test(token.value)
);
}
/**
* Gets the closing parenthesis by the given node.
* @param {ASTNode} node first node after an opening parenthesis.
* @returns {Token} The found closing parenthesis token.
*/
function findClosingParen(node) {
let nodeToCheck = node;
while (!astUtils.isParenthesised(sourceCode, nodeToCheck)) {
nodeToCheck = nodeToCheck.parent;
}
return sourceCode.getTokenAfter(nodeToCheck);
}
/**
* Check whether the node is inside of a for loop's init
* @param {ASTNode} node node is inside for loop
* @returns {boolean} `true` if the node is inside of a for loop, else `false`
*/
function isInsideForLoopInitializer(node) {
if (node && node.parent) {
if (
node.parent.type === "ForStatement" &&
node.parent.init === node
) {
return true;
}
return isInsideForLoopInitializer(node.parent);
}
return false;
}
/**
* Determines whether a arrow function body needs braces
* @param {ASTNode} node The arrow function node.
* @returns {void}
*/
function validate(node) {
const arrowBody = node.body;
if (arrowBody.type === "BlockStatement") {
const blockBody = arrowBody.body;
if (blockBody.length !== 1 && !never) {
return;
}
if (
asNeeded &&
requireReturnForObjectLiteral &&
blockBody[0].type === "ReturnStatement" &&
blockBody[0].argument &&
blockBody[0].argument.type === "ObjectExpression"
) {
return;
}
if (
never ||
(asNeeded && blockBody[0].type === "ReturnStatement")
) {
let messageId;
if (blockBody.length === 0) {
messageId = "unexpectedEmptyBlock";
} else if (
blockBody.length > 1 ||
blockBody[0].type !== "ReturnStatement"
) {
messageId = "unexpectedOtherBlock";
} else if (blockBody[0].argument === null) {
messageId = "unexpectedSingleBlock";
} else if (
astUtils.isOpeningBraceToken(
sourceCode.getFirstToken(blockBody[0], { skip: 1 }),
)
) {
messageId = "unexpectedObjectBlock";
} else {
messageId = "unexpectedSingleBlock";
}
context.report({
node,
loc: arrowBody.loc,
messageId,
fix(fixer) {
const fixes = [];
if (
blockBody.length !== 1 ||
blockBody[0].type !== "ReturnStatement" ||
!blockBody[0].argument ||
hasASIProblem(
sourceCode.getTokenAfter(arrowBody),
)
) {
return fixes;
}
const openingBrace =
sourceCode.getFirstToken(arrowBody);
const closingBrace =
sourceCode.getLastToken(arrowBody);
const firstValueToken = sourceCode.getFirstToken(
blockBody[0],
1,
);
const lastValueToken = sourceCode.getLastToken(
blockBody[0],
);
const commentsExist =
sourceCode.commentsExistBetween(
openingBrace,
firstValueToken,
) ||
sourceCode.commentsExistBetween(
lastValueToken,
closingBrace,
);
/*
* Remove tokens around the return value.
* If comments don't exist, remove extra spaces as well.
*/
if (commentsExist) {
fixes.push(
fixer.remove(openingBrace),
fixer.remove(closingBrace),
fixer.remove(
sourceCode.getTokenAfter(openingBrace),
), // return keyword
);
} else {
fixes.push(
fixer.removeRange([
openingBrace.range[0],
firstValueToken.range[0],
]),
fixer.removeRange([
lastValueToken.range[1],
closingBrace.range[1],
]),
);
}
/*
* If the first token of the return value is `{` or the return value is a sequence expression,
* enclose the return value by parentheses to avoid syntax error.
*/
if (
astUtils.isOpeningBraceToken(firstValueToken) ||
blockBody[0].argument.type ===
"SequenceExpression" ||
(funcInfo.hasInOperator &&
isInsideForLoopInitializer(node))
) {
if (
!astUtils.isParenthesised(
sourceCode,
blockBody[0].argument,
)
) {
fixes.push(
fixer.insertTextBefore(
firstValueToken,
"(",
),
fixer.insertTextAfter(
lastValueToken,
")",
),
);
}
}
/*
* If the last token of the return statement is semicolon, remove it.
* Non-block arrow body is an expression, not a statement.
*/
if (astUtils.isSemicolonToken(lastValueToken)) {
fixes.push(fixer.remove(lastValueToken));
}
return fixes;
},
});
}
} else {
if (
always ||
(asNeeded &&
requireReturnForObjectLiteral &&
arrowBody.type === "ObjectExpression")
) {
context.report({
node,
loc: arrowBody.loc,
messageId: "expectedBlock",
fix(fixer) {
const fixes = [];
const arrowToken = sourceCode.getTokenBefore(
arrowBody,
astUtils.isArrowToken,
);
const [
firstTokenAfterArrow,
secondTokenAfterArrow,
] = sourceCode.getTokensAfter(arrowToken, {
count: 2,
});
const lastToken = sourceCode.getLastToken(node);
let parenthesisedObjectLiteral = null;
if (
astUtils.isOpeningParenToken(
firstTokenAfterArrow,
) &&
astUtils.isOpeningBraceToken(
secondTokenAfterArrow,
)
) {
const braceNode =
sourceCode.getNodeByRangeIndex(
secondTokenAfterArrow.range[0],
);
if (braceNode.type === "ObjectExpression") {
parenthesisedObjectLiteral = braceNode;
}
}
// If the value is object literal, remove parentheses which were forced by syntax.
if (parenthesisedObjectLiteral) {
const openingParenToken = firstTokenAfterArrow;
const openingBraceToken = secondTokenAfterArrow;
if (
astUtils.isTokenOnSameLine(
openingParenToken,
openingBraceToken,
)
) {
fixes.push(
fixer.replaceText(
openingParenToken,
"{return ",
),
);
} else {
// Avoid ASI
fixes.push(
fixer.replaceText(
openingParenToken,
"{",
),
fixer.insertTextBefore(
openingBraceToken,
"return ",
),
);
}
// Closing paren for the object doesn't have to be lastToken, e.g.: () => ({}).foo()
fixes.push(
fixer.remove(
findClosingParen(
parenthesisedObjectLiteral,
),
),
);
fixes.push(
fixer.insertTextAfter(lastToken, "}"),
);
} else {
fixes.push(
fixer.insertTextBefore(
firstTokenAfterArrow,
"{return ",
),
);
fixes.push(
fixer.insertTextAfter(lastToken, "}"),
);
}
return fixes;
},
});
}
}
}
return {
"BinaryExpression[operator='in']"() {
let info = funcInfo;
while (info) {
info.hasInOperator = true;
info = info.upper;
}
},
ArrowFunctionExpression() {
funcInfo = {
upper: funcInfo,
hasInOperator: false,
};
},
"ArrowFunctionExpression:exit"(node) {
validate(node);
funcInfo = funcInfo.upper;
},
};
},
};
@@ -0,0 +1,413 @@
export default `flf2a$ 4 3 8 0 3
Bracket Letters By Joan Stark
Website: http://www.geocities.com/SoHo/7373/
Figlet conversion by patorjk, April 17, 2008
$ $@
$ $@
$ $@
$ $@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
.--. @
/ {} \\ @
/ /\\ \\@
\`-' \`-'@@
.----. @
| {} }@
| {} }@
\`----' @@
.---. @
/ ___}@
\\ }@
\`---' @@
.----. @
| {} \\@
| /@
\`----' @@
.----.@
| {_ @
| {__ @
\`----'@@
.----.@
| {_ @
| | @
\`-' @@
.---. @
/ __}@
\\ {_ }@
\`---' @@
.-. .-.@
| {_} |@
| { } |@
\`-' \`-'@@
.-.@
| |@
| |@
\`-'@@
.-.@
.-.| |@
| {} |@
\`----'@@
.-. .-.@
| |/ / @
| |\\ \\ @
\`-' \`-'@@
.-. @
| | @
| \`--.@
\`----'@@
.-. .-.@
| \`.' |@
| |\\ /| |@
\`-' \` \`-'@@
.-. .-.@
| \`| |@
| |\\ |@
\`-' \`-'@@
.----. @
/ {} \\@
\\ /@
\`----' @@
.----. @
| {} }@
| .--' @
\`-' @@
.----. @
/ {} \\@
\\ /@
\`-----\`@@
.----. @
| {} }@
| .-. \\@
\`-' \`-'@@
.----.@
{ {__ @
.-._} }@
\`----' @@
.---. @
{_ _}@
| | @
\`-' @@
.-. .-.@
| { } |@
| {_} |@
\`-----'@@
.-. .-.@
| | | |@
\\ \\_/ /@
\`---' @@
.-. . .-.@
| |/ \\| |@
| .'. |@
\`-' \`-'@@
.-. .-.@
\\ \\/ / @
/ /\\ \\ @
\`-' \`-'@@
.-. .-.@
\\ \\/ / @
} { @
\`--' @@
.---. @
{_ / @
/ }@
\`---' @@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
.--. @
/ {} \\ @
/ /\\ \\@
\`-' \`-'@@
.----. @
| {} }@
| {} }@
\`----' @@
.---. @
/ ___}@
\\ }@
\`---' @@
.----. @
| {} \\@
| /@
\`----' @@
.----.@
| {_ @
| {__ @
\`----'@@
.----.@
| {_ @
| | @
\`-' @@
.---. @
/ __}@
\\ {_ }@
\`---' @@
.-. .-.@
| {_} |@
| { } |@
\`-' \`-'@@
.-.@
| |@
| |@
\`-'@@
.-.@
.-.| |@
| {} |@
\`----'@@
.-. .-.@
| |/ / @
| |\\ \\ @
\`-' \`-'@@
.-. @
| | @
| \`--.@
\`----'@@
.-. .-.@
| \`.' |@
| |\\ /| |@
\`-' \` \`-'@@
.-. .-.@
| \`| |@
| |\\ |@
\`-' \`-'@@
.----. @
/ {} \\@
\\ /@
\`----' @@
.----. @
| {} }@
| .--' @
\`-' @@
.----. @
/ {} \\@
\\ /@
\`-----\`@@
.----. @
| {} }@
| .-. \\@
\`-' \`-'@@
.----.@
{ {__ @
.-._} }@
\`----' @@
.---. @
{_ _}@
| | @
\`-' @@
.-. .-.@
| { } |@
| {_} |@
\`-----'@@
.-. .-.@
| | | |@
\\ \\_/ /@
\`---' @@
.-. . .-.@
| |/ \\| |@
| .'. |@
\`-' \`-'@@
.-. .-.@
\\ \\/ / @
/ /\\ \\ @
\`-' \`-'@@
.-. .-.@
\\ \\/ / @
} { @
\`--' @@
.---. @
{_ / @
/ }@
\`---' @@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
`
@@ -0,0 +1 @@
{"version":3,"names":["_OverloadYield","require","_wrapAsyncGenerator","fn","AsyncGenerator","apply","arguments","gen","front","back","send","key","arg","Promise","resolve","reject","request","next","resume","result","value","overloaded","OverloadYield","v","then","nextKey","k","done","settle","err","type","_invoke","undefined","prototype","Symbol","asyncIterator"],"sources":["../../src/helpers/wrapAsyncGenerator.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport OverloadYield from \"./OverloadYield.ts\";\n\nexport default function _wrapAsyncGenerator(fn: GeneratorFunction) {\n return function (this: any) {\n // Use \"arguments\" here for better compatibility and smaller bundle size\n return new AsyncGenerator(fn.apply(this, arguments as any));\n };\n}\n\n/* == The implementation of the AsyncGenerator class == */\n\ntype AsyncIteratorMethod = \"next\" | \"throw\" | \"return\";\n\ndeclare class AsyncGenerator<T = unknown, TReturn = any, TNext = unknown>\n implements globalThis.AsyncGenerator<T, TReturn, TNext>\n{\n _invoke: (\n key: AsyncIteratorMethod,\n arg: IteratorResult<T>,\n ) => Promise<IteratorResult<T, TReturn>>;\n\n constructor(gen: Generator<T, TReturn, TNext>);\n\n next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;\n return(\n value: TReturn | PromiseLike<TReturn>,\n ): Promise<IteratorResult<T, TReturn>>;\n throw(e: any): Promise<IteratorResult<T, TReturn>>;\n [Symbol.asyncIterator](): AsyncGenerator<T, TReturn, TNext>;\n [Symbol.asyncDispose](): Promise<void>;\n}\n\ninterface AsyncGeneratorRequest<T = unknown, TReturn = any, TNext = unknown> {\n key: AsyncIteratorMethod;\n arg: IteratorResult<T>;\n resolve: (value: IteratorResult<T, TReturn>) => void;\n reject: (error: any) => void;\n next: AsyncGeneratorRequest<T, TReturn, TNext> | null;\n}\n\nfunction AsyncGenerator<T = unknown, TReturn = any, TNext = unknown>(\n this: AsyncGenerator<T, TReturn, TNext>,\n gen: Generator<T, TReturn, TNext>,\n) {\n var front: AsyncGeneratorRequest<T, TReturn, TNext> | null,\n back: AsyncGeneratorRequest<T, TReturn, TNext> | null;\n\n function send(key: AsyncIteratorMethod, arg: IteratorResult<T>) {\n return new Promise<IteratorResult<T, TReturn>>(function (resolve, reject) {\n var request: AsyncGeneratorRequest<T, TReturn, TNext> = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null,\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key: AsyncIteratorMethod, arg: IteratorResult<T, TReturn>) {\n try {\n var result = gen[key](arg);\n var value = result.value;\n var overloaded = value instanceof OverloadYield;\n\n Promise.resolve(\n overloaded ? (value as OverloadYield<T | TReturn>).v : value,\n ).then(\n function (arg: any) {\n if (overloaded) {\n // Overloaded yield requires calling into the generator twice:\n // - first we get the iterator result wrapped in a promise\n // (the gen[key](arg) call above)\n // - then we await it (the Promise.resolve call above)\n // - then we give the result back to the iterator, so that it can:\n // * if it was an await, use its result\n // * if it was a yield*, possibly return the `done: true` signal\n // so that yield* knows that the iterator is finished.\n // This needs to happen in the second call, because in the\n // first one `done: true` was hidden in the promise and thus\n // not visible to the (sync) yield*.\n // The other part of this implementation is in asyncGeneratorDelegate.\n var nextKey: \"return\" | \"next\" =\n key === \"return\" &&\n (value as OverloadYield<IteratorReturnResult<T>>).k\n ? key\n : \"next\";\n if (\n !(value as OverloadYield<IteratorReturnResult<T>>).k ||\n arg.done\n ) {\n // await or end of yield*\n // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -- smaller bundle size\n return resume(nextKey, arg);\n } else {\n // yield*, not done\n arg = gen[nextKey](arg).value;\n }\n }\n\n settle(!!result.done, arg);\n },\n function (err) {\n resume(\"throw\", err);\n },\n );\n } catch (err) {\n settle(2, err);\n }\n }\n\n /**\n * type == true -> return\n * type == false -> normal\n * type == 2 -> throw\n */\n function settle(type: true | false | 2, value: any) {\n if (type === 2) {\n front!.reject(value);\n } else {\n front!.resolve({ value: value, done: tyLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":["time","Date","getTime","ZxcvbnFactory","constructor","options","customMatchers","Options","scoring","Scoring","matching","Matching","feedback","Feedback","timeEstimates","TimeEstimates","estimateAttackTimes","guesses","getFeedback","score","sequence","createReturnValue","resolvedMatches","password","start","matchSequence","mostGuessableMatchSequence","calcTime","attackTimes","main","userInputs","userInputsOptions","getUserInputsOptions","match","check","reducedPassword","substring","maxLength","matches","Promise","Error","checkAsync"],"mappings":";;;;;;;;AAcA,MAAMA,IAAI,GAAGA,MAAM,IAAIC,IAAI,EAAE,CAACC,OAAO,EAAE;AAEvC,MAAMC,aAAa,CAAA;EAWjBC,WAAAA,CACEC,OAAA,GAAuB,EAAE,EACzBC,cAAA,GAA0C,EAAE,EAAA;IAE5C,IAAI,CAACD,OAAO,GAAG,IAAIE,OAAO,CAACF,OAAO,EAAEC,cAAc,CAAC;IACnD,IAAI,CAACE,OAAO,GAAG,IAAIC,OAAO,CAAC,IAAI,CAACJ,OAAO,CAAC;IACxC,IAAI,CAACK,QAAQ,GAAG,IAAIC,QAAQ,CAAC,IAAI,CAACN,OAAO,CAAC;IAC1C,IAAI,CAACO,QAAQ,GAAG,IAAIC,QAAQ,CAAC,IAAI,CAACR,OAAO,CAAC;IAC1C,IAAI,CAACS,aAAa,GAAG,IAAIC,aAAa,CAAC,IAAI,CAACV,OAAO,CAAC;AACtD,EAAA;EAEQW,mBAAmBA,CAACC,OAAe,EAAA;AACzC,IAAA,OAAO,IAAI,CAACH,aAAa,CAACE,mBAAmB,CAACC,OAAO,CAAC;AACxD,EAAA;AAEQC,EAAAA,WAAWA,CAACC,KAAa,EAAEC,QAA0B,EAAA;IAC3D,OAAO,IAAI,CAACR,QAAQ,CAACM,WAAW,CAACC,KAAK,EAAEC,QAAQ,CAAC;AACnD,EAAA;AAEQC,EAAAA,iBAAiBA,CACvBC,eAAgC,EAChCC,QAAgB,EAChBC,KAAa,EAAA;IAEb,MAAMC,aAAa,GAAG,IAAI,CAACjB,OAAO,CAACkB,0BAA0B,CAC3DH,QAAQ,EACRD,eAAe,CAChB;AACD,IAAA,MAAMK,QAAQ,GAAG3B,IAAI,EAAE,GAAGwB,KAAK;IAC/B,MAAMI,WAAW,GAAG,IAAI,CAACZ,mBAAmB,CAACS,aAAa,CAACR,OAAO,CAAC;IAEnE,OAAO;MACLU,QAAQ;AACR,MAAA,GAAGF,aAAa;AAChB,MAAA,GAAGG,WAAW;MACdhB,QAAQ,EAAE,IAAI,CAACM,WAAW,CAACU,WAAW,CAACT,KAAK,EAAEM,aAAa,CAACL,QAAQ;KACrE;AACH,EAAA;AAEQS,EAAAA,IAAIA,CAACN,QAAgB,EAAEO,UAAgC,EAAA;IAC7D,MAAMC,iBAAiB,GAAG,IAAI,CAAC1B,OAAO,CAAC2B,oBAAoB,CAACF,UAAU,CAAC;IAEvE,OAAO,IAAI,CAACpB,QAAQ,CAACuB,KAAK,CAACV,QAAQ,EAAEQ,iBAAiB,CAAC;AACzD,EAAA;AAEOG,EAAAA,KAAKA,CAACX,QAAgB,EAAEO,UAAgC,EAAA;AAC7D,IAAA,MAAMK,eAAe,GAAGZ,QAAQ,CAACa,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC/B,OAAO,CAACgC,SAAS,CAAC;AACrE,IAAA,MAAMb,KAAK,GAAGxB,IAAI,EAAE;IACpB,MAAMsC,OAAO,GAAG,IAAI,CAACT,IAAI,CAACM,eAAe,EAAEL,UAAU,CAAC;IAEtD,IAAIQ,OAAO,YAAYC,OAAO,EAAE;AAC9B,MAAA,MAAM,IAAIC,KAAK,CACb,oEAAoE,CACrE;AACH,IAAA;IACA,OAAO,IAAI,CAACnB,iBAAiB,CAACiB,OAAO,EAAEH,eAAe,EAAEX,KAAK,CAAC;AAChE,EAAA;AAEO,EAAA,MAAMiB,UAAUA,CAAClB,QAAgB,EAAEO,UAAgC,EAAA;AACxE,IAAA,MAAMK,eAAe,GAAGZ,QAAQ,CAACa,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC/B,OAAO,CAACgC,SAAS,CAAC;AACrE,IAAA,MAAMb,KAAK,GAAGxB,IAAI,EAAE;IACpB,MAAMsC,OAAO,GAAG,MAAM,IAAI,CAACT,IAAI,CAACM,eAAe,EAAEL,UAAU,CAAC;IAE5D,OAAO,IAAI,CAACT,iBAAiB,CAACiB,OAAO,EAAEH,eAAe,EAAEX,KAAK,CAAC;AAChE,EAAA;AACD;;;;"}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2025_regexp: LibDefinition;
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const esnext_float16: LibDefinition;
@@ -0,0 +1,412 @@
export default `flf2a$ 4 4 18 16 2
4max.flf by Philip Menke (philippe@dds.nl)
April 1995
$ $#
$ $#
$ $#
$ $##
d8b$#
Y8P$#
\`"'$#
(8)$##
o8o o8o$#
\`"' \`"'$#
$#
$##
__88_88__$#
""88"88""$#
__88_88__$#
""88"88""$##
.dPIIY8$#
\`YbII "$#
o.\`II8b$#
8boIIP'$##
.o. dP $#
\`"'dP $#
dP.o.$#
dP \`"'$##
d888 $#
dP_______$#
Yb"""88""$#
\`Ybo 88 $##
.o.$#
,dP'$#
$#
$##
dP$#
dP $#
Yb $#
Yb$##
Yb $#
Yb$#
dP$#
dP $##
o $#
\`8.8.8'$#
.8.8.8.$#
" $##
oo $#
___88___$#
"""88"""$#
"" $##
$#
$#
.o.$#
,dP'$##
$#
________$#
""""""""$#
$##
$#
$#
.o.$#
\`"'$##
dP$#
dP $#
dP $#
dP $##
dP"Yb $#
dP Yb$#
Yb dP$#
YbodP $##
.d$#
.d88$#
88$#
88$##
oP"Yb.$#
"' dP'$#
dP' $#
.d8888$##
88888$#
.dP$#
o \`Yb$#
YbodP$##
dP88 $#
dP 88 $#
d888888$#
88 $##
888888$#
88oo."$#
\`8b$#
8888P'$##
dP' $#
.d8' $#
8P"""Yb$#
\`YboodP$##
888888P$#
dP $#
dP $#
dP $##
.dP"o.$#
\`8b.d'$#
d'\`Y8b$#
\`bodP'$##
dP""Yb$#
Ybood8$#
.8P'$#
.dP' $##
.o.$#
\`"'$#
.o.$#
\`"'$##
.o.$#
\`"'$#
.o.$#
,dP'$##
.dP'$#
.dP' $#
\`Yb. $#
\`Yb.$##
$#
oooooo$#
______$#
""""""$##
\`Yb. $#
\`Yb.$#
.dP'$#
.dP' $##
oP"Yb.$#
"'.dP'$#
8P $#
(8) $##
dP""Yb $#
dP PY Yb$#
Yb boodP$#
Ybooo $##
db $#
dPYb $#
dP__Yb $#
dP""""Yb$##
88""Yb$#
88__dP$#
88""Yb$#
88oodP$##
dP""b8$#
dP \`"$#
Yb $#
YboodP$##
8888b. $#
8I Yb$#
8I dY$#
8888Y" $##
888888$#
88__ $#
88"" $#
888888$##
888888$#
88__ $#
88"" $#
88 $##
dP""b8$#
dP \`"$#
Yb "88$#
YboodP$##
88 88$#
88 88$#
888888$#
88 88$##
88$#
88$#
88$#
88$##
88888$#
88$#
o. 88$#
"bodP'$##
88 dP$#
88odP $#
88"Yb $#
88 Yb$##
88 $#
88 $#
88 .o$#
88ood8$##
8b d8$#
88b d88$#
88YbdP88$#
88 YY 88$##
88b 88$#
88Yb88$#
88 Y88$#
88 Y8$##
dP"Yb $#
dP Yb$#
Yb dP$#
YbodP $##
88""Yb$#
88__dP$#
88""" $#
88 $##
dP"Yb $#
dP Yb$#
Yb b dP$#
\`"YoYo$##
88""Yb$#
88__dP$#
88"Yb $#
88 Yb$##
.dP"Y8$#
\`Ybo."$#
o.\`Y8b$#
8bodP'$##
888888$#
88 $#
88 $#
88 $##
88 88$#
88 88$#
Y8 8P$#
\`YbodP'$##
Yb dP$#
Yb dP $#
YbdP $#
YP $##
Yb dP$#
Yb db dP $#
YbdPYbdP $#
YP YP $##
Yb dP$#
YbdP $#
dPYb $#
dP Yb$##
Yb dP$#
YbdP $#
8P $#
dP $##
8888P$#
dP $#
dP $#
d8888$##
88888$#
88 $#
88 $#
88888$##
Yb $#
Yb $#
Yb $#
Yb$##
88888$#
88$#
88$#
88888$##
.db. $#
.dP'\`Yb.$#
$#
$##
$#
$#
$#
oooooooooo$##
.o. $#
\`Yb.$#
$#
$##
db $#
dPYb $#
dP__Yb $#
dP""""Yb$##
88""Yb$#
88__dP$#
88""Yb$#
88oodP$##
dP""b8$#
dP \`"$#
Yb $#
YboodP$##
8888b. $#
8I Yb$#
8I dY$#
8888Y" $##
888888$#
88__ $#
88"" $#
888888$##
888888$#
88__ $#
88"" $#
88 $##
dP""b8$#
dP \`"$#
Yb "88$#
YboodP$##
88 88$#
88 88$#
888888$#
88 88$##
88$#
88$#
88$#
88$##
88888$#
88$#
o. 88$#
"bodP'$##
88 dP$#
88odP $#
88"Yb $#
88 Yb$##
88 $#
88 $#
88 .o$#
88ood8$##
8b d8$#
88b d88$#
88YbdP88$#
88 YY 88$##
88b 88$#
88Yb88$#
88 Y88$#
88 Y8$##
dP"Yb $#
dP Yb$#
Yb dP$#
YbodP $##
88""Yb$#
88__dP$#
88""" $#
88 $##
dP"Yb $#
dP Yb$#
Yb b dP$#
\`"YoYo$##
88""Yb$#
88__dP$#
88"Yb $#
88 Yb$##
.dP"Y8$#
\`Ybo."$#
o.\`Y8b$#
8bodP'$##
888888$#
88 $#
88 $#
88 $##
88 88$#
88 88$#
Y8 8P$#
\`YbodP'$##
Yb dP$#
Yb dP $#
YbdP $#
YP $##
Yb dP$#
Yb db dP $#
YbdPYbdP $#
YP YP $##
Yb dP$#
YbdP $#
dPYb $#
dP Yb$##
Yb dP$#
YbdP $#
8P $#
dP $##
8888P$#
dP $#
dP $#
d8888$##
d888$#
.dP $#
\`Yb $#
Y888$##
II$#
II$#
II$#
II$##
888b $#
Yb.$#
dP'$#
888P $##
dP"Yb dP$#
dP \`YbdP $#
$#
$##
db db db$#
""dPYb""$#
dP__Yb $#
dP""""Yb$##
db db $#
".oo." $#
dP Yb $#
YboodP $##
db db$#
"" ""$#
Yb dP$#
YbodP $##
db db db$#
""dPYb""$#
dP__Yb $#
dP""""Yb$##
db db $#
".oo." $#
dP Yb $#
YboodP $##
db db$#
"" ""$#
Y8 8P$#
YbodP $##
dP"o.$#
88.d'$#
88\`8b$#
d8P P'$##
`
@@ -0,0 +1 @@
{"version":3,"file":"clover.js","sources":["../../../src/icons/clover.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Clover\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYuMTcgNy44MyAyIDIyIiAvPgogIDxwYXRoIGQ9Ik00LjAyIDEyYTIuODI3IDIuODI3IDAgMSAxIDMuODEtNC4xN0EyLjgyNyAyLjgyNyAwIDEgMSAxMiA0LjAyYTIuODI3IDIuODI3IDAgMSAxIDQuMTcgMy44MUEyLjgyNyAyLjgyNyAwIDEgMSAxOS45OCAxMmEyLjgyNyAyLjgyNyAwIDEgMS0zLjgxIDQuMTdBMi44MjcgMi44MjcgMCAxIDEgMTIgMTkuOThhMi44MjcgMi44MjcgMCAxIDEtNC4xNy0zLjgxQTEgMSAwIDEgMSA0IDEyIiAvPgogIDxwYXRoIGQ9Im03LjgzIDcuODMgOC4zNCA4LjM0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/clover\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 Clover = createLucideIcon('Clover', [\n ['path', { d: 'M16.17 7.83 2 22', key: 't58vo8' }],\n [\n 'path',\n {\n d: 'M4.02 12a2.827 2.827 0 1 1 3.81-4.17A2.827 2.827 0 1 1 12 4.02a2.827 2.827 0 1 1 4.17 3.81A2.827 2.827 0 1 1 19.98 12a2.827 2.827 0 1 1-3.81 4.17A2.827 2.827 0 1 1 12 19.98a2.827 2.827 0 1 1-4.17-3.81A1 1 0 1 1 4 12',\n key: '17k36q',\n },\n ],\n ['path', { d: 'm7.83 7.83 8.34 8.34', key: '1d7sxk' }],\n]);\n\nexport default Clover;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAA;AAAA,CACjD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAAwB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACvD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"door-open.js","sources":["../../../src/icons/door-open.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name DoorOpen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMgNGgzYTIgMiAwIDAgMSAyIDJ2MTQiIC8+CiAgPHBhdGggZD0iTTIgMjBoMyIgLz4KICA8cGF0aCBkPSJNMTMgMjBoOSIgLz4KICA8cGF0aCBkPSJNMTAgMTJ2LjAxIiAvPgogIDxwYXRoIGQ9Ik0xMyA0LjU2MnYxNi4xNTdhMSAxIDAgMCAxLTEuMjQyLjk3TDUgMjBWNS41NjJhMiAyIDAgMCAxIDEuNTE1LTEuOTRsNC0xQTIgMiAwIDAgMSAxMyA0LjU2MVoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/door-open\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 DoorOpen = createLucideIcon('DoorOpen', [\n ['path', { d: 'M13 4h3a2 2 0 0 1 2 2v14', key: 'hrm0s9' }],\n ['path', { d: 'M2 20h3', key: '1gaodv' }],\n ['path', { d: 'M13 20h9', key: 's90cdi' }],\n ['path', { d: 'M10 12v.01', key: 'vx6srw' }],\n [\n 'path',\n {\n d: 'M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z',\n key: '199qr4',\n },\n ],\n]);\n\nexport default DoorOpen;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC3C,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;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,85 @@
{
"name": "zod-to-json-schema",
"version": "3.25.2",
"description": "Converts Zod schemas to Json Schemas",
"types": "./dist/types/index.d.ts",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"exports": {
"import": {
"types": "./dist/types/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/types/index.d.ts",
"default": "./dist/cjs/index.js"
}
},
"scripts": {
"build:test": "npm --prefix ./dist-test-v3 test && npm --prefix ./dist-test-v4 test",
"build:types": "tsc -p tsconfig.types.json",
"build:cjs": "tsc -p tsconfig.cjs.json && tsx postcjs.ts",
"build:esm": "tsc -p tsconfig.esm.json && tsx postesm.ts",
"build": "npm i && npm run gen && npm test && rimraf ./dist && npm run build:types && npm run build:cjs && npm run build:esm && npm run build:test",
"dry": "npm run build && npm pub --dry-run",
"test:watch": "tsx watch test/index.ts",
"test:gen": "tsx test/createIndex.ts",
"test": "tsx test/index.ts",
"gen": "tsx createIndex.ts"
},
"keywords": [
"zod",
"json",
"schema",
"open",
"api",
"conversion"
],
"author": "Stefan Terdell",
"contributors": [
"Hammad Asif (https://github.com/mrhammadasif)",
"Noah Rosenzweig (https://github.com/Noah2610)",
"John Wright (https://github.com/johngeorgewright)",
"Krzysztof Ciombor (https://github.com/krzysztofciombor)",
"Yuta Mombetsu (https://github.com/mokocm)",
"Tom Arad (https://github.com/tomarad)",
"Isaac Way (https://github.com/iway1)",
"Andreas Berger (https://github.com/Andy2003)",
"Jan Potoms (https://github.com/Janpot)",
"Santiago Cammi (https://github.com/scammi)",
"Philipp Burckhardt (https://github.com/Planeshifter)",
"Bram del Canho (https://github.com/Bram-dc)",
"Gilad Hecht (https://github.com/gthecht)",
"Colin McDonnell (https://github.com/colinhacks)",
"Spappz (https://github.com/Spappz)",
"Jacob Lee (https://github.com/jacoblee93)",
"Brett Zamir (https://github.com/brettz9)",
"Isaiah Marc Sanchez (https://github.com/imsanchez)",
"Mitchell Merry (https://github.com/mitchell-merry)",
"Enzo Monjardín (https://github.com/enzomonjardin)",
"Víctor Hernández (https://github.com/NanezX)",
"Faïz Hernawan Abdillah (https://github.com/Abdillah)",
"Felix Mosheev (https://github.com/felixmosh)"
],
"repository": {
"type": "git",
"url": "https://github.com/StefanTerdell/zod-to-json-schema"
},
"license": "ISC",
"peerDependencies": {
"zod": "^3.25.28 || ^4"
},
"devDependencies": {
"@types/json-schema": "^7.0.9",
"@types/node": "^20.9.0",
"ajv": "^8.6.3",
"ajv-errors": "^3.0.0",
"ajv-formats": "^2.1.1",
"fast-diff": "^1.3.0",
"local-ref-resolver": "^0.2.0",
"rimraf": "^6.1.3",
"tsx": "^4.19.0",
"typescript": "^5.1.3",
"zod": "^3.25.28 || ^4"
}
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_nG _hH","2":"_0 _sD"},C:{"1":"_DS","2":"_o _JF _L"},D:{"1":"_nG _gH","2":"_v _sD"},E:{"2":"_3C","132":"_PC"},F:{"1":"_H RC _QN","2":"_4B _xJ _O"},G:{"2":"_0C","132":"_NC"},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":"_yD","2":"_WE"},Q:{"2":"JE"},R:{"1":"KE"},S:{"1":"ME","2":"LE"}},B:5,C:"CSS ::marker pseudo-element",D:true};
@@ -0,0 +1,17 @@
// This file is auto generated by data-scripts/_helpers/runtime.ts
import commonWords from './commonWords.json'
import firstnames from './firstnames.json'
import lastnames from './lastnames.json'
import wikipedia from './wikipedia.json'
import wordSequences from './wordSequences.json'
import translations from './translations'
const dictionary = {
'commonWords-en': commonWords,
'firstnames-en': firstnames,
'lastnames-en': lastnames,
'wikipedia-en': wikipedia,
...wordSequences,
}
export { dictionary, translations }
@@ -0,0 +1,412 @@
flf2a$ 4 1 6 -1 3 0 8192 0
Font Name: tmplr
Font Author: Eugene Ghanizadeh Khoub
FIGFont created with: http://patorjk.com/figfont-editor
@
@
@
@@
╻@
┃@
•@
@@
╹╹@
@
@
@@
╋╋@
┃┃@
╋╋@
@@
┏┻┓@
┗━┓@
┗┳┛@
@@
•┏ @
┃ @
┛•@
@@
┏┓@
┣╋@
┗┻@
@@
╹@
@
@
@@
┏@
┃@
┗@
@@
┓@
┃@
┛@
@@
┓┏@
┛┗@
@
@@
╻ @
━╋━@
╹ @
@@
@
@
╻@
@@
@
━━@
@
@@
@
@
•@
@@
┏@
┃@
┛@
@@
┏┓@
┃┫@
┗┛@
@@
┓@
┃@
┻@
@@
┏┓@
┏┛@
┗━@
@@
┏┓@
┫@
┗┛@
@@
┏┓@
┃┃@
┗╋@
@@
┏━@
┗┓@
┗┛@
@@
┏┓@
┣┓@
┗┛@
@@
━┓@
┃@
╹@
@@
┏┓@
┣┫@
┗┛@
@@
┏┓@
┗┫@
┗┛@
@@
@
•@
•@
@@
@
•@
╻@
@@
┏@
━┫@
┗@
@@
━━@
━━@
━━@
@@
┓ @
┣━@
┛ @
@@
┏┓@
┏┛@
• @
@@
┏━┓@
┃┗┛@
┗━┛@
@@
┏┓@
┣┫@
┛┗@
@@
┳┓@
┣┫@
┻┛@
@@
┏┓@
┃ @
┗┛@
@@
┳┓@
┃┃@
┻┛@
@@
┏┓@
┣ @
┗┛@
@@
┏┓@
┣ @
┻ @
@@
┏┓@
┃┓@
┗┛@
@@
┓┏@
┣┫@
┛┗@
@@
┳@
┃@
┻@
@@
┏┳@
┃@
┗┛@
@@
┓┏┓@
┃┫ @
┛┗┛@
@@
┓ @
┃ @
┗┛@
@@
┳┳┓@
┃┃┃@
┛ ┗@
@@
┳┓@
┃┃@
┛┗@
@@
┏┓@
┃┃@
┗┛@
@@
┏┓@
┃┃@
┣┛@
@@
┏┓@
┃┃@
┗┻@
@@
┳┓@
┣┫@
┛┗@
@@
┏┓@
┗┓@
┗┛@
@@
┏┳┓@
┃ @
┻ @
@@
┳┳@
┃┃@
┗┛@
@@
┓┏@
┃┃@
┗┛@
@@
┓ ┏@
┃┃┃@
┗┻┛@
@@
┏┓┏┓@
┃┃ @
┗┛┗┛@
@@
┓┏@
┗┫@
┗┛@
@@
┏┓@
┏┛@
┗┛@
@@
┏━@
┃ @
┗━@
@@
╻ @
┗┓@
╹@
@@
━┓@
┃@
━┛@
@@
┏┓@
@
@
@@
@
@
━@
@@
┓@
@
@
@@
@
┏┓@
┗┻@
@@
┓ @
┣┓@
┗┛@
@@
@
┏@
┗@
@@
┓@
┏┫@
┗┻@
@@
@
┏┓@
┗ @
@@
┏@
╋@
┛@
@@
@
┏┓@
┗┫@
┛@@
┓ @
┣┓@
┛┗@
@@
•@
┓@
┗@
@@
•@
┓@
┃@
┛@@
┓ @
┃┏@
┛┗@
@@
┓@
┃@
┗@
@@
@
┏┳┓@
┛┗┗@
@@
@
┏┓@
┛┗@
@@
@
┏┓@
┗┛@
@@
@
┏┓@
┣┛@
┛ @@
@
┏┓@
┗┫@
┗@@
@
┏┓@
┛ @
@@
@
┏@
┛@
@@
@
╋@
┗@
@@
@
┓┏@
┗┻@
@@
@
┓┏@
┗┛@
@@
@
┓┏┏@
┗┻┛@
@@
@
┓┏@
┛┗@
@@
@
┓┏@
┗┫@
┛@@
@
┓@
┗@
@@
┏@
┫@
┗@
@@
╻@
┃@
╹@
@@
┓@
┣@
┛@
@@
@
┏━┛@
@
@@
@
@
@
@@
@
@
@
@@
@
@
@
@@
••@
┏┓@
┗┻@
@@
••@
┏┓@
┗┛@
@@
••@
┓┏@
┗┻@
@@
┏┓@
┣┫@
┻┛@
@@
@@ -0,0 +1,46 @@
/**
* @fileoverview Types for the config-array package.
* @author Nicholas C. Zakas
*/
/**
* A file matcher used in `files` and `ignores`.
*/
export type FileMatcher = string | ((filePath: string) => boolean);
/**
* An entry in a config's `files` array.
*
* A subarray means all matchers must match.
*/
export type FilesMatcher = FileMatcher | FileMatcher[];
/**
* The config types allowed in the `extraConfigTypes` option.
*/
export type ExtraConfigType = "array" | "function";
export interface ConfigObject {
/**
* The base path for files and ignores.
*/
basePath?: string;
/**
* The files to include.
*/
files?: FilesMatcher[];
/**
* The files to exclude.
*/
ignores?: FileMatcher[];
/**
* The name of the config object.
*/
name?: string;
// may also have any number of other properties
[key: string]: unknown;
}
@@ -0,0 +1,156 @@
const getDefaultParent = (originalTarget) => {
if (typeof document === 'undefined') {
return null;
}
const sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
return sampleTarget.ownerDocument.body;
};
let counterMap = new WeakMap();
let uncontrolledNodes = new WeakMap();
let markerMap = {};
let lockCount = 0;
const unwrapHost = (node) => node && (node.host || unwrapHost(node.parentNode));
const correctTargets = (parent, targets) => targets
.map((target) => {
if (parent.contains(target)) {
return target;
}
const correctedTarget = unwrapHost(target);
if (correctedTarget && parent.contains(correctedTarget)) {
return correctedTarget;
}
console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');
return null;
})
.filter((x) => Boolean(x));
/**
* Marks everything except given node(or nodes) as aria-hidden
* @param {Element | Element[]} originalTarget - elements to keep on the page
* @param [parentNode] - top element, defaults to document.body
* @param {String} [markerName] - a special attribute to mark every node
* @param {String} [controlAttribute] - html Attribute to control
* @return {Undo} undo command
*/
const applyAttributeToOthers = (originalTarget, parentNode, markerName, controlAttribute) => {
const targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
if (!markerMap[markerName]) {
markerMap[markerName] = new WeakMap();
}
const markerCounter = markerMap[markerName];
const hiddenNodes = [];
const elementsToKeep = new Set();
const elementsToStop = new Set(targets);
const keep = (el) => {
if (!el || elementsToKeep.has(el)) {
return;
}
elementsToKeep.add(el);
keep(el.parentNode);
};
targets.forEach(keep);
const deep = (parent) => {
if (!parent || elementsToStop.has(parent)) {
return;
}
Array.prototype.forEach.call(parent.children, (node) => {
if (elementsToKeep.has(node)) {
deep(node);
}
else {
try {
const attr = node.getAttribute(controlAttribute);
const alreadyHidden = attr !== null && attr !== 'false';
const counterValue = (counterMap.get(node) || 0) + 1;
const markerValue = (markerCounter.get(node) || 0) + 1;
counterMap.set(node, counterValue);
markerCounter.set(node, markerValue);
hiddenNodes.push(node);
if (counterValue === 1 && alreadyHidden) {
uncontrolledNodes.set(node, true);
}
if (markerValue === 1) {
node.setAttribute(markerName, 'true');
}
if (!alreadyHidden) {
node.setAttribute(controlAttribute, 'true');
}
}
catch (e) {
console.error('aria-hidden: cannot operate on ', node, e);
}
}
});
};
deep(parentNode);
elementsToKeep.clear();
lockCount++;
return () => {
hiddenNodes.forEach((node) => {
const counterValue = counterMap.get(node) - 1;
const markerValue = markerCounter.get(node) - 1;
counterMap.set(node, counterValue);
markerCounter.set(node, markerValue);
if (!counterValue) {
if (!uncontrolledNodes.has(node)) {
node.removeAttribute(controlAttribute);
}
uncontrolledNodes.delete(node);
}
if (!markerValue) {
node.removeAttribute(markerName);
}
});
lockCount--;
if (!lockCount) {
// clear
counterMap = new WeakMap();
counterMap = new WeakMap();
uncontrolledNodes = new WeakMap();
markerMap = {};
}
};
};
/**
* Marks everything except given node(or nodes) as aria-hidden
* @param {Element | Element[]} originalTarget - elements to keep on the page
* @param [parentNode] - top element, defaults to document.body
* @param {String} [markerName] - a special attribute to mark every node
* @return {Undo} undo command
*/
export const hideOthers = (originalTarget, parentNode, markerName = 'data-aria-hidden') => {
const targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
const activeParentNode = parentNode || getDefaultParent(originalTarget);
if (!activeParentNode) {
return () => null;
}
// we should not hide aria-live elements - https://github.com/theKashey/aria-hidden/issues/10
// and script elements, as they have no impact on accessibility.
targets.push(...Array.from(activeParentNode.querySelectorAll('[aria-live], script')));
return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
};
/**
* Marks everything except given node(or nodes) as inert
* @param {Element | Element[]} originalTarget - elements to keep on the page
* @param [parentNode] - top element, defaults to document.body
* @param {String} [markerName] - a special attribute to mark every node
* @return {Undo} undo command
*/
export const inertOthers = (originalTarget, parentNode, markerName = 'data-inert-ed') => {
const activeParentNode = parentNode || getDefaultParent(originalTarget);
if (!activeParentNode) {
return () => null;
}
return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert');
};
/**
* @returns if current browser supports inert
*/
export const supportsInert = () => typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert');
/**
* Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way
* @param {Element | Element[]} originalTarget - elements to keep on the page
* @param [parentNode] - top element, defaults to document.body
* @param {String} [markerName] - a special attribute to mark every node
* @return {Undo} undo command
*/
export const suppressOthers = (originalTarget, parentNode, markerName = 'data-suppressed') => (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName);
@@ -0,0 +1,32 @@
{
"name": "assertion-error",
"version": "2.0.1",
"description": "Error constructor for test and validation frameworks that implements standardized AssertionError specification.",
"author": "Jake Luer <jake@qualiancy.com> (http://qualiancy.com)",
"license": "MIT",
"types": "./index.d.ts",
"keywords": [
"test",
"assertion",
"assertion-error"
],
"repository": {
"type": "git",
"url": "git@github.com:chaijs/assertion-error.git"
},
"engines": {
"node": ">=12"
},
"files": [
"index.d.ts"
],
"type": "module",
"module": "index.js",
"main": "index.js",
"scripts": {
"build": "deno bundle mod.ts > index.js",
"pretest": "rm -rf coverage/",
"test": "deno test --coverage=coverage",
"posttest": "deno coverage coverage --lcov > coverage/lcov.info && lcov --summary coverage/lcov.info"
}
}
@@ -0,0 +1,159 @@
import { Bench } from 'tinybench'
import { fastUri } from '../index.js'
import { parse as uriJsParse, serialize as uriJsSerialize, resolve as uriJsResolve, equal as uriJsEqual } from 'uri-js'
const base = 'uri://a/b/c/d;p?q'
const domain = 'https://example.com/foo#bar$fiz'
const ipv4 = '//10.10.10.10'
const ipv6 = '//[2001:db8::7]'
const urn = 'urn:foo:a123,456'
const urnuuid = 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
const urnuuidComponent = {
scheme: 'urn',
nid: 'uuid',
uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
}
const {
parse: fastUriParse,
serialize: fastUriSerialize,
resolve: fastUriResolve,
equal: fastUriEqual,
} = fastUri
// Initialization as there is a lot to parse at first
// eg: regexes
fastUriParse(domain)
uriJsParse(domain)
const benchFastUri = new Bench({ name: 'fast-uri benchmark' })
const benchUriJs = new Bench({ name: 'uri-js benchmark' })
const benchWHATWG = new Bench({ name: 'WHATWG URL benchmark' })
benchFastUri.add('fast-uri: parse domain', function () {
fastUriParse(domain)
})
benchUriJs.add('urijs: parse domain', function () {
uriJsParse(domain)
})
benchWHATWG.add('WHATWG URL: parse domain', function () {
// eslint-disable-next-line
new URL(domain)
})
benchFastUri.add('fast-uri: parse IPv4', function () {
fastUriParse(ipv4)
})
benchUriJs.add('urijs: parse IPv4', function () {
uriJsParse(ipv4)
})
benchFastUri.add('fast-uri: parse IPv6', function () {
fastUriParse(ipv6)
})
benchUriJs.add('urijs: parse IPv6', function () {
uriJsParse(ipv6)
})
benchFastUri.add('fast-uri: parse URN', function () {
fastUriParse(urn)
})
benchUriJs.add('urijs: parse URN', function () {
uriJsParse(urn)
})
benchWHATWG.add('WHATWG URL: parse URN', function () {
// eslint-disable-next-line
new URL(urn)
})
benchFastUri.add('fast-uri: parse URN uuid', function () {
fastUriParse(urnuuid)
})
benchUriJs.add('urijs: parse URN uuid', function () {
uriJsParse(urnuuid)
})
benchFastUri.add('fast-uri: serialize URN uuid', function () {
fastUriSerialize(urnuuidComponent)
})
benchUriJs.add('uri-js: serialize URN uuid', function () {
uriJsSerialize(urnuuidComponent)
})
benchFastUri.add('fast-uri: serialize uri', function () {
fastUriSerialize({
scheme: 'uri',
userinfo: 'foo:bar',
host: 'example.com',
port: 1,
path: 'path',
query: 'query',
fragment: 'fragment'
})
})
benchUriJs.add('urijs: serialize uri', function () {
uriJsSerialize({
scheme: 'uri',
userinfo: 'foo:bar',
host: 'example.com',
port: 1,
path: 'path',
query: 'query',
fragment: 'fragment'
})
})
benchFastUri.add('fast-uri: serialize long uri with dots', function () {
fastUriSerialize({
scheme: 'uri',
userinfo: 'foo:bar',
host: 'example.com',
port: 1,
path: './a/./b/c/../.././d/../e/f/.././/',
query: 'query',
fragment: 'fragment'
})
})
benchUriJs.add('urijs: serialize long uri with dots', function () {
uriJsSerialize({
scheme: 'uri',
userinfo: 'foo:bar',
host: 'example.com',
port: 1,
path: './a/./b/c/../.././d/../e/f/.././/',
query: 'query',
fragment: 'fragment'
})
})
benchFastUri.add('fast-uri: serialize IPv6', function () {
fastUriSerialize({ host: '2606:2800:220:1:248:1893:25c8:1946' })
})
benchUriJs.add('urijs: serialize IPv6', function () {
uriJsSerialize({ host: '2606:2800:220:1:248:1893:25c8:1946' })
})
benchFastUri.add('fast-uri: serialize ws', function () {
fastUriSerialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true })
})
benchUriJs.add('urijs: serialize ws', function () {
uriJsSerialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true })
})
benchFastUri.add('fast-uri: resolve', function () {
fastUriResolve(base, '../../../g')
})
benchUriJs.add('urijs: resolve', function () {
uriJsResolve(base, '../../../g')
})
benchFastUri.add('fast-uri: equal', function () {
fastUriEqual('example://a/b/c/%7Bfoo%7D', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d')
})
benchUriJs.add('urijs: equal', function () {
uriJsEqual('example://a/b/c/%7Bfoo%7D', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d')
})
await benchFastUri.run()
console.log(benchFastUri.name)
console.table(benchFastUri.table())
await benchUriJs.run()
console.log(benchUriJs.name)
console.table(benchUriJs.table())
await benchWHATWG.run()
console.log(benchWHATWG.name)
console.table(benchWHATWG.table())
@@ -0,0 +1,65 @@
import type * as core from "./core.js";
import type { SomeType } from "./schemas.js";
/** @internal Sentinel the compiled fast path returns when validation fails. */
export declare const INVALID: unique symbol;
/** @internal */
export type INVALID = typeof INVALID;
interface CompileFnOptions {
debug?: boolean | undefined;
/** Emit a validator instead of a parser: skip building the output value where nothing reads it. */
assertOnly?: boolean | undefined;
}
type CompiledFn<T> = ((input: unknown) => T | INVALID) & {
code?: string | undefined;
/** False when this function's INVALID does not strictly mean "the runtime would reject". */
definite?: boolean | undefined;
};
/** Raised when the schema contains async refinements or transforms. Surfaces only under `compile(schema, { strict: true })`. */
export declare class ZodCompileAsyncError extends Error {
constructor(message?: string);
}
/**
* Raised when the schema contains a feature whose semantics the fast path
* can't fully model. Both the shim in `zod/compile` and the default
* `compile()` fall back to the runtime parser for that schema; only
* `compile(schema, { strict: true })` lets it surface.
*/
export declare class ZodCompileUnsupportedError extends Error {
/** Whether a container may absorb this refusal by running the child through the runtime (see `compileChild`). False when running only that node on the runtime is not equivalent to running the whole parse there — a runtime island gets no parse context, so a node that *consumes* issues rather than propagating them would finalize them against the wrong error map and still succeed. */
readonly islandable: boolean;
constructor(feature: string, islandable?: boolean);
}
export interface CompileOptions {
/** Throw the refusal instead of returning the schema uncompiled. */
strict?: boolean | undefined;
}
/**
* AOT-compile a Zod schema. Returns a clone whose `_zod.run` calls a generated
* fast path first and falls back to the original runtime parser on failure.
*
* - Forward direction only. Backward (encode), async, and `skipChecks` paths
* bypass the fast path and use the runtime directly.
* - Never throws. A schema the fast path can't model is returned unchanged and
* keeps using the runtime parser. Pass `{ strict: true }` to get the refusal
* as a thrown `ZodCompileUnsupportedError` / `ZodCompileAsyncError` instead.
* - The original schema is unchanged. The clone shares children by reference.
*/
export declare function compile<T extends SomeType>(schema: T, options?: CompileOptions): T;
/**
* Install an already-generated parser as a schema's fast path. Returns a clone; the original is
* unchanged.
*
* The parser takes the input and returns the parsed value, or `INVALID` to hand the parse to the
* runtime. It must be synchronous and forward-direction, and it must build fresh output rather than
* return its input — Zod cannot check either, and a wrong *success* is returned to the caller as-is.
*
* `compile()` is the ordinary entry point. This is for a build-time or native compiler that produces
* a parser where `new Function` is unavailable.
*/
export declare function withParser<T extends SomeType>(schema: T, parser: (input: unknown) => core.output<T> | INVALID): T;
/**
* @internal Generate the standalone compiled function: a parser by default, a validator under
* `assertOnly`. Returns the parsed value, `true` where nothing reads the output, or `INVALID`. Consumers use `compile()`.
*/
export declare function compileFn<T extends SomeType>(schema: T, options?: CompileFnOptions): CompiledFn<core.output<T>>;
export {};
@@ -0,0 +1 @@
{"version":3,"file":"use-animated-state.mjs","sources":["../../../../src/animation/hooks/use-animated-state.ts"],"sourcesContent":["\"use client\"\n\nimport {\n animateVisualElement,\n createBox,\n ResolvedValues,\n TargetAndTransition,\n VisualElement,\n} from \"motion-dom\"\nimport { useLayoutEffect, useState } from \"react\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { useConstant } from \"../../utils/use-constant\"\n\ninterface AnimatedStateOptions {\n initialState: ResolvedValues\n}\n\nconst createObject = () => ({})\n\nclass StateVisualElement extends VisualElement<\n ResolvedValues,\n {},\n AnimatedStateOptions\n> {\n type: \"state\"\n build() {}\n measureInstanceViewportBox = createBox\n resetTransform() {}\n restoreTransform() {}\n removeValueFromRenderState() {}\n renderInstance() {}\n scrapeMotionValuesFromProps() {\n return createObject()\n }\n getBaseTargetFromProps() {\n return undefined\n }\n\n readValueFromInstance(\n _state: ResolvedValues,\n key: string,\n options: AnimatedStateOptions\n ) {\n return options.initialState[key] || 0\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n\nconst useVisualState = makeUseVisualState({\n scrapeMotionValuesFromProps: createObject,\n createRenderState: createObject,\n})\n\n/**\n * This is not an officially supported API and may be removed\n * on any version.\n */\nexport function useAnimatedState(initialState: any) {\n const [animationState, setAnimationState] = useState(initialState)\n const visualState = useVisualState({}, false)\n\n const element = useConstant(() => {\n return new StateVisualElement(\n {\n props: {\n onUpdate: (v) => {\n setAnimationState({ ...v })\n },\n },\n visualState,\n presenceContext: null,\n },\n { initialState }\n )\n })\n\n useLayoutEffect(() => {\n element.mount({})\n return () => element.unmount()\n }, [element])\n\n const startAnimation = useConstant(\n () => (animationDefinition: TargetAndTransition) => {\n return animateVisualElement(element, animationDefinition)\n }\n )\n\n return [animationState, startAnimation]\n}\n"],"names":[],"mappings":";;;;;;AAiBA;AAEA;AAAA;;;;AAMI;AAEA;AACA;AACA;AACA;;;;;AAKI;;AAGJ;;;;AASI;;AAEP;AAED;AACI;AACA;AACH;AAED;;;AAGG;AACG;;;AAIF;;AAGY;AACI;AACI;;AAEP;;AAED;AACH;AAGT;;AAGI;AACA;AACJ;;AAIQ;AACJ;AAGJ;AACJ;;"}
@@ -0,0 +1,17 @@
'use strict'
// parse out just the options we care about
const looseOption = Object.freeze({ loose: true })
const emptyOpts = Object.freeze({ })
const parseOptions = options => {
if (!options) {
return emptyOpts
}
if (typeof options !== 'object') {
return looseOption
}
return options
}
module.exports = parseOptions
@@ -0,0 +1,9 @@
// on windows, either \ or / are valid directory separators.
// on unix, \ is a valid character in filenames.
// so, on windows, and only on windows, we replace all \ chars with /,
// so that we can use / as our one and only directory separator char.
const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
export const normalizeWindowsPath = platform !== 'win32' ?
(p) => String(p)
: (p) => String(p).replaceAll(/\\/g, '/');
//# sourceMappingURL=normalize-windows-path.js.map
@@ -0,0 +1,44 @@
/**
* @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 Boxes = createLucideIcon("Boxes", [
[
"path",
{
d: "M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",
key: "lc1i9w"
}
],
["path", { d: "m7 16.5-4.74-2.85", key: "1o9zyk" }],
["path", { d: "m7 16.5 5-3", key: "va8pkn" }],
["path", { d: "M7 16.5v5.17", key: "jnp8gn" }],
[
"path",
{
d: "M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",
key: "8zsnat"
}
],
["path", { d: "m17 16.5-5-3", key: "8arw3v" }],
["path", { d: "m17 16.5 4.74-2.85", key: "8rfmw" }],
["path", { d: "M17 16.5v5.17", key: "k6z78m" }],
[
"path",
{
d: "M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",
key: "1xygjf"
}
],
["path", { d: "M12 8 7.26 5.15", key: "1vbdud" }],
["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
["path", { d: "M12 13.5V8", key: "1io7kd" }]
]);
export { Boxes as default };
//# sourceMappingURL=boxes.js.map
@@ -0,0 +1,79 @@
{
"name": "@radix-ui/react-slider",
"version": "1.4.3",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"dependencies": {
"@radix-ui/primitive": "1.1.5",
"@radix-ui/react-compose-refs": "1.1.3",
"@radix-ui/react-collection": "1.1.12",
"@radix-ui/number": "1.1.2",
"@radix-ui/react-context": "1.2.0",
"@radix-ui/react-use-controllable-state": "1.2.3",
"@radix-ui/react-primitive": "2.1.7",
"@radix-ui/react-use-layout-effect": "1.1.2",
"@radix-ui/react-use-previous": "1.1.2",
"@radix-ui/react-use-size": "1.1.2",
"@radix-ui/react-direction": "1.1.2"
},
"devDependencies": {
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"typescript": "^5.9.3",
"@repo/builder": "0.0.0",
"@repo/test-utils": "0.0.0",
"@repo/typescript-config": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git",
"directory": "packages/react/slider"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "oxlint --max-warnings 0 src",
"clean": "rm -rf dist",
"reset": "rm -rf dist node_modules",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1,135 @@
/**
* @fileoverview Require or disallow newline at the end of files
* @author Nodeca Team <https://github.com/nodeca>
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "eol-last",
url: "https://eslint.style/rules/eol-last",
},
},
],
},
type: "layout",
docs: {
description: "Require or disallow newline at the end of files",
recommended: false,
url: "https://eslint.org/docs/latest/rules/eol-last",
},
fixable: "whitespace",
schema: [
{
enum: ["always", "never", "unix", "windows"],
},
],
messages: {
missing: "Newline required at end of file but not found.",
unexpected: "Newline not allowed at end of file.",
},
},
create(context) {
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
Program: function checkBadEOF(node) {
const sourceCode = context.sourceCode,
src = sourceCode.getText(),
lastLine = sourceCode.lines.at(-1),
location = {
column: lastLine.length,
line: sourceCode.lines.length,
},
LF = "\n",
CRLF = `\r${LF}`,
endsWithNewline = src.endsWith(LF);
/*
* Empty source is always valid: No content in file so we don't
* need to lint for a newline on the last line of content.
*/
if (!src.length) {
return;
}
let mode = context.options[0] || "always",
appendCRLF = false;
if (mode === "unix") {
// `"unix"` should behave exactly as `"always"`
mode = "always";
}
if (mode === "windows") {
// `"windows"` should behave exactly as `"always"`, but append CRLF in the fixer for backwards compatibility
mode = "always";
appendCRLF = true;
}
if (mode === "always" && !endsWithNewline) {
// File is not newline-terminated, but should be
context.report({
node,
loc: location,
messageId: "missing",
fix(fixer) {
return fixer.insertTextAfterRange(
[0, src.length],
appendCRLF ? CRLF : LF,
);
},
});
} else if (mode === "never" && endsWithNewline) {
const secondLastLine = sourceCode.lines.at(-2);
// File is newline-terminated, but shouldn't be
context.report({
node,
loc: {
start: {
line: sourceCode.lines.length - 1,
column: secondLastLine.length,
},
end: { line: sourceCode.lines.length, column: 0 },
},
messageId: "unexpected",
fix(fixer) {
const finalEOLs = /(?:\r?\n)+$/u,
match = finalEOLs.exec(sourceCode.text),
start = match.index,
end = sourceCode.text.length;
return fixer.replaceTextRange([start, end], "");
},
});
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"names":["_assert","require","_t","callExpression","cloneNode","expressionStatement","identifier","importDeclaration","importDefaultSpecifier","importNamespaceSpecifier","importSpecifier","memberExpression","stringLiteral","variableDeclaration","variableDeclarator","ImportBuilder","constructor","importedSource","scope","hub","_statements","_resultName","_importedSource","_scope","_hub","done","statements","resultName","import","push","namespace","name","local","generateUidIdentifier","statement","length","assert","type","specifiers","default","id","named","importName","var","expression","defaultInterop","_interop","addHelper","wildcardInterop","callee","declarations","init","fail","prop","read","exports"],"sources":["../src/import-builder.ts"],"sourcesContent":["import assert from \"node:assert\";\nimport {\n callExpression,\n cloneNode,\n expressionStatement,\n identifier,\n importDeclaration,\n importDefaultSpecifier,\n importNamespaceSpecifier,\n importSpecifier,\n memberExpression,\n stringLiteral,\n variableDeclaration,\n variableDeclarator,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { Scope, HubInterface } from \"@babel/traverse\";\n\n/**\n * A class to track and accumulate mutations to the AST that will eventually\n * output a new require/import statement list.\n */\nexport default class ImportBuilder {\n private _statements: t.Statement[] = [];\n private _resultName: t.Identifier | t.MemberExpression = null;\n\n declare _scope: Scope;\n declare _hub: HubInterface;\n private _importedSource: string;\n\n constructor(importedSource: string, scope: Scope, hub: HubInterface) {\n this._scope = scope;\n this._hub = hub;\n this._importedSource = importedSource;\n }\n\n done() {\n return {\n statements: this._statements,\n resultName: this._resultName,\n };\n }\n\n import() {\n this._statements.push(\n importDeclaration([], stringLiteral(this._importedSource)),\n );\n return this;\n }\n\n require() {\n this._statements.push(\n expressionStatement(\n callExpression(identifier(\"require\"), [\n stringLiteral(this._importedSource),\n ]),\n ),\n );\n return this;\n }\n\n namespace(name = \"namespace\") {\n const local = this._scope.generateUidIdentifier(name);\n\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [importNamespaceSpecifier(local)];\n this._resultName = cloneNode(local);\n return this;\n }\n default(name: string) {\n const id = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [importDefaultSpecifier(id)];\n this._resultName = cloneNode(id);\n return this;\n }\n named(name: string, importName: string) {\n if (importName === \"default\") return this.default(name);\n\n const id = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [importSpecifier(id, identifier(importName))];\n this._resultName = cloneNode(id);\n return this;\n }\n\n var(name: string) {\n const id = this._scope.generateUidIdentifier(name);\n let statement = this._statements[this._statements.length - 1];\n if (statement.type !== \"ExpressionStatement\") {\n assert(this._resultName);\n statement = expressionStatement(this._resultName);\n this._statements.push(statement);\n }\n this._statements[this._statements.length - 1] = variableDeclaration(\"var\", [\n variableDeclarator(id, statement.expression),\n ]);\n this._resultName = cloneNode(id);\n return this;\n }\n\n defaultInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireDefault\"));\n }\n wildcardInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireWildcard\"));\n }\n\n _interop(callee: t.Expression) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = callExpression(callee, [statement.expression]);\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = callExpression(callee, [\n statement.declarations[0].init,\n ]);\n } else {\n assert.fail(\"Unexpected type.\");\n }\n return this;\n }\n\n prop(name: string) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statementLine truncated
@@ -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 './file-pen.js';
//# sourceMappingURL=file-edit.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_tC","2":"_g"},D:{"1":"_NK","2":"_KC"},E:{"1":"_DB","2":"_e"},F:{"1":"_dD","2":"_fB"},G:{"1":"_M"},H:{"2":"1D"},I:{"1":"_SB","16":"_m"},J:{"1":"_B"},K:{"1":"_CB","16":"A"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:6,C:"Wav audio format",D:true};
@@ -0,0 +1 @@
export { Referencer, type ReferencerOptions } from './Referencer';
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"_IB","66":"_6H"},B:{"1":"_J"},C:{"1":"_8R","2":"_TS","66":"LB _iN"},D:{"1":"_fR","2":"_hJ"},E:{"1":"_7C","2":"_ZC"},F:{"1":"_QG _eF","2":"F G YD","66":"_6Q"},G:{"1":"_t","2":"_d"},H:{"1":"1D"},I:{"1":"I","2":"_G"},J:{"1":"A","2":"D"},K:{"1":"_ZB","2":"_cB"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"B","66":"A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:6,C:"TLS 1.2",D:true};
@@ -0,0 +1,273 @@
# ESLint Plugin Kit
## Description
A collection of utilities to help build ESLint plugins.
## Installation
For Node.js and compatible runtimes:
```shell
npm install @eslint/plugin-kit
# or
yarn add @eslint/plugin-kit
# or
pnpm install @eslint/plugin-kit
# or
bun add @eslint/plugin-kit
```
For Deno:
```shell
deno add @eslint/plugin-kit
```
## Usage
This package exports the following utilities:
- [`ConfigCommentParser`](#configcommentparser) - used to parse ESLint configuration comments (i.e., `/* eslint-disable rule */`)
- [`VisitNodeStep` and `CallMethodStep`](#visitnodestep-and-callmethodstep) - used to help implement `SourceCode#traverse()`
- [`Directive`](#directive) - used to help implement `SourceCode#getDisableDirectives()`
- [`TextSourceCodeBase`](#textsourcecodebase) - base class to help implement the `SourceCode` interface
### `ConfigCommentParser`
To use the `ConfigCommentParser` class, import it from the package and create a new instance, such as:
```js
import { ConfigCommentParser } from "@eslint/plugin-kit";
// create a new instance
const commentParser = new ConfigCommentParser();
// pass in a comment string without the comment delimiters
const directive = commentParser.parseDirective(
"eslint-disable prefer-const, no-var -- I don't want to use these.",
);
// will be undefined when a directive can't be parsed
if (directive) {
console.log(directive.label); // "eslint-disable"
console.log(directive.value); // "prefer-const, no-var"
console.log(directive.justification); // "I don't want to use these."
}
```
There are different styles of directive values that you'll need to parse separately to get the correct format:
```js
import { ConfigCommentParser } from "@eslint/plugin-kit";
// create a new instance
const commentParser = new ConfigCommentParser();
// list format
const list = commentParser.parseListConfig("prefer-const, no-var");
console.log(Object.entries(list)); // [["prefer-const", true], ["no-var", true]]
// string format
const strings = commentParser.parseStringConfig("foo:off, bar");
console.log(Object.entries(strings)); // [["foo", "off"], ["bar", null]]
// JSON-like config format
const jsonLike = commentParser.parseJSONLikeConfig(
"radix:[error, always], prefer-const: warn",
);
console.log(Object.entries(jsonLike.config)); // [["radix", ["error", "always"]], ["prefer-const", "warn"]]
```
### `VisitNodeStep` and `CallMethodStep`
The `VisitNodeStep` and `CallMethodStep` classes represent steps in the traversal of source code. They implement the correct interfaces to return from the `SourceCode#traverse()` method.
The `VisitNodeStep` class is the more common of the two, where you are describing a visit to a particular node during the traversal. The constructor accepts three arguments:
- `target` - the node being visited. This is used to determine the method to call inside of a rule. For instance, if the node's type is `Literal` then ESLint will call a method named `Literal()` on the rule (if present).
- `phase` - either 1 for enter or 2 for exit.
- `args` - an array of arguments to pass into the visitor method of a rule.
For example:
```js
import { VisitNodeStep } from "@eslint/plugin-kit";
class MySourceCode {
traverse() {
const steps = [];
for (const { node, parent, phase } of iterator(this.ast)) {
steps.push(
new VisitNodeStep({
target: node,
phase: phase === "enter" ? 1 : 2,
args: [node, parent],
}),
);
}
return steps;
}
}
```
The `CallMethodStep` class is less common and is used to tell ESLint to call a specific method on the rule. The constructor accepts two arguments:
- `target` - the name of the method to call, frequently beginning with `"on"` such as `"onCodePathStart"`.
- `args` - an array of arguments to pass to the method.
For example:
```js
import { VisitNodeStep, CallMethodStep } from "@eslint/plugin-kit";
class MySourceCode {
traverse() {
const steps = [];
for (const { node, parent, phase } of iterator(this.ast)) {
steps.push(
new VisitNodeStep({
target: node,
phase: phase === "enter" ? 1 : 2,
args: [node, parent],
}),
);
// call a method indicating how many times we've been through the loop
steps.push(
new CallMethodStep({
target: "onIteration",
args: [steps.length]
});
)
}
return steps;
}
}
```
### `Directive`
The `Directive` class represents a disable directive in the source code and implements the `Directive` interface from `@eslint/core`. You can tell ESLint about disable directives using the `SourceCode#getDisableDirectives()` method, where part of the return value is an array of `Directive` objects. Here's an example:
```js
import { Directive, ConfigCommentParser } from "@eslint/plugin-kit";
class MySourceCode {
getDisableDirectives() {
const directives = [];
const problems = [];
const commentParser = new ConfigCommentParser();
// read in the inline config nodes to check each one
this.getInlineConfigNodes().forEach(comment => {
// Step 1: Parse the directive
const { label, value, justification } =
commentParser.parseDirective(comment.value);
// Step 2: Extract the directive value and create the `Directive` object
switch (label) {
case "eslint-disable":
case "eslint-enable":
case "eslint-disable-next-line":
case "eslint-disable-line": {
const directiveType = label.slice("eslint-".length);
directives.push(
new Directive({
type: directiveType,
node: comment,
value,
justification,
}),
);
}
// ignore any comments that don't begin with known labels
}
});
return {
directives,
problems,
};
}
}
```
### `TextSourceCodeBase`
The `TextSourceCodeBase` class is intended to be a base class that has several of the common members found in `SourceCode` objects already implemented. Those members are:
- `lines` - an array of text lines that is created automatically when the constructor is called.
- `getLoc(nodeOrToken)` - gets the location of a node or token. Works for nodes that have the ESLint-style `loc` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different location format, you'll still need to implement this method yourself.
- `getLocFromIndex(index)` - Converts a source text index into a `{ line: number, column: number }` pair. (For this method to work, the root node should always cover the entire source code text, and the `getLoc()` method needs to be implemented correctly.)
- `getIndexFromLoc(loc)` - Converts a `{ line: number, column: number }` pair into a source text index. (For this method to work, the root node should always cover the entire source code text, and the `getLoc()` method needs to be implemented correctly.)
- `getRange(nodeOrToken)` - gets the range of a node or token within the source text. Works for nodes that have the ESLint-style `range` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different range format, you'll still need to implement this method yourself.
- `getText(node, beforeCount, afterCount)` - gets the source text for the given node that has range information attached. Optionally, can return additional characters before and after the given node. As long as `getRange()` is properly implemented, this method will just work.
- `getAncestors(node)` - returns the ancestry of the node. In order for this to work, you must implement the `getParent()` method yourself.
Here's an example:
```js
import { TextSourceCodeBase } from "@eslint/plugin-kit";
export class MySourceCode extends TextSourceCodeBase {
#parents = new Map();
constructor({ ast, text }) {
super({ ast, text });
}
getParent(node) {
return this.#parents.get(node);
}
traverse() {
const steps = [];
for (const { node, parent, phase } of iterator(this.ast)) {
//save the parent information
this.#parent.set(node, parent);
steps.push(
new VisitNodeStep({
target: node,
phase: phase === "enter" ? 1 : 2,
args: [node, parent],
}),
);
}
return steps;
}
}
```
In general, it's safe to collect the parent information during the `traverse()` method as `getParent()` and `getAncestor()` will only be called from rules once the AST has been traversed at least once.
## License
Apache 2.0
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->
## Sponsors
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="#"><img src="https://images.opencollective.com/aeriusventilations-org/avatar.png" alt="aeriusventilation's Org" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
@@ -0,0 +1,141 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_compose = require("../../compose.js");
require("../../router.js");
const require_router_trie_router_router = require("../../router/trie-router/router.js");
require("../../router/trie-router/index.js");
//#region src/middleware/combine/index.ts
/**
* @module
* Combine Middleware for Hono.
*/
/**
* Create a composed middleware that runs the first middleware that returns true.
*
* @param middleware - An array of MiddlewareHandler or Condition functions.
* Middleware is applied in the order it is passed, and if any middleware exits without returning
* an exception first, subsequent middleware will not be executed.
* You can also pass a condition function that returns a boolean value. If returns true
* the evaluation will be halted, and rest of the middleware will not be executed.
* @returns A composed middleware.
*
* @example
* ```ts
* import { some } from 'hono/combine'
* import { bearerAuth } from 'hono/bearer-auth'
* import { myRateLimit } from '@/rate-limit'
*
* // If client has a valid token, then skip rate limiting.
* // Otherwise, apply rate limiting.
* app.use('/api/*', some(
* bearerAuth({ token }),
* myRateLimit({ limit: 100 }),
* ));
* ```
*/
const some = (...middleware) => {
return async function some(c, next) {
let isNextCalled = false;
const wrappedNext = () => {
isNextCalled = true;
return next();
};
let lastError;
let response;
for (const handler of middleware) try {
const result = await handler(c, wrappedNext);
if (result === true && !c.finalized) await wrappedNext();
else if (result === false) {
lastError = /* @__PURE__ */ new Error("No successful middleware found");
continue;
} else if (result && result !== true) response = result;
lastError = void 0;
break;
} catch (error) {
lastError = error;
if (isNextCalled) break;
}
if (lastError) throw lastError;
return response;
};
};
/**
* Create a composed middleware that runs all middleware and throws an error if any of them fail.
*
* @param middleware - An array of MiddlewareHandler or Condition functions.
* Middleware is applied in the order it is passed, and if any middleware throws an error,
* subsequent middleware will not be executed.
* You can also pass a condition function that returns a boolean value. If returns false
* the evaluation will be halted, and rest of the middleware will not be executed.
* @returns A composed middleware.
*
* @example
* ```ts
* import { some, every } from 'hono/combine'
* import { bearerAuth } from 'hono/bearer-auth'
* import { myCheckLocalNetwork } from '@/check-local-network'
* import { myRateLimit } from '@/rate-limit'
*
* // If client is in local network, then skip authentication and rate limiting.
* // Otherwise, apply authentication and rate limiting.
* app.use('/api/*', some(
* myCheckLocalNetwork(),
* every(
* bearerAuth({ token }),
* myRateLimit({ limit: 100 }),
* ),
* ));
* ```
*/
const every = (...middleware) => {
return async function every(c, next) {
const currentRouteIndex = c.req.routeIndex;
await require_compose.compose(middleware.map((m) => [[async (c, next) => {
c.req.routeIndex = currentRouteIndex;
const res = await m(c, next);
if (res === false) throw new Error("Unmet condition");
return res;
}]]))(c, next);
};
};
/**
* Create a composed middleware that runs all middleware except when the condition is met.
*
* @param condition - A string or Condition function.
* If there are multiple targets to match any of them, they can be passed as an array.
* If a string is passed, it will be treated as a path pattern to match.
* If a Condition function is passed, it will be evaluated against the request context.
* @param middleware - Middleware to run when the condition is not met.
* Multiple middleware can be passed, and they are applied in the order they are passed.
* @returns A composed middleware.
*
* @example
* ```ts
* import { except } from 'hono/combine'
* import { bearerAuth } from 'hono/bearer-auth'
*
* // If client is accessing public API, then skip authentication.
* // Otherwise, require a valid token.
* app.use('/api/*', except(
* '/api/public/*',
* bearerAuth({ token }),
* ));
* ```
*/
const except = (condition, ...middleware) => {
let router = void 0;
const conditions = (Array.isArray(condition) ? condition : [condition]).map((condition) => {
if (typeof condition === "string") {
router ||= new require_router_trie_router_router.TrieRouter();
router.add("ALL", condition, true);
} else return condition;
}).filter(Boolean);
if (router) conditions.unshift((c) => !!router?.match("ALL", c.req.path)?.[0]?.[0]?.[0]);
const handler = some((c) => conditions.some((cond) => cond(c)), every(...middleware));
return async function except(c, next) {
await handler(c, next);
};
};
//#endregion
exports.every = every;
exports.except = except;
exports.some = some;
@@ -0,0 +1,195 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
function getRussianPlural(count, one, few, many) {
const absCount = Math.abs(count);
const lastDigit = absCount % 10;
const lastTwoDigits = absCount % 100;
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
return many;
}
if (lastDigit === 1) {
return one;
}
if (lastDigit >= 2 && lastDigit <= 4) {
return few;
}
return many;
}
const error = () => {
const Sizable = {
string: {
unit: {
one: "символ",
few: "символа",
many: "символов",
},
verb: "иметь",
},
file: {
unit: {
one: "байт",
few: "байта",
many: "байт",
},
verb: "иметь",
},
array: {
unit: {
one: "элемент",
few: "элемента",
many: "элементов",
},
verb: "иметь",
},
set: {
unit: {
one: "элемент",
few: "элемента",
many: "элементов",
},
verb: "иметь",
},
map: {
unit: {
one: "элемент",
few: "элемента",
many: "элементов",
},
verb: "иметь",
},
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "ввод",
email: "email адрес",
url: "URL",
emoji: "эмодзи",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO дата и время",
date: "ISO дата",
time: "ISO время",
duration: "ISO длительность",
ipv4: "IPv4 адрес",
ipv6: "IPv6 адрес",
mac: "MAC адрес",
cidrv4: "IPv4 диапазон",
cidrv6: "IPv6 диапазон",
base64: "строка в формате base64",
base64url: "строка в формате base64url",
json_string: "JSON строка",
e164: "номер E.164",
credit_card: "номер кредитной карты",
currency_code: "код валюты",
iban: "IBAN",
jwt: "JWT",
template_literal: "ввод",
};
const TypeDictionary = {
nan: "NaN",
number: "число",
array: "массив",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Неверный ввод: ожидалось instanceof ${issue.expected}, получено ${received}`;
}
return `Неверный ввод: ожидалось ${expected}, получено ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Неверный ввод: ожидалось ${util.stringifyPrimitive(issue.values[0])}`;
return `Неверный вариант: ожидалось одно из ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
const maxValue = Number(issue.maximum);
const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет иметь ${adj}${issue.maximum.toString()} ${unit}`;
}
return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
const minValue = Number(issue.minimum);
const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет иметь ${adj}${issue.minimum.toString()} ${unit}`;
}
return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Неверная строка: должна начинаться с "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Неверная строка: должна заканчиваться на "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Неверная строка: должна содержать "${_issue.includes}"`;
if (_issue.format === "regex")
return `Неверная строка: должна соответствовать шаблону ${_issue.pattern}`;
return `Неверный ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Неверное число: должно быть кратным ${issue.divisor}`;
case "unrecognized_keys":
return `Нераспознанн${issue.keys.length > 1 ? "ые" : "ый"} ключ${issue.keys.length > 1 ? "и" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Неверный ключ в ${issue.origin}`;
case "invalid_union":
return "Неверные входные данные";
case "invalid_element":
return `Неверное значение в ${issue.origin}`;
default:
return `Неверные входные данные`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -0,0 +1,58 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Hook = require("./Hook");
const HookCodeFactory = require("./HookCodeFactory");
class SyncWaterfallHookCodeFactory extends HookCodeFactory {
content({ onError, onResult, resultReturns, rethrowIfPossible }) {
return this.callTapsSeries({
onError: (i, err) => onError(err),
onResult: (i, result, next) => {
let code = "";
code += `if(${result} !== undefined) {\n`;
code += `${this._args[0]} = ${result};\n`;
code += "}\n";
code += next();
return code;
},
onDone: () => onResult(this._args[0]),
doneReturns: resultReturns,
rethrowIfPossible
});
}
}
const factory = new SyncWaterfallHookCodeFactory();
const TAP_ASYNC = () => {
throw new Error("tapAsync is not supported on a SyncWaterfallHook");
};
const TAP_PROMISE = () => {
throw new Error("tapPromise is not supported on a SyncWaterfallHook");
};
function COMPILE(options) {
factory.setup(this, options);
return factory.create(options);
}
function SyncWaterfallHook(args = [], name = undefined) {
if (args.length < 1) {
throw new Error("Waterfall hooks must have at least one argument");
}
const hook = new Hook(args, name);
hook.constructor = SyncWaterfallHook;
hook.tapAsync = TAP_ASYNC;
hook.tapPromise = TAP_PROMISE;
hook.compile = COMPILE;
return hook;
}
SyncWaterfallHook.prototype = null;
module.exports = SyncWaterfallHook;
@@ -0,0 +1 @@
{"version":3,"file":"renderRouterToString.cjs","names":[],"sources":["../../../src/ssr/renderRouterToString.tsx"],"sourcesContent":["import ReactDOMServer from 'react-dom/server'\nimport type { ReactNode } from 'react'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport const renderRouterToString = async ({\n router,\n responseHeaders,\n children,\n}: {\n router: AnyRouter\n responseHeaders: Headers\n children: ReactNode\n}) => {\n try {\n let html = ReactDOMServer.renderToString(children)\n router.serverSsr!.setRenderFinished()\n\n const injectedHtml = router.serverSsr!.takeBufferedHtml()\n if (injectedHtml) {\n html = html.replace(`</body>`, () => `${injectedHtml}</body>`)\n }\n\n return new Response(`<!DOCTYPE html>${html}`, {\n status: router.stores.statusCode.get(),\n headers: responseHeaders,\n })\n } catch (error) {\n console.error('Render to string error:', error)\n return new Response('Internal Server Error', {\n status: 500,\n headers: responseHeaders,\n })\n } finally {\n router.serverSsr?.cleanup()\n }\n}\n"],"mappings":";;;;AAIA,IAAa,uBAAuB,OAAO,EACzC,QACA,iBACA,eAKI;AACJ,KAAI;EACF,IAAI,OAAO,iBAAA,QAAe,eAAe,SAAS;AAClD,SAAO,UAAW,mBAAmB;EAErC,MAAM,eAAe,OAAO,UAAW,kBAAkB;AACzD,MAAI,aACF,QAAO,KAAK,QAAQ,iBAAiB,GAAG,aAAa,SAAS;AAGhE,SAAO,IAAI,SAAS,kBAAkB,QAAQ;GAC5C,QAAQ,OAAO,OAAO,WAAW,KAAK;GACtC,SAAS;GACV,CAAC;UACK,OAAO;AACd,UAAQ,MAAM,2BAA2B,MAAM;AAC/C,SAAO,IAAI,SAAS,yBAAyB;GAC3C,QAAQ;GACR,SAAS;GACV,CAAC;WACM;AACR,SAAO,WAAW,SAAS"}
@@ -0,0 +1 @@
{"version":3,"file":"wind.js","sources":["../../../src/icons/wind.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Wind\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIuOCAxOS42QTIgMiAwIDEgMCAxNCAxNkgyIiAvPgogIDxwYXRoIGQ9Ik0xNy41IDhhMi41IDIuNSAwIDEgMSAyIDRIMiIgLz4KICA8cGF0aCBkPSJNOS44IDQuNEEyIDIgMCAxIDEgMTEgOEgyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/wind\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 Wind = createLucideIcon('Wind', [\n ['path', { d: 'M12.8 19.6A2 2 0 1 0 14 16H2', key: '148xed' }],\n ['path', { d: 'M17.5 8a2.5 2.5 0 1 1 2 4H2', key: '1u4tom' }],\n ['path', { d: 'M9.8 4.4A2 2 0 1 1 11 8H2', key: '75valh' }],\n]);\n\nexport default Wind;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CAAA,CACpC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
module.exports={C:{"47":0.00341,"49":0.00341,"52":0.01362,"72":0.00341,"78":0.00341,"115":0.38477,"120":0.15323,"121":0.31326,"123":0.00341,"124":0.00681,"125":0.00341,"127":0.00341,"128":0.00341,"136":0.00341,"138":0.02043,"140":0.04427,"142":0.00341,"143":0.00681,"144":0.00341,"145":0.00341,"146":0.00341,"147":0.00341,"148":0.00341,"149":0.00341,"150":0.01362,"151":0.00681,"152":0.06129,"153":0.02384,"154":0.18387,"155":0.4767,"156":0.50054,"157":0.02043,_:"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 48 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 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 118 119 122 126 129 130 131 132 133 134 135 137 139 141 158 159 160 3.5 3.6"},D:{"49":0.00681,"50":0.00341,"53":0.00341,"55":0.00341,"56":0.00341,"58":0.00341,"60":0.00341,"61":0.00341,"62":0.00341,"63":0.00341,"64":0.00341,"66":0.00341,"67":0.00341,"68":0.00341,"69":0.00681,"70":0.00341,"71":0.01362,"72":0.00681,"73":0.00681,"74":0.00681,"75":0.00341,"76":0.00681,"77":0.00341,"78":0.00681,"79":0.01362,"80":0.00681,"81":0.01022,"83":0.00341,"84":0.00341,"85":0.00341,"86":0.01362,"87":0.01703,"88":0.00341,"89":0.00341,"90":0.00341,"91":0.00681,"92":0.00341,"93":0.00341,"95":0.00341,"98":0.00341,"101":0.01022,"102":0.00341,"103":0.07151,"104":0.06129,"105":0.06129,"106":0.06129,"107":0.06129,"108":0.07151,"109":2.23368,"110":0.05789,"111":0.06129,"112":0.05789,"114":0.03065,"116":0.12599,"117":0.05789,"118":0.22133,"119":0.32007,"120":0.43244,"121":0.00681,"122":0.03405,"123":0.03405,"124":0.0681,"125":0.01362,"126":0.01022,"127":0.01022,"128":0.02384,"129":0.00681,"130":0.01703,"131":0.14301,"132":0.01022,"133":0.21111,"134":0.1328,"135":0.11918,"136":0.11918,"137":0.11577,"138":0.24857,"139":0.12939,"140":0.1362,"141":0.1328,"142":0.41201,"143":0.07491,"144":0.05108,"145":0.06129,"146":0.14982,"147":0.0681,"148":0.2043,"149":0.19409,"150":0.24516,"151":1.19856,"152":7.23563,"153":6.70445,"154":1.52204,"155":0.02043,"156":0.00681,_:"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 51 52 54 57 59 65 94 96 97 99 100 113 115 157"},F:{"46":0.00341,"56":0.00341,"64":0.00681,"73":0.00341,"79":0.01022,"95":0.01703,"100":0.00341,"101":0.01362,"106":0.00341,"113":0.00341,"131":0.00341,"132":0.00341,"133":0.07832,"134":0.09534,"135":0.07491,_:"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 57 58 60 62 63 65 66 67 68 69 70 71 72 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 102 103 104 105 107 108 109 110 111 112 114 115 116 117 118 119 120 121 122 123 124 125 126 127 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00341,"90":0.00341,"92":0.02043,"100":0.00341,"109":0.02724,"114":0.00681,"119":0.16004,"120":0.15663,"122":0.02724,"127":0.00341,"130":0.00341,"131":0.00341,"138":0.02724,"139":0.00341,"140":0.01362,"141":0.00681,"142":0.00681,"143":0.01362,"144":0.00681,"145":0.00681,"146":0.01022,"147":0.01022,"148":0.01362,"149":0.02043,"150":0.0681,"151":0.10215,"152":0.92957,"153":1.28709,"154":0.37115,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 121 123 124 125 126 128 129 132 133 134 135 136 137"},E:{"27":0.04767,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.2 17.4 18.0 27.1 27.2 TP","12.1":0.00341,"15.6":0.01022,"16.6":0.01362,"17.0":0.00341,"17.1":0.00681,"17.3":0.00341,"17.5":0.01362,"17.6":0.01022,"18.1":0.00341,"18.2":0.00341,"18.3":0.00341,"18.4":0.00341,"18.5-18.7":0.00341,"26.0":0.00681,"26.1":0.00341,"26.2":0.01362,"26.3":0.01703,"26.4":0.01362,"26.5":0.05448,"26.6":0.18047},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00087,"5.0-5.1":0.00087,"6.0-6.1":0,"7.0-7.1":0.00173,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00866,"11.0-11.2":0.00087,"11.3-11.4":0.00173,"12.0-12.1":0,"12.2-12.5":0.02251,"13.0-13.1":0,"13.2":0.00433,"13.3":0,"13.4-13.7":0.00087,"14.0-14.4":0.00346,"14.5-14.8":0.0052,"15.0-15.1":0.0052,"15.2-15.3":0.00346,"15.4":0.00433,"15.5":0.0052,"15.6-15.8":0.11257,"16.0":0.00866,"16.1":0.01559,"16.2":0.00866,"16.3":0.01905,"16.4":0.00433,"16.5":0.00693,"16.6-16.7":0.15673,"17.0":0.00606,"17.1":0.00866,"17.2":0.00866,"17.3":0.01299,"17.4":0.01818,"17.5":0.0355,"17.6-17.7":0.09179,"18.0":0.01905,"18.1":0.0381,"18.2":0.05196,"18.3":0.09006,"18.4":0.05629,"18.5-18.7":1.16294,"26.0":0.05629,"26.1":0.05715,"26.2":0.14894,"26.3":0.16106,"26.4":0.11777,"26.5":0.78886,"26.6":4.86736,"27.0":0.37321,"27.1":0,"27.2":0.00953},P:{"4":0.03718,"22":0.0093,"23":0.0093,"24":0.0093,"25":0.01859,"26":0.08366,"27":0.01859,"28":0.05577,"29":0.09296,Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"message-circle-warning.js","sources":["../../../src/icons/message-circle-warning.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageCircleWarning\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNy45IDIwQTkgOSAwIDEgMCA0IDE2LjFMMiAyMloiIC8+CiAgPHBhdGggZD0iTTEyIDh2NCIgLz4KICA8cGF0aCBkPSJNMTIgMTZoLjAxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/message-circle-warning\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 MessageCircleWarning = createLucideIcon('MessageCircleWarning', [\n ['path', { d: 'M7.9 20A9 9 0 1 0 4 16.1L2 22Z', key: 'vv11sd' }],\n ['path', { d: 'M12 8v4', key: '1got3b' }],\n ['path', { d: 'M12 16h.01', key: '1drbdi' }],\n]);\n\nexport default MessageCircleWarning;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB,iBAAiB,sBAAwB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/D,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,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,185 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
function getArmenianPlural(count, one, many) {
return Math.abs(count) === 1 ? one : many;
}
function withDefiniteArticle(word) {
if (!word)
return "";
const vowels = ["ա", "ե", "ը", "ի", "ո", "ու", "օ"];
const lastChar = word[word.length - 1];
return word + (vowels.includes(lastChar) ? "ն" : "ը");
}
const error = () => {
const Sizable = {
string: {
unit: {
one: "նշան",
many: "նշաններ",
},
verb: "ունենալ",
},
file: {
unit: {
one: "բայթ",
many: "բայթեր",
},
verb: "ունենալ",
},
array: {
unit: {
one: "տարր",
many: "տարրեր",
},
verb: "ունենալ",
},
set: {
unit: {
one: "տարր",
many: "տարրեր",
},
verb: "ունենալ",
},
map: {
unit: {
one: "տարր",
many: "տարրեր",
},
verb: "ունենալ",
},
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "մուտք",
email: "էլ. հասցե",
url: "URL",
emoji: "էմոջի",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO ամսաթիվ և ժամ",
date: "ISO ամսաթիվ",
time: "ISO ժամ",
duration: "ISO տևողություն",
ipv4: "IPv4 հասցե",
ipv6: "IPv6 հասցե",
mac: "MAC հասցե",
cidrv4: "IPv4 միջակայք",
cidrv6: "IPv6 միջակայք",
base64: "base64 ձևաչափով տող",
base64url: "base64url ձևաչափով տող",
json_string: "JSON տող",
e164: "E.164 համար",
credit_card: "կրեդիտ քարտի համար",
currency_code: "արժույթի կոդ",
iban: "IBAN",
jwt: "JWT",
template_literal: "մուտք",
};
const TypeDictionary = {
nan: "NaN",
number: "թիվ",
array: "զանգված",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Սխալ մուտքագրում․ սպասվում էր instanceof ${issue.expected}, ստացվել է ${received}`;
}
return `Սխալ մուտքագրում․ սպասվում էր ${expected}, ստացվել է ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Սխալ մուտքագրում․ սպասվում էր ${util.stringifyPrimitive(issue.values[1])}`;
return `Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
const maxValue = Number(issue.maximum);
const unit = getArmenianPlural(maxValue, sizing.unit.one, sizing.unit.many);
return `Չափազանց մեծ արժեք․ սպասվում է, որ ${withDefiniteArticle(issue.origin ?? "արժեք")} կունենա ${adj}${issue.maximum.toString()} ${unit}`;
}
return `Չափազանց մեծ արժեք․ սպասվում է, որ ${withDefiniteArticle(issue.origin ?? "արժեք")} լինի ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
const minValue = Number(issue.minimum);
const unit = getArmenianPlural(minValue, sizing.unit.one, sizing.unit.many);
return `Չափազանց փոքր արժեք․ սպասվում է, որ ${withDefiniteArticle(issue.origin)} կունենա ${adj}${issue.minimum.toString()} ${unit}`;
}
return `Չափազանց փոքր արժեք․ սպասվում է, որ ${withDefiniteArticle(issue.origin)} լինի ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Սխալ տող․ պետք է սկսվի "${_issue.prefix}"-ով`;
if (_issue.format === "ends_with")
return `Սխալ տող․ պետք է ավարտվի "${_issue.suffix}"-ով`;
if (_issue.format === "includes")
return `Սխալ տող․ պետք է պարունակի "${_issue.includes}"`;
if (_issue.format === "regex")
return `Սխալ տող․ պետք է համապատասխանի ${_issue.pattern} ձևաչափին`;
return `Սխալ ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Սխալ թիվ․ պետք է բազմապատիկ լինի ${issue.divisor}-ի`;
case "unrecognized_keys":
return `Չճանաչված բանալի${issue.keys.length > 1 ? "ներ" : ""}. ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Սխալ բանալի ${withDefiniteArticle(issue.origin)}-ում`;
case "invalid_union":
return "Սխալ մուտքագրում";
case "invalid_element":
return `Սխալ արժեք ${withDefiniteArticle(issue.origin)}-ում`;
default:
return `Սխալ մուտքագրում`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -0,0 +1,38 @@
import{a as rr,b as z,c as H,d as ir,e as I,f as St,g as ee,h as et,i as lr}from"./chunk-TDNFF6A4.mjs";import{a as nr}from"./chunk-X4GG3EDV.mjs";var ar="4.2.2";function tt(t){let r=[0];for(let n=0;n<t.length;n++)t.charCodeAt(n)===10&&r.push(n+1);function i(n){let s=0,l=r.length;for(;l>0;){let u=(l|0)>>1,f=s+u;r[f]<=n?(s=f+1,l=l-u-1):l=u}s-=1;let c=n-r[s];return{line:s+1,column:c}}function e({line:n,column:s}){n-=1,n=Math.min(Math.max(n,0),r.length-1);let l=r[n],c=r[n+1]??l;return Math.min(Math.max(l+s,0),c)}return{find:i,findOffset:e}}var Fe=92,rt=47,it=42,or=34,sr=39,Ji=58,nt=59,oe=10,lt=13,We=32,Be=9,ur=123,Tt=125,Et=40,fr=41,Qi=91,Xi=93,cr=45,Vt=64,en=33,se=class t extends Error{loc;constructor(r,i){if(i){let e=i[0],n=tt(e.code).find(i[1]);r=`${e.file}:${n.line}:${n.column+1}: ${r}`}super(r),this.name="CssSyntaxError",this.loc=i,Error.captureStackTrace&&Error.captureStackTrace(this,t)}};function Se(t,r){let i=r?.from?{file:r.from,code:t}:null;t[0]==="\uFEFF"&&(t=" "+t.slice(1));let e=[],n=[],s=[],l=null,c=null,u="",f="",g=0,d;for(let p=0;p<t.length;p++){let w=t.charCodeAt(p);if(!(w===lt&&(d=t.charCodeAt(p+1),d===oe)))if(w===Fe)u===""&&(g=p),u+=t.slice(p,p+2),p+=1;else if(w===rt&&t.charCodeAt(p+1)===it){let h=p;for(let A=p+2;A<t.length;A++)if(d=t.charCodeAt(A),d===Fe)A+=1;else if(d===it&&t.charCodeAt(A+1)===rt){p=A+1;break}let y=t.slice(h,p+1);if(y.charCodeAt(2)===en){let A=at(y.slice(2,-2));n.push(A),i&&(A.src=[i,h,p+1],A.dst=[i,h,p+1])}}else if(w===sr||w===or){let h=pr(t,p,w,i);u+=t.slice(p,h+1),p=h}else{if((w===We||w===oe||w===Be)&&(d=t.charCodeAt(p+1))&&(d===We||d===oe||d===Be||d===lt&&(d=t.charCodeAt(p+2))&&d==oe))continue;if(w===oe){if(u.length===0)continue;d=u.charCodeAt(u.length-1),d!==We&&d!==oe&&d!==Be&&(u+=" ")}else if(w===cr&&t.charCodeAt(p+1)===cr&&u.length===0){let h="",y=p,A=-1;for(let x=p+2;x<t.length;x++)if(d=t.charCodeAt(x),d===Fe)x+=1;else if(d===sr||d===or)x=pr(t,x,d,i);else if(d===rt&&t.charCodeAt(x+1)===it){for(let k=x+2;k<t.length;k++)if(d=t.charCodeAt(k),d===Fe)k+=1;else if(d===it&&t.charCodeAt(k+1)===rt){x=k+1;break}}else if(A===-1&&d===Ji)A=u.length+x-y;else if(d===nt&&h.length===0){u+=t.slice(y,x),p=x;break}else if(d===Et)h+=")";else if(d===Qi)h+="]";else if(d===ur)h+="}";else if((d===Tt||t.length-1===x)&&h.length===0){p=x-1,u+=t.slice(y,x);break}else(d===fr||d===Xi||d===Tt)&&h.length>0&&t[x]===h[h.length-1]&&(h=h.slice(0,-1));let E=Nt(u,A);if(!E)throw new se("Invalid custom property, expected a value",i?[i,y,p]:null);i&&(E.src=[i,y,p],E.dst=[i,y,p]),l?l.nodes.push(E):e.push(E),u=""}else if(w===nt&&u.charCodeAt(0)===Vt)c=Ye(u),i&&(c.src=[i,g,p],c.dst=[i,g,p]),l?l.nodes.push(c):e.push(c),u="",c=null;else if(w===nt&&f[f.length-1]!==")"){let h=Nt(u);if(!h){if(u.length===0)continue;throw new se(`Invalid declaration: \`${u.trim()}\``,i?[i,g,p]:null)}i&&(h.src=[i,g,p],h.dst=[i,g,p]),l?l.nodes.push(h):e.push(h),u=""}else if(w===ur&&f[f.length-1]!==")")f+="}",c=J(u.trim()),i&&(c.src=[i,g,p],c.dst=[i,g,p]),l&&l.nodes.push(c),s.push(l),l=c,u="",c=null;else if(w===Tt&&f[f.length-1]!==")"){if(f==="")throw new se("Missing opening {",i?[i,p,p]:null);if(f=f.slice(0,-1),u.length>0)if(u.charCodeAt(0)===Vt)c=Ye(u),i&&(c.src=[i,g,p],c.dst=[i,g,p]),l?l.nodes.push(c):e.push(c),u="",c=null;else{let y=u.indexOf(":");if(l){let A=Nt(u,y);if(!A)throw new se(`Invalid declaration: \`${u.trim()}\``,i?[i,g,p]:null);i&&(A.src=[i,g,p],A.dst=[i,g,p]),l.nodes.push(A)}}let h=s.pop()??null;h===null&&l&&e.push(l),l=h,u="",c=null}else if(w===Et)f+=")",u+="(";else if(w===fr){if(f[f.length-1]!==")")throw new se("Missing opening (",i?[i,p,p]:null);f=f.slice(0,-1),u+=")"}else{if(u.length===0&&(w===We||w===oe||w===Be))continue;u===""&&(g=p),u+=String.fromCharCode(w)}}}if(u.charCodeAt(0)===Vt){let p=Ye(u);i&&(p.src=[i,g,t.length],p.dst=[i,g,t.length]),e.push(p)}if(f.length>0&&l){if(l.kind==="rule")throw new se(`Missing closing } at ${l.selector}`,l.src?[l.src[0],l.src[1],l.src[1]]:null);if(l.kind==="at-rule")throw new se(`Missing closing } at ${l.name} ${l.params}`,l.src?[l.src[0],l.src[1],l.src[1]]:null)}return n.length>0?n.concat(e):e}function Ye(t,r=[]){let i=t,e="";for(let n=5;n<t.length;n++){let s=t.charCodeAt(n);if(s===We||s===Be||s===Et){i=t.slice(0,n),e=t.slice(n);break}}return F(i.trim(),e.trim(),r)}function Nt(t,r=t.indexOf(":")){if(r===-1)return null;let i=t.indexOf("!important",r+1);return a(t.slice(0,r).trim(),t.slice(r+1,i===-1?t.length:i).trim(),i!==-1)}function pr(t,r,i,e=null){let n;for(let s=r+1;s<t.length;s++)if(n=t.charCodeAt(s),n===Fe)s+=1;else{if(n===i)return s;if(n===nt&&(t.charCodeAt(s+1)===oe||t.charCodeAt(s+1)===lt&&t.charCodeAt(s+2)===oe))throw new se(`Unterminated string: ${t.slice(r,s+1)+String.fromCharCode(i)}`,e?[e,r,s+1]:null);if(n===oe||n===lt&&t.charCodeAt(s+1)===oe)throw new se(`Unterminated string: ${t.slice(r,s)+String.fromCharCode(i)}`,e?[e,r,s+1]:null)}return r}function ke(t){if(arguments.length===0)throw new TypeError("`CSS.escape` requires an argument.");let r=String(t),i=r.lengthLine truncated
`,`
`);let r=[],i=[],e=null,n="",s;for(let l=0;l<t.length;l++){let c=t.charCodeAt(l);switch(c){case gr:{n+=t[l]+t[l+1],l++;break}case sn:{if(n.length>0){let f=ne(n);e?e.nodes.push(f):r.push(f),n=""}let u=ne(t[l]);e?e.nodes.push(u):r.push(u);break}case hr:case vr:case wr:case yr:case kr:case br:case xr:case Ar:{if(n.length>0){let d=ne(n);e?e.nodes.push(d):r.push(d),n=""}let u=l,f=l+1;for(;f<t.length&&(s=t.charCodeAt(f),!(s!==hr&&s!==vr&&s!==wr&&s!==yr&&s!==kr&&s!==br&&s!==xr&&s!==Ar));f++);l=f-1;let g=rn(t.slice(u,f));e?e.nodes.push(g):r.push(g);break}case on:case ln:{let u=l;for(let f=l+1;f<t.length;f++)if(s=t.charCodeAt(f),s===gr)f+=1;else if(s===c){l=f;break}n+=t.slice(u,l+1);break}case an:{let u=tn(n,[]);n="",e?e.nodes.push(u):r.push(u),i.push(u),e=u;break}case nn:{let u=i.pop();if(n.length>0){let f=ne(n);u?.nodes.push(f),n=""}i.length>0?e=i[i.length-1]:e=null;break}default:n+=String.fromCharCode(c)}}return n.length>0&&r.push(ne(n)),r}var Ot=(l=>(l[l.Continue=0]="Continue",l[l.Skip=1]="Skip",l[l.Stop=2]="Stop",l[l.Replace=3]="Replace",l[l.ReplaceSkip=4]="ReplaceSkip",l[l.ReplaceStop=5]="ReplaceStop",l))(Ot||{}),R={Continue:{kind:0},Skip:{kind:1},Stop:{kind:2},Replace:t=>({kind:3,nodes:Array.isArray(t)?t:[t]}),ReplaceSkip:t=>({kind:4,nodes:Array.isArray(t)?t:[t]}),ReplaceStop:t=>({kind:5,nodes:Array.isArray(t)?t:[t]})};function _(t,r){typeof r=="function"?Cr(t,r):Cr(t,r.enter,r.exit)}function Cr(t,r=()=>R.Continue,i=()=>R.Continue){let e={value:[t,0,null],prev:null},n={parent:null,depth:0,path(){let s=[],l=e;for(;l;){let c=l.value[2];c&&s.push(c),l=l.prev}return s.reverse(),s}};for(;e!==null;){let s=e.value,l=s[0],c=s[1],u=s[2];if(c>=l.length){e=e.prev,n.depth-=1;continue}if(n.parent=u,c>=0){let p=l[c],w=r(p,n)??R.Continue;switch(w.kind){case 0:{p.nodes&&p.nodes.length>0&&(n.depth+=1,e={value:[p.nodes,0,p],prev:e}),s[1]=~c;continue}case 2:return;case 1:{s[1]=~c;continue}case 3:{l.splice(c,1,...w.nodes);continue}case 5:{l.splice(c,1,...w.nodes);return}case 4:{l.splice(c,1,...w.nodes),s[1]+=w.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${Ot[w.kind]??`Unknown(${w.kind})`}\` in enter.`)}}let f=~c,g=l[f],d=i(g,n)??R.Continue;switch(d.kind){case 0:s[1]=f+1;continue;case 2:return;case 3:{l.splice(f,1,...d.nodes),s[1]=f+d.nodes.length;continue}case 5:{l.splice(f,1,...d.nodes);return}case 4:{l.splice(f,1,...d.nodes),s[1]=f+d.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${Ot[d.kind]??`Unknown(${d.kind})`}\` in exit.`)}}}function st(t){let r=[];return _(B(t),i=>{if(!(i.kind!=="function"||i.value!=="var"))return _(i.nodes,e=>{e.kind!=="word"||e.value[0]!=="-"||e.value[1]!=="-"||r.push(e.value)}),R.Skip}),r}var un=64;function G(t,r=[]){return{kind:"rule",selector:t,nodes:r}}function F(t,r="",i=[]){return{kind:"at-rule",name:t,params:r,nodes:i}}function J(t,r=[]){return t.charCodeAt(0)===un?Ye(t,r):G(t,r)}function a(t,r,i=!1){return{kind:"declaration",property:t,value:r,important:i}}function at(t){return{kind:"comment",value:t}}function ce(t,r){return{kind:"context",context:t,nodes:r}}function W(t){return{kind:"at-root",nodes:t}}function te(t){switch(t.kind){case"rule":return{kind:t.kind,selector:t.selector,nodes:t.nodes.map(te),src:t.src,dst:t.dst};case"at-rule":return{kind:t.kind,name:t.name,params:t.params,nodes:t.nodes.map(te),src:t.src,dst:t.dst};case"at-root":return{kind:t.kind,nodes:t.nodes.map(te),src:t.src,dst:t.dst};case"context":return{kind:t.kind,context:{...t.context},nodes:t.nodes.map(te),src:t.src,dst:t.dst};case"declaration":return{kind:t.kind,property:t.property,value:t.value,important:t.important,src:t.src,dst:t.dst};case"comment":return{kind:t.kind,value:t.value,src:t.src,dst:t.dst};default:throw new Error(`Unknown node kind: ${t.kind}`)}}function qe(t){return{depth:t.depth,get context(){let r={};for(let i of t.path())i.kind==="context"&&Object.assign(r,i.context);return Object.defineProperty(this,"context",{value:r}),r},get parent(){let r=this.path().pop()??null;return Object.defineProperty(this,"parent",{value:r}),r},path(){return t.path().filter(r=>r.kind!=="context")}}}function Te(t,r,i=3){let e=[],n=new Set,s=new L(()=>new Set),l=new L(()=>new Set),c=new Set,u=new Set,f=[],g=[],d=new L(()=>new Set);function p(h,y,A={},E=0){if(h.kind==="declaration"){if(h.property==="--tw-sort"||h.value===void 0||h.value===null)return;if(A.theme&&h.property[0]==="-"&&h.property[1]==="-"){if(h.value==="initial"){h.value=void 0;return}A.keyframes||s.get(y).add(h)}if(h.value.includes("var("))if(A.theme&&h.property[0]==="-"&&h.property[1]==="-")for(let x of st(h.value))d.get(x).add(h.property);else r.trackUsedVariables(h.value);if(h.property==="animation")for(let x of $r(h.value))u.add(x);i&2&&h.value.includes("color-mix(")&&!A.supportsColorMix&&!A.keyframes&&l.get(y).add(h),y.push(h)}else if(h.kind==="rule"){let x=[];for(let V of h.nodes)p(V,x,A,E+1);let k={},D=new Set;for(let V of x){if(V.kind!=="declaration")continue;let N=`${V.property}:${V.value}:${V.important}`;k[N]??Line truncated
`,r){i+=f.length;let g=i;i+=l.property.length,i+=2,i+=l.value?.length??0,l.important&&(i+=11);let d=i;i+=2,l.dst=[e,g,d]}}else if(l.kind==="rule"){if(u+=`${f}${l.selector} {
`,r){i+=f.length;let g=i;i+=l.selector.length,i+=1;let d=i;l.dst=[e,g,d],i+=2}for(let g of l.nodes)u+=n(g,c+1);u+=`${f}}
`,r&&(i+=f.length,i+=2)}else if(l.kind==="at-rule"){if(l.nodes.length===0){let g=`${f}${l.name} ${l.params};
`;if(r){i+=f.length;let d=i;i+=l.name.length,i+=1,i+=l.params.length;let p=i;i+=2,l.dst=[e,d,p]}return g}if(u+=`${f}${l.name}${l.params?` ${l.params} `:" "}{
`,r){i+=f.length;let g=i;i+=l.name.length,l.params&&(i+=1,i+=l.params.length),i+=1;let d=i;l.dst=[e,g,d],i+=2}for(let g of l.nodes)u+=n(g,c+1);u+=`${f}}
`,r&&(i+=f.length,i+=2)}else if(l.kind==="comment"){if(u+=`${f}/*${l.value}*/
`,r){i+=f.length;let g=i;i+=2+l.value.length+2;let d=i;l.dst=[e,g,d],i+=1}}else if(l.kind==="context"||l.kind==="at-root")return"";return u}let s="";for(let l of t)s+=n(l,0);return e.code=s,s}function fn(t,r){let i=[];return _(t,(e,n)=>{if(r(e))return i=n.path(),i.push(e),R.Stop}),i}function Sr(t,r,i,e=new Set){if(e.has(t)||(e.add(t),r.getOptions(t)&24))return!0;{let s=i.get(t)??[];for(let l of s)if(Sr(l,r,i,e))return!0}return!1}function $r(t){return t.split(/[\s,]+/)}function be(t){if(t.indexOf("(")===-1)return Ie(t);let r=B(t);return It(r),t=Z(r),t=rr(t),t}function Ie(t,r=!1){let i="";for(let e=0;e<t.length;e++){let n=t[e];n==="\\"&&t[e+1]==="_"?(i+="_",e+=1):n==="_"&&!r?i+=" ":i+=n}return i}function It(t){for(let r of t)switch(r.kind){case"function":{if(r.value==="url"||r.value.endsWith("_url")){r.value=Ie(r.value);break}if(r.value==="var"||r.value.endsWith("_var")||r.value==="theme"||r.value.endsWith("_theme")){r.value=Ie(r.value);for(let i=0;i<r.nodes.length;i++){if(i==0&&r.nodes[i].kind==="word"){r.nodes[i].value=Ie(r.nodes[i].value,!0);continue}It([r.nodes[i]])}break}r.value=Ie(r.value),It(r.nodes);break}case"separator":case"word":{r.value=Ie(r.value);break}default:cn(r)}}function cn(t){throw new Error(`Unexpected value: ${t}`)}var _t=new Uint8Array(256);function we(t){let r=0,i=t.length;for(let e=0;e<i;e++){let n=t.charCodeAt(e);switch(n){case 92:e+=1;break;case 39:case 34:for(;++e<i;){let s=t.charCodeAt(e);if(s===92){e+=1;continue}if(s===n)break}break;case 40:_t[r]=41,r++;break;case 91:_t[r]=93,r++;break;case 123:break;case 93:case 125:case 41:if(r===0)return!1;r>0&&n===_t[r-1]&&r--;break;case 59:if(r===0)return!1;break}}return!0}var pn=58,Tr=45,Vr=97,Nr=122,Ut=/^[a-zA-Z0-9_.%-]+$/;function Lt(t){switch(t.kind){case"arbitrary":return{kind:t.kind,property:t.property,value:t.value,modifier:t.modifier?{kind:t.modifier.kind,value:t.modifier.value}:null,variants:t.variants.map(_e),important:t.important,raw:t.raw};case"static":return{kind:t.kind,root:t.root,variants:t.variants.map(_e),important:t.important,raw:t.raw};case"functional":return{kind:t.kind,root:t.root,value:t.value?t.value.kind==="arbitrary"?{kind:t.value.kind,dataType:t.value.dataType,value:t.value.value}:{kind:t.value.kind,value:t.value.value,fraction:t.value.fraction}:null,modifier:t.modifier?{kind:t.modifier.kind,value:t.modifier.value}:null,variants:t.variants.map(_e),important:t.important,raw:t.raw};default:throw new Error("Unknown candidate kind")}}function _e(t){switch(t.kind){case"arbitrary":return{kind:t.kind,selector:t.selector,relative:t.relative};case"static":return{kind:t.kind,root:t.root};case"functional":return{kind:t.kind,root:t.root,value:t.value?{kind:t.value.kind,value:t.value.value}:null,modifier:t.modifier?{kind:t.modifier.kind,value:t.modifier.value}:null};case"compound":return{kind:t.kind,root:t.root,variant:_e(t.variant),modifier:t.modifier?{kind:t.modifier.kind,value:t.modifier.value}:null};default:throw new Error("Unknown variant kind")}}function*Er(t,r){let i=z(t,":");if(r.theme.prefix){if(i.length===1||i[0]!==r.theme.prefix)return null;i.shift()}let e=i.pop(),n=[];for(let d=i.length-1;d>=0;--d){let p=r.parseVariant(i[d]);if(p===null)return;n.push(p)}let s=!1;e[e.length-1]==="!"?(s=!0,e=e.slice(0,-1)):e[0]==="!"&&(s=!0,e=e.slice(1)),r.utilities.has(e,"static")&&!e.includes("[")&&(yield{kind:"static",root:e,variants:n,important:s,raw:t});let[l,c=null,u]=z(e,"/");if(u)return;let f=c===null?null:Dt(c);if(c!==null&&f===null)return;if(l[0]==="["){if(l[l.length-1]!=="]")return;let d=l.charCodeAt(1);if(d!==Tr&&!(d>=Vr&&d<=Nr))return;l=l.slice(1,-1);let p=l.indexOf(":");if(p===-1||p===0||p===l.length-1)return;let w=l.slice(0,p),h=be(l.slice(p+1));if(!we(h))return;yield{kind:"arbitrary",property:w,value:h,modifier:f,variants:n,important:s,raw:t};return}let g;if(l[l.length-1]==="]"){let d=l.indexOf("-[");if(d===-1)return;let p=l.slice(0,d);if(!r.utilities.has(p,"functional"))return;let w=l.slice(d+1);g=[[p,w]]}else if(l[l.length-1]===")"){let d=l.indexOf("-(");if(d===-1)return;let p=l.slice(0,d);if(!r.utilities.has(p,"functional"))return;let w=l.slice(d+2,-1),h=z(w,":"),y=null;if(h.length===2&&(y=h[0],w=h[1]),w[0]!=="-"||w[1]!=="-"||!we(w))return;g=[[p,y===null?`[var(${w})]`:`[${y}:var(${w})]`]]}else g=Or(l,d=>r.utilities.has(d,"functional"));for(let[d,p]of g){let w={kind:"functional",root:d,modifier:f,value:null,variants:n,important:s,raw:t};if(p===null){yield w;continue}{let h=p.indexOf("[");if(h!==-1){if(p[p.length-1]!=="]")return;let A=be(p.slice(h+1,-1));if(!we(A))continue;let E=null;for(let x=0;x<A.length;x++){let k=A.charCodeAt(x);if(k===pn){E=A.slice(0,x),A=A.slice(x+1);break}if(!(k===Tr||k>=Vr&&k<=Nr))break}if(A.length===0||A.trim().length===0||E==="")continue;w.value={kind:"arbitrary",dataType:E||null,value:A}}else{let A=c===null||w.modifier?.kind==="arbitrary"?null:`${p}/${c}`;if(!Ut.test(p))continue;w.value={kind:"named",value:p,fraction:A}}}yield w}}function Dt(t){if(t[0]==="["&&t[t.length-1]==="]"){let r=be(tLine truncated
Only valid data types are: ${Mt.map(y=>`"${y}"`).join(", ")}.
`);let f=u.value,g=structuredClone(l),d="\xB6";_(g.nodes,y=>{if(y.kind==="word"&&y.value===f)return R.ReplaceSkip({kind:"word",value:d})});let p="^".repeat(Z([u]).length),w=Z([g]).indexOf(d),h=["```css",Z([l])," ".repeat(w)+p,"```"].join(`
`);console.warn(h)}}),n.value=Z(s)}),i.utilities.functional(r.slice(0,-2),n=>{let s=te(t),l=n.value,c=n.modifier;if(l===null)return;let u=!1,f=!1,g=!1,d=!1,p=new Map,w=!1;if(_([s],(h,y)=>{let A=y.parent;if(A?.kind!=="rule"&&A?.kind!=="at-rule"||h.kind!=="declaration"||!h.value)return;let E=!1,x=B(h.value);if(_(x,k=>{if(k.kind==="function"){if(k.value==="--value"){u=!0;let D=_r(l,k,i);return D?(f=!0,D.ratio?w=!0:p.set(h,A),R.ReplaceSkip(D.nodes)):(u||=!1,E=!0,R.Stop)}else if(k.value==="--modifier"){if(c===null)return E=!0,R.Stop;g=!0;let D=_r(c,k,i);return D?(d=!0,R.ReplaceSkip(D.nodes)):(g||=!1,E=!0,R.Stop)}}}),E)return R.ReplaceSkip([]);h.value=Z(x)}),u&&!f||g&&!d||w&&d||c&&!w&&!d)return null;if(w)for(let[h,y]of p){let A=y.nodes.indexOf(h);A!==-1&&y.nodes.splice(A,1)}return s.nodes}),i.utilities.suggest(r.slice(0,-2),()=>{let n=[],s=[];for(let[l,{literals:c,usedSpacingNumber:u,usedSpacingInteger:f,themeKeys:g}]of[[n,e["--value"]],[s,e["--modifier"]]]){for(let d of c)l.push(d);if(u)l.push(...dt);else if(f)for(let d of dt)I(d)&&l.push(d);for(let d of i.theme.keysInNamespaces(g))l.push(d.replace(Kr,(p,w,h)=>`${w}.${h}`))}return[{values:n,modifiers:s}]})}:Nn(r)?i=>{i.utilities.static(r,()=>t.nodes.map(te))}:null}function _r(t,r,i){for(let e of r.nodes){if(t.kind==="named"&&e.kind==="word"&&(e.value[0]==="'"||e.value[0]==='"')&&e.value[e.value.length-1]===e.value[0]&&e.value.slice(1,-1)===t.value)return{nodes:B(t.value)};if(t.kind==="named"&&e.kind==="word"&&e.value[0]==="-"&&e.value[1]==="-"){let n=e.value;if(n.endsWith("-*")){n=n.slice(0,-2);let s=i.theme.resolve(t.value,[n]);if(s)return{nodes:B(s)}}else{let s=n.split("-*");if(s.length<=1)continue;let l=[s.shift()],c=i.theme.resolveWith(t.value,l,s);if(c){let[,u={}]=c;{let f=u[s.pop()];if(f)return{nodes:B(f)}}}}}else if(t.kind==="named"&&e.kind==="word"){if(!Mt.includes(e.value))continue;let n=e.value==="ratio"&&"fraction"in t?t.fraction:t.value;if(!n)continue;let s=H(n,[e.value]);if(s===null)continue;if(s==="ratio"){let[l,c]=z(n,"/").map(Number);if(!I(l)||!I(c))continue}else{if(s==="number"&&!ee(n))continue;if(s==="percentage"&&!I(n.slice(0,-1)))continue}if(s==="ratio"){let[l,c]=z(n,"/");return{nodes:B(`${l.trim()} / ${c.trim()}`),ratio:!0}}return{nodes:B(n),ratio:!1}}else if(t.kind==="arbitrary"&&e.kind==="word"&&e.value[0]==="["&&e.value[e.value.length-1]==="]"){let n=e.value.slice(1,-1);if(n==="*")return{nodes:B(t.value)};if("dataType"in t&&t.dataType&&t.dataType!==n)continue;if("dataType"in t&&t.dataType)return{nodes:B(t.value)};if(H(t.value,[n])!==null)return{nodes:B(t.value)}}}}function ye(t,r,i,e,n=""){let s=!1,l=Je(r,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(Dr(u,i))));function c(u){return n?z(u,",").map(f=>n.trim()+" "+f.trim()).join(", "):u}return s?[a(t,c(Je(r,e))),J("@supports (color: lab(from red l a b))",[a(t,c(l))])]:[a(t,c(l))]}function ft(t,r,i,e,n=""){let s=!1,l=z(r,",").map(c=>Je(c,u=>i==null?e(u):u.startsWith("current")?e(Q(u,i)):((u.startsWith("var(")||i.startsWith("var("))&&(s=!0),e(Dr(u,i))))).map(c=>`drop-shadow(${c})`).join(" ");return s?[a(t,n+z(r,",").map(c=>`drop-shadow(${Je(c,e)})`).join(" ")),J("@supports (color: lab(from red l a b))",[a(t,n+l)])]:[a(t,n+l)]}var zr=/^-?[a-z][a-zA-Z0-9_-]*/,kn=37,bn=47,xn=46,An=97,Cn=122,$n=65,Sn=90,ct=48,pt=57,Tn=95,Vn=45;function Nn(t){let r=zr.exec(t);if(r===null)return!1;let i=r[0],e=t.slice(i.length);if(e.length===0&&i.endsWith("-"))return!1;if(e.length===0)return!0;let n=!1;for(let s=0;s<e.length;s++){let l=e.charCodeAt(s);switch(l){case kn:{if(s!==e.length-1)return!1;let u=(e[s-1]||i[i.length-1]||"").charCodeAt(0);if(u<ct||u>pt)return!1;break}case bn:{if(s===e.length-1||n)return!1;n=!0;break}case xn:{let u=(e[s-1]||i[i.length-1]||"").charCodeAt(0);if(u<ct||u>pt)return!1;let g=(e[s+1]||"").charCodeAt(0);if(g<ct||g>pt)return!1;break}case Tn:case Vn:continue;default:{if(l>=An&&l<=Cn||l>=$n&&l<=Sn||l>=ct&&l<=pt)continue;return!1}}}return!0}function En(t){if(!t.endsWith("-*"))return!1;t=t.slice(0,-2);let r=zr.exec(t);if(r===null)return!1;let i=r[0];return t.slice(i.length).length===0}var Ft={"--alpha":Rn,"--spacing":On,"--theme":Pn,theme:In};function Rn(t,r,i,...e){let[n,s]=z(i,"/").map(l=>l.trim());if(!n||!s)throw new Error(`The --alpha(\u2026) function requires a color and an alpha value, e.g.: \`--alpha(${n||"var(--my-color)"} / ${s||"50%"})\``);if(e.length>0)throw new Error(`The --alpha(\u2026) function only accepts one argument, e.g.: \`--alpha(${n||"var(--my-color)"} / ${s||"50%"})\``);return Q(n,s)}function On(t,r,i,...e){if(!i)throw new Error("The --spacing(\u2026) function requires an argument, but received none.");if(e.length>0)throw new Error(`The --spacing(\u2026) function only accepts a single argument, but received ${e.length+1}.`);let n=t.theme.resolve(null,["--spacing"]);if(!n)throw new Error("The --spacing(\u2026) function requires that the `--spacing` theme variable exists, but it was not found.");return`calc(${nLine truncated
`,`
`);let r=[],i=[],e=null,n="",s;for(let l=0;l<t.length;l++){let c=t.charCodeAt(l);switch(c){case ei:case ti:case ri:case ai:case li:case oi:case si:{if(n.length>0){let p=Ae(n);e?e.nodes.push(p):r.push(p),n=""}let u=l,f=l+1;for(;f<t.length&&(s=t.charCodeAt(f),!(s!==ei&&s!==ti&&s!==ri&&s!==ai&&s!==li&&s!==oi&&s!==si));f++);l=f-1;let g=t.slice(u,f),d=g.trim()===","?qn(g):Yn(g);e?e.nodes.push(d):r.push(d);break}case ni:{let u=Gn(n,[]);if(n="",u.value!==":not"&&u.value!==":where"&&u.value!==":has"&&u.value!==":is"){let f=l+1,g=0;for(let p=l+1;p<t.length;p++){if(s=t.charCodeAt(p),s===ni){g++;continue}if(s===Xr){if(g===0){l=p;break}g--}}let d=l;u.nodes.push(Zn(t.slice(f,d))),n="",l=d,e?e.nodes.push(u):r.push(u);break}e?e.nodes.push(u):r.push(u),i.push(u),e=u;break}case Xr:{let u=i.pop();if(n.length>0){let f=Ae(n);u.nodes.push(f),n=""}i.length>0?e=i[i.length-1]:e=null;break}case Xn:case Jn:case el:{if(n.length>0){let u=Ae(n);e?e.nodes.push(u):r.push(u)}n=t[l];break}case ii:{if(n.length>0){let g=Ae(n);e?e.nodes.push(g):r.push(g)}n="";let u=l,f=0;for(let g=l+1;g<t.length;g++){if(s=t.charCodeAt(g),s===ii){f++;continue}if(s===Hn){if(f===0){l=g;break}f--}}n+=t.slice(u,l+1);break}case tl:case Qn:{let u=l;for(let f=l+1;f<t.length;f++)if(s=t.charCodeAt(f),s===Qr)f+=1;else if(s===c){l=f;break}n+=t.slice(u,l+1);break}case rl:case il:{if(n.length>0){let u=Ae(n);e?e.nodes.push(u):r.push(u),n=""}e?e.nodes.push(Ae(t[l])):r.push(Ae(t[l]));break}case Qr:{n+=t[l]+t[l+1],l+=1;break}default:n+=t[l]}}return n.length>0&&r.push(Ae(n)),r}function ue(t,r){for(let i in t)delete t[i];return Object.assign(t,r)}function Oe(t){let r=[];for(let i of z(t,".")){if(!i.includes("[")){r.push(i);continue}let e=0;for(;;){let n=i.indexOf("[",e),s=i.indexOf("]",n);if(n===-1||s===-1)break;n>e&&r.push(i.slice(e,n)),r.push(i.slice(n+1,s)),e=s+1}e<=i.length-1&&r.push(i.slice(e))}return r}function Wt(t,r){let i=t;return i.storage[di]??=nl(),i.storage[mi]??=al(i),i.storage[gi]??=ul(),i.storage[hi]??=cl(),i.storage[vi]??=dl(),i.storage[Yt]??=yl(i),i.storage[wt]??=bl(i,r),i.storage[me]??=Pl(i),i.storage[Gt]??=_l(),i.storage[yt]??=Dl(i),i.storage[qt]??=Kl(i),i.storage[bt]??=Ul(i),i.storage[bi]??=Ll(i),i}var di=Symbol();function nl(){return new L(t=>new L(r=>({rem:t,features:r})))}function ll(t,r){let i=0;return r?.collapse&&(i|=1),r?.logicalToPhysical&&(i|=2),Wt(t,r).storage[di].get(r?.rem??null).get(i)}var mi=Symbol();function al(t){return new L(r=>new L(i=>({features:i,designSystem:t,signatureOptions:r})))}function ol(t,r,i){let e=0;return i?.collapse&&(e|=1),Wt(t).storage[mi].get(r).get(e)}function Bt(t,r,i){let e=ll(t,i),n=ol(t,e,i),s=Wt(t),l=new Set,c=s.storage[gi].get(n);for(let u of r)l.add(c.get(u));return l.size<=1||!(n.features&1)?Array.from(l):sl(n,Array.from(l))}function sl(t,r){if(r.length<=1)return r;let i=t.designSystem,e=new L(c=>new L(u=>new Set)),n=t.designSystem.theme.prefix?`${t.designSystem.theme.prefix}:`:"";for(let c of r){let u=z(c,":"),f=u.pop(),g=f.endsWith("!");g&&(f=f.slice(0,-1));let d=u.length>0?`${u.join(":")}:`:"",p=g?"!":"";e.get(d).get(p).add(`${n}${f}`)}let s=new Set;for(let[c,u]of e.entries())for(let[f,g]of u.entries())for(let d of l(Array.from(g)))n&&d.startsWith(n)&&(d=d.slice(n.length)),s.add(`${c}${d}${f}`);return Array.from(s);function l(c){let u=t.signatureOptions,f=i.storage[yt].get(u),g=i.storage[Gt].get(u),d=c.map(x=>f.get(x));if(d.some(x=>x.has("line-height"))){let x=i.theme.keysInNamespaces(["--text"]);if(x.length>0){let k=new Set,D=new Set;for(let N of d)if(N.has("line-height"))for(let U of N.get("line-height")){if(D.has(U))continue;D.add(U);let P=i.storage[wt]?.get(U)??null;if(P!==null)if(ee(P)){k.add(P);for(let j of x)f.get(`text-${j}/${P}`)}else{k.add(U);for(let j of x)f.get(`text-${j}/[${U}]`)}}let V=new Set;for(let N of d)if(N.has("font-size")){for(let U of N.get("font-size"))if(!V.has(U)){V.add(U);for(let P of k)ee(P)?f.get(`text-[${U}]/${P}`):f.get(`text-[${U}]/[${P}]`)}}}}let p=new L(x=>{let k=new L(V=>new L(N=>new Set)),D=new Set(f.get(x).keys());if(D.size===0)return k;for(let V of de(i,x))if(!(V.kind!=="functional"||V.value?.kind!=="named")){for(let N of i.utilities.keys("functional")){if(N===V.root)continue;let U=wi(i,{...Lt(V),root:N}),P=f.get(U);for(let[j,Y]of P)if(D.has(j))for(let q of Y)k.get(j).get(q).add(U)}return k}return k}),w=d.map((x,k)=>{let D=null;for(let V of x.keys()){let N=new Set;for(let U of g.get(V).values())for(let P of U)N.add(P);for(let U of x.get(V))for(let P of p.get(c[k]).get(V).get(U))N.add(P);if(D===null?D=N:D=pi(D,N),D.size===0)return D}return D??new Set}),h=new L(x=>new Set([x]));for(let x=0;x<w.length;x++){let k=w[x];for(let D=x+1;D<w.length;D++){let V=w[D];for(let N of k)if(V.has(N)){h.get(x).add(D),h.get(D).add(x);break}}}if(h.size===0)return c;let y=new L(x=>x.split(",").map(Number));for(let x of h.values()){let k=Array.from(x).sort((D,V)=>D-V);y.get(k.join(","))}let A=new Set(c),E=new Set;for(let x of y.values())for(let k of jl(x)){if(k.some(N=>E.has(c[N])))continue;let DLine truncated
`),s=!0;return _(B(e),l=>{if(l.kind==="function"&&l.value==="var"){let c=l.nodes[0].value;if(!new RegExp(`var\\(${c}[,)]\\s*`,"g").test(n)||n.includes(`${c}:`))return s=!1,R.Stop}}),s}function Cl(t,r){if(t.kind!=="functional"||t.value?.kind!=="named")return t;let i=r.designSystem,e=i.storage[qt].get(r.signatureOptions),n=i.storage[me].get(r.signatureOptions),s=i.printCandidate(t),l=n.get(s);if(typeof l!="string")return t;for(let u of c(l,t)){let f=i.printCandidate(u);if(n.get(f)===l)return u}return t;function*c(u,f){let g=e.get(u);if(!(g.length>1)){if(g.length===0&&f.modifier){let d={...f,modifier:null},p=n.get(i.printCandidate(d));if(typeof p=="string")for(let w of c(p,d))yield Object.assign({},w,{modifier:f.modifier})}if(g.length===1)for(let d of de(i,g[0]))yield d}}}var $l=new Map([["order-none","order-0"],["break-words","wrap-break-word"]]);function Sl(t,r){let i=r.designSystem,e=i.storage[me].get(r.signatureOptions),n=wi(i,t),s=$l.get(n)??null;if(s===null)return t;let l=e.get(n);if(typeof l!="string")return t;let c=e.get(s);if(typeof c!="string"||l!==c)return t;let[u]=de(i,s);return u}function Tl(t,r){let i=r.designSystem,e=i.storage[bt],n=i.storage[bi],s=kt(t);for(let[l]of s){if(l.kind==="compound")continue;let c=i.printVariant(l),u=e.get(c);if(typeof u!="string")continue;let f=n.get(u);if(f.length!==1)continue;let g=f[0],d=i.parseVariant(g);d!==null&&ue(l,d)}return t}function Vl(t,r){let i=r.designSystem,e=i.storage[me].get(r.signatureOptions);if(t.kind==="functional"&&t.value?.kind==="arbitrary"&&t.value.dataType!==null){let n=i.printCandidate({...t,value:{...t.value,dataType:null}});e.get(i.printCandidate(t))===e.get(n)&&(t.value.dataType=null)}return t}function Nl(t,r){if(t.kind!=="functional"||t.value?.kind!=="arbitrary")return t;let i=r.designSystem,e=i.storage[me].get(r.signatureOptions),n=e.get(i.printCandidate(t));if(n===null)return t;for(let s of yi(t))if(e.get(i.printCandidate({...t,value:s}))===n)return t.value=s,t;return t}function El(t){let r=kt(t);for(let[i]of r)if(i.kind==="functional"&&i.root==="data"&&i.value?.kind==="arbitrary"&&!i.value.value.includes("="))i.value={kind:"named",value:i.value.value};else if(i.kind==="functional"&&i.root==="aria"&&i.value?.kind==="arbitrary"&&(i.value.value.endsWith("=true")||i.value.value.endsWith('="true"')||i.value.value.endsWith("='true'"))){let[e,n]=z(i.value.value,"=");if(e[e.length-1]==="~"||e[e.length-1]==="|"||e[e.length-1]==="^"||e[e.length-1]==="$"||e[e.length-1]==="*")continue;i.value={kind:"named",value:i.value.value.slice(0,i.value.value.indexOf("="))}}else i.kind==="functional"&&i.root==="supports"&&i.value?.kind==="arbitrary"&&/^[a-z-][a-z0-9-]*$/i.test(i.value.value)&&(i.value={kind:"named",value:i.value.value});return t}function*yi(t,r=t.value?.value??"",i=new Set){if(i.has(r))return;if(i.add(r),yield{kind:"named",value:r,fraction:null},r.endsWith("%")&&ee(r.slice(0,-1))&&(yield{kind:"named",value:r.slice(0,-1),fraction:null}),r.includes("/")){let[s,l]=r.split("/");I(s)&&I(l)&&(yield{kind:"named",value:s,fraction:`${s}/${l}`})}let e=new Set;for(let s of r.matchAll(/(\d+\/\d+)|(\d+\.?\d+)/g))e.add(s[0].trim());let n=Array.from(e).sort((s,l)=>s.length-l.length);for(let s of n)yield*yi(t,s,i)}function ci(t){return!t.some(r=>r.kind==="separator"&&r.value.trim()===",")}function vt(t){let r=t.value.trim();return t.kind==="selector"&&r[0]==="["&&r[r.length-1]==="]"}function Rl(t,r){let i=[t],e=r.designSystem,n=e.storage[bt],s=kt(t);for(let[l,c]of s)if(l.kind==="compound"&&(l.root==="has"||l.root==="not"||l.root==="in")&&l.modifier!==null&&"modifier"in l.variant&&(l.variant.modifier=l.modifier,l.modifier=null),l.kind==="arbitrary"){if(l.relative)continue;let u=Re(l.selector.trim());if(!ci(u))continue;if(c===null&&u.length===3&&u[0].kind==="selector"&&u[0].value==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===">"&&u[2].kind==="selector"&&u[2].value==="*"){ue(l,e.parseVariant("*"));continue}if(c===null&&u.length===3&&u[0].kind==="selector"&&u[0].value==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===""&&u[2].kind==="selector"&&u[2].value==="*"){ue(l,e.parseVariant("**"));continue}if(c===null&&u.length===3&&u[1].kind==="combinator"&&u[1].value.trim()===""&&u[2].kind==="selector"&&u[2].value==="&"){u.pop(),u.pop(),ue(l,e.parseVariant(`in-[${pe(u)}]`));continue}if(c===null&&u[0].kind==="selector"&&(u[0].value==="@media"||u[0].value==="@supports")){let p=n.get(e.printVariant(l)),w=B(pe(u)),h=!1;if(_(w,y=>{if(y.kind==="word"&&y.value==="not")return h=!0,R.Replace([])}),w=B(Z(w)),_(w,y=>{y.kind==="separator"&&y.value!==" "&&y.value.trim()===""&&(y.value=" ")}),h){let y=e.parseVariant(`not-[${Z(w)}]`);if(y===null)continue;let A=n.get(e.printVariant(y));if(p===A){ue(l,y);continue}}}let f=null;c===null&&u.length===3&&u[0].kind==="selector"&&u[0].value.trim()==="&"&&u[1].kind==="combinator"&&u[1].value.trim()===">"&&u[2].kind==="selector"&&(vt(u[2])||u[2].value[0]===":")&&(u=[u[2]],f=e.parseVariant("*")),c===null&&u.length===3&&u[0].kind==="sLine truncated
${ie([d])}
Relies on:
${ie([w])}`)}f.add(d);for(let w of s.get(d))for(let h of l.get(w))p.push(d),g(h,p),p.pop();c.add(d),f.delete(d),u.push(d)}}for(let d of n)g(d);for(let d of u)"nodes"in d&&_(d.nodes,p=>{if(p.kind!=="at-rule"||p.name!=="@apply")return;let w=p.params.split(/(\s+)/g),h={},y=0;for(let[A,E]of w.entries())A%2===0&&(h[E]=y),y+=E.length;{let A=Object.keys(h),E=$e(A,r,{respectImportant:!1,onInvalidCandidate:V=>{if(r.theme.prefix&&!V.startsWith(r.theme.prefix))throw new Error(`Cannot apply unprefixed utility class \`${V}\`. Did you mean \`${r.theme.prefix}:${V}\`?`);if(r.invalidCandidates.has(V))throw new Error(`Cannot apply utility class \`${V}\` because it has been explicitly disabled: https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-excluding-classes`);let N=z(V,":");if(N.length>1){let U=N.pop();if(r.candidatesToCss([U])[0]){let P=r.candidatesToCss(N.map(Y=>`${Y}:[--tw-variant-check:1]`)),j=N.filter((Y,q)=>P[q]===null);if(j.length>0){if(j.length===1)throw new Error(`Cannot apply utility class \`${V}\` because the ${j.map(Y=>`\`${Y}\``)} variant does not exist.`);{let Y=new Intl.ListFormat("en",{style:"long",type:"conjunction"});throw new Error(`Cannot apply utility class \`${V}\` because the ${Y.format(j.map(q=>`\`${q}\``))} variants do not exist.`)}}}}throw r.theme.size===0?new Error(`Cannot apply unknown utility class \`${V}\`. Are you using CSS modules or similar and missing \`@reference\`? https://tailwindcss.com/docs/functions-and-directives#reference-directive`):new Error(`Cannot apply unknown utility class \`${V}\``)}}),x=p.src,k=E.astNodes.map(V=>{let N=E.nodeSorting.get(V)?.candidate,U=N?h[N]:void 0;if(V=te(V),!x||!N||U===void 0)return _([V],j=>{j.src=x}),V;let P=[x[0],x[1],x[2]];return P[1]+=7+U,P[2]=P[1]+N.length,_([V],j=>{j.src=P}),V}),D=[];for(let V of k)if(V.kind==="rule")for(let N of V.nodes)D.push(N);else D.push(V);return R.Replace(D)}});return i}function*Ri(t,r){for(let i of t.params.split(/\s+/g))for(let e of r.parseCandidate(i))switch(e.kind){case"arbitrary":break;case"static":case"functional":yield e.root;break;default:}}async function Qt(t,r,i,e=0,n=!1){let s=0,l=[];return _(t,c=>{if(c.kind==="at-rule"&&(c.name==="@import"||c.name==="@reference")){let u=Gl(B(c.params));if(u===null)return;c.name==="@reference"&&(u.media="reference"),s|=2;let{uri:f,layer:g,media:d,supports:p}=u;if(f.startsWith("data:")||f.startsWith("http://")||f.startsWith("https://"))return;let w=ce({},[]);return l.push((async()=>{if(e>100)throw new Error(`Exceeded maximum recursion depth while resolving \`${f}\` in \`${r}\`)`);let h=await i(f,r),y=Se(h.content,{from:n?h.path:void 0});await Qt(y,h.base,i,e+1,n),w.nodes=ql(c,[ce({base:h.base},y)],g,d,p)})()),R.ReplaceSkip(w)}}),l.length>0&&await Promise.all(l),s}function Gl(t){let r,i=null,e=null,n=null;for(let s=0;s<t.length;s++){let l=t[s];if(l.kind!=="separator"){if(l.kind==="word"&&!r){if(!l.value||l.value[0]!=='"'&&l.value[0]!=="'")return null;r=l.value.slice(1,-1);continue}if(l.kind==="function"&&l.value.toLowerCase()==="url"||!r)return null;if((l.kind==="word"||l.kind==="function")&&l.value.toLowerCase()==="layer"){if(i)return null;if(n)throw new Error("`layer(\u2026)` in an `@import` should come before any other functions or conditions");"nodes"in l?i=Z(l.nodes):i="";continue}if(l.kind==="function"&&l.value.toLowerCase()==="supports"){if(n)return null;n=Z(l.nodes);continue}e=Z(t.slice(s));break}}return r?{uri:r,layer:i,media:e,supports:n}:null}function ql(t,r,i,e,n){let s=r;if(i!==null){let l=F("@layer",i,s);l.src=t.src,s=[l]}if(e!==null){let l=F("@media",e,s);l.src=t.src,s=[l]}if(n!==null){let l=F("@supports",n[0]==="("?n:`(${n})`,s);l.src=t.src,s=[l]}return s}function Me(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let r=Object.getPrototypeOf(t);return r===null||Object.getPrototypeOf(r)===null}function Xe(t,r,i,e=[]){for(let n of r)if(n!=null)for(let s of Reflect.ownKeys(n)){e.push(s);let l=i(t[s],n[s],e);l!==void 0?t[s]=l:!Me(t[s])||!Me(n[s])?t[s]=n[s]:t[s]=Xe({},[t[s],n[s]],i,e),e.pop()}return t}function At(t,r,i){return function(n,s){let l=n.lastIndexOf("/"),c=null;l!==-1&&(c=n.slice(l+1).trim(),n=n.slice(0,l).trim());let u=(()=>{let f=Oe(n),[g,d]=Zl(t.theme,f),p=i(Oi(r()??{},f)??null);if(typeof p=="string"&&(p=p.replace("<alpha-value>","1")),typeof g!="object")return typeof d!="object"&&d&4?p??g:g;if(p!==null&&typeof p=="object"&&!Array.isArray(p)){let w=Xe({},[p],(h,y)=>y);if(g===null&&Object.hasOwn(p,"__CSS_VALUES__")){let h={};for(let y in p.__CSS_VALUES__)h[y]=p[y],delete w[y];g=h}for(let h in g)h!=="__CSS_VALUES__"&&(p?.__CSS_VALUES__?.[h]&4&&Oi(w,h.split("-"))!==void 0||(w[he(h)]=g[h]));return w}if(Array.isArray(g)&&Array.isArray(d)&&Array.isArray(p)){let w=g[0],h=g[1];d[0]&4&&(w=p[0]??w);for(let y of Object.keys(h))d[1][y]&4&&(h[y]=p[1][y]??h[y]);return[w,h]}return g??p})();return c&&typeof u=="string"&&(u=Q(u,c)),u??s}}function Zl(t,r){if(r.length===1&&r[0].startsWith("--"))return[t.get([r[0]]),t.getOptions(Line truncated
${ie([A])}
\`@plugin\` options must be a flat list of declarations.`);if(A.value===void 0)continue;let E=A.value,x=z(E,",").map(k=>{if(k=k.trim(),k==="null")return null;if(k==="true")return!0;if(k==="false")return!1;if(Number.isNaN(Number(k))){if(k[0]==='"'&&k[k.length-1]==='"'||k[0]==="'"&&k[k.length-1]==="'")return k.slice(1,-1);if(k[0]==="{"&&k[k.length-1]==="}")throw new Error(`Unexpected \`@plugin\` option: Value of declaration \`${ie([A]).trim()}\` is not supported.
Using an object as a plugin option is currently only supported in JavaScript configuration files.`)}else return Number(k);return k});y[A.property]=x.length===1?x[0]:x}return l.push([{id:h,base:w.context.base,reference:!!w.context.reference,src:d.src},Object.keys(y).length>0?y:null]),s|=4,R.Replace([])}if(d.name==="@config"){if(d.nodes.length>0)throw new Error("`@config` cannot have a body.");if(w.parent!==null)throw new Error("`@config` cannot be nested.");return c.push({id:d.params.slice(1,-1),base:w.context.base,reference:!!w.context.reference,src:d.src}),s|=4,R.Replace([])}}),ji(t);let u=t.resolveThemeValue;if(t.resolveThemeValue=function(p,w){return p.startsWith("--")?u(p,w):(s|=Wi({designSystem:t,base:r,ast:i,sources:n,configs:[],pluginDetails:[]}),t.resolveThemeValue(p,w))},!l.length&&!c.length)return 0;let[f,g]=await Promise.all([Promise.all(c.map(async({id:d,base:p,reference:w,src:h})=>{let y=await e(d,p,"config");return{path:d,base:y.base,config:y.module,reference:w,src:h}})),Promise.all(l.map(async([{id:d,base:p,reference:w,src:h},y])=>{let A=await e(d,p,"plugin");return{path:d,base:A.base,plugin:A.module,options:y,reference:w,src:h}}))]);return s|=Wi({designSystem:t,base:r,ast:i,sources:n,configs:f,pluginDetails:g}),s}function Wi({designSystem:t,base:r,ast:i,sources:e,configs:n,pluginDetails:s}){let l=0,u=[...s.map(y=>{if(!y.options)return{config:{plugins:[y.plugin]},base:y.base,reference:y.reference,src:y.src};if("__isOptionsFunction"in y.plugin)return{config:{plugins:[y.plugin(y.options)]},base:y.base,reference:y.reference,src:y.src};throw new Error(`The plugin "${y.path}" does not accept options`)}),...n],{resolvedConfig:f}=tr(t,[{config:Ui(t.theme),base:r,reference:!0,src:void 0},...u,{config:{plugins:[zi]},base:r,reference:!0,src:void 0}]),{resolvedConfig:g,replacedThemeKeys:d}=tr(t,u),p={designSystem:t,ast:i,resolvedConfig:f,featuresRef:{set current(y){l|=y}}},w=Xt({...p,referenceMode:!1,src:void 0}),h=t.resolveThemeValue;t.resolveThemeValue=function(A,E){if(A[0]==="-"&&A[1]==="-")return h(A,E);let x=w.theme(A,void 0);if(Array.isArray(x)&&x.length===2)return x[0];if(Array.isArray(x))return x.join(", ");if(typeof x=="object"&&x!==null&&"DEFAULT"in x)return x.DEFAULT;if(typeof x=="string")return x};for(let{handler:y,reference:A,src:E}of f.plugins){let x=Xt({...p,referenceMode:A??!1,src:E});y(x)}if(Wr(t,g,d),Ki(t,g),Fi(g,t),Mi(g,t),Li(g,t),!t.theme.prefix&&f.prefix){if(f.prefix.endsWith("-")&&(f.prefix=f.prefix.slice(0,-1),console.warn(`The prefix "${f.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only and is written as a variant before all utilities. We have fixed up the prefix for you. Remove the trailing \`-\` to silence this warning.`)),!ra.test(f.prefix))throw new Error(`The prefix "${f.prefix}" is invalid. Prefixes must be lowercase ASCII letters (a-z) only.`);t.theme.prefix=f.prefix}if(!t.important&&f.important===!0&&(t.important=!0),typeof f.important=="string"){let y=f.important;_(i,(A,E)=>{if(A.kind!=="at-rule"||A.name!=="@tailwind"||A.params!=="utilities")return;let x=qe(E);return x.parent?.kind==="rule"&&x.parent.selector===y?R.Stop:R.ReplaceStop(G(y,[A]))})}for(let y of f.blocklist)t.invalidCandidates.add(y);for(let y of f.content.files){if("raw"in y)throw new Error(`Error in the config file/plugin/preset. The \`content\` key contains a \`raw\` entry:
${JSON.stringify(y,null,2)}
This feature is not currently supported.`);let A=!1;y.pattern[0]=="!"&&(A=!0,y.pattern=y.pattern.slice(1)),e.push({...y,negated:A})}return l}function Yi({ast:t}){let r=new L(n=>tt(n.code)),i=new L(n=>({url:n.file,content:n.code,ignore:!1})),e={file:null,sources:[],mappings:[]};_(t,n=>{if(!n.src||!n.dst)return;let s=i.get(n.src[0]);if(!s.content)return;let l=r.get(n.src[0]),c=r.get(n.dst[0]),u=s.content.slice(n.src[1],n.src[2]),f=0;for(let p of u.split(`
`)){if(p.trim()!==""){let w=l.find(n.src[1]+f),h=c.find(n.dst[1]);e.mappings.push({name:null,originalPosition:{source:s,...w},generatedPosition:h})}f+=p.length,f+=1}let g=l.find(n.src[2]),d=c.find(n.dst[2]);e.mappings.push({name:null,originalPosition:{source:s,...g},generatedPosition:d})});for(let n of r.keys())e.sources.push(i.get(n));return e.mappings.sort((n,s)=>n.generatedPosition.line-s.generatedPosition.line||n.generatedPosition.column-s.generatedPosition.column||(n.originalPosition?.line??0)-(s.originalPosition?.line??0)||(n.originalPosition?.column??0)-(s.originalPosition?.column??0)),e}var Gi=/^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;function Ct(t){let r=t.indexOf("{");if(r===-1)return[t];let i=[],e=t.slice(0,r),n=t.slice(r),s=0,l=n.lastIndexOf("}");for(let d=0;d<n.length;d++){let p=n[d];if(p==="{")s++;else if(p==="}"&&(s--,s===0)){l=d;break}}if(l===-1)throw new Error(`The pattern \`${t}\` is not balanced.`);let c=n.slice(1,l),u=n.slice(l+1),f;ia(c)?f=na(c):f=z(c,","),f=f.flatMap(d=>Ct(d));let g=Ct(u);for(let d of g)for(let p of f)i.push(e+p+d);return i}function ia(t){return Gi.test(t)}function na(t){let r=t.match(Gi);if(!r)return[t];let[,i,e,n]=r,s=n?parseInt(n,10):void 0,l=[];if(/^-?\d+$/.test(i)&&/^-?\d+$/.test(e)){let c=parseInt(i,10),u=parseInt(e,10);if(s===void 0&&(s=c<=u?1:-1),s===0)throw new Error("Step cannot be zero in sequence expansion.");let f=c<u;f&&s<0&&(s=-s),!f&&s>0&&(s=-s);for(let g=c;f?g<=u:g>=u;g+=s)l.push(g.toString())}return l}function qi(t,r){let i=new Set,e=new Set,n=[];function s(l,c=[]){if(t.has(l)&&!i.has(l)){e.has(l)&&r.onCircularDependency?.(c,l),e.add(l);for(let u of t.get(l)??[])c.push(l),s(u,c),c.pop();i.add(l),e.delete(l),n.push(l)}}for(let l of t.keys())s(l);return n}var la=/^[a-z]+$/,Pt=(n=>(n[n.None=0]="None",n[n.AtProperty=1]="AtProperty",n[n.ColorMix=2]="ColorMix",n[n.All=3]="All",n))(Pt||{});function aa(){throw new Error("No `loadModule` function provided to `compile`")}function oa(){throw new Error("No `loadStylesheet` function provided to `compile`")}function sa(t){let r=0,i=null;for(let e of z(t," "))e==="reference"?r|=2:e==="inline"?r|=1:e==="default"?r|=4:e==="static"?r|=8:e.startsWith("prefix(")&&e.endsWith(")")&&(i=e.slice(7,-1));return[r,i]}var Ke=(u=>(u[u.None=0]="None",u[u.AtApply=1]="AtApply",u[u.AtImport=2]="AtImport",u[u.JsPluginCompat=4]="JsPluginCompat",u[u.ThemeFunction=8]="ThemeFunction",u[u.Utilities=16]="Utilities",u[u.Variants=32]="Variants",u[u.AtTheme=64]="AtTheme",u))(Ke||{});async function Zi(t,{base:r="",from:i,loadModule:e=aa,loadStylesheet:n=oa}={}){let s=0;t=[ce({base:r},t)],s|=await Qt(t,r,n,0,i!==void 0);let l=null,c=new ot,u=new Map,f=new Map,g=[],d=null,p=null,w=[],h=[],y=[],A=[],E=null;_(t,(k,D)=>{if(k.kind!=="at-rule")return;let V=qe(D);if(k.name==="@tailwind"&&(k.params==="utilities"||k.params.startsWith("utilities"))){if(p!==null)return R.Replace([]);if(V.context.reference)return R.Replace([]);let N=z(k.params," ");for(let U of N)if(U.startsWith("source(")){let P=U.slice(7,-1);if(P==="none"){E=P;continue}if(P[0]==='"'&&P[P.length-1]!=='"'||P[0]==="'"&&P[P.length-1]!=="'"||P[0]!=="'"&&P[0]!=='"')throw new Error("`source(\u2026)` paths must be quoted.");E={base:V.context.sourceBase??V.context.base,pattern:P.slice(1,-1)}}p=k,s|=16}if(k.name==="@utility"){if(V.parent!==null)throw new Error("`@utility` cannot be nested.");if(k.nodes.length===0)throw new Error(`\`@utility ${k.params}\` is empty. Utilities should include at least one property.`);let N=Lr(k);if(N===null){if(!k.params.endsWith("-*")){if(k.params.endsWith("*"))throw new Error(`\`@utility ${k.params}\` defines an invalid utility name. A functional utility must end in \`-*\`.`);if(k.params.includes("*"))throw new Error(`\`@utility ${k.params}\` defines an invalid utility name. The dynamic portion marked by \`-*\` must appear once at the end.`)}throw new Error(`\`@utility ${k.params}\` defines an invalid utility name. Utilities should be alphanumeric and start with a lowercase letter.`)}g.push(N)}if(k.name==="@source"){if(k.nodes.length>0)throw new Error("`@source` cannot have a body.");if(V.parent!==null)throw new Error("`@source` cannot be nested.");let N=!1,U=!1,P=k.params;if(P[0]==="n"&&P.startsWith("not ")&&(N=!0,P=P.slice(4)),P[0]==="i"&&P.startsWith("inline(")&&(U=!0,P=P.slice(7,-1).trim()),P[0]==='"'&&P[P.length-1]!=='"'||P[0]==="'"&&P[P.length-1]!=="'"||P[0]!=="'"&&P[0]!=='"')throw new Error("`@source` paths must be quoted.");let j=P.slice(1,-1);if(U){let Y=N?A:y,q=z(j," ");for(let le of q)for(let ae of Ct(le))Y.push(ae)}else h.push({base:V.context.base,pattern:j,negated:N});return R.ReplaceSkip([])}if(k.name==="@variant"&&(V.parent===null?k.nodes.length===0?k.name="@custom-variant":(_(k.nodes,N=>{if(N.kind==="at-rule"&&N.name==="@slot")return k.name="@custom-variant",R.Stop}),k.name==="@variant"&&w.push(k)):w.push(k)),k.name==="@custom-variant"){if(V.parent!==null)throw new Error("`@custom-variant` cannot be nested.");let[N,U]=z(k.params," ");if(!xt.test(N))throwLine truncated
`).map((Y,q,le)=>`${q===0||q>=le.length-2?" ":">"} ${Y}`).join(`
`);throw new Error(`\`@theme\` blocks must only contain custom properties or \`@keyframes\`.
${j}`)}),d?R.ReplaceSkip([]):(d=G(":root, :host",[]),d.src=k.src,R.ReplaceSkip(d))}});let x=Ti(c,p?.src);if(l&&(x.important=l),A.length>0)for(let k of A)x.invalidCandidates.add(k);s|=await Bi({designSystem:x,base:r,ast:t,loadModule:e,sources:h});for(let k of u.keys())x.variants.static(k,()=>{});for(let k of qi(f,{onCircularDependency(D,V){let N=ie(D.map((U,P)=>F("@custom-variant",U,[F("@variant",D[P+1]??V,[])]))).replaceAll(";"," { \u2026 }").replace(`@custom-variant ${V} {`,`@custom-variant ${V} { /* \u2190 */`);throw new Error(`Circular dependency detected in custom variants:
${N}`)}}))u.get(k)?.(x);for(let k of g)k(x);if(d){let k=[];for(let[V,N]of x.theme.entries()){if(N.options&2)continue;let U=a(ke(V),N.value);U.src=N.src,k.push(U)}let D=x.theme.getKeyframes();for(let V of D)t.push(ce({theme:!0},[W([V])]));d.nodes=[ce({theme:!0},k)]}if(s|=Qe(t,x),s|=De(t,x),s|=Ce(t,x),p){let k=p;k.kind="context",k.context={}}return _(t,k=>{if(k.kind==="at-rule")return k.name==="@utility"?R.Replace([]):R.Skip}),{designSystem:x,ast:t,sources:h,root:E,utilitiesNode:p,features:s,inlineCandidates:y}}async function ua(t,r={}){let{designSystem:i,ast:e,sources:n,root:s,utilitiesNode:l,features:c,inlineCandidates:u}=await Zi(t,r);e.unshift(at(`! tailwindcss v${ar} | MIT License | https://tailwindcss.com `));function f(h){i.invalidCandidates.add(h)}let g=new Set,d=null,p=0,w=!1;for(let h of u)i.invalidCandidates.has(h)||(g.add(h),w=!0);return{sources:n,root:s,features:c,build(h){if(c===0)return t;if(!l)return d??=Te(e,i,r.polyfills),d;let y=w,A=!1;w=!1;let E=g.size;for(let k of h)if(!i.invalidCandidates.has(k))if(k[0]==="-"&&k[1]==="-"){let D=i.theme.markUsedVariable(k);y||=D,A||=D}else g.add(k),y||=g.size!==E;if(!y)return d??=Te(e,i,r.polyfills),d;let x=$e(g,i,{onInvalidCandidate:f}).astNodes;return r.from&&_(x,k=>{k.src??=l.src}),!A&&p===x.length?(d??=Te(e,i,r.polyfills),d):(p=x.length,l.nodes=x,d=Te(e,i,r.polyfills),d)}}}async function yf(t,r={}){let i=Se(t,{from:r.from}),e=await ua(i,r),n=i,s=t;return{...e,build(l){let c=e.build(l);return c===n||(s=ie(c,!!r.from),n=c),s},buildSourceMap(){return Yi({ast:n})}}}async function kf(t,r={}){return(await Zi(Se(t,{from:r.from}),r)).designSystem}function fa(){throw new Error("It looks like you're trying to use `tailwindcss` directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install `@tailwindcss/postcss` and update your PostCSS configuration.")}export{Pt as a,Ke as b,ua as c,yf as d,kf as e,fa as f};
@@ -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 ChartColumn = createLucideIcon("ChartColumn", [
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
["path", { d: "M18 17V9", key: "2bz60n" }],
["path", { d: "M13 17V5", key: "1frdt8" }],
["path", { d: "M8 17v-3", key: "17ska0" }]
]);
export { ChartColumn as default };
//# sourceMappingURL=chart-column.js.map
@@ -0,0 +1,19 @@
# @babel/generator
> Turns an AST into code.
See our website [@babel/generator](https://babeljs.io/docs/babel-generator) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/generator
```
or using yarn:
```sh
yarn add @babel/generator --dev
```
@@ -0,0 +1,47 @@
/**
* Example: Progress notifications over stdio.
*
* Demonstrates a tool that reports progress to the client while processing.
*
* Run:
* npx tsx src/examples/server/progressExample.ts
*
* Then connect a client with an `onprogress` callback (see docs/protocol.md).
*/
import { McpServer } from '../../server/mcp.js';
import { StdioServerTransport } from '../../server/stdio.js';
import { z } from 'zod';
const server = new McpServer({ name: 'progress-example', version: '1.0.0' }, { capabilities: { logging: {} } });
server.registerTool('count', {
description: 'Count to N with progress updates',
inputSchema: { n: z.number().int().min(1).max(100) }
}, async ({ n }, extra) => {
for (let i = 1; i <= n; i++) {
if (extra.signal.aborted) {
return { content: [{ type: 'text', text: `Cancelled at ${i}` }], isError: true };
}
if (extra._meta?.progressToken !== undefined) {
await extra.sendNotification({
method: 'notifications/progress',
params: {
progressToken: extra._meta.progressToken,
progress: i,
total: n,
message: `Counting: ${i}/${n}`
}
});
}
// Simulate work
await new Promise(resolve => setTimeout(resolve, 100));
}
return { content: [{ type: 'text', text: `Counted to ${n}` }] };
});
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
}
main().catch(error => {
console.error('Server error:', error);
process.exit(1);
});
//# sourceMappingURL=progressExample.js.map
@@ -0,0 +1,26 @@
export { M as AgentReporter, B as BenchmarkReporter, a as BenchmarkReportsMap, D as DefaultReporter, b as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, J as JUnitReporter, c as JsonReporter, M as MinimalReporter, R as ReportersMap, T as TapFlatReporter, d as TapReporter, V as VerboseBenchmarkReporter, e as VerboseReporter } from './chunks/index.UpGiHP7g.js';
import 'node:fs';
import '@vitest/runner/utils';
import 'pathe';
import 'tinyrainbow';
import './chunks/utils.BS4fH3nR.js';
import 'node:util';
import '@vitest/utils/helpers';
import 'node:fs/promises';
import 'node:perf_hooks';
import '@vitest/utils/source-map';
import './chunks/env.D4Lgay0q.js';
import 'std-env';
import 'node:console';
import 'node:stream';
import '@vitest/utils/display';
import 'node:os';
import 'tinyexec';
import './path.js';
import 'node:path';
import 'node:url';
import 'vite';
import '@vitest/utils/offset';
import 'node:module';
console.warn("Importing from \"vitest/reporters\" is deprecated since Vitest 4.1. Please use \"vitest/node\" instead.");
@@ -0,0 +1,380 @@
import { n as isPromiseLike, t as arraify } from "./shared/misc-CoQm4NHO.mjs";
//#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.1/node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs
const postfixRE = /[?#].*$/;
function cleanUrl(url) {
return url.replace(postfixRE, "");
}
function extractQueryWithoutFragment(url) {
const questionMarkIndex = url.indexOf("?");
if (questionMarkIndex === -1) return "";
const fragmentIndex = url.indexOf("#", questionMarkIndex);
if (fragmentIndex === -1) return url.substring(questionMarkIndex);
else return url.substring(questionMarkIndex, fragmentIndex);
}
var And = class {
kind;
args;
constructor(...args) {
if (args.length === 0) throw new Error("`And` expects at least one operand");
this.args = args;
this.kind = "and";
}
};
var Or = class {
kind;
args;
constructor(...args) {
if (args.length === 0) throw new Error("`Or` expects at least one operand");
this.args = args;
this.kind = "or";
}
};
var Not = class {
kind;
expr;
constructor(expr) {
this.expr = expr;
this.kind = "not";
}
};
var Id = class {
kind;
pattern;
params;
constructor(pattern, params) {
this.pattern = pattern;
this.kind = "id";
this.params = params ?? { cleanUrl: false };
}
};
var ImporterId = class {
kind;
pattern;
params;
constructor(pattern, params) {
this.pattern = pattern;
this.kind = "importerId";
this.params = params ?? { cleanUrl: false };
}
};
var ModuleType = class {
kind;
pattern;
constructor(pattern) {
this.pattern = pattern;
this.kind = "moduleType";
}
};
var Code = class {
kind;
pattern;
constructor(expr) {
this.pattern = expr;
this.kind = "code";
}
};
var Query = class {
kind;
key;
pattern;
constructor(key, pattern) {
this.pattern = pattern;
this.key = key;
this.kind = "query";
}
};
var Include = class {
kind;
expr;
constructor(expr) {
this.expr = expr;
this.kind = "include";
}
};
var Exclude = class {
kind;
expr;
constructor(expr) {
this.expr = expr;
this.kind = "exclude";
}
};
function and(...args) {
return new And(...args);
}
function or(...args) {
return new Or(...args);
}
function not(expr) {
return new Not(expr);
}
function id(pattern, params) {
return new Id(pattern, params);
}
function importerId(pattern, params) {
return new ImporterId(pattern, params);
}
function moduleType(pattern) {
return new ModuleType(pattern);
}
function code(pattern) {
return new Code(pattern);
}
function query(key, pattern) {
return new Query(key, pattern);
}
function include(expr) {
return new Include(expr);
}
function exclude(expr) {
return new Exclude(expr);
}
/**
* convert a queryObject to FilterExpression like
* ```js
* and(query(k1, v1), query(k2, v2))
* ```
* @param queryFilterObject The query filter object needs to be matched.
* @returns a `And` FilterExpression
*/
function queries(queryFilter) {
return and(...Object.entries(queryFilter).map(([key, value]) => {
return new Query(key, value);
}));
}
function interpreter(exprs, code, id, moduleType, importerId) {
let arr = [];
if (Array.isArray(exprs)) arr = exprs;
else arr = [exprs];
return interpreterImpl(arr, code, id, moduleType, importerId);
}
function interpreterImpl(expr, code, id, moduleType, importerId, ctx = {}) {
let hasInclude = false;
for (const e of expr) switch (e.kind) {
case "include":
hasInclude = true;
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) return true;
break;
case "exclude":
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) return false;
break;
}
return !hasInclude;
}
function exprInterpreter(expr, code, id, moduleType, importerId, ctx = {}) {
switch (expr.kind) {
case "and": return expr.args.every((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
case "or": return expr.args.some((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
case "not": return !exprInterpreter(expr.expr, code, id, moduleType, importerId, ctx);
case "id": {
if (id === void 0) throw new Error("`id` is required for `id` expression");
let idToMatch = id;
if (expr.params.cleanUrl) idToMatch = cleanUrl(idToMatch);
return typeof expr.pattern === "string" ? idToMatch === expr.pattern : expr.pattern.test(idToMatch);
}
case "importerId": {
if (importerId === void 0) return false;
let importerIdToMatch = importerId;
if (expr.params.cleanUrl) importerIdToMatch = cleanUrl(importerIdToMatch);
return typeof expr.pattern === "string" ? importerIdToMatch === expr.pattern : expr.pattern.test(importerIdToMatch);
}
case "moduleType":
if (moduleType === void 0) throw new Error("`moduleType` is required for `moduleType` expression");
return moduleType === expr.pattern;
case "code":
if (code === void 0) throw new Error("`code` is required for `code` expression");
return typeof expr.pattern === "string" ? code.includes(expr.pattern) : expr.pattern.test(code);
case "query": {
if (id === void 0) throw new Error("`id` is required for `Query` expression");
if (!ctx.urlSearchParamsCache) {
let queryString = extractQueryWithoutFragment(id);
ctx.urlSearchParamsCache = new URLSearchParams(queryString);
}
let urlParams = ctx.urlSearchParamsCache;
if (typeof expr.pattern === "boolean") if (expr.pattern) return urlParams.has(expr.key);
else return !urlParams.has(expr.key);
else if (typeof expr.pattern === "string") return urlParams.get(expr.key) === expr.pattern;
else return expr.pattern.test(urlParams.get(expr.key) ?? "");
}
default: throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
}
}
/**
* Filters out Vite plugins that have `apply: 'serve'` set.
*
* Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
* are intended only for Vite's dev server and should be excluded from the build process.
*
* @param plugins - Array of plugins (can include nested arrays)
* @returns Filtered array with serve-only plugins removed
*
* @example
* ```ts
* import { defineConfig } from 'rolldown';
* import { filterVitePlugins } from '@rolldown/pluginutils';
* import viteReact from '@vitejs/plugin-react';
*
* export default defineConfig({
* plugins: filterVitePlugins([
* viteReact(),
* {
* name: 'dev-only',
* apply: 'serve', // This will be filtered out
* // ...
* }
* ])
* });
* ```
*/
function filterVitePlugins(plugins) {
if (!plugins) return [];
const pluginArray = Array.isArray(plugins) ? plugins : [plugins];
const result = [];
for (const plugin of pluginArray) {
if (!plugin) continue;
if (Array.isArray(plugin)) {
result.push(...filterVitePlugins(plugin));
continue;
}
const pluginWithApply = plugin;
if ("apply" in pluginWithApply) {
const applyValue = pluginWithApply.apply;
if (typeof applyValue === "function") try {
if (applyValue({}, {
command: "build",
mode: "production"
})) result.push(plugin);
} catch {
result.push(plugin);
}
else if (applyValue === "serve") continue;
else result.push(plugin);
} else result.push(plugin);
}
return result;
}
/**
* Constructs a RegExp that matches the exact string specified.
*
* This is useful for plugin hook filters.
*
* @param str the string to match.
* @param flags flags for the RegExp.
*
* @example
* ```ts
* import { exactRegex } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* resolveId: {
* filter: { id: exactRegex('foo') },
* handler(id) {} // will only be called for `foo`
* }
* }
* ```
*/
function exactRegex(str, flags) {
return new RegExp(`^${escapeRegex(str)}$`, flags);
}
/**
* Constructs a RegExp that matches a value that has the specified prefix.
*
* This is useful for plugin hook filters.
*
* @param str the string to match.
* @param flags flags for the RegExp.
*
* @example
* ```ts
* import { prefixRegex } from '@rolldown/pluginutils';
* const plugin = {
* name: 'plugin',
* resolveId: {
* filter: { id: prefixRegex('foo') },
* handler(id) {} // will only be called for IDs starting with `foo`
* }
* }
* ```
*/
function prefixRegex(str, flags) {
return new RegExp(`^${escapeRegex(str)}`, flags);
}
const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
function escapeRegex(str) {
return str.replace(escapeRegexRE, "\\$&");
}
function makeIdFiltersToMatchWithQuery(input) {
if (!Array.isArray(input)) return makeIdFilterToMatchWithQuery(input);
return input.map((i) => makeIdFilterToMatchWithQuery(i));
}
function makeIdFilterToMatchWithQuery(input) {
if (typeof input === "string") return `${input}{?*,}`;
return makeRegexIdFilterToMatchWithQuery(input);
}
function makeRegexIdFilterToMatchWithQuery(input) {
return new RegExp(input.source.replace(/(?<!\\)\$/g, "(?:\\?.*)?$"), input.flags);
}
//#endregion
//#region src/plugin/with-filter.ts
function withFilterImpl(pluginOption, filterObjectList) {
if (isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
if (pluginOption == false || pluginOption == null) return pluginOption;
if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
let plugin = pluginOption;
let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
if (filterObjectIndex === -1) return plugin;
let filterObject = filterObjectList[filterObjectIndex];
Object.keys(plugin).forEach((key) => {
switch (key) {
case "transform":
case "resolveId":
case "load":
if (!plugin[key]) return;
if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
else plugin[key] = {
handler: plugin[key],
filter: filterObject[key]
};
break;
default: break;
}
});
return plugin;
}
/**
* A helper function to add plugin hook filters to a plugin or an array of plugins.
*
* @example
* ```ts
* import yaml from '@rollup/plugin-yaml';
* import { defineConfig } from 'rolldown';
* import { withFilter } from 'rolldown/filter';
*
* export default defineConfig({
* plugins: [
* // Run the transform hook of the `yaml` plugin
* // only for modules which end in `.yaml`
* withFilter(
* yaml({}),
* { transform: { id: /\.yaml$/ } },
* ),
* ],
* });
* ```
*
* @category Config
*/
function withFilter(pluginOption, filterObject) {
return withFilterImpl(pluginOption, arraify(filterObject));
}
function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
if (typeof pattern === "string" && pattern === pluginName) return i;
else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
}
return -1;
}
//#endregion
export { and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query, withFilter };
@@ -0,0 +1 @@
module.exports={C:{"4":0.00912,"115":0.01825,"120":0.35276,"121":0.71768,"122":0.00304,"123":0.00912,"124":0.01216,"125":0.00304,"130":0.00304,"131":0.00304,"132":0.00304,"133":0.00304,"134":0.00304,"135":0.00304,"136":0.00304,"140":0.01521,"142":0.00304,"143":0.00304,"146":0.00304,"147":0.00304,"148":0.00304,"150":0.00912,"151":0.00304,"152":0.00608,"153":0.00608,"154":0.04257,"155":0.16421,"156":0.1703,"157":0.00608,_:"2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 126 127 128 129 137 138 139 141 144 145 149 158 159 160 3.5 3.6"},D:{"38":0.00304,"62":0.00304,"63":0.00304,"65":0.00304,"79":0.01216,"87":0.00608,"88":0.00304,"91":0.00608,"97":0.00608,"103":0.1338,"104":0.12772,"105":0.12772,"106":0.12772,"107":0.12772,"108":0.13076,"109":0.31931,"110":0.13076,"111":0.15509,"112":0.12772,"114":0.00608,"116":0.27369,"117":0.12772,"118":0.55042,"119":0.70551,"120":0.85452,"121":0.00912,"122":0.02433,"123":0.01521,"124":0.14597,"125":0.00608,"126":0.00912,"127":0.00608,"128":0.02433,"129":0.00608,"130":0.00912,"131":0.27369,"132":0.00608,"133":0.371,"134":0.13989,"135":0.13076,"136":0.14293,"137":0.13989,"138":0.16421,"139":0.13989,"140":0.15813,"141":0.16421,"142":0.48352,"143":0.01216,"144":0.13989,"145":0.14901,"146":0.26153,"147":0.02129,"148":0.26457,"149":0.17334,"150":0.21591,"151":3.07445,"152":5.43123,"153":4.85344,"154":1.1495,"155":0.01521,_:"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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 64 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 83 84 85 86 89 90 92 93 94 95 96 98 99 100 101 102 113 115 156 157"},F:{"54":0.00304,"55":0.00304,"56":0.00304,"85":0.00912,"89":0.00304,"95":0.00608,"101":0.00608,"105":0.00608,"106":0.01216,"107":0.00608,"114":0.00304,"115":0.00304,"116":0.00304,"119":0.00304,"120":0.00304,"121":0.00304,"122":0.00304,"133":0.01216,"134":0.09427,"135":0.41662,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 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 86 87 88 90 91 92 93 94 96 97 98 99 100 102 103 104 108 109 110 111 112 113 117 118 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00304,"92":0.00304,"109":0.00608,"119":0.35276,"120":0.35884,"122":0.01216,"123":0.00304,"124":0.00304,"131":0.00304,"132":0.00304,"133":0.00304,"134":0.00304,"136":0.00304,"137":0.00304,"138":0.00304,"139":0.00608,"140":0.00608,"141":0.00304,"142":0.00304,"143":0.00304,"144":0.00304,"145":0.00912,"146":0.00608,"147":0.01216,"148":0.01521,"149":0.00912,"150":0.07907,"151":0.10339,"152":0.97312,"153":1.20424,"154":0.34363,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 125 126 127 128 129 130 135"},E:{"27":0.04562,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.4 16.5 17.0 17.2 18.0 18.1 18.2 27.1 27.2 TP","13.1":0.00304,"14.1":0.00304,"15.6":0.00608,"16.3":0.00304,"16.6":0.01521,"17.1":0.01216,"17.3":0.00304,"17.4":0.00304,"17.5":0.00304,"17.6":0.02129,"18.3":0.00304,"18.4":0.00304,"18.5-18.7":0.00912,"26.0":0.00304,"26.1":0.00304,"26.2":0.01216,"26.3":0.01521,"26.4":0.01521,"26.5":0.08211,"26.6":0.27673},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00117,"5.0-5.1":0.00117,"6.0-6.1":0,"7.0-7.1":0.00235,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01175,"11.0-11.2":0.00117,"11.3-11.4":0.00235,"12.0-12.1":0,"12.2-12.5":0.03055,"13.0-13.1":0,"13.2":0.00587,"13.3":0,"13.4-13.7":0.00117,"14.0-14.4":0.0047,"14.5-14.8":0.00705,"15.0-15.1":0.00705,"15.2-15.3":0.0047,"15.4":0.00587,"15.5":0.00705,"15.6-15.8":0.15273,"16.0":0.01175,"16.1":0.02115,"16.2":0.01175,"16.3":0.02585,"16.4":0.00587,"16.5":0.0094,"16.6-16.7":0.21265,"17.0":0.00822,"17.1":0.01175,"17.2":0.01175,"17.3":0.01762,"17.4":0.02467,"17.5":0.04817,"17.6-17.7":0.12453,"18.0":0.02585,"18.1":0.05169,"18.2":0.07049,"18.3":0.12218,"18.4":0.07637,"18.5-18.7":1.57782,"26.0":0.07637,"26.1":0.07754,"26.2":0.20207,"26.3":0.21852,"26.4":0.15978,"26.5":1.07029,"26.6":6.60382,"27.0":0.50636,"27.1":0,"27.2":0.01292},P:{"22":0.00961,"23":0.00961,"24":0.00961,"25":0.00961,"26":0.02883,"27":0.00961,"28":0.02883,"29":0.04804,"30":0.9032,_:"4 20 21 5.0-5.4 6.2-6.4 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.01922,"8.2":0.00961},I:{"0":0.02087,"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.16008,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},Line truncated
@@ -0,0 +1,4 @@
import { AnyRouter } from '@tanstack/router-core';
export declare function RouterClient(props: {
router: AnyRouter;
}): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
export var errorUtil;
(function (errorUtil) {
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
// biome-ignore lint/suspicious/noShadowRestrictedNames: renaming churns 31 v3 call sites
errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
})(errorUtil || (errorUtil = {}));
@@ -0,0 +1,187 @@
import { functionalUpdate, isPlainObject } from "./utils.js";
import { isServer } from "@tanstack/router-core/isServer";
//#region src/scroll-restoration.ts
function getSafeSessionStorage() {
try {
return typeof window !== "undefined" && typeof window.sessionStorage === "object" ? window.sessionStorage : void 0;
} catch {
return;
}
}
const storageKey = "tsr-scroll-restoration-v1_3";
function createScrollRestorationCache() {
const safeSessionStorage = getSafeSessionStorage();
if (!safeSessionStorage) return null;
let state = {};
try {
const parsed = JSON.parse(safeSessionStorage.getItem("tsr-scroll-restoration-v1_3") || "{}");
if (isPlainObject(parsed)) state = parsed;
} catch {}
const persist = () => {
try {
safeSessionStorage.setItem(storageKey, JSON.stringify(state));
} catch {
if (process.env.NODE_ENV !== "production") console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.");
}
};
return {
get state() {
return state;
},
set: (updater) => {
state = functionalUpdate(updater, state) || state;
},
persist
};
}
const scrollRestorationCache = createScrollRestorationCache();
/**
* The default `getKey` function for `useScrollRestoration`.
* It returns the `key` from the location state or the `href` of the location.
*
* The `location.href` is used as a fallback to support the use case where the location state is not available like the initial render.
*/
const defaultGetScrollRestorationKey = (location) => {
return location.state.__TSR_key || location.href;
};
function getCssSelector(el) {
const path = [];
let parent;
while (parent = el.parentNode) {
path.push(`${el.tagName}:nth-child(${Array.prototype.indexOf.call(parent.children, el) + 1})`);
el = parent;
}
return `${path.reverse().join(" > ")}`.toLowerCase();
}
function getElementScrollRestorationEntry(router, options) {
const restoreKey = (options.getKey || defaultGetScrollRestorationKey)(router.latestLocation);
if (options.id) return scrollRestorationCache?.state[restoreKey]?.[`[${scrollRestorationIdAttribute}="${options.id}"]`];
const element = options.getElement?.();
if (!element) return;
return scrollRestorationCache?.state[restoreKey]?.[element instanceof Window ? windowScrollTarget : getCssSelector(element)];
}
let ignoreScroll = false;
const windowScrollTarget = "window";
const scrollRestorationIdAttribute = "data-scroll-restoration-id";
function setupScrollRestoration(router, force) {
if (!scrollRestorationCache && !(isServer ?? router.isServer)) return;
const cache = scrollRestorationCache;
if (force ?? router.options.scrollRestoration ?? false) router.isScrollRestoring = true;
if ((isServer ?? router.isServer) || router.isScrollRestorationSetup || !cache) return;
router.isScrollRestorationSetup = true;
ignoreScroll = false;
const getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey;
const trackedScrollEntries = /* @__PURE__ */ new Map();
window.history.scrollRestoration = "manual";
const onScroll = (event) => {
if (ignoreScroll || !router.isScrollRestoring) return;
if (event.target === document || event.target === window) trackedScrollEntries.set(windowScrollTarget, {
scrollX: window.scrollX || 0,
scrollY: window.scrollY || 0
});
else {
const target = event.target;
trackedScrollEntries.set(target, {
scrollX: target.scrollLeft || 0,
scrollY: target.scrollTop || 0
});
}
};
const snapshotCurrentScrollTargets = (restoreKey) => {
if (!router.isScrollRestoring || !restoreKey || trackedScrollEntries.size === 0 || !cache) return;
const keyEntry = cache.state[restoreKey] ||= {};
for (const [target, position] of trackedScrollEntries) {
let selector;
if (target === windowScrollTarget) selector = windowScrollTarget;
else if (target.isConnected) {
const attrId = target.getAttribute(scrollRestorationIdAttribute);
selector = attrId ? `[${scrollRestorationIdAttribute}="${attrId}"]` : getCssSelector(target);
}
if (!selector) continue;
keyEntry[selector] = position;
}
};
document.addEventListener("scroll", onScroll, true);
router.subscribe("onBeforeLoad", (event) => {
snapshotCurrentScrollTargets(event.fromLocation ? getKey(event.fromLocation) : void 0);
trackedScrollEntries.clear();
});
window.addEventListener("pagehide", () => {
snapshotCurrentScrollTargets(getKey(router.stores.resolvedLocation.get() ?? router.stores.location.get()));
cache.persist();
});
router.subscribe("onRendered", (event) => {
const cacheKey = getKey(event.toLocation);
const behavior = router.options.scrollRestorationBehavior;
const scrollToTopSelectors = router.options.scrollToTopSelectors;
trackedScrollEntries.clear();
if (!router.resetNextScroll) {
router.resetNextScroll = true;
return;
}
if (typeof router.options.scrollRestoration === "function" && !router.options.scrollRestoration({ location: router.latestLocation })) return;
ignoreScroll = true;
try {
const elementEntries = router.isScrollRestoring ? cache.state[cacheKey] : void 0;
let restored = false;
if (elementEntries) for (const elementSelector in elementEntries) {
const entry = elementEntries[elementSelector];
if (!isPlainObject(entry)) continue;
const { scrollX, scrollY } = entry;
if (!Number.isFinite(scrollX) || !Number.isFinite(scrollY)) continue;
if (elementSelector === windowScrollTarget) {
window.scrollTo({
top: scrollY,
left: scrollX,
behavior
});
restored = true;
} else if (elementSelector) {
let element;
try {
element = document.querySelector(elementSelector);
} catch {
continue;
}
if (element) {
element.scrollLeft = scrollX;
element.scrollTop = scrollY;
restored = true;
}
}
}
if (!restored) {
const hash = router.history.location.hash.slice(1);
if (hash) {
const hashScrollIntoViewOptions = window.history.state?.__hashScrollIntoViewOptions ?? true;
if (hashScrollIntoViewOptions) {
const el = document.getElementById(hash);
if (el) el.scrollIntoView(hashScrollIntoViewOptions);
}
} else {
const scrollOptions = {
top: 0,
left: 0,
behavior
};
window.scrollTo(scrollOptions);
if (scrollToTopSelectors) for (const selector of scrollToTopSelectors) {
if (selector === windowScrollTarget) continue;
const element = typeof selector === "function" ? selector() : document.querySelector(selector);
if (element) element.scrollTo(scrollOptions);
}
}
}
} finally {
ignoreScroll = false;
}
if (router.isScrollRestoring) cache.set((state) => {
state[cacheKey] ||= {};
return state;
});
});
}
//#endregion
export { defaultGetScrollRestorationKey, getElementScrollRestorationEntry, scrollRestorationCache, setupScrollRestoration, storageKey };
//# sourceMappingURL=scroll-restoration.js.map
@@ -0,0 +1,3 @@
import { t as CfWorkerJsonSchemaValidator } from "../cfWorkerProvider-p3WaZPqB.mjs";
export { CfWorkerJsonSchemaValidator };
@@ -0,0 +1 @@
{"version":3,"file":"decode-data-html.js","sourceRoot":"","sources":["../../../src/generated/decode-data-html.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C,MAAM,CAAC,MAAM,cAAc,GAAgB,eAAe,CAAC,IAAI,WAAW;AACtE,kBAAkB;AAClB,eAAe,CAAC,268CAA268C;KACt78C,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CACnC,CAAC"}
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/compose-refs.tsx"],
"sourcesContent": ["import * as React from 'react';\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == 'function') {\n hasCleanup = true;\n }\n return cleanup;\n });\n\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n"],
"mappings": ";AAAA,YAAY,WAAW;AAQvB,SAAS,OAAU,KAAqB,OAAU;AAChD,MAAI,OAAO,QAAQ,YAAY;AAC7B,WAAO,IAAI,KAAK;AAAA,EAClB,WAAW,QAAQ,QAAQ,QAAQ,QAAW;AAC5C,QAAI,UAAU;AAAA,EAChB;AACF;AAMA,SAAS,eAAkB,MAA8C;AACvE,SAAO,CAAC,SAAS;AACf,QAAI,aAAa;AACjB,UAAM,WAAW,KAAK,IAAI,CAAC,QAAQ;AACjC,YAAM,UAAU,OAAO,KAAK,IAAI;AAChC,UAAI,CAAC,cAAc,OAAO,WAAW,YAAY;AAC/C,qBAAa;AAAA,MACf;AACA,aAAO;AAAA,IACT,CAAC;AAMD,QAAI,YAAY;AACd,aAAO,MAAM;AACX,iBAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,gBAAM,UAAU,SAAS,CAAC;AAC1B,cAAI,OAAO,WAAW,YAAY;AAChC,oBAAQ;AAAA,UACV,OAAO;AACL,mBAAO,KAAK,CAAC,GAAG,IAAI;AAAA,UACtB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAMA,SAAS,mBAAsB,MAA8C;AAE3E,SAAa,kBAAY,YAAY,GAAG,IAAI,GAAG,IAAI;AACrD;",
"names": []
}
@@ -0,0 +1,87 @@
{
"name": "fix-dts-default-cjs-exports",
"type": "module",
"version": "1.0.1",
"packageManager": "pnpm@10.6.3",
"description": "Utility to fix TypeScript declarations when using default exports in CommonJS.",
"author": "userquin <userquin@gmail.com>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/userquin/fix-dts-default-cjs-exports.git"
},
"bugs": "https://github.com/userquin/fix-dts-default-cjs-exports/issues",
"keywords": [
"rollup",
"cjs",
"typescript",
"default exports"
],
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./rollup": {
"import": {
"types": "./dist/rollup.d.mts",
"default": "./dist/rollup.mjs"
},
"require": {
"types": "./dist/rollup.d.cts",
"default": "./dist/rollup.cjs"
}
}
},
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"rollup": [
"./dist/rollup.d.ts"
]
}
},
"files": [
"dist"
],
"scripts": {
"prepack": "pkgroll --clean-dist",
"test:full": "pnpm test:coverage && pnpm test:attw",
"test:coverage": "vitest run --coverage",
"test": "vitest",
"lint": "eslint .",
"lint:fix": "pnpm lint --fix",
"release": "bumpp && npm publish",
"test:attw": "pnpm test:reexport-types && pnpm test:reexport-default && pnpm test:mixed-declarations",
"test:reexport-types": "attw --pack test/fixtures/reexport-types",
"test:reexport-default": "attw --pack test/fixtures/reexport-default",
"test:mixed-declarations": "attw --pack test/fixtures/mixed-declarations"
},
"dependencies": {
"magic-string": "^0.30.17",
"mlly": "^1.7.4",
"rollup": "^4.34.8"
},
"devDependencies": {
"@antfu/eslint-config": "^4.3.0",
"@arethetypeswrong/cli": "^0.17.4",
"@types/node": "^20.14.8",
"@vitest/coverage-v8": "^3.0.6",
"bumpp": "^10.0.3",
"eslint": "^9.21.0",
"pathe": "^2.0.3",
"pkgroll": "^2.11.0",
"typescript": "^5.7.3",
"unbuild": "3.3.1",
"vitest": "^3.0.6"
}
}
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/object-inspect
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,40 @@
type Rules = { "only-export-components": any };
export type OnlyExportComponentsOptions = {
extraHOCs?: string[];
allowExportNames?: string[];
allowConstantExport?: boolean;
checkJS?: boolean;
};
type Config = {
name: string;
plugins: { "react-refresh": { rules: Rules } };
rules: Rules;
};
type ConfigFn = (options?: OnlyExportComponentsOptions) => {
name: string;
plugins: { "react-refresh": { rules: Rules } };
rules: Rules;
};
export const reactRefresh: {
plugin: {
rules: Rules;
};
configs: {
recommended: ConfigFn;
vite: ConfigFn;
next: ConfigFn;
};
};
declare const _default: {
rules: Rules;
configs: {
recommended: Config;
vite: Config;
next: Config;
};
};
export default _default;
@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;
const errors_1 = require("../errors");
const codegen_1 = require("../codegen");
const names_1 = require("../names");
const boolError = {
message: "boolean schema is false",
};
function topBoolOrEmptySchema(it) {
const { gen, schema, validateName } = it;
if (schema === false) {
falseSchemaError(it, false);
}
else if (typeof schema == "object" && schema.$async === true) {
gen.return(names_1.default.data);
}
else {
gen.assign((0, codegen_1._) `${validateName}.errors`, null);
gen.return(true);
}
}
exports.topBoolOrEmptySchema = topBoolOrEmptySchema;
function boolOrEmptySchema(it, valid) {
const { gen, schema } = it;
if (schema === false) {
gen.var(valid, false); // TODO var
falseSchemaError(it);
}
else {
gen.var(valid, true); // TODO var
}
}
exports.boolOrEmptySchema = boolOrEmptySchema;
function falseSchemaError(it, overrideAllErrors) {
const { gen, data } = it;
// TODO maybe some other interface should be used for non-keyword validation errors...
const cxt = {
gen,
keyword: "false schema",
data,
schema: false,
schemaCode: false,
schemaValue: false,
params: {},
it,
};
(0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors);
}
//# sourceMappingURL=boolSchema.js.map
@@ -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 Shovel = createLucideIcon("Shovel", [
["path", { d: "M2 22v-5l5-5 5 5-5 5z", key: "1fh25c" }],
["path", { d: "M9.5 14.5 16 8", key: "1smz5x" }],
[
"path",
{ d: "m17 2 5 5-.5.5a3.53 3.53 0 0 1-5 0s0 0 0 0a3.53 3.53 0 0 1 0-5L17 2", key: "1q8uv5" }
]
]);
export { Shovel as default };
//# sourceMappingURL=shovel.js.map
@@ -0,0 +1,52 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}
var {{=$errs}} = errors;
{{? {{# def.nonEmptySchema:$schema }} }}
{{
$it.schema = $schema;
$it.schemaPath = $schemaPath;
$it.errSchemaPath = $errSchemaPath;
}}
{{
var $key = 'key' + $lvl
, $idx = 'idx' + $lvl
, $i = 'i' + $lvl
, $invalidName = '\' + ' + $key + ' + \''
, $dataNxt = $it.dataLevel = it.dataLevel + 1
, $nextData = 'data' + $dataNxt
, $dataProperties = 'dataProperties' + $lvl
, $ownProperties = it.opts.ownProperties
, $currentBaseId = it.baseId;
}}
{{? $ownProperties }}
var {{=$dataProperties}} = undefined;
{{?}}
{{# def.iterateProperties }}
var startErrs{{=$lvl}} = errors;
{{ var $passData = $key; }}
{{# def.setCompositeRule }}
{{# def.generateSubschemaCode }}
{{# def.optimizeValidate }}
{{# def.resetCompositeRule }}
if (!{{=$nextValid}}) {
for (var {{=$i}}=startErrs{{=$lvl}}; {{=$i}}<errors; {{=$i}}++) {
vErrors[{{=$i}}].propertyName = {{=$key}};
}
{{# def.extraError:'propertyNames' }}
{{? $breakOnError }} break; {{?}}
}
}
{{?}}
{{? $breakOnError }}
{{= $closingBraces }}
if ({{=$errs}} == errors) {
{{?}}