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

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

No files matched your search

@@ -0,0 +1,238 @@
/**
* @fileoverview Rule to flag when IIFE is not wrapped in parens
* @author Ilya Volodin
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const eslintUtils = require("@eslint-community/eslint-utils");
//----------------------------------------------------------------------
// Helpers
//----------------------------------------------------------------------
/**
* Check if the given node is callee of a `NewExpression` node
* @param {ASTNode} node node to check
* @returns {boolean} True if the node is callee of a `NewExpression` node
* @private
*/
function isCalleeOfNewExpression(node) {
const maybeCallee =
node.parent.type === "ChainExpression" ? node.parent : node;
return (
maybeCallee.parent.type === "NewExpression" &&
maybeCallee.parent.callee === maybeCallee
);
}
//------------------------------------------------------------------------------
// 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: "wrap-iife",
url: "https://eslint.style/rules/wrap-iife",
},
},
],
},
type: "layout",
docs: {
description:
"Require parentheses around immediate `function` invocations",
recommended: false,
url: "https://eslint.org/docs/latest/rules/wrap-iife",
},
schema: [
{
enum: ["outside", "inside", "any"],
},
{
type: "object",
properties: {
functionPrototypeMethods: {
type: "boolean",
default: false,
},
},
additionalProperties: false,
},
],
fixable: "code",
messages: {
wrapInvocation:
"Wrap an immediate function invocation in parentheses.",
wrapExpression: "Wrap only the function expression in parens.",
moveInvocation:
"Move the invocation into the parens that contain the function.",
},
},
create(context) {
const style = context.options[0] || "outside";
const includeFunctionPrototypeMethods =
context.options[1] && context.options[1].functionPrototypeMethods;
const sourceCode = context.sourceCode;
/**
* Check if the node is wrapped in any (). All parens count: grouping parens and parens for constructs such as if()
* @param {ASTNode} node node to evaluate
* @returns {boolean} True if it is wrapped in any parens
* @private
*/
function isWrappedInAnyParens(node) {
return astUtils.isParenthesised(sourceCode, node);
}
/**
* Check if the node is wrapped in grouping (). Parens for constructs such as if() don't count
* @param {ASTNode} node node to evaluate
* @returns {boolean} True if it is wrapped in grouping parens
* @private
*/
function isWrappedInGroupingParens(node) {
return eslintUtils.isParenthesized(1, node, sourceCode);
}
/**
* Get the function node from an IIFE
* @param {ASTNode} node node to evaluate
* @returns {ASTNode} node that is the function expression of the given IIFE, or null if none exist
*/
function getFunctionNodeFromIIFE(node) {
const callee = astUtils.skipChainExpression(node.callee);
if (callee.type === "FunctionExpression") {
return callee;
}
if (
includeFunctionPrototypeMethods &&
callee.type === "MemberExpression" &&
callee.object.type === "FunctionExpression" &&
(astUtils.getStaticPropertyName(callee) === "call" ||
astUtils.getStaticPropertyName(callee) === "apply")
) {
return callee.object;
}
return null;
}
return {
CallExpression(node) {
const innerNode = getFunctionNodeFromIIFE(node);
if (!innerNode) {
return;
}
const isCallExpressionWrapped = isWrappedInAnyParens(node),
isFunctionExpressionWrapped =
isWrappedInAnyParens(innerNode);
if (!isCallExpressionWrapped && !isFunctionExpressionWrapped) {
context.report({
node,
messageId: "wrapInvocation",
fix(fixer) {
const nodeToSurround =
style === "inside" ? innerNode : node;
return fixer.replaceText(
nodeToSurround,
`(${sourceCode.getText(nodeToSurround)})`,
);
},
});
} else if (style === "inside" && !isFunctionExpressionWrapped) {
context.report({
node,
messageId: "wrapExpression",
fix(fixer) {
// The outer call expression will always be wrapped at this point.
if (
isWrappedInGroupingParens(node) &&
!isCalleeOfNewExpression(node)
) {
/*
* Parenthesize the function expression and remove unnecessary grouping parens around the call expression.
* Replace the range between the end of the function expression and the end of the call expression.
* for example, in `(function(foo) {}(bar))`, the range `(bar))` should get replaced with `)(bar)`.
*/
const parenAfter =
sourceCode.getTokenAfter(node);
return fixer.replaceTextRange(
[innerNode.range[1], parenAfter.range[1]],
`)${sourceCode.getText().slice(innerNode.range[1], parenAfter.range[0])}`,
);
}
/*
* Call expression is wrapped in mandatory parens such as if(), or in necessary grouping parens.
* These parens cannot be removed, so just parenthesize the function expression.
*/
return fixer.replaceText(
innerNode,
`(${sourceCode.getText(innerNode)})`,
);
},
});
} else if (style === "outside" && !isCallExpressionWrapped) {
context.report({
node,
messageId: "moveInvocation",
fix(fixer) {
/*
* The inner function expression will always be wrapped at this point.
* It's only necessary to replace the range between the end of the function expression
* and the call expression. For example, in `(function(foo) {})(bar)`, the range `)(bar)`
* should get replaced with `(bar))`.
*/
const parenAfter =
sourceCode.getTokenAfter(innerNode);
return fixer.replaceTextRange(
[parenAfter.range[0], node.range[1]],
`${sourceCode.getText().slice(parenAfter.range[1], node.range[1])})`,
);
},
});
}
},
};
},
};
@@ -0,0 +1,464 @@
(function (global, factory) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
factory(module);
module.exports = def(module);
} else if (typeof define === 'function' && define.amd) {
define(['module'], function(mod) {
factory.apply(this, arguments);
mod.exports = def(mod);
});
} else {
const mod = { exports: {} };
factory(mod);
global = typeof globalThis !== 'undefined' ? globalThis : global || self;
global.sourcemapCodec = def(mod);
}
function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; }
})(this, (function (module) {
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/sourcemap-codec.ts
var sourcemap_codec_exports = {};
__export(sourcemap_codec_exports, {
decode: () => decode,
decodeGeneratedRanges: () => decodeGeneratedRanges,
decodeOriginalScopes: () => decodeOriginalScopes,
encode: () => encode,
encodeGeneratedRanges: () => encodeGeneratedRanges,
encodeOriginalScopes: () => encodeOriginalScopes
});
module.exports = __toCommonJS(sourcemap_codec_exports);
// src/vlq.ts
var comma = ",".charCodeAt(0);
var semicolon = ";".charCodeAt(0);
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var intToChar = new Uint8Array(64);
var charToInt = new Uint8Array(128);
for (let i = 0; i < chars.length; i++) {
const c = chars.charCodeAt(i);
intToChar[i] = c;
charToInt[c] = i;
}
function decodeInteger(reader, relative) {
let value = 0;
let shift = 0;
let integer = 0;
do {
const c = reader.next();
integer = charToInt[c];
value |= (integer & 31) << shift;
shift += 5;
} while (integer & 32);
const shouldNegate = value & 1;
value >>>= 1;
if (shouldNegate) {
value = -2147483648 | -value;
}
return relative + value;
}
function encodeInteger(builder, num, relative) {
let delta = num - relative;
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
do {
let clamped = delta & 31;
delta >>>= 5;
if (delta > 0) clamped |= 32;
builder.write(intToChar[clamped]);
} while (delta > 0);
return num;
}
function hasMoreVlq(reader, max) {
if (reader.pos >= max) return false;
return reader.peek() !== comma;
}
// src/strings.ts
var bufLength = 1024 * 16;
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
decode(buf) {
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
return out.toString();
}
} : {
decode(buf) {
let out = "";
for (let i = 0; i < buf.length; i++) {
out += String.fromCharCode(buf[i]);
}
return out;
}
};
var StringWriter = class {
constructor() {
this.pos = 0;
this.out = "";
this.buffer = new Uint8Array(bufLength);
}
write(v) {
const { buffer } = this;
buffer[this.pos++] = v;
if (this.pos === bufLength) {
this.out += td.decode(buffer);
this.pos = 0;
}
}
flush() {
const { buffer, out, pos } = this;
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
}
};
var StringReader = class {
constructor(buffer) {
this.pos = 0;
this.buffer = buffer;
}
next() {
return this.buffer.charCodeAt(this.pos++);
}
peek() {
return this.buffer.charCodeAt(this.pos);
}
indexOf(char) {
const { buffer, pos } = this;
const idx = buffer.indexOf(char, pos);
return idx === -1 ? buffer.length : idx;
}
};
// src/scopes.ts
var EMPTY = [];
function decodeOriginalScopes(input) {
const { length } = input;
const reader = new StringReader(input);
const scopes = [];
const stack = [];
let line = 0;
for (; reader.pos < length; reader.pos++) {
line = decodeInteger(reader, line);
const column = decodeInteger(reader, 0);
if (!hasMoreVlq(reader, length)) {
const last = stack.pop();
last[2] = line;
last[3] = column;
continue;
}
const kind = decodeInteger(reader, 0);
const fields = decodeInteger(reader, 0);
const hasName = fields & 1;
const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind];
let vars = EMPTY;
if (hasMoreVlq(reader, length)) {
vars = [];
do {
const varsIndex = decodeInteger(reader, 0);
vars.push(varsIndex);
} while (hasMoreVlq(reader, length));
}
scope.vars = vars;
scopes.push(scope);
stack.push(scope);
}
return scopes;
}
function encodeOriginalScopes(scopes) {
const writer = new StringWriter();
for (let i = 0; i < scopes.length; ) {
i = _encodeOriginalScopes(scopes, i, writer, [0]);
}
return writer.flush();
}
function _encodeOriginalScopes(scopes, index, writer, state) {
const scope = scopes[index];
const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;
if (index > 0) writer.write(comma);
state[0] = encodeInteger(writer, startLine, state[0]);
encodeInteger(writer, startColumn, 0);
encodeInteger(writer, kind, 0);
const fields = scope.length === 6 ? 1 : 0;
encodeInteger(writer, fields, 0);
if (scope.length === 6) encodeInteger(writer, scope[5], 0);
for (const v of vars) {
encodeInteger(writer, v, 0);
}
for (index++; index < scopes.length; ) {
const next = scopes[index];
const { 0: l, 1: c } = next;
if (l > endLine || l === endLine && c >= endColumn) {
break;
}
index = _encodeOriginalScopes(scopes, index, writer, state);
}
writer.write(comma);
state[0] = encodeInteger(writer, endLine, state[0]);
encodeInteger(writer, endColumn, 0);
return index;
}
function decodeGeneratedRanges(input) {
const { length } = input;
const reader = new StringReader(input);
const ranges = [];
const stack = [];
let genLine = 0;
let definitionSourcesIndex = 0;
let definitionScopeIndex = 0;
let callsiteSourcesIndex = 0;
let callsiteLine = 0;
let callsiteColumn = 0;
let bindingLine = 0;
let bindingColumn = 0;
do {
const semi = reader.indexOf(";");
let genColumn = 0;
for (; reader.pos < semi; reader.pos++) {
genColumn = decodeInteger(reader, genColumn);
if (!hasMoreVlq(reader, semi)) {
const last = stack.pop();
last[2] = genLine;
last[3] = genColumn;
continue;
}
const fields = decodeInteger(reader, 0);
const hasDefinition = fields & 1;
const hasCallsite = fields & 2;
const hasScope = fields & 4;
let callsite = null;
let bindings = EMPTY;
let range;
if (hasDefinition) {
const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex);
definitionScopeIndex = decodeInteger(
reader,
definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0
);
definitionSourcesIndex = defSourcesIndex;
range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];
} else {
range = [genLine, genColumn, 0, 0];
}
range.isScope = !!hasScope;
if (hasCallsite) {
const prevCsi = callsiteSourcesIndex;
const prevLine = callsiteLine;
callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex);
const sameSource = prevCsi === callsiteSourcesIndex;
callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0);
callsiteColumn = decodeInteger(
reader,
sameSource && prevLine === callsiteLine ? callsiteColumn : 0
);
callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];
}
range.callsite = callsite;
if (hasMoreVlq(reader, semi)) {
bindings = [];
do {
bindingLine = genLine;
bindingColumn = genColumn;
const expressionsCount = decodeInteger(reader, 0);
let expressionRanges;
if (expressionsCount < -1) {
expressionRanges = [[decodeInteger(reader, 0)]];
for (let i = -1; i > expressionsCount; i--) {
const prevBl = bindingLine;
bindingLine = decodeInteger(reader, bindingLine);
bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0);
const expression = decodeInteger(reader, 0);
expressionRanges.push([expression, bindingLine, bindingColumn]);
}
} else {
expressionRanges = [[expressionsCount]];
}
bindings.push(expressionRanges);
} while (hasMoreVlq(reader, semi));
}
range.bindings = bindings;
ranges.push(range);
stack.push(range);
}
genLine++;
reader.pos = semi + 1;
} while (reader.pos < length);
return ranges;
}
function encodeGeneratedRanges(ranges) {
if (ranges.length === 0) return "";
const writer = new StringWriter();
for (let i = 0; i < ranges.length; ) {
i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);
}
return writer.flush();
}
function _encodeGeneratedRanges(ranges, index, writer, state) {
const range = ranges[index];
const {
0: startLine,
1: startColumn,
2: endLine,
3: endColumn,
isScope,
callsite,
bindings
} = range;
if (state[0] < startLine) {
catchupLine(writer, state[0], startLine);
state[0] = startLine;
state[1] = 0;
} else if (index > 0) {
writer.write(comma);
}
state[1] = encodeInteger(writer, range[1], state[1]);
const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0);
encodeInteger(writer, fields, 0);
if (range.length === 6) {
const { 4: sourcesIndex, 5: scopesIndex } = range;
if (sourcesIndex !== state[2]) {
state[3] = 0;
}
state[2] = encodeInteger(writer, sourcesIndex, state[2]);
state[3] = encodeInteger(writer, scopesIndex, state[3]);
}
if (callsite) {
const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;
if (sourcesIndex !== state[4]) {
state[5] = 0;
state[6] = 0;
} else if (callLine !== state[5]) {
state[6] = 0;
}
state[4] = encodeInteger(writer, sourcesIndex, state[4]);
state[5] = encodeInteger(writer, callLine, state[5]);
state[6] = encodeInteger(writer, callColumn, state[6]);
}
if (bindings) {
for (const binding of bindings) {
if (binding.length > 1) encodeInteger(writer, -binding.length, 0);
const expression = binding[0][0];
encodeInteger(writer, expression, 0);
let bindingStartLine = startLine;
let bindingStartColumn = startColumn;
for (let i = 1; i < binding.length; i++) {
const expRange = binding[i];
bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine);
bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn);
encodeInteger(writer, expRange[0], 0);
}
}
}
for (index++; index < ranges.length; ) {
const next = ranges[index];
const { 0: l, 1: c } = next;
if (l > endLine || l === endLine && c >= endColumn) {
break;
}
index = _encodeGeneratedRanges(ranges, index, writer, state);
}
if (state[0] < endLine) {
catchupLine(writer, state[0], endLine);
state[0] = endLine;
state[1] = 0;
} else {
writer.write(comma);
}
state[1] = encodeInteger(writer, endColumn, state[1]);
return index;
}
function catchupLine(writer, lastLine, line) {
do {
writer.write(semicolon);
} while (++lastLine < line);
}
// src/sourcemap-codec.ts
function decode(mappings) {
const { length } = mappings;
const reader = new StringReader(mappings);
const decoded = [];
let genColumn = 0;
let sourcesIndex = 0;
let sourceLine = 0;
let sourceColumn = 0;
let namesIndex = 0;
do {
const semi = reader.indexOf(";");
const line = [];
let sorted = true;
let lastCol = 0;
genColumn = 0;
while (reader.pos < semi) {
let seg;
genColumn = decodeInteger(reader, genColumn);
if (genColumn < lastCol) sorted = false;
lastCol = genColumn;
if (hasMoreVlq(reader, semi)) {
sourcesIndex = decodeInteger(reader, sourcesIndex);
sourceLine = decodeInteger(reader, sourceLine);
sourceColumn = decodeInteger(reader, sourceColumn);
if (hasMoreVlq(reader, semi)) {
namesIndex = decodeInteger(reader, namesIndex);
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
} else {
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
}
} else {
seg = [genColumn];
}
line.push(seg);
reader.pos++;
}
if (!sorted) sort(line);
decoded.push(line);
reader.pos = semi + 1;
} while (reader.pos <= length);
return decoded;
}
function sort(line) {
line.sort(sortComparator);
}
function sortComparator(a, b) {
return a[0] - b[0];
}
function encode(decoded) {
const writer = new StringWriter();
let sourcesIndex = 0;
let sourceLine = 0;
let sourceColumn = 0;
let namesIndex = 0;
for (let i = 0; i < decoded.length; i++) {
const line = decoded[i];
if (i > 0) writer.write(semicolon);
if (line.length === 0) continue;
let genColumn = 0;
for (let j = 0; j < line.length; j++) {
const segment = line[j];
if (j > 0) writer.write(comma);
genColumn = encodeInteger(writer, segment[0], genColumn);
if (segment.length === 1) continue;
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
sourceLine = encodeInteger(writer, segment[2], sourceLine);
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
if (segment.length === 4) continue;
namesIndex = encodeInteger(writer, segment[4], namesIndex);
}
}
return writer.flush();
}
}));
//# sourceMappingURL=sourcemap-codec.umd.js.map
@@ -0,0 +1 @@
{"version":3,"file":"arrow-down-square.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,12 @@
import type { TSESLint } from '@typescript-eslint/utils';
type AllowedSingleElementEquality = 'always' | 'never';
export type Options = [
{
allowSingleElementEquality?: AllowedSingleElementEquality;
}
];
export type MessageIds = 'preferEndsWith' | 'preferStartsWith';
declare const _default: TSESLint.RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,7 @@
var stringify = require('../');
var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 };
var s = stringify(obj, function (a, b) {
return a.value < b.value ? 1 : -1;
});
console.log(s);
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"_z"},B:{"1":"_I","2":"_K"},C:{"2":"_S"},D:{"2":"_Q"},E:{"2":"_R"},F:{"2":"_c"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"YC"},N:{"1":"B","2":"A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:7,C:"Resource Hints: Lazyload",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"animate-style.mjs","sources":["../../../../../src/animation/animators/waapi/animate-style.ts"],"sourcesContent":["import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n GroupAnimationWithThen,\n} from \"motion-dom\"\nimport { animateElements } from \"./animate-elements\"\n\nexport const createScopedWaapiAnimate = (scope?: AnimationScope) => {\n function scopedAnimate(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n return new GroupAnimationWithThen(\n animateElements(\n elementOrSelector,\n keyframes as DOMKeyframesDefinition,\n options,\n scope\n )\n )\n }\n\n return scopedAnimate\n}\n\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate()\n"],"names":[],"mappings":";;;AAUO,MAAM,wBAAwB,GAAG,CAAC,KAAsB,KAAI;AAC/D,IAAA,SAAS,aAAa,CAClB,iBAAoC,EACpC,SAAiC,EACjC,OAAiC,EAAA;AAEjC,QAAA,OAAO,IAAI,sBAAsB,CAC7B,eAAe,CACX,iBAAiB,EACjB,SAAmC,EACnC,OAAO,EACP,KAAK,CACR,CACJ;IACL;AAEA,IAAA,OAAO,aAAa;AACxB;MAEa,WAAW,iBAAiB,wBAAwB;;;;"}
@@ -0,0 +1,57 @@
BSD 2-Clause License
Original source code is copyright (c) 2019-2025 Remy Rylan
<https://github.com/RemyRylan>
All JSON Schema documentation and descriptions are copyright (c):
2009 [draft-0] IETF Trust <https://www.ietf.org/>, Kris Zyp <kris@sitepen.com>,
and SitePen (USA) <https://www.sitepen.com/>.
2009 [draft-1] IETF Trust <https://www.ietf.org/>, Kris Zyp <kris@sitepen.com>,
and SitePen (USA) <https://www.sitepen.com/>.
2010 [draft-2] IETF Trust <https://www.ietf.org/>, Kris Zyp <kris@sitepen.com>,
and SitePen (USA) <https://www.sitepen.com/>.
2010 [draft-3] IETF Trust <https://www.ietf.org/>, Kris Zyp <kris@sitepen.com>,
Gary Court <gary.court@gmail.com>, and SitePen (USA) <https://www.sitepen.com/>.
2013 [draft-4] IETF Trust <https://www.ietf.org/>), Francis Galiegue
<fgaliegue@gmail.com>, Kris Zyp <kris@sitepen.com>, Gary Court
<gary.court@gmail.com>, and SitePen (USA) <https://www.sitepen.com/>.
2018 [draft-7] IETF Trust <https://www.ietf.org/>, Austin Wright <aaa@bzfx.net>,
Henry Andrews <henry@cloudflare.com>, Geraint Luff <luffgd@gmail.com>, and
Cloudflare, Inc. <https://www.cloudflare.com/>.
2019 [draft-2019-09] IETF Trust <https://www.ietf.org/>, Austin Wright
<aaa@bzfx.net>, Henry Andrews <andrews_henry@yahoo.com>, Ben Hutton
<bh7@sanger.ac.uk>, and Greg Dennis <gregsdennis@yahoo.com>.
2020 [draft-2020-12] IETF Trust <https://www.ietf.org/>, Austin Wright
<aaa@bzfx.net>, Henry Andrews <andrews_henry@yahoo.com>, Ben Hutton
<ben@jsonschema.dev>, and Greg Dennis <gregsdennis@yahoo.com>.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,349 @@
---
name: router-core/search-params
description: >-
validateSearch, search param validation with Zod/Valibot/ArkType adapters,
fallback(), search middlewares (retainSearchParams, stripSearchParams),
custom serialization (parseSearch, stringifySearch), search param
inheritance, loaderDeps for cache keys, reading and writing search params.
type: sub-skill
library: tanstack-router
library_version: '1.166.2'
requires:
- router-core
sources:
- TanStack/router:docs/router/guide/search-params.md
- TanStack/router:docs/router/how-to/setup-basic-search-params.md
- TanStack/router:docs/router/how-to/validate-search-params.md
- TanStack/router:docs/router/how-to/navigate-with-search-params.md
- TanStack/router:docs/router/how-to/share-search-params-across-routes.md
- TanStack/router:docs/router/guide/custom-search-param-serialization.md
---
# Search Params
TanStack Router treats search params as JSON-first application state. They are automatically parsed from the URL into structured objects (numbers, booleans, arrays, nested objects) and validated via `validateSearch` on each route.
> **CRITICAL**: When using `zodValidator()` and Zod v3, use `fallback()` from `@tanstack/zod-adapter`, NOT zod's `.catch()`. Using `.catch()` with the zod adapter makes the output type `unknown`, destroying type safety. This does not apply to Valibot or ArkType (which use their own fallback mechanisms). It also does not apply to Zod v4, which should use `.catch()` and not use the `zodValidator()`.
> **CRITICAL**: Types are fully inferred. Never annotate the return of `useSearch()`.
## Setup: Zod Adapter (Recommended)
```bash
npm install zod @tanstack/zod-adapter
```
```tsx
// src/routes/products.tsx
import { createFileRoute } from '@tanstack/react-router'
import { z } from 'zod'
const productSearchSchema = z.object({
page: z.number().default(1).catch(1),
filter: z.string().default(''),
sort: z.enum(['newest', 'oldest', 'price']).default('newest').catch('newest'),
})
export const Route = createFileRoute('/products')({
validateSearch: productSearchSchema,
component: ProductsPage,
})
function ProductsPage() {
// page: number, filter: string, sort: 'newest' | 'oldest' | 'price'
// ALL INFERRED — do not annotate
const { page, filter, sort } = Route.useSearch()
return (
<div>
<p>
Page {page}, filter: {filter}, sort: {sort}
</p>
</div>
)
}
```
## Reading Search Params
### In Route Components: `Route.useSearch()`
```tsx
function ProductsPage() {
const { page, sort } = Route.useSearch()
return <div>Page {page}</div>
}
```
### In Code-Split Components: `getRouteApi()`
```tsx
import { getRouteApi } from '@tanstack/react-router'
const routeApi = getRouteApi('/products')
function ProductFilters() {
const { sort } = routeApi.useSearch()
return <select value={sort}>{/* options */}</select>
}
```
### From Any Component: `useSearch({ from })`
```tsx
import { useSearch } from '@tanstack/react-router'
function SortIndicator() {
const { sort } = useSearch({ from: '/products' })
return <span>Sorted by: {sort}</span>
}
```
### Loose Access: `useSearch({ strict: false })`
```tsx
function GenericPaginator() {
const search = useSearch({ strict: false })
// search.page is number | undefined (union of all routes)
return <span>Page: {search.page ?? 1}</span>
}
```
## Writing Search Params
### Link with Function Form (Preserves Existing Params)
```tsx
import { Link } from '@tanstack/react-router'
function Pagination() {
return (
<Link
from="/products"
search={(prev) => ({ ...prev, page: prev.page + 1 })}
>
Next Page
</Link>
)
}
```
### Link with Object Form (Replaces All Params)
```tsx
<Link to="/products" search={{ page: 1, filter: '', sort: 'newest' }}>
Reset
</Link>
```
### Programmatic: `useNavigate()`
```tsx
import { useNavigate } from '@tanstack/react-router'
function SortDropdown() {
const navigate = useNavigate({ from: '/products' })
return (
<select
onChange={(e) => {
navigate({
search: (prev) => ({ ...prev, sort: e.target.value, page: 1 }),
})
}}
>
<option value="newest">Newest</option>
<option value="price">Price</option>
</select>
)
}
```
## Search Param Inheritance
Parent route search params are automatically merged into child routes:
```tsx
// src/routes/shop.tsx — parent defines shared params
import { createFileRoute } from '@tanstack/react-router'
import { z } from 'zod'
const shopSearchSchema = z.object({
currency: z.enum(['USD', 'EUR']).default('USD').catch('USD'),
})
export const Route = createFileRoute('/shop')({
validateSearch: shopSearchSchema,
})
```
```tsx
// src/routes/shop/products.tsx — child inherits currency
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/shop/products')({
component: ShopProducts,
})
function ShopProducts() {
// currency is available here from parent — fully typed
const { currency } = Route.useSearch()
return <div>Currency: {currency}</div>
}
```
## Search Middlewares
### `retainSearchParams` — Keep Params Across Navigation
```tsx
import { createRootRoute, retainSearchParams } from '@tanstack/react-router'
import { z } from 'zod'
const rootSearchSchema = z.object({
debug: z.boolean().optional(),
})
export const Route = createRootRoute({
validateSearch: rootSearchSchema,
search: {
middlewares: [retainSearchParams(['debug'])],
},
})
```
### `stripSearchParams` — Remove Default Values from URL
```tsx
import { createFileRoute, stripSearchParams } from '@tanstack/react-router'
import { z } from 'zod'
const defaults = { sort: 'newest', page: 1 }
const searchSchema = z.object({
sort: z.string().default(defaults.sort),
page: z.number().default(defaults.page),
})
export const Route = createFileRoute('/items')({
validateSearch: searchSchema,
search: {
middlewares: [stripSearchParams(defaults)],
},
})
```
### Chaining Middlewares
```tsx
export const Route = createFileRoute('/search')({
validateSearch: z.object({
retainMe: z.string().optional(),
arrayWithDefaults: z.string().array().default(['foo', 'bar']),
required: z.string(),
}),
search: {
middlewares: [
retainSearchParams(['retainMe']),
stripSearchParams({ arrayWithDefaults: ['foo', 'bar'] }),
],
},
})
```
## Custom Serialization
Override the default JSON serialization at the router level:
```tsx
import {
createRouter,
parseSearchWith,
stringifySearchWith,
} from '@tanstack/react-router'
const router = createRouter({
routeTree,
// Example: use JSURL2 for compact, human-readable URLs
parseSearch: parseSearchWith(parse),
stringifySearch: stringifySearchWith(stringify),
})
```
## Using Search Params in Loaders via `loaderDeps`
```tsx
export const Route = createFileRoute('/products')({
validateSearch: productSearchSchema,
// Pick ONLY the params the loader needs — not the entire search object
loaderDeps: ({ search }) => ({ page: search.page }),
loader: async ({ deps }) => {
return fetchProducts({ page: deps.page })
},
})
```
## Common Mistakes
### 1. HIGH: Using zod v3's `.catch()` with `zodValidator()` instead of adapter `fallback()`
```tsx
// WRONG — .catch() with zodValidator makes the type unknown
const schema = z.object({ page: z.number().catch(1) })
validateSearch: zodValidator(schema) // page is typed as unknown!
// CORRECT — fallback() preserves the inferred type
import { fallback } from '@tanstack/zod-adapter'
const schema = z.object({ page: fallback(z.number(), 1) })
```
**Important:** This only applies when using Zod v3, not when using Zod v4. For v4, using `.catch()` is correct.
### 2. HIGH: Returning entire search object from `loaderDeps`
```tsx
// WRONG — loader re-runs on ANY search param change
loaderDeps: ({ search }) => search
// CORRECT — loader only re-runs when page changes
loaderDeps: ({ search }) => ({ page: search.page })
```
### 3. HIGH: Passing Date objects in search params
```tsx
// WRONG — Date does not serialize correctly to JSON in URLs
<Link search={{ startDate: new Date() }}>
// CORRECT — convert to ISO string
<Link search={{ startDate: new Date().toISOString() }}>
```
### 4. MEDIUM: Parent route missing `validateSearch` blocks inheritance
```tsx
// WRONG — child cannot access shared params
export const Route = createRootRoute({
component: RootComponent,
// no validateSearch!
})
// CORRECT — parent must define validateSearch for children to inherit
export const Route = createRootRoute({
validateSearch: globalSearchSchema,
component: RootComponent,
})
```
### 5. HIGH (cross-skill): Using search as object instead of function loses params
```tsx
// WRONG — replaces ALL search params, losing any existing ones
<Link to="." search={{ page: 2 }}>Page 2</Link>
// CORRECT — preserves existing params, updates only page
<Link to="." search={(prev) => ({ ...prev, page: 2 })}>Page 2</Link>
```
## References
- [Validation Patterns Reference](./references/validation-patterns.md) — comprehensive patterns for all validation libraries
@@ -0,0 +1,7 @@
import { HonoBase as Hono$1, HonoOptions } from "../hono-base.js";
import { BlankEnv, BlankSchema, Env, Schema } from "../types.js";
//#region src/preset/tiny.d.ts
export declare class Hono<E extends Env = BlankEnv, S extends Schema = BlankSchema, BasePath extends string = '/'> extends Hono$1<E, S, BasePath> {
constructor(options?: HonoOptions<E>);
}
//#endregion
@@ -0,0 +1 @@
{"version":3,"file":"shell.js","sources":["../../../src/icons/shell.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Shell\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTQgMTFhMiAyIDAgMSAxLTQgMCA0IDQgMCAwIDEgOCAwIDYgNiAwIDAgMS0xMiAwIDggOCAwIDAgMSAxNiAwIDEwIDEwIDAgMSAxLTIwIDAgMTEuOTMgMTEuOTMgMCAwIDEgMi40Mi03LjIyIDIgMiAwIDEgMSAzLjE2IDIuNDQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/shell\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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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;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,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 './circle-divide.js';
//# sourceMappingURL=divide-circle.js.map
@@ -0,0 +1,9 @@
"use client";
import { useFollowValue } from './use-follow-value.mjs';
function useSpring(source, options = {}) {
return useFollowValue(source, { type: "spring", ...options });
}
export { useSpring };
//# sourceMappingURL=use-spring.mjs.map
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const TriangleAlert = createLucideIcon("TriangleAlert", [
[
"path",
{
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
key: "wmoenq"
}
],
["path", { d: "M12 9v4", key: "juzpu7" }],
["path", { d: "M12 17h.01", key: "p32p05" }]
]);
export { TriangleAlert as default };
//# sourceMappingURL=triangle-alert.js.map
@@ -0,0 +1,96 @@
import { DecodingMode } from "./decode.js";
/** The level of entities to support. */
export declare enum EntityLevel {
/** Support only XML entities. */
XML = 0,
/** Support HTML entities, which are a superset of XML entities. */
HTML = 1
}
export declare enum EncodingMode {
/**
* The output is UTF-8 encoded. Only characters that need escaping within
* XML will be escaped.
*/
UTF8 = 0,
/**
* The output consists only of ASCII characters. Characters that need
* escaping within HTML, and characters that aren't ASCII characters will
* be escaped.
*/
ASCII = 1,
/**
* Encode all characters that have an equivalent entity, as well as all
* characters that are not ASCII characters.
*/
Extensive = 2,
/**
* Encode all characters that have to be escaped in HTML attributes,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*/
Attribute = 3,
/**
* Encode all characters that have to be escaped in HTML text,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*/
Text = 4
}
export interface DecodingOptions {
/**
* The level of entities to support.
* @default {@link EntityLevel.XML}
*/
level?: EntityLevel;
/**
* Decoding mode. If `Legacy`, will support legacy entities not terminated
* with a semicolon (`;`).
*
* Always `Strict` for XML. For HTML, set this to `true` if you are parsing
* an attribute value.
*
* The deprecated `decodeStrict` function defaults this to `Strict`.
*
* @default {@link DecodingMode.Legacy}
*/
mode?: DecodingMode | undefined;
}
/**
* Decodes a string with entities.
*
* @param data String to decode.
* @param options Decoding options.
*/
export declare function decode(data: string, options?: DecodingOptions | EntityLevel): string;
/**
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
*
* @param data String to decode.
* @param options Decoding options.
* @deprecated Use `decode` with the `mode` set to `Strict`.
*/
export declare function decodeStrict(data: string, options?: DecodingOptions | EntityLevel): string;
/**
* Options for `encode`.
*/
export interface EncodingOptions {
/**
* The level of entities to support.
* @default {@link EntityLevel.XML}
*/
level?: EntityLevel;
/**
* Output format.
* @default {@link EncodingMode.Extensive}
*/
mode?: EncodingMode;
}
/**
* Encodes a string with entities.
*
* @param data String to encode.
* @param options Encoding options.
*/
export declare function encode(data: string, options?: EncodingOptions | EntityLevel): string;
export { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js";
export { encodeHTML, encodeNonAsciiHTML, encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode.js";
export { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute, decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode.js";
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,120 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "aksara", verb: "mempunyai" },
file: { unit: "bait", verb: "mempunyai" },
array: { unit: "elemen", verb: "mempunyai" },
set: { unit: "elemen", verb: "mempunyai" },
map: { unit: "elemen", verb: "mempunyai" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "input",
email: "alamat e-mel",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "tarikh masa ISO",
date: "tarikh ISO",
time: "masa ISO",
duration: "tempoh ISO",
ipv4: "alamat IPv4",
ipv6: "alamat IPv6",
mac: "alamat MAC",
cidrv4: "julat IPv4",
cidrv6: "julat IPv6",
base64: "string dikodkan base64",
base64url: "string dikodkan base64url",
json_string: "string JSON",
e164: "nombor E.164",
credit_card: "nombor kad kredit",
currency_code: "kod mata wang",
iban: "IBAN",
jwt: "JWT",
template_literal: "input",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
number: "nombor",
};
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 `Input tidak sah: dijangka instanceof ${issue.expected}, diterima ${received}`;
}
return `Input tidak sah: dijangka ${expected}, diterima ${received}`;
}
case "invalid_value":
if (issue.values.length === 1) return `Input tidak sah: dijangka ${util.stringifyPrimitive(issue.values[0])}`;
return `Pilihan tidak sah: dijangka salah satu daripada ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemen"}`;
return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} adalah ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Terlalu kecil: dijangka ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Terlalu kecil: dijangka ${issue.origin} adalah ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `String tidak sah: mesti bermula dengan "${_issue.prefix}"`;
if (_issue.format === "ends_with") return `String tidak sah: mesti berakhir dengan "${_issue.suffix}"`;
if (_issue.format === "includes") return `String tidak sah: mesti mengandungi "${_issue.includes}"`;
if (_issue.format === "regex") return `String tidak sah: mesti sepadan dengan corak ${_issue.pattern}`;
return `${FormatDictionary[_issue.format] ?? issue.format} tidak sah`;
}
case "not_multiple_of":
return `Nombor tidak sah: perlu gandaan ${issue.divisor}`;
case "unrecognized_keys":
return `Kunci tidak dikenali: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Kunci tidak sah dalam ${issue.origin}`;
case "invalid_union":
return "Input tidak sah";
case "invalid_element":
return `Nilai tidak sah dalam ${issue.origin}`;
default:
return `Input tidak sah`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1,65 @@
import type { SerovalNode } from 'seroval';
import { createPlugin } from 'seroval';
import HeadersPlugin from './headers';
import ReadableStreamPlugin from './readable-stream';
function createResponseOptions(current: Response): ResponseInit {
return {
headers: current.headers,
status: current.status,
statusText: current.statusText,
};
}
type ResponseNode = {
body: SerovalNode;
options: SerovalNode;
};
const ResponsePlugin = /* @__PURE__ */ createPlugin<Response, ResponseNode>({
tag: 'seroval-plugins/web/Response',
extends: [ReadableStreamPlugin, HeadersPlugin],
test(value) {
if (typeof Response === 'undefined') {
return false;
}
return value instanceof Response;
},
parse: {
async async(value, ctx) {
return {
body: await ctx.parse(
value.body && !value.bodyUsed
? await value.clone().arrayBuffer()
: null,
),
options: await ctx.parse(createResponseOptions(value)),
};
},
stream(value, ctx) {
return {
body: ctx.parse(
value.body && !value.bodyUsed ? value.clone().body : null,
),
options: ctx.parse(createResponseOptions(value)),
};
},
},
serialize(node, ctx) {
return (
'new Response(' +
ctx.serialize(node.body) +
',' +
ctx.serialize(node.options) +
')'
);
},
deserialize(node, ctx) {
return new Response(
ctx.deserialize(node.body) as BodyInit,
ctx.deserialize(node.options) as ResponseInit,
);
},
});
export default ResponsePlugin;
@@ -0,0 +1 @@
{"version":3,"file":"luggage.js","sources":["../../../src/icons/luggage.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Luggage\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAyMGEyIDIgMCAwIDEtMi0yVjhhMiAyIDAgMCAxIDItMmgxMmEyIDIgMCAwIDEgMiAydjEwYTIgMiAwIDAgMS0yIDIiIC8+CiAgPHBhdGggZD0iTTggMThWNGEyIDIgMCAwIDEgMi0yaDRhMiAyIDAgMCAxIDIgMnYxNCIgLz4KICA8cGF0aCBkPSJNMTAgMjBoNCIgLz4KICA8Y2lyY2xlIGN4PSIxNiIgY3k9IjIwIiByPSIyIiAvPgogIDxjaXJjbGUgY3g9IjgiIGN5PSIyMCIgcj0iMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/luggage\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 Luggage = createLucideIcon('Luggage', [\n [\n 'path',\n { d: 'M6 20a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2', key: '1m57jg' },\n ],\n ['path', { d: 'M8 18V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v14', key: '1l99gc' }],\n ['path', { d: 'M10 20h4', key: 'ni2waw' }],\n ['circle', { cx: '16', cy: '20', r: '2', key: '1vifvg' }],\n ['circle', { cx: '8', cy: '20', r: '2', key: 'ckkr5m' }],\n]);\n\nexport default Luggage;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACxD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AACzD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"ssePollingExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/ssePollingExample.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.errorUtil = void 0;
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 || (exports.errorUtil = errorUtil = {}));
// seal-cjs-exports
(function () {
var keys = Object.getOwnPropertyNames(exports);
for (var i = 0; i < keys.length; i++) {
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
if (!desc || !desc.get || !desc.configurable) continue;
var value;
try {
value = desc.get();
} catch (e) {
continue;
}
// a circular require may not have settled this one yet, so leave it live
if (value === undefined) continue;
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
}
Object.freeze(exports);
})();
@@ -0,0 +1,38 @@
/**
* Decrypting JSON Web Encryption (JWE) in General JSON Serialization
*
* @module
*/
import type * as types from '../../types.d.ts';
/**
* Interface for General JWE Decryption dynamic key resolution. No token components have been
* verified at the time of this function call.
*/
export interface GeneralDecryptGetKey extends types.GetKeyFunction<types.JWEHeaderParameters, types.FlattenedJWE> {
}
/**
* Decrypts a General JWE.
*
* This function is exported (as a named export) from the main `'jose'` module entry point as well
* as from its subpath export `'jose/jwe/general/decrypt'`.
*
* > [!NOTE]\
* > The function iterates over the `recipients` array in the General JWE and returns the decryption
* > result of the first recipient entry that can be successfully decrypted. The result only contains
* > the plaintext and headers of that successfully decrypted recipient entry. Other recipient entries
* > in the General JWE are not validated, and their headers are not included in the returned result.
* > Recipients of a General JWE should only rely on the returned (decrypted) data.
*
* @param jwe General JWE.
* @param key Private Key or Secret to decrypt the JWE with. See
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
* @param options JWE Decryption options.
*/
export declare function generalDecrypt(jwe: types.GeneralJWE, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.DecryptOptions): Promise<types.GeneralDecryptResult>;
/**
* @param jwe General JWE.
* @param getKey Function resolving Private Key or Secret to decrypt the JWE with. See
* {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
* @param options JWE Decryption options.
*/
export declare function generalDecrypt(jwe: types.GeneralJWE, getKey: GeneralDecryptGetKey, options?: types.DecryptOptions): Promise<types.GeneralDecryptResult & types.ResolvedKey>;
@@ -0,0 +1 @@
{"version":3,"file":"git-pull-request-draft.js","sources":["../../../src/icons/git-pull-request-draft.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name GitPullRequestDraft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxOCIgY3k9IjE4IiByPSIzIiAvPgogIDxjaXJjbGUgY3g9IjYiIGN5PSI2IiByPSIzIiAvPgogIDxwYXRoIGQ9Ik0xOCA2VjUiIC8+CiAgPHBhdGggZD0iTTE4IDExdi0xIiAvPgogIDxsaW5lIHgxPSI2IiB4Mj0iNiIgeTE9IjkiIHkyPSIyMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/git-pull-request-draft\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 GitPullRequestDraft = createLucideIcon('GitPullRequestDraft', [\n ['circle', { cx: '18', cy: '18', r: '3', key: '1xkwt0' }],\n ['circle', { cx: '6', cy: '6', r: '3', key: '1lh9wr' }],\n ['path', { d: 'M18 6V5', key: '1oao2s' }],\n ['path', { d: 'M18 11v-1', key: '11c8tz' }],\n ['line', { x1: '6', x2: '6', y1: '9', y2: '21', key: 'rroup' }],\n]);\n\nexport default GitPullRequestDraft;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsB,iBAAiB,qBAAuB,CAAA,CAAA,CAAA;AAAA,CAClE,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACxD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACtD,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,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,SAAS,CAAA;AAChE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,13 @@
import type { TSESTree } from '@typescript-eslint/types';
import type { Referencer } from './Referencer';
import { Visitor } from './Visitor';
export type ExportNode = TSESTree.ExportAllDeclaration | TSESTree.ExportDefaultDeclaration | TSESTree.ExportNamedDeclaration;
export declare class ExportVisitor extends Visitor {
#private;
constructor(node: ExportNode, referencer: Referencer);
static visit(referencer: Referencer, node: ExportNode): void;
protected ExportDefaultDeclaration(node: TSESTree.ExportDefaultDeclaration): void;
protected ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
protected ExportSpecifier(node: TSESTree.ExportSpecifier): void;
protected Identifier(node: TSESTree.Identifier): void;
}
@@ -0,0 +1,91 @@
/**
* @fileoverview Rule to flag references to the undefined variable.
* @author Michael Ficarra
*/
"use strict";
//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------
/** @typedef {import("eslint-scope").Scope} Scope */
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow the use of `undefined` as an identifier",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-undefined",
},
schema: [],
messages: {
unexpectedUndefined: "Unexpected use of undefined.",
},
},
create(context) {
const sourceCode = context.sourceCode;
/**
* Report an invalid "undefined" identifier node.
* @param {ASTNode} node The node to report.
* @returns {void}
*/
function report(node) {
context.report({
node,
messageId: "unexpectedUndefined",
});
}
/**
* Checks the given scope for references to `undefined` and reports
* all references found.
* @param {Scope} scope The scope to check.
* @returns {void}
*/
function checkScope(scope) {
const undefinedVar = scope.set.get("undefined");
if (!undefinedVar) {
return;
}
const references = undefinedVar.references;
const defs = undefinedVar.defs;
// Report non-initializing references (those are covered in defs below)
references
.filter(ref => !ref.init)
.forEach(ref => report(ref.identifier));
defs.forEach(def => report(def.name));
}
return {
"Program:exit"(node) {
const globalScope = sourceCode.getScope(node);
const stack = [globalScope];
while (stack.length) {
const scope = stack.pop();
stack.push(...scope.childScopes);
checkScope(scope);
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"copy-slash.js","sources":["../../../src/icons/copy-slash.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CopySlash\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iMTIiIHgyPSIxOCIgeTE9IjE4IiB5Mj0iMTIiIC8+CiAgPHJlY3Qgd2lkdGg9IjE0IiBoZWlnaHQ9IjE0IiB4PSI4IiB5PSI4IiByeD0iMiIgcnk9IjIiIC8+CiAgPHBhdGggZD0iTTQgMTZjLTEuMSAwLTItLjktMi0yVjRjMC0xLjEuOS0yIDItMmgxMGMxLjEgMCAyIC45IDIgMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/copy-slash\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 CopySlash = createLucideIcon('CopySlash', [\n ['line', { x1: '12', x2: '18', y1: '18', y2: '12', key: 'ebkxgr' }],\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2', key: '17jyea' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2', key: 'zix9uf' }],\n]);\n\nexport default CopySlash;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1F,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,73 @@
{
"name": "tinyglobby",
"version": "0.2.16",
"description": "A fast and minimal alternative to globby and fast-glob",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.cts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"dist"
],
"author": "Superchupu",
"license": "MIT",
"keywords": [
"glob",
"patterns",
"fast",
"implementation"
],
"repository": {
"type": "git",
"url": "git+https://github.com/SuperchupuDev/tinyglobby.git"
},
"bugs": {
"url": "https://github.com/SuperchupuDev/tinyglobby/issues"
},
"homepage": "https://superchupu.dev/tinyglobby",
"funding": {
"url": "https://github.com/sponsors/SuperchupuDev"
},
"dependencies": {
"fdir": "^6.5.0",
"picomatch": "^4.0.4"
},
"devDependencies": {
"@biomejs/biome": "^2.4.10",
"@types/node": "^25.5.2",
"@types/picomatch": "^4.0.3",
"fast-glob": "^3.3.3",
"fs-fixture": "^2.13.0",
"glob": "^13.0.6",
"tinybench": "^6.0.0",
"tsdown": "^0.21.7",
"typescript": "^6.0.2"
},
"engines": {
"node": ">=12.0.0"
},
"publishConfig": {
"provenance": true
},
"scripts": {
"bench": "node benchmark/bench.ts",
"bench:setup": "node benchmark/setup.ts",
"build": "tsdown",
"check": "biome check",
"check:fix": "biome check --write --unsafe",
"format": "biome format --write",
"lint": "biome lint",
"test": "node --test \"test/**/*.ts\"",
"test:coverage": "node --test --experimental-test-coverage \"test/**/*.ts\"",
"test:only": "node --test --test-only \"test/**/*.ts\"",
"typecheck": "tsc --noEmit"
}
}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_qJ","2":"FD","8":"L"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_R"},F:{"1":"_c"},G:{"1":"_M"},H:{"1":"1D"},I:{"1":"_P"},J:{"1":"_B"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:2,C:"PNG alpha transparency",D:true};
@@ -0,0 +1,73 @@
'use strict';
module.exports = function generate_anyOf(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
var $dataLvl = it.dataLevel;
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $data = 'data' + ($dataLvl || '');
var $valid = 'valid' + $lvl;
var $errs = 'errs__' + $lvl;
var $it = it.util.copy(it);
var $closingBraces = '';
$it.level++;
var $nextValid = 'valid' + $it.level;
var $noEmptySchema = $schema.every(function($sch) {
return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all));
});
if ($noEmptySchema) {
var $currentBaseId = $it.baseId;
out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; ';
var $wasComposite = it.compositeRule;
it.compositeRule = $it.compositeRule = true;
var arr1 = $schema;
if (arr1) {
var $sch, $i = -1,
l1 = arr1.length - 1;
while ($i < l1) {
$sch = arr1[$i += 1];
$it.schema = $sch;
$it.schemaPath = $schemaPath + '[' + $i + ']';
$it.errSchemaPath = $errSchemaPath + '/' + $i;
out += ' ' + (it.validate($it)) + ' ';
$it.baseId = $currentBaseId;
out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { ';
$closingBraces += '}';
}
}
it.compositeRule = $it.compositeRule = $wasComposite;
out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
if (it.opts.messages !== false) {
out += ' , message: \'should match some schema in anyOf\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError(vErrors); ';
} else {
out += ' validate.errors = vErrors; return false; ';
}
}
out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
if (it.opts.allErrors) {
out += ' } ';
}
} else {
if ($breakOnError) {
out += ' if (true) { ';
}
}
return out;
}
@@ -0,0 +1,16 @@
export declare const BITS = 32;
export declare const GROUPS = 4;
export declare const RE_ADDRESS: RegExp;
export declare const RE_SUBNET_STRING: RegExp;
/**
* The IANA IPv4 Special-Purpose Address Registry
* (https://www.iana.org/assignments/iana-ipv4-special-registry/), one entry
* per block: `[cidr, name, globallyReachable]`. A `null` reachability means
* the registry leaves the column blank and the block inherits the answer of
* the block containing it (or is global when nothing contains it).
*
* `Address4.isGlobal()` answers from the most specific entry containing the
* address. `test/data/iana-corpus.json` is generated from the registry's CSV
* and pins this table to it.
*/
export declare const SPECIAL_PURPOSE: ReadonlyArray<readonly [string, string, boolean | null]>;
@@ -0,0 +1 @@
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/list.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAA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C7C,CAAC,CACF,CAAA","sourcesContent":["// tar -t\nimport * as fsm from '@isaacs/fs-minipass'\nimport fs from 'node:fs'\nimport { dirname, parse } from 'path'\nimport { makeCommand } from './make-command.js'\nimport type {\n TarOptions,\n TarOptionsFile,\n TarOptionsSyncFile,\n} from './options.js'\nimport { Parser } from './parse.js'\nimport { stripTrailingSlashes } from './strip-trailing-slashes.js'\n\nconst onReadEntryFunction = (opt: TarOptions) => {\n const onReadEntry = opt.onReadEntry\n opt.onReadEntry =\n onReadEntry ?\n e => {\n onReadEntry(e)\n e.resume()\n }\n : e =Line truncated
@@ -0,0 +1,125 @@
import Dispatcher from './dispatcher'
export default RetryHandler
declare class RetryHandler implements Dispatcher.DispatchHandler {
constructor (
options: Dispatcher.DispatchOptions & {
retryOptions?: RetryHandler.RetryOptions;
},
retryHandlers: RetryHandler.RetryHandlers
)
}
declare namespace RetryHandler {
export type RetryState = { counter: number; }
export type RetryContext = {
state: RetryState;
opts: Dispatcher.DispatchOptions & {
retryOptions?: RetryHandler.RetryOptions;
};
}
export type OnRetryCallback = (result?: Error | null) => void
export type RetryCallback = (
err: Error,
context: {
state: RetryState;
opts: Dispatcher.DispatchOptions & {
retryOptions?: RetryHandler.RetryOptions;
};
},
callback: OnRetryCallback
) => void
export interface RetryOptions {
/**
* If true, the retry handler will throw an error if the request fails,
* this will prevent the folling handlers from being called, and will destroy the socket.
*
* @type {boolean}
* @memberof RetryOptions
* @default true
*/
throwOnError?: boolean;
/**
* Callback to be invoked on every retry iteration.
* It receives the error, current state of the retry object and the options object
* passed when instantiating the retry handler.
*
* @type {RetryCallback}
* @memberof RetryOptions
*/
retry?: RetryCallback;
/**
* Maximum number of retries to allow.
*
* @type {number}
* @memberof RetryOptions
* @default 5
*/
maxRetries?: number;
/**
* Max number of milliseconds allow between retries
*
* @type {number}
* @memberof RetryOptions
* @default 30000
*/
maxTimeout?: number;
/**
* Initial number of milliseconds to wait before retrying for the first time.
*
* @type {number}
* @memberof RetryOptions
* @default 500
*/
minTimeout?: number;
/**
* Factior to multiply the timeout factor between retries.
*
* @type {number}
* @memberof RetryOptions
* @default 2
*/
timeoutFactor?: number;
/**
* It enables to automatically infer timeout between retries based on the `Retry-After` header.
*
* @type {boolean}
* @memberof RetryOptions
* @default true
*/
retryAfter?: boolean;
/**
* HTTP methods to retry.
*
* @type {Dispatcher.HttpMethod[]}
* @memberof RetryOptions
* @default ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
*/
methods?: Dispatcher.HttpMethod[];
/**
* Error codes to be retried. e.g. `ECONNRESET`, `ENOTFOUND`, `ETIMEDOUT`, `ECONNREFUSED`, etc.
*
* @type {string[]}
* @default ['ECONNRESET','ECONNREFUSED','ENOTFOUND','ENETDOWN','ENETUNREACH','EHOSTDOWN','EHOSTUNREACH','EPIPE']
*/
errorCodes?: string[];
/**
* HTTP status codes to be retried.
*
* @type {number[]}
* @memberof RetryOptions
* @default [500, 502, 503, 504, 429],
*/
statusCodes?: number[];
}
export interface RetryHandlers {
dispatch: Dispatcher['dispatch'];
handler: Dispatcher.DispatchHandler;
}
}
@@ -0,0 +1,2 @@
export declare const PLUGIN_NAME: string;
export declare const logger: import("base-log-factory").ILogger;
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FlaskRound = createLucideIcon("FlaskRound", [
["path", { d: "M10 2v6.292a7 7 0 1 0 4 0V2", key: "1s42pc" }],
["path", { d: "M5 15h14", key: "m0yey3" }],
["path", { d: "M8.5 2h7", key: "csnxdl" }]
]);
export { FlaskRound as default };
//# sourceMappingURL=flask-round.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/index.ts"],"names":[],"mappings":";;AAEA,mDAA0D;AAC1D,kDAAgE;AAChE,2CAAmD;AACnD,uDAAqD;AACrD,6CAAuD;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AC,CAAA;gBAC9D,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;YACzB,CAAC;YACD,IAAI,CAAC,WAAW;gBAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,oBAAoB,CAAC,CAAA;YACjF,OAAO,YAAY,CAAA;YAEnB,SAAS,WAAW,CAAC,EAAC,QAAQ,EAAkB;gBAC9C,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAC9D,CAAC;YAED,SAAS,WAAW,CAAC,GAAoB,EAAE,CAAS;gBAClD,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;oBACd,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;gBAC1B,CAAC;qBAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;oBACpB,KAAK,MAAM,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;wBAChC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;oBACzB,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,+BAA+B,CAAC,CAAA;gBACvF,CAAC;YACH,CAAC;YAED,SAAS,UAAU,CAAC,QAAiB,EAAE,CAAS;gBAC9C,IAAI,OAAO,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,YAAY,EAAE,CAAC;oBAC5D,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,iCAAiC,CAAC,CAAA;gBAC9E,CAAC;gBACD,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}
@@ -0,0 +1,73 @@
//compile doT templates to js functions
'use strict';
var glob = require('glob')
, fs = require('fs')
, path = require('path')
, doT = require('dot')
, beautify = require('js-beautify').js_beautify;
var defsRootPath = process.argv[2] || path.join(__dirname, '../lib');
var defs = {};
var defFiles = glob.sync('./dot/**/*.def', { cwd: defsRootPath });
defFiles.forEach(function (f) {
var name = path.basename(f, '.def');
defs[name] = fs.readFileSync(path.join(defsRootPath, f));
});
var filesRootPath = process.argv[3] || path.join(__dirname, '../lib');
var files = glob.sync('./dot/**/*.jst', { cwd: filesRootPath });
var dotjsPath = path.join(filesRootPath, './dotjs');
try { fs.mkdirSync(dotjsPath); } catch(e) {}
console.log('\n\nCompiling:');
var FUNCTION_NAME = /function\s+anonymous\s*\(it[^)]*\)\s*{/;
var OUT_EMPTY_STRING = /out\s*\+=\s*'\s*';/g;
var ISTANBUL = /'(istanbul[^']+)';/g;
var ERROR_KEYWORD = /\$errorKeyword/g;
var ERROR_KEYWORD_OR = /\$errorKeyword\s+\|\|/g;
var VARS = [
'$errs', '$valid', '$lvl', '$data', '$dataLvl',
'$errorKeyword', '$closingBraces', '$schemaPath',
'$validate'
];
files.forEach(function (f) {
var keyword = path.basename(f, '.jst');
var targetPath = path.join(dotjsPath, keyword + '.js');
var template = fs.readFileSync(path.join(filesRootPath, f));
var code = doT.compile(template, defs);
code = code.toString()
.replace(OUT_EMPTY_STRING, '')
.replace(FUNCTION_NAME, 'function generate_' + keyword + '(it, $keyword, $ruleType) {')
.replace(ISTANBUL, '/* $1 */');
removeAlwaysFalsyInOr();
VARS.forEach(removeUnusedVar);
code = "'use strict';\nmodule.exports = " + code;
code = beautify(code, { indent_size: 2 }) + '\n';
fs.writeFileSync(targetPath, code);
console.log('compiled', keyword);
function removeUnusedVar(v) {
v = v.replace(/\$/g, '\\$$');
var regexp = new RegExp(v + '[^A-Za-z0-9_$]', 'g');
var count = occurrences(regexp);
if (count == 1) {
regexp = new RegExp('var\\s+' + v + '\\s*=[^;]+;|var\\s+' + v + ';');
code = code.replace(regexp, '');
}
}
function removeAlwaysFalsyInOr() {
var countUsed = occurrences(ERROR_KEYWORD);
var countOr = occurrences(ERROR_KEYWORD_OR);
if (countUsed == countOr + 1) code = code.replace(ERROR_KEYWORD_OR, '');
}
function occurrences(regexp) {
return (code.match(regexp) || []).length;
}
});
@@ -0,0 +1,8 @@
import SemVer = require("../classes/semver");
import semver = require("../index");
/**
* v1 <= v2
*/
declare function lte(v1: string | SemVer, v2: string | SemVer, optionsOrLoose?: boolean | semver.Options): boolean;
export = lte;
@@ -0,0 +1,651 @@
import { createConsola as createConsola$1, LogLevels } from './core.mjs';
export { Consola, LogTypes } from './core.mjs';
import { B as BasicReporter, p as parseStack } from './shared/consola.DRwqZj3T.mjs';
import g$1 from 'node:process';
import { e as colors, d as box, s as stripAnsi$1 } from './shared/consola.DXBYu-KD.mjs';
import 'node:util';
import 'node:path';
import 'node:tty';
const r=Object.create(null),i=e=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?r:globalThis),o=new Proxy(r,{get(e,s){return i()[s]??r[s]},has(e,s){const E=i();return s in E||s in r},set(e,s,E){const B=i(true);return B[s]=E,true},deleteProperty(e,s){if(!s)return false;const E=i(true);return delete E[s],true},ownKeys(){const e=i(true);return Object.keys(e)}}),t=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",f=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:true}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:true}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:false}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:false}],["VERCEL","VERCEL_ENV",{ci:false}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:false}],["CODESANDBOX","CODESANDBOX_HOST",{ci:false}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:true}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:true}]];function b(){if(globalThis.process?.env)for(const e of f){const s=e[1]||e[0];if(globalThis.process?.env[s])return {name:e[0].toLowerCase(),...e[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:false}:{name:"",ci:false}}const l=b();l.name;function n(e){return e?e!=="false":false}const I=globalThis.process?.platform||"",T=n(o.CI)||l.ci!==false,a=n(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),g=n(o.DEBUG),R=t==="test"||n(o.TEST);n(o.MINIMAL)||T||R||!a;const A=/^win/i.test(I);!n(o.NO_COLOR)&&(n(o.FORCE_COLOR)||(a||A)&&o.TERM!=="dumb"||T);const C=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(C?.split(".")[0])||null;const y=globalThis.process||Object.create(null),_={versions:{}};new Proxy(y,{get(e,s){if(s==="env")return o;if(s in e)return e[s];if(s in _)return _[s]}});const c=globalThis.process?.release?.name==="node",O=!!globalThis.Bun||!!globalThis.process?.versions?.bun,D=!!globalThis.Deno,L=!!globalThis.fastly,S=!!globalThis.Netlify,u=!!globalThis.EdgeRuntime,N=globalThis.navigator?.userAgent==="Cloudflare-Workers",F=[[S,"netlify"],[u,"edge-light"],[N,"workerd"],[L,"fastly"],[D,"deno"],[O,"bun"],[c,"node"]];function G(){const e=F.find(s=>s[0]);if(e)return {name:e[1]}}const P=G();P?.name||"";
function ansiRegex({onlyFirst = false} = {}) {
// Valid string terminator sequences are BEL, ESC\, and 0x9c
const ST = '(?:\\u0007|\\u001B\\u005C|\\u009C)';
const pattern = [
`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))',
].join('|');
return new RegExp(pattern, onlyFirst ? undefined : 'g');
}
const regex = ansiRegex();
function stripAnsi(string) {
if (typeof string !== 'string') {
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
}
// Even though the regex is global, we don't need to reset the `.lastIndex`
// because unlike `.exec()` and `.test()`, `.replace()` does it automatically
// and doing it manually has a performance penalty.
return string.replace(regex, '');
}
// Generated code.
function isAmbiguous(x) {
return x === 0xA1
|| x === 0xA4
|| x === 0xA7
|| x === 0xA8
|| x === 0xAA
|| x === 0xAD
|| x === 0xAE
|| x >= 0xB0 && x <= 0xB4
|| x >= 0xB6 && x <= 0xBA
|| x >= 0xBC && x <= 0xBF
|| x === 0xC6
|| x === 0xD0
|| x === 0xD7
|| x === 0xD8
|| x >= 0xDE && x <= 0xE1
|| x === 0xE6
|| x >= 0xE8 && x <= 0xEA
|| x === 0xEC
|| x === 0xED
|| x === 0xF0
|| x === 0xF2
|| x === 0xF3
|| x >= 0xF7 && x <= 0xFA
|| x === 0xFC
|| x === 0xFE
|| x === 0x101
|| x === 0x111
|| x === 0x113
|| x === 0x11B
|| x === 0x126
|| x === 0x127
|| x === 0x12B
|| x >= 0x131 && x <= 0x133
|| x === 0x138
|| x >= 0x13F && x <= 0x142
|| x === 0x144
|| x >= 0x148 && x <= 0x14B
|| x === 0x14D
|| x === 0x152
|| x === 0x153
|| x === 0x166
|| x === 0x167
|| x === 0x16B
|| x === 0x1CE
|| x === 0x1D0
|| x === 0x1D2
|| x === 0x1D4
|| x === 0x1D6
|| x === 0x1D8
|| x === 0x1DA
|| x === 0x1DC
|| x === 0x251
|| x === 0x261
|| x === 0x2C4
|| x === 0x2C7
|| x >= 0x2C9 && x <= 0x2CB
|| x === 0x2CD
|| x === 0x2D0
|| x >= 0x2D8 && x <= 0x2DB
|| x === 0x2DD
|| x === 0x2DF
|| x >= 0x300 && x <= 0x36F
|| x >= 0x391 && x <= 0x3A1
|| x >= 0x3A3 && x <= 0x3A9
|| x >= 0x3B1 && x <= 0x3C1
|| x >= 0x3C3 && x <= 0x3C9
|| x === 0x401
|| x >= 0x410 && x <= 0x44F
|| x === 0x451
|| x === 0x2010
|| x >= 0x2013 && x <= 0x2016
|| x === 0x2018
|| x === 0x2019
|| x === 0x201C
|| x === 0x201D
|| x >= 0x2020 && x <= 0x2022
|| x >= 0x2024 && x <= 0x2027
|| x === 0x2030
|| x === 0x2032
|| x === 0x2033
|| x === 0x2035
|| x === 0x203B
|| x === 0x203E
|| x === 0x2074
|| x === 0x207F
|| x >= 0x2081 && x <= 0x2084
|| x === 0x20AC
|| x === 0x2103
|| x === 0x2105
|| x === 0x2109
|| x === 0x2113
|| x === 0x2116
|| x === 0x2121
|| x === 0x2122
|| x === 0x2126
|| x === 0x212B
|| x === 0x2153
|| x === 0x2154
|| x >= 0x215B && x <= 0x215E
|| x >= 0x2160 && x <= 0x216B
|| x >= 0x2170 && x <= 0x2179
|| x === 0x2189
|| x >= 0x2190 && x <= 0x2199
|| x === 0x21B8
|| x === 0x21B9
|| x === 0x21D2
|| x === 0x21D4
|| x === 0x21E7
|| x === 0x2200
|| x === 0x2202
|| x === 0x2203
|| x === 0x2207
|| x === 0x2208
|| x === 0x220B
|| x === 0x220F
|| x === 0x2211
|| x === 0x2215
|| x === 0x221A
|| x >= 0x221D && x <= 0x2220
|| x === 0x2223
|| x === 0x2225
|| x >= 0x2227 && x <= 0x222C
|| x === 0x222E
|| x >= 0x2234 && x <= 0x2237
|| x === 0x223C
|| x === 0x223D
|| x === 0x2248
|| x === 0x224C
|| x === 0x2252
|| x === 0x2260
|| x === 0x2261
|| x >= 0x2264 && x <= 0x2267
|| x === 0x226A
|| x === 0x226B
|| x === 0x226E
|| x === 0x226F
|| x === 0x2282
|| x === 0x2283
|| x === 0x2286
|| x === 0x2287
|| x === 0x2295
|| x === 0x2299
|| x === 0x22A5
|| x === 0x22BF
|| x === 0x2312
|| x >= 0x2460 && x <= 0x24E9
|| x >= 0x24EB && x <= 0x254B
|| x >= 0x2550 && x <= 0x2573
|| x >= 0x2580 && x <= 0x258F
|| x >= 0x2592 && x <= 0x2595
|| x === 0x25A0
|| x === 0x25A1
|| x >= 0x25A3 && x <= 0x25A9
|| x === 0x25B2
|| x === 0x25B3
|| x === 0x25B6
|| x === 0x25B7
|| x === 0x25BC
|| x === 0x25BD
|| x === 0x25C0
|| x === 0x25C1
|| x >= 0x25C6 && x <= 0x25C8
|| x === 0x25CB
|| x >= 0x25CE && x <= 0x25D1
|| x >= 0x25E2 && x <= 0x25E5
|| x === 0x25EF
|| x === 0x2605
|| x === 0x2606
|| x === 0x2609
|| x === 0x260E
|| x === 0x260F
|| x === 0x261C
|| x === 0x261E
|| x === 0x2640
|| x === 0x2642
|| x === 0x2660
|| x === 0x2661
|| x >= 0x2663 && x <= 0x2665
|| x >= 0x2667 && x <= 0x266A
|| x === 0x266C
|| x === 0x266D
|| x === 0x266F
|| x === 0x269E
|| x === 0x269F
|| x === 0x26BF
|| x >= 0x26C6 && x <= 0x26CD
|| x >= 0x26CF && x <= 0x26D3
|| x >= 0x26D5 && x <= 0x26E1
|| x === 0x26E3
|| x === 0x26E8
|| x === 0x26E9
|| x >= 0x26EB && x <= 0x26F1
|| x === 0x26F4
|| x >= 0x26F6 && x <= 0x26F9
|| x === 0x26FB
|| x === 0x26FC
|| x === 0x26FE
|| x === 0x26FF
|| x === 0x273D
|| x >= 0x2776 && x <= 0x277F
|| x >= 0x2B56 && x <= 0x2B59
|| x >= 0x3248 && x <= 0x324F
|| x >= 0xE000 && x <= 0xF8FF
|| x >= 0xFE00 && x <= 0xFE0F
|| x === 0xFFFD
|| x >= 0x1F100 && x <= 0x1F10A
|| x >= 0x1F110 && x <= 0x1F12D
|| x >= 0x1F130 && x <= 0x1F169
|| x >= 0x1F170 && x <= 0x1F18D
|| x === 0x1F18F
|| x === 0x1F190
|| x >= 0x1F19B && x <= 0x1F1AC
|| x >= 0xE0100 && x <= 0xE01EF
|| x >= 0xF0000 && x <= 0xFFFFD
|| x >= 0x100000 && x <= 0x10FFFD;
}
function isFullWidth(x) {
return x === 0x3000
|| x >= 0xFF01 && x <= 0xFF60
|| x >= 0xFFE0 && x <= 0xFFE6;
}
function isWide(x) {
return x >= 0x1100 && x <= 0x115F
|| x === 0x231A
|| x === 0x231B
|| x === 0x2329
|| x === 0x232A
|| x >= 0x23E9 && x <= 0x23EC
|| x === 0x23F0
|| x === 0x23F3
|| x === 0x25FD
|| x === 0x25FE
|| x === 0x2614
|| x === 0x2615
|| x >= 0x2630 && x <= 0x2637
|| x >= 0x2648 && x <= 0x2653
|| x === 0x267F
|| x >= 0x268A && x <= 0x268F
|| x === 0x2693
|| x === 0x26A1
|| x === 0x26AA
|| x === 0x26AB
|| x === 0x26BD
|| x === 0x26BE
|| x === 0x26C4
|| x === 0x26C5
|| x === 0x26CE
|| x === 0x26D4
|| x === 0x26EA
|| x === 0x26F2
|| x === 0x26F3
|| x === 0x26F5
|| x === 0x26FA
|| x === 0x26FD
|| x === 0x2705
|| x === 0x270A
|| x === 0x270B
|| x === 0x2728
|| x === 0x274C
|| x === 0x274E
|| x >= 0x2753 && x <= 0x2755
|| x === 0x2757
|| x >= 0x2795 && x <= 0x2797
|| x === 0x27B0
|| x === 0x27BF
|| x === 0x2B1B
|| x === 0x2B1C
|| x === 0x2B50
|| x === 0x2B55
|| x >= 0x2E80 && x <= 0x2E99
|| x >= 0x2E9B && x <= 0x2EF3
|| x >= 0x2F00 && x <= 0x2FD5
|| x >= 0x2FF0 && x <= 0x2FFF
|| x >= 0x3001 && x <= 0x303E
|| x >= 0x3041 && x <= 0x3096
|| x >= 0x3099 && x <= 0x30FF
|| x >= 0x3105 && x <= 0x312F
|| x >= 0x3131 && x <= 0x318E
|| x >= 0x3190 && x <= 0x31E5
|| x >= 0x31EF && x <= 0x321E
|| x >= 0x3220 && x <= 0x3247
|| x >= 0x3250 && x <= 0xA48C
|| x >= 0xA490 && x <= 0xA4C6
|| x >= 0xA960 && x <= 0xA97C
|| x >= 0xAC00 && x <= 0xD7A3
|| x >= 0xF900 && x <= 0xFAFF
|| x >= 0xFE10 && x <= 0xFE19
|| x >= 0xFE30 && x <= 0xFE52
|| x >= 0xFE54 && x <= 0xFE66
|| x >= 0xFE68 && x <= 0xFE6B
|| x >= 0x16FE0 && x <= 0x16FE4
|| x === 0x16FF0
|| x === 0x16FF1
|| x >= 0x17000 && x <= 0x187F7
|| x >= 0x18800 && x <= 0x18CD5
|| x >= 0x18CFF && x <= 0x18D08
|| x >= 0x1AFF0 && x <= 0x1AFF3
|| x >= 0x1AFF5 && x <= 0x1AFFB
|| x === 0x1AFFD
|| x === 0x1AFFE
|| x >= 0x1B000 && x <= 0x1B122
|| x === 0x1B132
|| x >= 0x1B150 && x <= 0x1B152
|| x === 0x1B155
|| x >= 0x1B164 && x <= 0x1B167
|| x >= 0x1B170 && x <= 0x1B2FB
|| x >= 0x1D300 && x <= 0x1D356
|| x >= 0x1D360 && x <= 0x1D376
|| x === 0x1F004
|| x === 0x1F0CF
|| x === 0x1F18E
|| x >= 0x1F191 && x <= 0x1F19A
|| x >= 0x1F200 && x <= 0x1F202
|| x >= 0x1F210 && x <= 0x1F23B
|| x >= 0x1F240 && x <= 0x1F248
|| x === 0x1F250
|| x === 0x1F251
|| x >= 0x1F260 && x <= 0x1F265
|| x >= 0x1F300 && x <= 0x1F320
|| x >= 0x1F32D && x <= 0x1F335
|| x >= 0x1F337 && x <= 0x1F37C
|| x >= 0x1F37E && x <= 0x1F393
|| x >= 0x1F3A0 && x <= 0x1F3CA
|| x >= 0x1F3CF && x <= 0x1F3D3
|| x >= 0x1F3E0 && x <= 0x1F3F0
|| x === 0x1F3F4
|| x >= 0x1F3F8 && x <= 0x1F43E
|| x === 0x1F440
|| x >= 0x1F442 && x <= 0x1F4FC
|| x >= 0x1F4FF && x <= 0x1F53D
|| x >= 0x1F54B && x <= 0x1F54E
|| x >= 0x1F550 && x <= 0x1F567
|| x === 0x1F57A
|| x === 0x1F595
|| x === 0x1F596
|| x === 0x1F5A4
|| x >= 0x1F5FB && x <= 0x1F64F
|| x >= 0x1F680 && x <= 0x1F6C5
|| x === 0x1F6CC
|| x >= 0x1F6D0 && x <= 0x1F6D2
|| x >= 0x1F6D5 && x <= 0x1F6D7
|| x >= 0x1F6DC && x <= 0x1F6DF
|| x === 0x1F6EB
|| x === 0x1F6EC
|| x >= 0x1F6F4 && x <= 0x1F6FC
|| x >= 0x1F7E0 && x <= 0x1F7EB
|| x === 0x1F7F0
|| x >= 0x1F90C && x <= 0x1F93A
|| x >= 0x1F93C && x <= 0x1F945
|| x >= 0x1F947 && x <= 0x1F9FF
|| x >= 0x1FA70 && x <= 0x1FA7C
|| x >= 0x1FA80 && x <= 0x1FA89
|| x >= 0x1FA8F && x <= 0x1FAC6
|| x >= 0x1FACE && x <= 0x1FADC
|| x >= 0x1FADF && x <= 0x1FAE9
|| x >= 0x1FAF0 && x <= 0x1FAF8
|| x >= 0x20000 && x <= 0x2FFFD
|| x >= 0x30000 && x <= 0x3FFFD;
}
function validate(codePoint) {
if (!Number.isSafeInteger(codePoint)) {
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
}
}
function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {
validate(codePoint);
if (
isFullWidth(codePoint)
|| isWide(codePoint)
|| (ambiguousAsWide && isAmbiguous(codePoint))
) {
return 2;
}
return 1;
}
const emojiRegex = () => {
// https://mths.be/emoji
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFF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|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\Line truncated
};
const segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split('') };
const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
function stringWidth$1(string, options = {}) {
if (typeof string !== 'string' || string.length === 0) {
return 0;
}
const {
ambiguousIsNarrow = true,
countAnsiEscapeCodes = false,
} = options;
if (!countAnsiEscapeCodes) {
string = stripAnsi(string);
}
if (string.length === 0) {
return 0;
}
let width = 0;
const eastAsianWidthOptions = {ambiguousAsWide: !ambiguousIsNarrow};
for (const {segment: character} of segmenter.segment(string)) {
const codePoint = character.codePointAt(0);
// Ignore control characters
if (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {
continue;
}
// Ignore zero-width characters
if (
(codePoint >= 0x20_0B && codePoint <= 0x20_0F) // Zero-width space, non-joiner, joiner, left-to-right mark, right-to-left mark
|| codePoint === 0xFE_FF // Zero-width no-break space
) {
continue;
}
// Ignore combining characters
if (
(codePoint >= 0x3_00 && codePoint <= 0x3_6F) // Combining diacritical marks
|| (codePoint >= 0x1A_B0 && codePoint <= 0x1A_FF) // Combining diacritical marks extended
|| (codePoint >= 0x1D_C0 && codePoint <= 0x1D_FF) // Combining diacritical marks supplement
|| (codePoint >= 0x20_D0 && codePoint <= 0x20_FF) // Combining diacritical marks for symbols
|| (codePoint >= 0xFE_20 && codePoint <= 0xFE_2F) // Combining half marks
) {
continue;
}
// Ignore surrogate pairs
if (codePoint >= 0xD8_00 && codePoint <= 0xDF_FF) {
continue;
}
// Ignore variation selectors
if (codePoint >= 0xFE_00 && codePoint <= 0xFE_0F) {
continue;
}
// This covers some of the above cases, but we still keep them for performance reasons.
if (defaultIgnorableCodePointRegex.test(character)) {
continue;
}
// TODO: Use `/\p{RGI_Emoji}/v` when targeting Node.js 20.
if (emojiRegex().test(character)) {
width += 2;
continue;
}
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
}
return width;
}
function isUnicodeSupported() {
const {env} = g$1;
const {TERM, TERM_PROGRAM} = env;
if (g$1.platform !== 'win32') {
return TERM !== 'linux'; // Linux console (kernel)
}
return Boolean(env.WT_SESSION) // Windows Terminal
|| Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)
|| env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder
|| TERM_PROGRAM === 'Terminus-Sublime'
|| TERM_PROGRAM === 'vscode'
|| TERM === 'xterm-256color'
|| TERM === 'alacritty'
|| TERM === 'rxvt-unicode'
|| TERM === 'rxvt-unicode-256color'
|| env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
}
const TYPE_COLOR_MAP = {
info: "cyan",
fail: "red",
success: "green",
ready: "green",
start: "magenta"
};
const LEVEL_COLOR_MAP = {
0: "red",
1: "yellow"
};
const unicode = isUnicodeSupported();
const s = (c, fallback) => unicode ? c : fallback;
const TYPE_ICONS = {
error: s("\u2716", "\xD7"),
fatal: s("\u2716", "\xD7"),
ready: s("\u2714", "\u221A"),
warn: s("\u26A0", "\u203C"),
info: s("\u2139", "i"),
success: s("\u2714", "\u221A"),
debug: s("\u2699", "D"),
trace: s("\u2192", "\u2192"),
fail: s("\u2716", "\xD7"),
start: s("\u25D0", "o"),
log: ""
};
function stringWidth(str) {
const hasICU = typeof Intl === "object";
if (!hasICU || !Intl.Segmenter) {
return stripAnsi$1(str).length;
}
return stringWidth$1(str);
}
class FancyReporter extends BasicReporter {
formatStack(stack, message, opts) {
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
return `
${indent}` + parseStack(stack, message).map(
(line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)
).join(`
${indent}`);
}
formatType(logObj, isBadge, opts) {
const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
if (isBadge) {
return getBgColor(typeColor)(
colors.black(` ${logObj.type.toUpperCase()} `)
);
}
const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
return _type ? getColor(typeColor)(_type) : "";
}
formatLogObj(logObj, opts) {
const [message, ...additional] = this.formatArgs(logObj.args, opts).split(
"\n"
);
if (logObj.type === "box") {
return box(
characterFormat(
message + (additional.length > 0 ? "\n" + additional.join("\n") : "")
),
{
title: logObj.title ? characterFormat(logObj.title) : void 0,
style: logObj.style
}
);
}
const date = this.formatDate(logObj.date, opts);
const coloredDate = date && colors.gray(date);
const isBadge = logObj.badge ?? logObj.level < 2;
const type = this.formatType(logObj, isBadge, opts);
const tag = logObj.tag ? colors.gray(logObj.tag) : "";
let line;
const left = this.filterAndJoin([type, characterFormat(message)]);
const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
line += characterFormat(
additional.length > 0 ? "\n" + additional.join("\n") : ""
);
if (logObj.type === "trace") {
const _err = new Error("Trace: " + logObj.message);
line += this.formatStack(_err.stack || "", _err.message);
}
return isBadge ? "\n" + line + "\n" : line;
}
}
function characterFormat(str) {
return str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
}
function getColor(color = "white") {
return colors[color] || colors.white;
}
function getBgColor(color = "bgWhite") {
return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
}
function createConsola(options = {}) {
let level = _getDefaultLogLevel();
if (process.env.CONSOLA_LEVEL) {
level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
}
const consola2 = createConsola$1({
level,
defaults: { level },
stdout: process.stdout,
stderr: process.stderr,
prompt: (...args) => import('./chunks/prompt.mjs').then((m) => m.prompt(...args)),
reporters: options.reporters || [
options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()
],
...options
});
return consola2;
}
function _getDefaultLogLevel() {
if (g) {
return LogLevels.debug;
}
if (R) {
return LogLevels.warn;
}
return LogLevels.info;
}
const consola = createConsola();
export { LogLevels, consola, createConsola, consola as default };
@@ -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 TrendingUpDown = createLucideIcon("TrendingUpDown", [
["path", { d: "M14.828 14.828 21 21", key: "ar5fw7" }],
["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
["path", { d: "m21 3-9 9-4-4-6 6", key: "1h02xo" }],
["path", { d: "M21 8V3h-5", key: "1qoq8a" }]
]);
export { TrendingUpDown as default };
//# sourceMappingURL=trending-up-down.js.map
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Laptop = createLucideIcon("Laptop", [
[
"path",
{
d: "M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",
key: "tarvll"
}
]
]);
export { Laptop as default };
//# sourceMappingURL=laptop.js.map
@@ -0,0 +1 @@
{"version":3,"file":"defer.cjs","names":[],"sources":["../../src/defer.ts"],"sourcesContent":["import { defaultSerializeError } from './router'\n\n/**\n * Well-known symbol used by {@link defer} to tag a promise with\n * its deferred state. Consumers can read `promise[TSR_DEFERRED_PROMISE]`\n * to access `status`, `data`, or `error`.\n */\nexport const TSR_DEFERRED_PROMISE = Symbol.for('TSR_DEFERRED_PROMISE')\n\nexport type DeferredPromiseState<T> =\n | {\n status: 'pending'\n data?: T\n error?: unknown\n }\n | {\n status: 'success'\n data: T\n }\n | {\n status: 'error'\n data?: T\n error: unknown\n }\n\nexport type DeferredPromise<T> = Promise<T> & {\n [TSR_DEFERRED_PROMISE]: DeferredPromiseState<T>\n}\n\n/**\n * Wrap a promise with a deferred state for use with `<Await>` and `useAwaited`.\n *\n * The returned promise is augmented with internal state (status/data/error)\n * so UI can read progress or suspend until it settles.\n *\n * @param _promise The promise to wrap.\n * @param options Optional config. Provide `serializeError` to customize how\n * errors are serialized for transfer.\n * @returns The same promise with attached deferred metadata.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/deferFunction\n */\nexport function defer<T>(\n _promise: Promise<T>,\n options?: {\n serializeError?: typeof defaultSerializeError\n },\n) {\n const promise = _promise as DeferredPromise<T>\n // this is already deferred promise\n if ((promise as any)[TSR_DEFERRED_PROMISE]) {\n return promise\n }\n promise[TSR_DEFERRED_PROMISE] = { status: 'pending' }\n\n promise\n .then((data) => {\n promise[TSR_DEFERRED_PROMISE].status = 'success'\n promise[TSR_DEFERRED_PROMISE].data = data\n })\n .catch((error) => {\n promise[TSR_DEFERRED_PROMISE].status = 'error'\n ;(promise[TSR_DEFERRED_PROMISE] as any).error = {\n data: (options?.serializeError ?? defaultSerializeError)(error),\n __isServerError: true,\n }\n })\n\n return promise\n}\n"],"mappings":";;;;;;;AAOA,MAAa,uBAAuB,OAAO,IAAI,uBAAuB;;;;;;;;;;;;;AAkCtE,SAAgB,MACd,UACA,SAGA;CACA,MAAM,UAAU;AAEhB,KAAK,QAAgB,sBACnB,QAAO;AAET,SAAQ,wBAAwB,EAAE,QAAQ,WAAW;AAErD,SACG,MAAM,SAAS;AACd,UAAQ,sBAAsB,SAAS;AACvC,UAAQ,sBAAsB,OAAO;GACrC,CACD,OAAO,UAAU;AAChB,UAAQ,sBAAsB,SAAS;AACrC,UAAQ,sBAA8B,QAAQ;GAC9C,OAAO,SAAS,kBAAkB,eAAA,uBAAuB,MAAM;GAC/D,iBAAiB;GAClB;GACD;AAEJ,QAAO"}
@@ -0,0 +1 @@
{"version":3,"names":["_t","require","addComment","_addComment","addComments","_addComments","shareCommentsWithSiblings","key","node","trailing","trailingComments","leading","leadingComments","prev","getSibling","next","hasPrev","Boolean","hasNext","removeIfExisting","list","toRemove","length","set","Set","filter","el","has","type","content","line","comments"],"sources":["../../src/path/comments.ts"],"sourcesContent":["// This file contains methods responsible for dealing with comments.\nimport type * as t from \"@babel/types\";\nimport type NodePath from \"./index.ts\";\nimport {\n addComment as _addComment,\n addComments as _addComments,\n} from \"@babel/types\";\n\n/**\n * Share comments amongst siblings.\n */\n\nexport function shareCommentsWithSiblings(this: NodePath) {\n // NOTE: this assumes numbered keys\n if (typeof this.key === \"string\") return;\n\n const node = this.node;\n if (!node) return;\n\n const trailing = node.trailingComments;\n const leading = node.leadingComments;\n if (!trailing && !leading) return;\n\n const prev = this.getSibling(this.key! - 1);\n const next = this.getSibling(this.key! + 1);\n const hasPrev = Boolean(prev.node);\n const hasNext = Boolean(next.node);\n\n if (hasPrev) {\n if (leading) {\n prev.addComments(\n \"trailing\",\n removeIfExisting(leading, prev.node.trailingComments),\n );\n }\n if (trailing && !hasNext) prev.addComments(\"trailing\", trailing);\n }\n if (hasNext) {\n if (trailing) {\n next.addComments(\n \"leading\",\n removeIfExisting(trailing, next.node.leadingComments),\n );\n }\n if (leading && !hasPrev) next.addComments(\"leading\", leading);\n }\n}\n\nfunction removeIfExisting<T>(list: T[], toRemove?: T[] | null): T[] {\n if (!toRemove?.length) return list;\n const set = new Set(toRemove);\n return list.filter(el => {\n return !set.has(el);\n });\n}\n\nexport function addComment(\n this: NodePath,\n type: t.CommentTypeShorthand,\n content: string,\n line?: boolean,\n) {\n _addComment(this.node, type, content, line);\n}\n\n/**\n * Give node `comments` of the specified `type`.\n */\n\nexport function addComments(\n this: NodePath,\n type: t.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AID,OAAO,IAAI,CAACK,OAAO,EAAED,IAAI,CAACX,WAAW,CAAC,SAAS,EAAEO,OAAO,CAAC;EAC/D;AACF;AAEA,SAASQ,gBAAgBA,CAAIC,IAAS,EAAEC,QAAqB,EAAO;EAClE,IAAI,EAACA,QAAQ,YAARA,QAAQ,CAAEC,MAAM,GAAE,OAAOF,IAAI;EAClC,MAAMG,GAAG,GAAG,IAAIC,GAAG,CAACH,QAAQ,CAAC;EAC7B,OAAOD,IAAI,CAACK,MAAM,CAACC,EAAE,IAAI;IACvB,OAAO,CAACH,GAAG,CAACI,GAAG,CAACD,EAAE,CAAC;EACrB,CAAC,CAAC;AACJ;AAEO,SAASxB,UAAUA,CAExB0B,IAA4B,EAC5BC,OAAe,EACfC,IAAc,EACd;EACA3B,WAAW,CAAC,IAAI,CAACK,IAAI,EAAEoB,IAAI,EAAEC,OAAO,EAAEC,IAAI,CAAC;AAC7C;AAMO,SAAS1B,WAAWA,CAEzBwB,IAA4B,EAC5BG,QAAqB,EACrB;EACA1B,YAAY,CAAC,IAAI,CAACG,IAAI,EAAEoB,IAAI,EAAEG,QAAQ,CAAC;AACzC","ignoreList":[]}
@@ -0,0 +1,40 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
// You can regenerate it using `pnpm run generate-configs`
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const base_1 = __importDefault(require("./base"));
const eslint_recommended_1 = __importDefault(require("./eslint-recommended"));
/**
* Rules considered to be best practice for modern TypeScript codebases, but that do not impact program logic.
* @see {@link https://typescript-eslint.io/users/configs#stylistic}
*/
exports.default = (plugin, parser) => [
(0, base_1.default)(plugin, parser),
(0, eslint_recommended_1.default)(plugin, parser),
{
name: 'typescript-eslint/stylistic',
rules: {
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/ban-tslint-comment': 'error',
'@typescript-eslint/class-literal-property-style': 'error',
'@typescript-eslint/consistent-generic-constructors': 'error',
'@typescript-eslint/consistent-indexed-object-style': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
},
},
];
@@ -0,0 +1,42 @@
# globals
> Global identifiers from different JavaScript environments
It's just a [JSON file](globals.json), so you can use it in any environment.
This package is used by ESLint 8 and earlier. For ESLint 9 and later, you should depend on this package directly in [your ESLint config](https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables).
## Install
```sh
npm install globals
```
## Usage
```js
import globals from 'globals';
console.log(globals.browser);
/*
{
addEventListener: false,
applicationCache: false,
ArrayBuffer: false,
atob: false,
…
}
*/
```
Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise.
For Node.js this package provides two sets of globals:
- `globals.nodeBuiltin`: Globals available to all code running in Node.js.
These will usually be available as properties on the `globalThis` object and include `process`, `Buffer`, but not CommonJS arguments like `require`.
See: https://nodejs.org/api/globals.html
- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope").
See: https://nodejs.org/api/modules.html#modules_the_module_scope
When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references.
@@ -0,0 +1,40 @@
{
"name": "@babel/compat-data",
"version": "7.29.7",
"author": "The Babel Team (https://babel.dev/team)",
"license": "MIT",
"description": "The compat-data to determine required Babel plugins",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-compat-data"
},
"publishConfig": {
"access": "public"
},
"exports": {
"./plugins": "./plugins.js",
"./native-modules": "./native-modules.js",
"./corejs2-built-ins": "./corejs2-built-ins.js",
"./corejs3-shipped-proposals": "./corejs3-shipped-proposals.js",
"./overlapping-plugins": "./overlapping-plugins.js",
"./plugin-bugfixes": "./plugin-bugfixes.js"
},
"scripts": {
"build-data": "./scripts/download-compat-table.sh && node ./scripts/build-data.mjs && node ./scripts/build-modules-support.mjs && node ./scripts/build-bugfixes-targets.mjs"
},
"keywords": [
"babel",
"compat-table",
"compat-data"
],
"devDependencies": {
"@mdn/browser-compat-data": "^6.0.8",
"core-js-compat": "^3.48.0",
"electron-to-chromium": "^1.5.278"
},
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs"
}
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/index.ts"],"names":[],"mappings":";;AACA,uDAAuE;AACvE,+CAAuC;AACvC,mCAA2B;AAC3B,2CAAiD;AACjD,yCAAkD;AAClD,iDAA8D;AAC9D,mDAAiE;AACjE,iEAAsF;AACtF,6CAAqC;AACrC,2DAAmD;AACnD,+BAAiD;AACjD,mCAAyC;AACzC,mCAAyC;AACzC,mCAA2B;AAC3B,6BAA8C;AAC9C,yCAAiC;AAEjC,SAAwB,aAAa,CAAC,SAAS,GAAG,KAAK;IACrD,MAAM,UAAU,GAAG;QACjB,MAAM;QACN,aAAU;QACV,eAAK;QACL,eAAK;QACL,eAAK;QACL,YAAS;QACT,kBAAQ;QACR,SAAS;QACT,uBAAa;QACb,8BAAoB;QACpB,sBAAY;QACZ,oBAAU;QACV,2BAAiB;KAClB,CAAA;IACD,QAAQ;IACR,IAAI,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,qBAAW,EAAE,mBAAS,CAAC,CAAA;;QACjD,UAAU,CAAC,IAAI,CAAC,yBAAe,EAAE,eAAK,CAAC,CAAA;IAC5C,UAAU,CAAC,IAAI,CAAC,kBAAQ,CAAC,CAAA;IACzB,OAAO,UAAU,CAAA;AACnB,CAAC;AArBD,gCAqBC"}
@@ -0,0 +1,6 @@
/**
* gridstack-item.component.ts 12.6.0
* Copyright (c) 2025 Alain Dumesny - see GridStack root license
*/
export {};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9hbmd1bGFyL3Byb2plY3RzL2xpYi9zcmMvbGliL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxyXG4gKiBncmlkc3RhY2staXRlbS5jb21wb25lbnQudHMgMTIuNi4wXHJcbiAqIENvcHlyaWdodCAoYykgMjAyNSBBbGFpbiBEdW1lc255IC0gc2VlIEdyaWRTdGFjayByb290IGxpY2Vuc2VcclxuICovXHJcblxyXG5pbXBvcnQgeyBHcmlkU3RhY2tOb2RlLCBHcmlkU3RhY2tPcHRpb25zLCBHcmlkU3RhY2tXaWRnZXQgfSBmcm9tIFwiZ3JpZHN0YWNrXCI7XHJcblxyXG4vKipcclxuICogRXh0ZW5kZWQgR3JpZFN0YWNrV2lkZ2V0IGludGVyZmFjZSBmb3IgQW5ndWxhciBpbnRlZ3JhdGlvbi5cclxuICogQWRkcyBBbmd1bGFyLXNwZWNpZmljIHByb3BlcnRpZXMgZm9yIGR5bmFtaWMgY29tcG9uZW50IGNyZWF0aW9uLlxyXG4gKi9cclxuZXhwb3J0IGludGVyZmFjZSBOZ0dyaWRTdGFja1dpZGdldCBleHRlbmRzIEdyaWRTdGFja1dpZGdldCB7XHJcbiAgLyoqIEFuZ3VsYXIgY29tcG9uZW50IHNlbGVjdG9yIGZvciBkeW5hbWljIGNyZWF0aW9uIChlLmcuLCAnbXktd2lkZ2V0JykgKi9cclxuICBzZWx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V0W107XHJcbiAgLyoqIENvbmZpZ3VyYXRpb24gZm9yIG5lc3RlZCBzdWItZ3JpZHMgKEFuZ3VsYXItYXdhcmUpICovXHJcbiAgc3ViR3JpZE9wdHM/OiBOZ0dyaWRTdGFja09wdGlvbnM7XHJcbn1cclxuXHJcbi8qKlxyXG4gKiBUeXBlIGZvciBjb21wb25lbnQgaW5wdXQgZGF0YSBzZXJpYWxpemF0aW9uLlxyXG4gKiBNYXBzIEBJbnB1dCgpIHByb3BlcnR5IG5hbWVzIHRvIHRoZWlyIHZhbHVlcyBmb3Igd2lkZ2V0IHBlcnNpc3RlbmNlLlxyXG4gKlxyXG4gKiBAZXhhbXBsZVxyXG4gKiBgYGB0eXBlc2NyaXB0XHJcbiAqIGNvbnN0IGlucHV0czogTmdDb21wSW5wdXRzID0ge1xyXG4gKiAgIHRpdGxlOiAnTXkgV2lkZ2V0JyxcclxuICogICB2YWx1ZTogNDIsXHJcbiAqICAgY29uZmlnOiB7IGVuYWJsZWQ6IHRydWUgfVxyXG4gKiB9O1xyXG4gKiBgYGBcclxuICovXHJcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XHJcbmV4cG9ydCB0eXBlIE5nQ29tcElucHV0cyA9IHtba2V5OiBzdHJpbmddOiBhbnl9O1xyXG4iXX0=
@@ -0,0 +1,118 @@
var Stream = require('stream').Stream
module.exports = legacy
function legacy (fs) {
return {
ReadStream: ReadStream,
WriteStream: WriteStream
}
function ReadStream (path, options) {
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
Stream.call(this);
var self = this;
this.path = path;
this.fd = null;
this.readable = true;
this.paused = false;
this.flags = 'r';
this.mode = 438; /*=0666*/
this.bufferSize = 64 * 1024;
options = options || {};
// Mixin options into this
var keys = Object.keys(options);
for (var index = 0, length = keys.length; index < length; index++) {
var key = keys[index];
this[key] = options[key];
}
if (this.encoding) this.setEncoding(this.encoding);
if (this.start !== undefined) {
if ('number' !== typeof this.start) {
throw TypeError('start must be a Number');
}
if (this.end === undefined) {
this.end = Infinity;
} else if ('number' !== typeof this.end) {
throw TypeError('end must be a Number');
}
if (this.start > this.end) {
throw new Error('start must be <= end');
}
this.pos = this.start;
}
if (this.fd !== null) {
process.nextTick(function() {
self._read();
});
return;
}
fs.open(this.path, this.flags, this.mode, function (err, fd) {
if (err) {
self.emit('error', err);
self.readable = false;
return;
}
self.fd = fd;
self.emit('open', fd);
self._read();
})
}
function WriteStream (path, options) {
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
Stream.call(this);
this.path = path;
this.fd = null;
this.writable = true;
this.flags = 'w';
this.encoding = 'binary';
this.mode = 438; /*=0666*/
this.bytesWritten = 0;
options = options || {};
// Mixin options into this
var keys = Object.keys(options);
for (var index = 0, length = keys.length; index < length; index++) {
var key = keys[index];
this[key] = options[key];
}
if (this.start !== undefined) {
if ('number' !== typeof this.start) {
throw TypeError('start must be a Number');
}
if (this.start < 0) {
throw new Error('start must be >= zero');
}
this.pos = this.start;
}
this.busy = false;
this._queue = [];
if (this.fd === null) {
this._open = fs.open;
this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
this.flush();
}
}
}
@@ -0,0 +1,41 @@
import { transformProps } from '../../render/utils/keys-transform.mjs';
const underDampedSpring = {
type: "spring",
stiffness: 500,
damping: 25,
restSpeed: 10,
};
const criticallyDampedSpring = (target) => ({
type: "spring",
stiffness: 550,
damping: target === 0 ? 2 * Math.sqrt(550) : 30,
restSpeed: 10,
});
const keyframesTransition = {
type: "keyframes",
duration: 0.8,
};
/**
* Default easing curve is a slightly shallower version of
* the default browser easing curve.
*/
const ease = {
type: "keyframes",
ease: [0.25, 0.1, 0.35, 1],
duration: 0.3,
};
const getDefaultTransition = (valueKey, { keyframes }) => {
if (keyframes.length > 2) {
return keyframesTransition;
}
else if (transformProps.has(valueKey)) {
return valueKey.startsWith("scale")
? criticallyDampedSpring(keyframes[1])
: underDampedSpring;
}
return ease;
};
export { getDefaultTransition };
//# sourceMappingURL=default-transitions.mjs.map
@@ -0,0 +1,25 @@
/**
* @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 Salad = createLucideIcon("Salad", [
["path", { d: "M7 21h10", key: "1b0cd5" }],
["path", { d: "M12 21a9 9 0 0 0 9-9H3a9 9 0 0 0 9 9Z", key: "4rw317" }],
[
"path",
{
d: "M11.38 12a2.4 2.4 0 0 1-.4-4.77 2.4 2.4 0 0 1 3.2-2.77 2.4 2.4 0 0 1 3.47-.63 2.4 2.4 0 0 1 3.37 3.37 2.4 2.4 0 0 1-1.1 3.7 2.51 2.51 0 0 1 .03 1.1",
key: "10xrj0"
}
],
["path", { d: "m13 12 4-4", key: "1hckqy" }],
["path", { d: "M10.9 7.25A3.99 3.99 0 0 0 4 10c0 .73.2 1.41.54 2", key: "1p4srx" }]
]);
export { Salad as default };
//# sourceMappingURL=salad.js.map
@@ -0,0 +1,100 @@
const require_invariant = require("./invariant.cjs");
const require_path = require("./path.cjs");
const require_not_found = require("./not-found.cjs");
const require_root = require("./root.cjs");
const require_redirect = require("./redirect.cjs");
//#region src/route.ts
var BaseRoute = class {
get to() {
return this._to;
}
get id() {
return this._id;
}
get path() {
return this._path;
}
get fullPath() {
return this._fullPath;
}
constructor(options) {
this.init = (opts) => {
this.originalIndex = opts.originalIndex;
const options = this.options;
const isRoot = !options?.path && !options?.id;
this.parentRoute = this.options.getParentRoute?.();
if (isRoot) this._path = require_root.rootRouteId;
else if (!this.parentRoute) {
if (process.env.NODE_ENV !== "production") throw new Error(`Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);
require_invariant.invariant();
}
let path = isRoot ? require_root.rootRouteId : options?.path;
if (path && path !== "/") path = require_path.trimPathLeft(path);
const customId = options?.id || path;
let id = isRoot ? require_root.rootRouteId : require_path.joinPaths([this.parentRoute.id === "__root__" ? "" : this.parentRoute.id, customId]);
if (path === "__root__") path = "/";
if (id !== "__root__") id = require_path.joinPaths(["/", id]);
const fullPath = id === "__root__" ? "/" : require_path.joinPaths([this.parentRoute.fullPath, path]);
this._path = path;
this._id = id;
this._fullPath = fullPath;
this._to = require_path.trimPathRight(fullPath);
};
this.addChildren = (children) => {
return this._addFileChildren(children);
};
this._addFileChildren = (children) => {
if (Array.isArray(children)) this.children = children;
if (typeof children === "object" && children !== null) this.children = Object.values(children);
return this;
};
this._addFileTypes = () => {
return this;
};
this.updateLoader = (options) => {
Object.assign(this.options, options);
return this;
};
this.update = (options) => {
Object.assign(this.options, options);
return this;
};
this.lazy = (lazyFn) => {
this.lazyFn = lazyFn;
return this;
};
this.redirect = (opts) => require_redirect.redirect({
from: this.fullPath,
...opts
});
this.options = options || {};
this.isRoot = !options?.getParentRoute;
if (options?.id && options?.path) throw new Error(`Route cannot have both an 'id' and a 'path' option.`);
}
};
var BaseRouteApi = class {
constructor({ id }) {
this.notFound = (opts) => {
return require_not_found.notFound({
routeId: this.id,
...opts
});
};
this.redirect = (opts) => require_redirect.redirect({
from: this.id,
...opts
});
this.id = id;
}
};
var BaseRootRoute = class extends BaseRoute {
constructor(options) {
super(options);
}
};
//#endregion
exports.BaseRootRoute = BaseRootRoute;
exports.BaseRoute = BaseRoute;
exports.BaseRouteApi = BaseRouteApi;
//# sourceMappingURL=route.cjs.map
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isPlaceholderType;
var _index = require("../definitions/index.js");
function isPlaceholderType(placeholderType, targetType) {
if (placeholderType === targetType) return true;
const aliases = _index.PLACEHOLDERS_ALIAS[placeholderType];
if (aliases != null && aliases.includes(targetType)) return true;
return false;
}
//# sourceMappingURL=isPlaceholderType.js.map
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const BadgeX = createLucideIcon("BadgeX", [
[
"path",
{
d: "M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",
key: "3c2336"
}
],
["line", { x1: "15", x2: "9", y1: "9", y2: "15", key: "f7djnv" }],
["line", { x1: "9", x2: "15", y1: "9", y2: "15", key: "1shsy8" }]
]);
export { BadgeX as default };
//# sourceMappingURL=badge-x.js.map
@@ -0,0 +1 @@
{"version":3,"file":"normalize-windows-path.js","sourceRoot":"","sources":["../../src/normalize-windows-path.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,gDAAgD;AAChD,sEAAsE;AACtE,qEAAqE;AAErE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,OAAO,CAAC,QAAQ,CAAA;AAE1E,MAAM,CAAC,MAAM,oBAAoB,GAC/B,QAAQ,KAAK,OAAO,CAAC,CAAC;IACpB,CAAC,CAAU,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA","sourcesContent":["// on windows, either \\ or / are valid directory separators.\n// on unix, \\ is a valid character in filenames.\n// so, on windows, and only on windows, we replace all \\ chars with /,\n// so that we can use / as our one and only directory separator char.\n\nconst platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform\n\nexport const normalizeWindowsPath: (p: unknown) => string =\n platform !== 'win32' ?\n (p: unknown) => String(p)\n : (p: unknown) => String(p).replaceAll(/\\\\/g, '/')\n"]}
@@ -0,0 +1 @@
{"version":3,"file":"router.cjs","names":[],"sources":["../../src/router.ts"],"sourcesContent":["import { RouterCore } from '@tanstack/router-core'\nimport { getStoreFactory } from './routerStores'\nimport type { RouterHistory } from '@tanstack/history'\nimport type {\n AnyRoute,\n CreateRouterFn,\n RouterConstructorOptions,\n TrailingSlashOption,\n} from '@tanstack/router-core'\n\nimport type {\n ErrorRouteComponent,\n NotFoundRouteComponent,\n RouteComponent,\n} from './route'\n\ndeclare module '@tanstack/router-core' {\n export interface RouterOptionsExtensions {\n /**\n * The default `component` a route should use if no component is provided.\n *\n * @default Outlet\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultcomponent-property)\n */\n defaultComponent?: RouteComponent\n /**\n * The default `errorComponent` a route should use if no error component is provided.\n *\n * @default ErrorComponent\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaulterrorcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)\n */\n defaultErrorComponent?: ErrorRouteComponent\n /**\n * The default `pendingComponent` a route should use if no pending component is provided.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#showing-a-pending-component)\n */\n defaultPendingComponent?: RouteComponent\n /**\n * The default `notFoundComponent` a route should use if no notFound component is provided.\n *\n * @default NotFound\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultnotfoundcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/not-found-errors#default-router-wide-not-found-handling)\n */\n defaultNotFoundComponent?: NotFoundRouteComponent\n /**\n * A component that will be used to wrap the entire router.\n *\n * This is useful for providing a context to the entire router.\n *\n * Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#wrap-property)\n */\n Wrap?: (props: { children: any }) => React.JSX.Element\n /**\n * A component that will be used to wrap the inner contents of the router.\n *\n * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.\n *\n * Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#innerwrap-property)\n */\n InnerWrap?: (props: { children: any }) => React.JSX.Element\n\n /**\n * The default `onCatch` handler for errors caught by the Router ErrorBoundary\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)\n */\n defaultOnCatch?: (error: Error, errorInfo: React.ErrorInfo) => void\n }\n}\n\n/**\n * Creates a new Router instance for React.\n *\n * Pass the returned router to `RouterProvider` to enable routing.\n * Notable options: `routeTree` (your route definitions) and `context`\n * (required if the root route was created with `createRootRouteWithContext`).\n *\n * @param options Router options used to configure the router.\n * @returns A Router instance to be provided to `RouterProvider`.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction\n */\nexport const createRouter: CreateRouterFn = (options) => {\n return new Router(options)\n}\n\nexport class Router<\n in out TRouteTree extends AnyRoute,\n in out TTrailingSlashOption extends TrailingSlashOption = 'never',\n in out TDefaultStructuralSharingOption extends boolean = false,\n in out TRouterHistory extends RouterHistory = RouterHistory,\n in out TDehydrated extends Record<string, any> = Record<string, any>,\n> extends RouterCore<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated\n> {\n constructor(\n options: RouterConstructorOptions<\n TRouteTree,\n TTrailingSlasLine truncated
@@ -0,0 +1,29 @@
'use strict';
var wordSequenceMatcher = (options, match) => {
if (match.pattern !== 'wordSequence') {
return null;
}
let warning = null;
const suggestions = [];
// Warning for common word sequences
if (match.wordCount >= 3) {
warning = options.translations.warnings.sequences;
}
// Suggestions based on sequence characteristics
if (match.ascending) {
suggestions.push(options.translations.suggestions.sequences);
} else {
suggestions.push(options.translations.suggestions.anotherWord);
}
if (match.wordCount > 2) {
suggestions.push(options.translations.suggestions.useWords);
}
return {
warning,
suggestions
};
};
module.exports = wordSequenceMatcher;
//# sourceMappingURL=feedback.cjs.map
@@ -0,0 +1,22 @@
declare global {
let suite: typeof import('vitest')['suite']
let test: typeof import('vitest')['test']
let chai: typeof import("vitest")["chai"]
let describe: typeof import('vitest')['describe']
let it: typeof import('vitest')['it']
let expectTypeOf: typeof import('vitest')['expectTypeOf']
let assertType: typeof import('vitest')['assertType']
let expect: typeof import('vitest')['expect']
let assert: typeof import('vitest')['assert']
let vitest: typeof import('vitest')['vitest']
let vi: typeof import('vitest')['vitest']
let beforeAll: typeof import('vitest')['beforeAll']
let afterAll: typeof import('vitest')['afterAll']
let beforeEach: typeof import('vitest')['beforeEach']
let afterEach: typeof import('vitest')['afterEach']
let aroundEach: typeof import('vitest')['aroundEach']
let aroundAll: typeof import('vitest')['aroundAll']
let onTestFailed: typeof import('vitest')['onTestFailed']
let onTestFinished: typeof import('vitest')['onTestFinished']
}
export {}
@@ -0,0 +1 @@
{"version":3,"file":"interpolate.mjs","sources":["../../../src/utils/interpolate.ts"],"sourcesContent":["import {\n clamp,\n EasingFunction,\n invariant,\n MotionGlobalConfig,\n noop,\n pipe,\n progress,\n} from \"motion-utils\"\nimport { mix } from \"./mix\"\nimport { Mixer, MixerFactory } from \"./mix/types\"\n\nexport interface InterpolateOptions<T> {\n clamp?: boolean\n ease?: EasingFunction | EasingFunction[]\n mixer?: MixerFactory<T>\n}\n\nfunction createMixers<T>(\n output: T[],\n ease?: EasingFunction | EasingFunction[],\n customMixer?: MixerFactory<T>\n) {\n const mixers: Array<Mixer<T>> = []\n const mixerFactory: MixerFactory<T> =\n customMixer || MotionGlobalConfig.mix || mix\n const numMixers = output.length - 1\n\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1])\n\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease\n mixer = pipe(easingFunction, mixer) as Mixer<T>\n }\n\n mixers.push(mixer)\n }\n\n return mixers\n}\n\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nexport function interpolate<T>(\n input: number[],\n output: T[],\n { clamp: isClamp = true, ease, mixer }: InterpolateOptions<T> = {}\n): (v: number) => T {\n const inputLength = input.length\n\n invariant(\n inputLength === output.length,\n \"Both input and output ranges must be the same length\",\n \"range-length\"\n )\n\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1) return () => output[0]\n if (inputLength === 2 && output[0] === output[1]) return () => output[1]\n\n const isZeroDeltaRange = input[0] === input[1]\n\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse()\n output = [...output].reverse()\n }\n\n const mixers = createMixers(output, ease, mixer)\n const numMixers = mixers.length\n\n const interpolator = (v: number): T => {\n if (isZeroDeltaRange && v < input[0]) return output[0]\n\n let i = 0\n\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1]) break\n }\n }\n\n const progressInRange = progress(input[i], input[i + 1], v)\n\n return mixers[i](progressInRange)\n }\n\n return isClamp\n ? (v: number) =>\n interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator\n}\n"],"names":[],"mappings":";;;AAkBA,SAAS,YAAY,CACjB,MAAW,EACX,IAAwC,EACxC,WAA6B,EAAA;IAE7B,MAAM,MAAM,GAAoB,EAAE;IAClC,MAAM,YAAY,GACd,WAAW,IAAI,kBAAkB,CAAC,GAAG,IAAI,GAAG;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CAAC,EAAE;QACnC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,OAAO,EAAE;QAC5B,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,OAAO,EAAE;IAClC;IAEA,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC;AAChD,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM;AAE/B,IAAA,MAAM,YAAY,GAAG,CAAC,CAAS,KAAO;AAClC,QAAA,IAAI,gBAAgB,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,MAAM,CAAC,CAAC,CAAC;QAEtD,IAAI,CAAC,GAAG,CAAC;AAET,QAAA,IAAI,SAAS,GAAG,CAAC,EAAE;YACf,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAC9B,gBAAA,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;oBAAE;YAC1B;QACJ;AAEA,QAAA,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KLine truncated
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/popper.tsx"],
"sourcesContent": ["'use client';\nexport {\n createPopperScope,\n //\n Popper,\n PopperAnchor,\n PopperContent,\n PopperArrow,\n //\n Root,\n Anchor,\n Content,\n Arrow,\n //\n SIDE_OPTIONS,\n ALIGN_OPTIONS,\n} from './popper';\nexport type {\n PopperProps,\n PopperAnchorProps,\n PopperContentProps,\n PopperArrowProps,\n} from './popper';\n", "import * as React from 'react';\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size,\n} from '@floating-ui/react-dom';\nimport * as ArrowPrimitive from '@radix-ui/react-arrow';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useSize } from '@radix-ui/react-use-size';\n\nimport type { Placement, Middleware } from '@floating-ui/react-dom';\nimport type { Scope } from '@radix-ui/react-context';\nimport type { Measurable } from '@radix-ui/rect';\n\nconst SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'] as const;\nconst ALIGN_OPTIONS = ['start', 'center', 'end'] as const;\n\ntype Side = (typeof SIDE_OPTIONS)[number];\ntype Align = (typeof ALIGN_OPTIONS)[number];\n\n/* -------------------------------------------------------------------------------------------------\n * Popper\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_NAME = 'Popper';\n\ntype ScopedProps<P> = P & { __scopePopper?: Scope };\nconst [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\n\ntype PopperContextValue = {\n anchor: Measurable | null;\n onAnchorChange(anchor: Measurable | null): void;\n};\nconst [PopperProvider, usePopperContext] = createPopperContext<PopperContextValue>(POPPER_NAME);\n\ninterface PopperProps {\n children?: React.ReactNode;\n}\nconst Popper: React.FC<PopperProps> = (props: ScopedProps<PopperProps>) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState<Measurable | null>(null);\n return (\n <PopperProvider scope={__scopePopper} anchor={anchor} onAnchorChange={setAnchor}>\n {children}\n </PopperProvider>\n );\n};\n\nPopper.displayName = POPPER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopperAnchor';\n\ntype PopperAnchorElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PopperAnchorProps extends PrimitiveDivProps {\n virtualRef?: React.RefObject<Measurable>;\n}\n\nconst PopperAnchor = React.forwardRef<PopperAnchorElement, PopperAnchorProps>(\n (props: ScopedProps<PopperAnchorProps>, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef<PopperAnchorElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n const anchorRef = React.useRef<Measurable | null>(null);\n React.useEffect(() => {\n const previousAnchor = anchorRef.current;\n anchorRef.current = virtualRef?.current || ref.current;\n if (previousAnchor !== anchorRef.current) {\n // Consumer can anchor the popper to something that isn't\n // a DOM node e.g. pointer position, so we override the\n // `anchorRef` with their virtual ref in this case.\n context.onAnchorChange(anchorRef.current);\n }\n });\n\n return virtualRef ? null : <Primitive.div {...anchorProps} ref={composedRefs} />;\n }\n);\n\nPopperAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopperContent';\n\ntype PopperContentContextValue = {\n placedSide: Side;\n onArrowChange(arrow: HTMLSpanElement | null): void;\n arrowX?: number;\n arrowY?: number;\n shouldHideArrow: boolean;\n};\n\nconst [PopperContentProvider, useContentContext] =\n createPopperContext<PopperContentContextValue>(CONTENT_NAME);\n\ntype Boundary = Element | null;\n\ntype PopperContentElement = React.ComponentRef<typeof Primitive.div>;\ninterface PopperContentProps extends PrimitiveDivProps {\n side?: Side;\n sideOffset?: number;\n align?: Align;\n alignOffset?: number;\n arrowPadding?: number;\n avoidCollisions?: boolean;\n collisionBoundary?: Boundary | Boundary[];\n collisionPadding?: number | Partial<Record<Side, numLine truncated
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,uBAUO;AACP,qBAAgC;AAChC,gCAAgC;AAChC,2BAAmC;AACnC,6BAA0B;AAC1B,oCAA+B;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U;AAExD;AAAA;AAAA;AAAA;AAAA,IAIE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK,eAAe;AAAA,QACpB,OAAO;AAAA,UACL,UAAU;AAAA,UACV,MAAM,eAAe;AAAA,UACrB,KAAK,eAAe;AAAA,UACpB,CAAC,QAAQ,GAAG;AAAA,UACZ,iBAAiB;AAAA,YACf,KAAK;AAAA,YACL,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,MAAM;AAAA,UACR,EAAE,eAAe,UAAU;AAAA,UAC3B,WAAW;AAAA,YACT,KAAK;AAAA,YACL,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,MAAM;AAAA,UACR,EAAE,eAAe,UAAU;AAAA,UAC3B,YAAY,eAAe,kBAAkB,WAAW;AAAA,QAC1D;AAAA,QAEA;AAAA,UAAgB;AAAA,UAAf;AAAA,YACE,GAAG;AAAA,YACJ,KAAK;AAAA,YACL,OAAO;AAAA,cACL,GAAG,WAAW;AAAA;AAAA,cAEd,SAAS;AAAA,YACX;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA;AAEJ,CLine truncated
"names": ["Root", "floatingUIarrow", "PopperArrow", "Root"]
}
@@ -0,0 +1 @@
{"version":3,"file":"index.cjs","sources":["../src/errors.ts","../src/EventSource.ts"],"sourcesContent":["/**\n * An extended version of the `Event` emitted by the `EventSource` object when an error occurs.\n * While the spec does not include any additional properties, we intentionally go beyond the spec\n * and provide some (minimal) additional information to aid in debugging.\n *\n * @public\n */\nexport class ErrorEvent extends Event {\n /**\n * HTTP status code, if this was triggered by an HTTP error\n * Note: this is not part of the spec, but is included for better error handling.\n *\n * @public\n */\n public code?: number | undefined\n\n /**\n * Optional message attached to the error.\n * Note: this is not part of the spec, but is included for better error handling.\n *\n * @public\n */\n public message?: string | undefined\n\n /**\n * Constructs a new `ErrorEvent` instance. This is typically not called directly,\n * but rather emitted by the `EventSource` object when an error occurs.\n *\n * @param type - The type of the event (should be \"error\")\n * @param errorEventInitDict - Optional properties to include in the error event\n */\n constructor(\n type: string,\n errorEventInitDict?: {message?: string | undefined; code?: number | undefined},\n ) {\n super(type)\n this.code = errorEventInitDict?.code ?? undefined\n this.message = errorEventInitDict?.message ?? undefined\n }\n\n /**\n * Node.js \"hides\" the `message` and `code` properties of the `ErrorEvent` instance,\n * when it is `console.log`'ed. This makes it harder to debug errors. To ease debugging,\n * we explicitly include the properties in the `inspect` method.\n *\n * This is automatically called by Node.js when you `console.log` an instance of this class.\n *\n * @param _depth - The current depth\n * @param options - The options passed to `util.inspect`\n * @param inspect - The inspect function to use (prevents having to import it from `util`)\n * @returns A string representation of the error\n */\n [Symbol.for('nodejs.util.inspect.custom')](\n _depth: number,\n options: {colors: boolean},\n inspect: (obj: unknown, inspectOptions: {colors: boolean}) => string,\n ): string {\n return inspect(inspectableError(this), options)\n }\n\n /**\n * Deno \"hides\" the `message` and `code` properties of the `ErrorEvent` instance,\n * when it is `console.log`'ed. This makes it harder to debug errors. To ease debugging,\n * we explicitly include the properties in the `inspect` method.\n *\n * This is automatically called by Deno when you `console.log` an instance of this class.\n *\n * @param inspect - The inspect function to use (prevents having to import it from `util`)\n * @param options - The options passed to `Deno.inspect`\n * @returns A string representation of the error\n */\n [Symbol.for('Deno.customInspect')](\n inspect: (obj: unknown, inspectOptions: {colors: boolean}) => string,\n options: {colors: boolean},\n ): string {\n return inspect(inspectableError(this), options)\n }\n}\n\n/**\n * For environments where DOMException may not exist, we will use a SyntaxError instead.\n * While this isn't strictly according to spec, it is very close.\n *\n * @param message - The message to include in the error\n * @returns A `DOMException` or `SyntaxError` instance\n * @internal\n */\nexport function syntaxError(message: string): SyntaxError {\n // If someone can figure out a way to make this work without depending on DOM/Node.js typings,\n // and without casting to `any`, please send a PR 🙏\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const DomException = (globalThis as any).DOMException\n if (typeof DomException === 'function') {\n return new DomException(message, 'SyntaxError')\n }\n\n return new SyntaxError(message)\n}\n\n/**\n * Flatten an error into a single error message string.\n * Unwraps nested errors and joins them with a comma.\n *\n * @param err - The error to flatten\n * @returns A string representation of the error\n * @internal\n */\nexport function flattenError(err: unknown): string {\n if (!(err instanceof Error)) {\n return `${err}`\n }\n\n if ('errors' in err && Array.isArray(err.errors)) {\n return err.errors.map(flattenError).join(', ')\n }\n\n if ('cause' in err && err.cause instanceof Error) {\n return `${err}: ${flattenError(err.cause)}`\n }\n\n return err.message\n}\n\n/**\n * Convert an `ErrorEvent` instance into a plain object for inspection.\n *\n * @param err - The `ErrorEvent` instance to inspect\n * @returns A plain object representation of the error\n * @internal\n */\nfunction inspectableError(err: ErrorEvent) {\n return {\n type: err.type,\n message: err.message,\n code: err.code,\n defaultPrevented: err.defaultPrevented,\n cancelable: err.cancelable,\n timeStamp: err.timeStamp,\n }\n}\n","import {createParser, type EvLine 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 './square-chevron-up.js';
//# sourceMappingURL=chevron-up-square.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index-J2FaQ-KY.d.cts","names":[],"sources":["../../core-internal/src/auth/errors.ts","../../core-internal/src/errors/sdkErrors.ts","../../core-internal/src/shared/authUtils.ts","../../core-internal/src/types/schemas.ts","../../core-internal/src/types/types.ts","../../core-internal/src/wire/codec.ts","../../core-internal/src/util/standardSchema.ts","../../core-internal/src/shared/inputRequired.ts","../../core-internal/src/shared/inputRequiredDriver.ts","../../core-internal/src/types/enums.ts","../../core-internal/src/types/errors.ts","../../core-internal/src/types/guards.ts","../../core-internal/src/types/specTypeSchema.ts","../../core-internal/src/shared/transport.ts","../../core-internal/src/shared/protocol.ts","../../core-internal/src/shared/mediaType.ts","../../core-internal/src/shared/metadataUtils.ts","../../core-internal/src/shared/protocolEras.ts","../../core-internal/src/shared/stdio.ts","../../core-internal/src/shared/uriTemplate.ts","../../core-internal/src/util/inMemory.ts","../../core-internal/src/wire/preload.ts"],"sourcesCont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ClC,gBAAA,GAAmB,cAAc,aAAa;KAC9C,uBAAA,GAA0B,aAAa;KAGvC,eAAA,GAAkB,aAAa;KAC/B,cAAA,GAAiB,cAAc,aAAa;KAG5C,WAAA,GAAc,aAAa;KAG3B,QAAA,GAAW,aAAa;KACxB,0BAAA,GAA6B,aAAa;KAC1C,oBAAA,GAAuB,aAAa;;KAYpC,IAAA,GAAO,aAAa;;KAEpB,UAAA,GAAa,aAAa;;KAE1B,kBAAA,GAAqB,aAAa;;KAElC,YAAA,GAAe,aAAa;;KAE5B,mBAAA,GAAsB,aAAa;;KAEnC,gBAAA,GAAmB,cAAc,aAAa;;KAE9C,4BAAA,GAA+B,aAAa;;KAE5C,sBAAA,GAAyB,aAAa;;KAEtC,cAAA,GAAiB,aAAa;;KAE9B,aAAA,GAAgB,cAAc,aAAa;;KAE3C,qBAAA,GAAwB,aAAa;;KAErC,gBAAA,GAAmB,aAAa;;KAEhC,eAAA,GAAkB,cAAc,aAAa;;KAE7C,iBAAA,GAAoB,aAAa;;KAEjC,gBAAA,GAAmB,cAAc,aAAa;;KAE9C,oBAAA,GAAuB,cAAc,aAAa;KAGlD,sBAAA,GAAyB,aAAa;KACtC,gBAAA,GAAmB,aAAa;KAChC,eAAA,GAAkB,cAAc,aAAa;KAG7C,gBAAA,GAAmB,aAAa;KAChC,oBAAA,GAAuB,aAAa;KACpC,oBAAA,GAAuB,aAAa;KACpC,QAAA,GAAW,aAAa;KAExB,oBAAA,GAAuB,aAAa;KACpC,oBAAA,GAAuB,aAAa;KACpC,mBAAA,GAAsB,cAAc,aAAa;KACjD,4BAAA,GAA+B,aAAa;Line truncated
@@ -0,0 +1,49 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
module.exports = class AppendPlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {string} appending appending
* @param {string | ResolveStepHook} target target
*/
constructor(source, appending, target) {
this.source = source;
this.appending = appending;
this.target = target;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
resolver
.getHook(this.source)
.tapAsync("AppendPlugin", (request, resolveContext, callback) => {
/** @type {ResolveRequest} */
const obj = {
...request,
path: request.path + this.appending,
relativePath:
request.relativePath && request.relativePath + this.appending,
};
resolver.doResolve(
target,
obj,
this.appending,
resolveContext,
callback,
);
});
}
};
@@ -0,0 +1,183 @@
const require_utils = require("../utils.cjs");
const require_invariant = require("../invariant.cjs");
const require_not_found = require("../not-found.cjs");
const require_ssr_match_id = require("./ssr-match-id.cjs");
//#region src/ssr/ssr-client.ts
function hydrateMatch(match, deyhydratedMatch) {
match.id = deyhydratedMatch.i;
match.__beforeLoadContext = deyhydratedMatch.b;
match.loaderData = deyhydratedMatch.l;
match.status = deyhydratedMatch.s;
match.ssr = deyhydratedMatch.ssr;
match.updatedAt = deyhydratedMatch.u;
match.error = deyhydratedMatch.e;
if (deyhydratedMatch.g !== void 0) match.globalNotFound = deyhydratedMatch.g;
}
async function hydrate(router) {
if (!window.$_TSR) {
if (process.env.NODE_ENV !== "production") throw new Error("Invariant failed: Expected to find bootstrap data on window.$_TSR, but we did not. Please file an issue!");
require_invariant.invariant();
}
const serializationAdapters = router.options.serializationAdapters;
if (serializationAdapters?.length) {
const fromSerializableMap = /* @__PURE__ */ new Map();
serializationAdapters.forEach((adapter) => {
fromSerializableMap.set(adapter.key, adapter.fromSerializable);
});
window.$_TSR.t = fromSerializableMap;
window.$_TSR.buffer.forEach((script) => script());
}
window.$_TSR.initialized = true;
if (!window.$_TSR.router) {
if (process.env.NODE_ENV !== "production") throw new Error("Invariant failed: Expected to find a dehydrated data on window.$_TSR.router, but we did not. Please file an issue!");
require_invariant.invariant();
}
const dehydratedRouter = window.$_TSR.router;
dehydratedRouter.matches.forEach((dehydratedMatch) => {
dehydratedMatch.i = require_ssr_match_id.hydrateSsrMatchId(dehydratedMatch.i);
});
if (dehydratedRouter.lastMatchId) dehydratedRouter.lastMatchId = require_ssr_match_id.hydrateSsrMatchId(dehydratedRouter.lastMatchId);
const { manifest, dehydratedData, lastMatchId } = dehydratedRouter;
router.ssr = { manifest };
const nonce = document.querySelector("meta[property=\"csp-nonce\"]")?.content;
router.options.ssr = { nonce };
const matches = router.matchRoutes(router.stores.location.get());
const routeChunkPromise = Promise.all(matches.map((match) => router.loadRouteChunk(router.looseRoutesById[match.routeId])));
function setMatchForcePending(match) {
const pendingMinMs = router.looseRoutesById[match.routeId].options.pendingMinMs ?? router.options.defaultPendingMinMs;
if (pendingMinMs) {
const minPendingPromise = require_utils.createControlledPromise();
match._nonReactive.minPendingPromise = minPendingPromise;
match._forcePending = true;
setTimeout(() => {
minPendingPromise.resolve();
router.updateMatch(match.id, (prev) => {
prev._nonReactive.minPendingPromise = void 0;
return {
...prev,
_forcePending: void 0
};
});
}, pendingMinMs);
}
}
function setRouteSsr(match) {
const route = router.looseRoutesById[match.routeId];
if (route) route.options.ssr = match.ssr;
}
let firstNonSsrMatchIndex = void 0;
matches.forEach((match) => {
const dehydratedMatch = dehydratedRouter.matches.find((d) => d.i === match.id);
if (!dehydratedMatch) {
match._nonReactive.dehydrated = false;
match.ssr = false;
setRouteSsr(match);
return;
}
hydrateMatch(match, dehydratedMatch);
setRouteSsr(match);
match._nonReactive.dehydrated = match.ssr !== false;
if (match.ssr === "data-only" || match.ssr === false) {
if (firstNonSsrMatchIndex === void 0) {
firstNonSsrMatchIndex = match.index;
setMatchForcePending(match);
}
}
});
router.stores.setMatches(matches);
await router.options.hydrate?.(dehydratedData);
const activeMatches = router.stores.matches.get();
const location = router.stores.location.get();
await Promise.all(activeMatches.map(async (match) => {
try {
const route = router.looseRoutesById[match.routeId];
const parentContext = activeMatches[match.index - 1]?.context ?? router.options.context;
if (route.options.context) {
const contextFnContext = {
deps: match.loaderDeps,
params: match.params,
context: parentContext ?? {},
location,
navigate: (opts) => router.navigate({
...opts,
_fromLocation: location
}),
buildLocation: router.buildLocation,
cause: match.cause,
abortController: match.abortController,
preload: false,
matches,
routeId: route.id
};
match.__routeContext = route.options.context(contextFnContext) ?? void 0;
}
match.context = {
...parentContext,
...match.__routeContext,
...match.__beforeLoadContext
};
const assetContext = {
ssr: router.options.ssr,
matches: activeMatches,
match,
params: match.params,
loaderData: match.loaderData
};
const headFnContent = await route.options.head?.(assetContext);
const scripts = await route.options.scripts?.(assetContext);
match.meta = headFnContent?.meta;
match.links = headFnContent?.links;
match.headScripts = headFnContent?.scripts;
match.styles = headFnContent?.styles;
match.scripts = scripts;
} catch (err) {
if (require_not_found.isNotFound(err)) {
match.error = { isNotFound: true };
console.error(`NotFound error during hydration for routeId: ${match.routeId}`, err);
} else {
match.error = err;
console.error(`Error during hydration for route ${match.routeId}:`, err);
throw err;
}
}
}));
const isSpaMode = matches[matches.length - 1].id !== lastMatchId;
if (!matches.some((m) => m.ssr === false) && !isSpaMode) {
matches.forEach((match) => {
match._nonReactive.dehydrated = void 0;
});
router.stores.resolvedLocation.set(router.stores.location.get());
return routeChunkPromise;
}
const loadPromise = Promise.resolve().then(() => router.load()).catch((err) => {
console.error("Error during router hydration:", err);
});
if (isSpaMode) {
const match = matches[1];
if (!match) {
if (process.env.NODE_ENV !== "production") throw new Error("Invariant failed: Expected to find a match below the root match in SPA mode.");
require_invariant.invariant();
}
setMatchForcePending(match);
match._displayPending = true;
match._nonReactive.displayPendingPromise = loadPromise;
loadPromise.then(() => {
router.batch(() => {
if (router.stores.status.get() === "pending") {
router.stores.status.set("idle");
router.stores.resolvedLocation.set(router.stores.location.get());
}
router.updateMatch(match.id, (prev) => ({
...prev,
_displayPending: void 0,
displayPendingPromise: void 0
}));
});
});
}
return routeChunkPromise;
}
//#endregion
exports.hydrate = hydrate;
//# sourceMappingURL=ssr-client.cjs.map
@@ -0,0 +1,80 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getScriptKind = getScriptKind;
exports.getLanguageVariant = getLanguageVariant;
const node_path_1 = __importDefault(require("node:path"));
const ts = __importStar(require("typescript"));
function getScriptKind(filePath, jsx) {
const extension = node_path_1.default.extname(filePath).toLowerCase();
// note - we only respect the user's jsx setting for unknown extensions
// this is so that we always match TS's internal script kind logic, preventing
// weird errors due to a mismatch.
// https://github.com/microsoft/TypeScript/blob/da00ba67ed1182ad334f7c713b8254fba174aeba/src/compiler/utilities.ts#L6948-L6968
switch (extension) {
case ts.Extension.Cjs:
case ts.Extension.Js:
case ts.Extension.Mjs:
return ts.ScriptKind.JS;
case ts.Extension.Cts:
case ts.Extension.Mts:
case ts.Extension.Ts:
return ts.ScriptKind.TS;
case ts.Extension.Json:
return ts.ScriptKind.JSON;
case ts.Extension.Jsx:
return ts.ScriptKind.JSX;
case ts.Extension.Tsx:
return ts.ScriptKind.TSX;
default:
// unknown extension, force typescript to ignore the file extension, and respect the user's setting
return jsx ? ts.ScriptKind.TSX : ts.ScriptKind.TS;
}
}
function getLanguageVariant(scriptKind) {
// https://github.com/microsoft/TypeScript/blob/d6e483b8dabd8fd37c00954c3f2184bb7f1eb90c/src/compiler/utilities.ts#L6281-L6285
switch (scriptKind) {
case ts.ScriptKind.JS:
case ts.ScriptKind.JSON:
case ts.ScriptKind.JSX:
case ts.ScriptKind.TSX:
return ts.LanguageVariant.JSX;
default:
return ts.LanguageVariant.Standard;
}
}
@@ -0,0 +1,130 @@
/**
* @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not.
* @author Glen Mailer
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow confusing multiline expressions",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-unexpected-multiline",
},
schema: [],
messages: {
function:
"Unexpected newline between function and ( of function call.",
property:
"Unexpected newline between object and [ of property access.",
taggedTemplate:
"Unexpected newline between template tag and template literal.",
division:
"Unexpected newline between numerator and division operator.",
},
},
create(context) {
const REGEX_FLAG_MATCHER = /^[gimsuy]+$/u;
const sourceCode = context.sourceCode;
/**
* Check to see if there is a newline between the node and the following open bracket
* line's expression
* @param {ASTNode} node The node to check.
* @param {string} messageId The error messageId to use.
* @returns {void}
* @private
*/
function checkForBreakAfter(node, messageId) {
const openParen = sourceCode.getTokenAfter(
node,
astUtils.isNotClosingParenToken,
);
const nodeExpressionEnd = sourceCode.getTokenBefore(openParen);
if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) {
context.report({
node,
loc: openParen.loc,
messageId,
});
}
}
//--------------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------------
return {
MemberExpression(node) {
if (!node.computed || node.optional) {
return;
}
checkForBreakAfter(node.object, "property");
},
TaggedTemplateExpression(node) {
const { quasi } = node;
// handles common tags, parenthesized tags, and typescript's generic type arguments
const tokenBefore = sourceCode.getTokenBefore(quasi);
if (tokenBefore.loc.end.line !== quasi.loc.start.line) {
context.report({
node,
loc: {
start: quasi.loc.start,
end: {
line: quasi.loc.start.line,
column: quasi.loc.start.column + 1,
},
},
messageId: "taggedTemplate",
});
}
},
CallExpression(node) {
if (node.arguments.length === 0 || node.optional) {
return;
}
checkForBreakAfter(node.callee, "function");
},
"BinaryExpression[operator='/'] > BinaryExpression[operator='/'].left"(
node,
) {
const secondSlash = sourceCode.getTokenAfter(
node,
token => token.value === "/",
);
const tokenAfterOperator =
sourceCode.getTokenAfter(secondSlash);
if (
tokenAfterOperator.type === "Identifier" &&
REGEX_FLAG_MATCHER.test(tokenAfterOperator.value) &&
secondSlash.range[1] === tokenAfterOperator.range[0]
) {
checkForBreakAfter(node.left, "division");
}
},
};
},
};
@@ -0,0 +1,70 @@
/*
Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
'use strict';
var gulp = require('gulp'),
git = require('gulp-git'),
bump = require('gulp-bump'),
filter = require('gulp-filter'),
tagVersion = require('gulp-tag-version');
var TEST = [ 'test/*.js' ];
var POWERED = [ 'powered-test/*.js' ];
var SOURCE = [ 'src/**/*.js' ];
/**
* Bumping version number and tagging the repository with it.
* Please read http://semver.org/
*
* You can use the commands
*
* gulp patch # makes v0.1.0 -> v0.1.1
* gulp feature # makes v0.1.1 -> v0.2.0
* gulp release # makes v0.2.1 -> v1.0.0
*
* To bump the version numbers accordingly after you did a patch,
* introduced a feature or made a backwards-incompatible release.
*/
function inc(importance) {
// get all the files to bump version in
return gulp.src(['./package.json'])
// bump the version number in those files
.pipe(bump({type: importance}))
// save it back to filesystem
.pipe(gulp.dest('./'))
// commit the changed version number
.pipe(git.commit('Bumps package version'))
// read only one file to get the version number
.pipe(filter('package.json'))
// **tag it in the repository**
.pipe(tagVersion({
prefix: ''
}));
}
gulp.task('patch', [ ], function () { return inc('patch'); })
gulp.task('minor', [ ], function () { return inc('minor'); })
gulp.task('major', [ ], function () { return inc('major'); })
@@ -0,0 +1,6 @@
'use strict';
/** @type {import('./isNaN')} */
module.exports = Number.isNaN || function isNaN(a) {
return a !== a;
};
@@ -0,0 +1,279 @@
import { frameData, frame, isPrimaryPointer, cancelFrame } from 'motion-dom';
import { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';
import { addPointerEvent } from '../../events/add-pointer-event.mjs';
import { extractEventInfo } from '../../events/event-info.mjs';
import { distance2D } from '../../utils/distance.mjs';
const overflowStyles = /*#__PURE__*/ new Set(["auto", "scroll"]);
/**
* @internal
*/
class PanSession {
constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {
/**
* @internal
*/
this.startEvent = null;
/**
* @internal
*/
this.lastMoveEvent = null;
/**
* @internal
*/
this.lastMoveEventInfo = null;
/**
* Raw (untransformed) event info, re-transformed each frame
* so transformPagePoint sees the current parent matrix.
* @internal
*/
this.lastRawMoveEventInfo = null;
/**
* @internal
*/
this.handlers = {};
/**
* @internal
*/
this.contextWindow = window;
/**
* Scroll positions of scrollable ancestors and window.
* @internal
*/
this.scrollPositions = new Map();
/**
* Cleanup function for scroll listeners.
* @internal
*/
this.removeScrollListeners = null;
this.onElementScroll = (event) => {
this.handleScroll(event.target);
};
this.onWindowScroll = () => {
this.handleScroll(window);
};
this.updatePoint = () => {
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
return;
// Re-transform raw point through current transformPagePoint so
// animated parent transforms (e.g. rotation) are picked up each frame
if (this.lastRawMoveEventInfo) {
this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint);
}
const info = getPanInfo(this.lastMoveEventInfo, this.history);
const isPanStarted = this.startEvent !== null;
// Only start panning if the offset is larger than 3 pixels. If we make it
// any larger than this we'll want to reset the pointer history
// on the first update to avoid visual snapping to the cursor.
const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;
if (!isPanStarted && !isDistancePastThreshold)
return;
const { point } = info;
const { timestamp } = frameData;
this.history.push({ ...point, timestamp });
const { onStart, onMove } = this.handlers;
if (!isPanStarted) {
onStart && onStart(this.lastMoveEvent, info);
this.startEvent = this.lastMoveEvent;
}
onMove && onMove(this.lastMoveEvent, info);
};
this.handlePointerMove = (event, info) => {
this.lastMoveEvent = event;
this.lastRawMoveEventInfo = info;
this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);
// Throttle mouse move event to once per frame
frame.update(this.updatePoint, true);
};
this.handlePointerUp = (event, info) => {
this.end();
const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
// Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)
// This ensures constraint animations continue when interrupted by a click
if (this.dragSnapToOrigin || !this.startEvent) {
resumeAnimation && resumeAnimation();
}
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
return;
const panInfo = getPanInfo(event.type === "pointercancel"
? this.lastMoveEventInfo
: transformPoint(info, this.transformPagePoint), this.history);
if (this.startEvent && onEnd) {
onEnd(event, panInfo);
}
onSessionEnd && onSessionEnd(event, panInfo);
};
// If we have more than one touch, don't start detecting this gesture
if (!isPrimaryPointer(event))
return;
this.dragSnapToOrigin = dragSnapToOrigin;
this.handlers = handlers;
this.transformPagePoint = transformPagePoint;
this.distanceThreshold = distanceThreshold;
this.contextWindow = contextWindow || window;
const info = extractEventInfo(event);
const initialInfo = transformPoint(info, this.transformPagePoint);
const { point } = initialInfo;
const { timestamp } = frameData;
this.history = [{ ...point, timestamp }];
const { onSessionStart } = handlers;
onSessionStart &&
onSessionStart(event, getPanInfo(initialInfo, this.history));
this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp));
// Start scroll tracking if element provided
if (element) {
this.startScrollTracking(element);
}
}
/**
* Start tracking scroll on ancestors and window.
*/
startScrollTracking(element) {
// Store initial scroll positions for scrollable ancestors
let current = element.parentElement;
while (current) {
const style = getComputedStyle(current);
if (overflowStyles.has(style.overflowX) ||
overflowStyles.has(style.overflowY)) {
this.scrollPositions.set(current, {
x: current.scrollLeft,
y: current.scrollTop,
});
}
current = current.parentElement;
}
// Track window scroll
this.scrollPositions.set(window, {
x: window.scrollX,
y: window.scrollY,
});
// Capture listener catches element scroll events as they bubble
window.addEventListener("scroll", this.onElementScroll, {
capture: true,
});
// Direct window scroll listener (window scroll doesn't bubble)
window.addEventListener("scroll", this.onWindowScroll);
this.removeScrollListeners = () => {
window.removeEventListener("scroll", this.onElementScroll, {
capture: true,
});
window.removeEventListener("scroll", this.onWindowScroll);
};
}
/**
* Handle scroll compensation during drag.
*
* For element scroll: adjusts history origin since pageX/pageY doesn't change.
* For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.
*/
handleScroll(target) {
const initial = this.scrollPositions.get(target);
if (!initial)
return;
const isWindow = target === window;
const current = isWindow
? { x: window.scrollX, y: window.scrollY }
: {
x: target.scrollLeft,
y: target.scrollTop,
};
const delta = { x: current.x - initial.x, y: current.y - initial.y };
if (delta.x === 0 && delta.y === 0)
return;
if (isWindow) {
// Window scroll: pageX/pageY changes, so update lastMoveEventInfo
if (this.lastMoveEventInfo) {
this.lastMoveEventInfo.point.x += delta.x;
this.lastMoveEventInfo.point.y += delta.y;
}
}
else {
// Element scroll: pageX/pageY unchanged, so adjust history origin
if (this.history.length > 0) {
this.history[0].x -= delta.x;
this.history[0].y -= delta.y;
}
}
this.scrollPositions.set(target, current);
frame.update(this.updatePoint, true);
}
updateHandlers(handlers) {
this.handlers = handlers;
}
end() {
this.removeListeners && this.removeListeners();
this.removeScrollListeners && this.removeScrollListeners();
this.scrollPositions.clear();
cancelFrame(this.updatePoint);
}
}
function transformPoint(info, transformPagePoint) {
return transformPagePoint ? { point: transformPagePoint(info.point) } : info;
}
function subtractPoint(a, b) {
return { x: a.x - b.x, y: a.y - b.y };
}
function getPanInfo({ point }, history) {
return {
point,
delta: subtractPoint(point, lastDevicePoint(history)),
offset: subtractPoint(point, startDevicePoint(history)),
velocity: getVelocity(history, 0.1),
};
}
function startDevicePoint(history) {
return history[0];
}
function lastDevicePoint(history) {
return history[history.length - 1];
}
function getVelocity(history, timeDelta) {
if (history.length < 2) {
return { x: 0, y: 0 };
}
let i = history.length - 1;
let timestampedPoint = null;
const lastPoint = lastDevicePoint(history);
while (i >= 0) {
timestampedPoint = history[i];
if (lastPoint.timestamp - timestampedPoint.timestamp >
secondsToMilliseconds(timeDelta)) {
break;
}
i--;
}
if (!timestampedPoint) {
return { x: 0, y: 0 };
}
/**
* If the selected point is the pointer-down origin (history[0]),
* there are better movement points available, and the time gap
* is suspiciously large (>2x timeDelta), use the next point instead.
* This prevents stale pointer-down points from diluting velocity
* in hold-then-flick gestures.
*/
if (timestampedPoint === history[0] &&
history.length > 2 &&
lastPoint.timestamp - timestampedPoint.timestamp >
secondsToMilliseconds(timeDelta) * 2) {
timestampedPoint = history[1];
}
const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
if (time === 0) {
return { x: 0, y: 0 };
}
const currentVelocity = {
x: (lastPoint.x - timestampedPoint.x) / time,
y: (lastPoint.y - timestampedPoint.y) / time,
};
if (currentVelocity.x === Infinity) {
currentVelocity.x = 0;
}
if (currentVelocity.y === Infinity) {
currentVelocity.y = 0;
}
return currentVelocity;
}
export { PanSession };
//# sourceMappingURL=PanSession.mjs.map
@@ -0,0 +1,57 @@
/**
* @fileoverview Reports useless `catch` clauses that just rethrow their error.
* @author Teddy Katz
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow unnecessary `catch` clauses",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-useless-catch",
},
schema: [],
messages: {
unnecessaryCatchClause: "Unnecessary catch clause.",
unnecessaryCatch: "Unnecessary try/catch wrapper.",
},
},
create(context) {
return {
CatchClause(node) {
if (
node.param &&
node.param.type === "Identifier" &&
node.body.body.length &&
node.body.body[0].type === "ThrowStatement" &&
node.body.body[0].argument.type === "Identifier" &&
node.body.body[0].argument.name === node.param.name
) {
if (node.parent.finalizer) {
context.report({
node,
messageId: "unnecessaryCatchClause",
});
} else {
context.report({
node: node.parent,
messageId: "unnecessaryCatch",
});
}
}
},
};
},
};
@@ -0,0 +1,36 @@
export {}; // Make this a module
declare global {
namespace NodeJS {
type TypedArray =
| Uint8Array
| Uint8ClampedArray
| Uint16Array
| Uint32Array
| Int8Array
| Int16Array
| Int32Array
| BigUint64Array
| BigInt64Array
| Float16Array
| Float32Array
| Float64Array;
type ArrayBufferView = TypedArray | DataView;
type NonSharedUint8Array = Uint8Array;
type NonSharedUint8ClampedArray = Uint8ClampedArray;
type NonSharedUint16Array = Uint16Array;
type NonSharedUint32Array = Uint32Array;
type NonSharedInt8Array = Int8Array;
type NonSharedInt16Array = Int16Array;
type NonSharedInt32Array = Int32Array;
type NonSharedBigUint64Array = BigUint64Array;
type NonSharedBigInt64Array = BigInt64Array;
type NonSharedFloat16Array = Float16Array;
type NonSharedFloat32Array = Float32Array;
type NonSharedFloat64Array = Float64Array;
type NonSharedDataView = DataView;
type NonSharedTypedArray = TypedArray;
type NonSharedArrayBufferView = ArrayBufferView;
}
}
@@ -0,0 +1,291 @@
import { createPlugin, createStream } from "seroval";
//#region src/ssr/serializer/RawStream.ts
/**
* Marker class for ReadableStream<Uint8Array> that should be serialized
* with base64 encoding (SSR) or binary framing (server functions).
*
* Wrap your binary streams with this to get efficient serialization:
* ```ts
* // For binary data (files, images, etc.)
* return { data: new RawStream(file.stream()) }
*
* // For text-heavy data (RSC payloads, etc.)
* return { data: new RawStream(rscStream, { hint: 'text' }) }
* ```
*/
var RawStream = class {
constructor(stream, options) {
this.stream = stream;
this.hint = options?.hint ?? "binary";
}
};
const BufferCtor = globalThis.Buffer;
const hasNodeBuffer = !!BufferCtor && typeof BufferCtor.from === "function";
function uint8ArrayToBase64(bytes) {
if (bytes.length === 0) return "";
if (hasNodeBuffer) return BufferCtor.from(bytes).toString("base64");
const CHUNK_SIZE = 32768;
const chunks = [];
for (let i = 0; i < bytes.length; i += CHUNK_SIZE) {
const chunk = bytes.subarray(i, i + CHUNK_SIZE);
chunks.push(String.fromCharCode.apply(null, chunk));
}
return btoa(chunks.join(""));
}
function base64ToUint8Array(base64) {
if (base64.length === 0) return new Uint8Array(0);
if (hasNodeBuffer) {
const buf = BufferCtor.from(base64, "base64");
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
}
const binary = atob(base64);
const bytes = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
return bytes;
}
const RAW_STREAM_FACTORY_BINARY = Object.create(null);
const RAW_STREAM_FACTORY_TEXT = Object.create(null);
const RAW_STREAM_FACTORY_CONSTRUCTOR_BINARY = (stream) => new ReadableStream({ start(controller) {
stream.on({
next(base64) {
try {
controller.enqueue(base64ToUint8Array(base64));
} catch {}
},
throw(error) {
controller.error(error);
},
return() {
try {
controller.close();
} catch {}
}
});
} });
const textEncoderForFactory = new TextEncoder();
const RAW_STREAM_FACTORY_CONSTRUCTOR_TEXT = (stream) => {
return new ReadableStream({ start(controller) {
stream.on({
next(value) {
try {
if (typeof value === "string") controller.enqueue(textEncoderForFactory.encode(value));
else controller.enqueue(base64ToUint8Array(value.$b64));
} catch {}
},
throw(error) {
controller.error(error);
},
return() {
try {
controller.close();
} catch {}
}
});
} });
};
const FACTORY_BINARY = `(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}catch(_){}},throw(e){c.error(e)},return(){try{c.close()}catch(_){}}})}}))`;
const FACTORY_TEXT = `(s=>{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}}catch(_){}},throw(x){c.error(x)},return(){try{c.close()}catch(_){}}})}})})`;
function toBinaryStream(readable) {
const stream = createStream();
const reader = readable.getReader();
(async () => {
try {
while (true) {
const { done, value } = await reader.read();
if (done) {
stream.return(void 0);
break;
}
stream.next(uint8ArrayToBase64(value));
}
} catch (error) {
stream.throw(error);
} finally {
reader.releaseLock();
}
})();
return stream;
}
function toTextStream(readable) {
const stream = createStream();
const reader = readable.getReader();
const decoder = new TextDecoder("utf-8", { fatal: true });
(async () => {
try {
while (true) {
const { done, value } = await reader.read();
if (done) {
try {
const remaining = decoder.decode();
if (remaining.length > 0) stream.next(remaining);
} catch {}
stream.return(void 0);
break;
}
try {
const text = decoder.decode(value, { stream: true });
if (text.length > 0) stream.next(text);
} catch {
stream.next({ $b64: uint8ArrayToBase64(value) });
}
}
} catch (error) {
stream.throw(error);
} finally {
reader.releaseLock();
}
})();
return stream;
}
/**
* SSR Plugin - uses base64 or UTF-8+base64 encoding for chunks, delegates to seroval's stream mechanism.
* Used during SSR when serializing to JavaScript code for HTML injection.
*
* Supports two modes based on RawStream hint:
* - 'binary': Always base64 encode (default)
* - 'text': Try UTF-8 first, fallback to base64 for invalid UTF-8
*/
const RawStreamSSRPlugin = /* @__PURE__ */ createPlugin({
tag: "tss/RawStream",
extends: [/* @__PURE__ */ createPlugin({
tag: "tss/RawStreamFactory",
test(value) {
return value === RAW_STREAM_FACTORY_BINARY;
},
parse: {
sync(_value, _ctx, _data) {
return {};
},
async async(_value, _ctx, _data) {
return {};
},
stream(_value, _ctx, _data) {
return {};
}
},
serialize(_node, _ctx, _data) {
return FACTORY_BINARY;
},
deserialize(_node, _ctx, _data) {
return RAW_STREAM_FACTORY_BINARY;
}
}), /* @__PURE__ */ createPlugin({
tag: "tss/RawStreamFactoryText",
test(value) {
return value === RAW_STREAM_FACTORY_TEXT;
},
parse: {
sync(_value, _ctx, _data) {
return {};
},
async async(_value, _ctx, _data) {
return {};
},
stream(_value, _ctx, _data) {
return {};
}
},
serialize(_node, _ctx, _data) {
return FACTORY_TEXT;
},
deserialize(_node, _ctx, _data) {
return RAW_STREAM_FACTORY_TEXT;
}
})],
test(value) {
return value instanceof RawStream;
},
parse: {
sync(value, ctx, _data) {
const factory = value.hint === "text" ? RAW_STREAM_FACTORY_TEXT : RAW_STREAM_FACTORY_BINARY;
return {
hint: ctx.parse(value.hint),
factory: ctx.parse(factory),
stream: ctx.parse(createStream())
};
},
async async(value, ctx, _data) {
const factory = value.hint === "text" ? RAW_STREAM_FACTORY_TEXT : RAW_STREAM_FACTORY_BINARY;
const encodedStream = value.hint === "text" ? toTextStream(value.stream) : toBinaryStream(value.stream);
return {
hint: await ctx.parse(value.hint),
factory: await ctx.parse(factory),
stream: await ctx.parse(encodedStream)
};
},
stream(value, ctx, _data) {
const factory = value.hint === "text" ? RAW_STREAM_FACTORY_TEXT : RAW_STREAM_FACTORY_BINARY;
const encodedStream = value.hint === "text" ? toTextStream(value.stream) : toBinaryStream(value.stream);
return {
hint: ctx.parse(value.hint),
factory: ctx.parse(factory),
stream: ctx.parse(encodedStream)
};
}
},
serialize(node, ctx, _data) {
return "(" + ctx.serialize(node.factory) + ")(" + ctx.serialize(node.stream) + ")";
},
deserialize(node, ctx, _data) {
const stream = ctx.deserialize(node.stream);
return ctx.deserialize(node.hint) === "text" ? RAW_STREAM_FACTORY_CONSTRUCTOR_TEXT(stream) : RAW_STREAM_FACTORY_CONSTRUCTOR_BINARY(stream);
}
});
/**
* Creates an RPC plugin instance that registers raw streams with a multiplexer.
* Used for server function responses where we want binary framing.
* Note: RPC always uses binary framing regardless of hint.
*
* @param onRawStream Callback invoked when a RawStream is encountered during serialization
*/
/* @__NO_SIDE_EFFECTS__ */
function createRawStreamRPCPlugin(onRawStream) {
let nextStreamId = 1;
return /* @__PURE__ */ createPlugin({
tag: "tss/RawStream",
test(value) {
return value instanceof RawStream;
},
parse: {
async async(value, ctx, _data) {
const streamId = nextStreamId++;
onRawStream(streamId, value.stream);
return { streamId: await ctx.parse(streamId) };
},
stream(value, ctx, _data) {
const streamId = nextStreamId++;
onRawStream(streamId, value.stream);
return { streamId: ctx.parse(streamId) };
}
},
serialize() {
throw new Error("RawStreamRPCPlugin.serialize should not be called. RPC uses JSON serialization, not JS code generation.");
},
deserialize() {
throw new Error("RawStreamRPCPlugin.deserialize should not be called. Use createRawStreamDeserializePlugin on client.");
}
});
}
/**
* Creates a deserialize-only plugin for client-side stream reconstruction.
* Used in serverFnFetcher to wire up streams from frame decoder.
*
* @param getOrCreateStream Function to get/create a stream by ID from frame decoder
*/
function createRawStreamDeserializePlugin(getOrCreateStream) {
return /* @__PURE__ */ createPlugin({
tag: "tss/RawStream",
test: () => false,
parse: {},
serialize() {
throw new Error("RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.");
},
deserialize(node, ctx, _data) {
return getOrCreateStream(typeof ctx?.deserialize === "function" ? ctx.deserialize(node.streamId) : node.streamId);
}
});
}
//#endregion
export { RawStream, RawStreamSSRPlugin, createRawStreamDeserializePlugin, createRawStreamRPCPlugin };
//# sourceMappingURL=RawStream.js.map
@@ -0,0 +1,22 @@
(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.typescript=e()}})(function(){"use strict";var Sp=Object.defineProperty;var hy=Object.getOwnPropertyDescriptor;var yy=Object.getOwnPropertyNames;var gy=Object.prototype.hasOwnProperty;var wd=(e,t)=>{for(var a in t)Sp(e,a,{get:t[a],enumerable:!0})},by=(e,t,a,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of yy(t))!gy.call(e,f)&&f!==a&&Sp(e,f,{get:()=>t[f],enumerable:!(s=hy(t,f))||s.enumerable});return e};var vy=e=>by(Sp({},"__esModule",{value:!0}),e);var T3={};wd(T3,{parsers:()=>gd});var gd={};wd(gd,{typescript:()=>x3});var xy=()=>()=>{},La=xy;var ja=(e,t)=>(a,s,...f)=>a|1&&s==null?void 0:(t.call(s)??s[e]).apply(s,f);var Ty=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},Sy=ja("replaceAll",function(){if(typeof this=="string")return Ty}),yr=Sy;var Em="6.0";var Tt=[],wy=new Map;function s_(e){return e!==void 0?e.length:0}function Bn(e,t){if(e!==void 0)for(let a=0;a<e.length;a++){let s=t(e[a],a);if(s)return s}}function ky(e,t){if(e!==void 0)for(let a=0;a<e.length;a++){let s=t(e[a],a);if(s!==void 0)return s}}function kd(e,t,a){let s=[];q.assertEqual(e.length,t.length);for(let f=0;f<e.length;f++)s.push(a(e[f],t[f],f));return s}function Kp(e,t){if(e!==void 0){for(let a=0;a<e.length;a++)if(!t(e[a],a))return!1}return!0}function Am(e,t,a){if(e!==void 0)for(let s=a??0;s<e.length;s++){let f=e[s];if(t(f,s))return f}}function wp(e,t,a){if(e===void 0)return-1;for(let s=a??0;s<e.length;s++)if(t(e[s],s))return s;return-1}function Ey(e,t,a=tf){if(e!==void 0){for(let s=0;s<e.length;s++)if(a(e[s],t))return!0}return!1}function $r(e,t){if(e!==void 0){let a=e.length,s=0;for(;s<a&&t(e[s]);)s++;if(s<a){let f=e.slice(0,s);for(s++;s<a;){let h=e[s];t(h)&&f.push(h),s++}return f}}return e}function jp(e,t){let a;if(e!==void 0){a=[];for(let s=0;s<e.length;s++)a.push(t(e[s],s))}return a}function Cm(e){let t=[];for(let a=0;a<e.length;a++){let s=e[a];s&&(Kr(s)?Dn(t,s):t.push(s))}return t}function Dm(e,t){let a;if(e!==void 0)for(let s=0;s<e.length;s++){let f=t(e[s],s);f&&(Kr(f)?a=Dn(a,f):a=An(a,f))}return a??Tt}function Ay(e,t){let a;if(e!==void 0)for(let s=0;s<e.length;s++){let f=e[s],h=t(f,s);(a||f!==h||Kr(h))&&(a||(a=e.slice(0,s)),Kr(h)?Dn(a,h):a.push(h))}return a??e}function Cy(e,t){let a=[];if(e!==void 0)for(let s=0;s<e.length;s++){let f=t(e[s],s);f!==void 0&&a.push(f)}return a}function nn(e,t){if(e!==void 0)if(t!==void 0){for(let a=0;a<e.length;a++)if(t(e[a]))return!0}else return e.length>0;return!1}function Zp(e,t){return t===void 0||t.length===0?e:e===void 0||e.length===0?t:[...e,...t]}function Dy(e,t,a=tf){if(e===void 0||t===void 0)return e===t;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(!a(e[s],t[s],s))return!1;return!0}function An(e,t){return t===void 0?e:e===void 0?[t]:(e.push(t),e)}function Jp(e,t){return t<0?e.length+t:t}function Dn(e,t,a,s){if(t===void 0||t.length===0)return e;if(e===void 0)return t.slice(a,s);a=a===void 0?0:Jp(t,a),s=s===void 0?t.length:Jp(t,s);for(let f=a;f<s&&f<t.length;f++)t[f]!==void 0&&e.push(t[f]);return e}function Py(e,t,a){return Ey(e,t,a)?!1:(e.push(t),!0)}function Ny(e,t,a){return e!==void 0?(Py(e,t,a),e):[t]}function Iy(e,t){return e.length===0?Tt:e.slice().sort(t)}var C3=Array.prototype.at?(e,t)=>e?.at(t):(e,t)=>{if(e!==void 0&&(t=Jp(e,t),t<e.length))return e[t]};function ef(e){return e===void 0||e.length===0?void 0:e[0]}function Va(e){return e===void 0||e.length===0?void 0:e[e.length-1]}function Oy(e){return q.assert(e.length!==0),e[e.length-1]}function My(e){return e!==void 0&&e.length===1?e[0]:void 0}function Ly(e,t,a,s,f){return jy(e,a(t),a,s,f)}function jy(e,t,a,s,f){if(!nn(e))return-1;let h=f??0,b=e.length-1;for(;h<=b;){let v=h+(b-h>>1),l=a(e[v],v);switch(Math.sign(s(l,t))){case-1:h=v+1;break;case 0:return v;case 1:b=v-1;break}}return~h}function Jy(e,t,a,s,f){if(e&&e.length>0){let h=e.length;if(h>0){let b=s===void 0||s<0?0:s,v=f===void 0||b+f>h-1?h-1:b+f,l;for(arguments.length<=2?(l=e[b],b++):l=a;b<=v;)l=t(l,e[b],b),b++;return l}}return a}var Pm=Object.prototype.hasOwnProperty;function Or(e,t){return Pm.call(e,t)}function Ry(e){let t=[];for(let a in e)Pm.call(e,a)&&t.push(a);return t}function Uy(){let e=new Map;return e.add=By,e.remove=qy,e}function By(e,t){let a=this.get(e);return a!==void 0?a.push(t):this.set(e,a=[t]),a}function qy(e,t){let a=this.get(e);a!==void 0&&($y(a,t),a.length||this.delete(e))}function Kr(e){return Array.isArray(e)}function kp(e){return Kr(e)?e:[e]}function Fy(e,t){return e!==void 0&&t(e)?e:void 0}function Pr(e,t){return e!==void 0&&t(e)?e:q.fail(`Invalid cast. The supplied value ${e} did not pass the test '${q.getFunctionName(t)}'.`)}function Ha(e)Line truncated
Node ${Lt(L.kind)} was unexpected.`,de||W)}e.failBadSyntaxKind=W;function k(L,se,de,Se){L||(se=se?`False expression: ${se}`:"False expression.",de&&(se+=`\r
Verbose Debug Information: `+(typeof de=="string"?de:de())),y(se,Se||k))}e.assert=k;function C(L,se,de,Se,$e){if(L!==se){let Ze=de?Se?`${de} ${Se}`:de:"";y(`Expected ${L} === ${se}. ${Ze}`,$e||C)}}e.assertEqual=C;function R(L,se,de,Se){L>=se&&y(`Expected ${L} < ${se}. ${de||""}`,Se||R)}e.assertLessThan=R;function pe(L,se,de){L>se&&y(`Expected ${L} <= ${se}`,de||pe)}e.assertLessThanOrEqual=pe;function xe(L,se,de){L<se&&y(`Expected ${L} >= ${se}`,de||xe)}e.assertGreaterThanOrEqual=xe;function ge(L,se,de){L==null&&y(se,de||ge)}e.assertIsDefined=ge;function me(L,se,de){return ge(L,se,de||me),L}e.checkDefined=me;function I(L,se,de){for(let Se of L)ge(Se,se,de||I)}e.assertEachIsDefined=I;function ae(L,se,de){return I(L,se,de||ae),L}e.checkEachDefined=ae;function Le(L,se="Illegal value:",de){let Se=typeof L=="object"&&Or(L,"kind")&&Or(L,"pos")?"SyntaxKind: "+Lt(L.kind):JSON.stringify(L);return y(`${se} ${Se}`,de||Le)}e.assertNever=Le;function V(L,se,de,Se){G(1,"assertEachNode")&&k(se===void 0||Kp(L,se),de||"Unexpected node.",()=>`Node array did not pass test '${bn(se)}'.`,Se||V)}e.assertEachNode=V;function oe(L,se,de,Se){G(1,"assertNode")&&k(L!==void 0&&(se===void 0||se(L)),de||"Unexpected node.",()=>`Node ${Lt(L?.kind)} did not pass test '${bn(se)}'.`,Se||oe)}e.assertNode=oe;function Y(L,se,de,Se){G(1,"assertNotNode")&&k(L===void 0||se===void 0||!se(L),de||"Unexpected node.",()=>`Node ${Lt(L.kind)} should not have passed test '${bn(se)}'.`,Se||Y)}e.assertNotNode=Y;function mt(L,se,de,Se){G(1,"assertOptionalNode")&&k(se===void 0||L===void 0||se(L),de||"Unexpected node.",()=>`Node ${Lt(L?.kind)} did not pass test '${bn(se)}'.`,Se||mt)}e.assertOptionalNode=mt;function ar(L,se,de,Se){G(1,"assertOptionalToken")&&k(se===void 0||L===void 0||L.kind===se,de||"Unexpected node.",()=>`Node ${Lt(L?.kind)} was not a '${Lt(se)}' token.`,Se||ar)}e.assertOptionalToken=ar;function gn(L,se,de){G(1,"assertMissingNode")&&k(L===void 0,se||"Unexpected node.",()=>`Node ${Lt(L.kind)} was unexpected'.`,de||gn)}e.assertMissingNode=gn;function sr(L){}e.type=sr;function bn(L){if(typeof L!="function")return"";if(Or(L,"name"))return L.name;{let se=Function.prototype.toString.call(L),de=/^function\s+([\w$]+)\s*\(/.exec(se);return de?de[1]:""}}e.getFunctionName=bn;function In(L){return`{ name: ${h_(L.escapedName)}; flags: ${ct(L.flags)}; declarations: ${jp(L.declarations,se=>Lt(se.kind))} }`}e.formatSymbol=In;function He(L=0,se,de){let Se=jr(se);if(L===0)return Se.length>0&&Se[0][0]===0?Se[0][1]:"0";if(de){let $e=[],Ze=L;for(let[_t,Pt]of Se){if(_t>L)break;_t!==0&&_t&L&&($e.push(Pt),Ze&=~_t)}if(Ze===0)return $e.join("|")}else for(let[$e,Ze]of Se)if($e===L)return Ze;return L.toString()}e.formatEnum=He;let _r=new Map;function jr(L){let se=_r.get(L);if(se)return se;let de=[];for(let $e in L){let Ze=L[$e];typeof Ze=="number"&&de.push([Ze,$e])}let Se=Iy(de,($e,Ze)=>Nm($e[0],Ze[0]));return _r.set(L,Se),Se}function Lt(L){return He(L,Ae,!1)}e.formatSyntaxKind=Lt;function Fn(L){return He(L,jm,!1)}e.formatSnippetKind=Fn;function On(L){return He(L,Mr,!1)}e.formatScriptKind=On;function jt(L){return He(L,rn,!0)}e.formatNodeFlags=jt;function gt(L){return He(L,Om,!0)}e.formatNodeCheckFlags=gt;function Ke(L){return He(L,rf,!0)}e.formatModifierFlags=Ke;function zn(L){return He(L,Lm,!0)}e.formatTransformFlags=zn;function Zt(L){return He(L,Jm,!0)}e.formatEmitFlags=Zt;function ct(L){return He(L,af,!0)}e.formatSymbolFlags=ct;function st(L){return He(L,an,!0)}e.formatTypeFlags=st;function qt(L){return He(L,Mm,!0)}e.formatSignatureFlags=qt;function Jt(L){return He(L,sf,!0)}e.formatObjectFlags=Jt;function lt(L){return He(L,Up,!0)}e.formatFlowFlags=lt;function or(L){return He(L,Im,!0)}e.formatRelationComparisonResult=or;function ht(L){return He(L,CheckMode,!0)}e.formatCheckMode=ht;function vn(L){return He(L,SignatureCheckMode,!0)}e.formatSignatureCheckMode=vn;function bt(L){return He(L,TypeFacts,!0)}e.formatTypeFacts=bt;let ln=!1,it;function Ft(L){"__debugFlowFlags"in L||Object.defineProperties(L,{__tsDebuggerDisplay:{value(){let se=this.flags&2?"FlowStart":this.flags&4?"FlowBranchLabel":this.flags&8?"FlowLoopLabel":this.flags&16?"FlowAssignment":this.flags&32?"FlowTrueCondition":this.flags&64?"FlowFalseCondition":this.flags&128?"FlowSwitchClause":this.flags&256?"FlowArrayMutation":this.flags&512?"FlowCall":this.flags&1024?"FlowReduceLabel":this.flags&1?"FlowUnreachable":"UnknownFlow",de=this.flags&-2048;return`${se}${de?` (${lt(de)})`:""}`}},__debugFlowFlags:{get(){return He(this.flags,Up,!0)}},__debugToString:{value(){return xr(this)}}})}function sn(L){return ln&&(typeof Object.setPrototypeOf=="function"?(it||(it=Object.create(Object.prototype),Ft(it)),Object.setPrototypeOf(L,it)):Ft(L)),L}e.attachFlowNodeDebugInfo=sn;let cr;function br(L){"__tsDebuggerDisplay"in L||Object.defineProperties(L,{__tsDebuggerDisplay:{value(se){return se=String(se).replace(/(?:,[\s\w]+:[^,]+)+\]$/,"]"),`NodeArray ${se}`}}})}function vr(L){ln&&(typeof Object.setPrototypeOf=="function"?(cr||Line truncated
`).join(`
`)}
m2: ${this.mapper2.__debugToString().split(`
`).join(`
`)}`;default:return Le(this)}}}e.DebugTypeMapper=Jr;function Gn(L){return e.isDebugging?Object.setPrototypeOf(L,Jr.prototype):L}e.attachDebugPrototypeIfDebug=Gn;function Pe(L){return console.log(xr(L))}e.printControlFlowGraph=Pe;function xr(L){let se=-1;function de(u){return u.id||(u.id=se,se--),u.id}let Se;(u=>{u.lr="\u2500",u.ud="\u2502",u.dr="\u256D",u.dl="\u256E",u.ul="\u256F",u.ur="\u2570",u.udr="\u251C",u.udl="\u2524",u.dlr="\u252C",u.ulr="\u2534",u.udlr="\u256B"})(Se||(Se={}));let $e;(u=>{u[u.None=0]="None",u[u.Up=1]="Up",u[u.Down=2]="Down",u[u.Left=4]="Left",u[u.Right=8]="Right",u[u.UpDown=3]="UpDown",u[u.LeftRight=12]="LeftRight",u[u.UpLeft=5]="UpLeft",u[u.UpRight=9]="UpRight",u[u.DownLeft=6]="DownLeft",u[u.DownRight=10]="DownRight",u[u.UpDownLeft=7]="UpDownLeft",u[u.UpDownRight=11]="UpDownRight",u[u.UpLeftRight=13]="UpLeftRight",u[u.DownLeftRight=14]="DownLeftRight",u[u.UpDownLeftRight=15]="UpDownLeftRight",u[u.NoChildren=16]="NoChildren"})($e||($e={}));let Ze=2032,_t=882,Pt=Object.create(null),St=[],ut=[],Rr=ke(L,new Set);for(let u of St)u.text=at(u.flowNode,u.circular),he(u);let Tr=Ye(Rr),Mn=tt(Tr);return Xe(Rr,0),un();function Yn(u){return!!(u.flags&128)}function Ei(u){return!!(u.flags&12)&&!!u.antecedent}function U(u){return!!(u.flags&Ze)}function K(u){return!!(u.flags&_t)}function Z(u){let Me=[];for(let je of u.edges)je.source===u&&Me.push(je.target);return Me}function we(u){let Me=[];for(let je of u.edges)je.target===u&&Me.push(je.source);return Me}function ke(u,Me){let je=de(u),B=Pt[je];if(B&&Me.has(u))return B.circular=!0,B={id:-1,flowNode:u,edges:[],text:"",lane:-1,endLane:-1,level:-1,circular:"circularity"},St.push(B),B;if(Me.add(u),!B)if(Pt[je]=B={id:je,flowNode:u,edges:[],text:"",lane:-1,endLane:-1,level:-1,circular:!1},St.push(B),Ei(u))for(let ze of u.antecedent)Ee(B,ze,Me);else U(u)&&Ee(B,u.antecedent,Me);return Me.delete(u),B}function Ee(u,Me,je){let B=ke(Me,je),ze={source:u,target:B};ut.push(ze),u.edges.push(ze),B.edges.push(ze)}function he(u){if(u.level!==-1)return u.level;let Me=0;for(let je of we(u))Me=Math.max(Me,he(je)+1);return u.level=Me}function Ye(u){let Me=0;for(let je of Z(u))Me=Math.max(Me,Ye(je));return Me+1}function tt(u){let Me=O(Array(u),0);for(let je of St)Me[je.level]=Math.max(Me[je.level],je.text.length);return Me}function Xe(u,Me){if(u.lane===-1){u.lane=Me,u.endLane=Me;let je=Z(u);for(let B=0;B<je.length;B++){B>0&&Me++;let ze=je[B];Xe(ze,Me),ze.endLane>u.endLane&&(Me=ze.endLane)}u.endLane=Me}}function De(u){if(u&2)return"Start";if(u&4)return"Branch";if(u&8)return"Loop";if(u&16)return"Assignment";if(u&32)return"True";if(u&64)return"False";if(u&128)return"SwitchClause";if(u&256)return"ArrayMutation";if(u&512)return"Call";if(u&1024)return"ReduceLabel";if(u&1)return"Unreachable";throw new Error}function xn(u){let Me=bi(u);return qd(Me,u,!1)}function at(u,Me){let je=De(u.flags);if(Me&&(je=`${je}#${de(u)}`),Yn(u)){let B=[],{switchStatement:ze,clauseStart:_n,clauseEnd:Ge}=u.node;for(let Qe=_n;Qe<Ge;Qe++){let Nt=ze.caseBlock.clauses[Qe];Tv(Nt)?B.push("default"):B.push(xn(Nt.expression))}je+=` (${B.join(", ")})`}else K(u)&&u.node&&(je+=` (${xn(u.node)})`);return Me==="circularity"?`Circular(${je})`:je}function un(){let u=Mn.length,Me=Gy(St,0,Ge=>Ge.lane)+1,je=O(Array(Me),""),B=Mn.map(()=>Array(Me)),ze=Mn.map(()=>O(Array(Me),0));for(let Ge of St){B[Ge.level][Ge.lane]=Ge;let Qe=Z(Ge);for(let Et=0;Et<Qe.length;Et++){let It=Qe[Et],zt=8;It.lane===Ge.lane&&(zt|=4),Et>0&&(zt|=1),Et<Qe.length-1&&(zt|=2),ze[Ge.level][It.lane]|=zt}Qe.length===0&&(ze[Ge.level][Ge.lane]|=16);let Nt=we(Ge);for(let Et=0;Et<Nt.length;Et++){let It=Nt[Et],zt=4;Et>0&&(zt|=1),Et<Nt.length-1&&(zt|=2),ze[Ge.level-1][It.lane]|=zt}}for(let Ge=0;Ge<u;Ge++)for(let Qe=0;Qe<Me;Qe++){let Nt=Ge>0?ze[Ge-1][Qe]:0,Et=Qe>0?ze[Ge][Qe-1]:0,It=ze[Ge][Qe];It||(Nt&8&&(It|=12),Et&2&&(It|=3),ze[Ge][Qe]=It)}for(let Ge=0;Ge<u;Ge++)for(let Qe=0;Qe<je.length;Qe++){let Nt=ze[Ge][Qe],Et=Nt&4?"\u2500":" ",It=B[Ge][Qe];It?(_n(Qe,It.text),Ge<u-1&&(_n(Qe," "),_n(Qe,qe(Et,Mn[Ge]-It.text.length)))):Ge<u-1&&_n(Qe,qe(Et,Mn[Ge]+1)),_n(Qe,ei(Nt)),_n(Qe,Nt&8&&Ge<u-1&&!B[Ge+1][Qe]?"\u2500":" ")}return`
${je.join(`
`)}
`;function _n(Ge,Qe){je[Ge]+=Qe}}function ei(u){switch(u){case 3:return"\u2502";case 12:return"\u2500";case 5:return"\u256F";case 9:return"\u2570";case 6:return"\u256E";case 10:return"\u256D";case 7:return"\u2524";case 11:return"\u251C";case 13:return"\u2534";case 14:return"\u252C";case 15:return"\u256B"}return" "}function O(u,Me){if(u.fill)u.fill(Me);else for(let je=0;je<u.length;je++)u[je]=Me;return u}function qe(u,Me){if(u.repeat)return Me>0?u.repeat(Me):"";let je="";for(;je.length<Me;)je+=u;return je}}e.formatControlFlowGraph=xr})(q||(q={}));var D3=Date.now,Ad=()=>{},Ky=()=>{},hl,Ae=(e=>(e[e.Unknown=0]="Unknown",e[e.EndOfFileToken=1]="EndOfFileToken",e[e.SingleLineCommentTrivia=2]="SingleLineCommentTrivia",e[e.MultiLineCommentTrivia=3]="MultiLineCommentTrivia",e[e.NewLineTrivia=4]="NewLineTrivia",e[e.WhitespaceTrivia=5]="WhitespaceTrivia",e[e.ShebangTrivia=6]="ShebangTrivia",e[e.ConflictMarkerTrivia=7]="ConflictMarkerTrivia",e[e.NonTextFileMarkerTrivia=8]="NonTextFileMarkerTrivia",e[e.NumericLiteral=9]="NumericLiteral",e[e.BigIntLiteral=10]="BigIntLiteral",e[e.StringLiteral=11]="StringLiteral",e[e.JsxText=12]="JsxText",e[e.JsxTextAllWhiteSpaces=13]="JsxTextAllWhiteSpaces",e[e.RegularExpressionLiteral=14]="RegularExpressionLiteral",e[e.NoSubstitutionTemplateLiteral=15]="NoSubstitutionTemplateLiteral",e[e.TemplateHead=16]="TemplateHead",e[e.TemplateMiddle=17]="TemplateMiddle",e[e.TemplateTail=18]="TemplateTail",e[e.OpenBraceToken=19]="OpenBraceToken",e[e.CloseBraceToken=20]="CloseBraceToken",e[e.OpenParenToken=21]="OpenParenToken",e[e.CloseParenToken=22]="CloseParenToken",e[e.OpenBracketToken=23]="OpenBracketToken",e[e.CloseBracketToken=24]="CloseBracketToken",e[e.DotToken=25]="DotToken",e[e.DotDotDotToken=26]="DotDotDotToken",e[e.SemicolonToken=27]="SemicolonToken",e[e.CommaToken=28]="CommaToken",e[e.QuestionDotToken=29]="QuestionDotToken",e[e.LessThanToken=30]="LessThanToken",e[e.LessThanSlashToken=31]="LessThanSlashToken",e[e.GreaterThanToken=32]="GreaterThanToken",e[e.LessThanEqualsToken=33]="LessThanEqualsToken",e[e.GreaterThanEqualsToken=34]="GreaterThanEqualsToken",e[e.EqualsEqualsToken=35]="EqualsEqualsToken",e[e.ExclamationEqualsToken=36]="ExclamationEqualsToken",e[e.EqualsEqualsEqualsToken=37]="EqualsEqualsEqualsToken",e[e.ExclamationEqualsEqualsToken=38]="ExclamationEqualsEqualsToken",e[e.EqualsGreaterThanToken=39]="EqualsGreaterThanToken",e[e.PlusToken=40]="PlusToken",e[e.MinusToken=41]="MinusToken",e[e.AsteriskToken=42]="AsteriskToken",e[e.AsteriskAsteriskToken=43]="AsteriskAsteriskToken",e[e.SlashToken=44]="SlashToken",e[e.PercentToken=45]="PercentToken",e[e.PlusPlusToken=46]="PlusPlusToken",e[e.MinusMinusToken=47]="MinusMinusToken",e[e.LessThanLessThanToken=48]="LessThanLessThanToken",e[e.GreaterThanGreaterThanToken=49]="GreaterThanGreaterThanToken",e[e.GreaterThanGreaterThanGreaterThanToken=50]="GreaterThanGreaterThanGreaterThanToken",e[e.AmpersandToken=51]="AmpersandToken",e[e.BarToken=52]="BarToken",e[e.CaretToken=53]="CaretToken",e[e.ExclamationToken=54]="ExclamationToken",e[e.TildeToken=55]="TildeToken",e[e.AmpersandAmpersandToken=56]="AmpersandAmpersandToken",e[e.BarBarToken=57]="BarBarToken",e[e.QuestionToken=58]="QuestionToken",e[e.ColonToken=59]="ColonToken",e[e.AtToken=60]="AtToken",e[e.QuestionQuestionToken=61]="QuestionQuestionToken",e[e.BacktickToken=62]="BacktickToken",e[e.HashToken=63]="HashToken",e[e.EqualsToken=64]="EqualsToken",e[e.PlusEqualsToken=65]="PlusEqualsToken",e[e.MinusEqualsToken=66]="MinusEqualsToken",e[e.AsteriskEqualsToken=67]="AsteriskEqualsToken",e[e.AsteriskAsteriskEqualsToken=68]="AsteriskAsteriskEqualsToken",e[e.SlashEqualsToken=69]="SlashEqualsToken",e[e.PercentEqualsToken=70]="PercentEqualsToken",e[e.LessThanLessThanEqualsToken=71]="LessThanLessThanEqualsToken",e[e.GreaterThanGreaterThanEqualsToken=72]="GreaterThanGreaterThanEqualsToken",e[e.GreaterThanGreaterThanGreaterThanEqualsToken=73]="GreaterThanGreaterThanGreaterThanEqualsToken",e[e.AmpersandEqualsToken=74]="AmpersandEqualsToken",e[e.BarEqualsToken=75]="BarEqualsToken",e[e.BarBarEqualsToken=76]="BarBarEqualsToken",e[e.AmpersandAmpersandEqualsToken=77]="AmpersandAmpersandEqualsToken",e[e.QuestionQuestionEqualsToken=78]="QuestionQuestionEqualsToken",e[e.CaretEqualsToken=79]="CaretEqualsToken",e[e.Identifier=80]="Identifier",e[e.PrivateIdentifier=81]="PrivateIdentifier",e[e.JSDocCommentTextToken=82]="JSDocCommentTextToken",e[e.BreakKeyword=83]="BreakKeyword",e[e.CaseKeyword=84]="CaseKeyword",e[e.CatchKeyword=85]="CatchKeyword",e[e.ClassKeyword=86]="ClassKeyword",e[e.ConstKeyword=87]="ConstKeyword",e[e.ContinueKeyword=88]="ContinueKeyword",e[e.DebuggerKeyword=89]="DebuggerKeyword",e[e.DefaultKeyword=90]="DefaultKeyword",e[e.DeleteKeyword=91]="DeleteKeyword",e[e.DoKeyword=92]="DoKeyword",e[e.ElseKeyword=93]="ElseKeyword",e[e.EnumKeyword=94]="EnumKeyword",e[e.ExportKeyword=95]="ExportKeyword",e[e.ExtendsKeyword=96]="ExtendsKeyword",e[e.FalseKeyword=97]="FalseKeyword",e[e.FinallyKeyword=98]="FinallyKeyLine truncated
`,Z=l;continue}l++}return q.assert(ke!==void 0),C=we,ke}function Lt(U){let K=l;if(l++,l>=G)return Y(E.Unexpected_end_of_text),"";let Z=V(l);switch(l++,Z){case 48:if(l>=G||!hi(V(l)))return"\0";case 49:case 50:case 51:l<G&&Ap(V(l))&&l++;case 52:case 53:case 54:case 55:if(l<G&&Ap(V(l))&&l++,R|=2048,U&6){let Ee=parseInt(v.substring(K+1,l),8);return U&4&&!(U&32)&&Z!==48?Y(E.Octal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_If_this_was_intended_as_an_escape_sequence_use_the_syntax_0_instead,K,l-K,"\\x"+Ee.toString(16).padStart(2,"0")):Y(E.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0,K,l-K,"\\x"+Ee.toString(16).padStart(2,"0")),String.fromCharCode(Ee)}return v.substring(K,l);case 56:case 57:return R|=2048,U&6?(U&4&&!(U&32)?Y(E.Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class,K,l-K):Y(E.Escape_sequence_0_is_not_allowed,K,l-K,v.substring(K,l)),String.fromCharCode(Z)):v.substring(K,l);case 98:return"\b";case 116:return" ";case 110:return`
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 39:return"'";case 34:return'"';case 117:if(l<G&&V(l)===123){l-=2;let Ee=Fn(!!(U&6));return U&17||(R|=2048,U&6&&Y(E.Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set,K,l-K)),Ee}for(;l<K+6;l++)if(!(l<G&&Ep(V(l))))return R|=2048,U&6&&Y(E.Hexadecimal_digit_expected),v.substring(K,l);R|=1024;let we=parseInt(v.substring(K+2,l),16),ke=String.fromCharCode(we);if(U&16&&we>=55296&&we<=56319&&l+6<G&&v.substring(l,l+2)==="\\u"&&V(l+2)!==123){let Ee=l,he=l+2;for(;he<Ee+6;he++)if(!Ep(V(he)))return ke;let Ye=parseInt(v.substring(Ee+2,he),16);if(Ye>=56320&&Ye<=57343)return l=he,ke+String.fromCharCode(Ye)}return ke;case 120:for(;l<K+4;l++)if(!(l<G&&Ep(V(l))))return R|=2048,U&6&&Y(E.Hexadecimal_digit_expected),v.substring(K,l);return R|=4096,String.fromCharCode(parseInt(v.substring(K+2,l),16));case 13:l<G&&V(l)===10&&l++;case 10:case 8232:case 8233:return"";default:return(U&16||U&4&&!(U&8)&&Nr(Z,e))&&Y(E.This_character_cannot_be_escaped_in_a_regular_expression,l-2,2),String.fromCharCode(Z)}}function Fn(U){let K=l;l+=3;let Z=l,we=In(1,!1),ke=we?parseInt(we,16):-1,Ee=!1;return ke<0?(U&&Y(E.Hexadecimal_digit_expected),Ee=!0):ke>1114111&&(U&&Y(E.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive,Z,l-Z),Ee=!0),l>=G?(U&&Y(E.Unexpected_end_of_text),Ee=!0):V(l)===125?l++:(U&&Y(E.Unterminated_Unicode_escape_sequence),Ee=!0),Ee?(R|=2048,v.substring(K,l)):(R|=8,Od(ke))}function On(){if(l+5<G&&V(l+1)===117){let U=l;l+=2;let K=bn(4,!1);return l=U,K}return-1}function jt(){if(ae(l+1)===117&&ae(l+2)===123){let U=l;l+=3;let K=In(1,!1),Z=K?parseInt(K,16):-1;return l=U,Z}return-1}function gt(){let U="",K=l;for(;l<G;){let Z=ae(l);if(Nr(Z,e))l+=Wt(Z);else if(Z===92){if(Z=jt(),Z>=0&&Nr(Z,e)){U+=Fn(!0),K=l;continue}if(Z=On(),!(Z>=0&&Nr(Z,e)))break;R|=1024,U+=v.substring(K,l),U+=Od(Z),l+=6,K=l}else break}return U+=v.substring(K,l),U}function Ke(){let U=C.length;if(U>=2&&U<=12){let K=C.charCodeAt(0);if(K>=97&&K<=122){let Z=lg.get(C);if(Z!==void 0)return k=Z}}return k=80}function zn(U){let K="",Z=!1,we=!1;for(;;){let ke=V(l);if(ke===95){R|=512,Z?(Z=!1,we=!0):Y(we?E.Multiple_consecutive_numeric_separators_are_not_permitted:E.Numeric_separators_are_not_allowed_here,l,1),l++;continue}if(Z=!0,!hi(ke)||ke-48>=U)break;K+=v[l],l++,we=!1}return V(l-1)===95&&Y(E.Numeric_separators_are_not_allowed_here,l-1,1),K}function Zt(){return V(l)===110?(C+="n",R&384&&(C=Ub(C)+"n"),l++,10):(C=""+(R&128?parseInt(C.slice(2),2):R&256?parseInt(C.slice(2),8):+C),9)}function ct(){for(y=l,R=0;;){if(W=l,l>=G)return k=1;let U=ae(l);if(l===0&&U===35&&$m(v,l)){if(l=Qm(v,l),t)continue;return k=6}switch(U){case 10:case 13:if(R|=1,t){l++;continue}else return U===13&&l+1<G&&V(l+1)===10?l+=2:l++,k=4;case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8203:case 8239:case 8287:case 12288:case 65279:if(t){l++;continue}else{for(;l<G&&o_(V(l));)l++;return k=5}case 33:return V(l+1)===61?V(l+2)===61?(l+=3,k=38):(l+=2,k=36):(l++,k=54);case 34:case 39:return C=_r(),k=11;case 96:return k=jr(!1);case 37:return V(l+1)===61?(l+=2,k=70):(l++,k=45);case 38:return V(l+1)===38?V(l+2)===61?(l+=3,k=77):(l+=2,k=56):V(l+1)===61?(l+=2,k=74):(l++,k=51);case 40:return l++,k=21;case 41:return l++,k=22;case 42:if(V(l+1)===61)return l+=2,k=67;if(V(l+1)===42)return V(l+2)===61?(l+=3,k=68):(l+=2,k=43);if(l++,xe&&(R&32768)===0&&R&1){R|=32768;continue}return k=42;case 43:return V(l+1)===43?(l+=2,k=46):V(l+1)===61?(l+=2,k=65):(l++,k=40);case 44:return l++,k=28;case 45:return V(l+1)===45?(l+=2,k=47):V(l+1)===61?(l+=2,k=66):(l++,k=41);case 46:return hi(V(l+1))?(ar(),k=9):V(l+1)===46&&V(l+2)===46?(l+=3,k=26):(l++,k=25);case 47:if(V(l+1)===47){for(l+=2;l<G&&!Cn(V(l));)l++;if(pe=ln(pe,v.slice(W,l),hg,W),t)continue;return k=2}if(V(l+1)===42){l+=2;let he=V(l)===42&&V(l+1)!==47,Ye=!1,tt=W;for(;l<G;){let Xe=V(l);if(Xe===42&&V(l+1)===47){l+=2,Ye=!0;break}l++,Cn(Xe)&&(tt=l,R|=1)}if(he&&st()&&(R|=2),pe=ln(pe,v.slice(tt,l),yg,tt),Ye||Y(E.Asterisk_Slash_expected),t)continue;return Ye||(R|=4),k=3}return V(l+1)===61?(l+=2,k=69):(l++,k=44);case 48:if(l+2<G&&(V(l+1)===88||V(l+1)===120))return l+=2,C=In(1,!0),C||(Y(E.Hexadecimal_digit_expected),C="0"),C="0x"+C,R|=64,k=Zt();if(l+2<G&&(V(l+1)===66||V(l+1)===98))return l+=2,C=zn(2),C||(Y(E.Binary_digit_expected),C="0"),C="0b"+C,R|=128,k=Zt();if(l+2<G&&(V(l+1)===79||V(l+1)===111))return l+=2,C=zn(8),C||(Y(E.Octal_digit_expected),C="0"),C="0o"+C,R|=256,k=Zt();case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return k=ar();case 58:return l++,k=59;case 59:return l++,k=27;case 60:if(Qi(v,l)){if(l=Ra(v,l,Y),t)continue;return k=7}return V(l+1)===60?V(l+2)===61?(l+=3,k=71):(l+=2,k=48):V(l+1)===61?(l+=2,k=33):a===1&&V(l+1)===47&&V(l+2)!==42?(l+=2,k=31):(l++,k=30);case 61:if(Qi(v,l)){if(l=Ra(v,l,Y),t)continue;return k=7}retuLine truncated
`)),s}function Ya(e){let t=e.emitNode;return t&&t.flags||0}function C2(e,t,a){q.assertGreaterThanOrEqual(t,0),q.assertGreaterThanOrEqual(a,0),q.assertLessThanOrEqual(t,e.length),q.assertLessThanOrEqual(t+a,e.length)}function gl(e){return e.kind===245&&e.expression.kind===11}function Sf(e){return!!(Ya(e)&2097152)}function Fd(e){return Sf(e)&&Vf(e)}function D2(e){return et(e.name)&&!e.initializer}function zd(e){return Sf(e)&&es(e)&&Kp(e.declarationList.declarations,D2)}function P2(e,t){let a=e.kind===170||e.kind===169||e.kind===219||e.kind===220||e.kind===218||e.kind===261||e.kind===282?Zp(Ag(t,e.pos),qp(t,e.pos)):qp(t,e.pos);return $r(a,s=>s.end<=e.end&&t.charCodeAt(s.pos+1)===42&&t.charCodeAt(s.pos+2)===42&&t.charCodeAt(s.pos+3)!==47)}function N2(e){if(e)switch(e.kind){case 209:case 307:case 170:case 304:case 173:case 172:case 305:case 261:return!0}return!1}function I2(e){return e&&e.kind===242&&Tf(e.parent)}function Vd(e){let t=e.kind;return(t===212||t===213)&&e.expression.kind===108}function aa(e){return!!e&&!!(e.flags&524288)}function O2(e){return!!e&&!!(e.flags&16777216)}function M2(e){for(;El(e,!0);)e=e.right;return e}function L2(e){return et(e)&&e.escapedText==="exports"}function j2(e){return et(e)&&e.escapedText==="module"}function b1(e){return(gr(e)||v1(e))&&j2(e.expression)&&b_(e)==="exports"}function wf(e){let t=R2(e);return t===5||aa(e)?t:0}function J2(e){return s_(e.arguments)===3&&gr(e.expression)&&et(e.expression.expression)&&Pn(e.expression.expression)==="Object"&&Pn(e.expression.name)==="defineProperty"&&Ol(e.arguments[1])&&g_(e.arguments[0],!0)}function v1(e){return Za(e)&&Ol(e.argumentExpression)}function k_(e,t){return gr(e)&&(!t&&e.expression.kind===110||et(e.name)&&g_(e.expression,!0))||x1(e,t)}function x1(e,t){return v1(e)&&(!t&&e.expression.kind===110||Df(e.expression)||k_(e.expression,!0))}function g_(e,t){return Df(e)||k_(e,t)}function R2(e){if(Bf(e)){if(!J2(e))return 0;let t=e.arguments[0];return L2(t)||b1(t)?8:k_(t)&&b_(t)==="prototype"?9:7}return e.operatorToken.kind!==64||!A1(e.left)||U2(M2(e))?0:g_(e.left.expression,!0)&&b_(e.left)==="prototype"&&Uf(q2(e))?6:B2(e.left)}function U2(e){return yv(e)&&sa(e.expression)&&e.expression.text==="0"}function kf(e){if(gr(e))return e.name;let t=Af(e.argumentExpression);return sa(t)||Il(t)?t:e}function b_(e){let t=kf(e);if(t){if(et(t))return t.escapedText;if(Il(t)||sa(t))return Ua(t.text)}}function B2(e){if(e.expression.kind===110)return 4;if(b1(e))return 2;if(g_(e.expression,!0)){if(hb(e.expression))return 3;let t=e;for(;!et(t.expression);)t=t.expression;let a=t.expression;if((a.escapedText==="exports"||a.escapedText==="module"&&b_(t)==="exports")&&k_(e))return 1;if(g_(e,!0)||Za(e)&&tb(e))return 5}return 0}function q2(e){for(;ra(e.right);)e=e.right;return e.right}function F2(e){return Ll(e)&&ra(e.expression)&&wf(e.expression)!==0&&ra(e.expression.right)&&(e.expression.right.operatorToken.kind===57||e.expression.right.operatorToken.kind===61)?e.expression.right.right:void 0}function z2(e){switch(e.kind){case 244:let t=Wp(e);return t&&t.initializer;case 173:return e.initializer;case 304:return e.initializer}}function Wp(e){return es(e)?ef(e.declarationList.declarations):void 0}function V2(e){return Si(e)&&e.body&&e.body.kind===268?e.body:void 0}function Ef(e){switch(e.kind){case 220:case 227:case 242:case 253:case 180:case 297:case 264:case 232:case 176:case 177:case 186:case 181:case 252:case 260:case 247:case 213:case 243:case 1:case 267:case 307:case 278:case 279:case 282:case 245:case 250:case 251:case 249:case 263:case 219:case 185:case 178:case 80:case 246:case 273:case 272:case 182:case 265:case 318:case 324:case 257:case 175:case 174:case 268:case 203:case 271:case 211:case 170:case 218:case 212:case 304:case 173:case 172:case 254:case 241:case 179:case 305:case 306:case 256:case 258:case 259:case 266:case 169:case 261:case 244:case 248:case 255:return!0;default:return!1}}function W2(e,t){let a;N2(e)&&x2(e)&&Zi(e.initializer)&&(a=Dn(a,Wd(e,e.initializer.jsDoc)));let s=e;for(;s&&s.parent;){if(Zi(s)&&(a=Dn(a,Wd(e,s.jsDoc))),s.kind===170){a=Dn(a,(t?Ug:Rg)(s));break}if(s.kind===169){a=Dn(a,(t?qg:Bg)(s));break}s=Y2(s)}return a||Tt}function Wd(e,t){let a=Oy(t);return Dm(t,s=>{if(s===a){let f=$r(s.tags,h=>G2(e,h));return s.tags===f?[s]:f}else return $r(s.tags,Pv)})}function G2(e,t){return!($f(t)||Mv(t))||!t.parent||!lh(t.parent)||!Ml(t.parent.parent)||t.parent.parent===e}function Y2(e){let t=e.parent;if(t.kind===304||t.kind===278||t.kind===173||t.kind===245&&e.kind===212||t.kind===254||V2(t)||El(e))return t;if(t.parent&&(Wp(t.parent)===e||El(t)))return t.parent;if(t.parent&&t.parent.parent&&(Wp(t.parent.parent)||z2(t.parent.parent)===e||F2(t.parent.parent)))return t.parent.parent}function Af(e,t){return Qf(e,t?-2147483647:1)}function H2(e){let t=X2(e);if(t&&aa(e)){let a=Fg(e);if(a)return a.class}return t}function X2(e){let t=Cf(e.heritageClauses,96);return t&&t.types.length>0?t.types[0]:void 0}function $2(e){if(aa(e))return zg(e).map(t=>t.cLine truncated
`,te)+1)+4;function ne(Be){X||(X=$),Jn.push(Be),$+=Be.length}for(ze();Yi(5););Yi(4)&&(N=0,$=0);e:for(;;){switch(u()){case 60:vp(Jn),mr||(mr=O()),We(r($)),N=0,X=void 0;break;case 4:Jn.push(t.getTokenText()),N=0,$=0;break;case 42:let Be=t.getTokenText();N===1?(N=2,ne(Be)):(q.assert(N===0),N=1,$+=Be.length);break;case 5:q.assert(N!==2,"whitespace shouldn't come from the scanner while saving top-level comment text");let pt=t.getTokenText();X!==void 0&&$+pt.length>X&&Jn.push(pt.slice(X-$)),$+=pt.length;break;case 1:break e;case 82:N=2,ne(t.getTokenValue());break;case 19:N=2;let hn=t.getTokenFullStart(),cn=t.getTokenEnd()-1,tn=c(cn);if(tn){dr||Vi(Jn),Hr.push(D(y.createJSDocText(Jn.join("")),dr??te,hn)),Hr.push(tn),Jn=[],dr=t.getTokenEnd();break}default:N=2,ne(t.getTokenText());break}N===2?_n(!1):ze()}let re=Jn.join("").trimEnd();Hr.length&&re.length&&Hr.push(D(y.createJSDocText(re),dr??te,mr)),Hr.length&&Ne&&q.assertIsDefined(mr,"having parsed tags implies that the end of the comment span should be set");let Oe=Ne&&Dt(Ne,Xt,Ot);return D(y.createJSDocComment(Hr.length?Dt(Hr,te,mr):re.length?re:void 0,Oe),te,Re)}function Vi(N){for(;N.length&&(N[0]===`
`||N[0]==="\r");)N.shift()}function vp(N){for(;N.length;){let X=N[N.length-1].trimEnd();if(X==="")N.pop();else if(X.length<N[N.length-1].length){N[N.length-1]=X;break}else break}}function Kn(){for(;;){if(ze(),u()===1)return!0;if(!(u()===5||u()===4))return!1}}function wn(){if(!((u()===5||u()===4)&&H(Kn)))for(;u()===5||u()===4;)ze()}function J(){if((u()===5||u()===4)&&H(Kn))return"";let N=t.hasPrecedingLineBreak(),X=!1,$="";for(;N&&u()===42||u()===5||u()===4;)$+=t.getTokenText(),u()===4?(N=!0,X=!0,$=""):u()===42&&(N=!1),ze();return X?$:""}function r(N){q.assert(u()===60);let X=t.getTokenStart();ze();let $=pi(void 0),ne=J(),re;switch($.escapedText){case"author":re=K0(X,$,N,ne);break;case"implements":re=ey(X,$,N,ne);break;case"augments":case"extends":re=ty(X,$,N,ne);break;case"class":case"constructor":re=Gi(X,y.createJSDocClassTag,$,N,ne);break;case"public":re=Gi(X,y.createJSDocPublicTag,$,N,ne);break;case"private":re=Gi(X,y.createJSDocPrivateTag,$,N,ne);break;case"protected":re=Gi(X,y.createJSDocProtectedTag,$,N,ne);break;case"readonly":re=Gi(X,y.createJSDocReadonlyTag,$,N,ne);break;case"override":re=Gi(X,y.createJSDocOverrideTag,$,N,ne);break;case"deprecated":Gn=!0,re=Gi(X,y.createJSDocDeprecatedTag,$,N,ne);break;case"this":re=xd(X,$,N,ne);break;case"enum":re=ay(X,$,N,ne);break;case"arg":case"argument":case"param":return Wi(X,$,2,N);case"return":case"returns":re=X0(X,$,N,ne);break;case"template":re=Sd(X,$,N,ne);break;case"type":re=bd(X,$,N,ne);break;case"typedef":re=sy(X,$,N,ne);break;case"callback":re=oy(X,$,N,ne);break;case"overload":re=cy(X,$,N,ne);break;case"satisfies":re=ny(X,$,N,ne);break;case"see":re=$0(X,$,N,ne);break;case"exception":case"throws":re=Q0(X,$,N,ne);break;case"import":re=ry(X,$,N,ne);break;default:re=fe(X,$,N,ne);break}return re}function i(N,X,$,ne){return ne||($+=X-N),_($,ne.slice($))}function _(N,X){let $=O(),ne=[],re=[],Oe,Be=0,pt;function hn(Zn){pt||(pt=N),ne.push(Zn),N+=Zn.length}X!==void 0&&(X!==""&&hn(X),Be=1);let cn=u();e:for(;;){switch(cn){case 4:Be=0,ne.push(t.getTokenText()),N=0;break;case 60:t.resetTokenState(t.getTokenEnd()-1);break e;case 1:break e;case 5:q.assert(Be!==2&&Be!==3,"whitespace shouldn't come from the scanner while saving comment text");let Zn=t.getTokenText();pt!==void 0&&N+Zn.length>pt&&(ne.push(Zn.slice(pt-N)),Be=2),N+=Zn.length;break;case 19:Be=2;let _l=t.getTokenFullStart(),Ma=t.getTokenEnd()-1,ol=c(Ma);ol?(re.push(D(y.createJSDocText(ne.join("")),Oe??$,_l)),re.push(ol),ne=[],Oe=t.getTokenEnd()):hn(t.getTokenText());break;case 62:Be===3?Be=2:Be=3,hn(t.getTokenText());break;case 82:Be!==3&&(Be=2),hn(t.getTokenValue());break;case 42:if(Be===0){Be=1,N+=1;break}default:Be!==3&&(Be=2),hn(t.getTokenText());break}Be===2||Be===3?cn=_n(Be===3):cn=ze()}Vi(ne);let tn=ne.join("").trimEnd();if(re.length)return tn.length&&re.push(D(y.createJSDocText(tn),Oe??$)),Dt(re,$,t.getTokenEnd());if(tn.length)return tn}function c(N){let X=le(T);if(!X)return;ze(),wn();let $=d(),ne=[];for(;u()!==20&&u()!==4&&u()!==1;)ne.push(t.getTokenText()),ze();let re=X==="link"?y.createJSDocLink:X==="linkcode"?y.createJSDocLinkCode:y.createJSDocLinkPlain;return D(re($,ne.join("")),N,t.getTokenEnd())}function d(){if(kt(u())){let N=O(),X=Ut();for(;Je(25);)X=D(y.createQualifiedName(X,u()===81?Yt(80,!1):Ut()),N);for(;u()===81;)It(),ze(),X=D(y.createJSDocMemberName(X,vt()),N);return X}}function T(){if(J(),u()===19&&ze()===60&&kt(ze())){let N=t.getTokenValue();if(F(N))return N}}function F(N){return N==="link"||N==="linkcode"||N==="linkplain"}function fe(N,X,$,ne){return D(y.createJSDocUnknownTag(X,i(N,O(),$,ne)),N)}function We(N){N&&(Ne?Ne.push(N):(Ne=[N],Xt=N.pos),Ot=N.end)}function Mt(){return J(),u()===19?m():void 0}function hr(){let N=Yi(23);N&&wn();let X=Yi(62),$=my();return X&&Hl(62),N&&(wn(),ft(64)&&At(),j(24)),{name:$,isBracketed:N}}function kn(N){switch(N.kind){case 151:return!0;case 189:return kn(N.elementType);default:return jf(N)&&et(N.typeName)&&N.typeName.escapedText==="Object"&&!N.typeArguments}}function Wi(N,X,$,ne){let re=Mt(),Oe=!re;J();let{name:Be,isBracketed:pt}=hr(),hn=J();Oe&&!H(T)&&(re=Mt());let cn=i(N,O(),ne,hn),tn=H0(re,Be,$,ne);tn&&(re=tn,Oe=!0);let Zn=$===1?y.createJSDocPropertyTag(X,Be,pt,re,Oe,cn):y.createJSDocParameterTag(X,Be,pt,re,Oe,cn);return D(Zn,N)}function H0(N,X,$,ne){if(N&&kn(N.type)){let re=O(),Oe,Be;for(;Oe=le(()=>Tp($,ne,X));)Oe.kind===342||Oe.kind===349?Be=An(Be,Oe):Oe.kind===346&&un(Oe.tagName,E.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);if(Be){let pt=D(y.createJSDocTypeLiteral(Be,N.type.kind===189),re);return D(y.createJSDocTypeExpression(pt),re)}}}function X0(N,X,$,ne){nn(Ne,Iv)&&at(X.pos,t.getTokenStart(),E._0_tag_already_specified,h_(X.escapedText));let re=Mt();return D(y.createJSDocReturnTag(X,re,i(N,O(),$,ne)),N)}function bd(N,X,$,ne){nn(Ne,$f)&&at(X.pos,t.getTokenStart(),E._0_tag_already_specified,h_(X.escapedText));let re=m(!0),Oe=$!==void 0&&ne!==void 0?i(N,O(),$,ne):void 0;return D(y.createJSDocTypeTag(X,re,Oe),N)}functLine truncated
`&&f[s-1]==="\r"?s-1:s}getNamedDeclarations(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations}computeNamedDeclarations(){let e=Uy();return this.forEachChild(f),e;function t(h){let b=s(h);b&&e.add(b,h)}function a(h){let b=e.get(h);return b||e.set(h,b=[]),b}function s(h){let b=hf(h);return b&&(If(b)&&gr(b.expression)?b.expression.name.text:l1(b)?getNameFromPropertyName(b):void 0)}function f(h){switch(h.kind){case 263:case 219:case 175:case 174:let b=h,v=s(b);if(v){let y=a(v),W=Va(y);W&&b.parent===W.parent&&b.symbol===W.symbol?b.body&&!W.body&&(y[y.length-1]=b):y.push(b)}$t(h,f);break;case 264:case 232:case 265:case 266:case 267:case 268:case 272:case 282:case 277:case 274:case 275:case 178:case 179:case 188:t(h),$t(h,f);break;case 170:if(!E_(h,31))break;case 261:case 209:{let y=h;if(l2(y.name)){$t(y.name,f);break}y.initializer&&f(y.initializer)}case 307:case 173:case 172:t(h);break;case 279:let l=h;l.exportClause&&(rh(l.exportClause)?Bn(l.exportClause.elements,f):f(l.exportClause.name));break;case 273:let G=h.importClause;G&&(G.name&&t(G.name),G.namedBindings&&(G.namedBindings.kind===275?t(G.namedBindings):Bn(G.namedBindings.elements,f)));break;case 227:wf(h)!==0&&t(h);default:$t(h,f)}}}},b6=class{constructor(e,t,a){this.fileName=e,this.text=t,this.skipTrivia=a||(s=>s)}getLineAndCharacterOfPosition(e){return Hm(this,e)}};function v6(){return{getNodeConstructor:()=>Zf,getTokenConstructor:()=>xh,getIdentifierConstructor:()=>Th,getPrivateIdentifierConstructor:()=>Sh,getSourceFileConstructor:()=>g6,getSymbolConstructor:()=>m6,getTypeConstructor:()=>h6,getSignatureConstructor:()=>y6,getSourceMapSourceConstructor:()=>b6}}var x6=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints","getSupportedCodeFixes","getPasteEdits"],ox=[...x6,"getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors","preparePasteEditsForFile"];Eb(v6());var ts=new Proxy({},{get:()=>!0});var Eh=ts["4.8"];function rr(e,t=!1){if(e!=null){if(Eh){if(t||Rl(e)){let a=i1(e);return a?[...a]:void 0}return}return e.modifiers?.filter(a=>!Ka(a))}}function wi(e,t=!1){if(e!=null){if(Eh){if(t||Kf(e)){let a=yf(e);return a?[...a]:void 0}return}return e.decorators?.filter(Ka)}}var Ah={};var Ul=new Proxy({},{get:(e,t)=>t});var Ch=Ul,Dh=Ul;var A=Ch,Bt=Dh;var w6=ts["5.0"],ye=Ae,k6=new Set([ye.AmpersandAmpersandToken,ye.BarBarToken,ye.QuestionQuestionToken]),E6=new Set([Ae.AmpersandAmpersandEqualsToken,Ae.AmpersandEqualsToken,Ae.AsteriskAsteriskEqualsToken,Ae.AsteriskEqualsToken,Ae.BarBarEqualsToken,Ae.BarEqualsToken,Ae.CaretEqualsToken,Ae.EqualsToken,Ae.GreaterThanGreaterThanEqualsToken,Ae.GreaterThanGreaterThanGreaterThanEqualsToken,Ae.LessThanLessThanEqualsToken,Ae.MinusEqualsToken,Ae.PercentEqualsToken,Ae.PlusEqualsToken,Ae.QuestionQuestionEqualsToken,Ae.SlashEqualsToken]),A6=new Set([ye.AmpersandAmpersandToken,ye.AmpersandToken,ye.AsteriskAsteriskToken,ye.AsteriskToken,ye.BarBarToken,ye.BarToken,ye.CaretToken,ye.EqualsEqualsEqualsToken,ye.EqualsEqualsToken,ye.ExclamationEqualsEqualsToken,ye.ExclamationEqualsToken,ye.GreaterThanEqualsToken,ye.GreaterThanGreaterThanGreaterThanToken,ye.GreaterThanGreaterThanToken,ye.GreaterThanToken,ye.InKeyword,ye.InstanceOfKeyword,ye.LessThanEqualsToken,ye.LessThanLessThanToken,ye.LessThanToken,ye.MinusToken,ye.PercentToken,ye.PlusToken,ye.SlashToken]);function C6(e){return E6.has(e.kind)}function D6(e){return k6.has(e.kind)}function P6(e){return A6.has(e.kind)}function qn(e){return rt(e)}function Ph(e){return e.kind!==ye.SemicolonClassElement}function Fe(e,t){return rr(t)?.some(s=>s.kind===e)===!0}function Nh(e){let t=rr(e);return t==null?null:t[t.length-1]??null}function Ih(e){return e.kind===ye.CommaToken}function N6(e){return e.kind===ye.SingleLineCommentTrivia||e.kind===ye.MultiLineCommentTrivia}function I6(e){return e.kind===ye.JSDocComment}function Oh(e){if(C6(e))return{type:A.AssignmentExpression,operator:qn(e.kind)};if(D6(e))return{type:A.LogicalExpression,operator:qn(e.kind)};if(P6(e))return{type:A.BinaryExpression,operator:qn(e.kind)};throw new Error(`Unexpected binary operator ${rt(e.kind)}`)}function C_(e,t){let a=t.getLineAndCharacterOfPosition(e);return{column:a.character,line:a.line+1}}function Zr(e,t){let[a,s]=e.map(f=>C_(f,t));return{end:Line truncated
`))return[];let t=[];for(let a of`*${e.value}*`.split(`
`)){if(a=a.trimStart(),!a.startsWith("*"))return[];t.push(a)}return t}var x0=new WeakMap;function K4(e){return is(x0,e,Q4)}function T0(e){x0.delete(e)}function dd(e){return K4(e).length>0}function S0(e){if(e.length<2)return;let t;for(let a=e.length-1;a>=0;a--){let s=e[a];if(t&&Kt(s)===Qt(t)&&dd(s)&&dd(t)&&(e.splice(a+1,1),s.value+="*//*"+t.value,s.range=[Qt(s),Kt(t)],T0(s)),!y0(s)&&!rs(s))throw new TypeError(`Unknown comment type: "${s.type}".`);t=s}}function Z4(e){return e!==null&&typeof e=="object"}var w0=Z4;var I_=null;function O_(e){if(I_!==null&&typeof I_.property){let t=I_;return I_=O_.prototype=null,t}return I_=O_.prototype=e??Object.create(null),new O_}var e3=10;for(let e=0;e<=e3;e++)O_();function md(e){return O_(e)}function t3(e,t="type"){md(e);function a(s){let f=s[t],h=e[f];if(!Array.isArray(h))throw Object.assign(new Error(`Missing visitor keys for '${f}'.`),{node:s});return h}return a}var k0=t3;var M=[["elements"],["left","right"],["value"],["directives","body"],["label"],["callee","typeArguments","arguments"],["test","consequent","alternate"],["body","test"],["expression"],["left","right","body"],["id","typeParameters","params","predicate","returnType","body"],["object","property"],["properties"],["decorators","key","typeParameters","params","returnType","body"],["decorators","key","value"],["argument"],["expressions"],["id","init"],["body"],["decorators","id","typeParameters","superClass","superTypeArguments","mixins","implements","body"],["declaration","specifiers","source","attributes"],["local"],["exported"],["decorators","variance","key","typeAnnotation","value"],["id"],["key","value"],["elementType"],["id","typeParameters"],["id","typeParameters","extends","body"],["id","body"],["typeAnnotation"],["id","typeParameters","right"],["name","typeAnnotation"],["types"],["qualification","id"],["elementTypes"],["expression","typeAnnotation"],["params"],["members"],["objectType","indexType"],["decorators","key","typeAnnotation","value"],["id","typeParameters","params","returnType","body"],["key","typeParameters","params","returnType"],["typeParameters","params","returnType"],["parameterName","typeAnnotation"],["checkType","extendsType","trueType","falseType"],["typeParameter"],["literal"],["expression","typeArguments"],["decorators","key","typeAnnotation"],["argument","cases"],["pattern","body","guard"],["properties","rest"],["node"]],E0={ArrayExpression:M[0],AssignmentExpression:M[1],BinaryExpression:M[1],InterpreterDirective:[],Directive:M[2],DirectiveLiteral:[],BlockStatement:M[3],BreakStatement:M[4],CallExpression:M[5],CatchClause:["param","body"],ConditionalExpression:M[6],ContinueStatement:M[4],DebuggerStatement:[],DoWhileStatement:M[7],EmptyStatement:[],ExpressionStatement:M[8],File:["program"],ForInStatement:M[9],ForStatement:["init","test","update","body"],FunctionDeclaration:M[10],FunctionExpression:M[10],Identifier:["typeAnnotation","decorators"],IfStatement:M[6],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:M[1],MemberExpression:M[11],NewExpression:M[5],Program:M[3],ObjectExpression:M[12],ObjectMethod:M[13],ObjectProperty:M[14],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:M[15],SequenceExpression:M[16],ParenthesizedExpression:M[8],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:M[15],TryStatement:["block","handler","finalizer"],UnaryExpression:M[15],UpdateExpression:M[15],VariableDeclaration:["declarations"],VariableDeclarator:M[17],WhileStatement:M[7],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:M[18],ClassExpression:M[19],ClassDeclaration:M[19],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:M[20],ExportSpecifier:["local","exported"],ForOfStatement:M[9],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:M[21],ImportNamespaceSpecifier:M[21],ImportSpecifier:["imported","local"],MetaProperty:["meta","property"],ClassMethod:M[13],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:M[15],Super:[],TaggedTemplateExpression:["tag","typeArguments","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:M[15],AwaitExpression:M[15],ImportExpression:["source","options"],BigIntLiteral:[],ExportNamespaceSpecifier:M[22],OptionalMemberExpression:M[11],OptionalCallExpression:M[5],ClassProperty:M[23],ClassPrivateProperty:M[23],ClassPrivateMethod:M[13],PrivateName:M[24],StaticBlock:M[18],ImportAttribute:M[25],AnyTypeAnnotation:[],ArrayTypeAnnotation:M[26],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:M[27],DeclareClass:["id","tyLine truncated
$1 $2
`);e=e.replace(N0,"").trimEnd();let s=Object.create(null),f=yr(0,e,I0,"").replace(N0,"").trimEnd(),h;for(;h=I0.exec(e);){let b=yr(0,h[2],c3,"");if(typeof s[h[1]]=="string"||Array.isArray(s[h[1]])){let v=s[h[1]];s[h[1]]=[...p3,...Array.isArray(v)?v:[v],b]}else s[h[1]]=b}return{comments:f,pragmas:s}}var L0=["noformat","noprettier"],j0=["format","prettier"];function f3(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(`
`);return t===-1?e:e.slice(0,t)}var J0=f3;function R0(e){let t=J0(e);t&&(e=e.slice(t.length+1));let a=O0(e),{pragmas:s,comments:f}=M0(a);return{shebang:t,text:e,pragmas:s,comments:f}}function U0(e){let{pragmas:t}=R0(e);return j0.some(a=>yd(t,a))}function B0(e){let{pragmas:t}=R0(e);return L0.some(a=>yd(t,a))}function d3(e){return e=typeof e=="function"?{parse:e}:e,{astFormat:"estree",hasPragma:U0,hasIgnorePragma:B0,locStart:Qt,locEnd:Kt,...e}}var q0=d3;var F0=/^[^"'`]*<\/|^[^/]{2}.*\/>/m;function m3(e){return e.charAt(0)==="#"&&e.charAt(1)==="!"?"//"+e.slice(2):e}var z0=m3;var V0="module",W0="commonjs",G0=[V0,W0];function Y0(e){if(typeof e=="string"){if(e=e.toLowerCase(),/\.(?:mjs|mts)$/i.test(e))return V0;if(/\.(?:cjs|cts)$/i.test(e))return W0}}var h3={loc:!0,range:!0,comment:!0,tokens:!1,loggerFn:!1,project:!1,jsDocParsingMode:"none",suppressDeprecatedPropertyWarnings:!0,onUnsupportedTypeScriptVersion:"ignore"};function y3(e){let{message:t,location:a}=e;if(!a)return e;let{start:s,end:f}=a;return u0(t,{loc:{start:{line:s.line,column:s.column+1},end:{line:f.line,column:f.column+1}},cause:e})}var g3=e=>e&&/\.(?:js|mjs|cjs|jsx|ts|mts|cts|tsx)$/i.test(e);function b3(e,t){let a=[{...h3,filePath:t}],s=Y0(t);if(s?a=a.map(h=>({...h,sourceType:s})):a=G0.flatMap(h=>a.map(b=>({...b,sourceType:h}))),g3(t))return a;let f=F0.test(e);return[f,!f].flatMap(h=>a.map(b=>({...b,jsx:h})))}function v3(e,t){let a=t?.filepath;typeof a!="string"&&(a=void 0);let s=z0(e),f=b3(e,a),h;try{h=p0(f.map(b=>()=>l0(s,b)))}catch({errors:[b]}){throw y3(b)}return P0(h,{text:e,astType:"typescript"})}var x3=q0(v3);return vy(T3);});
@@ -0,0 +1,76 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var index_exports = {};
__export(index_exports, {
canUseDOM: () => canUseDOM,
composeEventHandlers: () => composeEventHandlers,
getActiveElement: () => getActiveElement,
getOwnerDocument: () => getOwnerDocument,
getOwnerWindow: () => getOwnerWindow,
isFrame: () => isFrame
});
module.exports = __toCommonJS(index_exports);
// src/primitive.tsx
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
return function handleEvent(event) {
originalEventHandler?.(event);
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
return ourEventHandler?.(event);
}
};
}
function getOwnerWindow(element) {
if (!canUseDOM) {
throw new Error("Cannot access window outside of the DOM");
}
return element?.ownerDocument?.defaultView ?? window;
}
function getOwnerDocument(element) {
if (!canUseDOM) {
throw new Error("Cannot access document outside of the DOM");
}
return element?.ownerDocument ?? document;
}
function getActiveElement(node, activeDescendant = false) {
const { activeElement } = getOwnerDocument(node);
if (!activeElement?.nodeName) {
return null;
}
if (isFrame(activeElement) && activeElement.contentDocument) {
return getActiveElement(activeElement.contentDocument.body, activeDescendant);
}
if (activeDescendant) {
const id = activeElement.getAttribute("aria-activedescendant");
if (id) {
const element = getOwnerDocument(activeElement).getElementById(id);
if (element) {
return element;
}
}
}
return activeElement;
}
function isFrame(element) {
return element.tagName === "IFRAME";
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1,554 @@
/**
* @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const FixTracker = require("./utils/fix-tracker");
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------
/** @typedef {import("eslint-scope").Scope} Scope */
/** @typedef {import("eslint-scope").Variable} Variable */
/** @typedef {import("eslint-scope").Reference} Reference */
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const PATTERN_TYPE =
/^(?:.+?Pattern|RestElement|SpreadProperty|ExperimentalRestProperty|Property)$/u;
const DECLARATION_HOST_TYPE =
/^(?:Program|BlockStatement|StaticBlock|SwitchCase)$/u;
const DESTRUCTURING_HOST_TYPE =
/^(?:VariableDeclarator|AssignmentExpression)$/u;
/**
* Checks whether a given node is located at `ForStatement.init` or not.
* @param {ASTNode} node A node to check.
* @returns {boolean} `true` if the node is located at `ForStatement.init`.
*/
function isInitOfForStatement(node) {
return node.parent.type === "ForStatement" && node.parent.init === node;
}
/**
* Checks whether a given Identifier node becomes a VariableDeclaration or not.
* @param {ASTNode} identifier An Identifier node to check.
* @returns {boolean} `true` if the node can become a VariableDeclaration.
*/
function canBecomeVariableDeclaration(identifier) {
let node = identifier.parent;
while (PATTERN_TYPE.test(node.type)) {
node = node.parent;
}
return (
node.type === "VariableDeclarator" ||
(node.type === "AssignmentExpression" &&
node.parent.type === "ExpressionStatement" &&
DECLARATION_HOST_TYPE.test(node.parent.parent.type))
);
}
/**
* Checks if an property or element is from outer scope or function parameters
* in destructing pattern.
* @param {string} name A variable name to be checked.
* @param {Scope} initScope A scope to start find.
* @returns {boolean} Indicates if the variable is from outer scope or function parameters.
*/
function isOuterVariableInDestructing(name, initScope) {
if (
initScope.through.some(
ref => ref.resolved && ref.resolved.name === name,
)
) {
return true;
}
const variable = astUtils.getVariableByName(initScope, name);
if (variable !== null) {
return variable.defs.some(def => def.type === "Parameter");
}
return false;
}
/**
* Gets the VariableDeclarator/AssignmentExpression node that a given reference
* belongs to.
* This is used to detect a mix of reassigned and never reassigned in a
* destructuring.
* @param {Reference} reference A reference to get.
* @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or
* null.
*/
function getDestructuringHost(reference) {
if (!reference.isWrite()) {
return null;
}
let node = reference.identifier.parent;
while (PATTERN_TYPE.test(node.type)) {
node = node.parent;
}
if (!DESTRUCTURING_HOST_TYPE.test(node.type)) {
return null;
}
return node;
}
/**
* Determines if a destructuring assignment node contains
* any MemberExpression nodes. This is used to determine if a
* variable that is only written once using destructuring can be
* safely converted into a const declaration.
* @param {ASTNode} node The ObjectPattern or ArrayPattern node to check.
* @returns {boolean} True if the destructuring pattern contains
* a MemberExpression, false if not.
*/
function hasMemberExpressionAssignment(node) {
switch (node.type) {
case "ObjectPattern":
return node.properties.some(prop => {
if (prop) {
/*
* Spread elements have an argument property while
* others have a value property. Because different
* parsers use different node types for spread elements,
* we just check if there is an argument property.
*/
return hasMemberExpressionAssignment(
prop.argument || prop.value,
);
}
return false;
});
case "ArrayPattern":
return node.elements.some(element => {
if (element) {
return hasMemberExpressionAssignment(element);
}
return false;
});
case "AssignmentPattern":
return hasMemberExpressionAssignment(node.left);
case "MemberExpression":
return true;
// no default
}
return false;
}
/**
* Gets an identifier node of a given variable.
*
* If the initialization exists or one or more reading references exist before
* the first assignment, the identifier node is the node of the declaration.
* Otherwise, the identifier node is the node of the first assignment.
*
* If the variable should not change to const, this function returns null.
* - If the variable is reassigned.
* - If the variable is never initialized nor assigned.
* - If the variable is initialized in a different scope from the declaration.
* - If the unique assignment of the variable cannot change to a declaration.
* e.g. `if (a) b = 1` / `return (b = 1)`
* - If the variable is declared in the global scope and `eslintUsed` is `true`.
* `/*exported foo` directive comment makes such variables. This rule does not
* warn such variables because this rule cannot distinguish whether the
* exported variables are reassigned or not.
* @param {Variable} variable A variable to get.
* @param {boolean} ignoreReadBeforeAssign
* The value of `ignoreReadBeforeAssign` option.
* @returns {ASTNode|null}
* An Identifier node if the variable should change to const.
* Otherwise, null.
*/
function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) {
if (variable.eslintUsed && variable.scope.type === "global") {
return null;
}
// Finds the unique WriteReference.
let writer = null;
let isReadBeforeInit = false;
const references = variable.references;
for (let i = 0; i < references.length; ++i) {
const reference = references[i];
if (reference.isWrite()) {
const isReassigned =
writer !== null && writer.identifier !== reference.identifier;
if (isReassigned) {
return null;
}
const destructuringHost = getDestructuringHost(reference);
if (
destructuringHost !== null &&
destructuringHost.left !== void 0
) {
const leftNode = destructuringHost.left;
let hasOuterVariables = false,
hasNonIdentifiers = false;
if (leftNode.type === "ObjectPattern") {
const properties = leftNode.properties;
hasOuterVariables = properties
.filter(prop => prop.value)
.map(prop => prop.value.name)
.some(name =>
isOuterVariableInDestructing(name, variable.scope),
);
hasNonIdentifiers = hasMemberExpressionAssignment(leftNode);
} else if (leftNode.type === "ArrayPattern") {
const elements = leftNode.elements;
hasOuterVariables = elements
.map(element => element && element.name)
.some(name =>
isOuterVariableInDestructing(name, variable.scope),
);
hasNonIdentifiers = hasMemberExpressionAssignment(leftNode);
}
if (hasOuterVariables || hasNonIdentifiers) {
return null;
}
}
writer = reference;
} else if (reference.isRead() && writer === null) {
if (ignoreReadBeforeAssign) {
return null;
}
isReadBeforeInit = true;
}
}
/*
* If the assignment is from a different scope, ignore it.
* If the assignment cannot change to a declaration, ignore it.
*/
const shouldBeConst =
writer !== null &&
writer.from === variable.scope &&
canBecomeVariableDeclaration(writer.identifier);
if (!shouldBeConst) {
return null;
}
if (isReadBeforeInit) {
return variable.defs[0].name;
}
return writer.identifier;
}
/**
* Groups by the VariableDeclarator/AssignmentExpression node that each
* reference of given variables belongs to.
* This is used to detect a mix of reassigned and never reassigned in a
* destructuring.
* @param {Variable[]} variables Variables to group by destructuring.
* @param {boolean} ignoreReadBeforeAssign
* The value of `ignoreReadBeforeAssign` option.
* @returns {Map<ASTNode, ASTNode[]>} Grouped identifier nodes.
*/
function groupByDestructuring(variables, ignoreReadBeforeAssign) {
const identifierMap = new Map();
for (let i = 0; i < variables.length; ++i) {
const variable = variables[i];
const references = variable.references;
const identifier = getIdentifierIfShouldBeConst(
variable,
ignoreReadBeforeAssign,
);
let prevId = null;
for (let j = 0; j < references.length; ++j) {
const reference = references[j];
const id = reference.identifier;
/*
* Avoid counting a reference twice or more for default values of
* destructuring.
*/
if (id === prevId) {
continue;
}
prevId = id;
// Add the identifier node into the destructuring group.
const group = getDestructuringHost(reference);
if (group) {
if (identifierMap.has(group)) {
identifierMap.get(group).push(identifier);
} else {
identifierMap.set(group, [identifier]);
}
}
}
}
return identifierMap;
}
/**
* Finds the nearest parent of node with a given type.
* @param {ASTNode} node The node to search from.
* @param {string} type The type field of the parent node.
* @param {Function} shouldStop A predicate that returns true if the traversal should stop, and false otherwise.
* @returns {ASTNode} The closest ancestor with the specified type; null if no such ancestor exists.
*/
function findUp(node, type, shouldStop) {
if (!node || shouldStop(node)) {
return null;
}
if (node.type === type) {
return node;
}
return findUp(node.parent, type, shouldStop);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
destructuring: "any",
ignoreReadBeforeAssign: false,
},
],
docs: {
description:
"Require `const` declarations for variables that are never reassigned after declared",
recommended: false,
url: "https://eslint.org/docs/latest/rules/prefer-const",
},
fixable: "code",
schema: [
{
type: "object",
properties: {
destructuring: { enum: ["any", "all"] },
ignoreReadBeforeAssign: { type: "boolean" },
},
additionalProperties: false,
},
],
messages: {
useConst: "'{{name}}' is never reassigned. Use 'const' instead.",
},
},
create(context) {
const [{ destructuring, ignoreReadBeforeAssign }] = context.options;
const shouldMatchAnyDestructuredVariable = destructuring !== "all";
const sourceCode = context.sourceCode;
const variables = [];
let reportCount = 0;
let checkedId = null;
let checkedName = "";
/**
* Reports given identifier nodes if all of the nodes should be declared
* as const.
*
* The argument 'nodes' is an array of Identifier nodes.
* This node is the result of 'getIdentifierIfShouldBeConst()', so it's
* nullable. In simple declaration or assignment cases, the length of
* the array is 1. In destructuring cases, the length of the array can
* be 2 or more.
* @param {(Reference|null)[]} nodes
* References which are grouped by destructuring to report.
* @returns {void}
*/
function checkGroup(nodes) {
const nodesToReport = nodes.filter(Boolean);
if (
nodes.length &&
(shouldMatchAnyDestructuredVariable ||
nodesToReport.length === nodes.length)
) {
const varDeclParent = findUp(
nodes[0],
"VariableDeclaration",
parentNode => parentNode.type.endsWith("Statement"),
);
const isVarDecParentNull = varDeclParent === null;
if (
!isVarDecParentNull &&
varDeclParent.declarations.length > 0
) {
const firstDeclaration = varDeclParent.declarations[0];
if (firstDeclaration.init) {
const firstDecParent = firstDeclaration.init.parent;
/*
* First we check the declaration type and then depending on
* if the type is a "VariableDeclarator" or its an "ObjectPattern"
* we compare the name and id from the first identifier, if the names are different
* we assign the new name, id and reset the count of reportCount and nodeCount in
* order to check each block for the number of reported errors and base our fix
* based on comparing nodes.length and nodesToReport.length.
*/
if (firstDecParent.type === "VariableDeclarator") {
if (firstDecParent.id.name !== checkedName) {
checkedName = firstDecParent.id.name;
reportCount = 0;
}
if (firstDecParent.id.type === "ObjectPattern") {
if (firstDecParent.init.name !== checkedName) {
checkedName = firstDecParent.init.name;
reportCount = 0;
}
}
if (firstDecParent.id !== checkedId) {
checkedId = firstDecParent.id;
reportCount = 0;
}
}
}
}
let shouldFix =
varDeclParent &&
// Don't do a fix unless all variables in the declarations are initialized (or it's in a for-in or for-of loop)
(varDeclParent.parent.type === "ForInStatement" ||
varDeclParent.parent.type === "ForOfStatement" ||
varDeclParent.declarations.every(
declaration => declaration.init,
)) &&
/*
* If options.destructuring is "all", then this warning will not occur unless
* every assignment in the destructuring should be const. In that case, it's safe
* to apply the fix.
*/
nodesToReport.length === nodes.length;
if (
!isVarDecParentNull &&
varDeclParent.declarations &&
varDeclParent.declarations.length !== 1
) {
if (
varDeclParent &&
varDeclParent.declarations &&
varDeclParent.declarations.length >= 1
) {
/*
* Add nodesToReport.length to a count, then comparing the count to the length
* of the declarations in the current block.
*/
reportCount += nodesToReport.length;
let totalDeclarationsCount = 0;
varDeclParent.declarations.forEach(declaration => {
if (declaration.id.type === "ObjectPattern") {
totalDeclarationsCount +=
declaration.id.properties.length;
} else if (declaration.id.type === "ArrayPattern") {
totalDeclarationsCount +=
declaration.id.elements.length;
} else {
totalDeclarationsCount += 1;
}
});
shouldFix =
shouldFix && reportCount === totalDeclarationsCount;
}
}
nodesToReport.forEach(node => {
context.report({
node,
messageId: "useConst",
data: node,
fix: shouldFix
? fixer => {
const letKeywordToken =
sourceCode.getFirstToken(
varDeclParent,
t => t.value === varDeclParent.kind,
);
/**
* Extend the replacement range to the whole declaration,
* in order to prevent other fixes in the same pass
* https://github.com/eslint/eslint/issues/13899
*/
return new FixTracker(fixer, sourceCode)
.retainRange(varDeclParent.range)
.replaceTextRange(
letKeywordToken.range,
"const",
);
}
: null,
});
});
}
}
return {
"Program:exit"() {
groupByDestructuring(variables, ignoreReadBeforeAssign).forEach(
checkGroup,
);
},
VariableDeclaration(node) {
if (node.kind === "let" && !isInitOfForStatement(node)) {
variables.push(...sourceCode.getDeclaredVariables(node));
}
},
};
},
};
@@ -0,0 +1,29 @@
import { Feature, hover, frame } from 'motion-dom';
import { extractEventInfo } from '../events/event-info.mjs';
function handleHoverEvent(node, event, lifecycle) {
const { props } = node;
if (node.animationState && props.whileHover) {
node.animationState.setActive("whileHover", lifecycle === "Start");
}
const eventName = ("onHover" + lifecycle);
const callback = props[eventName];
if (callback) {
frame.postRender(() => callback(event, extractEventInfo(event)));
}
}
class HoverGesture extends Feature {
mount() {
const { current } = this.node;
if (!current)
return;
this.unmount = hover(current, (_element, startEvent) => {
handleHoverEvent(this.node, startEvent, "Start");
return (endEvent) => handleHoverEvent(this.node, endEvent, "End");
});
}
unmount() { }
}
export { HoverGesture };
//# sourceMappingURL=hover.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"layout.mjs","sources":["../../../../src/motion/features/layout.ts"],"sourcesContent":["import { HTMLProjectionNode } from \"motion-dom\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const layout: FeaturePackages = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,MAAM,GAAoB;AACnC,IAAA,MAAM,EAAE;AACJ,QAAA,cAAc,EAAE,kBAAkB;QAClC,aAAa;AAChB,KAAA;;;;;"}
@@ -0,0 +1,22 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _keywords = require('../parser/tokenizer/keywords');
var _types = require('../parser/tokenizer/types');
/**
* Starting at a potential `with` or (legacy) `assert` token, remove the import
* attributes if they exist.
*/
function removeMaybeImportAttributes(tokens) {
if (
tokens.matches2(_types.TokenType._with, _types.TokenType.braceL) ||
(tokens.matches2(_types.TokenType.name, _types.TokenType.braceL) && tokens.matchesContextual(_keywords.ContextualKeyword._assert))
) {
// assert
tokens.removeToken();
// {
tokens.removeToken();
tokens.removeBalancedCode();
// }
tokens.removeToken();
}
} exports.removeMaybeImportAttributes = removeMaybeImportAttributes;
@@ -0,0 +1,34 @@
import { JsonSchema7AnyType } from "./parsers/any.js";
import { JsonSchema7ArrayType } from "./parsers/array.js";
import { JsonSchema7BigintType } from "./parsers/bigint.js";
import { JsonSchema7BooleanType } from "./parsers/boolean.js";
import { JsonSchema7DateType } from "./parsers/date.js";
import { JsonSchema7EnumType } from "./parsers/enum.js";
import { JsonSchema7AllOfType } from "./parsers/intersection.js";
import { JsonSchema7LiteralType } from "./parsers/literal.js";
import { JsonSchema7MapType } from "./parsers/map.js";
import { JsonSchema7NativeEnumType } from "./parsers/nativeEnum.js";
import { JsonSchema7NeverType } from "./parsers/never.js";
import { JsonSchema7NullType } from "./parsers/null.js";
import { JsonSchema7NullableType } from "./parsers/nullable.js";
import { JsonSchema7NumberType } from "./parsers/number.js";
import { JsonSchema7ObjectType } from "./parsers/object.js";
import { JsonSchema7RecordType } from "./parsers/record.js";
import { JsonSchema7SetType } from "./parsers/set.js";
import { JsonSchema7StringType } from "./parsers/string.js";
import { JsonSchema7TupleType } from "./parsers/tuple.js";
import { JsonSchema7UndefinedType } from "./parsers/undefined.js";
import { JsonSchema7UnionType } from "./parsers/union.js";
import { JsonSchema7UnknownType } from "./parsers/unknown.js";
type JsonSchema7RefType = {
$ref: string;
};
type JsonSchema7Meta = {
title?: string;
default?: any;
description?: string;
markdownDescription?: string;
};
export type JsonSchema7TypeUnion = JsonSchema7StringType | JsonSchema7ArrayType | JsonSchema7NumberType | JsonSchema7BigintType | JsonSchema7BooleanType | JsonSchema7DateType | JsonSchema7EnumType | JsonSchema7LiteralType | JsonSchema7NativeEnumType | JsonSchema7NullType | JsonSchema7NumberType | JsonSchema7ObjectType | JsonSchema7RecordType | JsonSchema7TupleType | JsonSchema7UnionType | JsonSchema7UndefinedType | JsonSchema7RefType | JsonSchema7NeverType | JsonSchema7MapType | JsonSchema7AnyType | JsonSchema7NullableType | JsonSchema7AllOfType | JsonSchema7UnknownType | JsonSchema7SetType;
export type JsonSchema7Type = JsonSchema7TypeUnion & JsonSchema7Meta;
export {};