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,8 @@
import type { AST_TOKEN_TYPES, TSESTree } from '../ts-estree';
declare namespace AST {
type TokenType = AST_TOKEN_TYPES;
type Token = TSESTree.Token;
type SourceLocation = TSESTree.SourceLocation;
type Range = TSESTree.Range;
}
export type { AST };
@@ -0,0 +1,5 @@
import { attachRouterServerSsrUtils, getNormalizedURL, getOrigin } from "./ssr-server.js";
import { createRequestHandler } from "./createRequestHandler.js";
import { defineHandlerCallback } from "./handlerCallback.js";
import { transformPipeableStreamWithRouter, transformReadableStreamWithRouter, transformStreamWithRouter } from "./transformStreamWithRouter.js";
export { attachRouterServerSsrUtils, createRequestHandler, defineHandlerCallback, getNormalizedURL, getOrigin, transformPipeableStreamWithRouter, transformReadableStreamWithRouter, transformStreamWithRouter };
@@ -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 Archive = createLucideIcon("Archive", [
["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
["path", { d: "M10 12h4", key: "a56b0p" }]
]);
export { Archive as default };
//# sourceMappingURL=archive.js.map
@@ -0,0 +1,162 @@
/**
* @fileoverview Disallows unnecessary `return await`
* @author Jordan Harband
* @deprecated in ESLint v8.46.0
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
hasSuggestions: true,
type: "suggestion",
docs: {
description: "Disallow unnecessary `return await`",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-return-await",
},
fixable: null,
deprecated: {
message:
"The original assumption of the rule no longer holds true because of engine optimization.",
deprecatedSince: "8.46.0",
availableUntil: null,
replacedBy: [],
},
schema: [],
messages: {
removeAwait: "Remove redundant `await`.",
redundantUseOfAwait: "Redundant use of `await` on a return value.",
},
},
create(context) {
/**
* Reports a found unnecessary `await` expression.
* @param {ASTNode} node The node representing the `await` expression to report
* @returns {void}
*/
function reportUnnecessaryAwait(node) {
context.report({
node: context.sourceCode.getFirstToken(node),
loc: node.loc,
messageId: "redundantUseOfAwait",
suggest: [
{
messageId: "removeAwait",
fix(fixer) {
const sourceCode = context.sourceCode;
const [awaitToken, tokenAfterAwait] =
sourceCode.getFirstTokens(node, 2);
const areAwaitAndAwaitedExpressionOnTheSameLine =
awaitToken.loc.start.line ===
tokenAfterAwait.loc.start.line;
if (!areAwaitAndAwaitedExpressionOnTheSameLine) {
return null;
}
const [startOfAwait, endOfAwait] = awaitToken.range;
const characterAfterAwait =
sourceCode.text[endOfAwait];
const trimLength =
characterAfterAwait === " " ? 1 : 0;
const range = [
startOfAwait,
endOfAwait + trimLength,
];
return fixer.removeRange(range);
},
},
],
});
}
/**
* Determines whether a thrown error from this node will be caught/handled within this function rather than immediately halting
* this function. For example, a statement in a `try` block will always have an error handler. A statement in
* a `catch` block will only have an error handler if there is also a `finally` block.
* @param {ASTNode} node A node representing a location where an could be thrown
* @returns {boolean} `true` if a thrown error will be caught/handled in this function
*/
function hasErrorHandler(node) {
let ancestor = node;
while (
!astUtils.isFunction(ancestor) &&
ancestor.type !== "Program"
) {
if (
ancestor.parent.type === "TryStatement" &&
(ancestor === ancestor.parent.block ||
(ancestor === ancestor.parent.handler &&
ancestor.parent.finalizer))
) {
return true;
}
ancestor = ancestor.parent;
}
return false;
}
/**
* Checks if a node is placed in tail call position. Once `return` arguments (or arrow function expressions) can be a complex expression,
* an `await` expression could or could not be unnecessary by the definition of this rule. So we're looking for `await` expressions that are in tail position.
* @param {ASTNode} node A node representing the `await` expression to check
* @returns {boolean} The checking result
*/
function isInTailCallPosition(node) {
if (node.parent.type === "ArrowFunctionExpression") {
return true;
}
if (node.parent.type === "ReturnStatement") {
return !hasErrorHandler(node.parent);
}
if (
node.parent.type === "ConditionalExpression" &&
(node === node.parent.consequent ||
node === node.parent.alternate)
) {
return isInTailCallPosition(node.parent);
}
if (
node.parent.type === "LogicalExpression" &&
node === node.parent.right
) {
return isInTailCallPosition(node.parent);
}
if (
node.parent.type === "SequenceExpression" &&
node === node.parent.expressions.at(-1)
) {
return isInTailCallPosition(node.parent);
}
return false;
}
return {
AwaitExpression(node) {
if (isInTailCallPosition(node) && !hasErrorHandler(node)) {
reportUnnecessaryAwait(node);
}
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"zxcvbn-ts.js","sources":["../../../../node_modules/@zxcvbn-ts/dictionary-compression/dist/decompress.mjs","../src/index.ts"],"sourcesContent":["function decompress(encodedString) {\n const decompressedArray = encodedString.split(/([A-Z])/g);\n const decompressedData = [];\n let last = \"\";\n let i;\n for (i = 1; i < decompressedArray.length; i += 2) {\n last = last.slice(0, decompressedArray[i].charCodeAt(0) - 65) + decompressedArray[i + 1];\n decompressedData.push(last);\n }\n return decompressedData;\n}\nexport {\n decompress as default\n};\n//# sourceMappingURL=decompress.mjs.map",null],"names":["dictionary","diceware","passwords","adjacencyGraphs","tempAdjacencyGraphs"],"mappings":";;;;;;EAAA,SAAS,UAAU,CAAC,aAAa,EAAE;EACnC,EAAE,MAAM,iBAAiB,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC;EAC3D,EAAE,MAAM,gBAAgB,GAAG,EAAE;EAC7B,EAAE,IAAI,IAAI,GAAG,EAAE;EACf,EAAE,IAAI,CAAC;EACP,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;EACpD,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC;EAC5F,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;EAC/B,EAAE;EACF,EAAE,OAAO,gBAAgB;EACzB;;;;;;ECVA;AAKA,QAAMA,UAAU,GAAG;EACjB,EAAA,iBAAiB,EAAEC,QAAQ;EAC3B,EAAA,kBAAkB,EAAEC;;EAGtB;AACA,QAAMC,eAAe,GAAGC;;;;;;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const esnext_symbol: LibDefinition;
@@ -0,0 +1,141 @@
"use client";
import { useHydrated } from "./ClientOnly.js";
import { useRouter } from "./useRouter.js";
import * as React$1 from "react";
import { jsx } from "react/jsx-runtime";
import { isServer } from "@tanstack/router-core/isServer";
//#region src/Asset.tsx
var INLINE_CSS_HYDRATION_ATTR = "data-tsr-inline-css";
function Asset(asset) {
const { attrs, children, nonce } = asset;
switch (asset.tag) {
case "title": return /* @__PURE__ */ jsx("title", {
...attrs,
suppressHydrationWarning: true,
children
});
case "meta": return /* @__PURE__ */ jsx("meta", {
...attrs,
suppressHydrationWarning: true
});
case "link": return /* @__PURE__ */ jsx("link", {
...attrs,
precedence: attrs?.precedence ?? (attrs?.rel === "stylesheet" ? "default" : void 0),
nonce,
suppressHydrationWarning: true
});
case "style":
if (asset.inlineCss && (process.env.TSS_INLINE_CSS_ENABLED === "true" || process.env.TSS_INLINE_CSS_ENABLED === void 0 && isServer)) return /* @__PURE__ */ jsx(InlineCssStyle, {
attrs,
nonce,
children
});
return /* @__PURE__ */ jsx("style", {
...attrs,
dangerouslySetInnerHTML: { __html: children },
nonce
});
case "script": return /* @__PURE__ */ jsx(Script, {
attrs,
children
});
default: return null;
}
}
function InlineCssStyle({ attrs, children, nonce }) {
const isInlineCssPlaceholder = children === void 0;
const [hydratedInlineCss] = React$1.useState(() => {
if (!isInlineCssPlaceholder || typeof document === "undefined") return;
return document.querySelector(`style[${INLINE_CSS_HYDRATION_ATTR}]`)?.textContent ?? void 0;
});
const html = isInlineCssPlaceholder ? hydratedInlineCss ?? "" : children ?? "";
return /* @__PURE__ */ jsx("style", {
...attrs,
[INLINE_CSS_HYDRATION_ATTR]: "",
dangerouslySetInnerHTML: { __html: html },
nonce,
suppressHydrationWarning: true
});
}
function Script({ attrs, children }) {
const router = useRouter();
const hydrated = useHydrated();
const dataScript = typeof attrs?.type === "string" && attrs.type !== "" && attrs.type !== "text/javascript" && attrs.type !== "module";
if (process.env.NODE_ENV !== "production" && attrs?.src && typeof children === "string" && children.trim().length) console.warn("[TanStack Router] <Script> received both `src` and `children`. The `children` content will be ignored. Remove `children` or remove `src`.");
React$1.useEffect(() => {
if (dataScript) return;
if (attrs?.src) {
const normSrc = (() => {
try {
const base = document.baseURI || window.location.href;
return new URL(attrs.src, base).href;
} catch {
return attrs.src;
}
})();
if (Array.from(document.querySelectorAll("script[src]")).find((el) => el.src === normSrc)) return;
const script = document.createElement("script");
for (const [key, value] of Object.entries(attrs)) if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) script.setAttribute(key, typeof value === "boolean" ? "" : String(value));
document.head.appendChild(script);
return () => {
if (script.parentNode) script.parentNode.removeChild(script);
};
}
if (typeof children === "string") {
const typeAttr = typeof attrs?.type === "string" ? attrs.type : "text/javascript";
const nonceAttr = typeof attrs?.nonce === "string" ? attrs.nonce : void 0;
if (Array.from(document.querySelectorAll("script:not([src])")).find((el) => {
if (!(el instanceof HTMLScriptElement)) return false;
const sType = el.getAttribute("type") ?? "text/javascript";
const sNonce = el.getAttribute("nonce") ?? void 0;
return el.textContent === children && sType === typeAttr && sNonce === nonceAttr;
})) return;
const script = document.createElement("script");
script.textContent = children;
if (attrs) {
for (const [key, value] of Object.entries(attrs)) if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) script.setAttribute(key, typeof value === "boolean" ? "" : String(value));
}
document.head.appendChild(script);
return () => {
if (script.parentNode) script.parentNode.removeChild(script);
};
}
}, [
attrs,
children,
dataScript
]);
if (isServer ?? router.isServer) {
if (attrs?.src) return /* @__PURE__ */ jsx("script", {
...attrs,
suppressHydrationWarning: true
});
if (typeof children === "string") return /* @__PURE__ */ jsx("script", {
...attrs,
dangerouslySetInnerHTML: { __html: children },
suppressHydrationWarning: true
});
return null;
}
if (dataScript && typeof children === "string") return /* @__PURE__ */ jsx("script", {
...attrs,
suppressHydrationWarning: true,
dangerouslySetInnerHTML: { __html: children }
});
if (!hydrated) {
if (attrs?.src) return /* @__PURE__ */ jsx("script", {
...attrs,
suppressHydrationWarning: true
});
if (typeof children === "string") return /* @__PURE__ */ jsx("script", {
...attrs,
dangerouslySetInnerHTML: { __html: children },
suppressHydrationWarning: true
});
}
return null;
}
//#endregion
export { Asset };
//# sourceMappingURL=Asset.js.map
@@ -0,0 +1,531 @@
import { AlignedPlacement } from '@floating-ui/utils';
import { Alignment } from '@floating-ui/utils';
import { Axis } from '@floating-ui/utils';
import { ClientRectObject } from '@floating-ui/utils';
import { Coords } from '@floating-ui/utils';
import { Dimensions } from '@floating-ui/utils';
import { ElementRects } from '@floating-ui/utils';
import { Length } from '@floating-ui/utils';
import { Padding } from '@floating-ui/utils';
import { Placement } from '@floating-ui/utils';
import { Rect } from '@floating-ui/utils';
import { rectToClientRect } from '@floating-ui/utils';
import { Side } from '@floating-ui/utils';
import { SideObject } from '@floating-ui/utils';
import { Strategy } from '@floating-ui/utils';
import { VirtualElement } from '@floating-ui/utils';
export { AlignedPlacement }
export { Alignment }
/**
* Provides data to position an inner element of the floating element so that it
* appears centered to the reference element.
* @see https://floating-ui.com/docs/arrow
*/
export declare const arrow: (options: ArrowOptions | Derivable<ArrowOptions>) => Middleware;
export declare interface ArrowOptions {
/**
* The arrow element to be positioned.
* @default undefined
*/
element: any;
/**
* The padding between the arrow element and the floating element edges.
* Useful when the floating element has rounded corners.
* @default 0
*/
padding?: Padding;
}
/**
* Optimizes the visibility of the floating element by choosing the placement
* that has the most space available automatically, without needing to specify a
* preferred placement. Alternative to `flip`.
* @see https://floating-ui.com/docs/autoPlacement
*/
export declare const autoPlacement: (options?: AutoPlacementOptions | Derivable<AutoPlacementOptions>) => Middleware;
export declare interface AutoPlacementOptions extends DetectOverflowOptions {
/**
* The axis that runs along the alignment of the floating element. Determines
* whether to check for most space along this axis.
* @default false
*/
crossAxis?: boolean;
/**
* Choose placements with a particular alignment.
* @default undefined
*/
alignment?: Alignment | null;
/**
* Whether to choose placements with the opposite alignment if the preferred
* alignment does not fit.
* @default true
*/
autoAlignment?: boolean;
/**
* Which placements are allowed to be chosen. Placements must be within the
* `alignment` option if explicitly set.
* @default allPlacements (variable)
*/
allowedPlacements?: Array<Placement>;
}
export { Axis }
export declare type Boundary = any;
export { ClientRectObject }
export declare type ComputePosition = (reference: unknown, floating: unknown, config: ComputePositionConfig) => Promise<ComputePositionReturn>;
/**
* Computes the `x` and `y` coordinates that will place the floating element
* next to a given reference element.
*
* This export does not have any `platform` interface logic. You will need to
* write one for the platform you are using Floating UI with.
*/
export declare const computePosition: ComputePosition;
export declare interface ComputePositionConfig {
/**
* Object to interface with the current platform.
*/
platform: Platform;
/**
* Where to place the floating element relative to the reference element.
*/
placement?: Placement;
/**
* The strategy to use when positioning the floating element.
*/
strategy?: Strategy;
/**
* Array of middleware objects to modify the positioning or provide data for
* rendering.
*/
middleware?: Array<Middleware | null | undefined | false>;
}
export declare interface ComputePositionReturn extends Coords {
/**
* The final chosen placement of the floating element.
*/
placement: Placement;
/**
* The strategy used to position the floating element.
*/
strategy: Strategy;
/**
* Object containing data returned from all middleware, keyed by their name.
*/
middlewareData: MiddlewareData;
}
export { Coords }
/**
* Function option to derive middleware options from state.
*/
export declare type Derivable<T> = (state: MiddlewareState) => T;
/**
* Resolves with an object of overflow side offsets that determine how much the
* element is overflowing a given clipping boundary on each side.
* - positive = overflowing the boundary by that number of pixels
* - negative = how many pixels left before it will overflow
* - 0 = lies flush with the boundary
* @see https://floating-ui.com/docs/detectOverflow
*/
export declare function detectOverflow(state: MiddlewareState, options?: DetectOverflowOptions | Derivable<DetectOverflowOptions>): Promise<SideObject>;
export declare interface DetectOverflowOptions {
/**
* The clipping element(s) or area in which overflow will be checked.
* @default 'clippingAncestors'
*/
boundary?: Boundary;
/**
* The root clipping area in which overflow will be checked.
* @default 'viewport'
*/
rootBoundary?: RootBoundary;
/**
* The element in which overflow is being checked relative to a boundary.
* @default 'floating'
*/
elementContext?: ElementContext;
/**
* Whether to check for overflow using the alternate element's boundary
* (`clippingAncestors` boundary only).
* @default false
*/
altBoundary?: boolean;
/**
* Virtual padding for the resolved overflow detection offsets.
* @default 0
*/
padding?: Padding;
}
export { Dimensions }
export declare type ElementContext = 'reference' | 'floating';
export { ElementRects }
export declare interface Elements {
reference: ReferenceElement;
floating: FloatingElement;
}
/**
* Optimizes the visibility of the floating element by flipping the `placement`
* in order to keep it in view when the preferred placement(s) will overflow the
* clipping boundary. Alternative to `autoPlacement`.
* @see https://floating-ui.com/docs/flip
*/
export declare const flip: (options?: FlipOptions | Derivable<FlipOptions>) => Middleware;
export declare interface FlipOptions extends DetectOverflowOptions {
/**
* The axis that runs along the side of the floating element. Determines
* whether overflow along this axis is checked to perform a flip.
* @default true
*/
mainAxis?: boolean;
/**
* The axis that runs along the alignment of the floating element. Determines
* whether overflow along this axis is checked to perform a flip.
* - `true`: Whether to check cross axis overflow for both side and alignment flipping.
* - `false`: Whether to disable all cross axis overflow checking.
* - `'alignment'`: Whether to check cross axis overflow for alignment flipping only.
* @default true
*/
crossAxis?: boolean | 'alignment';
/**
* Placements to try sequentially if the preferred `placement` does not fit.
* @default [oppositePlacement] (computed)
*/
fallbackPlacements?: Array<Placement>;
/**
* What strategy to use when no placements fit.
* @default 'bestFit'
*/
fallbackStrategy?: 'bestFit' | 'initialPlacement';
/**
* Whether to allow fallback to the perpendicular axis of the preferred
* placement, and if so, which side direction along the axis to prefer.
* @default 'none' (disallow fallback)
*/
fallbackAxisSideDirection?: 'none' | 'start' | 'end';
/**
* Whether to flip to placements with the opposite alignment if they fit
* better.
* @default true
*/
flipAlignment?: boolean;
}
export declare type FloatingElement = any;
/**
* Provides data to hide the floating element in applicable situations, such as
* when it is not in the same clipping context as the reference element.
* @see https://floating-ui.com/docs/hide
*/
export declare const hide: (options?: HideOptions | Derivable<HideOptions>) => Middleware;
export declare interface HideOptions extends DetectOverflowOptions {
/**
* The strategy used to determine when to hide the floating element.
*/
strategy?: 'referenceHidden' | 'escaped';
}
/**
* Provides improved positioning for inline reference elements that can span
* over multiple lines, such as hyperlinks or range selections.
* @see https://floating-ui.com/docs/inline
*/
export declare const inline: (options?: InlineOptions | Derivable<InlineOptions>) => Middleware;
export declare interface InlineOptions {
/**
* Viewport-relative `x` coordinate to choose a `ClientRect`.
* @default undefined
*/
x?: number;
/**
* Viewport-relative `y` coordinate to choose a `ClientRect`.
* @default undefined
*/
y?: number;
/**
* Represents the padding around a disjoined rect when choosing it.
* @default 2
*/
padding?: Padding;
}
export { Length }
/**
* Built-in `limiter` that will stop `shift()` at a certain point.
*/
export declare const limitShift: (options?: LimitShiftOptions | Derivable<LimitShiftOptions>) => {
options: any;
fn: (state: MiddlewareState) => Coords;
};
declare type LimitShiftOffset = number | {
/**
* Offset the limiting of the axis that runs along the alignment of the
* floating element.
*/
mainAxis?: number;
/**
* Offset the limiting of the axis that runs along the side of the
* floating element.
*/
crossAxis?: number;
};
export declare interface LimitShiftOptions {
/**
* Offset when limiting starts. `0` will limit when the opposite edges of the
* reference and floating elements are aligned.
* - positive = start limiting earlier
* - negative = start limiting later
*/
offset?: LimitShiftOffset | Derivable<LimitShiftOffset>;
/**
* Whether to limit the axis that runs along the alignment of the floating
* element.
*/
mainAxis?: boolean;
/**
* Whether to limit the axis that runs along the side of the floating element.
*/
crossAxis?: boolean;
}
export declare type Middleware = {
name: string;
options?: any;
fn: (state: MiddlewareState) => Promisable<MiddlewareReturn>;
};
/**
* @deprecated use `MiddlewareState` instead.
*/
export declare type MiddlewareArguments = MiddlewareState;
export declare interface MiddlewareData {
[key: string]: any;
arrow?: Partial<Coords> & {
centerOffset: number;
alignmentOffset?: number;
};
autoPlacement?: {
index?: number;
overflows: Array<{
placement: Placement;
overflows: Array<number>;
}>;
};
flip?: {
index?: number;
overflows: Array<{
placement: Placement;
overflows: Array<number>;
}>;
};
hide?: {
referenceHidden?: boolean;
escaped?: boolean;
referenceHiddenOffsets?: SideObject;
escapedOffsets?: SideObject;
};
offset?: Coords & {
placement: Placement;
};
shift?: Coords & {
enabled: {
[key in Axis]: boolean;
};
};
}
export declare interface MiddlewareReturn extends Partial<Coords> {
data?: {
[key: string]: any;
};
reset?: boolean | {
placement?: Placement;
rects?: boolean | ElementRects;
};
}
export declare interface MiddlewareState extends Coords {
initialPlacement: Placement;
placement: Placement;
strategy: Strategy;
middlewareData: MiddlewareData;
elements: Elements;
rects: ElementRects;
platform: {
detectOverflow: typeof detectOverflow;
} & Platform;
}
/**
* Modifies the placement by translating the floating element along the
* specified axes.
* A number (shorthand for `mainAxis` or distance), or an axes configuration
* object may be passed.
* @see https://floating-ui.com/docs/offset
*/
export declare const offset: (options?: OffsetOptions) => Middleware;
export declare type OffsetOptions = OffsetValue | Derivable<OffsetValue>;
declare type OffsetValue = number | {
/**
* The axis that runs along the side of the floating element. Represents
* the distance (gutter or margin) between the reference and floating
* element.
* @default 0
*/
mainAxis?: number;
/**
* The axis that runs along the alignment of the floating element.
* Represents the skidding between the reference and floating element.
* @default 0
*/
crossAxis?: number;
/**
* The same axis as `crossAxis` but applies only to aligned placements
* and inverts the `end` alignment. When set to a number, it overrides the
* `crossAxis` value.
*
* A positive number will move the floating element in the direction of
* the opposite edge to the one that is aligned, while a negative number
* the reverse.
* @default null
*/
alignmentAxis?: number | null;
};
export { Padding }
export { Placement }
/**
* Platform interface methods to work with the current platform.
* @see https://floating-ui.com/docs/platform
*/
export declare interface Platform {
getElementRects: (args: {
reference: ReferenceElement;
floating: FloatingElement;
strategy: Strategy;
}) => Promisable<ElementRects>;
getClippingRect: (args: {
element: any;
boundary: Boundary;
rootBoundary: RootBoundary;
strategy: Strategy;
}) => Promisable<Rect>;
getDimensions: (element: any) => Promisable<Dimensions>;
convertOffsetParentRelativeRectToViewportRelativeRect?: (args: {
elements?: Elements;
rect: Rect;
offsetParent: any;
strategy: Strategy;
}) => Promisable<Rect>;
getOffsetParent?: (element: any) => Promisable<any>;
isElement?: (value: any) => Promisable<boolean>;
getDocumentElement?: (element: any) => Promisable<any>;
getClientRects?: (element: any) => Promisable<Array<ClientRectObject>>;
isRTL?: (element: any) => Promisable<boolean>;
getScale?: (element: any) => Promisable<{
x: number;
y: number;
}>;
detectOverflow?: typeof detectOverflow;
}
declare type Promisable<T> = T | Promise<T>;
export { Rect }
export { rectToClientRect }
export declare type ReferenceElement = any;
export declare type RootBoundary = 'viewport' | 'document' | Rect;
/**
* Optimizes the visibility of the floating element by shifting it in order to
* keep it in view when it will overflow the clipping boundary.
* @see https://floating-ui.com/docs/shift
*/
export declare const shift: (options?: ShiftOptions | Derivable<ShiftOptions>) => Middleware;
export declare interface ShiftOptions extends DetectOverflowOptions {
/**
* The axis that runs along the alignment of the floating element. Determines
* whether overflow along this axis is checked to perform shifting.
* @default true
*/
mainAxis?: boolean;
/**
* The axis that runs along the side of the floating element. Determines
* whether overflow along this axis is checked to perform shifting.
* @default false
*/
crossAxis?: boolean;
/**
* Accepts a function that limits the shifting done in order to prevent
* detachment.
*/
limiter?: {
fn: (state: MiddlewareState) => Coords;
options?: any;
};
}
export { Side }
export { SideObject }
/**
* Provides data that allows you to change the size of the floating element —
* for instance, prevent it from overflowing the clipping boundary or match the
* width of the reference element.
* @see https://floating-ui.com/docs/size
*/
export declare const size: (options?: SizeOptions | Derivable<SizeOptions>) => Middleware;
export declare interface SizeOptions extends DetectOverflowOptions {
/**
* Function that is called to perform style mutations to the floating element
* to change its size.
* @default undefined
*/
apply?(args: MiddlewareState & {
availableWidth: number;
availableHeight: number;
}): void | Promise<void>;
}
export { Strategy }
export { VirtualElement }
export { }
@@ -0,0 +1,109 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
//#region src/middleware/cors/index.ts
/**
* CORS Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/cors}
*
* @param {CORSOptions} [options] - The options for the CORS middleware.
* @param {string | string[] | ((origin: string, c: Context) => Promise<string | undefined | null> | string | undefined | null)} [options.origin='*'] - The value of "Access-Control-Allow-Origin" CORS header.
* @param {string[] | ((origin: string, c: Context) => Promise<string[]> | string[])} [options.allowMethods=['GET', 'HEAD', 'PUT', 'POST', 'DELETE', 'PATCH', 'QUERY']] - The value of "Access-Control-Allow-Methods" CORS header.
* @param {string[]} [options.allowHeaders=[]] - The value of "Access-Control-Allow-Headers" CORS header.
* @param {number} [options.maxAge] - The value of "Access-Control-Max-Age" CORS header.
* @param {boolean} [options.credentials] - The value of "Access-Control-Allow-Credentials" CORS header.
* @param {string[]} [options.exposeHeaders=[]] - The value of "Access-Control-Expose-Headers" CORS header.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
*
* app.use('/api/*', cors())
* app.use(
* '/api2/*',
* cors({
* origin: 'http://example.com',
* allowHeaders: ['X-Custom-Header', 'Upgrade-Insecure-Requests'],
* allowMethods: ['POST', 'GET', 'OPTIONS'],
* exposeHeaders: ['Content-Length', 'X-Kuma-Revision'],
* maxAge: 600,
* credentials: true,
* })
* )
*
* app.all('/api/abc', (c) => {
* return c.json({ success: true })
* })
* app.all('/api2/abc', (c) => {
* return c.json({ success: true })
* })
* ```
*/
const cors = (options) => {
const opts = {
origin: "*",
allowMethods: [
"GET",
"HEAD",
"PUT",
"POST",
"DELETE",
"PATCH",
"QUERY"
],
allowHeaders: [],
exposeHeaders: [],
...options
};
const exposeHeadersStr = opts.exposeHeaders?.length ? opts.exposeHeaders.join(",") : void 0;
const allowHeadersStr = opts.allowHeaders?.length ? opts.allowHeaders.join(",") : void 0;
const findAllowOrigin = ((optsOrigin) => {
if (typeof optsOrigin === "string") {
if (optsOrigin === "*") return () => optsOrigin;
else return (origin) => optsOrigin === origin ? origin : null;
} else if (typeof optsOrigin === "function") return optsOrigin;
else return (origin) => optsOrigin.includes(origin) ? origin : null;
})(opts.origin);
const findAllowMethods = ((optsAllowMethods) => {
if (typeof optsAllowMethods === "function") return async (origin, c) => (await optsAllowMethods(origin, c)).join(",");
else if (Array.isArray(optsAllowMethods)) {
const methodsStr = optsAllowMethods.join(",");
return () => methodsStr;
} else return () => "";
})(opts.allowMethods);
return async function cors(c, next) {
function set(key, value) {
c.res.headers.set(key, value);
}
const allowOrigin = await findAllowOrigin(c.req.header("origin") || "", c);
if (allowOrigin) set("Access-Control-Allow-Origin", allowOrigin);
if (opts.credentials) set("Access-Control-Allow-Credentials", "true");
if (exposeHeadersStr) set("Access-Control-Expose-Headers", exposeHeadersStr);
if (c.req.method === "OPTIONS") {
if (opts.origin !== "*") c.res.headers.append("Vary", "Origin");
if (opts.maxAge != null) set("Access-Control-Max-Age", opts.maxAge.toString());
const allowMethods = await findAllowMethods(c.req.header("origin") || "", c);
if (allowMethods) set("Access-Control-Allow-Methods", allowMethods);
let headersStr = allowHeadersStr;
if (!headersStr) {
const requestHeaders = c.req.header("Access-Control-Request-Headers");
if (requestHeaders) headersStr = requestHeaders.split(",").map((h) => h.trim()).join(",");
}
if (headersStr) {
set("Access-Control-Allow-Headers", headersStr);
c.res.headers.append("Vary", "Access-Control-Request-Headers");
}
c.res.headers.delete("Content-Length");
c.res.headers.delete("Content-Type");
return new Response(null, {
headers: c.res.headers,
status: 204,
statusText: "No Content"
});
}
await next();
if (opts.origin !== "*") c.header("Vary", "Origin", { append: true });
};
};
//#endregion
exports.cors = cors;
@@ -0,0 +1,87 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Hook = require("./Hook");
const HookCodeFactory = require("./HookCodeFactory");
class AsyncParallelBailHookCodeFactory extends HookCodeFactory {
content({ onError, onResult, onDone }) {
let code = "";
code += `var _results = new Array(${this.options.taps.length});\n`;
code += "var _checkDone = function() {\n";
code += "for(var i = 0; i < _results.length; i++) {\n";
code += "var item = _results[i];\n";
code += "if(item === undefined) return false;\n";
code += "if(item.result !== undefined) {\n";
code += onResult("item.result");
code += "return true;\n";
code += "}\n";
code += "if(item.error) {\n";
code += onError("item.error");
code += "return true;\n";
code += "}\n";
code += "}\n";
code += "return false;\n";
code += "}\n";
code += this.callTapsParallel({
onError: (i, err, done, doneBreak) => {
let code = "";
code += `if(${i} < _results.length && ((_results.length = ${
i + 1
}), (_results[${i}] = { error: ${err} }), _checkDone())) {\n`;
code += doneBreak(true);
code += "} else {\n";
code += done();
code += "}\n";
return code;
},
onResult: (i, result, done, doneBreak) => {
let code = "";
code += `if(${i} < _results.length && (${result} !== undefined && (_results.length = ${
i + 1
}), (_results[${i}] = { result: ${result} }), _checkDone())) {\n`;
code += doneBreak(true);
code += "} else {\n";
code += done();
code += "}\n";
return code;
},
onTap: (i, run, done, _doneBreak) => {
let code = "";
if (i > 0) {
code += `if(${i} >= _results.length) {\n`;
code += done();
code += "} else {\n";
}
code += run();
if (i > 0) code += "}\n";
return code;
},
onDone
});
return code;
}
}
const factory = new AsyncParallelBailHookCodeFactory();
function COMPILE(options) {
factory.setup(this, options);
return factory.create(options);
}
function AsyncParallelBailHook(args = [], name = undefined) {
const hook = new Hook(args, name);
hook.constructor = AsyncParallelBailHook;
hook.compile = COMPILE;
hook._call = undefined;
hook.call = undefined;
return hook;
}
AsyncParallelBailHook.prototype = null;
module.exports = AsyncParallelBailHook;
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Grid3x3 = createLucideIcon("Grid3x3", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M3 9h18", key: "1pudct" }],
["path", { d: "M3 15h18", key: "5xshup" }],
["path", { d: "M9 3v18", key: "fh3hqa" }],
["path", { d: "M15 3v18", key: "14nvp0" }]
]);
export { Grid3x3 as default };
//# sourceMappingURL=grid-3x3.js.map
@@ -0,0 +1,6 @@
function isLength(value) {
return Number.isInteger(value) && value > -1;
}
export {
isLength
};
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const VibrateOff = createLucideIcon("VibrateOff", [
["path", { d: "m2 8 2 2-2 2 2 2-2 2", key: "sv1b1" }],
["path", { d: "m22 8-2 2 2 2-2 2 2 2", key: "101i4y" }],
["path", { d: "M8 8v10c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2", key: "1hbad5" }],
["path", { d: "M16 10.34V6c0-.55-.45-1-1-1h-4.34", key: "1x5tf0" }],
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
]);
export { VibrateOff as default };
//# sourceMappingURL=vibrate-off.js.map
@@ -0,0 +1 @@
{"version":3,"file":"jitter.factory.js","sourceRoot":"","sources":["../../src/jitter/jitter.factory.ts"],"names":[],"mappings":";;AACA,kDAAgD;AAChD,4CAA0C;AAI1C,SAAgB,aAAa,CAAC,OAAwB;IACpD,QAAQ,OAAO,CAAC,MAAM,EAAE;QACtB,KAAK,MAAM;YACT,OAAO,wBAAU,CAAC;QAEpB,KAAK,MAAM,CAAC;QACZ;YACE,OAAO,oBAAQ,CAAC;KACnB;AACH,CAAC;AATD,sCASC"}
@@ -0,0 +1,3 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_middleware_jwk_jwk = require("./jwk.js");
exports.jwk = require_middleware_jwk_jwk.jwk;
@@ -0,0 +1,11 @@
export type Options = [
{
ignoreParameters?: boolean;
ignoreProperties?: boolean;
}
];
export type MessageIds = 'noInferrableType';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noInferrableType", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,24 @@
{
"name": "escape-html",
"description": "Escape string for use in HTML",
"version": "1.0.3",
"license": "MIT",
"keywords": [
"escape",
"html",
"utility"
],
"repository": "component/escape-html",
"devDependencies": {
"benchmark": "1.0.0",
"beautify-benchmark": "0.2.4"
},
"files": [
"LICENSE",
"Readme.md",
"index.js"
],
"scripts": {
"bench": "node benchmark/index.js"
}
}
@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Tags = createLucideIcon("Tags", [
["path", { d: "m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19", key: "1cbfv1" }],
[
"path",
{
d: "M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",
key: "135mg7"
}
],
["circle", { cx: "6.5", cy: "9.5", r: ".5", fill: "currentColor", key: "5pm5xn" }]
]);
export { Tags as default };
//# sourceMappingURL=tags.js.map
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FoldHorizontal = createLucideIcon("FoldHorizontal", [
["path", { d: "M2 12h6", key: "1wqiqv" }],
["path", { d: "M22 12h-6", key: "1eg9hc" }],
["path", { d: "M12 2v2", key: "tus03m" }],
["path", { d: "M12 8v2", key: "1woqiv" }],
["path", { d: "M12 14v2", key: "8jcxud" }],
["path", { d: "M12 20v2", key: "1lh1kg" }],
["path", { d: "m19 9-3 3 3 3", key: "12ol22" }],
["path", { d: "m5 15 3-3-3-3", key: "1kdhjc" }]
]);
export { FoldHorizontal as default };
//# sourceMappingURL=fold-horizontal.js.map
@@ -0,0 +1 @@
module.exports={C:{"115":0.50137,"120":0.75205,"121":1.59108,"123":0.02046,"124":0.01023,"125":0.00512,"135":0.00512,"136":0.00512,"140":0.02558,"143":0.00512,"144":0.00512,"145":0.00512,"146":0.00512,"150":0.02046,"151":0.01023,"152":0.01535,"153":0.02558,"154":0.1586,"155":0.42974,"156":0.36835,"157":0.02046,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 126 127 128 129 130 131 132 133 134 137 138 139 141 142 147 148 149 158 159 160 3.5 3.6"},D:{"67":0.00512,"79":0.01535,"83":0.00512,"87":0.00512,"92":0.02046,"93":0.00512,"97":0.01023,"98":0.00512,"101":0.00512,"103":0.43486,"104":0.31208,"105":0.31208,"106":0.31719,"107":0.31719,"108":0.31719,"109":0.42974,"110":0.32742,"111":0.31719,"112":0.31208,"114":0.04093,"115":0.01535,"116":0.6395,"117":0.30696,"118":1.12552,"119":1.5655,"120":1.95431,"121":0.00512,"122":0.04093,"123":0.0307,"124":0.31719,"125":0.00512,"126":0.00512,"127":0.01023,"128":0.05628,"129":0.00512,"130":0.00512,"131":0.62415,"132":0.01023,"133":0.71112,"134":0.08186,"135":0.10232,"136":0.0972,"137":0.0972,"138":0.13813,"139":0.08697,"140":0.11255,"141":0.29161,"142":0.353,"143":0.01023,"144":0.24557,"145":0.0972,"146":0.2558,"147":0.0307,"148":0.21487,"149":0.20976,"150":0.39393,"151":7.07543,"152":6.73777,"153":5.87317,"154":1.43248,"155":0.01023,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 68 69 70 71 72 73 74 75 76 77 78 80 81 84 85 86 88 89 90 91 94 95 96 99 100 102 113 156 157"},F:{"54":0.00512,"56":0.00512,"101":0.00512,"105":0.00512,"106":0.01023,"107":0.00512,"116":0.00512,"131":0.01535,"133":0.00512,"134":0.18929,"135":0.94134,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 55 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 102 103 104 108 109 110 111 112 113 114 115 117 118 119 120 121 122 123 124 125 126 127 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00512,"109":0.01023,"119":0.76228,"120":0.77252,"122":0.00512,"123":0.00512,"130":0.00512,"134":0.01023,"136":0.00512,"139":0.00512,"140":0.00512,"141":0.00512,"143":0.00512,"144":0.00512,"145":0.01023,"146":0.00512,"147":0.02558,"148":0.01023,"149":0.02046,"150":0.05116,"151":0.18929,"152":1.5348,"153":1.9185,"154":0.52695,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 121 124 125 126 127 128 129 131 132 133 135 137 138 142"},E:{"27":0.43486,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.4 17.2 27.1 TP","14.1":0.00512,"15.6":0.02558,"16.3":0.00512,"16.5":0.00512,"16.6":0.04604,"17.0":0.00512,"17.1":0.01535,"17.3":0.00512,"17.4":0.00512,"17.5":0.00512,"17.6":0.06651,"18.0":0.00512,"18.1":0.01023,"18.2":0.00512,"18.3":0.00512,"18.4":0.00512,"18.5-18.7":0.01535,"26.0":0.01023,"26.1":0.00512,"26.2":0.02046,"26.3":0.04093,"26.4":0.02046,"26.5":0.19441,"26.6":1.20226,"27.2":0.00512},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00127,"5.0-5.1":0.00127,"6.0-6.1":0,"7.0-7.1":0.00253,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01265,"11.0-11.2":0.00127,"11.3-11.4":0.00253,"12.0-12.1":0,"12.2-12.5":0.0329,"13.0-13.1":0,"13.2":0.00633,"13.3":0,"13.4-13.7":0.00127,"14.0-14.4":0.00506,"14.5-14.8":0.00759,"15.0-15.1":0.00759,"15.2-15.3":0.00506,"15.4":0.00633,"15.5":0.00759,"15.6-15.8":0.16451,"16.0":0.01265,"16.1":0.02278,"16.2":0.01265,"16.3":0.02784,"16.4":0.00633,"16.5":0.01012,"16.6-16.7":0.22905,"17.0":0.00886,"17.1":0.01265,"17.2":0.01265,"17.3":0.01898,"17.4":0.02657,"17.5":0.05188,"17.6-17.7":0.13414,"18.0":0.02784,"18.1":0.05568,"18.2":0.07593,"18.3":0.13161,"18.4":0.08225,"18.5-18.7":1.69949,"26.0":0.08225,"26.1":0.08352,"26.2":0.21766,"26.3":0.23537,"26.4":0.1721,"26.5":1.15282,"26.6":7.11306,"27.0":0.54541,"27.1":0,"27.2":0.01392},P:{"4":0.00968,"21":0.00968,"23":0.00968,"24":0.00968,"25":0.00968,"26":0.06778,"27":0.01937,"28":0.04842,"29":0.12588,"30":3.58285,_:"20 22 5.0-5.4 6.2-6.4 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.00968,"8.2":0.00968},I:{"0":0.00976,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.23443,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":32.63847},R:{_:"0"},M:{"0":0.28816},Q:{"14.9":0.00488},O:{"0":0.00977},H:{all:0}};
@@ -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 LockKeyhole = createLucideIcon("LockKeyhole", [
["circle", { cx: "12", cy: "16", r: "1", key: "1au0dj" }],
["rect", { x: "3", y: "10", width: "18", height: "12", rx: "2", key: "6s8ecr" }],
["path", { d: "M7 10V7a5 5 0 0 1 10 0v3", key: "1pqi11" }]
]);
export { LockKeyhole as default };
//# sourceMappingURL=lock-keyhole.js.map
@@ -0,0 +1 @@
{"version":3,"file":"calendar-minus.js","sources":["../../../src/icons/calendar-minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CalendarMinus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgMTloNiIgLz4KICA8cGF0aCBkPSJNMTYgMnY0IiAvPgogIDxwYXRoIGQ9Ik0yMSAxNVY2YTIgMiAwIDAgMC0yLTJINWEyIDIgMCAwIDAtMiAydjE0YTIgMiAwIDAgMCAyIDJoOC41IiAvPgogIDxwYXRoIGQ9Ik0zIDEwaDE4IiAvPgogIDxwYXRoIGQ9Ik04IDJ2NCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/calendar-minus\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 CalendarMinus = createLucideIcon('CalendarMinus', [\n ['path', { d: 'M16 19h6', key: 'xwg31i' }],\n ['path', { d: 'M16 2v4', key: '4m81vk' }],\n ['path', { d: 'M21 15V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5', key: '1scpom' }],\n ['path', { d: 'M3 10h18', key: '8toen8' }],\n ['path', { d: 'M8 2v4', key: '1cmpym' }],\n]);\n\nexport default CalendarMinus;\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,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5F,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,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACzC,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,107 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference lib="esnext.temporal" />
declare namespace Intl {
type FormattableTemporalObject = Temporal.PlainDate | Temporal.PlainYearMonth | Temporal.PlainMonthDay | Temporal.PlainTime | Temporal.PlainDateTime | Temporal.Instant;
interface DateTimeFormat {
format(date?: FormattableTemporalObject | Date | number): string;
formatToParts(date?: FormattableTemporalObject | Date | number): DateTimeFormatPart[];
formatRange(startDate: FormattableTemporalObject | Date | number, endDate: FormattableTemporalObject | Date | number): string;
formatRangeToParts(startDate: FormattableTemporalObject | Date | number, endDate: FormattableTemporalObject | Date | number): DateTimeRangeFormatPart[];
}
interface Locale {
/**
* Returns a list of one or more unique calendar identifiers for this locale.
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getCalendars)
*/
getCalendars(): string[];
/**
* Returns a list of one or more collation types for this locale.
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getCollations)
*/
getCollations(): string[];
/**
* Returns a list of one or more unique hour cycle identifiers for this locale.
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getHourCycles)
*/
getHourCycles(): string[];
/**
* Returns a list of one or more unique numbering system identifiers for this locale.
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getNumberingSystems)
*/
getNumberingSystems(): string[];
/**
* Returns the ordering of characters indicated by either ltr (left-to-right) or by rtl (right-to-left) for this locale.
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo)
*/
getTextInfo(): TextInfo;
/**
* Returns a list of supported time zones for this locale.
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTimeZones)
*/
getTimeZones(): string[] | undefined;
/**
* Returns a `WeekInfo` object with the properties `firstDay`, `weekend` and `minimalDays` for this locale.
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo)
*/
getWeekInfo(): WeekInfo;
}
/**
* An object representing text typesetting information associated with the Locale data specified in UTS 35's Layouts Elements.
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo#return_value)
*/
interface TextInfo {
/**
* A string indicating the direction of text for the locale. Can be either "ltr" (left-to-right) or "rtl" (right-to-left).
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo#direction)
*/
direction?: "ltr" | "rtl";
}
/**
* An object representing week information associated with the Locale data specified in UTS 35's Week Elements.
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo#return_value)
*/
interface WeekInfo {
/**
* An integer between 1 (Monday) and 7 (Sunday) indicating the first day of the week for the locale. Commonly 1, 5, 6, or 7.
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo#firstday)
*/
firstDay: number;
/**
* An array of integers between 1 and 7 indicating the weekend days for the locale.
*
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo#weekend)
*/
weekend: number[];
}
}
@@ -0,0 +1,45 @@
{
"name": "env-paths",
"version": "2.2.1",
"description": "Get paths for storing things like data, config, cache, etc",
"license": "MIT",
"repository": "sindresorhus/env-paths",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"common",
"user",
"paths",
"env",
"environment",
"directory",
"dir",
"appdir",
"path",
"data",
"config",
"cache",
"logs",
"temp",
"linux",
"unix"
],
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.1",
"xo": "^0.24.0"
}
}
@@ -0,0 +1,39 @@
{
"name": "joycon",
"version": "3.1.1",
"description": "Load config with ease.",
"repository": {
"url": "egoist/joycon",
"type": "git"
},
"main": "lib/index.js",
"types": "types/index.d.ts",
"files": [
"lib",
"types/index.d.ts"
],
"scripts": {
"test": "jest --testPathPattern tests",
"build": "babel src -d lib --no-comments",
"prepublishOnly": "npm run build"
},
"author": "egoist <0x142857@gmail.com>",
"license": "MIT",
"jest": {
"testEnvironment": "node"
},
"devDependencies": {
"@babel/cli": "^7.13.10",
"@babel/core": "^7.13.10",
"@babel/preset-env": "^7.13.10",
"@egoist/prettier-config": "^0.1.0",
"@types/node": "^14.14.33",
"babel-jest": "^26.6.3",
"babel-plugin-sync": "^0.1.0",
"jest-cli": "^26.6.3",
"prettier": "^2.2.1"
},
"engines": {
"node": ">=10"
}
}
@@ -0,0 +1,68 @@
{
"name": "tsx",
"version": "4.21.0",
"description": "TypeScript Execute (tsx): Node.js enhanced with esbuild to run TypeScript & ESM files",
"keywords": [
"cli",
"runtime",
"node",
"cjs",
"commonjs",
"esm",
"typescript",
"typescript runner"
],
"license": "MIT",
"repository": "privatenumber/tsx",
"author": {
"name": "Hiroki Osame",
"email": "hiroki.osame@gmail.com"
},
"files": [
"dist"
],
"type": "module",
"bin": "./dist/cli.mjs",
"exports": {
"./package.json": "./package.json",
".": "./dist/loader.mjs",
"./patch-repl": "./dist/patch-repl.cjs",
"./cjs": "./dist/cjs/index.cjs",
"./cjs/api": {
"import": {
"types": "./dist/cjs/api/index.d.mts",
"default": "./dist/cjs/api/index.mjs"
},
"require": {
"types": "./dist/cjs/api/index.d.cts",
"default": "./dist/cjs/api/index.cjs"
}
},
"./esm": "./dist/esm/index.mjs",
"./esm/api": {
"import": {
"types": "./dist/esm/api/index.d.mts",
"default": "./dist/esm/api/index.mjs"
},
"require": {
"types": "./dist/esm/api/index.d.cts",
"default": "./dist/esm/api/index.cjs"
}
},
"./cli": "./dist/cli.mjs",
"./suppress-warnings": "./dist/suppress-warnings.cjs",
"./preflight": "./dist/preflight.cjs",
"./repl": "./dist/repl.mjs"
},
"homepage": "https://tsx.is",
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"esbuild": "~0.27.0",
"get-tsconfig": "^4.7.5"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
}
}
@@ -0,0 +1,139 @@
import { AnyRoute, StaticDataRouteOption } from './route.cjs';
import { AllContext, AllLoaderData, AllParams, FullSearchSchema, ParseRoute, RouteById, RouteIds } from './routeInfo.cjs';
import { AnyRouter, RegisteredRouter, SSROption } from './router.cjs';
import { Constrain, ControlledPromise } from './utils.cjs';
export type AnyMatchAndValue = {
match: any;
value: any;
};
export type FindValueByIndex<TKey, TValue extends ReadonlyArray<any>> = TKey extends `${infer TIndex extends number}` ? TValue[TIndex] : never;
export type FindValueByKey<TKey, TValue> = TValue extends ReadonlyArray<any> ? FindValueByIndex<TKey, TValue> : TValue[TKey & keyof TValue];
export type CreateMatchAndValue<TMatch, TValue> = TValue extends any ? {
match: TMatch;
value: TValue;
} : never;
export type NextMatchAndValue<TKey, TMatchAndValue extends AnyMatchAndValue> = TMatchAndValue extends any ? CreateMatchAndValue<TMatchAndValue['match'], FindValueByKey<TKey, TMatchAndValue['value']>> : never;
export type IsMatchKeyOf<TValue> = TValue extends ReadonlyArray<any> ? number extends TValue['length'] ? `${number}` : keyof TValue & `${number}` : TValue extends object ? keyof TValue & string : never;
export type IsMatchPath<TParentPath extends string, TMatchAndValue extends AnyMatchAndValue> = `${TParentPath}${IsMatchKeyOf<TMatchAndValue['value']>}`;
export type IsMatchResult<TKey, TMatchAndValue extends AnyMatchAndValue> = TMatchAndValue extends any ? TKey extends keyof TMatchAndValue['value'] ? TMatchAndValue['match'] : never : never;
export type IsMatchParse<TPath, TMatchAndValue extends AnyMatchAndValue, TParentPath extends string = ''> = TPath extends `${string}.${string}` ? TPath extends `${infer TFirst}.${infer TRest}` ? IsMatchParse<TRest, NextMatchAndValue<TFirst, TMatchAndValue>, `${TParentPath}${TFirst}.`> : never : {
path: IsMatchPath<TParentPath, TMatchAndValue>;
result: IsMatchResult<TPath, TMatchAndValue>;
};
export type IsMatch<TMatch, TPath> = IsMatchParse<TPath, TMatch extends any ? {
match: TMatch;
value: TMatch;
} : never>;
/**
* Narrows matches based on a path
* @experimental
*/
export declare const isMatch: <TMatch, TPath extends string>(match: TMatch, path: Constrain<TPath, IsMatch<TMatch, TPath>["path"]>) => match is IsMatch<TMatch, TPath>["result"];
export interface DefaultRouteMatchExtensions {
scripts?: unknown;
links?: unknown;
headScripts?: unknown;
meta?: unknown;
styles?: unknown;
}
export interface RouteMatchExtensions extends DefaultRouteMatchExtensions {
}
export interface RouteMatch<out TRouteId, out TFullPath, out TAllParams, out TFullSearchSchema, out TLoaderData, out TAllContext, out TLoaderDeps> extends RouteMatchExtensions {
id: string;
routeId: TRouteId;
fullPath: TFullPath;
index: number;
pathname: string;
params: TAllParams;
_strictParams: TAllParams;
status: 'pending' | 'success' | 'error' | 'redirected' | 'notFound';
isFetching: false | 'beforeLoad' | 'loader';
error: unknown;
paramsError: unknown;
searchError: unknown;
updatedAt: number;
_nonReactive: {
loadPromise?: ControlledPromise<void>;
displayPendingPromise?: Promise<void>;
minPendingPromise?: ControlledPromise<void>;
dehydrated?: boolean;
};
loaderData?: TLoaderData;
context: TAllContext;
search: TFullSearchSchema;
_strictSearch: TFullSearchSchema;
fetchCount: number;
abortController: AbortController;
cause: 'preload' | 'enter' | 'stay';
loaderDeps: TLoaderDeps;
preload: boolean;
invalid: boolean;
headers?: Record<string, string>;
globalNotFound?: boolean;
staticData: StaticDataRouteOption;
/** This attribute is not reactive */
ssr?: SSROption;
_forcePending?: boolean;
_displayPending?: boolean;
}
export interface PreValidationErrorHandlingRouteMatch<TRouteId, TFullPath, TAllParams, TFullSearchSchema> {
id: string;
routeId: TRouteId;
fullPath: TFullPath;
index: number;
pathname: string;
search: {
status: 'success';
value: TFullSearchSchema;
} | {
status: 'error';
error: unknown;
};
params: {
status: 'success';
value: TAllParams;
} | {
status: 'error';
error: unknown;
};
staticData: StaticDataRouteOption;
ssr?: boolean | 'data-only';
}
export type MakePreValidationErrorHandlingRouteMatchUnion<TRouter extends AnyRouter = RegisteredRouter, TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>> = TRoute extends any ? PreValidationErrorHandlingRouteMatch<TRoute['id'], TRoute['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema']> : never;
export type MakeRouteMatchFromRoute<TRoute extends AnyRoute> = RouteMatch<TRoute['types']['id'], TRoute['types']['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema'], TRoute['types']['loaderData'], TRoute['types']['allContext'], TRoute['types']['loaderDeps']>;
export type MakeRouteMatch<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TRouteId = RouteIds<TRouteTree>, TStrict extends boolean = true> = RouteMatch<TRouteId, RouteById<TRouteTree, TRouteId>['types']['fullPath'], TStrict extends false ? AllParams<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['allParams'], TStrict extends false ? FullSearchSchema<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema'], TStrict extends false ? AllLoaderData<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['loaderData'], TStrict extends false ? AllContext<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['allContext'], RouteById<TRouteTree, TRouteId>['types']['loaderDeps']>;
export type AnyRouteMatch = RouteMatch<any, any, any, any, any, any, any>;
export type MakeRouteMatchUnion<TRouter extends AnyRouter = RegisteredRouter, TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>> = TRoute extends any ? RouteMatch<TRoute['id'], TRoute['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema'], TRoute['types']['loaderData'], TRoute['types']['allContext'], TRoute['types']['loaderDeps']> : never;
/**
* The `MatchRouteOptions` type is used to describe the options that can be used when matching a route.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#matchrouteoptions-type)
*/
export interface MatchRouteOptions {
/**
* If `true`, will match against pending location instead of the current location.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#pending-property)
*/
pending?: boolean;
/**
* If `true`, will match against the current location with case sensitivity.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#casesensitive-property)
*
* @deprecated Declare case sensitivity in the route definition instead, or globally for all routes using the `caseSensitive` option on the router.
*/
caseSensitive?: boolean;
/**
* If `true`, will match against the current location's search params using a deep inclusive check. e.g. `{ a: 1 }` will match for a current location of `{ a: 1, b: 2 }`.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#includesearch-property)
*/
includeSearch?: boolean;
/**
* If `true`, will match against the current location using a fuzzy match. e.g. `/posts` will match for a current location of `/posts/123`.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#fuzzy-property)
*/
fuzzy?: boolean;
}
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const HardHat = createLucideIcon("HardHat", [
["path", { d: "M10 10V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5", key: "1p9q5i" }],
["path", { d: "M14 6a6 6 0 0 1 6 6v3", key: "1hnv84" }],
["path", { d: "M4 15v-3a6 6 0 0 1 6-6", key: "9ciidu" }],
["rect", { x: "2", y: "15", width: "20", height: "4", rx: "1", key: "g3x8cw" }]
]);
export { HardHat as default };
//# sourceMappingURL=hard-hat.js.map
@@ -0,0 +1,10 @@
import { AnyRoute, AnyRouter } from '@tanstack/router-core';
/**
* Renders a not found component for a route when no matching route is found.
*
* @param router - The router instance containing the route configuration
* @param route - The route that triggered the not found state
* @param data - Additional data to pass to the not found component
* @returns The rendered not found component or a default fallback component
*/
export declare function renderRouteNotFound(router: AnyRouter, route: AnyRoute, data: any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,83 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateChallenge = generateChallenge;
exports.default = pkceChallenge;
exports.verifyChallenge = verifyChallenge;
let crypto;
crypto =
globalThis.crypto?.webcrypto ?? // Node.js [18-16] REPL
globalThis.crypto ?? // Node.js >18
import("node:crypto").then(m => m.webcrypto); // Node.js <18 Non-REPL
/**
* Creates an array of length `size` of random bytes
* @param size
* @returns Array of random ints (0 to 255)
*/
async function getRandomValues(size) {
return (await crypto).getRandomValues(new Uint8Array(size));
}
/** Generate cryptographically strong random string
* @param size The desired length of the string
* @returns The random string
*/
async function random(size) {
const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";
const evenDistCutoff = Math.pow(2, 8) - Math.pow(2, 8) % mask.length;
let result = "";
while (result.length < size) {
const randomBytes = await getRandomValues(size - result.length);
for (const randomByte of randomBytes) {
if (randomByte < evenDistCutoff) {
result += mask[randomByte % mask.length];
}
}
}
return result;
}
/** Generate a PKCE challenge verifier
* @param length Length of the verifier
* @returns A random verifier `length` characters long
*/
async function generateVerifier(length) {
return await random(length);
}
/** Generate a PKCE code challenge from a code verifier
* @param code_verifier
* @returns The base64 url encoded code challenge
*/
async function generateChallenge(code_verifier) {
const buffer = await (await crypto).subtle.digest("SHA-256", new TextEncoder().encode(code_verifier));
// Generate base64url string
// btoa is deprecated in Node.js but is used here for web browser compatibility
// (which has no good replacement yet, see also https://github.com/whatwg/html/issues/6811)
return btoa(String.fromCharCode(...new Uint8Array(buffer)))
.replace(/\//g, '_')
.replace(/\+/g, '-')
.replace(/=/g, '');
}
/** Generate a PKCE challenge pair
* @param length Length of the verifer (between 43-128). Defaults to 43.
* @returns PKCE challenge pair
*/
async function pkceChallenge(length) {
if (!length)
length = 43;
if (length < 43 || length > 128) {
throw `Expected a length between 43 and 128. Received ${length}.`;
}
const verifier = await generateVerifier(length);
const challenge = await generateChallenge(verifier);
return {
code_verifier: verifier,
code_challenge: challenge,
};
}
/** Verify that a code_verifier produces the expected code challenge
* @param code_verifier
* @param expectedChallenge The code challenge to verify
* @returns True if challenges are equal. False otherwise.
*/
async function verifyChallenge(code_verifier, expectedChallenge) {
const actualChallenge = await generateChallenge(code_verifier);
return actualChallenge === expectedChallenge;
}
@@ -0,0 +1 @@
{"version":3,"file":"user-plus.js","sources":["../../../src/icons/user-plus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name UserPlus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgMjF2LTJhNCA0IDAgMCAwLTQtNEg2YTQgNCAwIDAgMC00IDR2MiIgLz4KICA8Y2lyY2xlIGN4PSI5IiBjeT0iNyIgcj0iNCIgLz4KICA8bGluZSB4MT0iMTkiIHgyPSIxOSIgeTE9IjgiIHkyPSIxNCIgLz4KICA8bGluZSB4MT0iMjIiIHgyPSIxNiIgeTE9IjExIiB5Mj0iMTEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/user-plus\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 UserPlus = createLucideIcon('UserPlus', [\n ['path', { d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2', key: '1yyitq' }],\n ['circle', { cx: '9', cy: '7', r: '4', key: 'nufk8' }],\n ['line', { x1: '19', x2: '19', y1: '8', y2: '14', key: '1bvyxn' }],\n ['line', { x1: '22', x2: '16', y1: '11', y2: '11', key: '1shjgl' }],\n]);\n\nexport default UserPlus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC1E,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAS,CAAA,CAAA;AAAA,CACrD,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,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjE,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,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACpE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"monitor.js","sources":["../../../src/icons/monitor.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Monitor\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMjAiIGhlaWdodD0iMTQiIHg9IjIiIHk9IjMiIHJ4PSIyIiAvPgogIDxsaW5lIHgxPSI4IiB4Mj0iMTYiIHkxPSIyMSIgeTI9IjIxIiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMTciIHkyPSIyMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/monitor\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 Monitor = createLucideIcon('Monitor', [\n ['rect', { width: '20', height: '14', x: '2', y: '3', rx: '2', key: '48i651' }],\n ['line', { x1: '8', x2: '16', y1: '21', y2: '21', key: '1svkeh' }],\n ['line', { x1: '12', x2: '12', y1: '17', y2: '21', key: 'vw1qmm' }],\n]);\n\nexport default Monitor;\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,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC9E,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjE,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,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACpE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,45 @@
{
"name": "forwarded",
"description": "Parse HTTP X-Forwarded-For header",
"version": "0.2.0",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>"
],
"license": "MIT",
"keywords": [
"x-forwarded-for",
"http",
"req"
],
"repository": "jshttp/forwarded",
"devDependencies": {
"beautify-benchmark": "0.2.4",
"benchmark": "2.1.4",
"deep-equal": "1.0.1",
"eslint": "7.27.0",
"eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.23.4",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.3.1",
"eslint-plugin-standard": "4.1.0",
"mocha": "8.4.0",
"nyc": "15.1.0"
},
"files": [
"LICENSE",
"HISTORY.md",
"README.md",
"index.js"
],
"engines": {
"node": ">= 0.6"
},
"scripts": {
"bench": "node benchmark/index.js",
"lint": "eslint .",
"test": "mocha --reporter spec --bail --check-leaks test/",
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test",
"version": "node scripts/version-history.js && git add HISTORY.md"
}
}
@@ -0,0 +1,422 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-unnecessary-type-parameters',
meta: {
type: 'problem',
docs: {
description: "Disallow type parameters that aren't used multiple times",
recommended: 'strict',
requiresTypeChecking: true,
},
hasSuggestions: true,
messages: {
replaceUsagesWithConstraint: 'Replace all usages of type parameter with its constraint.',
sole: 'Type parameter {{name}} is {{uses}} in the {{descriptor}} signature.',
},
schema: [],
},
defaultOptions: [],
create(context) {
const parserServices = (0, util_1.getParserServices)(context);
function checkNode(node, descriptor) {
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
const checker = parserServices.program.getTypeChecker();
let counts;
// Get the scope in which the type parameters are declared.
const scope = context.sourceCode.getScope(node);
for (const typeParameter of tsNode.typeParameters) {
const esTypeParameter = parserServices.tsNodeToESTreeNodeMap.get(typeParameter);
const smTypeParameterVariable = (0, util_1.nullThrows)((() => {
const variable = scope.set.get(esTypeParameter.name.name);
return variable?.isTypeVariable ? variable : undefined;
})(), "Type parameter should be present in scope's variables.");
// Quick path: if the type parameter is used multiple times in the AST,
// we don't need to dip into types to know it's repeated.
if (isTypeParameterRepeatedInAST(esTypeParameter, smTypeParameterVariable.references, node.body?.range[0] ?? node.returnType?.range[1])) {
continue;
}
// For any inferred types, we have to dip into type checking.
counts ??= countTypeParameterUsage(checker, tsNode);
const identifierCounts = counts.get(typeParameter.name);
if (!identifierCounts || identifierCounts > 2) {
continue;
}
context.report({
node: esTypeParameter,
messageId: 'sole',
data: {
name: typeParameter.name.text,
descriptor,
uses: identifierCounts === 1 ? 'never used' : 'used only once',
},
suggest: [
{
messageId: 'replaceUsagesWithConstraint',
*fix(fixer) {
// Replace all the usages of the type parameter with the constraint...
const constraint = esTypeParameter.constraint;
// special case - a constraint of 'any' actually acts like 'unknown'
const constraintText = constraint != null &&
constraint.type !== utils_1.AST_NODE_TYPES.TSAnyKeyword
? context.sourceCode.getText(constraint)
: 'unknown';
for (const reference of smTypeParameterVariable.references) {
if (reference.isTypeReference) {
const referenceNode = reference.identifier;
const isComplexType = constraint?.type === utils_1.AST_NODE_TYPES.TSUnionType ||
constraint?.type === utils_1.AST_NODE_TYPES.TSIntersectionType ||
constraint?.type === utils_1.AST_NODE_TYPES.TSConditionalType;
const hasMatchingAncestorType = [
utils_1.AST_NODE_TYPES.TSArrayType,
utils_1.AST_NODE_TYPES.TSIndexedAccessType,
utils_1.AST_NODE_TYPES.TSIntersectionType,
utils_1.AST_NODE_TYPES.TSUnionType,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
].some(type => referenceNode.parent.parent.type === type);
if (isComplexType && hasMatchingAncestorType) {
const fixResult = (0, util_1.getWrappingFixer)({
node: referenceNode,
innerNode: constraint,
sourceCode: context.sourceCode,
wrap: constraintNode => constraintNode,
})(fixer);
yield fixResult;
}
else {
yield fixer.replaceText(referenceNode, constraintText);
}
}
}
// ...and remove the type parameter itself from the declaration.
const typeParamsNode = (0, util_1.nullThrows)(node.typeParameters, 'node should have type parameters');
// We are assuming at this point that the reported type parameter
// is present in the inspected node's type parameters.
if (typeParamsNode.params.length === 1) {
// Remove the whole <T> generic syntax if we're removing the only type parameter in the list.
yield fixer.remove(typeParamsNode);
}
else {
const index = typeParamsNode.params.indexOf(esTypeParameter);
if (index === 0) {
const commaAfter = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(esTypeParameter, token => token.value === ','), util_1.NullThrowsReasons.MissingToken('comma', 'type parameter list'));
const tokenAfterComma = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(commaAfter, {
includeComments: true,
}), util_1.NullThrowsReasons.MissingToken('token', 'type parameter list'));
yield fixer.removeRange([
esTypeParameter.range[0],
tokenAfterComma.range[0],
]);
}
else {
const commaBefore = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(esTypeParameter, token => token.value === ','), util_1.NullThrowsReasons.MissingToken('comma', 'type parameter list'));
yield fixer.removeRange([
commaBefore.range[0],
esTypeParameter.range[1],
]);
}
}
},
},
],
});
}
}
return {
[[
'ArrowFunctionExpression[typeParameters]',
'FunctionDeclaration[typeParameters]',
'FunctionExpression[typeParameters]',
'TSCallSignatureDeclaration[typeParameters]',
'TSConstructorType[typeParameters]',
'TSDeclareFunction[typeParameters]',
'TSEmptyBodyFunctionExpression[typeParameters]',
'TSFunctionType[typeParameters]',
'TSMethodSignature[typeParameters]',
].join(', ')](node) {
checkNode(node, 'function');
},
[[
'ClassDeclaration[typeParameters]',
'ClassExpression[typeParameters]',
].join(', ')](node) {
checkNode(node, 'class');
},
};
},
});
function isTypeParameterRepeatedInAST(node, references, startOfBody = Infinity) {
let total = 0;
for (const reference of references) {
// References inside the type parameter's definition don't count...
if (reference.identifier.range[0] < node.range[1] &&
reference.identifier.range[1] > node.range[0]) {
continue;
}
// ...nor references that are outside the declaring signature.
if (reference.identifier.range[0] > startOfBody) {
continue;
}
// Neither do references that aren't to the same type parameter,
// namely value-land (non-type) identifiers of the type parameter's type,
// and references to different type parameters or values.
if (!reference.isTypeReference ||
reference.identifier.name !== node.name.name) {
continue;
}
// If the type parameter is being used as a type argument, then we
// know the type parameter is being reused and can't be reported.
if (reference.identifier.parent.type === utils_1.AST_NODE_TYPES.TSTypeReference) {
const grandparent = skipConstituentsUpward(reference.identifier.parent.parent);
if (grandparent.type === utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation &&
grandparent.params.includes(reference.identifier.parent) &&
// Array and ReadonlyArray must be handled carefully
// let's defer the check to the type-aware phase
!(grandparent.parent.type === utils_1.AST_NODE_TYPES.TSTypeReference &&
grandparent.parent.typeName.type === utils_1.AST_NODE_TYPES.Identifier &&
['Array', 'ReadonlyArray'].includes(grandparent.parent.typeName.name))) {
return true;
}
}
total += 1;
if (total >= 2) {
return true;
}
}
return false;
}
function skipConstituentsUpward(node) {
switch (node.type) {
case utils_1.AST_NODE_TYPES.TSIntersectionType:
case utils_1.AST_NODE_TYPES.TSUnionType:
return skipConstituentsUpward(node.parent);
default:
return node;
}
}
/**
* Count uses of type parameters in inferred return types.
* We need to resolve and analyze the inferred return type of a function
* to see whether it contains additional references to the type parameters.
* For classes, we need to do this for all their methods.
*/
function countTypeParameterUsage(checker, node) {
const counts = new Map();
if (ts.isClassLike(node)) {
for (const typeParameter of node.typeParameters) {
collectTypeParameterUsageCounts(checker, typeParameter, counts, true);
}
for (const member of node.members) {
collectTypeParameterUsageCounts(checker, member, counts, true);
}
}
else {
collectTypeParameterUsageCounts(checker, node, counts, false);
}
return counts;
}
/**
* Populates {@link foundIdentifierUsages} by the number of times each type parameter
* appears in the given type by checking its uses through its type references.
* This is essentially a limited subset of the scope manager, but for types.
*/
function collectTypeParameterUsageCounts(checker, node, foundIdentifierUsages, fromClass) {
const visitedSymbolLists = new Set();
const type = checker.getTypeAtLocation(node);
const typeUsages = new Map();
const visitedConstraints = new Set();
let functionLikeType = false;
let visitedDefault = false;
if (ts.isCallSignatureDeclaration(node) ||
ts.isConstructorDeclaration(node)) {
functionLikeType = true;
visitSignature(checker.getSignatureFromDeclaration(node));
}
if (!functionLikeType) {
visitType(type, false);
}
function visitType(type, assumeMultipleUses, isReturnType = false) {
// Seeing the same type > (threshold=3 ** 2) times indicates a likely
// recursive type, like `type T = { [P in keyof T]: T }`.
// If it's not recursive, then heck, we've seen it enough times that any
// referenced types have been counted enough to qualify as used.
if (!type || incrementTypeUsages(type) > 9) {
return;
}
if (tsutils.isTypeParameter(type)) {
const declaration = type.getSymbol()?.getDeclarations()?.[0];
if (declaration) {
incrementIdentifierCount(declaration.name, assumeMultipleUses);
// Visiting the type of a constrained type parameter will recurse into
// the constraint. We avoid infinite loops by visiting each only once.
if (declaration.constraint &&
!visitedConstraints.has(declaration.constraint)) {
visitedConstraints.add(declaration.constraint);
visitType(checker.getTypeAtLocation(declaration.constraint), false);
}
if (declaration.default && !visitedDefault) {
visitedDefault = true;
visitType(checker.getTypeAtLocation(declaration.default), false);
}
}
}
// Catch-all: generic type references like `Exclude<T, null>`
else if (type.aliasTypeArguments) {
// We don't descend into the definition of the type alias, so we don't
// know whether it's used multiple times. It's safest to assume it is.
visitTypesList(type.aliasTypeArguments, true);
}
// Intersections and unions like `0 | 1`
else if (tsutils.isUnionOrIntersectionType(type)) {
visitTypesList(type.types, assumeMultipleUses);
}
// Index access types like `T[K]`
else if (tsutils.isIndexedAccessType(type)) {
visitType(type.objectType, assumeMultipleUses);
visitType(type.indexType, assumeMultipleUses);
}
// Tuple types like `[K, V]`
// Generic type references like `Map<K, V>`
else if (tsutils.isTypeReference(type)) {
for (const typeArgument of type.typeArguments ?? []) {
// currently, if we are in a "class context", everything is accepted
let thisAssumeMultipleUses = fromClass || assumeMultipleUses;
// special cases - readonly arrays/tuples are considered only to use the
// type parameter once. Mutable arrays/tuples are considered to use the
// type parameter multiple times if and only if they are returned.
// other kind of type references always count as multiple uses
thisAssumeMultipleUses ||= tsutils.isTupleType(type.target)
? isReturnType && !type.target.readonly
: checker.isArrayType(type.target)
? isReturnType &&
type.symbol?.getName() === 'Array'
: true;
visitType(typeArgument, thisAssumeMultipleUses, isReturnType);
}
}
// Template literals like `a${T}b`
else if (tsutils.isTemplateLiteralType(type)) {
for (const subType of type.types) {
visitType(subType, assumeMultipleUses);
}
}
// Conditional types like `T extends string ? T : never`
else if (tsutils.isConditionalType(type)) {
visitType(type.checkType, assumeMultipleUses);
visitType(type.extendsType, assumeMultipleUses);
}
// Catch-all: inferred object types like `{ K: V }`.
// These catch-alls should be _after_ more specific checks like
// `isTypeReference` to avoid descending into all the properties of a
// generic interface/class, e.g. `Map<K, V>`.
else if (tsutils.isObjectType(type)) {
const properties = type.getProperties();
visitSymbolsListOnce(properties, false);
if (isMappedType(type)) {
visitType(type.typeParameter, false);
if (properties.length === 0) {
// TS treats mapped types like `{[k in "a"]: T}` like `{a: T}`.
// They have properties, so we need to avoid double-counting.
visitType(type.templateType ?? type.constraintType, false);
}
}
visitType(type.getNumberIndexType(), true);
visitType(type.getStringIndexType(), true);
type.getCallSignatures().forEach(signature => {
functionLikeType = true;
visitSignature(signature);
});
type.getConstructSignatures().forEach(signature => {
functionLikeType = true;
visitSignature(signature);
});
}
// Catch-all: operator types like `keyof T`
else if (isOperatorType(type)) {
visitType(type.type, assumeMultipleUses);
}
}
function incrementIdentifierCount(id, assumeMultipleUses) {
const identifierCount = foundIdentifierUsages.get(id) ?? 0;
const value = assumeMultipleUses ? 2 : 1;
foundIdentifierUsages.set(id, identifierCount + value);
}
function incrementTypeUsages(type) {
const count = (typeUsages.get(type) ?? 0) + 1;
typeUsages.set(type, count);
return count;
}
function visitSignature(signature) {
if (!signature) {
return;
}
if (signature.thisParameter) {
visitType(checker.getTypeOfSymbol(signature.thisParameter), false);
}
for (const parameter of signature.parameters) {
visitType(checker.getTypeOfSymbol(parameter), false);
}
for (const typeParameter of signature.getTypeParameters() ?? []) {
visitType(typeParameter, false);
}
visitType(checker.getTypePredicateOfSignature(signature)?.type ??
signature.getReturnType(), false, true);
}
function visitSymbolsListOnce(symbols, assumeMultipleUses) {
if (visitedSymbolLists.has(symbols)) {
return;
}
visitedSymbolLists.add(symbols);
for (const symbol of symbols) {
visitType(checker.getTypeOfSymbol(symbol), assumeMultipleUses);
}
}
function visitTypesList(types, assumeMultipleUses) {
for (const type of types) {
visitType(type, assumeMultipleUses);
}
}
}
function isMappedType(type) {
return 'typeParameter' in type;
}
function isOperatorType(type) {
return 'type' in type && !!type.type;
}
@@ -0,0 +1,10 @@
export * from "./stringify.js";
export * from "./traversal.js";
export * from "./manipulation.js";
export * from "./querying.js";
export * from "./legacy.js";
export * from "./helpers.js";
export * from "./feeds.js";
/** @deprecated Use these methods from `domhandler` directly. */
export { isTag, isCDATA, isText, isComment, isDocument, hasChildren, } from "domhandler";
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"useRouterState.cjs","names":[],"sources":["../../src/useRouterState.tsx"],"sourcesContent":["'use client'\n\nimport { useStore } from '@tanstack/react-store'\nimport { useRef } from 'react'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\nimport type {\n StructuralSharingOption,\n ValidateSelected,\n} from './structuralSharing'\n\nexport type UseRouterStateOptions<\n TRouter extends AnyRouter,\n TSelected,\n TStructuralSharing,\n> = {\n router?: TRouter\n select?: (\n state: RouterState<TRouter['routeTree']>,\n ) => ValidateSelected<TRouter, TSelected, TStructuralSharing>\n} & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>\n\nexport type UseRouterStateResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? RouterState<TRouter['routeTree']> : TSelected\n\n/**\n * Subscribe to the router's state store with optional selection and\n * structural sharing for render optimization.\n *\n * Options:\n * - `select`: Project the full router state to a derived slice\n * - `structuralSharing`: Replace-equal semantics for stable references\n * - `router`: Read state from a specific router instance instead of context\n *\n * @returns The selected router state (or the full state by default).\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterStateHook\n */\nexport function useRouterState<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n TStructuralSharing extends boolean = boolean,\n>(\n opts?: UseRouterStateOptions<TRouter, TSelected, TStructuralSharing>,\n): UseRouterStateResult<TRouter, TSelected> {\n const contextRouter = useRouter<TRouter>({\n warn: opts?.router === undefined,\n })\n const router = opts?.router || contextRouter\n\n // During SSR we render exactly once and do not need reactivity.\n // Avoid subscribing to the store (and any structural sharing work) on the server.\n const _isServer = isServer ?? router.isServer\n if (_isServer) {\n const state = router.stores.__store.get() as RouterState<\n TRouter['routeTree']\n >\n return (opts?.select ? opts.select(state) : state) as UseRouterStateResult<\n TRouter,\n TSelected\n >\n }\n\n const previousResult =\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useRef<ValidateSelected<TRouter, TSelected, TStructuralSharing>>(undefined)\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStore(router.stores.__store, (state) => {\n if (opts?.select) {\n if (opts.structuralSharing ?? router.options.defaultStructuralSharing) {\n const newSlice = replaceEqualDeep(\n previousResult.current,\n opts.select(state),\n )\n previousResult.current = newSlice\n return newSlice\n }\n return opts.select(state)\n }\n return state\n }) as UseRouterStateResult<TRouter, TSelected>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6CA,SAAgB,eAKd,MAC0C;CAC1C,MAAM,gBAAgB,kBAAA,UAAmB,EACvC,MAAM,MAAM,WAAW,KAAA,GACxB,CAAC;CACF,MAAM,SAAS,MAAM,UAAU;AAK/B,KADkB,+BAAA,YAAY,OAAO,UACtB;EACb,MAAM,QAAQ,OAAO,OAAO,QAAQ,KAAK;AAGzC,SAAQ,MAAM,SAAS,KAAK,OAAO,MAAM,GAAG;;CAM9C,MAAM,kBAAA,GAAA,MAAA,QAE6D,KAAA,EAAU;AAG7E,SAAA,GAAA,sBAAA,UAAgB,OAAO,OAAO,UAAU,UAAU;AAChD,MAAI,MAAM,QAAQ;AAChB,OAAI,KAAK,qBAAqB,OAAO,QAAQ,0BAA0B;IACrE,MAAM,YAAA,GAAA,sBAAA,kBACJ,eAAe,SACf,KAAK,OAAO,MAAM,CACnB;AACD,mBAAe,UAAU;AACzB,WAAO;;AAET,UAAO,KAAK,OAAO,MAAM;;AAE3B,SAAO;GACP"}
@@ -0,0 +1,184 @@
//#region src/middleware/timing/timing.ts
const getTime = () => {
try {
return performance.now();
} catch {}
return Date.now();
};
/**
* Server-Timing Middleware for Hono.
*
* @see {@link https://hono.dev/docs/middleware/builtin/timing}
*
* @param {TimingOptions} [config] - The options for the timing middleware.
* @param {boolean} [config.total=true] - Show the total response time.
* @param {boolean | ((c: Context) => boolean)} [config.enabled=true] - Whether timings should be added to the headers or not.
* @param {string} [config.totalDescription=Total Response Time] - Description for the total response time.
* @param {boolean} [config.autoEnd=true] - If `startTime()` should end automatically at the end of the request.
* @param {boolean | string | ((c: Context) => boolean | string)} [config.crossOrigin=false] - The origin this timings header should be readable.
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* const app = new Hono()
*
* // add the middleware to your router
* app.use(timing());
*
* app.get('/', async (c) => {
* // add custom metrics
* setMetric(c, 'region', 'europe-west3')
*
* // add custom metrics with timing, must be in milliseconds
* setMetric(c, 'custom', 23.8, 'My custom Metric')
*
* // start a new timer
* startTime(c, 'db');
*
* const data = await db.findMany(...);
*
* // end the timer
* endTime(c, 'db');
*
* return c.json({ response: data });
* });
* ```
*/
const timing = (config) => {
const options = {
total: true,
enabled: true,
totalDescription: "Total Response Time",
autoEnd: true,
crossOrigin: false,
...config
};
return async function timing(c, next) {
const headers = [];
const timers = /* @__PURE__ */ new Map();
if (c.get("metric")) return await next();
c.set("metric", {
headers,
timers
});
if (options.total) startTime(c, "total", options.totalDescription);
await next();
if (options.total) endTime(c, "total");
if (options.autoEnd) timers.forEach((_, key) => {
endTime(c, key);
});
if (typeof options.enabled === "function" ? options.enabled(c) : options.enabled) {
c.res.headers.append("Server-Timing", headers.join(","));
const crossOrigin = typeof options.crossOrigin === "function" ? options.crossOrigin(c) : options.crossOrigin;
if (crossOrigin) c.res.headers.append("Timing-Allow-Origin", typeof crossOrigin === "string" ? crossOrigin : "*");
}
};
};
/**
* Set a metric for the timing middleware.
*
* @param {Context} c - The context of the request.
* @param {string} name - The name of the metric.
* @param {number | string} [valueDescription] - The value or description of the metric.
* @param {string} [description] - The description of the metric.
* @param {number} [precision] - The precision of the metric value.
*
* @example
* ```ts
* setMetric(c, 'region', 'europe-west3')
* setMetric(c, 'custom', 23.8, 'My custom Metric')
* ```
*/
const setMetric = (c, name, valueDescription, description, precision) => {
const metrics = c.get("metric");
if (!metrics) {
console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!");
return;
}
if (typeof valueDescription === "number") {
const dur = valueDescription.toFixed(precision || 1);
const metric = description ? `${name};dur=${dur};desc="${description}"` : `${name};dur=${dur}`;
metrics.headers.push(metric);
} else {
const metric = valueDescription ? `${name};desc="${valueDescription}"` : `${name}`;
metrics.headers.push(metric);
}
};
/**
* Start a timer for the timing middleware.
*
* @param {Context} c - The context of the request.
* @param {string} name - The name of the timer.
* @param {string} [description] - The description of the timer.
*
* @example
* ```ts
* startTime(c, 'db')
* ```
*/
const startTime = (c, name, description) => {
const metrics = c.get("metric");
if (!metrics) {
console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!");
return;
}
metrics.timers.set(name, {
description,
start: getTime()
});
};
/**
* End a timer for the timing middleware.
*
* @param {Context} c - The context of the request.
* @param {string} name - The name of the timer.
* @param {number} [precision] - The precision of the timer value.
*
* @example
* ```ts
* endTime(c, 'db')
* ```
*/
const endTime = (c, name, precision) => {
const metrics = c.get("metric");
if (!metrics) {
console.warn("Metrics not initialized! Please add the `timing()` middleware to this route!");
return;
}
const timer = metrics.timers.get(name);
if (!timer) {
console.warn(`Timer "${name}" does not exist!`);
return;
}
const { description, start } = timer;
const duration = getTime() - start;
setMetric(c, name, duration, description, precision);
metrics.timers.delete(name);
};
/**
* Wrap a Promise to capture its duration.
* @param {Context} c - The context of the request.
* @param {string} name - The name of the timer.
* @param {Promise<T>} callable - The Promise to time.
* @param {string} [description] - The description of the timer.
* @param {number} [precision] - The precision of the timer value.
*
* @example
* ```ts
* // Instead of this:
* const data = await db.findMany(...);
*
* // do this:
* const data = await wrapTime(c, 'query', db.findMany(...));
* ```
* */
async function wrapTime(c, name, callable, description, precision) {
startTime(c, name, description);
try {
return await callable;
} finally {
endTime(c, name, precision);
}
}
//#endregion
export { endTime, setMetric, startTime, timing, wrapTime };
@@ -0,0 +1 @@
{"version":3,"file":"get-view-animations.mjs","sources":["../../../../src/view/utils/get-view-animations.ts"],"sourcesContent":["function filterViewAnimations(animation: Animation) {\n const { effect } = animation\n if (!effect) return false\n\n return (\n effect.target === document.documentElement &&\n effect.pseudoElement?.startsWith(\"::view-transition\")\n )\n}\n\nexport function getViewAnimations() {\n return document.getAnimations().filter(filterViewAnimations)\n}\n"],"names":[],"mappings":"AAAA,SAAS,oBAAoB,CAAC,SAAoB,EAAA;AAC9C,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS;AAC5B,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;AAEzB,IAAA,QACI,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,eAAe;QAC1C,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,mBAAmB,CAAC;AAE7D;SAEgB,iBAAiB,GAAA;IAC7B,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC;AAChE;;;;"}
@@ -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 Utensils = createLucideIcon("Utensils", [
["path", { d: "M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2", key: "cjf0a3" }],
["path", { d: "M7 2v20", key: "1473qp" }],
["path", { d: "M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7", key: "j28e5" }]
]);
export { Utensils as default };
//# sourceMappingURL=utensils.js.map
@@ -0,0 +1,113 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "Zeichen", verb: "zu haben" },
file: { unit: "Bytes", verb: "zu haben" },
array: { unit: "Elemente", verb: "zu haben" },
set: { unit: "Elemente", verb: "zu haben" },
map: { unit: "Elemente", verb: "zu haben" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "Eingabe",
email: "E-Mail-Adresse",
url: "URL",
emoji: "Emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO-Datum und -Uhrzeit",
date: "ISO-Datum",
time: "ISO-Uhrzeit",
duration: "ISO-Dauer",
ipv4: "IPv4-Adresse",
ipv6: "IPv6-Adresse",
mac: "MAC-Adresse",
cidrv4: "IPv4-Bereich",
cidrv6: "IPv6-Bereich",
base64: "Base64-codierter String",
base64url: "Base64-URL-codierter String",
json_string: "JSON-String",
e164: "E.164-Nummer",
credit_card: "Kreditkartennummer",
currency_code: "Währungscode",
iban: "IBAN",
jwt: "JWT",
template_literal: "Eingabe",
};
const TypeDictionary = {
nan: "NaN",
number: "Zahl",
array: "Array",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Ungültige Eingabe: erwartet instanceof ${issue.expected}, erhalten ${received}`;
}
return `Ungültige Eingabe: erwartet ${expected}, erhalten ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Ungültige Eingabe: erwartet ${util.stringifyPrimitive(issue.values[0])}`;
return `Ungültige Option: erwartet eine von ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`;
return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ist`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} hat`;
}
return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ist`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Ungültiger String: muss mit "${_issue.prefix}" beginnen`;
if (_issue.format === "ends_with")
return `Ungültiger String: muss mit "${_issue.suffix}" enden`;
if (_issue.format === "includes")
return `Ungültiger String: muss "${_issue.includes}" enthalten`;
if (_issue.format === "regex")
return `Ungültiger String: muss dem Muster ${_issue.pattern} entsprechen`;
return `Ungültig: ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Ungültige Zahl: muss ein Vielfaches von ${issue.divisor} sein`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Unbekannte Schlüssel" : "Unbekannter Schlüssel"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Ungültiger Schlüssel in ${issue.origin}`;
case "invalid_union":
return "Ungültige Eingabe";
case "invalid_element":
return `Ungültiger Wert in ${issue.origin}`;
default:
return `Ungültige Eingabe`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1 @@
{"version":3,"names":["spaceIndents","i","push","repeat","Buffer","constructor","map","indentChar","_map","_buf","_str","_appendCount","_last","_canMarkIdName","_indentChar","_queuedChar","_position","line","column","_sourcePosition","identifierName","undefined","identifierNamePos","filename","get","_flush","code","trimRight","decodedMap","rawMappings","result","getDecoded","__mergedMap","resultMap","value","Object","defineProperty","writable","mappings","getRawMappings","append","str","maybeNewline","ignoreMapping","_append","appendChar","char","_appendChar","queue","queuedChar","useSourcePos","indent","String","fromCharCode","isSpace","position","sourcePos","mark","len","length","hasMap","indexOf","last","removeLastSemicolon","getLastChar","checkQueue","getNewlineCount","hasContent","exactSource","loc","cb","source","prop","_normalizePosition","sourceWithOffset","columnOffset","pos","setSourcePosition","Math","max","target","getCurrentColumn","getCurrentLine","exports","default"],"sources":["../src/buffer.ts"],"sourcesContent":["import type SourceMap from \"./source-map.ts\";\nimport type { SourceLocation } from \"@babel/types\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charcodes from \"charcodes\";\n\nexport type Loc = SourceLocation;\nexport type Pos = SourceLocation[\"start\"];\n\ntype SourcePosition = {\n line: number | undefined;\n column: number | undefined;\n identifierName: string | undefined;\n identifierNamePos: Pos | undefined;\n filename: string | undefined;\n};\n\nconst spaceIndents: string[] = [];\nfor (let i = 0; i < 32; i++) {\n spaceIndents.push(\" \".repeat(i * 2));\n}\n\nexport default class Buffer {\n constructor(map: SourceMap | null, indentChar: string) {\n this._map = map;\n this._indentChar = indentChar;\n }\n\n _map: SourceMap | null = null;\n _buf = \"\";\n _str = \"\";\n _appendCount = 0;\n _last = 0;\n _canMarkIdName = true;\n _indentChar = \"\";\n _queuedChar: typeof charcodes.space | typeof charcodes.semicolon | 0 = 0;\n\n _position = {\n line: 1,\n column: 0,\n };\n _sourcePosition: SourcePosition = {\n identifierName: undefined,\n identifierNamePos: undefined,\n line: undefined,\n column: undefined,\n filename: undefined,\n };\n\n /**\n * Get the final string output from the buffer, along with the sourcemap if one exists.\n */\n\n get() {\n const { _map, _last } = this;\n if (this._queuedChar !== charcodes.space) {\n this._flush();\n }\n\n // Whatever trim is used here should not execute a regex against the\n // source string since it may be arbitrarily large after all transformations\n const code =\n _last === charcodes.lineFeed\n ? (this._buf + this._str).trimRight()\n : this._buf + this._str;\n\n // Creating objects with getters is expensive.\n if (_map === null) {\n return {\n code: code,\n decodedMap: undefined,\n map: null,\n rawMappings: undefined,\n };\n }\n\n const result = {\n code: code,\n // Decoded sourcemap is free to generate.\n decodedMap: _map.getDecoded(),\n // Used as a marker for backwards compatibility. We moved input map merging\n // into the generator. We cannot merge the input map a second time, so the\n // presence of this field tells us we've already done the work.\n get __mergedMap() {\n return this.map;\n },\n // Encoding the sourcemap is moderately CPU expensive.\n get map() {\n const resultMap = _map.get();\n result.map = resultMap;\n return resultMap;\n },\n set map(value) {\n Object.defineProperty(result, \"map\", { value, writable: true });\n },\n // Retrieving the raw mappings is very memory intensive.\n get rawMappings() {\n const mappings = _map.getRawMappings();\n result.rawMappings = mappings;\n return mappings;\n },\n set rawMappings(value) {\n Object.defineProperty(result, \"rawMappings\", { value, writable: true });\n },\n };\n\n return result;\n }\n\n /**\n * Add a string to the buffer that cannot be reverted.\n */\n\n append(\n str: string,\n maybeNewline: boolean,\n ignoreMapping: boolean = false,\n ): void {\n this._flush();\n this._append(str, maybeNewline, ignoreMapping);\n }\n\n appendChar(char: number): void {\n this._flush();\n this._appendChar(char, 1, true);\n }\n\n /**\n * Add a string to the buffer than can be reverted.\n */\n queue(char: typeof charcodes.space | typeof charcodes.semicolon): void {\n this._flush();\n this._queuedChar = char;\n }\n\n _flush(): void {\n const queuedChar = this._queuedChar;\n if (queuedChar !== 0) {\n this._appendChar(queuedChar, 1, true);\n this._queuedChar = 0;\n }\n }\n\n _appendChar(char: number, repeat: number, useSourcePos: boolean): void {\n this._last Line truncated
@@ -0,0 +1,32 @@
/**
* Reset an axis to the provided origin box.
*
* This is a mutative operation.
*/
function copyAxisInto(axis, originAxis) {
axis.min = originAxis.min;
axis.max = originAxis.max;
}
/**
* Reset a box to the provided origin box.
*
* This is a mutative operation.
*/
function copyBoxInto(box, originBox) {
copyAxisInto(box.x, originBox.x);
copyAxisInto(box.y, originBox.y);
}
/**
* Reset a delta to the provided origin box.
*
* This is a mutative operation.
*/
function copyAxisDeltaInto(delta, originDelta) {
delta.translate = originDelta.translate;
delta.scale = originDelta.scale;
delta.originPoint = originDelta.originPoint;
delta.origin = originDelta.origin;
}
export { copyAxisDeltaInto, copyAxisInto, copyBoxInto };
//# sourceMappingURL=copy.mjs.map
@@ -0,0 +1,83 @@
declare namespace locatePath {
interface Options {
/**
Current working directory.
@default process.cwd()
*/
readonly cwd?: string;
/**
Type of path to match.
@default 'file'
*/
readonly type?: 'file' | 'directory';
/**
Allow symbolic links to match if they point to the requested path type.
@default true
*/
readonly allowSymlinks?: boolean;
}
interface AsyncOptions extends Options {
/**
Number of concurrently pending promises. Minimum: `1`.
@default Infinity
*/
readonly concurrency?: number;
/**
Preserve `paths` order when searching.
Disable this to improve performance if you don't care about the order.
@default true
*/
readonly preserveOrder?: boolean;
}
}
declare const locatePath: {
/**
Synchronously get the first path that exists on disk of multiple paths.
@param paths - Paths to check.
@returns The first path that exists or `undefined` if none exists.
*/
sync: (
paths: Iterable<string>,
options?: locatePath.Options
) => string | undefined;
/**
Get the first path that exists on disk of multiple paths.
@param paths - Paths to check.
@returns The first path that exists or `undefined` if none exists.
@example
```
import locatePath = require('locate-path');
const files = [
'unicorn.png',
'rainbow.png', // Only this one actually exists on disk
'pony.png'
];
(async () => {
console(await locatePath(files));
//=> 'rainbow'
})();
```
*/
(paths: Iterable<string>, options?: locatePath.AsyncOptions): Promise<
string | undefined
>;
};
export = locatePath;
@@ -0,0 +1,332 @@
#ifndef NODE_SQLITE3_SRC_CONVERT_H
#define NODE_SQLITE3_SRC_CONVERT_H
// Shared value marshalling (Deliverable 06, extracted from the Deliverable 02
// code in statement.cc by the plan's instruction: "Do not write a second
// converter"). Both directions of statement binding and both directions of
// user-defined function arguments/results go through these helpers, so a
// value's type behaviour cannot drift between the two surfaces.
//
// - ConvertToField: JS value -> Values::Field (bind / function result)
// - ValueToCell: sqlite3_value* -> Cell (function arguments)
// - CellToJS: Cell -> JS value (rows / function arguments)
// - ConvertInt64ToJS: int64 -> JS honouring the database's integer mode
//
// The Values::Field/Cell/Row/Columns data types moved here from statement.h
// so this header has no dependency on the class.
#include <memory>
#include <string>
#include <vector>
#include <sqlite3.h>
#include <napi.h>
#include "database.h"
namespace node_sqlite3 {
namespace Values {
struct Field {
inline Field(unsigned short _index, unsigned short _type = SQLITE_NULL) :
type(_type), index(_index) {}
inline Field(const char* _name, unsigned short _type = SQLITE_NULL) :
type(_type), index(0), name(_name) {}
unsigned short type;
unsigned short index;
std::string name;
// Set when the value came from an explicit `undefined` (as opposed
// to `null`): used only to recognise the historical
// "accidental undefined" call shape against statements without
// parameters.
bool from_undefined = false;
virtual ~Field() = default;
};
struct Integer : Field {
template <class T> inline Integer(T _name, int64_t val) :
Field(_name, SQLITE_INTEGER), value(val) {}
int64_t value;
virtual ~Integer() override = default;
};
struct Float : Field {
template <class T> inline Float(T _name, double val) :
Field(_name, SQLITE_FLOAT), value(val) {}
double value;
virtual ~Float() override = default;
};
struct Text : Field {
template <class T> inline Text(T _name, size_t len, const char* val) :
Field(_name, SQLITE_TEXT), value(val, len) {}
std::string value;
virtual ~Text() override = default;
};
struct Blob : Field {
template <class T> inline Blob(T _name, size_t len, const void* val) :
Field(_name, SQLITE_BLOB), length(len) {
value = new char[len];
if (len > 0) {
memcpy(value, val, len);
}
}
inline virtual ~Blob() override {
delete[] value;
}
size_t length;
char* value;
};
typedef Field Null;
}
// A converted result cell: a flat value type instead of a per-cell heap
// object. TEXT payload and BLOB bytes live in `str` (binary-safe).
struct Cell {
unsigned short type = SQLITE_NULL;
int64_t integer = 0;
double real = 0.;
std::string str;
Cell() = default;
explicit Cell(unsigned short t) : type(t) {}
Cell(const Cell&) = default;
Cell(Cell&&) = default;
Cell& operator=(const Cell&) = default;
Cell& operator=(Cell&&) = default;
};
typedef std::vector<Cell> Row;
typedef std::vector<Row> Rows;
typedef std::vector<std::unique_ptr<Values::Field>> Parameters;
// Result column names captured from a prepared statement, shared by every
// row of one batch instead of being stored per cell.
//
// The shape is fixed for one execution: sqlite3_prepare_v2 may re-prepare
// transparently behind sqlite3_step() when the schema changed, but it keeps
// the original result columns. Capturing once per call therefore stays
// correct without relying on the names surviving across calls.
struct Columns {
std::vector<std::string> names;
// Populates the names on first use. Called on the thread that steps the
// statement, once per execution.
inline void EnsureLoaded(sqlite3_stmt* stmt) {
if (!names.empty()) return;
int cols = sqlite3_column_count(stmt);
names.reserve(cols);
for (int i = 0; i < cols; i++) {
const char* name = sqlite3_column_name(stmt, i);
names.emplace_back(name != NULL ? name : "");
}
}
};
// --- JS -> SQLite direction (bind parameters, function return values) ------
// Where a converted field will be bound: a 1-based parameter index for
// positional binds, or a name for named ones. Function return values use
// the default (neither) — they are never bound to a parameter.
struct FieldPos {
int index = 0;
const char* name = "";
};
// Converts one JS value into a field for binding. `subject` names the value
// in error messages, e.g. "parameter 3", "parameter $name" or "the return
// value of function 'foo'". Returns nullptr only with a TypeError or
// RangeError pending — no value is ever silently skipped or coerced.
std::unique_ptr<Values::Field> ConvertToField(const Napi::Value source,
const std::string& subject, const FieldPos& pos = FieldPos());
// --- SQLite -> JS direction (result columns, function arguments) -----------
// Reads one sqlite3_value into a Cell. Pure C: safe on any thread, which is
// where user-function arguments arrive.
void ValueToCell(Cell* cell, sqlite3_value* value);
// Names the value a conversion error is about, *without* building the
// name unless the error actually happens.
//
// The phrase is used by exactly one message: the 'number'-mode RangeError
// for an out-of-range integer. Building it eagerly cost a heap allocation
// and a concatenation for every cell of every row — on a 20,000 x 4 read,
// 80,000 allocations to describe an error that is not occurring. Callers
// that already hold a finished phrase (function arguments, changeset
// fields) pass a string and are converted implicitly; the row path passes
// the statement's cached column names plus an index, and pays nothing
// until Describe() is called.
struct ValueOrigin {
// A ready-made phrase, e.g. "argument 0". Borrowed, not owned; one of
// the two spellings callers already use.
const std::string* literal = nullptr;
const char* literal_cstr = nullptr;
// Or: a position in a statement's cached column names. Borrowed.
const std::vector<std::string>* column_names = nullptr;
size_t index = 0;
// Both conversions are implicit by design, so every existing call site
// keeps compiling — including the ones passing a string literal, which
// cannot reach a std::string parameter through a second user-defined
// conversion. Safe against temporaries: every use is inside the call
// expression that creates it.
ValueOrigin(const std::string& phrase) // NOLINT(runtime/explicit)
: literal(&phrase) {}
ValueOrigin(const char* phrase) // NOLINT(runtime/explicit)
: literal_cstr(phrase) {}
ValueOrigin(const std::vector<std::string>* names, size_t i)
: column_names(names), index(i) {}
// "column 'x'" when the name is known, "result column N" otherwise.
std::string Describe() const;
};
// Converts an int64 according to the database's integer mode (see
// Database::IntegerMode). Throws a RangeError in 'number' mode for unsafe
// values; callers must check env.IsExceptionPending() afterwards.
Napi::Value ConvertInt64ToJS(Napi::Env env, sqlite3_int64 value,
int integer_mode, const ValueOrigin& origin);
// Converts a Cell into a JS value: number/BigInt by integer mode, string,
// Buffer for blobs. `origin` names the value in the 'number'-mode
// RangeError, and is only formatted if that error is raised.
// `move_payload` enables the zero-copy external Buffer for blobs >= 4096
// bytes, moving the payload out of the cell (the row-conversion path, whose
// Cells are discarded afterwards); function arguments must pass false —
// their Cells outlive the conversion, so those blobs are copied.
// Throws (leaves a pending exception) only on the RangeError path.
// `raised` is the same per-cell failure channel as ColumnToJS's: it lets a
// row loop read a plain bool instead of calling napi_is_exception_pending
// per cell. Pass nullptr when the caller checks the env afterwards anyway.
Napi::Value CellToJS(Napi::Env env, Cell& cell, int integer_mode,
const ValueOrigin& origin, bool move_payload = false,
bool* raised = nullptr);
// Converts one live result column straight into a JS value, skipping the
// intermediate Cell entirely.
//
// The Cell exists for the *async* paths, where rows are read on a worker
// thread and converted later on the JS thread — there the copy is what
// makes the hand-off possible. The synchronous paths have no hand-off:
// they were paying for a full materialisation of the result set (a Row
// per row, a std::string per text/blob cell) and then converting it, so
// every string was copied twice and every row allocated twice.
//
// Semantics match CellToJS exactly, including an empty string/Buffer for a
// zero-length or NULL-pointer payload. Blobs are copied rather than
// adopted: the bytes belong to SQLite only until the next step, so there
// is nothing to move — which still leaves one copy, where the Cell route
// took two for blobs under 4096 bytes.
//
// The returned value borrows nothing from the statement; it is safe to
// step again immediately afterwards.
//
// `raised` is the per-cell failure channel: the row loop reads a plain
// bool instead of calling napi_is_exception_pending per cell (measured:
// inside run-to-run noise on its own, but it keeps the hot loop free of
// an avoidable ABI call). The only failure this conversion can produce
// is the 'number'-mode RangeError on an unsafe integer, so the flag is
// set exactly there; pass nullptr when the caller checks the env
// afterwards anyway.
Napi::Value ColumnToJS(Napi::Env env, sqlite3_stmt* stmt, int column,
int integer_mode, const ValueOrigin& origin, bool* raised = nullptr);
// Binds one JS value straight onto a prepared statement, with no
// intermediate Values::Field.
//
// The Field exists for the *asynchronous* paths, where the bind arguments
// are read on the JS thread and applied later on a worker thread — there
// the copy is what makes the hand-off possible. The synchronous paths have
// no hand-off, so a Field per parameter was a heap allocation (two, for
// text: the Field and its std::string) on a path whose whole point is
// minimal overhead.
//
// Type dispatch, coercions and error text match ConvertToField exactly;
// the two live side by side so they cannot drift apart unnoticed.
//
// Text payloads are malloc'd and handed to SQLite with `free` as the
// destructor, so ownership transfers instead of the value being copied a
// second time. SQLite runs that destructor even when the bind call fails,
// so there is no leak on the error path. Blobs are bound
// SQLITE_TRANSIENT: SQLite copies them immediately, which is what makes
// it safe not to keep the JS value alive.
//
// `rc` receives the sqlite3_bind_* result. `from_undefined` reports an
// explicit `undefined` argument, for the zero-parameter escape hatch in
// Statement::BindArgumentsDirect. Returns false with a pending JS
// exception for a value that cannot be bound at all.
// Names a bind position in an error message ("parameter 3",
// "parameter $name"), formatted only when an error is actually raised.
// Building it eagerly cost a heap allocation per parameter on every
// successful bind, which is the whole call for a small insert.
struct BindSubject {
int index = 0;
const char* name = nullptr;
explicit BindSubject(int i) : index(i) {}
explicit BindSubject(const char* n) : name(n) {}
std::string Describe() const;
};
bool BindValueDirect(sqlite3_stmt* stmt, int pos, const Napi::Value source,
const BindSubject& subject, int* rc, bool* from_undefined);
// True for a plain-object instance of the named global constructor
// ("Date", "RegExp"), matching JS instanceof.
//
// Declared here rather than re-declared per translation unit: the bind
// paths and the converter must agree on what counts as a Date or a
// RegExp, and a second declaration at another scope links against
// nothing under the addon's -undefined dynamic_lookup.
bool OtherInstanceOf(Napi::Object source, const char* object_type);
// True when a bind argument should be read as a map of named parameters
// rather than as a single positional value.
//
// Both bind paths have to answer this identically, so they share one
// implementation instead of two hand-inverted copies of the same
// predicate chain.
bool IsNamedParameterMap(Napi::Value source);
// One key of a named-parameter object, classified.
//
// A key that reads as an integer selects a bind position directly
// ({ 1: 'a' }); anything else is a parameter name ({ $a: 'x' }).
struct NamedKey {
bool positional = false;
int index = 0;
// NUL-terminated, owned by the `storage` passed to ResolveNamedKey.
const char* name = nullptr;
};
// Classifies one key from a named-parameter object, for both the sync and
// the async bind paths — they must agree on every key, so they share this.
//
// The obvious implementation coerces the key with ToNumber and compares
// Int32Value() against DoubleValue(). That is a real JS number coercion
// per parameter per call, and it was among the largest costs of a named
// bind — spent almost entirely on keys like "$a" that cannot possibly be
// numeric.
//
// So the string is read once into a stack buffer, and a key whose first
// byte cannot begin a numeric literal skips the coercion: for those,
// ToNumber is necessarily NaN, NaN != NaN, and the slow path would have
// reached the same "this is a name" verdict. Every key that *could* read
// as a number — digits, signs, a dot, leading whitespace, the empty
// string — still goes through ToNumber, so behaviour is unchanged
// including for the odd spellings ("0x10", " 1", "1.0").
//
// `storage` is reused across the keys of one call, so a short name
// (every real one) costs no allocation at all.
//
// Returns false with a pending exception if the key cannot be read.
bool ResolveNamedKey(Napi::Env env, Napi::Value key, NamedKey* out,
std::string* storage);
}
#endif
@@ -0,0 +1,8 @@
import type { NodeWithParent, TSESTree } from '@typescript-eslint/types';
import { DefinitionBase } from './DefinitionBase';
import { DefinitionType } from './DefinitionType';
export declare class ImplicitGlobalVariableDefinition extends DefinitionBase<DefinitionType.ImplicitGlobalVariable, NodeWithParent, null, TSESTree.BindingName> {
readonly isTypeDefinition = false;
readonly isVariableDefinition = true;
constructor(name: TSESTree.BindingName, node: ImplicitGlobalVariableDefinition['node']);
}
@@ -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 PhilippinePeso = createLucideIcon("PhilippinePeso", [
["path", { d: "M20 11H4", key: "6ut86h" }],
["path", { d: "M20 7H4", key: "zbl0bi" }],
["path", { d: "M7 21V4a1 1 0 0 1 1-1h4a1 1 0 0 1 0 12H7", key: "1ana5r" }]
]);
export { PhilippinePeso as default };
//# sourceMappingURL=philippine-peso.js.map
@@ -0,0 +1,30 @@
import { LocationRewrite } from './router.cjs';
/** Compose multiple rewrite pairs into a single in/out rewrite. */
/** Compose multiple rewrite pairs into a single in/out rewrite. */
export declare function composeRewrites(rewrites: Array<LocationRewrite>): {
input: ({ url }: {
url: URL;
}) => URL;
output: ({ url }: {
url: URL;
}) => URL;
};
/** Create a rewrite pair that strips/adds a basepath on input/output. */
/** Create a rewrite pair that strips/adds a basepath on input/output. */
export declare function rewriteBasepath(opts: {
basepath: string;
caseSensitive?: boolean;
}): {
input: ({ url }: {
url: URL;
}) => URL;
output: ({ url }: {
url: URL;
}) => URL;
};
/** Execute a location input rewrite if provided. */
/** Execute a location input rewrite if provided. */
export declare function executeRewriteInput(rewrite: LocationRewrite | undefined, url: URL): URL;
/** Execute a location output rewrite if provided. */
/** Execute a location output rewrite if provided. */
export declare function executeRewriteOutput(rewrite: LocationRewrite | undefined, url: URL): URL;
@@ -0,0 +1,159 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _flow = require('../plugins/flow');
var _typescript = require('../plugins/typescript');
var _index = require('../tokenizer/index');
var _keywords = require('../tokenizer/keywords');
var _types = require('../tokenizer/types');
var _base = require('./base');
var _expression = require('./expression');
var _util = require('./util');
function parseSpread() {
_index.next.call(void 0, );
_expression.parseMaybeAssign.call(void 0, false);
} exports.parseSpread = parseSpread;
function parseRest(isBlockScope) {
_index.next.call(void 0, );
parseBindingAtom(isBlockScope);
} exports.parseRest = parseRest;
function parseBindingIdentifier(isBlockScope) {
_expression.parseIdentifier.call(void 0, );
markPriorBindingIdentifier(isBlockScope);
} exports.parseBindingIdentifier = parseBindingIdentifier;
function parseImportedIdentifier() {
_expression.parseIdentifier.call(void 0, );
_base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration;
} exports.parseImportedIdentifier = parseImportedIdentifier;
function markPriorBindingIdentifier(isBlockScope) {
let identifierRole;
if (_base.state.scopeDepth === 0) {
identifierRole = _index.IdentifierRole.TopLevelDeclaration;
} else if (isBlockScope) {
identifierRole = _index.IdentifierRole.BlockScopedDeclaration;
} else {
identifierRole = _index.IdentifierRole.FunctionScopedDeclaration;
}
_base.state.tokens[_base.state.tokens.length - 1].identifierRole = identifierRole;
} exports.markPriorBindingIdentifier = markPriorBindingIdentifier;
// Parses lvalue (assignable) atom.
function parseBindingAtom(isBlockScope) {
switch (_base.state.type) {
case _types.TokenType._this: {
// In TypeScript, "this" may be the name of a parameter, so allow it.
const oldIsType = _index.pushTypeContext.call(void 0, 0);
_index.next.call(void 0, );
_index.popTypeContext.call(void 0, oldIsType);
return;
}
case _types.TokenType._yield:
case _types.TokenType.name: {
_base.state.type = _types.TokenType.name;
parseBindingIdentifier(isBlockScope);
return;
}
case _types.TokenType.bracketL: {
_index.next.call(void 0, );
parseBindingList(_types.TokenType.bracketR, isBlockScope, true /* allowEmpty */);
return;
}
case _types.TokenType.braceL:
_expression.parseObj.call(void 0, true, isBlockScope);
return;
default:
_util.unexpected.call(void 0, );
}
} exports.parseBindingAtom = parseBindingAtom;
function parseBindingList(
close,
isBlockScope,
allowEmpty = false,
allowModifiers = false,
contextId = 0,
) {
let first = true;
let hasRemovedComma = false;
const firstItemTokenIndex = _base.state.tokens.length;
while (!_index.eat.call(void 0, close) && !_base.state.error) {
if (first) {
first = false;
} else {
_util.expect.call(void 0, _types.TokenType.comma);
_base.state.tokens[_base.state.tokens.length - 1].contextId = contextId;
// After a "this" type in TypeScript, we need to set the following comma (if any) to also be
// a type token so that it will be removed.
if (!hasRemovedComma && _base.state.tokens[firstItemTokenIndex].isType) {
_base.state.tokens[_base.state.tokens.length - 1].isType = true;
hasRemovedComma = true;
}
}
if (allowEmpty && _index.match.call(void 0, _types.TokenType.comma)) {
// Empty item; nothing further to parse for this item.
} else if (_index.eat.call(void 0, close)) {
break;
} else if (_index.match.call(void 0, _types.TokenType.ellipsis)) {
parseRest(isBlockScope);
parseAssignableListItemTypes();
// Support rest element trailing commas allowed by TypeScript <2.9.
_index.eat.call(void 0, _types.TokenType.comma);
_util.expect.call(void 0, close);
break;
} else {
parseAssignableListItem(allowModifiers, isBlockScope);
}
}
} exports.parseBindingList = parseBindingList;
function parseAssignableListItem(allowModifiers, isBlockScope) {
if (allowModifiers) {
_typescript.tsParseModifiers.call(void 0, [
_keywords.ContextualKeyword._public,
_keywords.ContextualKeyword._protected,
_keywords.ContextualKeyword._private,
_keywords.ContextualKeyword._readonly,
_keywords.ContextualKeyword._override,
]);
}
parseMaybeDefault(isBlockScope);
parseAssignableListItemTypes();
parseMaybeDefault(isBlockScope, true /* leftAlreadyParsed */);
}
function parseAssignableListItemTypes() {
if (_base.isFlowEnabled) {
_flow.flowParseAssignableListItemTypes.call(void 0, );
} else if (_base.isTypeScriptEnabled) {
_typescript.tsParseAssignableListItemTypes.call(void 0, );
}
}
// Parses assignment pattern around given atom if possible.
function parseMaybeDefault(isBlockScope, leftAlreadyParsed = false) {
if (!leftAlreadyParsed) {
parseBindingAtom(isBlockScope);
}
if (!_index.eat.call(void 0, _types.TokenType.eq)) {
return;
}
const eqIndex = _base.state.tokens.length - 1;
_expression.parseMaybeAssign.call(void 0, );
_base.state.tokens[eqIndex].rhsEndIndex = _base.state.tokens.length;
} exports.parseMaybeDefault = parseMaybeDefault;
@@ -0,0 +1,3 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_validator_validator = require("./validator.js");
exports.validator = require_validator_validator.validator;
@@ -0,0 +1,21 @@
import { ILogger, LogEvent } from 'base-log-factory';
import { ColorfulAppender } from 'blf-colorful-appender';
import { default as createDebug } from 'debug';
/**
* Console appender (控制台输出)
*/
export declare class DebugAppender extends ColorfulAppender {
name: string;
dateFormat: string;
debug: createDebug.Debugger;
setup({ name }: ILogger): void;
/**
* Write log (写入日志)
* @param event Log event (日志事件)
*/
write(event: LogEvent): void;
/**
* Close appender (关闭输出)
*/
close(): Promise<void>;
}
@@ -0,0 +1,9 @@
/**
* Removes options that prompt the parser to parse the project with type
* information. In other words, you can use this if you are invoking the parser
* directly, to ensure that one file will be parsed in isolation, which is much,
* much faster.
*
* @see https://github.com/typescript-eslint/typescript-eslint/issues/8428
*/
export declare function withoutProjectParserOptions<Options extends object>(opts: Options): Omit<Options, 'EXPERIMENTAL_useProjectService' | 'project' | 'projectService'>;
@@ -0,0 +1,44 @@
import { DehydratedMatch } from './types.js';
import { AnyRouter } from '../router.js';
import { AnyRouteMatch } from '../Matches.js';
import { Manifest, RouterManagedTag } from '../manifest.js';
declare module '../router' {
interface ServerSsr {
setRenderFinished: () => void;
cleanup: () => void;
}
interface RouterEvents {
onInjectedHtml: {
type: 'onInjectedHtml';
};
onSerializationFinished: {
type: 'onSerializationFinished';
};
}
}
export declare function dehydrateMatch(match: AnyRouteMatch): DehydratedMatch;
export declare function attachRouterServerSsrUtils({ router, manifest, getRequestAssets, includeUnmatchedRouteAssets, }: {
router: AnyRouter;
manifest: Manifest | undefined;
getRequestAssets?: () => Array<RouterManagedTag> | undefined;
includeUnmatchedRouteAssets?: boolean;
}): void;
/**
* Get the origin for the request.
*
* SECURITY: We intentionally do NOT trust the Origin header for determining
* the router's origin. The Origin header can be spoofed by attackers, which
* could lead to SSRF-like vulnerabilities where redirects are constructed
* using a malicious origin (CVE-2024-34351).
*
* Instead, we derive the origin from request.url, which is typically set by
* the server infrastructure (not client-controlled headers).
*
* For applications behind proxies that need to trust forwarded headers,
* use the router's `origin` option to explicitly configure a trusted origin.
*/
export declare function getOrigin(request: Request): string;
export declare function getNormalizedURL(url: string | URL, base?: string | URL): {
url: URL;
handledProtocolRelativeURL: boolean;
};
@@ -0,0 +1,84 @@
#!/usr/bin/env node
"use strict";
var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = function(cb, mod) {
return function __require() {
try {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
} catch (e) {
throw mod = 0, e;
}
};
};
// node_modules/semver-compare/index.js
var require_semver_compare = __commonJS({
"node_modules/semver-compare/index.js": function(exports2, module2) {
module2.exports = function cmp(a, b) {
var pa = a.split(".");
var pb = b.split(".");
for (var i = 0; i < 3; i++) {
var na = Number(pa[i]);
var nb = Number(pb[i]);
if (na > nb) return 1;
if (nb > na) return -1;
if (!isNaN(na) && isNaN(nb)) return 1;
if (isNaN(na) && !isNaN(nb)) return -1;
}
return 0;
};
}
});
// node_modules/please-upgrade-node/index.js
var require_please_upgrade_node = __commonJS({
"node_modules/please-upgrade-node/index.js": function(exports2, module2) {
var semverCompare = require_semver_compare();
module2.exports = function pleaseUpgradeNode2(pkg, opts) {
var opts = opts || {};
var requiredVersion = pkg.engines.node.replace(">=", "");
var currentVersion = process.version.replace("v", "");
if (semverCompare(currentVersion, requiredVersion) === -1) {
if (opts.message) {
console.error(opts.message(requiredVersion));
} else {
console.error(
pkg.name + " requires at least version " + requiredVersion + " of Node, please upgrade"
);
}
if (opts.hasOwnProperty("exitCode")) {
process.exit(opts.exitCode);
} else {
process.exit(1);
}
}
};
}
});
// bin/prettier.cjs
var nodeModule = require("module");
if (typeof nodeModule.enableCompileCache === "function") {
nodeModule.enableCompileCache();
}
var pleaseUpgradeNode = require_please_upgrade_node();
var packageJson = require("../package.json");
pleaseUpgradeNode(packageJson);
var dynamicImport = new Function("module", "return import(module)");
var promise;
var index = process.argv.indexOf("--experimental-cli");
if (process.env.PRETTIER_EXPERIMENTAL_CLI || index !== -1) {
if (index !== -1) {
process.argv.splice(index, 1);
}
promise = dynamicImport("../internal/experimental-cli.mjs").then(
function(cli) {
return cli.__promise;
}
);
} else {
promise = dynamicImport("../internal/legacy-cli.mjs").then(function runCli(cli) {
return cli.run();
});
}
module.exports.__promise = promise;
@@ -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 Braces = createLucideIcon("Braces", [
[
"path",
{ d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
],
[
"path",
{
d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",
key: "e1hn23"
}
]
]);
export { Braces as default };
//# sourceMappingURL=braces.js.map
@@ -0,0 +1,8 @@
import { M as MS_IN_DAY } from "./constants-BuFquuHl.mjs";
import addMilliseconds from "./addMilliseconds.mjs";
function addDays(date, days) {
return addMilliseconds(date, days * MS_IN_DAY);
}
export {
addDays as default
};
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
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,10 @@
import { velocityPerSecond } from 'motion-utils';
const velocitySampleDuration = 5; // ms
function getGeneratorVelocity(resolveValue, t, current) {
const prevT = Math.max(t - velocitySampleDuration, 0);
return velocityPerSecond(current - resolveValue(prevT), t - prevT);
}
export { getGeneratorVelocity };
//# sourceMappingURL=velocity.mjs.map
@@ -0,0 +1,17 @@
'use strict';
var regexMatcher = (options, match) => {
if (match.regexName === 'recentYear') {
return {
warning: options.translations.warnings.recentYears,
suggestions: [options.translations.suggestions.recentYears, options.translations.suggestions.associatedYears]
};
}
return {
warning: null,
suggestions: []
};
};
module.exports = regexMatcher;
//# sourceMappingURL=feedback.cjs.map
@@ -0,0 +1 @@
{"version":3,"file":"flag-triangle-left.js","sources":["../../../src/icons/flag-triangle-left.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FlagTriangleLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgMjJWMkw3IDdsMTAgNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/flag-triangle-left\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 FlagTriangleLeft = createLucideIcon('FlagTriangleLeft', [\n ['path', { d: 'M17 22V2L7 7l10 5', key: '1rmf0r' }],\n]);\n\nexport default FlagTriangleLeft;\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,CAAqB,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;AACpD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"single-color-regex.mjs","sources":["../../../../../src/value/types/utils/single-color-regex.ts"],"sourcesContent":["export const singleColorRegex =\n /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu\n"],"names":[],"mappings":"AAAO,MAAM,gBAAgB,GACzB;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"circle-fading-plus.js","sources":["../../../src/icons/circle-fading-plus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleFadingPlus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMmExMCAxMCAwIDAgMSA3LjM4IDE2Ljc1IiAvPgogIDxwYXRoIGQ9Ik0xMiA4djgiIC8+CiAgPHBhdGggZD0iTTE2IDEySDgiIC8+CiAgPHBhdGggZD0iTTIuNSA4Ljg3NWExMCAxMCAwIDAgMC0uNSAzIiAvPgogIDxwYXRoIGQ9Ik0yLjgzIDE2YTEwIDEwIDAgMCAwIDIuNDMgMy40IiAvPgogIDxwYXRoIGQ9Ik00LjYzNiA1LjIzNWExMCAxMCAwIDAgMSAuODkxLS44NTciIC8+CiAgPHBhdGggZD0iTTguNjQ0IDIxLjQyYTEwIDEwIDAgMCAwIDcuNjMxLS4zOCIgLz4KPC9zdmc+) - https://lucide.dev/icons/circle-fading-plus\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 CircleFadingPlus = createLucideIcon('CircleFadingPlus', [\n ['path', { d: 'M12 2a10 10 0 0 1 7.38 16.75', key: '175t95' }],\n ['path', { d: 'M12 8v8', key: 'napkw2' }],\n ['path', { d: 'M16 12H8', key: '1fr5h0' }],\n ['path', { d: 'M2.5 8.875a10 10 0 0 0-.5 3', key: '1vce0s' }],\n ['path', { d: 'M2.83 16a10 10 0 0 0 2.43 3.4', key: 'o3fkw4' }],\n ['path', { d: 'M4.636 5.235a10 10 0 0 1 .891-.857', key: '1szpfk' }],\n ['path', { d: 'M8.644 21.42a10 10 0 0 0 7.631-.38', key: '9yhvd4' }],\n]);\n\nexport default CircleFadingPlus;\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,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACnE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACrE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
module.exports={C:{"115":0.3991,"120":1.2645,"121":2.48699,"123":0.0084,"124":0.03361,"127":0.07562,"129":0.0084,"132":0.0084,"135":0.02521,"140":0.0126,"142":0.0126,"147":0.0042,"149":0.0042,"150":0.0042,"152":0.20165,"154":0.48732,"155":0.46211,"156":0.65536,"157":0.03361,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 125 126 128 130 131 133 134 136 137 138 139 141 143 144 145 146 148 151 153 158 159 160 3.5 3.6"},D:{"57":0.05881,"62":0.0042,"64":0.0126,"69":0.0042,"76":0.0042,"80":0.04621,"83":0.0084,"87":0.0042,"92":0.0126,"93":0.0042,"99":0.0042,"101":0.02941,"103":0.10503,"104":0.07562,"105":0.08402,"106":0.08822,"107":0.09662,"108":0.08822,"109":0.25626,"110":0.09242,"111":0.09242,"112":0.07142,"114":0.0042,"116":0.20165,"117":0.10082,"118":1.91146,"119":2.508,"120":2.55001,"121":0.0084,"122":0.02101,"123":0.02521,"124":0.10082,"126":0.03781,"127":0.0168,"128":0.02941,"131":0.20585,"132":0.0168,"133":0.21845,"134":0.06722,"135":0.05461,"136":0.07142,"137":0.09242,"138":0.15964,"139":0.07562,"140":0.06302,"141":0.08822,"142":0.22685,"143":0.0042,"144":0.03361,"145":0.13863,"146":0.18484,"147":0.0084,"148":0.06722,"149":0.08822,"150":0.44111,"151":1.82323,"152":5.35628,"153":4.83535,"154":0.86121,"155":0.05041,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 58 59 60 61 63 65 66 67 68 70 71 72 73 74 75 77 78 79 81 84 85 86 88 89 90 91 94 95 96 97 98 100 102 113 115 125 129 130 156 157"},F:{"40":0.0084,"66":0.0084,"74":0.0084,"95":0.0042,"101":0.04621,"105":0.0168,"107":0.0084,"113":0.0084,"114":0.0126,"120":0.0084,"121":0.0084,"131":0.0084,"133":0.0042,"134":0.11343,"135":0.32348,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 67 68 69 70 71 72 73 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 102 103 104 106 108 109 110 111 112 115 116 117 118 119 122 123 124 125 126 127 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.0084,"109":0.0126,"114":0.0042,"119":1.2729,"120":1.15948,"121":0.0042,"122":0.0084,"124":0.0084,"136":0.0042,"137":0.0042,"138":0.0042,"139":0.0042,"144":0.0042,"145":0.0084,"146":0.0042,"147":0.0126,"148":0.0084,"149":0.0042,"150":0.02101,"151":0.22685,"152":1.50396,"153":1.78122,"154":0.51672,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 123 125 126 127 128 129 130 131 132 133 134 135 140 141 142 143"},E:{"27":0.09242,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 14.1 15.1 15.2-15.3 15.4 15.5 16.1 16.3 16.4 17.0 17.2 17.3 17.4 17.5 18.0 18.1 18.2 18.4 18.5-18.7 26.0 26.1 27.1 TP","13.1":0.08822,"15.6":0.0126,"16.0":0.11343,"16.2":0.0084,"16.5":0.0042,"16.6":0.0126,"17.1":0.0084,"17.6":0.02941,"18.3":0.0042,"26.2":0.0042,"26.3":0.0042,"26.4":0.0042,"26.5":0.05881,"26.6":0.76038,"27.2":0.02941},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00092,"5.0-5.1":0.00092,"6.0-6.1":0,"7.0-7.1":0.00183,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00916,"11.0-11.2":0.00092,"11.3-11.4":0.00183,"12.0-12.1":0,"12.2-12.5":0.02381,"13.0-13.1":0,"13.2":0.00458,"13.3":0,"13.4-13.7":0.00092,"14.0-14.4":0.00366,"14.5-14.8":0.00549,"15.0-15.1":0.00549,"15.2-15.3":0.00366,"15.4":0.00458,"15.5":0.00549,"15.6-15.8":0.11904,"16.0":0.00916,"16.1":0.01648,"16.2":0.00916,"16.3":0.02014,"16.4":0.00458,"16.5":0.00733,"16.6-16.7":0.16573,"17.0":0.00641,"17.1":0.00916,"17.2":0.00916,"17.3":0.01373,"17.4":0.01923,"17.5":0.03754,"17.6-17.7":0.09706,"18.0":0.02014,"18.1":0.04029,"18.2":0.05494,"18.3":0.09523,"18.4":0.05952,"18.5-18.7":1.22973,"26.0":0.05952,"26.1":0.06043,"26.2":0.15749,"26.3":0.17031,"26.4":0.12453,"26.5":0.83417,"26.6":5.14694,"27.0":0.39465,"27.1":0,"27.2":0.01007},P:{"4":0.00916,"21":0.00916,"22":0.00916,"24":0.01832,"26":0.07328,"27":0.07328,"28":0.07328,"29":0.32976,"30":3.05032,_:"20 23 25 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.03664},I:{"0":0.00579,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.29575,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":45.14024},R:{_:"0"},M:{"0":0.20297},Q:{_:"14.9"},O:{"0":0.25516},H:{all:0}};
@@ -0,0 +1,104 @@
import type { Token } from "../parser/tokenizer";
import type TokenProcessor from "../TokenProcessor";
import type RootTransformer from "./RootTransformer";
import Transformer from "./Transformer";
export default class TypeScriptTransformer extends Transformer {
readonly rootTransformer: RootTransformer;
readonly tokens: TokenProcessor;
readonly isImportsTransformEnabled: boolean;
constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, isImportsTransformEnabled: boolean);
process(): boolean;
processEnum(isExport?: boolean): void;
/**
* Transform an enum into equivalent JS. This has complexity in a few places:
* - TS allows string enums, numeric enums, and a mix of the two styles within an enum.
* - Enum keys are allowed to be referenced in later enum values.
* - Enum keys are allowed to be strings.
* - When enum values are omitted, they should follow an auto-increment behavior.
*/
processEnumBody(enumName: string): void;
/**
* Detect name information about this enum key, which will be used to determine which code to emit
* and whether we should declare a variable as part of this declaration.
*
* Some cases to keep in mind:
* - Enum keys can be implicitly referenced later, e.g. `X = 1, Y = X`. In Sucrase, we implement
* this by declaring a variable `X` so that later expressions can use it.
* - In addition to the usual identifier key syntax, enum keys are allowed to be string literals,
* e.g. `"hello world" = 3,`. Template literal syntax is NOT allowed.
* - Even if the enum key is defined as a string literal, it may still be referenced by identifier
* later, e.g. `"X" = 1, Y = X`. That means that we need to detect whether or not a string
* literal is identifier-like and emit a variable if so, even if the declaration did not use an
* identifier.
* - Reserved keywords like `break` are valid enum keys, but are not valid to be referenced later
* and would be a syntax error if we emitted a variable, so we need to skip the variable
* declaration in those cases.
*
* The variableName return value captures these nuances: if non-null, we can and must emit a
* variable declaration, and if null, we can't and shouldn't.
*/
extractEnumKeyInfo(nameToken: Token): {
nameStringCode: string;
variableName: string | null;
};
/**
* Handle an enum member where the RHS is just a string literal (not omitted, not a number, and
* not a complex expression). This is the typical form for TS string enums, and in this case, we
* do *not* create a reverse mapping.
*
* This is called after deleting the key token, when the token processor is at the equals sign.
*
* Example 1:
* someKey = "some value"
* ->
* const someKey = "some value"; MyEnum["someKey"] = someKey;
*
* Example 2:
* "some key" = "some value"
* ->
* MyEnum["some key"] = "some value";
*/
processStringLiteralEnumMember(enumName: string, nameStringCode: string, variableName: string | null): void;
/**
* Handle an enum member initialized with an expression on the right-hand side (other than a
* string literal). In these cases, we should transform the expression and emit code that sets up
* a reverse mapping.
*
* The TypeScript implementation of this operation distinguishes between expressions that can be
* "constant folded" at compile time (i.e. consist of number literals and simple math operations
* on those numbers) and ones that are dynamic. For constant expressions, it emits the resolved
* numeric value, and auto-incrementing is only allowed in that case. Evaluating expressions at
* compile time would add significant complexity to Sucrase, so Sucrase instead leaves the
* expression as-is, and will later emit something like `MyEnum["previousKey"] + 1` to implement
* auto-incrementing.
*
* This is called after deleting the key token, when the token processor is at the equals sign.
*
* Example 1:
* someKey = 1 + 1
* ->
* const someKey = 1 + 1; MyEnum[MyEnum["someKey"] = someKey] = "someKey";
*
* Example 2:
* "some key" = 1 + 1
* ->
* MyEnum[MyEnum["some key"] = 1 + 1] = "some key";
*/
processExplicitValueEnumMember(enumName: string, nameStringCode: string, variableName: string | null): void;
/**
* Handle an enum member with no right-hand side expression. In this case, the value is the
* previous value plus 1, or 0 if there was no previous value. We should also always emit a
* reverse mapping.
*
* Example 1:
* someKey2
* ->
* const someKey2 = someKey1 + 1; MyEnum[MyEnum["someKey2"] = someKey2] = "someKey2";
*
* Example 2:
* "some key 2"
* ->
* MyEnum[MyEnum["some key 2"] = someKey1 + 1] = "some key 2";
*/
processImplicitValueEnumMember(enumName: string, nameStringCode: string, variableName: string | null, previousValueCode: string | null): void;
}
@@ -0,0 +1 @@
{"version":3,"file":"handshake.js","sources":["../../../src/icons/handshake.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Handshake\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTEgMTcgMiAyYTEgMSAwIDEgMCAzLTMiIC8+CiAgPHBhdGggZD0ibTE0IDE0IDIuNSAyLjVhMSAxIDAgMSAwIDMtM2wtMy44OC0zLjg4YTMgMyAwIDAgMC00LjI0IDBsLS44OC44OGExIDEgMCAxIDEtMy0zbDIuODEtMi44MWE1Ljc5IDUuNzkgMCAwIDEgNy4wNi0uODdsLjQ3LjI4YTIgMiAwIDAgMCAxLjQyLjI1TDIxIDQiIC8+CiAgPHBhdGggZD0ibTIxIDMgMSAxMWgtMiIgLz4KICA8cGF0aCBkPSJNMyAzIDIgMTRsNi41IDYuNWExIDEgMCAxIDAgMy0zIiAvPgogIDxwYXRoIGQ9Ik0zIDRoOCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/handshake\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 Handshake = createLucideIcon('Handshake', [\n ['path', { d: 'm11 17 2 2a1 1 0 1 0 3-3', key: 'efffak' }],\n [\n 'path',\n {\n d: 'm14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4',\n key: '9pr0kb',\n },\n ],\n ['path', { d: 'm21 3 1 11h-2', key: '1tisrp' }],\n ['path', { d: 'M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3', key: '1uvwmv' }],\n ['path', { d: 'M3 4h8', key: '1ep09j' }],\n]);\n\nexport default Handshake;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACzC,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,66 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = traverseForScope;
var _t = require("@babel/types");
var _index = require("../index.js");
var _visitors = require("../visitors.js");
var _context = require("../path/context.js");
const {
VISITOR_KEYS
} = _t;
function traverseForScope(path, visitors, state) {
const exploded = (0, _visitors.explode)(visitors);
if (exploded.enter || exploded.exit) {
throw new Error("Should not be used with enter/exit visitors.");
}
_traverse(path.parentPath, path.parent, path.node, path.container, path.key, path.listKey, path.hub, path);
function _traverse(parentPath, parent, node, container, key, listKey, hub, inPath) {
if (!node) {
return;
}
const path = inPath || _index.NodePath.get({
hub,
parentPath,
parent,
container,
listKey,
key
});
_context._forceSetScope.call(path);
const visitor = exploded[node.type];
if (visitor != null && visitor.enter) {
for (const visit of visitor.enter) {
visit.call(state, path, state);
}
}
if (path.shouldSkip) {
return;
}
const keys = VISITOR_KEYS[node.type];
if (!(keys != null && keys.length)) {
return;
}
for (const key of keys) {
const prop = node[key];
if (!prop) continue;
if (Array.isArray(prop)) {
for (let i = 0; i < prop.length; i++) {
const value = prop[i];
_traverse(path, node, value, prop, i, key);
}
} else {
_traverse(path, node, prop, node, key, null);
}
}
if (visitor != null && visitor.exit) {
for (const visit of visitor.exit) {
visit.call(state, path, state);
}
}
}
}
//# sourceMappingURL=traverseForScope.js.map
@@ -0,0 +1,20 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const List = createLucideIcon("List", [
["path", { d: "M3 12h.01", key: "nlz23k" }],
["path", { d: "M3 18h.01", key: "1tta3j" }],
["path", { d: "M3 6h.01", key: "1rqtza" }],
["path", { d: "M8 12h13", key: "1za7za" }],
["path", { d: "M8 18h13", key: "1lx6n3" }],
["path", { d: "M8 6h13", key: "ik3vkj" }]
]);
export { List as default };
//# sourceMappingURL=list.js.map
@@ -0,0 +1,302 @@
import { AnyResolvedKeyframe, UnresolvedValueKeyframe, AnimationOptions, MotionValue, Transition, ElementOrSelector, DOMKeyframesDefinition, AnimationPlaybackOptions, AnimationPlaybackControlsWithThen, ValueAnimationTransition, AnimationScope, AnimationPlaybackControls } from 'motion-dom';
export * from 'motion-dom';
export { DelayedFunction, delayInSeconds as delay } from 'motion-dom';
import { Easing, EasingFunction, Point } from 'motion-utils';
export * from 'motion-utils';
/**
* Lifecycle callbacks are not supported on individual sequence segments
* because segments are consolidated into a single animation per subject.
* Use sequence-level options (e.g. SequenceOptions.onComplete) instead.
*/
type LifecycleCallbacks = "onUpdate" | "onPlay" | "onComplete" | "onRepeat" | "onStop";
/**
* Distributive Omit preserves union branches (unlike plain Omit).
*/
type DistributiveOmit<T, K extends string> = T extends any ? Omit<T, K> : never;
type SegmentTransitionOptions = DistributiveOmit<AnimationOptions, LifecycleCallbacks> & At;
type SegmentValueTransitionOptions = DistributiveOmit<Transition, LifecycleCallbacks> & At;
type ObjectTarget<O> = {
[K in keyof O]?: O[K] | UnresolvedValueKeyframe[];
};
type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`;
type SequenceLabel = string;
interface SequenceLabelWithTime {
name: SequenceLabel;
at: SequenceTime;
}
interface At {
at?: SequenceTime;
}
type MotionValueSegment = [
MotionValue,
UnresolvedValueKeyframe | UnresolvedValueKeyframe[]
];
type MotionValueSegmentWithTransition = [
MotionValue,
UnresolvedValueKeyframe | UnresolvedValueKeyframe[],
SegmentValueTransitionOptions
];
type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition];
type DOMSegmentWithTransition = [
ElementOrSelector,
DOMKeyframesDefinition,
SegmentTransitionOptions
];
type ObjectSegment<O extends {} = {}> = [O, ObjectTarget<O>];
type ObjectSegmentWithTransition<O extends {} = {}> = [
O,
ObjectTarget<O>,
SegmentTransitionOptions
];
type SequenceProgressCallback = (value: any) => void;
type FunctionSegment = [SequenceProgressCallback] | [SequenceProgressCallback, SegmentTransitionOptions] | [
SequenceProgressCallback,
UnresolvedValueKeyframe | UnresolvedValueKeyframe[],
SegmentTransitionOptions
];
type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition | FunctionSegment;
type AnimationSequence = Segment[];
interface SequenceOptions extends AnimationPlaybackOptions {
delay?: number;
duration?: number;
defaultTransition?: Transition;
reduceMotion?: boolean;
onComplete?: () => void;
}
interface AbsoluteKeyframe {
value: AnyResolvedKeyframe | null;
at: number;
easing?: Easing;
}
type ValueSequence = AbsoluteKeyframe[];
interface SequenceMap {
[key: string]: ValueSequence;
}
type ResolvedAnimationDefinition = {
keyframes: {
[key: string]: UnresolvedValueKeyframe[];
};
transition: {
[key: string]: Transition;
};
};
type ResolvedAnimationDefinitions = Map<Element | MotionValue, ResolvedAnimationDefinition>;
interface ScopedAnimateOptions {
scope?: AnimationScope;
reduceMotion?: boolean;
}
/**
* Creates an animation function that is optionally scoped
* to a specific element.
*/
declare function createScopedAnimate(options?: ScopedAnimateOptions): {
(sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen;
(value: string | MotionValue<string>, keyframes: string | UnresolvedValueKeyframe<string>[], options?: ValueAnimationTransition<string>): AnimationPlaybackControlsWithThen;
(value: number | MotionValue<number>, keyframes: number | UnresolvedValueKeyframe<number>[], options?: ValueAnimationTransition<number>): AnimationPlaybackControlsWithThen;
<V extends string | number>(value: V | MotionValue<V>, keyframes: V | UnresolvedValueKeyframe<V>[], options?: ValueAnimationTransition<V>): AnimationPlaybackControlsWithThen;
(element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen;
<O extends {}>(object: O | O[], keyframes: ObjectTarget<O>, options?: AnimationOptions): AnimationPlaybackControlsWithThen;
};
declare const animate: {
(sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen;
(value: string | MotionValue<string>, keyframes: string | UnresolvedValueKeyframe<string>[], options?: ValueAnimationTransition<string>): AnimationPlaybackControlsWithThen;
(value: number | MotionValue<number>, keyframes: number | UnresolvedValueKeyframe<number>[], options?: ValueAnimationTransition<number>): AnimationPlaybackControlsWithThen;
<V extends string | number>(value: V | MotionValue<V>, keyframes: V | UnresolvedValueKeyframe<V>[], options?: ValueAnimationTransition<V>): AnimationPlaybackControlsWithThen;
(element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen;
<O extends {}>(object: O | O[], keyframes: ObjectTarget<O>, options?: AnimationOptions): AnimationPlaybackControlsWithThen;
};
declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControlsWithThen;
interface ScrollOptions {
source?: HTMLElement;
container?: Element;
target?: Element;
axis?: "x" | "y";
offset?: ScrollOffset;
}
type OnScrollProgress = (progress: number) => void;
type OnScrollWithInfo = (progress: number, info: ScrollInfo) => void;
type OnScroll = OnScrollProgress | OnScrollWithInfo;
interface AxisScrollInfo {
current: number;
offset: number[];
progress: number;
scrollLength: number;
velocity: number;
targetOffset: number;
targetLength: number;
containerLength: number;
interpolatorOffsets?: number[];
interpolate?: EasingFunction;
}
interface ScrollInfo {
time: number;
x: AxisScrollInfo;
y: AxisScrollInfo;
}
type OnScrollInfo = (info: ScrollInfo) => void;
type SupportedEdgeUnit = "px" | "vw" | "vh" | "%";
type EdgeUnit = `${number}${SupportedEdgeUnit}`;
type NamedEdges = "start" | "end" | "center";
type EdgeString = NamedEdges | EdgeUnit | `${number}`;
type Edge = EdgeString | number;
type ProgressIntersection = [number, number];
type Intersection = `${Edge} ${Edge}`;
type ScrollOffset = Array<Edge | Intersection | ProgressIntersection>;
interface ScrollInfoOptions {
container?: Element;
target?: Element;
axis?: "x" | "y";
offset?: ScrollOffset;
/**
* When true, enables per-frame checking of scrollWidth/scrollHeight
* to detect content size changes and recalculate scroll progress.
*
* @default false
*/
trackContentSize?: boolean;
}
declare function scroll(onScroll: OnScroll | AnimationPlaybackControls, { axis, container, ...options }?: ScrollOptions): VoidFunction;
declare function scrollInfo(onScroll: OnScrollInfo, { container, trackContentSize, ...options }?: ScrollInfoOptions): VoidFunction;
type ViewChangeHandler = (entry: IntersectionObserverEntry) => void;
type MarginValue = `${number}${"px" | "%"}`;
type MarginType = MarginValue | `${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`;
interface InViewOptions {
root?: Element | Document;
margin?: MarginType;
amount?: "some" | "all" | number;
}
declare function inView(elementOrSelector: ElementOrSelector, onStart: (element: Element, entry: IntersectionObserverEntry) => void | ViewChangeHandler, { root, margin: rootMargin, amount }?: InViewOptions): VoidFunction;
interface HTMLElements {
a: HTMLAnchorElement;
abbr: HTMLElement;
address: HTMLElement;
area: HTMLAreaElement;
article: HTMLElement;
aside: HTMLElement;
audio: HTMLAudioElement;
b: HTMLElement;
base: HTMLBaseElement;
bdi: HTMLElement;
bdo: HTMLElement;
big: HTMLElement;
blockquote: HTMLQuoteElement;
body: HTMLBodyElement;
br: HTMLBRElement;
button: HTMLButtonElement;
canvas: HTMLCanvasElement;
caption: HTMLElement;
center: HTMLElement;
cite: HTMLElement;
code: HTMLElement;
col: HTMLTableColElement;
colgroup: HTMLTableColElement;
data: HTMLDataElement;
datalist: HTMLDataListElement;
dd: HTMLElement;
del: HTMLModElement;
details: HTMLDetailsElement;
dfn: HTMLElement;
dialog: HTMLDialogElement;
div: HTMLDivElement;
dl: HTMLDListElement;
dt: HTMLElement;
em: HTMLElement;
embed: HTMLEmbedElement;
fieldset: HTMLFieldSetElement;
figcaption: HTMLElement;
figure: HTMLElement;
footer: HTMLElement;
form: HTMLFormElement;
h1: HTMLHeadingElement;
h2: HTMLHeadingElement;
h3: HTMLHeadingElement;
h4: HTMLHeadingElement;
h5: HTMLHeadingElement;
h6: HTMLHeadingElement;
head: HTMLHeadElement;
header: HTMLElement;
hgroup: HTMLElement;
hr: HTMLHRElement;
html: HTMLHtmlElement;
i: HTMLElement;
iframe: HTMLIFrameElement;
img: HTMLImageElement;
input: HTMLInputElement;
ins: HTMLModElement;
kbd: HTMLElement;
keygen: HTMLElement;
label: HTMLLabelElement;
legend: HTMLLegendElement;
li: HTMLLIElement;
link: HTMLLinkElement;
main: HTMLElement;
map: HTMLMapElement;
mark: HTMLElement;
menu: HTMLElement;
menuitem: HTMLElement;
meta: HTMLMetaElement;
meter: HTMLMeterElement;
nav: HTMLElement;
noindex: HTMLElement;
noscript: HTMLElement;
object: HTMLObjectElement;
ol: HTMLOListElement;
optgroup: HTMLOptGroupElement;
option: HTMLOptionElement;
output: HTMLOutputElement;
p: HTMLParagraphElement;
param: HTMLParamElement;
picture: HTMLElement;
pre: HTMLPreElement;
progress: HTMLProgressElement;
q: HTMLQuoteElement;
rp: HTMLElement;
rt: HTMLElement;
ruby: HTMLElement;
s: HTMLElement;
samp: HTMLElement;
search: HTMLElement;
slot: HTMLSlotElement;
script: HTMLScriptElement;
section: HTMLElement;
select: HTMLSelectElement;
small: HTMLElement;
source: HTMLSourceElement;
span: HTMLSpanElement;
strong: HTMLElement;
style: HTMLStyleElement;
sub: HTMLElement;
summary: HTMLElement;
sup: HTMLElement;
table: HTMLTableElement;
template: HTMLTemplateElement;
tbody: HTMLTableSectionElement;
td: HTMLTableDataCellElement;
textarea: HTMLTextAreaElement;
tfoot: HTMLTableSectionElement;
th: HTMLTableHeaderCellElement;
thead: HTMLTableSectionElement;
time: HTMLTimeElement;
title: HTMLTitleElement;
tr: HTMLTableRowElement;
track: HTMLTrackElement;
u: HTMLElement;
ul: HTMLUListElement;
var: HTMLElement;
video: HTMLVideoElement;
wbr: HTMLElement;
webview: HTMLWebViewElement;
}
declare const distance: (a: number, b: number) => number;
declare function distance2D(a: Point, b: Point): number;
export { type AbsoluteKeyframe, type AnimationSequence, type At, type DOMSegment, type DOMSegmentWithTransition, type FunctionSegment, type HTMLElements, type MotionValueSegment, type MotionValueSegmentWithTransition, type ObjectSegment, type ObjectSegmentWithTransition, type ObjectTarget, type ResolvedAnimationDefinition, type ResolvedAnimationDefinitions, type Segment, type SegmentTransitionOptions, type SegmentValueTransitionOptions, type SequenceLabel, type SequenceLabelWithTime, type SequenceMap, type SequenceOptions, type SequenceProgressCallback, type SequenceTime, type ValueSequence, animate, animateMini, createScopedAnimate, distance, distance2D, inView, scroll, scrollInfo };
@@ -0,0 +1,351 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_compose = require("./compose.js");
const require_utils_url = require("./utils/url.js");
const require_context = require("./context.js");
const require_router = require("./router.js");
const require_utils_constants = require("./utils/constants.js");
//#region src/hono-base.ts
/**
* @module
* This module is the base module for the Hono object.
*/
const notFoundHandler = (c) => {
return c.text("404 Not Found", 404);
};
const errorHandler = (err, c) => {
if ("getResponse" in err) {
const res = err.getResponse();
return c.newResponse(res.body, res);
}
console.error(err);
return c.text("Internal Server Error", 500);
};
var Hono = class Hono {
get;
post;
put;
delete;
options;
patch;
query;
all;
on;
use;
router;
getPath;
_basePath = "/";
#path = "/";
routes = [];
constructor(options = {}) {
[...require_router.METHODS, "all"].forEach((method) => {
this[method] = (args1, ...args) => {
const methodName = method.toUpperCase();
if (typeof args1 === "string") this.#path = args1;
else this.#addRoute(methodName, this.#path, args1);
args.forEach((handler) => {
this.#addRoute(methodName, this.#path, handler);
});
return this;
};
});
this.on = (method, path, ...handlers) => {
for (const p of [path].flat()) {
this.#path = p;
for (const m of [method].flat()) {
const methodName = m.toUpperCase();
for (const handler of handlers) this.#addRoute(methodName, this.#path, handler);
}
}
return this;
};
this.use = (arg1, ...handlers) => {
if (typeof arg1 === "string") this.#path = arg1;
else {
this.#path = "*";
handlers.unshift(arg1);
}
handlers.forEach((handler) => {
this.#addRoute("ALL", this.#path, handler);
});
return this;
};
const { strict, ...optionsWithoutStrict } = options;
Object.assign(this, optionsWithoutStrict);
this.getPath = strict ?? true ? options.getPath ?? require_utils_url.getPath : require_utils_url.getPathNoStrict;
}
#clone() {
const clone = new Hono({
router: this.router,
getPath: this.getPath
});
clone.errorHandler = this.errorHandler;
clone.#notFoundHandler = this.#notFoundHandler;
clone.routes = this.routes;
return clone;
}
#notFoundHandler = notFoundHandler;
errorHandler = errorHandler;
/**
* `.route()` allows grouping other Hono instance in routes.
*
* @see {@link https://hono.dev/docs/api/routing#grouping}
*
* @param {string} path - base Path
* @param {Hono} app - other Hono instance
* @returns {Hono} routed Hono instance
*
* @example
* ```ts
* const app = new Hono()
* const app2 = new Hono()
*
* app2.get("/user", (c) => c.text("user"))
* app.route("/api", app2) // GET /api/user
* ```
*/
route(path, app) {
const subApp = this.basePath(path);
app.routes.map((r) => {
let handler;
if (app.errorHandler === errorHandler) handler = r.handler;
else {
handler = async (c, next) => (await require_compose.compose([], app.errorHandler)(c, () => r.handler(c, next))).res;
handler[require_utils_constants.COMPOSED_HANDLER] = r.handler;
}
subApp.#addRoute(r.method, r.path, handler, r.basePath);
});
return this;
}
/**
* `.basePath()` allows base paths to be specified.
*
* @see {@link https://hono.dev/docs/api/routing#base-path}
*
* @param {string} path - base Path
* @returns {Hono} changed Hono instance
*
* @example
* ```ts
* const api = new Hono().basePath('/api')
* ```
*/
basePath(path) {
const subApp = this.#clone();
subApp._basePath = require_utils_url.mergePath(this._basePath, path);
return subApp;
}
/**
* `.onError()` handles an error and returns a customized Response.
*
* @see {@link https://hono.dev/docs/api/hono#error-handling}
*
* @param {ErrorHandler} handler - request Handler for error
* @returns {Hono} changed Hono instance
*
* @example
* ```ts
* app.onError((err, c) => {
* console.error(`${err}`)
* return c.text('Custom Error Message', 500)
* })
* ```
*/
onError = (handler) => {
this.errorHandler = handler;
return this;
};
/**
* `.notFound()` allows you to customize a Not Found Response.
*
* @see {@link https://hono.dev/docs/api/hono#not-found}
*
* @param {NotFoundHandler} handler - request handler for not-found
* @returns {Hono} changed Hono instance
*
* @example
* ```ts
* app.notFound((c) => {
* return c.text('Custom 404 Message', 404)
* })
* ```
*/
notFound = (handler) => {
this.#notFoundHandler = handler;
return this;
};
/**
* `.mount()` allows you to mount applications built with other frameworks into your Hono application.
*
* @deprecated Use `mount()` from `hono/mount` instead. `.mount()` will be removed in v5.
*
* @see {@link https://hono.dev/docs/api/hono#mount}
*
* @param {string} path - base Path
* @param {Function} applicationHandler - other Request Handler
* @param {MountOptions} [options] - options of `.mount()`
* @returns {Hono} mounted Hono instance
*
* @example
* ```ts
* import { Router as IttyRouter } from 'itty-router'
* import { Hono } from 'hono'
* // Create itty-router application
* const ittyRouter = IttyRouter()
* // GET /itty-router/hello
* ittyRouter.get('/hello', () => new Response('Hello from itty-router'))
*
* const app = new Hono()
* app.mount('/itty-router', ittyRouter.handle)
* ```
*
* @example
* ```ts
* const app = new Hono()
* // Send the request to another application without modification.
* app.mount('/app', anotherApp, {
* replaceRequest: (req) => req,
* })
* ```
*/
mount(path, applicationHandler, options) {
let replaceRequest;
let optionHandler;
if (options) {
if (typeof options === "function") optionHandler = options;
else {
optionHandler = options.optionHandler;
if (options.replaceRequest === false) replaceRequest = (request) => request;
else replaceRequest = options.replaceRequest;
}
}
const getOptions = optionHandler ? (c) => {
const options = optionHandler(c);
return Array.isArray(options) ? options : [options];
} : (c) => {
let executionContext = void 0;
try {
executionContext = c.executionCtx;
} catch {}
return [c.env, executionContext];
};
replaceRequest ||= (() => {
const mergedPath = require_utils_url.mergePath(this._basePath, path);
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
return (request) => {
const url = new URL(request.url);
url.pathname = this.getPath(request).slice(pathPrefixLength) || "/";
return new Request(url, request);
};
})();
const handler = async (c, next) => {
const res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c));
if (res) return res;
await next();
};
this.#addRoute("ALL", require_utils_url.mergePath(path, "*"), handler);
return this;
}
#addRoute(method, path, handler, baseRoutePath) {
path = require_utils_url.mergePath(this._basePath, path);
const r = {
basePath: baseRoutePath !== void 0 ? require_utils_url.mergePath(this._basePath, baseRoutePath) : this._basePath,
path,
method,
handler
};
this.router.add(method, path, [handler, r]);
this.routes.push(r);
}
#handleError(err, c) {
if (err instanceof Error) return this.errorHandler(err, c);
throw err;
}
#dispatch(request, executionCtx, env, method) {
if (method === "HEAD") return (async () => new Response(null, await this.#dispatch(request, executionCtx, env, "GET")))();
const path = this.getPath(request, { env });
const matchResult = this.router.match(method, path);
const c = new require_context.Context(request, {
path,
matchResult,
env,
executionCtx,
notFoundHandler: this.#notFoundHandler
});
if (matchResult[0].length === 1) {
let res;
try {
res = matchResult[0][0][0][0](c, async () => {
c.res = await this.#notFoundHandler(c);
});
} catch (err) {
return this.#handleError(err, c);
}
return res instanceof Promise ? res.then((resolved) => resolved || (c.finalized ? c.res : this.#notFoundHandler(c))).catch((err) => this.#handleError(err, c)) : res ?? this.#notFoundHandler(c);
}
const composed = require_compose.compose(matchResult[0], this.errorHandler, this.#notFoundHandler);
return (async () => {
try {
const context = await composed(c);
if (!context.finalized) throw new Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");
return context.res;
} catch (err) {
return this.#handleError(err, c);
}
})();
}
/**
* `.fetch()` will be entry point of your app.
*
* @see {@link https://hono.dev/docs/api/hono#fetch}
*
* @param {Request} request - request Object of request
* @param {Env} env - env Object
* @param {ExecutionContext} executionCtx - context of execution
* @returns {Response | Promise<Response>} response of request
*
*/
fetch = (request, ...rest) => {
return this.#dispatch(request, rest[1], rest[0], request.method);
};
/**
* `.request()` is a useful method for testing.
* You can pass a URL or pathname to send a GET request.
* app will return a Response object.
* ```ts
* test('GET /hello is ok', async () => {
* const res = await app.request('/hello')
* expect(res.status).toBe(200)
* })
* ```
* @see https://hono.dev/docs/api/hono#request
*/
request = (input, requestInit, Env, executionCtx) => {
if (input instanceof Request) return this.fetch(requestInit ? new Request(input, requestInit) : input, Env, executionCtx);
input = input.toString();
return this.fetch(new Request(/^https?:\/\//.test(input) ? input : `http://localhost${require_utils_url.mergePath("/", input)}`, requestInit), Env, executionCtx);
};
/**
* `.fire()` automatically adds a global fetch event listener.
* This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers.
* @deprecated
* Use `fire` from `hono/service-worker` instead.
* ```ts
* import { Hono } from 'hono'
* import { fire } from 'hono/service-worker'
*
* const app = new Hono()
* // ...
* fire(app)
* ```
* @see https://hono.dev/docs/api/hono#fire
* @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
* @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/
*/
fire = () => {
addEventListener("fetch", (event) => {
event.respondWith(this.#dispatch(event.request, event, void 0, event.request.method));
});
};
};
//#endregion
exports.HonoBase = Hono;
@@ -0,0 +1,54 @@
# get-nonce
just returns a **nonce** (number used once). No batteries included in those 46 bytes of this library.
---
- ✅ build in `webpack` support via `__webpack_nonce__`
# API
- `getNonce(): string|undefined` - returns the current `nonce`
- `setNonce(newValue)` - set's nonce value
## Why?
Why we need a library to access `__webpack_nonce__`? Abstractions!
"I", as a library author, don't want to "predict" the platform "you" going to use.
"I", as well, want an easier way to test and control `nonce` value.
Like - `nonce` is supported out of the box only by webpack, what you are going to do?
This is why this "man-in-the-middle" was created.
Yep, think about `left-pad` :)
## Webpack
> https://webpack.js.org/guides/csp/
To activate the feature set a **webpack_nonce** variable needs to be included in your entry script.
```
__webpack_nonce__ = uuid(); // for example
```
Without `webpack` `__webpack_nonce__` is actually just a global variable,
which makes it actually bundler independent,
however "other bundlers" are able to replicate it only setting it as a global variable
(as here in tests) which violates a "secure" nature of `nonce`.
`get-nonce` is not global.
## Used in
- `react-style-singleton` <- `react-remove-scroll` <- `react-focus-on`
## Inspiration
- [this issue](https://github.com/theKashey/react-remove-scroll/issues/21)
- [styled-components](https://github.com/styled-components/styled-components/blob/147b0e9a1f10786551b13fd27452fcd5c678d5e0/packages/styled-components/src/utils/nonce.js)
# Licence
MIT
@@ -0,0 +1,256 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// Use a Map rather than object to avoid unexpected __proto__ access.
exports. default = new Map([
["quot", "\u0022"],
["amp", "&"],
["apos", "\u0027"],
["lt", "<"],
["gt", ">"],
["nbsp", "\u00A0"],
["iexcl", "\u00A1"],
["cent", "\u00A2"],
["pound", "\u00A3"],
["curren", "\u00A4"],
["yen", "\u00A5"],
["brvbar", "\u00A6"],
["sect", "\u00A7"],
["uml", "\u00A8"],
["copy", "\u00A9"],
["ordf", "\u00AA"],
["laquo", "\u00AB"],
["not", "\u00AC"],
["shy", "\u00AD"],
["reg", "\u00AE"],
["macr", "\u00AF"],
["deg", "\u00B0"],
["plusmn", "\u00B1"],
["sup2", "\u00B2"],
["sup3", "\u00B3"],
["acute", "\u00B4"],
["micro", "\u00B5"],
["para", "\u00B6"],
["middot", "\u00B7"],
["cedil", "\u00B8"],
["sup1", "\u00B9"],
["ordm", "\u00BA"],
["raquo", "\u00BB"],
["frac14", "\u00BC"],
["frac12", "\u00BD"],
["frac34", "\u00BE"],
["iquest", "\u00BF"],
["Agrave", "\u00C0"],
["Aacute", "\u00C1"],
["Acirc", "\u00C2"],
["Atilde", "\u00C3"],
["Auml", "\u00C4"],
["Aring", "\u00C5"],
["AElig", "\u00C6"],
["Ccedil", "\u00C7"],
["Egrave", "\u00C8"],
["Eacute", "\u00C9"],
["Ecirc", "\u00CA"],
["Euml", "\u00CB"],
["Igrave", "\u00CC"],
["Iacute", "\u00CD"],
["Icirc", "\u00CE"],
["Iuml", "\u00CF"],
["ETH", "\u00D0"],
["Ntilde", "\u00D1"],
["Ograve", "\u00D2"],
["Oacute", "\u00D3"],
["Ocirc", "\u00D4"],
["Otilde", "\u00D5"],
["Ouml", "\u00D6"],
["times", "\u00D7"],
["Oslash", "\u00D8"],
["Ugrave", "\u00D9"],
["Uacute", "\u00DA"],
["Ucirc", "\u00DB"],
["Uuml", "\u00DC"],
["Yacute", "\u00DD"],
["THORN", "\u00DE"],
["szlig", "\u00DF"],
["agrave", "\u00E0"],
["aacute", "\u00E1"],
["acirc", "\u00E2"],
["atilde", "\u00E3"],
["auml", "\u00E4"],
["aring", "\u00E5"],
["aelig", "\u00E6"],
["ccedil", "\u00E7"],
["egrave", "\u00E8"],
["eacute", "\u00E9"],
["ecirc", "\u00EA"],
["euml", "\u00EB"],
["igrave", "\u00EC"],
["iacute", "\u00ED"],
["icirc", "\u00EE"],
["iuml", "\u00EF"],
["eth", "\u00F0"],
["ntilde", "\u00F1"],
["ograve", "\u00F2"],
["oacute", "\u00F3"],
["ocirc", "\u00F4"],
["otilde", "\u00F5"],
["ouml", "\u00F6"],
["divide", "\u00F7"],
["oslash", "\u00F8"],
["ugrave", "\u00F9"],
["uacute", "\u00FA"],
["ucirc", "\u00FB"],
["uuml", "\u00FC"],
["yacute", "\u00FD"],
["thorn", "\u00FE"],
["yuml", "\u00FF"],
["OElig", "\u0152"],
["oelig", "\u0153"],
["Scaron", "\u0160"],
["scaron", "\u0161"],
["Yuml", "\u0178"],
["fnof", "\u0192"],
["circ", "\u02C6"],
["tilde", "\u02DC"],
["Alpha", "\u0391"],
["Beta", "\u0392"],
["Gamma", "\u0393"],
["Delta", "\u0394"],
["Epsilon", "\u0395"],
["Zeta", "\u0396"],
["Eta", "\u0397"],
["Theta", "\u0398"],
["Iota", "\u0399"],
["Kappa", "\u039A"],
["Lambda", "\u039B"],
["Mu", "\u039C"],
["Nu", "\u039D"],
["Xi", "\u039E"],
["Omicron", "\u039F"],
["Pi", "\u03A0"],
["Rho", "\u03A1"],
["Sigma", "\u03A3"],
["Tau", "\u03A4"],
["Upsilon", "\u03A5"],
["Phi", "\u03A6"],
["Chi", "\u03A7"],
["Psi", "\u03A8"],
["Omega", "\u03A9"],
["alpha", "\u03B1"],
["beta", "\u03B2"],
["gamma", "\u03B3"],
["delta", "\u03B4"],
["epsilon", "\u03B5"],
["zeta", "\u03B6"],
["eta", "\u03B7"],
["theta", "\u03B8"],
["iota", "\u03B9"],
["kappa", "\u03BA"],
["lambda", "\u03BB"],
["mu", "\u03BC"],
["nu", "\u03BD"],
["xi", "\u03BE"],
["omicron", "\u03BF"],
["pi", "\u03C0"],
["rho", "\u03C1"],
["sigmaf", "\u03C2"],
["sigma", "\u03C3"],
["tau", "\u03C4"],
["upsilon", "\u03C5"],
["phi", "\u03C6"],
["chi", "\u03C7"],
["psi", "\u03C8"],
["omega", "\u03C9"],
["thetasym", "\u03D1"],
["upsih", "\u03D2"],
["piv", "\u03D6"],
["ensp", "\u2002"],
["emsp", "\u2003"],
["thinsp", "\u2009"],
["zwnj", "\u200C"],
["zwj", "\u200D"],
["lrm", "\u200E"],
["rlm", "\u200F"],
["ndash", "\u2013"],
["mdash", "\u2014"],
["lsquo", "\u2018"],
["rsquo", "\u2019"],
["sbquo", "\u201A"],
["ldquo", "\u201C"],
["rdquo", "\u201D"],
["bdquo", "\u201E"],
["dagger", "\u2020"],
["Dagger", "\u2021"],
["bull", "\u2022"],
["hellip", "\u2026"],
["permil", "\u2030"],
["prime", "\u2032"],
["Prime", "\u2033"],
["lsaquo", "\u2039"],
["rsaquo", "\u203A"],
["oline", "\u203E"],
["frasl", "\u2044"],
["euro", "\u20AC"],
["image", "\u2111"],
["weierp", "\u2118"],
["real", "\u211C"],
["trade", "\u2122"],
["alefsym", "\u2135"],
["larr", "\u2190"],
["uarr", "\u2191"],
["rarr", "\u2192"],
["darr", "\u2193"],
["harr", "\u2194"],
["crarr", "\u21B5"],
["lArr", "\u21D0"],
["uArr", "\u21D1"],
["rArr", "\u21D2"],
["dArr", "\u21D3"],
["hArr", "\u21D4"],
["forall", "\u2200"],
["part", "\u2202"],
["exist", "\u2203"],
["empty", "\u2205"],
["nabla", "\u2207"],
["isin", "\u2208"],
["notin", "\u2209"],
["ni", "\u220B"],
["prod", "\u220F"],
["sum", "\u2211"],
["minus", "\u2212"],
["lowast", "\u2217"],
["radic", "\u221A"],
["prop", "\u221D"],
["infin", "\u221E"],
["ang", "\u2220"],
["and", "\u2227"],
["or", "\u2228"],
["cap", "\u2229"],
["cup", "\u222A"],
["int", "\u222B"],
["there4", "\u2234"],
["sim", "\u223C"],
["cong", "\u2245"],
["asymp", "\u2248"],
["ne", "\u2260"],
["equiv", "\u2261"],
["le", "\u2264"],
["ge", "\u2265"],
["sub", "\u2282"],
["sup", "\u2283"],
["nsub", "\u2284"],
["sube", "\u2286"],
["supe", "\u2287"],
["oplus", "\u2295"],
["otimes", "\u2297"],
["perp", "\u22A5"],
["sdot", "\u22C5"],
["lceil", "\u2308"],
["rceil", "\u2309"],
["lfloor", "\u230A"],
["rfloor", "\u230B"],
["lang", "\u2329"],
["rang", "\u232A"],
["loz", "\u25CA"],
["spades", "\u2660"],
["clubs", "\u2663"],
["hearts", "\u2665"],
["diams", "\u2666"],
]);