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

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

No files matched your search

@@ -0,0 +1,243 @@
"use strict";
// Claude-authored implementation of RFC 6570 URI Templates
Object.defineProperty(exports, "__esModule", { value: true });
exports.UriTemplate = void 0;
const MAX_TEMPLATE_LENGTH = 1000000; // 1MB
const MAX_VARIABLE_LENGTH = 1000000; // 1MB
const MAX_TEMPLATE_EXPRESSIONS = 10000;
const MAX_REGEX_LENGTH = 1000000; // 1MB
class UriTemplate {
/**
* Returns true if the given string contains any URI template expressions.
* A template expression is a sequence of characters enclosed in curly braces,
* like {foo} or {?bar}.
*/
static isTemplate(str) {
// Look for any sequence of characters between curly braces
// that isn't just whitespace
return /\{[^}\s]+\}/.test(str);
}
static validateLength(str, max, context) {
if (str.length > max) {
throw new Error(`${context} exceeds maximum length of ${max} characters (got ${str.length})`);
}
}
get variableNames() {
return this.parts.flatMap(part => (typeof part === 'string' ? [] : part.names));
}
constructor(template) {
UriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, 'Template');
this.template = template;
this.parts = this.parse(template);
}
toString() {
return this.template;
}
parse(template) {
const parts = [];
let currentText = '';
let i = 0;
let expressionCount = 0;
while (i < template.length) {
if (template[i] === '{') {
if (currentText) {
parts.push(currentText);
currentText = '';
}
const end = template.indexOf('}', i);
if (end === -1)
throw new Error('Unclosed template expression');
expressionCount++;
if (expressionCount > MAX_TEMPLATE_EXPRESSIONS) {
throw new Error(`Template contains too many expressions (max ${MAX_TEMPLATE_EXPRESSIONS})`);
}
const expr = template.slice(i + 1, end);
const operator = this.getOperator(expr);
const exploded = expr.includes('*');
const names = this.getNames(expr);
const name = names[0];
// Validate variable name length
for (const name of names) {
UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name');
}
parts.push({ name, operator, names, exploded });
i = end + 1;
}
else {
currentText += template[i];
i++;
}
}
if (currentText) {
parts.push(currentText);
}
return parts;
}
getOperator(expr) {
const operators = ['+', '#', '.', '/', '?', '&'];
return operators.find(op => expr.startsWith(op)) || '';
}
getNames(expr) {
const operator = this.getOperator(expr);
return expr
.slice(operator.length)
.split(',')
.map(name => name.replace('*', '').trim())
.filter(name => name.length > 0);
}
encodeValue(value, operator) {
UriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, 'Variable value');
if (operator === '+' || operator === '#') {
return encodeURI(value);
}
return encodeURIComponent(value);
}
expandPart(part, variables) {
if (part.operator === '?' || part.operator === '&') {
const pairs = part.names
.map(name => {
const value = variables[name];
if (value === undefined)
return '';
const encoded = Array.isArray(value)
? value.map(v => this.encodeValue(v, part.operator)).join(',')
: this.encodeValue(value.toString(), part.operator);
return `${name}=${encoded}`;
})
.filter(pair => pair.length > 0);
if (pairs.length === 0)
return '';
const separator = part.operator === '?' ? '?' : '&';
return separator + pairs.join('&');
}
if (part.names.length > 1) {
const values = part.names.map(name => variables[name]).filter(v => v !== undefined);
if (values.length === 0)
return '';
return values.map(v => (Array.isArray(v) ? v[0] : v)).join(',');
}
const value = variables[part.name];
if (value === undefined)
return '';
const values = Array.isArray(value) ? value : [value];
const encoded = values.map(v => this.encodeValue(v, part.operator));
switch (part.operator) {
case '':
return encoded.join(',');
case '+':
return encoded.join(',');
case '#':
return '#' + encoded.join(',');
case '.':
return '.' + encoded.join('.');
case '/':
return '/' + encoded.join('/');
default:
return encoded.join(',');
}
}
expand(variables) {
let result = '';
let hasQueryParam = false;
for (const part of this.parts) {
if (typeof part === 'string') {
result += part;
continue;
}
const expanded = this.expandPart(part, variables);
if (!expanded)
continue;
// Convert ? to & if we already have a query parameter
if ((part.operator === '?' || part.operator === '&') && hasQueryParam) {
result += expanded.replace('?', '&');
}
else {
result += expanded;
}
if (part.operator === '?' || part.operator === '&') {
hasQueryParam = true;
}
}
return result;
}
escapeRegExp(str) {
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
partToRegExp(part) {
const patterns = [];
// Validate variable name length for matching
for (const name of part.names) {
UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name');
}
if (part.operator === '?' || part.operator === '&') {
for (let i = 0; i < part.names.length; i++) {
const name = part.names[i];
const prefix = i === 0 ? '\\' + part.operator : '&';
patterns.push({
pattern: prefix + this.escapeRegExp(name) + '=([^&]+)',
name
});
}
return patterns;
}
let pattern;
const name = part.name;
switch (part.operator) {
case '':
pattern = part.exploded ? '([^/,]+(?:,[^/,]+)*)' : '([^/,]+)';
break;
case '+':
case '#':
pattern = '(.+)';
break;
case '.':
pattern = '\\.([^/,]+)';
break;
case '/':
pattern = '/' + (part.exploded ? '([^/,]+(?:,[^/,]+)*)' : '([^/,]+)');
break;
default:
pattern = '([^/]+)';
}
patterns.push({ pattern, name });
return patterns;
}
match(uri) {
UriTemplate.validateLength(uri, MAX_TEMPLATE_LENGTH, 'URI');
let pattern = '^';
const names = [];
for (const part of this.parts) {
if (typeof part === 'string') {
pattern += this.escapeRegExp(part);
}
else {
const patterns = this.partToRegExp(part);
for (const { pattern: partPattern, name } of patterns) {
pattern += partPattern;
names.push({ name, exploded: part.exploded });
}
}
}
pattern += '$';
UriTemplate.validateLength(pattern, MAX_REGEX_LENGTH, 'Generated regex pattern');
const regex = new RegExp(pattern);
const match = uri.match(regex);
if (!match)
return null;
const result = {};
for (let i = 0; i < names.length; i++) {
const { name, exploded } = names[i];
const value = match[i + 1];
const cleanName = name.replace('*', '');
if (exploded && value.includes(',')) {
result[cleanName] = value.split(',');
}
else {
result[cleanName] = value;
}
}
return result;
}
}
exports.UriTemplate = UriTemplate;
//# sourceMappingURL=uriTemplate.js.map
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const BookmarkCheck = createLucideIcon("BookmarkCheck", [
["path", { d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2Z", key: "169p4p" }],
["path", { d: "m9 10 2 2 4-4", key: "1gnqz4" }]
]);
export { BookmarkCheck as default };
//# sourceMappingURL=bookmark-check.js.map
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/presence.tsx", "../src/use-state-machine.tsx"],
"sourcesContent": ["'use client';\nexport { Presence, Root } from './presence';\nexport type { PresenceProps } from './presence';\n", "import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './use-state-machine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC<PresenceProps> = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref<HTMLElement> }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState<HTMLElement>();\n const stylesRef = React.useRef<CSSStyleDeclaration | null>(null);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef<string>('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n // The event.animationName is unescaped for CSS syntax,\n // so we need to escape it to compare with the animationName computed from the style.\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https:Line truncated
"mappings": ";;;;;;;;;;;;;;;;;;;;;;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C5D,WAAK,iBAAiB,mBAAmB,kBAAkB;AAC3D,WAAK,iBAAiB,gBAAgB,kBAAkB;AACxD,aAAO,MAAM;AACX,oBAAY,aAAa,SAAS;AAClC,aAAK,oBAAoB,kBAAkB,oBAAoB;AAC/D,aAAK,oBAAoB,mBAAmB,kBAAkB;AAC9D,aAAK,oBAAoB,gBAAgB,kBAAkB;AAAA,MAC7D;AAAA,IACF,OAAO;AAGL,WAAK,eAAe;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,MAAM,IAAI,CAAC;AAEf,SAAO;AAAA,IACL,WAAW,CAAC,WAAW,kBAAkB,EAAE,SAAS,KAAK;AAAA,IACzD,KAAW,mBAAY,CAACC,UAAsB;AAC5C,gBAAU,UAAUA,QAAO,iBAAiBA,KAAI,IAAI;AACpD,cAAQA,KAAI;AAAA,IACd,GAAG,CAAC,CAAC;AAAA,EACP;AACF;AAIA,SAAS,iBAAiB,QAAoC;AAC5D,SAAO,QAAQ,iBAAiB;AAClC;AAOA,SAAS,cAAc,SAA2D;AAEhF,MAAI,SAAS,OAAO,yBAAyB,QAAQ,OAAO,KAAK,GAAG;AACpE,MAAI,UAAU,UAAU,oBAAoB,UAAU,OAAO;AAC7D,MAAI,SAAS;AACX,WAAQ,QAAgB;AAAA,EAC1B;AAGA,WAAS,OAAO,yBAAyB,SAAS,KAAK,GAAG;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAO,QAAQ,MAAM;AAAA,EACvB;AAGA,SAAO,QAAQ,MAAM,OAAQ,QAAgB;AAC/C;AAEA,IAAM,OAAO;",
"names": ["React", "node"]
}
@@ -0,0 +1,28 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2024 = void 0;
const es2023_1 = require("./es2023");
const es2024_arraybuffer_1 = require("./es2024.arraybuffer");
const es2024_collection_1 = require("./es2024.collection");
const es2024_object_1 = require("./es2024.object");
const es2024_promise_1 = require("./es2024.promise");
const es2024_regexp_1 = require("./es2024.regexp");
const es2024_sharedmemory_1 = require("./es2024.sharedmemory");
const es2024_string_1 = require("./es2024.string");
exports.es2024 = {
libs: [
es2023_1.es2023,
es2024_arraybuffer_1.es2024_arraybuffer,
es2024_collection_1.es2024_collection,
es2024_object_1.es2024_object,
es2024_promise_1.es2024_promise,
es2024_regexp_1.es2024_regexp,
es2024_sharedmemory_1.es2024_sharedmemory,
es2024_string_1.es2024_string,
],
variables: [],
};
@@ -0,0 +1,24 @@
Copyright (c) 2013, Joel Feenstra
All rights reserved.
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.
* Neither the name of the ESQuery nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
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 JOEL FEENSTRA 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 @@
{"version":3,"names":["_shallowEqual","require","_deprecationWarning","isArrayExpression","node","opts","type","shallowEqual","isAssignmentExpression","isBinaryExpression","isInterpreterDirective","isDirective","isDirectiveLiteral","isBlockStatement","isBreakStatement","isCallExpression","isCatchClause","isConditionalExpression","isContinueStatement","isDebuggerStatement","isDoWhileStatement","isEmptyStatement","isExpressionStatement","isFile","isForInStatement","isForStatement","isFunctionDeclaration","isFunctionExpression","isIdentifier","isIfStatement","isLabeledStatement","isStringLiteral","isNumericLiteral","isNullLiteral","isBooleanLiteral","isRegExpLiteral","isLogicalExpression","isMemberExpression","isNewExpression","isProgram","isObjectExpression","isObjectMethod","isObjectProperty","isRestElement","isReturnStatement","isSequenceExpression","isParenthesizedExpression","isSwitchCase","isSwitchStatement","isThisExpression","isThrowStatement","isTryStatement","isUnaryExpression","isUpdateExpression","isVariableDeclaration","isVariableDeclarator","isWhileStatement","isWithStatement","isAssignmentPattern","isArrayPattern","isArrowFunctionExpression","isClassBody","isClassExpression","isClassDeclaration","isExportAllDeclaration","isExportDefaultDeclaration","isExportNamedDeclaration","isExportSpecifier","isForOfStatement","isImportDeclaration","isImportDefaultSpecifier","isImportNamespaceSpecifier","isImportSpecifier","isImportExpression","isMetaProperty","isClassMethod","isObjectPattern","isSpreadElement","isSuper","isTaggedTemplateExpression","isTemplateElement","isTemplateLiteral","isYieldExpression","isAwaitExpression","isImport","isBigIntLiteral","isExportNamespaceSpecifier","isOptionalMemberExpression","isOptionalCallExpression","isClassProperty","isClassAccessorProperty","isClassPrivateProperty","isClassPrivateMethod","isPrivateName","isStaticBlock","isImportAttribute","isAnyTypeAnnotation","isArrayTypeAnnotation","isBooleanTypeAnnotation","isBooleanLiteralTypeAnnotation","isNullLiteralTypeAnnotation","isClassImplements","isDeclareClass","isDeclareFunction","isDeclareInterface","isDeclareModule","isDeclareModuleExports","isDeclareTypeAlias","isDeclareOpaqueType","isDeclareVariable","isDeclareExportDeclaration","isDeclareExportAllDeclaration","isDeclaredPredicate","isExistsTypeAnnotation","isFunctionTypeAnnotation","isFunctionTypeParam","isGenericTypeAnnotation","isInferredPredicate","isInterfaceExtends","isInterfaceDeclaration","isInterfaceTypeAnnotation","isIntersectionTypeAnnotation","isMixedTypeAnnotation","isEmptyTypeAnnotation","isNullableTypeAnnotation","isNumberLiteralTypeAnnotation","isNumberTypeAnnotation","isObjectTypeAnnotation","isObjectTypeInternalSlot","isObjectTypeCallProperty","isObjectTypeIndexer","isObjectTypeProperty","isObjectTypeSpreadProperty","isOpaqueType","isQualifiedTypeIdentifier","isStringLiteralTypeAnnotation","isStringTypeAnnotation","isSymbolTypeAnnotation","isThisTypeAnnotation","isTupleTypeAnnotation","isTypeofTypeAnnotation","isTypeAlias","isTypeAnnotation","isTypeCastExpression","isTypeParameter","isTypeParameterDeclaration","isTypeParameterInstantiation","isUnionTypeAnnotation","isVariance","isVoidTypeAnnotation","isEnumDeclaration","isEnumBooleanBody","isEnumNumberBody","isEnumStringBody","isEnumSymbolBody","isEnumBooleanMember","isEnumNumberMember","isEnumStringMember","isEnumDefaultedMember","isIndexedAccessType","isOptionalIndexedAccessType","isJSXAttribute","isJSXClosingElement","isJSXElement","isJSXEmptyExpression","isJSXExpressionContainer","isJSXSpreadChild","isJSXIdentifier","isJSXMemberExpression","isJSXNamespacedName","isJSXOpeningElement","isJSXSpreadAttribute","isJSXText","isJSXFragment","isJSXOpeningFragment","isJSXClosingFragment","isNoop","isPlaceholder","isV8IntrinsicIdentifier","isArgumentPlaceholder","isBindExpression","isDecorator","isDoExpression","isExportDefaultSpecifier","isRecordExpression","isTupleExpression","isDecimalLiteral","isModuleExpression","isTopicReference","isPipelineTopicExpression","isPipelineBareFunction","isPipelinePrimaryTopicReference","isVoidPattern","isTSParameterProperty","isTSDeclareFunction","isTSDeclareMethod","isTSQualifiedName","isTSCallSignatureDeclaration","isTSConstructSignatureDeclaration","isTSPropertySignature","isTSMethodSignature","isTSIndexSignature","isTSAnyKeyword","isTSBooleanKeyword","isTSBigIntKeyword","isTSIntrinsicKeyword","isTSNeverKeyword","isTSNullKeyword","isTSNumberKeyword","isTSObjectKeyword","isTSStringKeyword","isTSSymbolKeyword","isTSUndefinedKeyword","isTSUnknownKeyword","isTSVoidKeyword","isTSThisType","isTSFunctionType","isTSConstructorType","isTSTypeReference","isTSTypePredicate","isTSTypeQuery","isTSTypeLiteral","isTSArrayType","isTSTupleType","isTSOptionalType","isTSRestType","isTSNamedTupleMember","isTSUnionType","isTSIntersectionType","isTSConditionalType","isTSInferType","isTSParenthesizedType","isTSTypeOperator","isTSIndexedAccessType","isTSMappedType","isTSTemplateLiteralTypeLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"lectern.js","sources":["../../../src/icons/lectern.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Lectern\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgMTJoM2EyIDIgMCAwIDAgMS45MDItMS4zOGwxLjA1Ni0zLjMzM0ExIDEgMCAwIDAgMjEgNkgzYTEgMSAwIDAgMC0uOTU4IDEuMjg3bDEuMDU2IDMuMzM0QTIgMiAwIDAgMCA1IDEyaDMiIC8+CiAgPHBhdGggZD0iTTE4IDZWM2ExIDEgMCAwIDAtMS0xaC0zIiAvPgogIDxyZWN0IHdpZHRoPSI4IiBoZWlnaHQ9IjEyIiB4PSI4IiB5PSIxMCIgcng9IjEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/lectern\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 Lectern = createLucideIcon('Lectern', [\n [\n 'path',\n {\n d: 'M16 12h3a2 2 0 0 0 1.902-1.38l1.056-3.333A1 1 0 0 0 21 6H3a1 1 0 0 0-.958 1.287l1.056 3.334A2 2 0 0 0 5 12h3',\n key: '13jjxg',\n },\n ],\n ['path', { d: 'M18 6V3a1 1 0 0 0-1-1h-3', key: '1550fe' }],\n ['rect', { width: '8', height: '12', x: '8', y: '10', rx: '1', key: 'qmu8b6' }],\n]);\n\nexport default Lectern;\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;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"feedback.cjs","sources":["../../../src/matcher/bruteforce/feedback.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA,wBAAe,MAAK;AAClB,EAAA,OAAO,IAAI;AACb,CAAC;;;;"}
@@ -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 SquareKanban = createLucideIcon("SquareKanban", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M8 7v7", key: "1x2jlm" }],
["path", { d: "M12 7v4", key: "xawao1" }],
["path", { d: "M16 7v9", key: "1hp2iy" }]
]);
export { SquareKanban as default };
//# sourceMappingURL=square-kanban.js.map
@@ -0,0 +1,2 @@
import { n as AjvJsonSchemaValidator, r as addFormats, t as Ajv } from "../ajvProvider-INpkxUi1.mjs";
export { Ajv, AjvJsonSchemaValidator, addFormats };
@@ -0,0 +1,107 @@
import { JOSENotSupported } from '../util/errors.js';
const unsupportedAlg = 'Invalid or unsupported JWK "alg" (Algorithm) Parameter value';
function subtleMapping(jwk) {
let algorithm;
let keyUsages;
switch (jwk.kty) {
case 'AKP': {
switch (jwk.alg) {
case 'ML-DSA-44':
case 'ML-DSA-65':
case 'ML-DSA-87':
algorithm = { name: jwk.alg };
keyUsages = jwk.priv ? ['sign'] : ['verify'];
break;
default:
throw new JOSENotSupported(unsupportedAlg);
}
break;
}
case 'RSA': {
switch (jwk.alg) {
case 'PS256':
case 'PS384':
case 'PS512':
algorithm = { name: 'RSA-PSS', hash: `SHA-${jwk.alg.slice(-3)}` };
keyUsages = jwk.d ? ['sign'] : ['verify'];
break;
case 'RS256':
case 'RS384':
case 'RS512':
algorithm = { name: 'RSASSA-PKCS1-v1_5', hash: `SHA-${jwk.alg.slice(-3)}` };
keyUsages = jwk.d ? ['sign'] : ['verify'];
break;
case 'RSA-OAEP':
case 'RSA-OAEP-256':
case 'RSA-OAEP-384':
case 'RSA-OAEP-512':
algorithm = {
name: 'RSA-OAEP',
hash: `SHA-${parseInt(jwk.alg.slice(-3), 10) || 1}`,
};
keyUsages = jwk.d ? ['decrypt', 'unwrapKey'] : ['encrypt', 'wrapKey'];
break;
default:
throw new JOSENotSupported(unsupportedAlg);
}
break;
}
case 'EC': {
switch (jwk.alg) {
case 'ES256':
case 'ES384':
case 'ES512':
algorithm = {
name: 'ECDSA',
namedCurve: { ES256: 'P-256', ES384: 'P-384', ES512: 'P-521' }[jwk.alg],
};
keyUsages = jwk.d ? ['sign'] : ['verify'];
break;
case 'ECDH-ES':
case 'ECDH-ES+A128KW':
case 'ECDH-ES+A192KW':
case 'ECDH-ES+A256KW':
algorithm = { name: 'ECDH', namedCurve: jwk.crv };
keyUsages = jwk.d ? ['deriveBits'] : [];
break;
default:
throw new JOSENotSupported(unsupportedAlg);
}
break;
}
case 'OKP': {
switch (jwk.alg) {
case 'Ed25519':
case 'EdDSA':
algorithm = { name: 'Ed25519' };
keyUsages = jwk.d ? ['sign'] : ['verify'];
break;
case 'ECDH-ES':
case 'ECDH-ES+A128KW':
case 'ECDH-ES+A192KW':
case 'ECDH-ES+A256KW':
algorithm = { name: jwk.crv };
keyUsages = jwk.d ? ['deriveBits'] : [];
break;
default:
throw new JOSENotSupported(unsupportedAlg);
}
break;
}
default:
throw new JOSENotSupported('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
}
return { algorithm, keyUsages };
}
export async function jwkToKey(jwk) {
if (!jwk.alg) {
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
}
const { algorithm, keyUsages } = subtleMapping(jwk);
const keyData = { ...jwk };
if (keyData.kty !== 'AKP') {
delete keyData.alg;
}
delete keyData.use;
return crypto.subtle.importKey('jwk', keyData, algorithm, jwk.ext ?? (jwk.d || jwk.priv ? false : true), jwk.key_ops ?? keyUsages);
}
@@ -0,0 +1,15 @@
var inspect = require('../../');
var test = require('tape');
test('dom element', function (t) {
t.plan(1);
var d = document.createElement('div');
d.setAttribute('id', 'beep');
d.innerHTML = '<b>wooo</b><i>iiiii</i>';
t.equal(
inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]),
'[ <div id="beep">...</div>, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [Object] ] ] ] } ]'
);
});
@@ -0,0 +1,34 @@
import { SyncWalker } from './sync.js';
import { AsyncWalker } from './async.js';
/**
* @typedef {import('estree').Node} Node
* @typedef {import('./sync.js').SyncHandler} SyncHandler
* @typedef {import('./async.js').AsyncHandler} AsyncHandler
*/
/**
* @param {Node} ast
* @param {{
* enter?: SyncHandler
* leave?: SyncHandler
* }} walker
* @returns {Node | null}
*/
export function walk(ast, { enter, leave }) {
const instance = new SyncWalker(enter, leave);
return instance.visit(ast, null);
}
/**
* @param {Node} ast
* @param {{
* enter?: AsyncHandler
* leave?: AsyncHandler
* }} walker
* @returns {Promise<Node | null>}
*/
export async function asyncWalk(ast, { enter, leave }) {
const instance = new AsyncWalker(enter, leave);
return await instance.visit(ast, null);
}
@@ -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 BetweenHorizontalEnd = createLucideIcon("BetweenHorizontalEnd", [
["rect", { width: "13", height: "7", x: "3", y: "3", rx: "1", key: "11xb64" }],
["path", { d: "m22 15-3-3 3-3", key: "26chmm" }],
["rect", { width: "13", height: "7", x: "3", y: "14", rx: "1", key: "k6ky7n" }]
]);
export { BetweenHorizontalEnd as default };
//# sourceMappingURL=between-horizontal-end.js.map
@@ -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 Bitcoin = createLucideIcon("Bitcoin", [
[
"path",
{
d: "M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",
key: "yr8idg"
}
]
]);
export { Bitcoin as default };
//# sourceMappingURL=bitcoin.js.map
@@ -0,0 +1,24 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2021_full = void 0;
const dom_1 = require("./dom");
const dom_asynciterable_1 = require("./dom.asynciterable");
const dom_iterable_1 = require("./dom.iterable");
const es2021_1 = require("./es2021");
const scripthost_1 = require("./scripthost");
const webworker_importscripts_1 = require("./webworker.importscripts");
exports.es2021_full = {
libs: [
es2021_1.es2021,
dom_1.dom,
webworker_importscripts_1.webworker_importscripts,
scripthost_1.scripthost,
dom_iterable_1.dom_iterable,
dom_asynciterable_1.dom_asynciterable,
],
variables: [],
};
@@ -0,0 +1 @@
{"version":3,"file":"delay.base.js","sourceRoot":"","sources":["../../src/delay/delay.base.ts"],"names":[],"mappings":";;AAEA,2DAAyD;AAEzD;IAEE,eAAoB,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;QADlC,YAAO,GAAG,CAAC,CAAC;IACyB,CAAC;IAEzC,qBAAK,GAAZ;QAAA,iBAEC;QADC,OAAO,IAAI,OAAO,CAAC,UAAA,OAAO,IAAI,OAAA,UAAU,CAAC,OAAO,EAAE,KAAI,CAAC,aAAa,CAAC,EAAvC,CAAuC,CAAC,CAAC;IACzE,CAAC;IAEM,gCAAgB,GAAvB,UAAwB,OAAe;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,sBAAY,gCAAa;aAAzB;YACE,IAAM,MAAM,GAAG,8BAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;;;OAAA;IAED,sBAAY,wBAAK;aAAjB;YACE,IAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;YAC5C,IAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;YACvC,IAAM,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC;YACxC,IAAM,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YAE/C,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAChD,CAAC;;;OAAA;IAED,sBAAc,uCAAoB;aAAlC;YACE,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;;;OAAA;IACH,YAAC;AAAD,CAAC,AA7BD,IA6BC;AA7BqB,sBAAK"}
@@ -0,0 +1 @@
{"version":3,"file":"sort.mjs","sources":["../../../../../src/animation/sequence/utils/sort.ts"],"sourcesContent":["import { AbsoluteKeyframe } from \"../types\"\n\nexport function compareByTime(\n a: AbsoluteKeyframe,\n b: AbsoluteKeyframe\n): number {\n if (a.at === b.at) {\n if (a.value === null) return 1\n if (b.value === null) return -1\n return 0\n } else {\n return a.at - b.at\n }\n}\n"],"names":[],"mappings":"AAEM,SAAU,aAAa,CACzB,CAAmB,EACnB,CAAmB,EAAA;IAEnB,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE;AACf,QAAA,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI;AAAE,YAAA,OAAO,CAAC;AAC9B,QAAA,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,EAAE;AAC/B,QAAA,OAAO,CAAC;IACZ;SAAO;AACH,QAAA,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;IACtB;AACJ;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"get-variant-context.mjs","sources":["../../../../src/render/utils/get-variant-context.ts"],"sourcesContent":["import { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nconst numVariantProps = variantProps.length\n\ntype VariantStateContext = {\n initial?: string | string[]\n animate?: string | string[]\n exit?: string | string[]\n whileHover?: string | string[]\n whileDrag?: string | string[]\n whileFocus?: string | string[]\n whileTap?: string | string[]\n}\n\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function getVariantContext(\n visualElement?: any\n): undefined | VariantStateContext {\n if (!visualElement) return undefined\n\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {}\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial as any\n }\n return context\n }\n\n const context: VariantStateContext = {}\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i] as keyof typeof context\n const prop = visualElement.props[name]\n\n if (isVariantLabel(prop) || prop === false) {\n ;(context as any)[name] = prop\n }\n }\n\n return context\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM;AAY3C;;;AAGG;AACG,SAAU,iBAAiB,CAC7B,aAAmB,EAAA;AAEnB,IAAA,IAAI,CAAC,aAAa;AAAE,QAAA,OAAO,SAAS;AAEpC,IAAA,IAAI,CAAC,aAAa,CAAC,qBAAqB,EAAE;AACtC,QAAA,MAAM,OAAO,GAAG,aAAa,CAAC;cACxB,iBAAiB,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI;cAC3C,EAAE;QACR,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE;YAC3C,OAAO,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,OAAc;QACxD;AACA,QAAA,OAAO,OAAO;IAClB;IAEA,MAAM,OAAO,GAAwB,EAAE;AACvC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC,EAAE,EAAE;AACtC,QAAA,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAyB;QACpD,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC;QAEtC,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,KAAK,EAAE;AACtC,YAAA,OAAe,CAAC,IAAI,CAAC,GAAG,IAAI;QAClC;IACJ;AAEA,IAAA,OAAO,OAAO;AAClB;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"hover.mjs","sources":["../../../src/gestures/hover.ts"],"sourcesContent":["import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { isDragActive } from \"./drag/state/is-active\"\nimport { EventOptions } from \"./types\"\nimport { setupGesture } from \"./utils/setup\"\n\n/**\n * A function to be called when a hover gesture starts.\n *\n * This function can optionally return a function that will be called\n * when the hover gesture ends.\n *\n * @public\n */\nexport type OnHoverStartEvent = (\n element: Element,\n event: PointerEvent\n) => void | OnHoverEndEvent\n\n/**\n * A function to be called when a hover gesture ends.\n *\n * @public\n */\nexport type OnHoverEndEvent = (event: PointerEvent) => void\n\nfunction isValidHover(event: PointerEvent) {\n return !(event.pointerType === \"touch\" || isDragActive())\n}\n\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nexport function hover(\n elementOrSelector: ElementOrSelector,\n onHoverStart: OnHoverStartEvent,\n options: EventOptions = {}\n): VoidFunction {\n const [elements, eventOptions, cancel] = setupGesture(\n elementOrSelector,\n options\n )\n\n elements.forEach((element) => {\n let isPressed = false\n let deferredHoverEnd = false\n let hoverEndCallback: OnHoverEndEvent | undefined\n\n const removePointerLeave = () => {\n element.removeEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener\n )\n }\n\n const endHover = (event: PointerEvent) => {\n if (hoverEndCallback) {\n hoverEndCallback(event)\n hoverEndCallback = undefined\n }\n removePointerLeave()\n }\n\n const onPointerUp = (event: Event) => {\n isPressed = false\n window.removeEventListener(\n \"pointerup\",\n onPointerUp as EventListener\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerUp as EventListener\n )\n\n if (deferredHoverEnd) {\n deferredHoverEnd = false\n endHover(event as PointerEvent)\n }\n }\n\n const onPointerDown = () => {\n isPressed = true\n window.addEventListener(\n \"pointerup\",\n onPointerUp as EventListener,\n eventOptions\n )\n window.addEventListener(\n \"pointercancel\",\n onPointerUp as EventListener,\n eventOptions\n )\n }\n\n const onPointerLeave = (leaveEvent: PointerEvent) => {\n if (leaveEvent.pointerType === \"touch\") return\n\n if (isPressed) {\n deferredHoverEnd = true\n return\n }\n\n endHover(leaveEvent)\n }\n\n const onPointerEnter = (enterEvent: PointerEvent) => {\n if (!isValidHover(enterEvent)) return\n\n deferredHoverEnd = false\n\n const onHoverEnd = onHoverStart(\n element as Element,\n enterEvent\n )\n\n if (typeof onHoverEnd !== \"function\") return\n\n hoverEndCallback = onHoverEnd\n\n element.addEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener,\n eventOptions\n )\n }\n\n element.addEventListener(\n \"pointerenter\",\n onPointerEnter as EventListener,\n eventOptions\n )\n element.addEventListener(\n \"pointerdown\",\n onPointerDown as EventListener,\n eventOptions\n )\n })\n\n return cancel\n}\n"],"names":[],"mappings":";;;AAyBA,SAAS,YAAY,CAAC,KAAmB,EAAA;IACrC,OAAO,EAAE,KAAK,CAAC,WAAW,KAAK,OAAO,IAAI,YAAY,EAAE,CAAC;AAC7D;AAEA;;;;;;AAMG;AACG,SAAU,KAAK,CACjB,iBAAoC,EACpC,YAA+B,EAC/B,UAAwB,EAAE,EAAA;AAE1B,IAAA,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,GAAG,YAAY,CACjD,iBAAiB,EACjB,OAAO,CACV;AAED,IAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAI;QACzB,IAAI,SAAS,GAAG,KAAK;QACrB,IAAI,gBAAgB,GAAG,KAAK;AAC5B,QAAA,IAAI,gBAA6C;QAEjD,MAAM,kBAAkB,GAAG,MAAK;AAC5B,YAAA,OAAO,CAAC,mBAAmB,CACvB,cAAc,EACd,cAA+B,CAClC;AACL,QAAA,CAAC;AAED,QAAA,MAAM,QAAQ,GAAG,CAAC,KAAmB,KAAI;YACrC,IAAI,gBAAgB,EAAE;gBAClB,gBAAgB,CAAC,KAAK,CAAC;gBACvB,gBAAgB,GAAG,SAAS;YAChC;AACA,YAAA,kBAAkB,EAAE;AACxB,QAAA,CAAC;AAED,QAAA,MAAM,WAAW,GAAG,CAAC,KAAY,KAAI;YACjC,SAAS,GAAG,KAAK;AACjB,YAAA,MAAM,CAAC,mBAAmB,CACtB,WAAW,EACX,WAA4B,CAC/B;AACD,YAAA,MAAM,CAAC,mBAAmB,CACtB,eAAe,ELine truncated
@@ -0,0 +1,6 @@
'use strict'
// Determine if version is greater than all the versions possible in the range.
const outside = require('./outside')
const gtr = (version, range, options) => outside(version, range, '>', options)
module.exports = gtr
@@ -0,0 +1,13 @@
import { visit } from "../core/visit.js";
import * as schemas from "./schemas.js";
/** Returns a copy of the schema with every nested object's properties made optional. */
export function deepPartial(schema) {
return visit(schema, {
object: (s) => s.partial(),
// Every partialed option now admits `undefined`, which the constructor rejects as a duplicate.
union: (s) => {
const def = s._zod.def;
return def.discriminator === undefined ? s : schemas.union(def.options);
},
});
}
@@ -0,0 +1,285 @@
/// <reference path="./types/importMeta.d.ts" />
// virtual modules
declare module 'vite/modulepreload-polyfill' {}
// CSS modules
type CSSModuleClasses = { readonly [key: string]: string }
declare module '*.module.css' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.module.scss' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.module.sass' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.module.less' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.module.styl' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.module.stylus' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.module.pcss' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.module.sss' {
const classes: CSSModuleClasses
export default classes
}
// CSS
declare module '*.css' {}
declare module '*.scss' {}
declare module '*.sass' {}
declare module '*.less' {}
declare module '*.styl' {}
declare module '*.stylus' {}
declare module '*.pcss' {}
declare module '*.sss' {}
// Built-in asset types
// see `src/node/constants.ts`
// images
declare module '*.apng' {
const src: string
export default src
}
declare module '*.bmp' {
const src: string
export default src
}
declare module '*.png' {
const src: string
export default src
}
declare module '*.jpg' {
const src: string
export default src
}
declare module '*.jpeg' {
const src: string
export default src
}
declare module '*.jfif' {
const src: string
export default src
}
declare module '*.pjpeg' {
const src: string
export default src
}
declare module '*.pjp' {
const src: string
export default src
}
declare module '*.gif' {
const src: string
export default src
}
declare module '*.svg' {
const src: string
export default src
}
declare module '*.ico' {
const src: string
export default src
}
declare module '*.webp' {
const src: string
export default src
}
declare module '*.avif' {
const src: string
export default src
}
declare module '*.cur' {
const src: string
export default src
}
declare module '*.jxl' {
const src: string
export default src
}
// media
declare module '*.mp4' {
const src: string
export default src
}
declare module '*.webm' {
const src: string
export default src
}
declare module '*.ogg' {
const src: string
export default src
}
declare module '*.mp3' {
const src: string
export default src
}
declare module '*.wav' {
const src: string
export default src
}
declare module '*.flac' {
const src: string
export default src
}
declare module '*.aac' {
const src: string
export default src
}
declare module '*.opus' {
const src: string
export default src
}
declare module '*.mov' {
const src: string
export default src
}
declare module '*.m4a' {
const src: string
export default src
}
declare module '*.vtt' {
const src: string
export default src
}
// fonts
declare module '*.woff' {
const src: string
export default src
}
declare module '*.woff2' {
const src: string
export default src
}
declare module '*.eot' {
const src: string
export default src
}
declare module '*.ttf' {
const src: string
export default src
}
declare module '*.otf' {
const src: string
export default src
}
// other
declare module '*.webmanifest' {
const src: string
export default src
}
declare module '*.pdf' {
const src: string
export default src
}
declare module '*.txt' {
const src: string
export default src
}
// wasm?init
declare module '*.wasm?init' {
const initWasm: (
options?: WebAssembly.Imports,
) => Promise<WebAssembly.Instance>
export default initWasm
}
// wasm (ESM integration)
declare module '*.wasm' {}
// web worker
declare module '*?worker' {
const workerConstructor: {
new (options?: { name?: string }): Worker
}
export default workerConstructor
}
declare module '*?worker&inline' {
const workerConstructor: {
new (options?: { name?: string }): Worker
}
export default workerConstructor
}
declare module '*?worker&url' {
const src: string
export default src
}
declare module '*?sharedworker' {
const sharedWorkerConstructor: {
new (options?: { name?: string }): SharedWorker
}
export default sharedWorkerConstructor
}
declare module '*?sharedworker&inline' {
const sharedWorkerConstructor: {
new (options?: { name?: string }): SharedWorker
}
export default sharedWorkerConstructor
}
declare module '*?sharedworker&url' {
const src: string
export default src
}
declare module '*?raw' {
const src: string
export default src
}
declare module '*?url' {
const src: string
export default src
}
declare module '*?inline' {
const src: string
export default src
}
declare module '*?no-inline' {
const src: string
export default src
}
declare module '*?url&inline' {
const src: string
export default src
}
declare module '*?url&no-inline' {
const src: string
export default src
}
declare interface VitePreloadErrorEvent extends Event {
payload: Error
}
declare interface WindowEventMap {
'vite:preloadError': VitePreloadErrorEvent
}
@@ -0,0 +1,31 @@
"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, {
clamp: () => clamp
});
module.exports = __toCommonJS(index_exports);
// src/number.ts
function clamp(value, [min, max]) {
return Math.min(max, Math.max(min, value));
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAC/C,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;AACnD,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,WAAW,GAAG,MAAM,CAAA;AAC1B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM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AAG,CAAC,CAAS,EAAE,CAAS;IAC/B,OAAO,CAAC,IAAI,CAAC,CAAA;AACf,CAAC;AAED,SAAS,GAAG,CAAC,CAAS,EAAE,CAAS;IAC/B,OAAO,CAAC,IAAI,CAAC,CAAA;AACf,CAAC;AAED,0EAA0E;AAC1E,gFAAgF;AAChF,2EAA2E;AAC3E,gFAAgF;AAChF,iCAAiC;AACjC,SAAS,OAAO,CACd,GAAa,EACb,GAAW,EACX,MAAgB,EAChB,GAAW,EACX,SAAiB,EACjB,WAAoB;IAEpB,MAAM,GAAG,GAAa,EAAE,CAAA;IACxB,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG;gBAAE,OAAO,GAAG,CAAA;YACjC,MAAM,SAAS,GAAI,GAAG,CAAC,CAAC,CAAY,GAAG,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;YACtD,yEAAyE;YACzE,+DAA+D;YAC/D,IAAI,WAAW,IAAI,CAAC,SAAS;gBAAE,SAAQ;YACvC,IAAI,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG,SAAS;gBAAE,OAAO,GAAG,CAAA;YACrD,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YACnB,MAAM,IAAI,SAAS,CAAC,MAAM,CAAA;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,8EAA8E;AAC9E,iBAAiB;AACjB,SAALine truncated
@@ -0,0 +1,376 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = applyDecs2203R;
var _setFunctionName = require("setFunctionName");
var _toPropertyKey = require("toPropertyKey");
function applyDecs2203RFactory() {
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
return function addInitializer(initializer) {
assertNotFinished(decoratorFinishedRef, "addInitializer");
assertCallable(initializer, "An initializer");
initializers.push(initializer);
};
}
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
var kindStr;
switch (kind) {
case 1:
kindStr = "accessor";
break;
case 2:
kindStr = "method";
break;
case 3:
kindStr = "getter";
break;
case 4:
kindStr = "setter";
break;
default:
kindStr = "field";
}
var ctx = {
kind: kindStr,
name: isPrivate ? "#" + name : _toPropertyKey(name),
static: isStatic,
private: isPrivate
};
var decoratorFinishedRef = {
v: false
};
if (kind !== 0) {
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
}
var get, set;
if (kind === 0) {
if (isPrivate) {
get = desc.get;
set = desc.set;
} else {
get = function () {
return this[name];
};
set = function (v) {
this[name] = v;
};
}
} else if (kind === 2) {
get = function () {
return desc.value;
};
} else {
if (kind === 1 || kind === 3) {
get = function () {
return desc.get.call(this);
};
}
if (kind === 1 || kind === 4) {
set = function (v) {
desc.set.call(this, v);
};
}
}
ctx.access = get && set ? {
get: get,
set: set
} : get ? {
get: get
} : {
set: set
};
try {
return dec(value, ctx);
} finally {
decoratorFinishedRef.v = true;
}
}
function assertNotFinished(decoratorFinishedRef, fnName) {
if (decoratorFinishedRef.v) {
throw new Error("attempted to call " + fnName + " after decoration was finished");
}
}
function assertCallable(fn, hint) {
if (typeof fn !== "function") {
throw new TypeError(hint + " must be a function");
}
}
function assertValidReturnValue(kind, value) {
var type = typeof value;
if (kind === 1) {
if (type !== "object" || value === null) {
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
}
if (value.get !== undefined) {
assertCallable(value.get, "accessor.get");
}
if (value.set !== undefined) {
assertCallable(value.set, "accessor.set");
}
if (value.init !== undefined) {
assertCallable(value.init, "accessor.init");
}
} else if (type !== "function") {
var hint;
if (kind === 0) {
hint = "field";
} else if (kind === 10) {
hint = "class";
} else {
hint = "method";
}
throw new TypeError(hint + " decorators must return a function or void 0");
}
}
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
var decs = decInfo[0];
var desc, init, prefix, value;
if (isPrivate) {
if (kind === 0 || kind === 1) {
desc = {
get: decInfo[3],
set: decInfo[4]
};
prefix = "get";
} else if (kind === 3) {
desc = {
get: decInfo[3]
};
prefix = "get";
} else if (kind === 4) {
desc = {
set: decInfo[3]
};
prefix = "set";
} else {
desc = {
value: decInfo[3]
};
}
if (kind !== 0) {
if (kind === 1) {
_setFunctionName(decInfo[4], "#" + name, "set");
}
_setFunctionName(decInfo[3], "#" + name, prefix);
}
} else if (kind !== 0) {
desc = Object.getOwnPropertyDescriptor(base, name);
}
if (kind === 1) {
value = {
get: desc.get,
set: desc.set
};
} else if (kind === 2) {
value = desc.value;
} else if (kind === 3) {
value = desc.get;
} else if (kind === 4) {
value = desc.set;
}
var newValue, get, set;
if (typeof decs === "function") {
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value);
if (newValue !== void 0) {
assertValidReturnValue(kind, newValue);
if (kind === 0) {
init = newValue;
} else if (kind === 1) {
init = newValue.init;
get = newValue.get || value.get;
set = newValue.set || value.set;
value = {
get: get,
set: set
};
} else {
value = newValue;
}
}
} else {
for (var i = decs.length - 1; i >= 0; i--) {
var dec = decs[i];
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value);
if (newValue !== void 0) {
assertValidReturnValue(kind, newValue);
var newInit;
if (kind === 0) {
newInit = newValue;
} else if (kind === 1) {
newInit = newValue.init;
get = newValue.get || value.get;
set = newValue.set || value.set;
value = {
get: get,
set: set
};
} else {
value = newValue;
}
if (newInit !== void 0) {
if (init === void 0) {
init = newInit;
} else if (typeof init === "function") {
init = [init, newInit];
} else {
init.push(newInit);
}
}
}
}
}
if (kind === 0 || kind === 1) {
if (init === void 0) {
init = function (instance, init) {
return init;
};
} else if (typeof init !== "function") {
var ownInitializers = init;
init = function (instance, init) {
var value = init;
for (var i = 0; i < ownInitializers.length; i++) {
value = ownInitializers[i].call(instance, value);
}
return value;
};
} else {
var originalInitializer = init;
init = function (instance, init) {
return originalInitializer.call(instance, init);
};
}
ret.push(init);
}
if (kind !== 0) {
if (kind === 1) {
desc.get = value.get;
desc.set = value.set;
} else if (kind === 2) {
desc.value = value;
} else if (kind === 3) {
desc.get = value;
} else if (kind === 4) {
desc.set = value;
}
if (isPrivate) {
if (kind === 1) {
ret.push(function (instance, args) {
return value.get.call(instance, args);
});
ret.push(function (instance, args) {
return value.set.call(instance, args);
});
} else if (kind === 2) {
ret.push(value);
} else {
ret.push(function (instance, args) {
return value.call(instance, args);
});
}
} else {
Object.defineProperty(base, name, desc);
}
}
}
function applyMemberDecs(Class, decInfos) {
var ret = [];
var protoInitializers;
var staticInitializers;
var existingProtoNonFields = new Map();
var existingStaticNonFields = new Map();
for (var i = 0; i < decInfos.length; i++) {
var decInfo = decInfos[i];
if (!Array.isArray(decInfo)) continue;
var kind = decInfo[1];
var name = decInfo[2];
var isPrivate = decInfo.length > 3;
var isStatic = kind >= 5;
var base;
var initializers;
if (isStatic) {
base = Class;
kind = kind - 5;
if (kind !== 0) {
staticInitializers = staticInitializers || [];
initializers = staticInitializers;
}
} else {
base = Class.prototype;
if (kind !== 0) {
protoInitializers = protoInitializers || [];
initializers = protoInitializers;
}
}
if (kind !== 0 && !isPrivate) {
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
var existingKind = existingNonFields.get(name) || 0;
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
} else if (!existingKind && kind > 2) {
existingNonFields.set(name, kind);
} else {
existingNonFields.set(name, true);
}
}
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
}
pushInitializers(ret, protoInitializers);
pushInitializers(ret, staticInitializers);
return ret;
}
function pushInitializers(ret, initializers) {
if (initializers) {
ret.push(function (instance) {
for (var i = 0; i < initializers.length; i++) {
initializers[i].call(instance);
}
return instance;
});
}
}
function applyClassDecs(targetClass, classDecs) {
if (classDecs.length > 0) {
var initializers = [];
var newClass = targetClass;
var name = targetClass.name;
for (var i = classDecs.length - 1; i >= 0; i--) {
var decoratorFinishedRef = {
v: false
};
try {
var nextNewClass = classDecs[i](newClass, {
kind: "class",
name: name,
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
});
} finally {
decoratorFinishedRef.v = true;
}
if (nextNewClass !== undefined) {
assertValidReturnValue(10, nextNewClass);
newClass = nextNewClass;
}
}
return [newClass, function () {
for (var i = 0; i < initializers.length; i++) {
initializers[i].call(newClass);
}
}];
}
}
return function applyDecs2203R(targetClass, memberDecs, classDecs) {
return {
e: applyMemberDecs(targetClass, memberDecs),
get c() {
return applyClassDecs(targetClass, classDecs);
}
};
};
}
function applyDecs2203R(targetClass, memberDecs, classDecs) {
return (exports.default = applyDecs2203R = applyDecs2203RFactory())(targetClass, memberDecs, classDecs);
}
//# sourceMappingURL=applyDecs2203R.js.map
@@ -0,0 +1,2 @@
export declare const modeFix: (mode: number, isDir: boolean, portable: boolean) => number;
//# sourceMappingURL=mode-fix.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"codepen.js","sources":["../../../src/icons/codepen.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Codepen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWdvbiBwb2ludHM9IjEyIDIgMjIgOC41IDIyIDE1LjUgMTIgMjIgMiAxNS41IDIgOC41IDEyIDIiIC8+CiAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSIyMiIgeTI9IjE1LjUiIC8+CiAgPHBvbHlsaW5lIHBvaW50cz0iMjIgOC41IDEyIDE1LjUgMiA4LjUiIC8+CiAgPHBvbHlsaW5lIHBvaW50cz0iMiAxNS41IDEyIDguNSAyMiAxNS41IiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMiIgeTI9IjguNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/codepen\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n * @deprecated Brand icons have been deprecated and are due to be removed, please refer to https://github.com/lucide-icons/lucide/issues/670. We recommend using https://simpleicons.org/?q=codepen instead. This icon will be removed in v1.0\n */\nconst Codepen = createLucideIcon('Codepen', [\n ['polygon', { points: '12 2 22 8.5 22 15.5 12 22 2 15.5 2 8.5 12 2', key: 'srzb37' }],\n ['line', { x1: '12', x2: '12', y1: '22', y2: '15.5', key: '1t73f2' }],\n ['polyline', { points: '22 8.5 12 15.5 2 8.5', key: 'ajlxae' }],\n ['polyline', { points: '2 15.5 12 8.5 22 15.5', key: 'susrui' }],\n ['line', { x1: '12', x2: '12', y1: '2', y2: '8.5', key: '2cldga' }],\n]);\n\nexport default Codepen;\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,CAA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yB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC/D,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACpE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/use-controllable-state.tsx", "../src/use-controllable-state-reducer.tsx"],
"sourcesContent": ["export { useControllableState } from './use-controllable-state';\nexport { useControllableStateReducer } from './use-controllable-state-reducer';\n", "import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// Prevent bundlers from trying to optimize the import\nconst useInsertionEffect: typeof useLayoutEffect =\n (React as any)[' useInsertionEffect '.trim().toString()] || useLayoutEffect;\n\ntype ChangeHandler<T> = (state: T) => void;\ntype SetStateFn<T> = React.Dispatch<React.SetStateAction<T>>;\n\ninterface UseControllableStateParams<T> {\n prop?: T | undefined;\n defaultProp: T;\n onChange?: ChangeHandler<T>;\n caller?: string;\n}\n\nexport function useControllableState<T>({\n prop,\n defaultProp,\n onChange = () => {},\n caller,\n}: UseControllableStateParams<T>): [T, SetStateFn<T>] {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange,\n });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (process.env.NODE_ENV !== 'production') {\n const isControlledRef = React.useRef(prop !== undefined);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? 'controlled' : 'uncontrolled';\n const to = isControlled ? 'controlled' : 'uncontrolled';\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`,\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n const setValue = React.useCallback<SetStateFn<T>>(\n (nextValue) => {\n if (isControlled) {\n const value = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value !== prop) {\n onChangeRef.current?.(value);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef],\n );\n\n return [value, setValue];\n}\n\nfunction useUncontrolledState<T>({\n defaultProp,\n onChange,\n}: Omit<UseControllableStateParams<T>, 'prop'>): [\n Value: T,\n setValue: React.Dispatch<React.SetStateAction<T>>,\n OnChangeRef: React.RefObject<ChangeHandler<T> | undefined>,\n] {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n\n return [value, setValue, onChangeRef];\n}\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n", "import * as React from 'react';\nimport { useEffectEvent } from '@radix-ui/react-use-effect-event';\n\ntype ChangeHandler<T> = (state: T) => void;\n\ninterface UseControllableStateParams<T> {\n prop: T | undefined;\n defaultProp: T;\n onChange: ChangeHandler<T> | undefined;\n caller: string;\n}\n\ninterface AnyAction {\n type: string;\n}\n\nconst SYNC_STATE = Symbol('RADIX:SYNC_STATE');\n\ninterface SyncStateAction<T> {\n type: typeof SYNC_STATE;\n state: T;\n}\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialState: S,\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, I, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: I,\n init: (i: I & { state: T }) => S,\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: any,\n init?: (i: any) => Omit<S, 'state'>,\n): [S & { state: T }, React.Dispatch<A>] {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== undefined;\n\n const onChange = useEffectEvent(onChangeProp);\n\n // OK to diLine truncated
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,qCAAgC;AAGhC,IAAM,qBACH,MAAc,uBAAuB,KAAK,EAAE,SAAS,CAAC,KAAK;AAYvD,SAAS,qBAAwB;AAAA,EACtC;AAAA,EACA;AAAA,EACA,WAAW,MAAM;AAAA,EAAC;AAAA,EAClB;AACF,GAAsD;AACpD,QAAM,CAAC,kBAAkB,qBAAqB,WAAW,IAAI,qBAAqB;AAAA,IAChF;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,SAAS;AAC9B,QAAM,QAAQ,eAAe,OAAO;AAM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C5B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,mBAAmB,cAAc,YAAY,CAAC;AAElD,QAAM,QAAc,eAAQ,MAAM;AAChC,UAAMC,gBAAe,oBAAoB;AACzC,QAAIA,eAAc;AAChB,aAAO,EAAE,GAAG,eAAe,OAAO,gBAAgB;AAAA,IACpD;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,eAAe,eAAe,CAAC;AAEnC,EAAM,iBAAU,MAAM;AAGpB,QAAI,gBAAgB,CAAC,OAAO,GAAG,iBAAiB,cAAc,KAAK,GAAG;AACpE,eAAS,EAAE,MAAM,YAAY,OAAO,gBAAgB,CAAC;AAAA,IACvD;AAAA,EACF,GAAG,CAAC,iBAAiB,cAAc,OAAO,YAAY,CAAC;AAEvD,SAAO,CAAC,OAAO,QAA6B;AAC9C;",
"names": ["value", "React", "state", "isControlled"]
}
@@ -0,0 +1,481 @@
# debug
[![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers)
[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
A tiny JavaScript debugging utility modelled after Node.js core's debugging
technique. Works in Node.js and web browsers.
## Installation
```bash
$ npm install debug
```
## Usage
`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
Example [_app.js_](./examples/node/app.js):
```js
var debug = require('debug')('http')
, http = require('http')
, name = 'My App';
// fake app
debug('booting %o', name);
http.createServer(function(req, res){
debug(req.method + ' ' + req.url);
res.end('hello\n');
}).listen(3000, function(){
debug('listening');
});
// fake worker of some kind
require('./worker');
```
Example [_worker.js_](./examples/node/worker.js):
```js
var a = require('debug')('worker:a')
, b = require('debug')('worker:b');
function work() {
a('doing lots of uninteresting work');
setTimeout(work, Math.random() * 1000);
}
work();
function workb() {
b('doing some work');
setTimeout(workb, Math.random() * 2000);
}
workb();
```
The `DEBUG` environment variable is then used to enable these based on space or
comma-delimited names.
Here are some examples:
<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">
#### Windows command prompt notes
##### CMD
On Windows the environment variable is set using the `set` command.
```cmd
set DEBUG=*,-not_this
```
Example:
```cmd
set DEBUG=* & node app.js
```
##### PowerShell (VS Code default)
PowerShell uses different syntax to set environment variables.
```cmd
$env:DEBUG = "*,-not_this"
```
Example:
```cmd
$env:DEBUG='app';node app.js
```
Then, run the program to be debugged as usual.
npm script example:
```js
"windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",
```
## Namespace Colors
Every debug instance has a color generated for it based on its namespace name.
This helps when visually parsing the debug output to identify which debug instance
a debug line belongs to.
#### Node.js
In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
otherwise debug will only use a small handful of basic colors.
<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">
#### Web Browser
Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
option. These are WebKit web inspectors, Firefox ([since version
31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
and the Firebug plugin for Firefox (any version).
<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">
## Millisecond diff
When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">
## Conventions
If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output.
## Wildcards
The `*` character may be used as a wildcard. Suppose for example your library has
debuggers named "connect:bodyParser", "connect:compress", "connect:session",
instead of listing all three with
`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
You can also exclude specific debuggers by prefixing them with a "-" character.
For example, `DEBUG=*,-connect:*` would include all debuggers except those
starting with "connect:".
## Environment Variables
When running through Node.js, you can set a few environment variables that will
change the behavior of the debug logging:
| Name | Purpose |
|-----------|-------------------------------------------------|
| `DEBUG` | Enables/disables specific debugging namespaces. |
| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). |
| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
| `DEBUG_DEPTH` | Object inspection depth. |
| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
__Note:__ The environment variables beginning with `DEBUG_` end up being
converted into an Options object that gets used with `%o`/`%O` formatters.
See the Node.js documentation for
[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
for the complete list.
## Formatters
Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
Below are the officially supported formatters:
| Formatter | Representation |
|-----------|----------------|
| `%O` | Pretty-print an Object on multiple lines. |
| `%o` | Pretty-print an Object all on a single line. |
| `%s` | String. |
| `%d` | Number (both integer and float). |
| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
| `%%` | Single percent sign ('%'). This does not consume an argument. |
### Custom formatters
You can add custom formatters by extending the `debug.formatters` object.
For example, if you wanted to add support for rendering a Buffer as hex with
`%h`, you could do something like:
```js
const createDebug = require('debug')
createDebug.formatters.h = (v) => {
return v.toString('hex')
}
// …elsewhere
const debug = createDebug('foo')
debug('this is hex: %h', new Buffer('hello world'))
// foo this is hex: 68656c6c6f20776f726c6421 +0ms
```
## Browser Support
You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
if you don't want to build it yourself.
Debug's enable state is currently persisted by `localStorage`.
Consider the situation shown below where you have `worker:a` and `worker:b`,
and wish to debug both. You can enable this using `localStorage.debug`:
```js
localStorage.debug = 'worker:*'
```
And then refresh the page.
```js
a = debug('worker:a');
b = debug('worker:b');
setInterval(function(){
a('doing some work');
}, 1000);
setInterval(function(){
b('doing some work');
}, 1200);
```
In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_.
<img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png">
## Output streams
By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
Example [_stdout.js_](./examples/node/stdout.js):
```js
var debug = require('debug');
var error = debug('app:error');
// by default stderr is used
error('goes to stderr!');
var log = debug('app:log');
// set this namespace to log via console.log
log.log = console.log.bind(console); // don't forget to bind to console!
log('goes to stdout');
error('still goes to stderr!');
// set all output to go via console.info
// overrides all per-namespace log settings
debug.log = console.info.bind(console);
error('now goes to stdout via console.info');
log('still goes to stdout, but via console.info now');
```
## Extend
You can simply extend debugger
```js
const log = require('debug')('auth');
//creates new debug instance with extended namespace
const logSign = log.extend('sign');
const logLogin = log.extend('login');
log('hello'); // auth hello
logSign('hello'); //auth:sign hello
logLogin('hello'); //auth:login hello
```
## Set dynamically
You can also enable debug dynamically by calling the `enable()` method :
```js
let debug = require('debug');
console.log(1, debug.enabled('test'));
debug.enable('test');
console.log(2, debug.enabled('test'));
debug.disable();
console.log(3, debug.enabled('test'));
```
print :
```
1 false
2 true
3 false
```
Usage :
`enable(namespaces)`
`namespaces` can include modes separated by a colon and wildcards.
Note that calling `enable()` completely overrides previously set DEBUG variable :
```
$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'
=> false
```
`disable()`
Will disable all namespaces. The functions returns the namespaces currently
enabled (and skipped). This can be useful if you want to disable debugging
temporarily without knowing what was enabled to begin with.
For example:
```js
let debug = require('debug');
debug.enable('foo:*,-foo:bar');
let namespaces = debug.disable();
debug.enable(namespaces);
```
Note: There is no guarantee that the string will be identical to the initial
enable string, but semantically they will be identical.
## Checking whether a debug target is enabled
After you've created a debug instance, you can determine whether or not it is
enabled by checking the `enabled` property:
```javascript
const debug = require('debug')('http');
if (debug.enabled) {
// do stuff...
}
```
You can also manually toggle this property to force the debug instance to be
enabled or disabled.
## Usage in child processes
Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process.
For example:
```javascript
worker = fork(WORKER_WRAP_PATH, [workerPath], {
stdio: [
/* stdin: */ 0,
/* stdout: */ 'pipe',
/* stderr: */ 'pipe',
'ipc',
],
env: Object.assign({}, process.env, {
DEBUG_COLORS: 1 // without this settings, colors won't be shown
}),
});
worker.stderr.pipe(process.stderr, { end: false });
```
## Authors
- TJ Holowaychuk
- Nathan Rajlich
- Andrew Rhyne
- Josh Junon
## Backers
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
## Sponsors
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
## License
(The MIT License)
Copyright (c) 2014-2017 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
Copyright (c) 2018-2021 Josh Junon
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,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 SquarePower = createLucideIcon("SquarePower", [
["path", { d: "M12 7v4", key: "xawao1" }],
["path", { d: "M7.998 9.003a5 5 0 1 0 8-.005", key: "1pek45" }],
["rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", key: "h1oib" }]
]);
export { SquarePower as default };
//# sourceMappingURL=square-power.js.map
@@ -0,0 +1,5 @@
'use strict'
const compare = require('./compare')
const lte = (a, b, loose) => compare(a, b, loose) <= 0
module.exports = lte
@@ -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 TriangleRight = createLucideIcon("TriangleRight", [
[
"path",
{
d: "M22 18a2 2 0 0 1-2 2H3c-1.1 0-1.3-.6-.4-1.3L20.4 4.3c.9-.7 1.6-.4 1.6.7Z",
key: "183wce"
}
]
]);
export { TriangleRight as default };
//# sourceMappingURL=triangle-right.js.map
@@ -0,0 +1,15 @@
import { ZodMapDef } from "zod/v3";
import { JsonSchema7Type } from "../parseTypes.js";
import { Refs } from "../Refs.js";
import { JsonSchema7RecordType } from "./record.js";
export type JsonSchema7MapType = {
type: "array";
maxItems: 125;
items: {
type: "array";
items: [JsonSchema7Type, JsonSchema7Type];
minItems: 2;
maxItems: 2;
};
};
export declare function parseMapDef(def: ZodMapDef, refs: Refs): JsonSchema7MapType | JsonSchema7RecordType;
@@ -0,0 +1 @@
{"version":3,"names":["_index","require","getQualifiedName","node","isIdentifier","name","isThisExpression","right","left","removeTypeDuplicates","nodesIn","nodes","Array","from","generics","Map","bases","typeGroups","Set","types","i","length","includes","isTSAnyKeyword","isTSBaseType","set","type","isTSUnionType","has","push","add","typeArgumentsKey","isTSTypeReference","typeArguments","typeName","existing","get","existingTypeArguments","params","baseType","genericName"],"sources":["../../../src/modifications/typescript/removeTypeDuplicates.ts"],"sourcesContent":["import {\n isIdentifier,\n isThisExpression,\n isTSAnyKeyword,\n isTSTypeReference,\n isTSUnionType,\n isTSBaseType,\n} from \"../../validators/generated/index.ts\";\nimport type * as t from \"../../index.ts\";\n\nfunction getQualifiedName(node: t.TSTypeReference[\"typeName\"]): string {\n return isIdentifier(node)\n ? node.name\n : isThisExpression(node)\n ? \"this\"\n : `${node.right.name}.${getQualifiedName(node.left)}`;\n}\n\n/**\n * Dedupe type annotations.\n */\nexport default function removeTypeDuplicates(\n nodesIn: readonly t.TSType[],\n): t.TSType[] {\n const nodes = Array.from(nodesIn);\n\n const generics = new Map<string, t.TSTypeReference>();\n const bases = new Map<t.TSBaseType[\"type\"], t.TSBaseType>();\n\n // store union type groups to circular references\n const typeGroups = new Set<t.TSType[]>();\n\n const types: t.TSType[] = [];\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (!node) continue;\n\n // detect duplicates\n if (types.includes(node)) {\n continue;\n }\n\n // this type matches anything\n if (isTSAnyKeyword(node)) {\n return [node];\n }\n\n // Analogue of FlowBaseAnnotation\n if (isTSBaseType(node)) {\n bases.set(node.type, node);\n continue;\n }\n\n if (isTSUnionType(node)) {\n if (!typeGroups.has(node.types)) {\n nodes.push(...node.types);\n typeGroups.add(node.types);\n }\n continue;\n }\n\n // todo: support merging tuples: number[]\n const typeArgumentsKey = process.env.BABEL_8_BREAKING\n ? \"typeArguments\"\n : \"typeParameters\";\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n if (isTSTypeReference(node) && node[typeArgumentsKey]) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n const typeArguments = node[typeArgumentsKey];\n const name = getQualifiedName(node.typeName);\n\n if (generics.has(name)) {\n let existing: t.TypeScript = generics.get(name);\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n const existingTypeArguments = existing[typeArgumentsKey];\n if (existingTypeArguments) {\n existingTypeArguments.params.push(...typeArguments.params);\n existingTypeArguments.params = removeTypeDuplicates(\n existingTypeArguments.params,\n );\n } else {\n existing = typeArguments;\n }\n } else {\n generics.set(name, node);\n }\n\n continue;\n }\n\n types.push(node);\n }\n\n // add back in bases\n for (const [, baseType] of bases) {\n types.push(baseType);\n }\n\n // add back in generics\n for (const [, genericName] of generics) {\n types.push(genericName);\n }\n\n return types;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAUA,SAASC,gBAAgBA,CAACC,IAAmC,EAAU;EACrE,OAAO,IAAAC,mBAAY,EAACD,IAAI,CAAC,GACrBA,IAAI,CAACE,IAAI,GACT,IAAAC,uBAAgB,EAACH,IAAI,CAAC,GACpB,MAAM,GACN,GAAGA,IAAI,CAACI,KAAK,CAACF,IAAI,IAAIH,gBAAgB,CAACC,IAAI,CAACK,IAAI,CAAC,EAAE;AAC3D;AAKe,SAASC,oBAAoBA,CAC1CC,OAA4B,EAChB;EACZ,MAAMC,KAAK,GAAGC,KAAK,CAACC,IAAI,CAACH,OAAO,CAAC;EAEjC,MAAMI,QAAQ,GAAG,IAAIC,GAAG,CAA4B,CAAC;EACrD,MAAMC,KAAK,GAAG,IAAID,GAAG,CAAqC,CAAC;EAG3D,MAAME,UAAU,GAAG,IAAIC,GAAG,CAAa,CAAC;EAExC,MAAMC,KAAiB,GAAG,EAAE;EAE5B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGT,KAAK,CAACU,MAAM,EAAED,CAAC,EAAE,EAAE;IACrC,MA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sources":["../../../src/ssr/json.ts"],"sourcesContent":["/**\n * @deprecated Use [`Response.json`](https://developer.mozilla.org/en-US/docs/Web/API/Response/json_static) from the standard Web API directly.\n */\nexport interface JsonResponse<TData> extends Response {\n json: () => Promise<TData>\n}\n\n/**\n * @deprecated Use [`Response.json`](https://developer.mozilla.org/en-US/docs/Web/API/Response/json_static) from the standard Web API directly.\n */\nexport function json<TData>(\n payload: TData,\n init?: ResponseInit,\n): JsonResponse<TData> {\n return Response.json(payload, init)\n}\n"],"mappings":";;;;AAUA,SAAgB,KACd,SACA,MACqB;AACrB,QAAO,SAAS,KAAK,SAAS,KAAK"}
@@ -0,0 +1,242 @@
/**
* @fileoverview Enforces that a return statement is present in property getters.
* @author Aladdin-ADD(hh_2013@foxmail.com)
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u;
/**
* Checks all segments in a set and returns true if any are reachable.
* @param {Set<CodePathSegment>} segments The segments to check.
* @returns {boolean} True if any segment is reachable; false otherwise.
*/
function isAnySegmentReachable(segments) {
for (const segment of segments) {
if (segment.reachable) {
return true;
}
}
return false;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: [
{
allowImplicit: false,
},
],
docs: {
description: "Enforce `return` statements in getters",
recommended: true,
url: "https://eslint.org/docs/latest/rules/getter-return",
},
fixable: null,
schema: [
{
type: "object",
properties: {
allowImplicit: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
expected: "Expected to return a value in {{name}}.",
expectedAlways: "Expected {{name}} to always return a value.",
},
},
create(context) {
const [{ allowImplicit }] = context.options;
const sourceCode = context.sourceCode;
let funcInfo = {
upper: null,
codePath: null,
hasReturn: false,
shouldCheck: false,
node: null,
currentSegments: [],
};
/**
* Checks whether or not the last code path segment is reachable.
* Then reports this function if the segment is reachable.
*
* If the last code path segment is reachable, there are paths which are not
* returned or thrown.
* @param {ASTNode} node A node to check.
* @returns {void}
*/
function checkLastSegment(node) {
if (
funcInfo.shouldCheck &&
isAnySegmentReachable(funcInfo.currentSegments)
) {
context.report({
node,
loc: astUtils.getFunctionHeadLoc(node, sourceCode),
messageId: funcInfo.hasReturn
? "expectedAlways"
: "expected",
data: {
name: astUtils.getFunctionNameWithKind(funcInfo.node),
},
});
}
}
/**
* Checks whether a node means a getter function.
* @param {ASTNode} node a node to check.
* @returns {boolean} if node means a getter, return true; else return false.
*/
function isGetter(node) {
const parent = node.parent;
if (
TARGET_NODE_TYPE.test(node.type) &&
node.body.type === "BlockStatement"
) {
if (parent.kind === "get") {
return true;
}
if (
parent.type === "Property" &&
astUtils.getStaticPropertyName(parent) === "get" &&
parent.parent.type === "ObjectExpression"
) {
// Object.defineProperty() or Reflect.defineProperty()
if (parent.parent.parent.type === "CallExpression") {
const callNode = parent.parent.parent.callee;
if (
astUtils.isSpecificMemberAccess(
callNode,
"Object",
"defineProperty",
) ||
astUtils.isSpecificMemberAccess(
callNode,
"Reflect",
"defineProperty",
)
) {
return true;
}
}
// Object.defineProperties() or Object.create()
if (
parent.parent.parent.type === "Property" &&
parent.parent.parent.parent.type ===
"ObjectExpression" &&
parent.parent.parent.parent.parent.type ===
"CallExpression"
) {
const callNode =
parent.parent.parent.parent.parent.callee;
return (
astUtils.isSpecificMemberAccess(
callNode,
"Object",
"defineProperties",
) ||
astUtils.isSpecificMemberAccess(
callNode,
"Object",
"create",
)
);
}
}
}
return false;
}
return {
// Stacks this function's information.
onCodePathStart(codePath, node) {
funcInfo = {
upper: funcInfo,
codePath,
hasReturn: false,
shouldCheck: isGetter(node),
node,
currentSegments: new Set(),
};
},
// Pops this function's information.
onCodePathEnd() {
funcInfo = funcInfo.upper;
},
onUnreachableCodePathSegmentStart(segment) {
funcInfo.currentSegments.add(segment);
},
onUnreachableCodePathSegmentEnd(segment) {
funcInfo.currentSegments.delete(segment);
},
onCodePathSegmentStart(segment) {
funcInfo.currentSegments.add(segment);
},
onCodePathSegmentEnd(segment) {
funcInfo.currentSegments.delete(segment);
},
// Checks the return statement is valid.
ReturnStatement(node) {
if (funcInfo.shouldCheck) {
funcInfo.hasReturn = true;
// if allowImplicit: false, should also check node.argument
if (!allowImplicit && !node.argument) {
context.report({
node,
messageId: "expected",
data: {
name: astUtils.getFunctionNameWithKind(
funcInfo.node,
),
},
});
}
}
},
// Reports a given function if the last path is reachable.
"FunctionExpression:exit": checkLastSegment,
"ArrowFunctionExpression:exit": checkLastSegment,
};
},
};
@@ -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 './alarm-clock-minus.js';
//# sourceMappingURL=alarm-minus.js.map
@@ -0,0 +1,24 @@
/**
* @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 ShowerHead = createLucideIcon("ShowerHead", [
["path", { d: "m4 4 2.5 2.5", key: "uv2vmf" }],
["path", { d: "M13.5 6.5a4.95 4.95 0 0 0-7 7", key: "frdkwv" }],
["path", { d: "M15 5 5 15", key: "1ag8rq" }],
["path", { d: "M14 17v.01", key: "eokfpp" }],
["path", { d: "M10 16v.01", key: "14uyyl" }],
["path", { d: "M13 13v.01", key: "1v1k97" }],
["path", { d: "M16 10v.01", key: "5169yg" }],
["path", { d: "M11 20v.01", key: "cj92p8" }],
["path", { d: "M17 14v.01", key: "11cswd" }],
["path", { d: "M20 11v.01", key: "19e0od" }]
]);
export { ShowerHead as default };
//# sourceMappingURL=shower-head.js.map
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.nonPassive = void 0;
var passiveSupported = false;
if (typeof window !== 'undefined') {
try {
var options = Object.defineProperty({}, 'passive', {
get: function () {
passiveSupported = true;
return true;
},
});
// @ts-ignore
window.addEventListener('test', options, options);
// @ts-ignore
window.removeEventListener('test', options, options);
}
catch (err) {
passiveSupported = false;
}
}
exports.nonPassive = passiveSupported ? { passive: false } : false;
@@ -0,0 +1,40 @@
import { JOSENotSupported } from '../util/errors.js';
export async function generateSecret(alg, options) {
let length;
let algorithm;
let keyUsages;
switch (alg) {
case 'HS256':
case 'HS384':
case 'HS512':
length = parseInt(alg.slice(-3), 10);
algorithm = { name: 'HMAC', hash: `SHA-${length}`, length };
keyUsages = ['sign', 'verify'];
break;
case 'A128CBC-HS256':
case 'A192CBC-HS384':
case 'A256CBC-HS512':
length = parseInt(alg.slice(-3), 10);
return crypto.getRandomValues(new Uint8Array(length >> 3));
case 'A128KW':
case 'A192KW':
case 'A256KW':
length = parseInt(alg.slice(1, 4), 10);
algorithm = { name: 'AES-KW', length };
keyUsages = ['wrapKey', 'unwrapKey'];
break;
case 'A128GCMKW':
case 'A192GCMKW':
case 'A256GCMKW':
case 'A128GCM':
case 'A192GCM':
case 'A256GCM':
length = parseInt(alg.slice(1, 4), 10);
algorithm = { name: 'AES-GCM', length };
keyUsages = ['encrypt', 'decrypt'];
break;
default:
throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
}
return crypto.subtle.generateKey(algorithm, options?.extractable ?? false, keyUsages);
}
@@ -0,0 +1,193 @@
// Traversal pattern adapted from Jaen's v3 `mapOnSchema` (Apache-2.0): https://gist.github.com/jaens/7e15ae1984bb338c86eb5e452dee3010
import * as schemas from "./schemas.js";
import { clone } from "./util.js";
const RESOLVING: unique symbol = Symbol("z.visit/resolving");
type Resolving = typeof RESOLVING;
type AnyZod = schemas.$ZodType;
type Kind = schemas.$ZodTypeDef["type"];
/** The concrete schema class for a `def.type`, or `$ZodType` for kinds with no dedicated class. */
type SchemaOfKind<K extends Kind> = [Extract<schemas.$ZodTypes, { _zod: { def: { type: K } } }>] extends [never]
? AnyZod
: Extract<schemas.$ZodTypes, { _zod: { def: { type: K } } }>;
export type VisitFn = (node: AnyZod, rewritten: boolean) => AnyZod;
export type VisitHandlers = { [K in Kind]?: (node: SchemaOfKind<K>, rewritten: boolean) => AnyZod };
/**
* @internal Bottom-up rewrite of a schema tree. Unhandled kinds and unchanged branches keep their
* identity. Returns `$ZodType`: a visitor can swap in a schema of any type, so callers declare
* their own return type. `rewritten` tells a handler whether the traversal replaced anything
* below the node it is looking at.
*/
export function visit(schema: schemas.SomeType, fn: VisitFn): AnyZod;
export function visit(schema: schemas.SomeType, handlers: VisitHandlers): AnyZod;
export function visit(schema: schemas.SomeType, fnOrHandlers: VisitFn | VisitHandlers): AnyZod {
const fn: VisitFn =
typeof fnOrHandlers === "function"
? fnOrHandlers
: (node, rewritten) => {
// A union of handlers isn't callable with one argument; handler `K` only ever sees kind `K`.
const h = (fnOrHandlers as VisitHandlers)[node._zod.def.type] as
| ((n: AnyZod, rewritten: boolean) => AnyZod)
| undefined;
return h ? h(node, rewritten) : node;
};
const cache = new Map<AnyZod, AnyZod | Resolving>();
function run(s: AnyZod): AnyZod {
const cached = cache.get(s);
if (cached === RESOLVING) {
// Non-lazy cycle. Defer to parse time, when the cache holds the finished node.
return new schemas.$ZodLazy({
type: "lazy",
getter: () => cache.get(s) as AnyZod,
});
}
if (cached !== undefined) return cached;
cache.set(s, RESOLVING);
const inner = mapInner(s);
const mapped = fn(inner, inner !== s);
cache.set(s, mapped);
return mapped;
}
function mapInner(s: AnyZod): AnyZod {
const def = s._zod.def as any;
const kind = def.type as Kind;
switch (kind) {
case "object": {
const oldShape = def.shape as Record<string, AnyZod>;
const keys = Object.keys(oldShape);
let changed = false;
const newShape: Record<string, AnyZod> = {};
for (const k of keys) {
const mapped = run(oldShape[k]!);
if (mapped !== oldShape[k]) changed = true;
newShape[k] = mapped;
}
let newCatchall = def.catchall;
if (def.catchall) {
newCatchall = run(def.catchall);
if (newCatchall !== def.catchall) changed = true;
}
return changed ? clone(s, { ...def, shape: newShape, catchall: newCatchall }) : s;
}
case "array": {
const mapped = run(def.element);
return mapped === def.element ? s : clone(s, { ...def, element: mapped });
}
case "tuple": {
const oldItems = def.items as AnyZod[];
let changed = false;
const newItems: AnyZod[] = [];
for (const item of oldItems) {
const mapped = run(item);
if (mapped !== item) changed = true;
newItems.push(mapped);
}
let newRest = def.rest;
if (def.rest) {
newRest = run(def.rest);
if (newRest !== def.rest) changed = true;
}
return changed ? clone(s, { ...def, items: newItems, rest: newRest }) : s;
}
case "record":
case "map": {
const newKey = run(def.keyType);
const newVal = run(def.valueType);
return newKey === def.keyType && newVal === def.valueType
? s
: clone(s, { ...def, keyType: newKey, valueType: newVal });
}
case "set": {
const newVal = run(def.valueType);
return newVal === def.valueType ? s : clone(s, { ...def, valueType: newVal });
}
case "union": {
const oldOptions = def.options as AnyZod[];
let changed = false;
const newOptions: AnyZod[] = [];
for (const opt of oldOptions) {
const mapped = run(opt);
if (mapped !== opt) changed = true;
newOptions.push(mapped);
}
return changed ? clone(s, { ...def, options: newOptions }) : s;
}
case "intersection": {
const newLeft = run(def.left);
const newRight = run(def.right);
return newLeft === def.left && newRight === def.right
? s
: clone(s, { ...def, left: newLeft, right: newRight });
}
case "optional":
case "nullable":
case "default":
case "prefault":
case "catch":
case "readonly":
case "nonoptional":
case "promise":
case "success": {
const newInner = run(def.innerType);
return newInner === def.innerType ? s : clone(s, { ...def, innerType: newInner });
}
case "pipe": {
const newIn = run(def.in);
const newOut = run(def.out);
return newIn === def.in && newOut === def.out ? s : clone(s, { ...def, in: newIn, out: newOut });
}
case "function": {
const newInput = run(def.input);
const newOutput = run(def.output);
return newInput === def.input && newOutput === def.output
? s
: clone(s, { ...def, input: newInput, output: newOutput });
}
case "lazy": {
// Invoking the getter here would trip the cycle check, so lazy nodes always re-clone.
const original = def.getter as () => AnyZod;
// Drop the memo, or it shadows the new getter forever.
const { _cachedInner, ...rest } = def;
return clone(s, { ...rest, getter: () => run(original()) });
}
// A leaf by choice: `parts` are regex fragments, not data positions.
case "template_literal":
// Leaves.
case "string":
case "number":
case "int":
case "boolean":
case "bigint":
case "symbol":
case "undefined":
case "null":
case "void":
case "never":
case "any":
case "unknown":
case "date":
case "nan":
case "enum":
case "literal":
case "file":
case "transform":
case "custom":
return s;
default: {
// A new built-in kind becomes a compile error here; unknown user kinds fall through.
kind satisfies never;
return s;
}
}
}
return run(schema as AnyZod);
}
@@ -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 './wand-sparkles.js';
//# sourceMappingURL=wand-2.js.map
@@ -0,0 +1 @@
const t=new Set(["Custom ESM Loaders is an experimental feature. This feature could change at any time","Custom ESM Loaders is an experimental feature and might change at any time","Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js."]),{emit:n}=process;process.emit=function(e,a){if(!(e==="warning"&&t.has(a.message)))return Reflect.apply(n,this,arguments)};
@@ -0,0 +1,704 @@
import type { HistoryState, ParsedHistoryState } from '@tanstack/history'
import type {
AllParams,
CatchAllPaths,
CurrentPath,
FullSearchSchema,
FullSearchSchemaInput,
ParentPath,
RouteByPath,
RouteByToPath,
RoutePaths,
RouteToPath,
ToPath,
} from './routeInfo'
import type {
AnyRouter,
RegisteredRouter,
ViewTransitionOptions,
} from './router'
import type {
ConstrainLiteral,
Expand,
MakeDifferenceOptional,
NoInfer,
NonNullableUpdater,
Updater,
} from './utils'
import type { ParsedLocation } from './location'
export type IsRequiredParams<TParams> =
Record<never, never> extends TParams ? never : true
export interface ParsePathParamsResult<
in out TRequired,
in out TOptional,
in out TRest,
> {
required: TRequired
optional: TOptional
rest: TRest
}
export type AnyParsePathParamsResult = ParsePathParamsResult<
string,
string,
string
>
export type ParsePathParamsBoundaryStart<T extends string> =
T extends `${infer TLeft}{-${infer TRight}`
? ParsePathParamsResult<
ParsePathParams<TLeft>['required'],
| ParsePathParams<TLeft>['optional']
| ParsePathParams<TRight>['required']
| ParsePathParams<TRight>['optional'],
ParsePathParams<TRight>['rest']
>
: T extends `${infer TLeft}{${infer TRight}`
? ParsePathParamsResult<
| ParsePathParams<TLeft>['required']
| ParsePathParams<TRight>['required'],
| ParsePathParams<TLeft>['optional']
| ParsePathParams<TRight>['optional'],
ParsePathParams<TRight>['rest']
>
: never
export type ParsePathParamsSymbol<T extends string> =
T extends `${string}$${infer TRight}`
? TRight extends `${string}/${string}`
? TRight extends `${infer TParam}/${infer TRest}`
? TParam extends ''
? ParsePathParamsResult<
ParsePathParams<TRest>['required'],
'_splat' | ParsePathParams<TRest>['optional'],
ParsePathParams<TRest>['rest']
>
: ParsePathParamsResult<
TParam | ParsePathParams<TRest>['required'],
ParsePathParams<TRest>['optional'],
ParsePathParams<TRest>['rest']
>
: never
: TRight extends ''
? ParsePathParamsResult<never, '_splat', never>
: ParsePathParamsResult<TRight, never, never>
: never
export type ParsePathParamsBoundaryEnd<T extends string> =
T extends `${infer TLeft}}${infer TRight}`
? ParsePathParamsResult<
| ParsePathParams<TLeft>['required']
| ParsePathParams<TRight>['required'],
| ParsePathParams<TLeft>['optional']
| ParsePathParams<TRight>['optional'],
ParsePathParams<TRight>['rest']
>
: never
export type ParsePathParamsEscapeStart<T extends string> =
T extends `${infer TLeft}[${infer TRight}`
? ParsePathParamsResult<
| ParsePathParams<TLeft>['required']
| ParsePathParams<TRight>['required'],
| ParsePathParams<TLeft>['optional']
| ParsePathParams<TRight>['optional'],
ParsePathParams<TRight>['rest']
>
: never
export type ParsePathParamsEscapeEnd<T extends string> =
T extends `${string}]${infer TRight}` ? ParsePathParams<TRight> : never
export type ParsePathParams<T extends string> = T extends `${string}[${string}`
? ParsePathParamsEscapeStart<T>
: T extends `${string}]${string}`
? ParsePathParamsEscapeEnd<T>
: T extends `${string}}${string}`
? ParsePathParamsBoundaryEnd<T>
: T extends `${string}{${string}`
? ParsePathParamsBoundaryStart<T>
: T extends `${string}$${string}`
? ParsePathParamsSymbol<T>
: never
export type AddTrailingSlash<T> = T extends `${string}/` ? T : `${T & string}/`
export type RemoveTrailingSlashes<T> = T & `${string}/` extends never
? T
: T extends `${infer R}/`
? R
: T
export type AddLeadingSlash<T> = T & `/${string}` extends never
? `/${T & string}`
: T
export type RemoveLeadingSlashes<T> = T & `/${string}` extends never
? T
: T extends `/${infer R}`
? R
: T
type JoinPath<TLeft extends string, TRight extends string> = TRight extends ''
? TLeft
: TLeft extends ''
? TRight
: `${RemoveTrailingSlashes<TLeft>}/${RemoveLeadingSlashes<TRight>}`
type RemoveLastSegment<
T extends string,
TAcc extends string = '',
> = T extends `${infer TSegment}/${infer TRest}`
? TRest & `${string}/${string}` extends never
? TRest extends ''
? TAcc
: `${TAcc}${TSegment}`
: RemoveLastSegment<TRest, `${TAcc}${TSegment}/`>
: TAcc
export type ResolveCurrentPath<
TFrom extends string,
TTo extends string,
> = TTo extends '.'
? TFrom
: TTo extends './'
? AddTrailingSlash<TFrom>
: TTo & `./${string}` extends never
? never
: TTo extends `./${infer TRest}`
? AddLeadingSlash<JoinPath<TFrom, TRest>>
: never
export type ResolveParentPath<
TFrom extends string,
TTo extends string,
> = TTo extends '../' | '..'
? TFrom extends '' | '/'
? never
: AddLeadingSlash<RemoveLastSegment<TFrom>>
: TTo & `../${string}` extends never
? AddLeadingSlash<JoinPath<TFrom, TTo>>
: TFrom extends '' | '/'
? never
: TTo extends `../${infer ToRest}`
? ResolveParentPath<RemoveLastSegment<TFrom>, ToRest>
: AddLeadingSlash<JoinPath<TFrom, TTo>>
export type ResolveRelativePath<TFrom, TTo = '.'> = string extends TFrom
? TTo
: string extends TTo
? TFrom
: undefined extends TTo
? TFrom
: TTo extends string
? TFrom extends string
? TTo extends `/${string}`
? TTo
: TTo extends `..${string}`
? ResolveParentPath<TFrom, TTo>
: TTo extends `.${string}`
? ResolveCurrentPath<TFrom, TTo>
: AddLeadingSlash<JoinPath<TFrom, TTo>>
: never
: never
export type FindDescendantToPaths<
TRouter extends AnyRouter,
TPrefix extends string,
> = `${TPrefix}/${string}` & RouteToPath<TRouter>
export type InferDescendantToPaths<
TRouter extends AnyRouter,
TPrefix extends string,
TPaths = FindDescendantToPaths<TRouter, TPrefix>,
> = TPaths extends `${TPrefix}/`
? never
: TPaths extends `${TPrefix}/${infer TRest}`
? TRest
: never
export type RelativeToPath<
TRouter extends AnyRouter,
TTo extends string,
TResolvedPath extends string,
> =
| (TResolvedPath & RouteToPath<TRouter> extends never
? never
: ToPath<TRouter, TTo>)
| `${RemoveTrailingSlashes<TTo>}/${InferDescendantToPaths<TRouter, RemoveTrailingSlashes<TResolvedPath>>}`
export type RelativeToParentPath<
TRouter extends AnyRouter,
TFrom extends string,
TTo extends string,
TResolvedPath extends string = ResolveRelativePath<TFrom, TTo>,
> =
| RelativeToPath<TRouter, TTo, TResolvedPath>
| (TTo extends `${string}..` | `${string}../`
? TResolvedPath extends '/' | ''
? never
: FindDescendantToPaths<
TRouter,
RemoveTrailingSlashes<TResolvedPath>
> extends never
? never
: `${RemoveTrailingSlashes<TTo>}/${ParentPath<TRouter>}`
: never)
export type RelativeToCurrentPath<
TRouter extends AnyRouter,
TFrom extends string,
TTo extends string,
TResolvedPath extends string = ResolveRelativePath<TFrom, TTo>,
> = RelativeToPath<TRouter, TTo, TResolvedPath> | CurrentPath<TRouter>
export type AbsoluteToPath<TRouter extends AnyRouter, TFrom extends string> =
| (string extends TFrom
? CurrentPath<TRouter>
: TFrom extends `/`
? never
: CurrentPath<TRouter>)
| (string extends TFrom
? ParentPath<TRouter>
: TFrom extends `/`
? never
: ParentPath<TRouter>)
| RouteToPath<TRouter>
| (TFrom extends '/'
? never
: string extends TFrom
? never
: InferDescendantToPaths<TRouter, RemoveTrailingSlashes<TFrom>>)
export type RelativeToPathAutoComplete<
TRouter extends AnyRouter,
TFrom extends string,
TTo extends string,
> = string extends TTo
? string
: string extends TFrom
? AbsoluteToPath<TRouter, TFrom>
: TTo & `..${string}` extends never
? TTo & `.${string}` extends never
? AbsoluteToPath<TRouter, TFrom>
: RelativeToCurrentPath<TRouter, TFrom, TTo>
: RelativeToParentPath<TRouter, TFrom, TTo>
export type NavigateOptions<
TRouter extends AnyRouter = RegisteredRouter,
TFrom extends string = string,
TTo extends string | undefined = '.',
TMaskFrom extends string = TFrom,
TMaskTo extends string = '.',
> = ToOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & NavigateOptionProps
/**
* The NavigateOptions type is used to describe the options that can be used when describing a navigation action in TanStack Router.
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType)
*/
export interface NavigateOptionProps {
/**
* If set to `true`, the router will scroll the element with an id matching the hash into view with default `ScrollIntoViewOptions`.
* If set to `false`, the router will not scroll the element with an id matching the hash into view.
* If set to `ScrollIntoViewOptions`, the router will scroll the element with an id matching the hash into view with the provided options.
* @default true
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#hashscrollintoview)
* @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)
*/
hashScrollIntoView?: boolean | ScrollIntoViewOptions
/**
* `replace` is a boolean that determines whether the navigation should replace the current history entry or push a new one.
* @default false
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#replace)
*/
replace?: boolean
/**
* Defaults to `true` so that the scroll position will be reset to 0,0 after the location is committed to the browser history.
* If `false`, the scroll position will not be reset to 0,0 after the location is committed to history.
* @default true
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#resetscroll)
*/
resetScroll?: boolean
/** @deprecated All navigations now use startTransition under the hood */
startTransition?: boolean
/**
* If set to `true`, the router will wrap the resulting navigation in a `document.startViewTransition()` call.
* If `ViewTransitionOptions`, route navigations will be called using `document.startViewTransition({update, types})`
* where `types` will be the strings array passed with `ViewTransitionOptions["types"]`.
* If the browser does not support viewTransition types, the navigation will fall back to normal `document.startTransition()`, same as if `true` was passed.
*
* If the browser does not support this api, this option will be ignored.
* @default false
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#viewtransition)
* @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition)
* @see [Google](https://developer.chrome.com/docs/web-platform/view-transitions/same-document#view-transition-types)
*/
viewTransition?: boolean | ViewTransitionOptions
/**
* If `true`, navigation will ignore any blockers that might prevent it.
* @default false
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#ignoreblocker)
*/
ignoreBlocker?: boolean
/**
* If `true`, navigation to a route inside of router will trigger a full page load instead of the traditional SPA navigation.
* @default false
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#reloaddocument)
*/
reloadDocument?: boolean
/**
* This can be used instead of `to` to navigate to a fully built href, e.g. pointing to an external target.
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
*/
href?: string
/** @internal */
publicHref?: string
}
export type ToOptions<
TRouter extends AnyRouter = RegisteredRouter,
TFrom extends string = string,
TTo extends string | undefined = '.',
TMaskFrom extends string = TFrom,
TMaskTo extends string = '.',
> = ToSubOptions<TRouter, TFrom, TTo> & MaskOptions<TRouter, TMaskFrom, TMaskTo>
export interface MaskOptions<
in out TRouter extends AnyRouter,
in out TMaskFrom extends string,
in out TMaskTo extends string,
> {
_fromLocation?: ParsedLocation
mask?: ToMaskOptions<TRouter, TMaskFrom, TMaskTo>
}
export type ToMaskOptions<
TRouter extends AnyRouter = RegisteredRouter,
TMaskFrom extends string = string,
TMaskTo extends string = '.',
> = ToSubOptions<TRouter, TMaskFrom, TMaskTo> & {
unmaskOnReload?: boolean
}
export type ToSubOptions<
TRouter extends AnyRouter = RegisteredRouter,
TFrom extends string = string,
TTo extends string | undefined = '.',
> = ToSubOptionsProps<TRouter, TFrom, TTo> &
SearchParamOptions<TRouter, TFrom, TTo> &
PathParamOptions<TRouter, TFrom, TTo>
export interface RequiredToOptions<
in out TRouter extends AnyRouter,
in out TFrom extends string,
in out TTo extends string | undefined,
> {
/**
* The internal route path to navigate to. This should be a relative or absolute path within your application.
* For external URLs, use the `href` property instead.
* @example "/dashboard" or "../profile"
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
*/
to: ToPathOption<TRouter, TFrom, TTo> & {}
}
export interface OptionalToOptions<
in out TRouter extends AnyRouter,
in out TFrom extends string,
in out TTo extends string | undefined,
> {
/**
* The internal route path to navigate to. This should be a relative or absolute path within your application.
* For external URLs, use the `href` property instead.
* @example "/dashboard" or "../profile"
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
*/
to?: ToPathOption<TRouter, TFrom, TTo> & {}
}
export type MakeToRequired<
TRouter extends AnyRouter,
TFrom extends string,
TTo extends string | undefined,
> = string extends TFrom
? string extends TTo
? OptionalToOptions<TRouter, TFrom, TTo>
: TTo & CatchAllPaths<TRouter> extends never
? RequiredToOptions<TRouter, TFrom, TTo>
: OptionalToOptions<TRouter, TFrom, TTo>
: OptionalToOptions<TRouter, TFrom, TTo>
export type ToSubOptionsProps<
TRouter extends AnyRouter = RegisteredRouter,
TFrom extends RoutePaths<TRouter['routeTree']> | string = string,
TTo extends string | undefined = '.',
> = MakeToRequired<TRouter, TFrom, TTo> & {
hash?: true | Updater<string>
state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>
from?: FromPathOption<TRouter, TFrom> & {}
unsafeRelative?: 'path'
}
export type ParamsReducerFn<
in out TRouter extends AnyRouter,
in out TParamVariant extends ParamVariant,
in out TFrom,
in out TTo,
> = (
current: Expand<ResolveFromParams<TRouter, TParamVariant, TFrom>>,
) => Expand<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>>
type ParamsReducer<
TRouter extends AnyRouter,
TParamVariant extends ParamVariant,
TFrom,
TTo,
> =
| Expand<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>>
| (ParamsReducerFn<TRouter, TParamVariant, TFrom, TTo> & {})
type ParamVariant = 'PATH' | 'SEARCH'
export type ResolveRoute<
TRouter extends AnyRouter,
TFrom,
TTo,
TPath = ResolveRelativePath<TFrom, TTo>,
> = TPath extends string
? TFrom extends TPath
? RouteByPath<TRouter['routeTree'], TPath>
: RouteByToPath<TRouter, TPath>
: never
type ResolveFromParamType<TParamVariant extends ParamVariant> =
TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchema'
type ResolveFromAllParams<
TRouter extends AnyRouter,
TParamVariant extends ParamVariant,
> = TParamVariant extends 'PATH'
? AllParams<TRouter['routeTree']>
: FullSearchSchema<TRouter['routeTree']>
type ResolveFromParams<
TRouter extends AnyRouter,
TParamVariant extends ParamVariant,
TFrom,
> = string extends TFrom
? ResolveFromAllParams<TRouter, TParamVariant>
: RouteByPath<
TRouter['routeTree'],
TFrom
>['types'][ResolveFromParamType<TParamVariant>]
type ResolveToParamType<TParamVariant extends ParamVariant> =
TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchemaInput'
type ResolveAllToParams<
TRouter extends AnyRouter,
TParamVariant extends ParamVariant,
> = TParamVariant extends 'PATH'
? AllParams<TRouter['routeTree']>
: FullSearchSchemaInput<TRouter['routeTree']>
export type ResolveToParams<
TRouter extends AnyRouter,
TParamVariant extends ParamVariant,
TFrom,
TTo,
> =
ResolveRelativePath<TFrom, TTo> extends infer TPath
? undefined extends TPath
? never
: string extends TPath
? ResolveAllToParams<TRouter, TParamVariant>
: TPath extends CatchAllPaths<TRouter>
? ResolveAllToParams<TRouter, TParamVariant>
: ResolveRoute<
TRouter,
TFrom,
TTo
>['types'][ResolveToParamType<TParamVariant>]
: never
type ResolveRelativeToParams<
TRouter extends AnyRouter,
TParamVariant extends ParamVariant,
TFrom,
TTo,
TToParams = ResolveToParams<TRouter, TParamVariant, TFrom, TTo>,
> = TParamVariant extends 'SEARCH'
? TToParams
: string extends TFrom
? TToParams
: MakeDifferenceOptional<
ResolveFromParams<TRouter, TParamVariant, TFrom>,
TToParams
>
export interface MakeOptionalSearchParams<
in out TRouter extends AnyRouter,
in out TFrom,
in out TTo,
> {
search?: true | (ParamsReducer<TRouter, 'SEARCH', TFrom, TTo> & {})
}
export interface MakeOptionalPathParams<
in out TRouter extends AnyRouter,
in out TFrom,
in out TTo,
> {
params?: true | (ParamsReducer<TRouter, 'PATH', TFrom, TTo> & {})
}
type MakeRequiredParamsReducer<
TRouter extends AnyRouter,
TParamVariant extends ParamVariant,
TFrom,
TTo,
> =
| (string extends TFrom
? never
: ResolveFromParams<
TRouter,
TParamVariant,
TFrom
> extends ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>
? true
: never)
| (ParamsReducer<TRouter, TParamVariant, TFrom, TTo> & {})
export interface MakeRequiredPathParams<
in out TRouter extends AnyRouter,
in out TFrom,
in out TTo,
> {
params: MakeRequiredParamsReducer<TRouter, 'PATH', TFrom, TTo> & {}
}
export interface MakeRequiredSearchParams<
in out TRouter extends AnyRouter,
in out TFrom,
in out TTo,
> {
search: MakeRequiredParamsReducer<TRouter, 'SEARCH', TFrom, TTo> & {}
}
export type IsRequired<
TRouter extends AnyRouter,
TParamVariant extends ParamVariant,
TFrom,
TTo,
> =
ResolveRelativePath<TFrom, TTo> extends infer TPath
? undefined extends TPath
? never
: TPath extends CatchAllPaths<TRouter>
? never
: IsRequiredParams<
ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>
>
: never
export type SearchParamOptions<TRouter extends AnyRouter, TFrom, TTo> =
IsRequired<TRouter, 'SEARCH', TFrom, TTo> extends never
? MakeOptionalSearchParams<TRouter, TFrom, TTo>
: MakeRequiredSearchParams<TRouter, TFrom, TTo>
export type PathParamOptions<TRouter extends AnyRouter, TFrom, TTo> =
IsRequired<TRouter, 'PATH', TFrom, TTo> extends never
? MakeOptionalPathParams<TRouter, TFrom, TTo>
: MakeRequiredPathParams<TRouter, TFrom, TTo>
export type ToPathOption<
TRouter extends AnyRouter = AnyRouter,
TFrom extends string = string,
TTo extends string | undefined = string,
> = ConstrainLiteral<
TTo,
RelativeToPathAutoComplete<
TRouter,
NoInfer<TFrom> extends string ? NoInfer<TFrom> : '',
NoInfer<TTo> & string
>
>
export type FromPathOption<TRouter extends AnyRouter, TFrom> = ConstrainLiteral<
TFrom,
RoutePaths<TRouter['routeTree']>
>
/**
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/navigation#active-options)
*/
export interface ActiveOptions {
/**
* If true, the link will be active if the current route matches the `to` route path exactly (no children routes)
* @default false
*/
exact?: boolean
/**
* If true, the link will only be active if the current URL hash matches the `hash` prop
* @default false
*/
includeHash?: boolean
/**
* If true, the link will only be active if the current URL search params inclusively match the `search` prop
* @default true
*/
includeSearch?: boolean
/**
* This modifies the `includeSearch` behavior.
* If true, properties in `search` that are explicitly `undefined` must NOT be present in the current URL search params for the link to be active.
* @default false
*/
explicitUndefined?: boolean
}
export interface LinkOptionsProps {
/**
* The standard anchor tag target attribute
*/
target?: HTMLAnchorElement['target']
/**
* Configurable options to determine if the link should be considered active or not
* @default {exact:true,includeHash:true}
*/
activeOptions?: ActiveOptions
/**
* The preloading strategy for this link
* - `false` - No preloading
* - `'intent'` - Preload the linked route on hover and cache it for this many milliseconds in hopes that the user will eventually navigate there.
* - `'viewport'` - Preload the linked route when it enters the viewport
*/
preload?: false | 'intent' | 'viewport' | 'render'
/**
* When a preload strategy is set, this delays the preload by this many milliseconds.
* If the user exits the link before this delay, the preload will be cancelled.
*/
preloadDelay?: number
/**
* Control whether the link should be disabled or not
* If set to `true`, the link will be rendered without an `href` attribute
* @default false
*/
disabled?: boolean
/**
* When the preload strategy is set to `intent`, this controls the proximity of the link to the cursor before it is preloaded.
* If the user exits this proximity before this delay, the preload will be cancelled.
*/
preloadIntentProximity?: number
}
export type LinkOptions<
TRouter extends AnyRouter = RegisteredRouter,
TFrom extends string = string,
TTo extends string | undefined = '.',
TMaskFrom extends string = TFrom,
TMaskTo extends string = '.',
> = NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & LinkOptionsProps
export const preloadWarning = 'Error preloading route! ☝️'
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2019: LibDefinition;
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _classPrivateFieldSet;
var _classApplyDescriptorSet = require("classApplyDescriptorSet");
var _classPrivateFieldGet = require("classPrivateFieldGet2");
function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = _classPrivateFieldGet(privateMap, receiver);
_classApplyDescriptorSet(receiver, descriptor, value);
return value;
}
//# sourceMappingURL=classPrivateFieldSet.js.map
@@ -0,0 +1,24 @@
/**
* @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 SaveAll = createLucideIcon("SaveAll", [
["path", { d: "M10 2v3a1 1 0 0 0 1 1h5", key: "1xspal" }],
["path", { d: "M18 18v-6a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6", key: "1ra60u" }],
["path", { d: "M18 22H4a2 2 0 0 1-2-2V6", key: "pblm9e" }],
[
"path",
{
d: "M8 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9.172a2 2 0 0 1 1.414.586l2.828 2.828A2 2 0 0 1 22 6.828V16a2 2 0 0 1-2.01 2z",
key: "1yve0x"
}
]
]);
export { SaveAll as default };
//# sourceMappingURL=save-all.js.map
@@ -0,0 +1 @@
{"version":3,"file":"file-image.js","sources":["../../../src/icons/file-image.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileImage\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMkg2YTIgMiAwIDAgMC0yIDJ2MTZhMiAyIDAgMCAwIDIgMmgxMmEyIDIgMCAwIDAgMi0yVjdaIiAvPgogIDxwYXRoIGQ9Ik0xNCAydjRhMiAyIDAgMCAwIDIgMmg0IiAvPgogIDxjaXJjbGUgY3g9IjEwIiBjeT0iMTIiIHI9IjIiIC8+CiAgPHBhdGggZD0ibTIwIDE3LTEuMjk2LTEuMjk2YTIuNDEgMi40MSAwIDAgMC0zLjQwOCAwTDkgMjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/file-image\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 FileImage = createLucideIcon('FileImage', [\n ['path', { d: 'M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z', key: '1rqfz7' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['circle', { cx: '10', cy: '12', r: '2', key: '737tya' }],\n ['path', { d: 'm20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22', key: 'wt3hpn' }],\n]);\n\nexport default FileImage;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,C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A,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAClF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,141 @@
import { f as createRule, g as import_ast_utils, m as AST_NODE_TYPES } from "../utils.js";
var semi_spacing_default = createRule({
name: "semi-spacing",
meta: {
type: "layout",
docs: { description: "Enforce consistent spacing before and after semicolons" },
fixable: "whitespace",
schema: [{
type: "object",
properties: {
before: { type: "boolean" },
after: { type: "boolean" }
},
additionalProperties: false
}],
defaultOptions: [{
before: false,
after: true
}],
messages: {
unexpectedWhitespaceBefore: "Unexpected whitespace before semicolon.",
unexpectedWhitespaceAfter: "Unexpected whitespace after semicolon.",
missingWhitespaceBefore: "Missing whitespace before semicolon.",
missingWhitespaceAfter: "Missing whitespace after semicolon."
}
},
create(context, [config]) {
const { before: requireSpaceBefore, after: requireSpaceAfter } = config;
const sourceCode = context.sourceCode;
function hasLeadingSpace(token) {
const tokenBefore = sourceCode.getTokenBefore(token);
return tokenBefore && (0, import_ast_utils.isTokenOnSameLine)(tokenBefore, token) && sourceCode.isSpaceBetween(tokenBefore, token);
}
function hasTrailingSpace(token) {
const tokenAfter = sourceCode.getTokenAfter(token);
return tokenAfter && (0, import_ast_utils.isTokenOnSameLine)(token, tokenAfter) && sourceCode.isSpaceBetween(token, tokenAfter);
}
function isLastTokenInCurrentLine(token) {
const tokenAfter = sourceCode.getTokenAfter(token);
return !(tokenAfter && (0, import_ast_utils.isTokenOnSameLine)(token, tokenAfter));
}
function isFirstTokenInCurrentLine(token) {
const tokenBefore = sourceCode.getTokenBefore(token);
return !(tokenBefore && (0, import_ast_utils.isTokenOnSameLine)(token, tokenBefore));
}
function isBeforeClosingParen(token) {
const nextToken = sourceCode.getTokenAfter(token);
return nextToken && (0, import_ast_utils.isClosingBraceToken)(nextToken) || (0, import_ast_utils.isClosingParenToken)(nextToken);
}
function checkSemicolonSpacing(token, node) {
if ((0, import_ast_utils.isSemicolonToken)(token)) {
if (hasLeadingSpace(token)) {
if (!requireSpaceBefore) {
const tokenBefore = sourceCode.getTokenBefore(token);
const loc = {
start: tokenBefore.loc.end,
end: token.loc.start
};
context.report({
node,
loc,
messageId: "unexpectedWhitespaceBefore",
fix(fixer) {
return fixer.removeRange([tokenBefore.range[1], token.range[0]]);
}
});
}
} else if (requireSpaceBefore) {
const loc = token.loc;
context.report({
node,
loc,
messageId: "missingWhitespaceBefore",
fix(fixer) {
return fixer.insertTextBefore(token, " ");
}
});
}
if (!isFirstTokenInCurrentLine(token) && !isLastTokenInCurrentLine(token) && !isBeforeClosingParen(token)) {
if (hasTrailingSpace(token)) {
if (!requireSpaceAfter) {
const tokenAfter = sourceCode.getTokenAfter(token);
const loc = {
start: token.loc.end,
end: tokenAfter.loc.start
};
context.report({
node,
loc,
messageId: "unexpectedWhitespaceAfter",
fix(fixer) {
return fixer.removeRange([token.range[1], tokenAfter.range[0]]);
}
});
}
} else if (requireSpaceAfter) {
const loc = token.loc;
context.report({
node,
loc,
messageId: "missingWhitespaceAfter",
fix(fixer) {
return fixer.insertTextAfter(token, " ");
}
});
}
}
}
}
function checkNode(node) {
checkSemicolonSpacing(sourceCode.getLastToken(node), node);
}
return {
VariableDeclaration: checkNode,
ExpressionStatement: checkNode,
BreakStatement: checkNode,
ContinueStatement: checkNode,
DebuggerStatement: checkNode,
DoWhileStatement: checkNode,
ReturnStatement: checkNode,
ThrowStatement: checkNode,
ImportDeclaration: checkNode,
ExportNamedDeclaration: checkNode,
ExportAllDeclaration: checkNode,
ExportDefaultDeclaration: checkNode,
ForStatement(node) {
if (node.init) checkSemicolonSpacing(sourceCode.getTokenAfter(node.init), node);
if (node.test) checkSemicolonSpacing(sourceCode.getTokenAfter(node.test), node);
},
PropertyDefinition: checkNode,
AccessorProperty: checkNode,
TSDeclareFunction: checkNode,
TSTypeAliasDeclaration: checkNode,
TSTypeAnnotation(node) {
const excludeNodeTypes = new Set([AST_NODE_TYPES.TSDeclareFunction]);
if (node.parent && !excludeNodeTypes.has(node.parent.type)) checkNode(node.parent);
}
};
}
});
export { semi_spacing_default as t };
@@ -0,0 +1,7 @@
{
"private": true,
"main": "../dist/es5/sidecar.js",
"jsnext:main": "../dist/es2015/sidecar.js",
"module": "../dist/es2015/sidecar.js",
"types": "sidecar.d.ts"
}
@@ -0,0 +1 @@
{"version":3,"file":"flask-conical.js","sources":["../../../src/icons/flask-conical.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FlaskConical\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTQgMnY2YTIgMiAwIDAgMCAuMjQ1Ljk2bDUuNTEgMTAuMDhBMiAyIDAgMCAxIDE4IDIySDZhMiAyIDAgMCAxLTEuNzU1LTIuOTZsNS41MS0xMC4wOEEyIDIgMCAwIDAgMTAgOFYyIiAvPgogIDxwYXRoIGQ9Ik02LjQ1MyAxNWgxMS4wOTQiIC8+CiAgPHBhdGggZD0iTTguNSAyaDciIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/flask-conical\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 FlaskConical = createLucideIcon('FlaskConical', [\n [\n 'path',\n {\n d: 'M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2',\n key: '18mbvz',\n },\n ],\n ['path', { d: 'M6.453 15h11.094', key: '3shlmq' }],\n ['path', { d: 'M8.5 2h7', key: 'csnxdl' }],\n]);\n\nexport default FlaskConical;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CACpD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACjD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"number.mjs","sources":["../../../../../src/value/types/maps/number.ts"],"sourcesContent":["import { int } from \"../int\"\nimport { alpha } from \"../numbers\"\nimport { px } from \"../numbers/units\"\nimport { transformValueTypes } from \"./transform\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const numberValueTypes: ValueTypeMap = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n\n // Typography\n fontSize: px,\n\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n\n ...transformValueTypes,\n zIndex: int,\n\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,gBAAgB,GAAiB;;AAE1C,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,mBAAmB,EAAE,EAAE;AACvB,IAAA,oBAAoB,EAAE,EAAE;AACxB,IAAA,uBAAuB,EAAE,EAAE;AAC3B,IAAA,sBAAsB,EAAE,EAAE;;AAG1B,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,aAAa,EAAE,EAAE;AACjB,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,cAAc,EAAE,EAAE;;AAGlB,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,aAAa,EAAE,EAAE;AACjB,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,aAAa,EAAE,EAAE;AACjB,IAAA,kBAAkB,EAAE,EAAE;AACtB,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,eAAe,EAAE,EAAE;;AAGnB,IAAA,QAAQ,EAAE,EAAE;;AAGZ,IAAA,mBAAmB,EAAE,EAAE;AACvB,IAAA,mBAAmB,EAAE,EAAE;AAEvB,IAAA,GAAG,mBAAmB;AACtB,IAAA,MAAM,EAAE,GAAG;;AAGX,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,UAAU,EAAE,GAAG;;;;;"}
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Bolt = createLucideIcon("Bolt", [
[
"path",
{
d: "M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",
key: "yt0hxn"
}
],
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }]
]);
export { Bolt as default };
//# sourceMappingURL=bolt.js.map
@@ -0,0 +1,186 @@
import { K as isSingleLine, f as createRule, m as AST_NODE_TYPES, p as deepMerge } from "../utils.js";
function isLastTokenEndOfLine(token, line) {
return token.loc.start.column === line.length - 1;
}
function isCommentsEndOfLine(token, comments, line) {
if (!comments) return false;
if (comments.loc.end.line > token.loc.end.line) return true;
return comments.loc.end.column === line.length;
}
function makeFixFunction({ optsNone, optsSemi, lastToken, commentsAfterLastToken, missingDelimiter, lastTokenLine, isSingleLine }) {
if (optsNone && !isLastTokenEndOfLine(lastToken, lastTokenLine) && !isCommentsEndOfLine(lastToken, commentsAfterLastToken, lastTokenLine) && !isSingleLine) return;
return (fixer) => {
if (optsNone) return fixer.remove(lastToken);
const token = optsSemi ? ";" : ",";
if (missingDelimiter) return fixer.insertTextAfter(lastToken, token);
return fixer.replaceText(lastToken, token);
};
}
const BASE_SCHEMA = {
type: "object",
properties: {
multiline: {
type: "object",
properties: {
delimiter: { $ref: "#/items/0/$defs/multiLineOption" },
requireLast: { type: "boolean" }
},
additionalProperties: false
},
singleline: {
type: "object",
properties: {
delimiter: { $ref: "#/items/0/$defs/singleLineOption" },
requireLast: { type: "boolean" }
},
additionalProperties: false
}
},
additionalProperties: false
};
var member_delimiter_style_default = createRule({
name: "member-delimiter-style",
meta: {
type: "layout",
docs: { description: "Require a specific member delimiter style for interfaces and type literals" },
fixable: "whitespace",
schema: [{
$defs: {
multiLineOption: {
type: "string",
enum: [
"none",
"semi",
"comma"
]
},
singleLineOption: {
type: "string",
enum: ["semi", "comma"]
},
delimiterConfig: BASE_SCHEMA
},
type: "object",
properties: {
...BASE_SCHEMA.properties,
overrides: {
type: "object",
properties: {
interface: { $ref: "#/items/0/$defs/delimiterConfig" },
typeLiteral: { $ref: "#/items/0/$defs/delimiterConfig" }
},
additionalProperties: false
},
multilineDetection: {
type: "string",
enum: ["brackets", "last-member"]
}
},
additionalProperties: false
}],
defaultOptions: [{
multiline: {
delimiter: "semi",
requireLast: true
},
singleline: {
delimiter: "semi",
requireLast: false
},
multilineDetection: "brackets"
}],
messages: {
unexpectedComma: "Unexpected separator (,).",
unexpectedSemi: "Unexpected separator (;).",
expectedComma: "Expected a comma.",
expectedSemi: "Expected a semicolon."
}
},
create(context, [options]) {
const sourceCode = context.sourceCode;
const baseOptions = options;
const overrides = baseOptions.overrides ?? {};
const interfaceOptions = deepMerge(baseOptions, overrides.interface);
const typeLiteralOptions = deepMerge(baseOptions, overrides.typeLiteral);
function checkLastToken(member, opts, isLast) {
function getOption(type) {
if (isLast && !opts.requireLast) return type === "none";
return opts.delimiter === type;
}
let messageId = null;
let missingDelimiter = false;
const lastToken = sourceCode.getLastToken(member, { includeComments: false });
if (!lastToken) return;
const commentsAfterLastToken = sourceCode.getCommentsAfter(lastToken).pop();
const lastTokenLine = sourceCode.getLines()[lastToken?.loc.start.line - 1];
const optsSemi = getOption("semi");
const optsComma = getOption("comma");
const optsNone = getOption("none");
if (lastToken.value === ";") {
if (optsComma) messageId = "expectedComma";
else if (optsNone) {
missingDelimiter = true;
messageId = "unexpectedSemi";
}
} else if (lastToken.value === ",") {
if (optsSemi) messageId = "expectedSemi";
else if (optsNone) {
missingDelimiter = true;
messageId = "unexpectedComma";
}
} else if (optsSemi) {
missingDelimiter = true;
messageId = "expectedSemi";
} else if (optsComma) {
missingDelimiter = true;
messageId = "expectedComma";
}
if (messageId) context.report({
node: lastToken,
loc: {
start: {
line: lastToken.loc.end.line,
column: lastToken.loc.end.column
},
end: {
line: lastToken.loc.end.line,
column: lastToken.loc.end.column
}
},
messageId,
fix: makeFixFunction({
optsNone,
optsSemi,
lastToken,
commentsAfterLastToken,
missingDelimiter,
lastTokenLine,
isSingleLine: opts.type === "single-line"
})
});
}
function checkMemberSeparatorStyle(node) {
const members = node.type === AST_NODE_TYPES.TSInterfaceBody ? node.body : node.members;
let _isSingleLine = isSingleLine(node);
if (options.multilineDetection === "last-member" && !_isSingleLine && members.length > 0) {
if (members[members.length - 1].loc.end.line === node.loc.end.line) _isSingleLine = true;
}
const typeOpts = node.type === AST_NODE_TYPES.TSInterfaceBody ? interfaceOptions : typeLiteralOptions;
const opts = _isSingleLine ? {
...typeOpts.singleline,
type: "single-line"
} : {
...typeOpts.multiline,
type: "multi-line"
};
members.forEach((member, index) => {
checkLastToken(member, opts ?? {}, index === members.length - 1);
});
}
return {
TSInterfaceBody: checkMemberSeparatorStyle,
TSTypeLiteral: checkMemberSeparatorStyle
};
}
});
export { member_delimiter_style_default as t };
@@ -0,0 +1,196 @@
import { randomUUID } from 'node:crypto';
import express from 'express';
import { createOAuthMetadata, mcpAuthRouter } from '../../server/auth/router.js';
import { resourceUrlFromServerUrl } from '../../shared/auth-utils.js';
import { InvalidRequestError } from '../../server/auth/errors.js';
export class DemoInMemoryClientsStore {
constructor() {
this.clients = new Map();
}
async getClient(clientId) {
return this.clients.get(clientId);
}
async registerClient(clientMetadata) {
this.clients.set(clientMetadata.client_id, clientMetadata);
return clientMetadata;
}
}
/**
* 🚨 DEMO ONLY - NOT FOR PRODUCTION
*
* This example demonstrates MCP OAuth flow but lacks some of the features required for production use,
* for example:
* - Persistent token storage
* - Rate limiting
*/
export class DemoInMemoryAuthProvider {
constructor(validateResource) {
this.validateResource = validateResource;
this.clientsStore = new DemoInMemoryClientsStore();
this.codes = new Map();
this.tokens = new Map();
}
async authorize(client, params, res) {
const code = randomUUID();
const searchParams = new URLSearchParams({
code
});
if (params.state !== undefined) {
searchParams.set('state', params.state);
}
this.codes.set(code, {
client,
params
});
// Simulate a user login
// Set a secure HTTP-only session cookie with authorization info
if (res.cookie) {
const authCookieData = {
userId: 'demo_user',
name: 'Demo User',
timestamp: Date.now()
};
res.cookie('demo_session', JSON.stringify(authCookieData), {
httpOnly: true,
secure: false, // In production, this should be true
sameSite: 'lax',
maxAge: 24 * 60 * 60 * 1000, // 24 hours - for demo purposes
path: '/' // Available to all routes
});
}
if (!client.redirect_uris.includes(params.redirectUri)) {
throw new InvalidRequestError('Unregistered redirect_uri');
}
const targetUrl = new URL(params.redirectUri);
targetUrl.search = searchParams.toString();
res.redirect(targetUrl.toString());
}
async challengeForAuthorizationCode(client, authorizationCode) {
// Store the challenge with the code data
const codeData = this.codes.get(authorizationCode);
if (!codeData) {
throw new Error('Invalid authorization code');
}
return codeData.params.codeChallenge;
}
async exchangeAuthorizationCode(client, authorizationCode,
// Note: code verifier is checked in token.ts by default
// it's unused here for that reason.
_codeVerifier) {
const codeData = this.codes.get(authorizationCode);
if (!codeData) {
throw new Error('Invalid authorization code');
}
if (codeData.client.client_id !== client.client_id) {
throw new Error(`Authorization code was not issued to this client, ${codeData.client.client_id} != ${client.client_id}`);
}
if (this.validateResource && !this.validateResource(codeData.params.resource)) {
throw new Error(`Invalid resource: ${codeData.params.resource}`);
}
this.codes.delete(authorizationCode);
const token = randomUUID();
const tokenData = {
token,
clientId: client.client_id,
scopes: codeData.params.scopes || [],
expiresAt: Date.now() + 3600000, // 1 hour
resource: codeData.params.resource,
type: 'access'
};
this.tokens.set(token, tokenData);
return {
access_token: token,
token_type: 'bearer',
expires_in: 3600,
scope: (codeData.params.scopes || []).join(' ')
};
}
async exchangeRefreshToken(_client, _refreshToken, _scopes, _resource) {
throw new Error('Not implemented for example demo');
}
async verifyAccessToken(token) {
const tokenData = this.tokens.get(token);
if (!tokenData || !tokenData.expiresAt || tokenData.expiresAt < Date.now()) {
throw new Error('Invalid or expired token');
}
return {
token,
clientId: tokenData.clientId,
scopes: tokenData.scopes,
expiresAt: Math.floor(tokenData.expiresAt / 1000),
resource: tokenData.resource
};
}
}
export const setupAuthServer = ({ authServerUrl, mcpServerUrl, strictResource }) => {
// Create separate auth server app
// NOTE: This is a separate app on a separate port to illustrate
// how to separate an OAuth Authorization Server from a Resource
// server in the SDK. The SDK is not intended to be provide a standalone
// authorization server.
const validateResource = strictResource
? (resource) => {
if (!resource)
return false;
const expectedResource = resourceUrlFromServerUrl(mcpServerUrl);
return resource.toString() === expectedResource.toString();
}
: undefined;
const provider = new DemoInMemoryAuthProvider(validateResource);
const authApp = express();
authApp.use(express.json());
// For introspection requests
authApp.use(express.urlencoded());
// Add OAuth routes to the auth server
// NOTE: this will also add a protected resource metadata route,
// but it won't be used, so leave it.
authApp.use(mcpAuthRouter({
provider,
issuerUrl: authServerUrl,
scopesSupported: ['mcp:tools']
}));
authApp.post('/introspect', async (req, res) => {
try {
const { token } = req.body;
if (!token) {
res.status(400).json({ error: 'Token is required' });
return;
}
const tokenInfo = await provider.verifyAccessToken(token);
res.json({
active: true,
client_id: tokenInfo.clientId,
scope: tokenInfo.scopes.join(' '),
exp: tokenInfo.expiresAt,
aud: tokenInfo.resource
});
return;
}
catch (error) {
res.status(401).json({
active: false,
error: 'Unauthorized',
error_description: `Invalid token: ${error}`
});
}
});
const auth_port = authServerUrl.port;
// Start the auth server
authApp.listen(auth_port, error => {
if (error) {
console.error('Failed to start server:', error);
process.exit(1);
}
console.log(`OAuth Authorization Server listening on port ${auth_port}`);
});
// Note: we could fetch this from the server, but then we end up
// with some top level async which gets annoying.
const oauthMetadata = createOAuthMetadata({
provider,
issuerUrl: authServerUrl,
scopesSupported: ['mcp:tools']
});
oauthMetadata.introspection_endpoint = new URL('/introspect', authServerUrl).href;
return oauthMetadata;
};
//# sourceMappingURL=demoInMemoryOAuthProvider.js.map
@@ -0,0 +1,46 @@
# has-symbols <sup>[![Version Badge][2]][1]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][11]][1]
Determine if the JS environment has Symbol support. Supports spec, or shams.
## Example
```js
var hasSymbols = require('has-symbols');
hasSymbols() === true; // if the environment has native Symbol support. Not polyfillable, not forgeable.
var hasSymbolsKinda = require('has-symbols/shams');
hasSymbolsKinda() === true; // if the environment has a Symbol sham that mostly follows the spec.
```
## Supported Symbol shams
- get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols)
- core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js)
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[1]: https://npmjs.org/package/has-symbols
[2]: https://versionbadg.es/inspect-js/has-symbols.svg
[5]: https://david-dm.org/inspect-js/has-symbols.svg
[6]: https://david-dm.org/inspect-js/has-symbols
[7]: https://david-dm.org/inspect-js/has-symbols/dev-status.svg
[8]: https://david-dm.org/inspect-js/has-symbols#info=devDependencies
[11]: https://nodei.co/npm/has-symbols.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/has-symbols.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/has-symbols.svg
[downloads-url]: https://npm-stat.com/charts.html?package=has-symbols
[codecov-image]: https://codecov.io/gh/inspect-js/has-symbols/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/has-symbols/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-symbols
[actions-url]: https://github.com/inspect-js/has-symbols/actions
@@ -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 DoorOpen = createLucideIcon("DoorOpen", [
["path", { d: "M13 4h3a2 2 0 0 1 2 2v14", key: "hrm0s9" }],
["path", { d: "M2 20h3", key: "1gaodv" }],
["path", { d: "M13 20h9", key: "s90cdi" }],
["path", { d: "M10 12v.01", key: "vx6srw" }],
[
"path",
{
d: "M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",
key: "199qr4"
}
]
]);
export { DoorOpen as default };
//# sourceMappingURL=door-open.js.map
@@ -0,0 +1,33 @@
/**
* Verifying JSON Web Signature (JWS) in Compact Serialization
*
* @module
*/
import type * as types from '../../types.d.ts';
/**
* Interface for Compact JWS Verification dynamic key resolution. No token components have been
* verified at the time of this function call.
*
* @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set.
*/
export interface CompactVerifyGetKey extends types.GenericGetKeyFunction<types.CompactJWSHeaderParameters, types.FlattenedJWSInput, types.CryptoKey | types.KeyObject | types.JWK | Uint8Array> {
}
/**
* Verifies the signature and format of and afterwards decodes the Compact JWS.
*
* This function is exported (as a named export) from the main `'jose'` module entry point as well
* as from its subpath export `'jose/jws/compact/verify'`.
*
* @param jws Compact JWS.
* @param key Key to verify the JWS with. See
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
* @param options JWS Verify options.
*/
export declare function compactVerify(jws: string | Uint8Array, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.VerifyOptions): Promise<types.CompactVerifyResult>;
/**
* @param jws Compact JWS.
* @param getKey Function resolving a key to verify the JWS with. See
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
* @param options JWS Verify options.
*/
export declare function compactVerify(jws: string | Uint8Array, getKey: CompactVerifyGetKey, options?: types.VerifyOptions): Promise<types.CompactVerifyResult & types.ResolvedKey>;
@@ -0,0 +1,190 @@
import { expectTypeOf, test } from "vitest";
import * as z from "zod/mini";
test("assignability", () => {
// $ZodString
z.string() satisfies z.core.$ZodString;
// $ZodNumber
z.number() satisfies z.core.$ZodNumber;
// $ZodBigInt
z.bigint() satisfies z.core.$ZodBigInt;
// $ZodBoolean
z.boolean() satisfies z.core.$ZodBoolean;
// $ZodDate
z.date() satisfies z.core.$ZodDate;
// $ZodSymbol
z.symbol() satisfies z.core.$ZodSymbol;
// $ZodUndefined
z.undefined() satisfies z.core.$ZodUndefined;
// $ZodNullable
z.nullable(z.string()) satisfies z.core.$ZodNullable;
// $ZodNull
z.null() satisfies z.core.$ZodNull;
// $ZodAny
z.any() satisfies z.core.$ZodAny;
// $ZodUnknown
z.unknown() satisfies z.core.$ZodUnknown;
// $ZodNever
z.never() satisfies z.core.$ZodNever;
// $ZodVoid
z.void() satisfies z.core.$ZodVoid;
// $ZodArray
z.array(z.string()) satisfies z.core.$ZodArray;
// $ZodObject
z.object({ key: z.string() }) satisfies z.core.$ZodObject;
// $ZodUnion
z.union([z.string(), z.number()]) satisfies z.core.$ZodUnion;
// $ZodIntersection
z.intersection(z.string(), z.number()) satisfies z.core.$ZodIntersection;
// $ZodTuple
z.tuple([z.string(), z.number()]) satisfies z.core.$ZodTuple;
// $ZodRecord
z.record(z.string(), z.number()) satisfies z.core.$ZodRecord;
// $ZodMap
z.map(z.string(), z.number()) satisfies z.core.$ZodMap;
// $ZodSet
z.set(z.string()) satisfies z.core.$ZodSet;
// $ZodLiteral
z.literal("example") satisfies z.core.$ZodLiteral;
// $ZodEnum
z.enum(["a", "b", "c"]) satisfies z.core.$ZodEnum;
// $ZodPromise
z.promise(z.string()) satisfies z.core.$ZodPromise;
// $ZodLazy
const lazySchema = z.lazy(() => z.string());
lazySchema satisfies z.core.$ZodLazy;
// $ZodOptional
z.optional(z.string()) satisfies z.core.$ZodOptional;
// $ZodDefault
z._default(z.string(), "default") satisfies z.core.$ZodDefault;
// $ZodTemplateLiteral
z.templateLiteral([z.literal("a"), z.literal("b")]) satisfies z.core.$ZodTemplateLiteral;
// $ZodCustom
z.custom<string>((val) => typeof val === "string") satisfies z.core.$ZodCustom;
// $ZodTransform
z.transform((val) => val as string) satisfies z.core.$ZodTransform;
// $ZodNonOptional
z.nonoptional(z.optional(z.string())) satisfies z.core.$ZodNonOptional;
// $ZodReadonly
z.readonly(z.object({ key: z.string() })) satisfies z.core.$ZodReadonly;
// $ZodNaN
z.nan() satisfies z.core.$ZodNaN;
// $ZodPipe
z.pipe(z.unknown(), z.number()) satisfies z.core.$ZodPipe;
// $ZodSuccess
z.success(z.string()) satisfies z.core.$ZodSuccess;
// $ZodCatch
z.catch(z.string(), "fallback") satisfies z.core.$ZodCatch;
// $ZodFile
z.file() satisfies z.core.$ZodFile;
});
test("toZod", () => {
type Company = {
id: string;
name: string;
webAddress: string | null;
};
const CompanySchema = z.object({
id: z.string(),
name: z.string(),
webAddress: z.nullable(z.string()),
});
const Company = z.toZod<Company>()(CompanySchema);
expectTypeOf<z.output<typeof Company>>().toEqualTypeOf<Company>();
const CoreCompany = z.core.toZod<Company>()(CompanySchema);
expectTypeOf<z.output<typeof CoreCompany>>().toEqualTypeOf<Company>();
const UtilCompany = z.core.util.toZod<Company>()(CompanySchema);
expectTypeOf<z.output<typeof UtilCompany>>().toEqualTypeOf<Company>();
const Transformed = z.toZod<{ count: number }>()(
z.object({
count: z.pipe(
z.string(),
z.transform((value) => value.length)
),
})
);
expectTypeOf<z.input<typeof Transformed>>().toEqualTypeOf<{ count: string }>();
expectTypeOf<z.output<typeof Transformed>>().toEqualTypeOf<{ count: number }>();
z.toZod<Company>()(
// @ts-expect-error missing optional keys still fail exact output matching
z.object({
id: z.string(),
name: z.string(),
})
);
z.toZod<Company>()(
// @ts-expect-error extra keys fail exact output matching
z.object({
id: z.string(),
name: z.string(),
webAddress: z.nullable(z.string()),
extra: z.string(),
})
);
z.toZod<Company>()(
// @ts-expect-error wrong property output fails matching
z.object({
id: z.number(),
name: z.string(),
webAddress: z.nullable(z.string()),
})
);
});
test("assignability with type narrowing", () => {
type _RefinedSchema<T extends z.ZodMiniType<object> | z.ZodMiniUnion> = T extends z.ZodMiniUnion
? RefinedUnionSchema<T> // <-- Type instantiation is excessively deep and possibly infinite.
: T extends z.ZodMiniType<object>
? RefinedTypeSchema<z.output<T>> // <-- Type instantiation is excessively deep and possibly infinite.
: never;
type RefinedTypeSchema<T extends object> = T;
type RefinedUnionSchema<T extends z.ZodMiniUnion> = T;
});
@@ -0,0 +1,14 @@
#!/usr/bin/env node
kill = require('.')
try {
kill(process.argv[2], process.argv[3], function(err){
if (err) {
console.log(err.message)
process.exit(1)
}
})
}
catch (err) {
console.log(err.message)
process.exit(1)
}
@@ -0,0 +1,131 @@
import { allProcessors } from "./json-schema-processors.js";
import type * as JSONSchema from "./json-schema.js";
import type { $ZodRegistry } from "./registries.js";
import type * as schemas from "./schemas.js";
import {
type JSONSchemaGeneratorParams,
type ProcessParams,
type Seen,
type ToJSONSchemaContext,
extractDefs,
finalize,
initializeContext,
processSchema,
} from "./to-json-schema.js";
/**
* Parameters for the emit method of JSONSchemaGenerator.
* @deprecated Use toJSONSchema function instead
*/
export type EmitParams = Pick<JSONSchemaGeneratorParams, "cycles" | "reused" | "external">;
/**
* Parameters for JSONSchemaGenerator constructor.
* @deprecated Use toJSONSchema function instead
*/
type JSONSchemaGeneratorConstructorParams = Pick<
JSONSchemaGeneratorParams,
"metadata" | "target" | "unrepresentable" | "override" | "io"
>;
/**
* Legacy class-based interface for JSON Schema generation.
* This class wraps the new functional implementation to provide backward compatibility.
*
* @deprecated Use the `toJSONSchema` function instead for new code.
*
* @example
* ```typescript
* // Legacy usage (still supported)
* const gen = new JSONSchemaGenerator({ target: "draft-07" });
* gen.process(schema);
* const result = gen.emit(schema);
*
* // Preferred modern usage
* const result = toJSONSchema(schema, { target: "draft-07" });
* ```
*/
export class JSONSchemaGenerator {
private ctx: ToJSONSchemaContext;
/** @deprecated Access via ctx instead */
get metadataRegistry(): $ZodRegistry<Record<string, any>> {
return this.ctx.metadataRegistry;
}
/** @deprecated Access via ctx instead */
get target() {
return this.ctx.target;
}
// annotated so the .d.cts emits an indexed access rather than an inline `import()` of an ESM path
/** @deprecated Access via ctx instead */
get unrepresentable(): ToJSONSchemaContext["unrepresentable"] {
return this.ctx.unrepresentable;
}
/** @deprecated Access via ctx instead */
get override() {
return this.ctx.override;
}
/** @deprecated Access via ctx instead */
get io() {
return this.ctx.io;
}
/** @deprecated Access via ctx instead */
get counter() {
return this.ctx.counter;
}
set counter(value: number) {
this.ctx.counter = value;
}
/** @deprecated Access via ctx instead */
get seen(): Map<schemas.$ZodType, Seen> {
return this.ctx.seen;
}
constructor(params?: JSONSchemaGeneratorConstructorParams) {
// Normalize target for internal context
let normalizedTarget: ToJSONSchemaContext["target"] = params?.target ?? "draft-2020-12";
if (normalizedTarget === "draft-4") normalizedTarget = "draft-04";
if (normalizedTarget === "draft-7") normalizedTarget = "draft-07";
this.ctx = initializeContext({
processors: allProcessors,
target: normalizedTarget,
...(params?.metadata && { metadata: params.metadata }),
...(params?.unrepresentable && { unrepresentable: params.unrepresentable }),
...(params?.override && { override: params.override as any }),
...(params?.io && { io: params.io }),
});
}
/**
* Process a schema to prepare it for JSON Schema generation.
* This must be called before emit().
*/
process(schema: schemas.$ZodType, _params: ProcessParams = { path: [], schemaPath: [] }): JSONSchema.BaseSchema {
return processSchema(schema, this.ctx, _params);
}
/**
* Emit the final JSON Schema after processing.
* Must call process() first.
*/
emit(schema: schemas.$ZodType, _params?: EmitParams): JSONSchema.BaseSchema {
// Apply emit params to the context
if (_params) {
if (_params.cycles) this.ctx.cycles = _params.cycles;
if (_params.reused) this.ctx.reused = _params.reused;
if (_params.external) this.ctx.external = _params.external;
}
// extractDefs/finalize skip their whole-map passes when they have already run for this `external`, but they also branch on `cycles`, `reused`, `seen.count` and the metadata registry — any of which can change between emits, including with no params at all. Drop the guards so the passes re-run. The registry conversion calls extractDefs/finalize directly and never routes through here, so it keeps skipping them.
this.ctx.sharedDefsExtractedFor = undefined;
this.ctx.sharedEmitDoneFor = undefined;
extractDefs(this.ctx, schema);
const result = finalize(this.ctx, schema);
// Strip ~standard property to match old implementation's return type
const { "~standard": _, ...plainResult } = result as any;
return plainResult as JSONSchema.BaseSchema;
}
}
@@ -0,0 +1 @@
{"version":3,"file":"sse.js","sourceRoot":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ChB,CAAC;QAED,IAAI,CAAC,SAAS,EAAE,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAuB;QAC9B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QACrC,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpF,CAAC;IAED;;;;OAIG;IACH,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ;AArLD,gDAqLC"}
@@ -0,0 +1,55 @@
/**
* The exception type thrown by {@link renderSync} and passed as the error to
* {@link render}'s callback.
*
* @category Legacy
* @deprecated This is only thrown by the legacy {@link render} and {@link
* renderSync} APIs. Use {@link compile}, {@link compileString}, {@link
* compileAsync}, and {@link compileStringAsync} instead.
*/
export interface LegacyException extends Error {
/**
* The error message. For Dart Sass, when possible this includes a highlighted
* indication of where in the source file the error occurred as well as the
* Sass stack trace.
*/
message: string;
/**
* The error message. For Dart Sass, this is the same as the result of calling
* {@link toString}, which is itself the same as {@link message} but with the
* prefix "Error:".
*/
formatted: string;
/**
* The (1-based) line number on which the error occurred, if this exception is
* associated with a specific Sass file location.
*/
line?: number;
/**
* The (1-based) column number within {@link line} at which the error
* occurred, if this exception is associated with a specific Sass file
* location.
*/
column?: number;
/**
* Analogous to the exit code for an executable. `1` for an error caused by a
* Sass file, `3` for any other type of error.
*/
status: number;
/**
* If this exception was caused by an error in a Sass file, this will
* represent the Sass file's location. It can be in one of three formats:
*
* * If the Sass file was loaded from disk, this is the path to that file.
* * If the Sass file was generated by an importer, this is its canonical URL.
* * If the Sass file was passed as {@link LegacyStringOptions.data} without a
* corresponding {@link LegacyStringOptions.file}, this is the special
* string `"stdin"`.
*/
file?: string;
}
@@ -0,0 +1,33 @@
/**
* Verifying JSON Web Signature (JWS) in Flattened JSON Serialization
*
* @module
*/
import type * as types from '../../types.d.ts';
/**
* Interface for Flattened JWS Verification dynamic key resolution. No token components have been
* verified at the time of this function call.
*
* @see {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} to verify using a remote JSON Web Key Set.
*/
export interface FlattenedVerifyGetKey extends types.GenericGetKeyFunction<types.JWSHeaderParameters | undefined, types.FlattenedJWSInput, types.CryptoKey | types.KeyObject | types.JWK | Uint8Array> {
}
/**
* Verifies the signature and format of and afterwards decodes the Flattened JWS.
*
* This function is exported (as a named export) from the main `'jose'` module entry point as well
* as from its subpath export `'jose/jws/flattened/verify'`.
*
* @param jws Flattened JWS.
* @param key Key to verify the JWS with. See
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
* @param options JWS Verify options.
*/
export declare function flattenedVerify(jws: types.FlattenedJWSInput, key: types.CryptoKey | types.KeyObject | types.JWK | Uint8Array, options?: types.VerifyOptions): Promise<types.FlattenedVerifyResult>;
/**
* @param jws Flattened JWS.
* @param getKey Function resolving a key to verify the JWS with. See
* {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
* @param options JWS Verify options.
*/
export declare function flattenedVerify(jws: types.FlattenedJWSInput, getKey: FlattenedVerifyGetKey, options?: types.VerifyOptions): Promise<types.FlattenedVerifyResult & types.ResolvedKey>;
@@ -0,0 +1 @@
{"version":3,"file":"arrow-right-to-line.js","sources":["../../../src/icons/arrow-right-to-line.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowRightToLine\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgMTJIMyIgLz4KICA8cGF0aCBkPSJtMTEgMTggNi02LTYtNiIgLz4KICA8cGF0aCBkPSJNMjEgNXYxNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-right-to-line\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 ArrowRightToLine = createLucideIcon('ArrowRightToLine', [\n ['path', { d: 'M17 12H3', key: '8awo09' }],\n ['path', { d: 'm11 18 6-6-6-6', key: '8c2y43' }],\n ['path', { d: 'M21 5v14', key: 'nzette' }],\n]);\n\nexport default ArrowRightToLine;\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,CAAmB,iBAAiB,kBAAoB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,87 @@
// src/create-context.tsx
import * as React from "react";
import { jsx } from "react/jsx-runtime";
function createContext2(rootComponentName, defaultContext) {
const Context = React.createContext(defaultContext);
Context.displayName = rootComponentName + "Context";
const Provider = (props) => {
const { children, ...context } = props;
const value = React.useMemo(() => context, Object.values(context));
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
};
Provider.displayName = rootComponentName + "Provider";
function useContext2(consumerName, options = {}) {
const { optional = false } = options;
const context = React.useContext(Context);
if (context) return context;
if (defaultContext !== void 0) return defaultContext;
if (optional) return void 0;
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
}
return [Provider, useContext2];
}
function createContextScope(scopeName, createContextScopeDeps = []) {
let defaultContexts = [];
function createContext3(rootComponentName, defaultContext) {
const BaseContext = React.createContext(defaultContext);
BaseContext.displayName = rootComponentName + "Context";
const index = defaultContexts.length;
defaultContexts = [...defaultContexts, defaultContext];
const Provider = (props) => {
const { scope, children, ...context } = props;
const Context = scope?.[scopeName]?.[index] || BaseContext;
const value = React.useMemo(() => context, Object.values(context));
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
};
Provider.displayName = rootComponentName + "Provider";
function useContext2(consumerName, scope, options = {}) {
const { optional = false } = options;
const Context = scope?.[scopeName]?.[index] || BaseContext;
const context = React.useContext(Context);
if (context) return context;
if (defaultContext !== void 0) return defaultContext;
if (optional) return void 0;
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
}
return [Provider, useContext2];
}
const createScope = () => {
const scopeContexts = defaultContexts.map((defaultContext) => {
return React.createContext(defaultContext);
});
return function useScope(scope) {
const contexts = scope?.[scopeName] || scopeContexts;
return React.useMemo(
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
[scope, contexts]
);
};
};
createScope.scopeName = scopeName;
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
}
function composeContextScopes(...scopes) {
const baseScope = scopes[0];
if (scopes.length === 1) return baseScope;
const createScope = () => {
const scopeHooks = scopes.map((createScope2) => ({
useScope: createScope2(),
scopeName: createScope2.scopeName
}));
return function useComposedScopes(overrideScopes) {
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
const scopeProps = useScope(overrideScopes);
const currentScope = scopeProps[`__scope${scopeName}`];
return { ...nextScopes2, ...currentScope };
}, {});
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
};
};
createScope.scopeName = baseScope.scopeName;
return createScope;
}
export {
createContext2 as createContext,
createContextScope
};
//# sourceMappingURL=index.mjs.map