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 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_3H","2":"_I","66":"_wH"},C:{"2":"_S"},D:{"1":"_2H","2":"_7 _CL","66":"XC _wH"},E:{"2":"_R"},F:{"1":"_aJ","2":"_TR","66":"_eK _DG"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:7,C:"WebHID API",D:true};
@@ -0,0 +1,84 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const core = require('./core.cjs');
class BrowserReporter {
options;
defaultColor;
levelColorMap;
typeColorMap;
constructor(options) {
this.options = { ...options };
this.defaultColor = "#7f8c8d";
this.levelColorMap = {
0: "#c0392b",
// Red
1: "#f39c12",
// Yellow
3: "#00BCD4"
// Cyan
};
this.typeColorMap = {
success: "#2ecc71"
// Green
};
}
_getLogFn(level) {
if (level < 1) {
return console.__error || console.error;
}
if (level === 1) {
return console.__warn || console.warn;
}
return console.__log || console.log;
}
log(logObj) {
const consoleLogFn = this._getLogFn(logObj.level);
const type = logObj.type === "log" ? "" : logObj.type;
const tag = logObj.tag || "";
const color = this.typeColorMap[logObj.type] || this.levelColorMap[logObj.level] || this.defaultColor;
const style = `
background: ${color};
border-radius: 0.5em;
color: white;
font-weight: bold;
padding: 2px 0.5em;
`;
const badge = `%c${[tag, type].filter(Boolean).join(":")}`;
if (typeof logObj.args[0] === "string") {
consoleLogFn(
`${badge}%c ${logObj.args[0]}`,
style,
// Empty string as style resets to default console style
"",
...logObj.args.slice(1)
);
} else {
consoleLogFn(badge, style, ...logObj.args);
}
}
}
function createConsola(options = {}) {
const consola2 = core.createConsola({
reporters: options.reporters || [new BrowserReporter({})],
prompt(message, options2 = {}) {
if (options2.type === "confirm") {
return Promise.resolve(confirm(message));
}
return Promise.resolve(prompt(message));
},
...options
});
return consola2;
}
const consola = createConsola();
exports.Consola = core.Consola;
exports.LogLevels = core.LogLevels;
exports.LogTypes = core.LogTypes;
exports.consola = consola;
exports.createConsola = createConsola;
exports.default = consola;
@@ -0,0 +1,24 @@
(The MIT License)
Copyright (c) 2009-2014 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2013-2014 Roman Shtylman <shtylman+expressjs@gmail.com>
Copyright (c) 2014-2015 Douglas Christopher Wilson <doug@somethingdoug.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
{"version":3,"names":["applyDecs2203Factory","createAddInitializerMethod","initializers","decoratorFinishedRef","addInitializer","initializer","assertNotFinished","assertCallable","push","memberDec","dec","name","desc","kind","isStatic","isPrivate","value","kindStr","ctx","static","private","v","get","set","call","access","fnName","Error","fn","hint","TypeError","assertValidReturnValue","type","undefined","init","applyMemberDec","ret","base","decInfo","decs","Object","getOwnPropertyDescriptor","newValue","i","length","newInit","instance","ownInitializers","originalInitializer","args","defineProperty","applyMemberDecs","Class","decInfos","protoInitializers","staticInitializers","existingProtoNonFields","Map","existingStaticNonFields","Array","isArray","prototype","existingNonFields","existingKind","pushInitializers","applyClassDecs","targetClass","classDecs","newClass","nextNewClass","applyDecs2203Impl","memberDecs","applyDecs2203"],"sources":["../../src/helpers/applyDecs2203.js"],"sourcesContent":["/* @minVersion 7.19.0 */\n/* @onlyBabel7 */\n\n/**\n * NOTE: This is an old version of the helper, used for 2022-03 decorators.\n * Updates should be done in applyDecs2203R.js.\n */\n\n/**\n Enums are used in this file, but not assigned to vars to avoid non-hoistable values\n\n CONSTRUCTOR = 0;\n PUBLIC = 1;\n PRIVATE = 2;\n\n FIELD = 0;\n ACCESSOR = 1;\n METHOD = 2;\n GETTER = 3;\n SETTER = 4;\n\n STATIC = 5;\n\n CLASS = 10; // only used in assertValidReturnValue\n*/\nfunction applyDecs2203Factory() {\n function createAddInitializerMethod(initializers, decoratorFinishedRef) {\n return function addInitializer(initializer) {\n assertNotFinished(decoratorFinishedRef, \"addInitializer\");\n assertCallable(initializer, \"An initializer\");\n initializers.push(initializer);\n };\n }\n\n function memberDec(\n dec,\n name,\n desc,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n ) {\n var kindStr;\n\n switch (kind) {\n case 1 /* ACCESSOR */:\n kindStr = \"accessor\";\n break;\n case 2 /* METHOD */:\n kindStr = \"method\";\n break;\n case 3 /* GETTER */:\n kindStr = \"getter\";\n break;\n case 4 /* SETTER */:\n kindStr = \"setter\";\n break;\n default:\n kindStr = \"field\";\n }\n\n var ctx = {\n kind: kindStr,\n name: isPrivate ? \"#\" + name : name,\n static: isStatic,\n private: isPrivate,\n };\n\n var decoratorFinishedRef = { v: false };\n\n if (kind !== 0 /* FIELD */) {\n ctx.addInitializer = createAddInitializerMethod(\n initializers,\n decoratorFinishedRef,\n );\n }\n\n var get, set;\n if (kind === 0 /* FIELD */) {\n if (isPrivate) {\n get = desc.get;\n set = desc.set;\n } else {\n get = function () {\n return this[name];\n };\n set = function (v) {\n this[name] = v;\n };\n }\n } else if (kind === 2 /* METHOD */) {\n get = function () {\n return desc.value;\n };\n } else {\n // replace with values that will go through the final getter and setter\n if (kind === 1 /* ACCESSOR */ || kind === 3 /* GETTER */) {\n get = function () {\n return desc.get.call(this);\n };\n }\n\n if (kind === 1 /* ACCESSOR */ || kind === 4 /* SETTER */) {\n set = function (v) {\n desc.set.call(this, v);\n };\n }\n }\n ctx.access =\n get && set ? { get: get, set: set } : get ? { get: get } : { set: set };\n\n try {\n return dec(value, ctx);\n } finally {\n decoratorFinishedRef.v = true;\n }\n }\n\n function assertNotFinished(decoratorFinishedRef, fnName) {\n if (decoratorFinishedRef.v) {\n throw new Error(\n \"attempted to call \" + fnName + \" after decoration was finished\",\n );\n }\n }\n\n function assertCallable(fn, hint) {\n if (typeof fn !== \"function\") {\n throw new TypeError(hint + \" must be a function\");\n }\n }\n\n function assertValidReturnValue(kind, value) {\n var type = typeof value;\n\n if (kind === 1 /* ACCESSOR */) {\n if (type !== \"object\" || value === null) {\n throw new TypeError(\n \"accessor decorators must return an object with get, set, or init properties or void 0\",\n );\n }\n if (value.get !== undefined) {\n assertCallable(value.get, \"accessor.get\");\n }\n if (value.set !== undefined) {\n assertCallable(value.set, \"accessor.set\");\n }\n if (value.init !== undefined) {\n assertCallable(value.init, \"accessor.init\");\n }\n } else if (type !== \"function\") {\n var hint;\n if (kind === 0 /* FIELD */) {\n hint = \"field\";\n } else if (kind === 10 /* CLASS */) {\n hint = \"class\";\n } else {\n hint = \"method\"Line truncated
@@ -0,0 +1,426 @@
# Interceptors
Undici ships with a set of built-in interceptors that can be composed via
`dispatcher.compose()` to add cross-cutting behaviour such as automatic
retries, response decompression, redirect following, DNS caching, and more.
## Usage
```js
import { Agent, interceptors } from 'undici'
const { retry, redirect, decompress, dump, responseError, dns, cache, deduplicate } = interceptors
const agent = new Agent().compose([
retry({ maxRetries: 3 }),
redirect({ maxRedirections: 5 }),
decompress()
])
const response = await agent.request({ origin: 'https://example.com', path: '/', method: 'GET' })
```
You can also apply interceptors to a single `Client` or `Pool`:
```js
import { Client, interceptors } from 'undici'
const client = new Client('https://example.com').compose(
interceptors.retry({ maxRetries: 2 })
)
```
---
## Custom interceptors
Custom interceptors use the same shape as
[`dispatcher.compose()`](./Dispatcher.md#dispatchercomposeinterceptors-interceptor):
an interceptor takes a `dispatch` function and returns another dispatch-like
function with the same `(options, handler)` signature.
When an interceptor wraps the handler, forward the callbacks that it does not
handle itself. The complete handler callback list is documented under
[`dispatcher.dispatch(options, handler)`](./Dispatcher.md#dispatcherdispatchoptions-handler).
```js
import { Agent } from 'undici'
const timingInterceptor = dispatch => {
return (options, handler) => {
const started = performance.now()
return dispatch(options, {
...handler,
onResponseStart (controller, statusCode, headers, statusMessage) {
const duration = Math.round(performance.now() - started)
const method = options.method ?? 'GET'
const origin = options.origin ?? ''
console.log(`${method} ${origin}${options.path} -> ${statusCode} in ${duration}ms`)
return handler.onResponseStart?.(
controller,
statusCode,
headers,
statusMessage
)
},
onResponseError (controller, error) {
const duration = Math.round(performance.now() - started)
console.error(`request failed after ${duration}ms`, error)
return handler.onResponseError?.(controller, error)
}
})
}
}
const dispatcher = new Agent().compose(timingInterceptor)
const { body } = await dispatcher.request({
origin: 'https://example.com',
path: '/',
method: 'GET'
})
await body.dump()
await dispatcher.close()
```
---
## `interceptors.dump([opts])`
Reads and discards the response body up to a configurable size limit. Useful
for keeping a connection alive after an error response without reading the
body yourself.
**Parameters**
* `opts` {Object} (optional)
* `maxSize` {number} Maximum number of bytes to read and discard. Responses
whose declared or received body size exceeds this value are aborted.
**Default:** `1_048_576` (1 MiB).
Per-request override: set `dumpMaxSize` on the dispatch options to override
the global `maxSize` for a specific request.
**Returns:** {Dispatcher.DispatcherComposeInterceptor}
**Example**
```js
import { Agent, interceptors } from 'undici'
const agent = new Agent().compose(
interceptors.dump({ maxSize: 128 * 1024 }) // discard up to 128 KiB
)
```
---
## `interceptors.retry([opts])`
Automatically retries failed requests using the same options accepted by
[`RetryHandler`](./RetryHandler.md).
**Parameters**
* `opts` {RetryHandler.RetryOptions} (optional) Global retry options applied
to every request. Individual requests can override via `opts.retryOptions`.
See [`RetryOptions`](./RetryHandler.md#retryoptions) for the full list of
accepted fields.
**Returns:** {Dispatcher.DispatcherComposeInterceptor}
**Example**
```js
import { Agent, interceptors } from 'undici'
const agent = new Agent().compose(
interceptors.retry({
maxRetries: 5,
minTimeout: 200,
maxTimeout: 5000,
timeoutFactor: 2,
statusCodes: [429, 502, 503, 504]
})
)
```
---
## `interceptors.redirect([opts])`
Follows HTTP redirects (3xx responses) automatically.
**Parameters**
* `opts` {Object} (optional)
* `maxRedirections` {number} Maximum number of redirects to follow. Passing
`0` disables redirect following entirely. **Default:** `undefined`
(inherits from the per-request `maxRedirections` option).
* `throwOnMaxRedirect` {boolean} When `true`, throws an error when a
redirect would be followed but the redirect limit has been reached, instead
of returning that redirect response. A non-redirect response after exactly
`maxRedirections` redirects is returned normally. **Default:** `false`.
* `stripHeadersOnRedirect` {string[]} List of header names to remove from
the request when following any redirect. **Default:** `[]`.
* `stripHeadersOnCrossOriginRedirect` {string[]} List of header names to
remove from the request when following a cross-origin redirect (i.e. the
redirect target has a different origin). Useful for stripping
`Authorization` on cross-origin hops. **Default:** `[]`.
Per-request override: any of the four options above can also be set directly
on the dispatch options to override the interceptor defaults for a specific
request.
**Returns:** {Dispatcher.DispatcherComposeInterceptor}
**Example**
```js
import { Agent, interceptors } from 'undici'
const agent = new Agent().compose(
interceptors.redirect({
maxRedirections: 10,
throwOnMaxRedirect: true,
stripHeadersOnCrossOriginRedirect: ['authorization', 'cookie']
})
)
```
---
## `interceptors.decompress([opts])`
Automatically decompresses response bodies encoded with `gzip`, `x-gzip`,
`br` (Brotli), `deflate`, or `zstd`. Any other coding, including `compress`
and `x-compress`, is left untouched, matching `fetch()`. As required by
[RFC 9659](https://www.rfc-editor.org/rfc/rfc9659.html), a `zstd` frame that
requires a window size larger than 8 MB fails to decode.
> **Experimental:** This interceptor is experimental and subject to change.
> A one-time `ExperimentalWarning` is emitted on first use.
**Parameters**
* `opts` {Object} (optional)
* `skipStatusCodes` {number[]} Status codes for which decompression is
skipped. **Default:** `[204, 304]`.
* `skipErrorResponses` {boolean} When `true`, responses with a status code
>= 400 are not decompressed. **Default:** `true`.
* `maxSize` {number} Maximum decompressed response size in bytes for each
decompression stage. The request fails with a
`ResponseExceededMaxSizeError` if a stage exceeds this limit. Set to `0` to
disable the limit. **Default:** `0`.
**Returns:** {Dispatcher.DispatcherComposeInterceptor}
**Example**
```js
import { Agent, interceptors } from 'undici'
const agent = new Agent().compose(
interceptors.decompress({
skipStatusCodes: [204, 304],
skipErrorResponses: false, // decompress error bodies too
maxSize: 16 * 1024 * 1024 // limit decoded bodies to 16 MiB
})
)
```
---
## `interceptors.responseError([opts])`
Converts 4xx/5xx responses into thrown `ResponseError` instances, making it
easy to handle HTTP errors with a standard `try/catch` block.
The error body is automatically decoded for `application/json` and
`text/plain` responses. For JSON responses the body is parsed and exposed as
`error.body`.
**Parameters**
* `opts` {Object} (optional)
* `maxSize` {number} Maximum number of response body bytes to include in the
error. If the body exceeds this limit, the resulting `ResponseError`
contains the retained prefix with `bodyTruncated` set to `true`. Set to `0`
to disable the limit. **Default:** `1048576` (1 MiB).
**Returns:** {Dispatcher.DispatcherComposeInterceptor}
**Example**
```js
import { Agent, interceptors, errors } from 'undici'
const agent = new Agent().compose(interceptors.responseError())
try {
await agent.request({ origin: 'https://example.com', path: '/not-found', method: 'GET' })
} catch (err) {
if (err instanceof errors.ResponseError) {
console.error(err.status, err.body)
}
}
```
---
## `interceptors.dns([opts])`
Caches DNS lookups so that repeated requests to the same origin reuse the
resolved IP address instead of performing a fresh lookup every time. Supports
dual-stack (IPv4 + IPv6) and custom lookup/storage implementations.
**Parameters**
* `opts` {Object} (optional)
* `maxTTL` {number} Maximum number of milliseconds a DNS record is cached,
regardless of the TTL returned by the resolver. **Default:** `0`
(use the TTL from the DNS record).
* `maxItems` {number} Maximum number of origins to cache simultaneously.
Oldest entries are evicted when the limit is reached. **Default:**
`Infinity`.
* `dualStack` {boolean} When `true`, both IPv4 (`A`) and IPv6 (`AAAA`)
records are looked up and the interceptor picks between them based on
`affinity`. **Default:** `true`.
* `affinity` {4 | 6 | null} Preferred IP family when `dualStack` is
enabled. `null` lets the interceptor alternate between families.
**Default:** `null`.
* `lookup` {Function} (optional) Custom DNS resolution function with the
same signature as `node:dns`'s `lookup` callback form:
`(origin, options, callback) => void`.
* `pick` {Function} (optional) Custom record-selection function called with
`(origin, records, affinity)` to choose which resolved address to use.
* `storage` {DNSStorage} (optional) Custom storage backend. Must implement
`get`, `set`, `delete`, `full`, and `size`.
**`DNSStorage` interface**
```ts
interface DNSStorage {
size: number
get(origin: string): DNSInterceptorOriginRecords | null
set(origin: string, records: DNSInterceptorOriginRecords | null, options: { ttl: number }): void
delete(origin: string): void
full(): boolean
}
```
**Returns:** {Dispatcher.DispatcherComposeInterceptor}
**Example**
```js
import { Agent, interceptors } from 'undici'
const agent = new Agent().compose(
interceptors.dns({
maxTTL: 60_000, // cache for at most 60 seconds
dualStack: true,
affinity: 4 // prefer IPv4
})
)
```
---
## `interceptors.cache([opts])`
Caches HTTP responses according to RFC 9111 (HTTP Caching). See
[`CacheStore`](./CacheStore.md) for information on providing a custom
backing store.
**Parameters**
* `opts` {CacheHandler.CacheOptions} (optional) See the
[`CacheStore`](./CacheStore.md) documentation for accepted fields.
**Returns:** {Dispatcher.DispatcherComposeInterceptor}
**Example**
```js
import { Agent, interceptors, cacheStores } from 'undici'
const agent = new Agent().compose(
interceptors.cache({ store: new cacheStores.MemoryCacheStore() })
)
```
---
## `interceptors.deduplicate([opts])`
Deduplicates concurrent identical requests so that only one is sent over the
wire. All waiting callers receive the same response once the in-flight request
completes. Only safe HTTP methods (e.g. `GET`, `HEAD`) may be deduplicated.
**Parameters**
* `opts` {Object} (optional)
* `methods` {string[]} HTTP methods to deduplicate. Must be safe HTTP
methods (`GET`, `HEAD`, `OPTIONS`, `TRACE`). **Default:** `['GET']`.
* `skipHeaderNames` {string[]} Header names whose presence in a request
causes it to bypass deduplication entirely. Matching is
case-insensitive. **Default:** `[]`.
* `excludeHeaderNames` {string[]} Header names to exclude from the
deduplication key. Requests that differ only in these headers are still
deduplicated together. Useful for headers like `x-request-id` that vary
per request but should not prevent deduplication. Matching is
case-insensitive. **Default:** `[]`.
* `maxBufferSize` {number} Maximum number of bytes buffered per paused
waiting handler. If a waiting handler exceeds this threshold it is failed
with an `AbortError` to prevent unbounded memory growth. **Default:**
`5_242_880` (5 MiB).
**Returns:** {Dispatcher.DispatcherComposeInterceptor}
**Example**
```js
import { Agent, interceptors } from 'undici'
const agent = new Agent().compose(
interceptors.deduplicate({
methods: ['GET', 'HEAD'],
excludeHeaderNames: ['x-request-id', 'x-trace-id'],
maxBufferSize: 2 * 1024 * 1024
})
)
```
---
## Composing multiple interceptors
Interceptors are applied in the order they appear in the `compose()` call.
The first interceptor in the array wraps the outermost layer.
```js
import { Agent, interceptors } from 'undici'
const agent = new Agent().compose([
interceptors.dns({ maxTTL: 30_000 }),
interceptors.retry({ maxRetries: 3 }),
interceptors.redirect({ maxRedirections: 5 }),
interceptors.decompress(),
interceptors.responseError()
])
```
In the example above the request flow is:
1. **dns** — resolves and caches the target IP
2. **retry** — retries the dispatch on transient failures
3. **redirect** — follows any 3xx redirects
4. **decompress** — decompresses the response body
5. **responseError** — converts 4xx/5xx into thrown errors
@@ -0,0 +1,57 @@
import { expect, expectTypeOf, test } from "vitest";
import * as z from "../index.js";
test("basic apply (number)", () => {
const setCommonNumberChecks = <T extends z.ZodMiniNumber>(schema: T) => {
return schema.check(z.minimum(0), z.maximum(100));
};
const schema = z.nullable(z.number().apply(setCommonNumberChecks));
expect(() => z.parse(schema, -1)).toThrowError();
expect(() => z.parse(schema, 101)).toThrowError();
expect(z.parse(schema, 0)).toBe(0);
expect(z.parse(schema, null)).toBe(null);
expectTypeOf<z.infer<typeof schema>>().toEqualTypeOf<number | null>();
});
test("The callback's return value becomes the apply's return value.", () => {
const symbol = Symbol();
const result = z.number().apply(() => symbol);
expect(result).toBe(symbol);
expectTypeOf<typeof result>().toEqualTypeOf<symbol>();
});
test("apply forwards extra args to the callback", () => {
const calls: unknown[] = [];
const capture = (schema: z.ZodMiniString, ...args: unknown[]) => {
calls.push(schema, ...args);
return schema;
};
const schema = z.string();
const result = schema.apply(capture, "id", 42);
expect(calls[0]).toBe(schema);
expect(calls[1]).toBe("id");
expect(calls[2]).toBe(42);
expect(z.parse(result, "value")).toBe("value");
expectTypeOf<z.infer<typeof result>>().toEqualTypeOf<string>();
});
test("apply type-checks the extra args", () => {
const withMin = (schema: z.ZodMiniString, n: number) => schema.check(z.minLength(n));
expect(z.parse(z.string().apply(withMin, 3), "abcd")).toBe("abcd");
expectTypeOf(
z.number().apply<z.ZodMiniNumber>((schema) => schema.check(z.minimum(0)))
).toEqualTypeOf<z.ZodMiniNumber>();
// @ts-expect-error wrong arg type
z.string().apply(withMin, "3");
// @ts-expect-error missing arg
z.string().apply(withMin);
// @ts-expect-error extra arg for a single-parameter callback
z.string().apply((schema: z.ZodMiniString) => schema, 3);
});
@@ -0,0 +1 @@
var m=Object.defineProperty;var a=(r,t)=>m(r,"name",{value:t,configurable:!0});import{r as o}from"./get-pipe-path-BHW2eJdv.mjs";import{r as n}from"./register-CFH5oNdT.mjs";let e;const s=a((r,t)=>(e||(e=n({namespace:Date.now().toString()})),e.require(r,t)),"tsxRequire"),i=a((r,t,c)=>(e||(e=n({namespace:Date.now().toString()})),e.resolve(r,t,c)),"resolve");i.paths=o.resolve.paths,s.resolve=i,s.main=o.main,s.extensions=o.extensions,s.cache=o.cache;export{s as t};
@@ -0,0 +1,740 @@
import fs from 'node:fs';
import { splitFileAndPostfix as splitFileAndPostfix$1, isBareImport } from '@vitest/utils/helpers';
import { i as isBuiltin, a as isBrowserExternal, t as toBuiltin } from './modules.BJuCwlRJ.js';
import { E as EnvironmentTeardownError, a as getSafeWorkerState } from './utils.BX5Fg8C4.js';
import { pathToFileURL } from 'node:url';
import { normalize, join } from 'pathe';
import { distDir } from '../path.js';
import { VitestModuleEvaluator, unwrapId } from '../module-evaluator.js';
import { isAbsolute, resolve } from 'node:path';
import vm from 'node:vm';
import { MockerRegistry, mockObject, RedirectedModule, AutomockedModule } from '@vitest/mocker';
import { findMockRedirect } from '@vitest/mocker/redirect';
import * as viteModuleRunner from 'vite/module-runner';
import { T as Traces } from './traces.DT5aQ62U.js';
class BareModuleMocker {
static pendingIds = [];
spyModule;
primitives;
registries = /* @__PURE__ */ new Map();
mockContext = { callstack: null };
_otel;
constructor(options) {
this.options = options;
this._otel = options.traces;
this.primitives = {
Object,
Error,
Function,
RegExp,
Symbol: globalThis.Symbol,
Array,
Map
};
if (options.spyModule) this.spyModule = options.spyModule;
}
get root() {
return this.options.root;
}
get moduleDirectories() {
return this.options.moduleDirectories || [];
}
getMockerRegistry() {
const suite = this.getSuiteFilepath();
if (!this.registries.has(suite)) this.registries.set(suite, new MockerRegistry());
return this.registries.get(suite);
}
reset() {
this.registries.clear();
}
invalidateModuleById(_id) {
// implemented by mockers that control the module runner
}
isModuleDirectory(path) {
return this.moduleDirectories.some((dir) => path.includes(dir));
}
getSuiteFilepath() {
return this.options.getCurrentTestFilepath() || "global";
}
createError(message, codeFrame) {
const Error = this.primitives.Error;
const error = new Error(message);
Object.assign(error, { codeFrame });
return error;
}
async resolveId(rawId, importer) {
return this._otel.$("vitest.mocker.resolve_id", { attributes: {
"vitest.module.raw_id": rawId,
"vitest.module.importer": rawId
} }, async (span) => {
const result = await this.options.resolveId(rawId, importer);
if (!result) {
span.addEvent("could not resolve id, fallback to unresolved values");
const id = normalizeModuleId(rawId);
span.setAttributes({
"vitest.module.id": id,
"vitest.module.url": rawId,
"vitest.module.external": id,
"vitest.module.fallback": true
});
return {
id,
url: rawId,
external: id
};
}
// external is node_module or unresolved module
// for example, some people mock "vscode" and don't have it installed
const external = !isAbsolute(result.file) || this.isModuleDirectory(result.file) ? normalizeModuleId(rawId) : null;
const id = normalizeModuleId(result.id);
span.setAttributes({
"vitest.module.id": id,
"vitest.module.url": result.url,
"vitest.module.external": external ?? false
});
return {
...result,
id,
external
};
});
}
async resolveMocks() {
if (!BareModuleMocker.pendingIds.length) return;
const resolveMock = async (mock) => {
const { id, url, external } = await this.resolveId(mock.id, mock.importer);
if (mock.action === "unmock") this.unmockPath(id);
if (mock.action === "mock") this.mockPath(mock.id, id, url, external, mock.type, mock.factory);
};
// group consecutive mocks of the same action type together,
// resolve in parallel inside each group, but run groups sequentially
// to preserve mock/unmock ordering
const groups = groupByConsecutiveAction(BareModuleMocker.pendingIds);
for (const group of groups) await Promise.all(group.map(resolveMock));
BareModuleMocker.pendingIds = [];
}
// public method to avoid circular dependency
getMockContext() {
return this.mockContext;
}
// path used to store mocked dependencies
getMockPath(dep) {
return `mock:${dep}`;
}
getDependencyMock(id) {
return this.getMockerRegistry().getById(fixLeadingSlashes(id));
}
getDependencyMockByUrl(url) {
return this.getMockerRegistry().get(url);
}
findMockRedirect(mockPath, external) {
return findMockRedirect(this.root, mockPath, external);
}
mockObject(object, mockExportsOrModuleType, moduleType) {
let mockExports;
if (mockExportsOrModuleType === "automock" || mockExportsOrModuleType === "autospy") {
moduleType = mockExportsOrModuleType;
mockExports = void 0;
} else mockExports = mockExportsOrModuleType;
moduleType ??= "automock";
const createMockInstance = this.spyModule?.createMockInstance;
if (!createMockInstance) throw this.createError("[vitest] `spyModule` is not defined. This is a Vitest error. Please open a new issue with reproduction.");
return mockObject({
globalConstructors: this.primitives,
createMockInstance,
type: moduleType
}, object, mockExports);
}
unmockPath(id) {
this.getMockerRegistry().deleteById(id);
this.invalidateModuleById(id);
}
mockPath(originalId, id, url, external, mockType, factory) {
const registry = this.getMockerRegistry();
if (mockType === "manual") registry.register("manual", originalId, id, url, factory);
else if (mockType === "autospy") registry.register("autospy", originalId, id, url);
else {
const redirect = this.findMockRedirect(id, external);
if (redirect) registry.register("redirect", originalId, id, url, redirect);
else registry.register("automock", originalId, id, url);
}
// every time the mock is registered, we remove the previous one from the cache
this.invalidateModuleById(id);
}
async importActual(_rawId, _importer, _callstack) {
throw new Error(`importActual is not implemented`);
}
async importMock(_rawId, _importer, _callstack) {
throw new Error(`importMock is not implemented`);
}
queueMock(id, importer, factoryOrOptions) {
const mockType = getMockType(factoryOrOptions);
BareModuleMocker.pendingIds.push({
action: "mock",
id,
importer,
factory: typeof factoryOrOptions === "function" ? factoryOrOptions : void 0,
type: mockType
});
}
queueUnmock(id, importer) {
BareModuleMocker.pendingIds.push({
action: "unmock",
id,
importer
});
}
}
function getMockType(factoryOrOptions) {
if (!factoryOrOptions) return "automock";
if (typeof factoryOrOptions === "function") return "manual";
return factoryOrOptions.spy ? "autospy" : "automock";
}
// unique id that is not available as "$bare_import" like "test"
// https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
const prefixedBuiltins = new Set([
"node:sea",
"node:sqlite",
"node:test",
"node:test/reporters"
]);
const isWindows$1 = process.platform === "win32";
// transform file url to id
// virtual:custom -> virtual:custom
// \0custom -> \0custom
// /root/id -> /id
// /root/id.js -> /id.js
// C:/root/id.js -> /id.js
// C:\root\id.js -> /id.js
// TODO: expose this in vite/module-runner
function normalizeModuleId(file) {
if (prefixedBuiltins.has(file)) return file;
// if it's not in the root, keep it as a path, not a URL
return slash(file).replace(/^\/@fs\//, isWindows$1 ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/").replace(/^file:\//, "/");
}
const windowsSlashRE = /\\/g;
function slash(p) {
return p.replace(windowsSlashRE, "/");
}
function groupByConsecutiveAction(mocks) {
const groups = [];
for (const mock of mocks) {
const last = groups.at(-1);
if (last?.[0].action === mock.action) last.push(mock);
else groups.push([mock]);
}
return groups;
}
const multipleSlashRe = /^\/+/;
// module-runner incorrectly replaces file:///path with `///path`
function fixLeadingSlashes(id) {
if (id.startsWith("//")) return id.replace(multipleSlashRe, "/");
return id;
}
// copied from vite
// https://github.com/vitejs/vite/blob/4417b4f305623b2850bd6ae6553834c017694672/packages/vite/src/shared/utils.ts
// https://github.com/vitejs/vite/blob/4417b4f305623b2850bd6ae6553834c017694672/packages/vite/src/node/utils.ts
const postfixRE = /[?#].*$/;
const trailingSeparatorRE = /[?&]$/;
function cleanUrl(url) {
return url.replace(postfixRE, "");
}
function splitFileAndPostfix(path) {
const file = cleanUrl(path);
return {
file,
postfix: path.slice(file.length)
};
}
function injectQuery(url, queryToInject) {
const { file, postfix } = splitFileAndPostfix(url);
return `${file}?${queryToInject}${postfix[0] === "?" ? `&${postfix.slice(1)}` : postfix}`;
}
function removeQuery(url, queryToRemove) {
return url.replace(new RegExp(`([?&])${queryToRemove}(?:&|$)`), "$1").replace(trailingSeparatorRE, "");
}
const spyModulePath = resolve(distDir, "spy.js");
class VitestMocker extends BareModuleMocker {
filterPublicKeys;
constructor(moduleRunner, options) {
super(options);
this.moduleRunner = moduleRunner;
this.options = options;
const context = this.options.context;
if (context) this.primitives = vm.runInContext("({ Object, Error, Function, RegExp, Symbol, Array, Map })", context);
const Symbol = this.primitives.Symbol;
this.filterPublicKeys = [
"__esModule",
Symbol.asyncIterator,
Symbol.hasInstance,
Symbol.isConcatSpreadable,
Symbol.iterator,
Symbol.match,
Symbol.matchAll,
Symbol.replace,
Symbol.search,
Symbol.split,
Symbol.species,
Symbol.toPrimitive,
Symbol.toStringTag,
Symbol.unscopables
];
}
get evaluatedModules() {
return this.moduleRunner.evaluatedModules;
}
async initializeSpyModule() {
if (this.spyModule) return;
this.spyModule = await this.moduleRunner.import(spyModulePath);
}
reset() {
this.registries.clear();
}
invalidateModuleById(id) {
const mockId = this.getMockPath(id);
const node = this.evaluatedModules.getModuleById(mockId);
if (node) {
this.evaluatedModules.invalidateModule(node);
node.mockedExports = void 0;
}
}
ensureModule(id, url) {
const node = this.evaluatedModules.ensureModule(id, url);
// TODO
node.meta = {
id,
url,
code: "",
file: null,
invalidate: false
};
return node;
}
async callFunctionMock(id, url, mock) {
const node = this.ensureModule(id, url);
if (node.exports) return node.exports;
const exports$1 = await mock.resolve();
const moduleExports = new Proxy(exports$1, { get: (target, prop) => {
const val = target[prop];
// 'then' can exist on non-Promise objects, need nested instanceof check for logic to work
if (prop === "then") {
if (target instanceof Promise) return target.then.bind(target);
} else if (!(prop in target)) {
if (this.filterPublicKeys.includes(prop)) return;
throw this.createError(`[vitest] No "${String(prop)}" export is defined on the "${mock.raw}" mock. Did you forget to return it from "vi.mock"?
If you need to partially mock a module, you can use "importOriginal" helper inside:
`, `vi.mock(import("${mock.raw}"), async (importOriginal) => {
const actual = await importOriginal()
return {
...actual,
// your mocked methods
}
})`);
}
return val;
} });
node.exports = moduleExports;
return moduleExports;
}
async importActual(rawId, importer, callstack) {
const { url } = await this.resolveId(rawId, importer);
const actualUrl = injectQuery(url, "_vitest_original");
const node = await this.moduleRunner.fetchModule(actualUrl, importer);
return await this.moduleRunner.cachedRequest(node.url, node, callstack || [importer], void 0, true);
}
async importMock(rawId, importer) {
const { id, url, external } = await this.resolveId(rawId, importer);
let mock = this.getDependencyMock(id);
if (!mock) {
const redirect = this.findMockRedirect(id, external);
if (redirect) mock = new RedirectedModule(rawId, id, rawId, redirect);
else mock = new AutomockedModule(rawId, id, rawId);
}
if (mock.type === "automock" || mock.type === "autospy") {
const node = await this.moduleRunner.fetchModule(url, importer);
const mod = await this.moduleRunner.cachedRequest(url, node, [importer], void 0, true);
const Object = this.primitives.Object;
return this.mockObject(mod, Object.create(Object.prototype), mock.type);
}
if (mock.type === "manual") return this.callFunctionMock(id, url, mock);
const node = await this.moduleRunner.fetchModule(mock.redirect);
return this.moduleRunner.cachedRequest(mock.redirect, node, [importer], void 0, true);
}
async requestWithMockedModule(url, evaluatedNode, callstack, mock) {
return this._otel.$("vitest.mocker.evaluate", async (span) => {
const mockId = this.getMockPath(evaluatedNode.id);
span.setAttributes({
"vitest.module.id": mockId,
"vitest.mock.type": mock.type,
"vitest.mock.id": mock.id,
"vitest.mock.url": mock.url,
"vitest.mock.raw": mock.raw
});
if (mock.type === "automock" || mock.type === "autospy") {
const cache = this.evaluatedModules.getModuleById(mockId);
if (cache && cache.mockedExports) return cache.mockedExports;
const Object = this.primitives.Object;
// we have to define a separate object that will copy all properties into itself
// and can't just use the same `exports` define automatically by Vite before the evaluator
const exports$1 = Object.create(null);
Object.defineProperty(exports$1, Symbol.toStringTag, {
value: "Module",
configurable: true,
writable: true
});
const node = this.ensureModule(mockId, this.getMockPath(evaluatedNode.url));
node.meta = evaluatedNode.meta;
node.file = evaluatedNode.file;
node.mockedExports = exports$1;
const mod = await this.moduleRunner.cachedRequest(url, node, callstack, void 0, true);
this.mockObject(mod, exports$1, mock.type);
return exports$1;
}
if (mock.type === "manual" && !callstack.includes(mockId) && !callstack.includes(url)) try {
callstack.push(mockId);
// this will not work if user does Promise.all(import(), import())
// we can also use AsyncLocalStorage to store callstack, but this won't work in the browser
// maybe we should improve mock API in the future?
this.mockContext.callstack = callstack;
return await this.callFunctionMock(mockId, this.getMockPath(url), mock);
} finally {
this.mockContext.callstack = null;
const indexMock = callstack.indexOf(mockId);
callstack.splice(indexMock, 1);
}
else if (mock.type === "redirect" && !callstack.includes(mock.redirect)) {
span.setAttribute("vitest.mock.redirect", mock.redirect);
return mock.redirect;
}
});
}
async mockedRequest(url, evaluatedNode, callstack) {
const mock = this.getDependencyMock(evaluatedNode.id);
if (!mock) return;
return this.requestWithMockedModule(url, evaluatedNode, callstack, mock);
}
}
class VitestTransport {
constructor(options, evaluatedModules, callstacks) {
this.options = options;
this.evaluatedModules = evaluatedModules;
this.callstacks = callstacks;
}
async invoke(event) {
if (event.type !== "custom") return { error: /* @__PURE__ */ new Error(`Vitest Module Runner doesn't support Vite HMR events.`) };
if (event.event !== "vite:invoke") return { error: /* @__PURE__ */ new Error(`Vitest Module Runner doesn't support ${event.event} event.`) };
const { name, data } = event.data;
if (name === "getBuiltins")
// we return an empty array here to avoid client-side builtin check,
// as we need builtins to go through `fetchModule`
return { result: [] };
if (name !== "fetchModule") return { error: /* @__PURE__ */ new Error(`Unknown method: ${name}. Expected "fetchModule".`) };
try {
return { result: await this.options.fetchModule(...data) };
} catch (cause) {
if (cause instanceof EnvironmentTeardownError) {
const [id, importer] = data;
let message = `Cannot load '${id}'${importer ? ` imported from ${importer}` : ""} after the environment was torn down. This is not a bug in Vitest.`;
const moduleNode = importer ? this.evaluatedModules.getModuleById(importer) : void 0;
const callstack = moduleNode ? this.callstacks.get(moduleNode) : void 0;
if (callstack) message += ` The last recorded callstack:\n- ${[
...callstack,
importer,
id
].reverse().join("\n- ")}`;
const error = new EnvironmentTeardownError(message);
if (cause.stack) error.stack = cause.stack.replace(cause.message, error.message);
return { error };
}
return { error: cause };
}
}
}
const createNodeImportMeta = (modulePath) => {
if (!viteModuleRunner.createDefaultImportMeta) throw new Error(`createNodeImportMeta is not supported in this version of Vite.`);
const defaultMeta = viteModuleRunner.createDefaultImportMeta(modulePath);
const href = defaultMeta.url;
const importMetaResolver = createImportMetaResolver();
return {
...defaultMeta,
main: false,
resolve(id, parent) {
return (importMetaResolver ?? defaultMeta.resolve)(id, parent ?? href);
}
};
};
function createImportMetaResolver() {
if (!import.meta.resolve) return;
return (specifier, importer) => import.meta.resolve(specifier, importer);
}
// @ts-expect-error overriding private method
class VitestModuleRunner extends viteModuleRunner.ModuleRunner {
mocker;
moduleExecutionInfo;
_otel;
_callstacks;
constructor(vitestOptions) {
const options = vitestOptions;
const evaluatedModules = options.evaluatedModules;
const callstacks = /* @__PURE__ */ new WeakMap();
const transport = new VitestTransport(options.transport, evaluatedModules, callstacks);
super({
transport,
hmr: false,
evaluatedModules,
sourcemapInterceptor: "prepareStackTrace",
createImportMeta: vitestOptions.createImportMeta
}, options.evaluator);
this.vitestOptions = vitestOptions;
this._callstacks = callstacks;
this._otel = vitestOptions.traces || new Traces({ enabled: false });
this.moduleExecutionInfo = options.getWorkerState().moduleExecutionInfo;
this.mocker = options.mocker || new VitestMocker(this, {
spyModule: options.spyModule,
context: options.vm?.context,
traces: this._otel,
resolveId: options.transport.resolveId,
get root() {
return options.getWorkerState().config.root;
},
get moduleDirectories() {
return options.getWorkerState().config.deps.moduleDirectories || [];
},
getCurrentTestFilepath() {
return options.getWorkerState().filepath;
}
});
if (options.vm) options.vm.context.__vitest_mocker__ = this.mocker;
else Object.defineProperty(globalThis, "__vitest_mocker__", {
configurable: true,
writable: true,
value: this.mocker
});
}
/**
* Vite checks that the module has exports emulating the Node.js behaviour,
* but Vitest is more relaxed.
*
* We should keep the Vite behavior when there is a `strict` flag.
* @internal
*/
processImport(exports$1) {
return exports$1;
}
async import(rawId) {
const resolved = await this._otel.$("vitest.module.resolve_id", { attributes: { "vitest.module.raw_id": rawId } }, async (span) => {
const result = await this.vitestOptions.transport.resolveId(rawId);
if (result) span.setAttributes({
"vitest.module.url": result.url,
"vitest.module.file": result.file,
"vitest.module.id": result.id
});
return result;
});
return super.import(resolved ? resolved.url : rawId);
}
async fetchModule(url, importer) {
return await this.cachedModule(url, importer);
}
_cachedRequest(url, module, callstack = [], metadata) {
// @ts-expect-error "cachedRequest" is private
return super.cachedRequest(url, module, callstack, metadata);
}
/**
* @internal
*/
async cachedRequest(url, mod, callstack = [], metadata, ignoreMock = false) {
// Track for a better error message if dynamic import is not resolved properly
this._callstacks.set(mod, callstack);
if (ignoreMock) return this._cachedRequest(url, mod, callstack, metadata);
let mocked;
if (mod.meta && "mockedModule" in mod.meta) {
const mockedModule = mod.meta.mockedModule;
const mockId = this.mocker.getMockPath(mod.id);
// bypass mock and force "importActual" behavior when:
// - mock was removed by doUnmock (stale mockedModule in meta)
// - self-import: mock factory/file is importing the module it's mocking
const isStale = !this.mocker.getDependencyMock(mod.id);
const isSelfImport = callstack.includes(mockId) || callstack.includes(url) || "redirect" in mockedModule && callstack.includes(mockedModule.redirect);
if (isStale || isSelfImport) {
const node = await this.fetchModule(injectQuery(url, "_vitest_original"));
return this._cachedRequest(node.url, node, callstack, metadata);
}
mocked = await this.mocker.requestWithMockedModule(url, mod, callstack, mockedModule);
} else mocked = await this.mocker.mockedRequest(url, mod, callstack);
if (typeof mocked === "string") {
const node = await this.fetchModule(mocked);
return this._cachedRequest(mocked, node, callstack, metadata);
}
if (mocked != null && typeof mocked === "object") return mocked;
return this._cachedRequest(url, mod, callstack, metadata);
}
/** @internal */
_invalidateSubTreeById(ids, invalidated = /* @__PURE__ */ new Set()) {
for (const id of ids) {
if (invalidated.has(id)) continue;
const node = this.evaluatedModules.getModuleById(id);
if (!node) continue;
invalidated.add(id);
const subIds = Array.from(this.evaluatedModules.idToModuleMap).filter(([, mod]) => mod.importers.has(id)).map(([key]) => key);
if (subIds.length) this._invalidateSubTreeById(subIds, invalidated);
this.evaluatedModules.invalidateModule(node);
}
}
}
const bareVitestRegexp = /^@?vitest(?:\/|$)/;
const normalizedDistDir = normalize(distDir);
const relativeIds = {};
const externalizeMap = /* @__PURE__ */ new Map();
// all Vitest imports always need to be externalized
function getCachedVitestImport(id, state) {
if (id.startsWith("/@fs/") || id.startsWith("\\@fs\\")) id = id.slice(process.platform === "win32" ? 5 : 4);
if (externalizeMap.has(id)) return {
externalize: externalizeMap.get(id),
type: "module"
};
// always externalize Vitest because we import from there before running tests
// so we already have it cached by Node.js
const root = state().config.root;
const relativeRoot = relativeIds[root] ?? (relativeIds[root] = normalizedDistDir.slice(root.length));
if (id.includes(distDir) || id.includes(normalizedDistDir)) {
const { file, postfix } = splitFileAndPostfix$1(id);
const externalize = id.startsWith("file://") ? id : `${pathToFileURL(file)}${postfix}`;
externalizeMap.set(id, externalize);
return {
externalize,
type: "module"
};
}
if (relativeRoot && relativeRoot !== "/" && id.startsWith(relativeRoot)) {
const { file, postfix } = splitFileAndPostfix$1(id);
const externalize = `${pathToFileURL(join(root, file))}${postfix}`;
externalizeMap.set(id, externalize);
return {
externalize,
type: "module"
};
}
if (bareVitestRegexp.test(id)) {
externalizeMap.set(id, id);
return {
externalize: id,
type: "module"
};
}
return null;
}
const { readFileSync } = fs;
const VITEST_VM_CONTEXT_SYMBOL = "__vitest_vm_context__";
const cwd = process.cwd();
const isWindows = process.platform === "win32";
function startVitestModuleRunner(options) {
const traces = options.traces;
const state = () => getSafeWorkerState() || options.state;
const rpc = () => state().rpc;
const environment = () => {
const environment = state().environment;
return environment.viteEnvironment || environment.name;
};
const vm = options.context && options.externalModulesExecutor ? {
context: options.context,
externalModulesExecutor: options.externalModulesExecutor
} : void 0;
const evaluator = options.evaluator || new VitestModuleEvaluator(vm, {
traces,
evaluatedModules: options.evaluatedModules,
get moduleExecutionInfo() {
return state().moduleExecutionInfo;
},
get interopDefault() {
return state().config.deps.interopDefault;
},
getCurrentTestFilepath: () => state().filepath
});
const moduleRunner = new VitestModuleRunner({
spyModule: options.spyModule,
evaluatedModules: options.evaluatedModules,
evaluator,
traces,
mocker: options.mocker,
transport: {
async fetchModule(id, importer, options) {
const resolvingModules = state().resolvingModules;
if (isWindows) {
if (id[1] === ":") {
// The drive letter is different for whatever reason, we need to normalize it to CWD
if (id[0] !== cwd[0] && id[0].toUpperCase() === cwd[0].toUpperCase()) id = (cwd[0].toUpperCase() === cwd[0] ? id[0].toUpperCase() : id[0].toLowerCase()) + id.slice(1);
// always mark absolute windows paths, otherwise Vite will externalize it
id = `/@id/${id}`;
}
}
const vitest = getCachedVitestImport(id, state);
if (vitest) return vitest;
// strip _vitest_original query added by importActual so that
// the plugin pipeline sees the original import id (e.g. virtual modules's load hook)
const isImportActual = id.includes("_vitest_original");
if (isImportActual) id = removeQuery(id, "_vitest_original");
const rawId = unwrapId(id);
resolvingModules.add(rawId);
try {
if (VitestMocker.pendingIds.length) await moduleRunner.mocker.resolveMocks();
if (!isImportActual) {
const resolvedMock = moduleRunner.mocker.getDependencyMockByUrl(id);
if (resolvedMock?.type === "manual" || resolvedMock?.type === "redirect") return {
code: "",
file: null,
id: resolvedMock.id,
url: resolvedMock.url,
invalidate: false,
mockedModule: resolvedMock
};
}
if (isBuiltin(rawId)) return {
externalize: rawId,
type: "builtin"
};
if (isBrowserExternal(rawId)) return {
externalize: toBuiltin(rawId),
type: "builtin"
};
// if module is invalidated, the worker will be recreated,
// so cached is always true in a single worker
if (!isImportActual && options?.cached) return { cache: true };
const otelCarrier = traces?.getContextCarrier();
const result = await rpc().fetch(id, importer, environment(), options, otelCarrier);
if ("cached" in result) return {
code: readFileSync(result.tmp, "utf-8"),
...result
};
return result;
} catch (cause) {
// rethrow vite error if it cannot load the module because it's not resolved
if (typeof cause === "object" && cause != null && cause.code === "ERR_LOAD_URL" || typeof cause?.message === "string" && cause.message.includes("Failed to load url") || typeof cause?.message === "string" && cause.message.startsWith("Cannot find module '")) {
const error = new Error(`Cannot find ${isBareImport(id) ? "package" : "module"} '${id}'${importer ? ` imported from ${importer}` : ""}`, { cause });
error.code = "ERR_MODULE_NOT_FOUND";
throw error;
}
throw cause;
} finally {
resolvingModules.delete(rawId);
}
},
resolveId(id, importer) {
return rpc().resolve(id, importer, environment());
}
},
getWorkerState: state,
vm,
createImportMeta: options.createImportMeta
});
return moduleRunner;
}
export { BareModuleMocker as B, VITEST_VM_CONTEXT_SYMBOL as V, VitestModuleRunner as a, VitestTransport as b, createNodeImportMeta as c, normalizeModuleId as n, startVitestModuleRunner as s };
@@ -0,0 +1,114 @@
# Changelog
## [5.0.1](https://github.com/crouchcd/pkce-challenge/releases/tag/5.0.1) - 2025-11-22
## What's Changed
* Use even distribution by @RobinVdBroeck in https://github.com/crouchcd/pkce-challenge/pull/38
## New Contributors
* @RobinVdBroeck made their first contribution in https://github.com/crouchcd/pkce-challenge/pull/38
**Full Changelog**: https://github.com/crouchcd/pkce-challenge/compare/5.0.0...5.0.1
## [5.0.0](https://github.com/crouchcd/pkce-challenge/releases/tag/5.0.0) - 2025-03-30
## What's Changed
* fix: add support for commonjs module by @li-yechao in https://github.com/crouchcd/pkce-challenge/pull/32
## New Contributors
* @li-yechao made their first contribution in https://github.com/crouchcd/pkce-challenge/pull/32
**Full Changelog**: https://github.com/crouchcd/pkce-challenge/compare/4.1.0...5.0.0
## [4.1.0](https://github.com/crouchcd/pkce-challenge/releases/tag/4.1.0) - 2024-01-25
## What's Changed
* Separate entrypoints for node and browser by @mdarocha in https://github.com/crouchcd/pkce-challenge/pull/25
## New Contributors
* @mdarocha made their first contribution in https://github.com/crouchcd/pkce-challenge/pull/25
**Full Changelog**: https://github.com/crouchcd/pkce-challenge/compare/4.0.1...4.1.0
## [4.0.1](https://github.com/crouchcd/pkce-challenge/releases/tag/4.0.1) - 2023-05-11
- chore: update README (dc76443a502c25ce98258cea3f25fd78a22cb2a8)
- chore: specify node engines >= 16.20.0 (5e7fc5edbcd0e19f99fc11a9705e5e708a100be8)
## [4.0.0](https://github.com/crouchcd/pkce-challenge/releases/tag/4.0.0) - 2023-05-11
- BREAKING CHANGE: Use Web Cryptography API (#20), closes #21, #18
### Contributors
- [saschanaz](https://github.com/saschanaz)
## [3.1.0] - 2023-03-29
- chore: Use ES6 imports for crypto-js to reduce bundle size
### Contributors
- [gretchenfitze]
## [3.0.0] - 2022-03-28
- feat!: depend on crypto-js for node/browser compatibility. Using Typescript with Parcel.
```js
// commonjs
const pkceChallenge = require("pkce-challenge").default;
// es modules
import pkceChallenge from "pkce-challenge";
```
## [2.2.0] - 2021-05-19
### Added
- `generateChallenge` exported from index
### Contributors
- [SeyyedKhandon]
## [2.1.0] - 2019-12-20
### Added
- `verifyChallenge` exported from index
### Changed
- code/comment formatting
- refactored `random` function
## [2.0.0] - 2019-10-18
### Added
- CHANGELOG
- typescript definition
- Cryptographically secured method for generating code verifier
- Method for base64 url encoding
### Removed
- `generateVerifier` export from index
- `generateChallenge` export from index
- `base64url` npm dependency
- `randomatic` npm dependency
### Contributors
- [lordnox]
[gretchenfitze]: https://github.com/gretchenfitze
[seyyedkhandon]: https://github.com/SeyyedKhandon
[lordnox]: https://github.com/lordnox
[3.1.0]: https://github.com/crouchcd/pkce-challenge/releases/tag/3.1.0
[3.0.0]: https://github.com/crouchcd/pkce-challenge/releases/tag/3.0.0
[2.2.0]: https://github.com/crouchcd/pkce-challenge/releases/tag/2.2.0
[2.1.0]: https://github.com/crouchcd/pkce-challenge/releases/tag/2.1.0
[2.0.0]: https://github.com/crouchcd/pkce-challenge/releases/tag/2.0.0
@@ -0,0 +1,14 @@
import type { TSESLint } from '@typescript-eslint/utils';
export type MessageIds = 'angle-bracket' | 'as' | 'never' | 'replaceArrayTypeAssertionWithAnnotation' | 'replaceArrayTypeAssertionWithSatisfies' | 'replaceObjectTypeAssertionWithAnnotation' | 'replaceObjectTypeAssertionWithSatisfies' | 'unexpectedArrayTypeAssertion' | 'unexpectedObjectTypeAssertion';
type OptUnion = {
assertionStyle: 'angle-bracket' | 'as';
objectLiteralTypeAssertions?: 'allow' | 'allow-as-parameter' | 'never';
arrayLiteralTypeAssertions?: 'allow' | 'allow-as-parameter' | 'never';
} | {
assertionStyle: 'never';
};
export type Options = readonly [OptUnion];
declare const _default: TSESLint.RuleModule<MessageIds, Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _nonIterableSpread;
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
//# sourceMappingURL=nonIterableSpread.js.map
@@ -0,0 +1,186 @@
/*!
* body-parser
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
* @private
*/
const debug = require('debug')('body-parser:json')
const read = require('../read')
const { normalizeOptions } = require('../utils')
/**
* Module exports.
*/
module.exports = json
/**
* RegExp to match the first non-whitespace character in a string.
*
* Allowed whitespace is defined in RFC 7159:
*
* ws = *(
* %x20 / ; Space
* %x09 / ; Horizontal tab
* %x0A / ; Line feed or New line
* %x0D ) ; Carriage return
*/
const FIRST_NON_WHITESPACE_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d]|$)/ // eslint-disable-line no-control-regex
const JSON_SYNTAX_CHAR = '#'
const JSON_SYNTAX_REGEXP = /#+/g
/**
* Create a middleware to parse JSON bodies.
*
* @param {Object} [options]
* @returns {Function}
* @public
*/
function json (options) {
const normalizedOptions = normalizeOptions(options, 'application/json')
const parse = createJsonParser(options)
const readOptions = {
...normalizedOptions,
// assert charset per RFC 7159 sec 8.1
isValidCharset: (charset) => charset.slice(0, 4) === 'utf-'
}
return function jsonParser (req, res, next) {
read(req, res, next, parse, debug, readOptions)
}
}
/**
* Create a JSON parse function
*
* @param {object} [options]
* @return {function}
* @private
*/
function createJsonParser (options) {
const reviver = options?.reviver
const strict = options?.strict !== false
if (strict) {
return function parse (body) {
if (body.length === 0) {
// special-case empty json body, as it's a common client-side mistake
// TODO: maybe make this configurable or part of "strict" option
return {}
}
if (body[0] !== '{' && body[0] !== '[') {
const first = firstNonWhitespaceChar(body)
if (first !== '{' && first !== '[') {
debug('strict violation')
throw createStrictSyntaxError(body, first)
}
}
try {
debug('parse json')
return JSON.parse(body, reviver)
} catch (e) {
throw normalizeJsonSyntaxError(e, {
message: e.message,
stack: e.stack
})
}
}
}
return function parse (body) {
if (body.length === 0) {
// special-case empty json body, as it's a common client-side mistake
// TODO: maybe make this configurable or part of "strict" option
return {}
}
try {
debug('parse json')
return JSON.parse(body, reviver)
} catch (e) {
throw normalizeJsonSyntaxError(e, {
message: e.message,
stack: e.stack
})
}
}
}
/**
* Create strict violation syntax error matching native error.
*
* @param {string} str
* @param {string} char
* @returns {Error}
* @private
*/
function createStrictSyntaxError (str, char) {
const index = str.indexOf(char)
let partial = ''
if (index !== -1) {
partial = str.substring(0, index) + JSON_SYNTAX_CHAR.repeat(str.length - index)
}
try {
JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')
} catch (e) {
return normalizeJsonSyntaxError(e, {
message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) {
return str.substring(index, index + placeholder.length)
}),
stack: e.stack
})
}
}
/**
* Get the first non-whitespace character in a string.
*
* @param {string} str
* @returns {string|undefined}
* @private
*/
function firstNonWhitespaceChar (str) {
const match = FIRST_NON_WHITESPACE_REGEXP.exec(str)
return match && match[1] ? match[1] : undefined
}
/**
* Normalize a SyntaxError for JSON.parse.
*
* @param {SyntaxError} error
* @param {Object} obj
* @returns {SyntaxError}
* @private
*/
function normalizeJsonSyntaxError (error, obj) {
const keys = Object.getOwnPropertyNames(error)
for (let i = 0; i < keys.length; i++) {
const key = keys[i]
if (key !== 'stack' && key !== 'message') {
delete error[key]
}
}
// replace stack before message for Node.js 0.10 and below
error.stack = obj.stack.replace(error.message, obj.message)
error.message = obj.message
return error
}
@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ArrowDownLeft = createLucideIcon("ArrowDownLeft", [
["path", { d: "M17 7 7 17", key: "15tmo1" }],
["path", { d: "M17 17H7V7", key: "1org7z" }]
]);
export { ArrowDownLeft as default };
//# sourceMappingURL=arrow-down-left.js.map
@@ -0,0 +1,83 @@
'use strict';
var levenshtein = require('../../utils/levenshtein.cjs');
var types = require('../../types.cjs');
var mergeUserInputDictionary = require('../../utils/mergeUserInputDictionary.cjs');
class MatchDictionary extends types.MatcherBaseClass {
constructor(options, wordSequenceCheck) {
super(options);
this.wordSequenceCheck = wordSequenceCheck;
}
getRangedDictionaries(userInputsOptions) {
if (this.wordSequenceCheck) {
const rankedDictionaries = {};
const rankedDictionariesMaxWordSize = {};
Object.keys(this.options.rankedDictionaries).forEach(key => {
if (this.options.isWordSequence(key)) {
rankedDictionaries[key] = this.options.rankedDictionaries[key];
rankedDictionariesMaxWordSize[key] = this.options.rankedDictionariesMaxWordSize[key];
}
});
return {
rankedDictionaries,
rankedDictionariesMaxWordSize
};
}
return mergeUserInputDictionary(this.options.rankedDictionaries, this.options.rankedDictionariesMaxWordSize, userInputsOptions);
}
match({
password,
userInputsOptions,
useLevenshtein = true
}) {
const matches = [];
const passwordLength = password.length;
const passwordLower = password.toLowerCase();
const {
rankedDictionaries,
rankedDictionariesMaxWordSize
} = this.getRangedDictionaries(userInputsOptions);
// eslint-disable-next-line complexity,max-statements
Object.keys(rankedDictionaries).forEach(dictionaryName => {
const rankedDict = rankedDictionaries[dictionaryName];
const longestDictionaryWordSize = rankedDictionariesMaxWordSize[dictionaryName];
const searchWidth = Math.min(longestDictionaryWordSize, passwordLength);
for (let i = 0; i < passwordLength; i += 1) {
const searchEnd = Math.min(i + searchWidth, passwordLength);
for (let j = i; j < searchEnd; j += 1) {
const usedPassword = passwordLower.slice(i, j + 1 || 9e9);
const isInDictionary = usedPassword in rankedDict;
let foundLevenshteinDistance = {};
// only use levenshtein distance on full password to minimize the performance drop
// and because otherwise there would be to many false positives
const isFullPassword = i === 0 && j === passwordLength - 1;
if (this.options.useLevenshteinDistance && isFullPassword && !isInDictionary && useLevenshtein) {
foundLevenshteinDistance = levenshtein(usedPassword, rankedDict, this.options.levenshteinThreshold);
}
const isLevenshteinMatch = Object.keys(foundLevenshteinDistance).length !== 0;
if (isInDictionary || isLevenshteinMatch) {
const usedRankPassword = isLevenshteinMatch ? foundLevenshteinDistance.levenshteinDistanceEntry : usedPassword;
const rank = rankedDict[usedRankPassword];
matches.push({
pattern: 'dictionary',
i,
j,
token: password.slice(i, j + 1 || 9e9),
matchedWord: usedPassword,
rank,
dictionaryName: dictionaryName,
reversed: false,
l33t: false,
...foundLevenshteinDistance
});
}
}
}
});
return matches;
}
}
module.exports = MatchDictionary;
//# sourceMappingURL=matching.cjs.map
@@ -0,0 +1 @@
{"version":3,"file":"vault.js","sources":["../../../src/icons/vault.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Vault\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxjaXJjbGUgY3g9IjcuNSIgY3k9IjcuNSIgcj0iLjUiIGZpbGw9ImN1cnJlbnRDb2xvciIgLz4KICA8cGF0aCBkPSJtNy45IDcuOSAyLjcgMi43IiAvPgogIDxjaXJjbGUgY3g9IjE2LjUiIGN5PSI3LjUiIHI9Ii41IiBmaWxsPSJjdXJyZW50Q29sb3IiIC8+CiAgPHBhdGggZD0ibTEzLjQgMTAuNiAyLjctMi43IiAvPgogIDxjaXJjbGUgY3g9IjcuNSIgY3k9IjE2LjUiIHI9Ii41IiBmaWxsPSJjdXJyZW50Q29sb3IiIC8+CiAgPHBhdGggZD0ibTcuOSAxNi4xIDIuNy0yLjciIC8+CiAgPGNpcmNsZSBjeD0iMTYuNSIgY3k9IjE2LjUiIHI9Ii41IiBmaWxsPSJjdXJyZW50Q29sb3IiIC8+CiAgPHBhdGggZD0ibTEzLjQgMTMuNCAyLjcgMi43IiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/vault\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 Vault = createLucideIcon('Vault', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['circle', { cx: '7.5', cy: '7.5', r: '.5', fill: 'currentColor', key: 'kqv944' }],\n ['path', { d: 'm7.9 7.9 2.7 2.7', key: 'hpeyl3' }],\n ['circle', { cx: '16.5', cy: '7.5', r: '.5', fill: 'currentColor', key: 'w0ekpg' }],\n ['path', { d: 'm13.4 10.6 2.7-2.7', key: '264c1n' }],\n ['circle', { cx: '7.5', cy: '16.5', r: '.5', fill: 'currentColor', key: 'nkw3mc' }],\n ['path', { d: 'm7.9 16.1 2.7-2.7', key: 'p81g5e' }],\n ['circle', { cx: '16.5', cy: '16.5', r: '.5', fill: 'currentColor', key: 'fubopw' }],\n ['path', { d: 'm13.4 13.4 2.7 2.7', key: 'abhel3' }],\n ['circle', { cx: '12', cy: '12', r: '2', key: '1c9p78' }],\n]);\n\nexport default Vault;\n"],"names":[],"mappings":"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 truncated
@@ -0,0 +1,108 @@
/**
* Recursive version of readdir. Exposes a streaming API and promise API.
* Streaming API allows to use a small amount of RAM.
*
* @module
* @example
```js
import readdirp from 'readdirp';
for await (const entry of readdirp('.')) {
const {path} = entry;
console.log(`${JSON.stringify({path})}`);
}
```
*/
/*! readdirp - MIT License (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com) */
import type { Stats, Dirent } from 'node:fs';
import { Readable } from 'node:stream';
/** Path in file system. */
export type Path = string;
/** Emitted entry. Contains relative & absolute path, basename, and either stats or dirent. */
export interface EntryInfo {
path: string;
fullPath: string;
stats?: Stats;
dirent?: Dirent;
basename: string;
}
/** Path or dir entries (files) */
export type PathOrDirent = Dirent | Path;
/** Filterer for files */
export type Tester = (entryInfo: EntryInfo) => boolean;
export type Predicate = string[] | string | Tester;
export declare const EntryTypes: {
readonly FILE_TYPE: "files";
readonly DIR_TYPE: "directories";
readonly FILE_DIR_TYPE: "files_directories";
readonly EVERYTHING_TYPE: "all";
};
export type EntryType = (typeof EntryTypes)[keyof typeof EntryTypes];
/**
* Options for readdirp.
* * type: files, directories, or both
* * lstat: whether to use symlink-friendly stat
* * depth: max depth
* * alwaysStat: whether to use stat (more resources) or dirent
* * highWaterMark: streaming param, specifies max amount of resources per entry
*/
export type ReaddirpOptions = {
root: string;
fileFilter?: Predicate;
directoryFilter?: Predicate;
type?: EntryType;
lstat?: boolean;
depth?: number;
alwaysStat?: boolean;
highWaterMark?: number;
};
/** Directory entry. Contains path, depth count, and files. */
export interface DirEntry {
files: PathOrDirent[];
depth: number;
path: Path;
}
/** Readable readdir stream, emitting new files as they're being listed. */
export declare class ReaddirpStream extends Readable {
parents: any[];
reading: boolean;
parent?: DirEntry;
_stat: Function;
_maxDepth: number;
_wantsDir: boolean;
_wantsFile: boolean;
_wantsEverything: boolean;
_root: Path;
_isDirent: boolean;
_statsProp: 'dirent' | 'stats';
_rdOptions: {
encoding: 'utf8';
withFileTypes: boolean;
};
_fileFilter: Tester;
_directoryFilter: Tester;
constructor(options?: Partial<ReaddirpOptions>);
_read(batch: number): Promise<void>;
_exploreDir(path: Path, depth: number): Promise<{
files: string[] | undefined;
depth: number;
path: string;
}>;
_formatEntry(dirent: PathOrDirent, path: Path): Promise<EntryInfo | undefined>;
_onError(err: Error): void;
_getEntryType(entry: EntryInfo): Promise<void | '' | 'file' | 'directory'>;
_includeAsFile(entry: EntryInfo): boolean | undefined;
}
/**
* Streaming version: Reads all files and directories in given root recursively.
* Consumes ~constant small amount of RAM.
* @param root Root directory
* @param options Options to specify root (start directory), filters and recursion depth
*/
export declare function readdirp(root: Path, options?: Partial<ReaddirpOptions>): ReaddirpStream;
/**
* Promise version: Reads all files and directories in given root recursively.
* Compared to streaming version, will consume a lot of RAM e.g. when 1 million files are listed.
* @returns array of paths and their entry infos
*/
export declare function readdirpPromise(root: Path, options?: Partial<ReaddirpOptions>): Promise<EntryInfo[]>;
export default readdirp;
@@ -0,0 +1,2 @@
const t={};class e{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,s);else for(let n=0;n<i;n++){const i=this.subscriptions[n];i&&i(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const s=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function i(e,i){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,c=s.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,i=!1,n=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(c.schedule(e),t()),e(a)}const c={schedule:(t,n=!1,a=!1)=>{const o=a&&i?e:s;return n&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,i)return void(n=!0);i=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),i=!1,n&&(n=!1,c.process(t))}};return c}(o),t),{}),{setup:h,read:d,resolveKeyframes:p,preUpdate:u,update:l,preRender:v,render:m,postRender:f}=c,g=()=>{const s=t.useManualTiming,o=s?a.timestamp:performance.now();n=!1,s||(a.delta=r?1e3/60:Math.max(Math.min(o-a.timestamp,40),1)),a.timestamp=o,a.isProcessing=!0,h.process(a),d.process(a),p.process(a),u.process(a),l.process(a),v.process(a),m.process(a),f.process(a),a.isProcessing=!1,n&&i&&(r=!1,e(g))};return{schedule:s.reduce((t,s)=>{const i=c[s];return t[s]=(t,s=!1,o=!1)=>(n||(n=!0,r=!0,a.isProcessing||e(g)),i.schedule(t,s,o)),t},{}),cancel:t=>{for(let e=0;e<s.length;e++)c[s[e]].cancel(t)},state:a,steps:c}}const{schedule:n,state:r}=i("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:t=>t,!0);let a;function o(){a=void 0}const c={now:()=>(void 0===a&&c.set(r.isProcessing||t.useManualTiming?r.timestamp:performance.now()),a),set:t=>{a=t,queueMicrotask(o)}},h={current:void 0};class d{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=c.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=c.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new e);const i=this.events[t].add(s);return"change"===t?()=>{i(),n.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return h.current&&h.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=c.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return s=parseFloat(this.current)-parseFloat(this.prevFrameValue),(i=e)?s*(1e3/i):0;var s,i}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function p(t,e){return new d(t,e)}export{d as MotionValue,h as collectMotionValues,p as motionValue};
//# sourceMappingURL=size-rollup-motion-value.js.map
@@ -0,0 +1,33 @@
/**
* @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 Telescope = createLucideIcon("Telescope", [
[
"path",
{
d: "m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",
key: "k4qptu"
}
],
["path", { d: "m13.56 11.747 4.332-.924", key: "19l80z" }],
["path", { d: "m16 21-3.105-6.21", key: "7oh9d" }],
[
"path",
{
d: "M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",
key: "m7xp4m"
}
],
["path", { d: "m6.158 8.633 1.114 4.456", key: "74o979" }],
["path", { d: "m8 21 3.105-6.21", key: "1fvxut" }],
["circle", { cx: "12", cy: "13", r: "2", key: "1c1ljs" }]
]);
export { Telescope as default };
//# sourceMappingURL=telescope.js.map
@@ -0,0 +1,56 @@
1.2.1 / 2019-05-10
==================
* Improve error when `str` is not a string
1.2.0 / 2016-06-01
==================
* Add `combine` option to combine overlapping ranges
1.1.0 / 2016-05-13
==================
* Fix incorrectly returning -1 when there is at least one valid range
* perf: remove internal function
1.0.3 / 2015-10-29
==================
* perf: enable strict mode
1.0.2 / 2014-09-08
==================
* Support Node.js 0.6
1.0.1 / 2014-09-07
==================
* Move repository to jshttp
1.0.0 / 2013-12-11
==================
* Add repository to package.json
* Add MIT license
0.0.4 / 2012-06-17
==================
* Change ret -1 for unsatisfiable and -2 when invalid
0.0.3 / 2012-06-17
==================
* Fix last-byte-pos default to len - 1
0.0.2 / 2012-06-14
==================
* Add `.type`
0.0.1 / 2012-06-11
==================
* Initial release
@@ -0,0 +1,40 @@
/**
* @license React
* react-jsx-dev-runtime.react-server.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
var React = require("react"),
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)
throw Error(
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
);
function jsxProd(type, config, maybeKey) {
var key = null;
void 0 !== maybeKey && (key = "" + maybeKey);
void 0 !== config.key && (key = "" + config.key);
if ("key" in config) {
maybeKey = {};
for (var propName in config)
"key" !== propName && (maybeKey[propName] = config[propName]);
} else maybeKey = config;
config = maybeKey.ref;
return {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
ref: void 0 !== config ? config : null,
props: maybeKey
};
}
exports.Fragment = REACT_FRAGMENT_TYPE;
exports.jsx = jsxProd;
exports.jsxDEV = void 0;
exports.jsxs = jsxProd;
@@ -0,0 +1,81 @@
/**
* Program is a reimplementation of the `qss` package:
* Copyright (c) Luke Edwards luke.edwards05@gmail.com, MIT License
* https://github.com/lukeed/qss/blob/master/license.md
*
* This reimplementation uses modern browser APIs
* (namely URLSearchParams) and TypeScript while still
* maintaining the original functionality and interface.
*
* Update: this implementation has also been mangled to
* fit exactly our use-case (single value per key in encoding).
*/
/**
* Encodes an object into a query string.
* @param obj - The object to encode into a query string.
* @param stringify - An optional custom stringify function.
* @returns The encoded query string.
* @example
* ```
* // Example input: encode({ token: 'foo', key: 'value' })
* // Expected output: "token=foo&key=value"
* ```
*/
export function encode(
obj: Record<string, any>,
stringify: (value: any) => string = String,
): string {
const result = new URLSearchParams()
for (const key in obj) {
const val = obj[key]
if (val !== undefined) {
result.set(key, stringify(val))
}
}
return result.toString()
}
/**
* Converts a string value to its appropriate type (string, number, boolean).
* @param mix - The string value to convert.
* @returns The converted value.
* @example
* // Example input: toValue("123")
* // Expected output: 123
*/
function toValue(str: unknown) {
if (!str) return ''
if (str === 'false') return false
if (str === 'true') return true
return +str * 0 === 0 && +str + '' === str ? +str : str
}
/**
* Decodes a query string into an object.
* @param str - The query string to decode.
* @returns The decoded key-value pairs in an object format.
* @example
* // Example input: decode("token=foo&key=value")
* // Expected output: { "token": "foo", "key": "value" }
*/
export function decode(str: any): any {
const searchParams = new URLSearchParams(str)
const result: Record<string, unknown> = Object.create(null)
for (const [key, value] of searchParams.entries()) {
const previousValue = result[key]
if (previousValue == null) {
result[key] = toValue(value)
} else if (Array.isArray(previousValue)) {
previousValue.push(toValue(value))
} else {
result[key] = [previousValue, toValue(value)]
}
}
return result
}
@@ -0,0 +1,64 @@
{
"name": "debug",
"version": "4.4.3",
"repository": {
"type": "git",
"url": "git://github.com/debug-js/debug.git"
},
"description": "Lightweight debugging utility for Node.js and the browser",
"keywords": [
"debug",
"log",
"debugger"
],
"files": [
"src",
"LICENSE",
"README.md"
],
"author": "Josh Junon (https://github.com/qix-)",
"contributors": [
"TJ Holowaychuk <tj@vision-media.ca>",
"Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
"Andrew Rhyne <rhyneandrew@gmail.com>"
],
"license": "MIT",
"scripts": {
"lint": "xo",
"test": "npm run test:node && npm run test:browser && npm run lint",
"test:node": "mocha test.js test.node.js",
"test:browser": "karma start --single-run",
"test:coverage": "cat ./coverage/lcov.info | coveralls"
},
"dependencies": {
"ms": "^2.1.3"
},
"devDependencies": {
"brfs": "^2.0.1",
"browserify": "^16.2.3",
"coveralls": "^3.0.2",
"karma": "^3.1.4",
"karma-browserify": "^6.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^1.3.0",
"mocha": "^5.2.0",
"mocha-lcov-reporter": "^1.2.0",
"sinon": "^14.0.0",
"xo": "^0.23.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
},
"main": "./src/index.js",
"browser": "./src/browser.js",
"engines": {
"node": ">=6.0"
},
"xo": {
"rules": {
"import/extensions": "off"
}
}
}
@@ -0,0 +1 @@
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../web/headers.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,aAAa,KAkCjB,CAAC;AAEH,eAAe,aAAa,CAAC"}
@@ -0,0 +1,26 @@
{
"rules": {
"generator-star": ["generator-star-spacing"],
"global-strict": ["strict"],
"no-arrow-condition": ["no-confusing-arrow", "no-constant-condition"],
"no-comma-dangle": ["comma-dangle"],
"no-empty-class": ["no-empty-character-class"],
"no-empty-label": ["no-labels"],
"no-extra-strict": ["strict"],
"no-reserved-keys": ["quote-props"],
"no-space-before-semi": ["semi-spacing"],
"no-wrap-func": ["no-extra-parens"],
"space-after-function-name": ["space-before-function-paren"],
"space-after-keywords": ["keyword-spacing"],
"space-before-function-parentheses": ["space-before-function-paren"],
"space-before-keywords": ["keyword-spacing"],
"space-in-brackets": [
"object-curly-spacing",
"array-bracket-spacing",
"computed-property-spacing"
],
"space-return-throw-case": ["keyword-spacing"],
"space-unary-word-ops": ["space-unary-ops"],
"spaced-line-comment": ["spaced-comment"]
}
}
@@ -0,0 +1,5 @@
export interface IConfig {
onError(e: Error): void;
}
export declare const config: IConfig;
export declare const setConfig: (conf: Partial<IConfig>) => void;
@@ -0,0 +1,22 @@
import { expect, test } from "vitest";
import { parsedType } from "../../util.js";
test("parsedType", () => {
expect(parsedType("string")).toBe("string");
expect(parsedType(1)).toBe("number");
expect(parsedType(true)).toBe("boolean");
expect(parsedType(null)).toBe("null");
expect(parsedType(undefined)).toBe("undefined");
expect(parsedType([])).toBe("array");
expect(parsedType({})).toBe("object");
expect(parsedType(new Date())).toBe("Date");
expect(parsedType(new Map())).toBe("Map");
expect(parsedType(new Set())).toBe("Set");
expect(parsedType(new Error())).toBe("Error");
const nullPrototype = Object.create(null);
expect(parsedType(nullPrototype)).toBe("object");
const doubleNullPrototype = Object.create(Object.create(null));
expect(parsedType(doubleNullPrototype)).toBe("object");
});
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"FD","8":"_HB"},B:{"1":"_I","129":"_K"},C:{"1":"_MO _L","8":"_g","129":"_YJ"},D:{"1":"_DJ _ZG","4":"J","129":"_zL"},E:{"1":"mB _RC _0I _wM","8":"_k","129":"A"},F:{"1":"_6 _wL _kH vB _2K","2":"F G YD","8":"_lN","129":"_KQ _kD"},G:{"1":"_OB","129":"_BB"},H:{"2":"1D"},I:{"1":"_G","129":"I"},J:{"1":"_B"},K:{"1":"_bD","8":"A","129":"H"},L:{"129":"I"},M:{"129":"YC"},N:{"1":"_A"},O:{"129":"bC"},P:{"1":"J","129":"_U"},Q:{"129":"JE"},R:{"129":"KE"},S:{"1":"LE","129":"ME"}},B:2,C:"Geolocation",D:true};
@@ -0,0 +1,617 @@
flf2a$ 6 4 6 -1 4
3x5 font by Richard Kirk (rak@crosfield.co.uk).
Ported to figlet, and slightly changed (without permission :-})
by Daniel Cabeza Gras (bardo@dia.fi.upm.es)
@
@
@
@
@
@@
@
# @
# @
# @
@
# @@
@
# # @
# # @
@
@
@@
@
# # @
### @
# # @
### @
# # @@
@
## @
## @
### @
## @
## @@
@
# # @
# @
# @
# @
# # @@
@
# @
# @
## @
# # @
### @@
@
# @
# @
# @
@
@@
@
# @
# @
# @
# @
# @@
@
# @
# @
# @
# @
# @@
@
# @
### @
# @
### @
# @@
@
@
# @
### @
# @
@@
@
@
@
@
# @
# @@
@
@
@
### @
@
@@
@
@
@
@
@
# @@
@
# @
# @
# @
# @
# @@
@
### @
# # @
# # @
# # @
### @@
@
# @
## @
# @
# @
### @@
@
### @
# @
### @
# @
### @@
@
### @
# @
## @
# @
### @@
@
# # @
# # @
### @
# @
# @@
@
### @
# @
### @
# @
### @@
@
### @
# @
### @
# # @
### @@
@
### @
# @
# @
# @
# @@
@
### @
# # @
### @
# # @
### @@
@
### @
# # @
### @
# @
### @@
@
@
# @
@
# @
@@
@
@
# @
@
# @
# @@
@
# @
# @
# @
# @
# @@
@
@
### @
@
### @
@@
@
# @
# @
# @
# @
# @@
@
### @
# @
## @
@
# @@
@
### @
# # @
# @
### @
@@
@
# @
# # @
### @
# # @
# # @@
@
## @
# # @
## @
# # @
## @@
@
## @
# @
# @
# @
## @@
@
## @
# # @
# # @
# # @
## @@
@
### @
# @
## @
# @
### @@
@
### @
# @
## @
# @
# @@
@
## @
# @
# # @
# # @
## @@
@
# # @
# # @
### @
# # @
# # @@
@
### @
# @
# @
# @
### @@
@
## @
# @
# @
# # @
# @@
@
# # @
# # @
## @
# # @
# # @@
@
# @
# @
# @
# @
### @@
@
# # @
### @
### @
# # @
# # @@
@
### @
# # @
# # @
# # @
# # @@
@
# @
# # @
# # @
# # @
# @@
@
## @
# # @
## @
# @
# @@
@
# @
# # @
# # @
## @
# @@
@
## @
# # @
## @
# # @
# # @@
@
## @
# @
# @
# @
## @@
@
### @
# @
# @
# @
# @@
@
# # @
# # @
# # @
# # @
### @@
@
# # @
# # @
# # @
# # @
# @@
@
# # @
# # @
### @
### @
# # @@
@
# # @
# # @
# @
# # @
# # @@
@
# # @
# # @
# @
# @
# @@
@
### @
# @
# @
# @
### @@
@
## @
# @
# @
# @
## @@
@
# @
# @
# @
# @
# @@
@
## @
# @
# @
# @
## @@
@
# @
# # @
@
@
@@
@
@
@
@
@
### @@
@
# @
# @
# @
@
@@
@
@
## @
# # @
### @
@@
@
# @
### @
# # @
### @
@@
@
@
### @
# @
### @
@@
@
# @
### @
# # @
### @
@@
@
@
### @
## @
### @
@@
@
## @
# @
### @
# @
## @@
@
@
### @
# # @
## @
### @@
@
# @
### @
# # @
# # @
@@
@
# @
@
# @
## @
@@
@
# @
@
# @
# @
# @@
@
# @
# # @
## @
# # @
@@
@
# @
# @
# @
## @
@@
@
@
### @
### @
# # @
@@
@
@
## @
# # @
# # @
@@
@
@
### @
# # @
### @
@@
@
@
### @
# # @
### @
# @@
@
@
### @
# # @
### @
# @@
@
@
### @
# @
# @
@@
@
@
## @
# @
## @
@@
@
# @
### @
# @
## @
@@
@
@
# # @
# # @
### @
@@
@
@
# # @
# # @
# @
@@
@
@
# # @
### @
### @
@@
@
@
# # @
# @
# # @
@@
@
@
# # @
### @
# @
### @@
@
@
## @
# @
## @
@@
@
## @
# @
## @
# @
## @@
@
# @
# @
# @
# @
# @@
@
## @
# @
## @
# @
## @@
@
# @
### @
# @
@
@@
@
# # @
# @
# # @
### @
# # @@
@
# # @
### @
# # @
# # @
### @@
@
# # @
@
# # @
# # @
### @@
@
# # @
## @
# # @
### @
@@
@
# # @
### @
# # @
### @
@@
@
# # @
@
# # @
### @
@@
@
### @
## @
# # @
## @
# @@
@@ -0,0 +1,175 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
/**
* This transform strips all Flow types.
*
* It is expected that all transforms create valid ESTree AST output. If
* the transform requires outputting Babel specific AST nodes then it
* should live in `ConvertESTreeToBabel.js`
*/
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.transformProgram = transformProgram;
var _SimpleTransform = require("../transform/SimpleTransform");
const nodeWith = _SimpleTransform.SimpleTransform.nodeWith;
function transformProgram(program, _options) {
return _SimpleTransform.SimpleTransform.transformProgram(program, {
transform(node) {
switch (node.type) {
case 'AsExpression':
case 'AsConstExpression':
case 'TypeCastExpression':
{
return node.expression;
}
case 'CallExpression':
case 'NewExpression':
{
if (node.typeArguments != null) {
return nodeWith(node, {
typeArguments: null
});
}
return node;
}
case 'ObjectPattern':
case 'ArrayPattern':
case 'Identifier':
{
if (node.typeAnnotation != null) {
return nodeWith(node, {
typeAnnotation: null
});
}
return node;
}
case 'DeclareClass':
case 'DeclareFunction':
case 'DeclareInterface':
case 'DeclareModule':
case 'DeclareModuleExports':
case 'DeclareNamespace':
case 'DeclareOpaqueType':
case 'DeclareTypeAlias':
case 'DeclareVariable':
case 'InterfaceDeclaration':
case 'OpaqueType':
case 'TypeAlias':
{
return null;
}
case 'FunctionDeclaration':
case 'ArrowFunctionExpression':
case 'FunctionExpression':
{
const newParams = [];
for (let i = 0; i < node.params.length; i++) {
if (i === 0 && node.params[0].type === 'Identifier' && node.params[0].name === 'this') {
continue;
}
let param = node.params[i];
if (param.type === 'AssignmentPattern') {
param = param.left;
}
if (param.optional === true) {
param = nodeWith(param, {
optional: false
});
}
newParams.push(param);
}
return nodeWith(node, {
params: newParams,
returnType: null,
typeParameters: null,
predicate: null
});
}
case 'ClassDeclaration':
case 'ClassExpression':
{
return nodeWith(node, {
typeParameters: null,
superTypeParameters: null,
implements: [],
decorators: []
});
}
case 'PropertyDefinition':
{
return nodeWith(node, {
typeAnnotation: null,
variance: null,
declare: false,
optional: false
});
}
case 'ImportDeclaration':
{
if (node.importKind === 'type' || node.importKind === 'typeof') {
return null;
}
const nonTypeSpecifiers = node.specifiers.filter(s => s.type !== 'ImportSpecifier' || s.importKind !== 'type' && s.importKind !== 'typeof');
if (nonTypeSpecifiers.length === 0) {
return null;
}
if (nonTypeSpecifiers.length === node.specifiers.length) {
return node;
}
return nodeWith(node, {
specifiers: nonTypeSpecifiers
});
}
case 'ExportAllDeclaration':
case 'ExportNamedDeclaration':
{
if (node.exportKind === 'type') {
return null;
}
return node;
}
default:
{
return node;
}
}
}
});
}
@@ -0,0 +1,934 @@
flf2a$ 9 9 40 1 15
Mega-relief by Nick Bryant 12/9, dmc1@st-and.ac.uk for the moment.
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be `a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
9 - height of a character
9 - height of a character, not including descenders
40 - max line length (excluding comment lines) + a fudge factor
0 - default smushmode for this font
15 - number of comment lines
___________ @
___________ @
___________ @
___________ @
___________ @
___________ @
___________ @
___________ @
___________ @@
_____/\\\____ @
___/\\\\\\\__ @
__/\\\\\\\\\_ @
_\//\\\\\\\__ @
__\//\\\\\___ @
___\//\\\____ @
____\///_____ @
_____/\\\____ @
____\///_____@@
__/\\/\\_ @
_\/\\/\\_ @
_\//\//__ @
_________ @
_________ @
_________ @
_________ @
_________ @
_________@@
____/\\\__/\\\___ @
___\/\\\_\/\\\___ @
__/\\\\\\\\\\\\\_ @
_\///\\\///\\\/__ @
___\/\\\_\/\\\___ @
__/\\\\\\\\\\\\\_ @
_\///\\\///\\\/__ @
___\/\\\_\/\\\___ @
___\///__\///____@@
________/\\\_______ @
____/\\\\\\\\\\\___ @
__/\\\///\\\////\\_ @
_\////\\\\\\__\//__ @
____\////\\\\\\____ @
__/\\__\/\\\///\\\_ @
_\///\\\\\\\\\\\/__ @
___\/////\\\///___ @
_______\///________@@
____/\\\________/\\\_ @
___/\\/\\_____/\\\/__ @
__\//\\\____/\\\/____ @
___\///___/\\\/______ @
________/\\\/________ @
______/\\\/___/\\\___ @
____/\\\/____/\\/\\__ @
__/\\\/_____\//\\\___ @
_\///________\///___ @@
___________/\\\_______ @
________/\\\//\\\_____ @
_______/\\\_/\\\______ @
______\//\\\\//_______ @
_____/\\\///\\\_______ @
___/\\\/__\///\\\/\\\_ @
__/\\\______\//\\\//__ @
_\//\\\\\\\\\\\//\\\__ @
__\///////////_\///___@@
__/\\\\_ @
_\///\\_ @
__/\\/__ @
_\//____ @
________ @
________ @
________ @
________ @
________@@
______/\\\_ @
____/\\\/__ @
___/\\\____ @
__/\\\_____ @
_\/\\\_____ @
_\//\\\____ @
__\//\\\___ @
___\///\\\_ @
_____\///__@@
__/\\\_____ @
_\///\\\___ @
___\//\\\__ @
____\//\\\_ @
_____\/\\\_ @
_____/\\\__ @
____/\\\___ @
__/\\\/____ @
_\///______@@
________/\\\_______ @
__/\\\_\/\\\__/\\\_ @
_\////\\\\\\\\\//__ @
____\////\\\//_____ @
_____/\\\\\\\\\____ @
__/\\\///\\\///\\\_ @
_\///__\/\\\_\///__ @
_______\///________ @
___________________@@
_______________ @
_______________ @
______/\\\_____ @
_____\/\\\_____ @
__/\\\\\\\\\\\_ @
_\/////\\\///__ @
_____\/\\\_____ @
_____\///______ @
_______________@@
________ @
________ @
________ @
________ @
________ @
__/\\\\_ @
_\///\\_ @
__/\\/__ @
_\//____@@
_______________ @
_______________ @
_______________ @
__/\\\\\\\\\\\_ @
_\///////////__ @
_______________ @
_______________ @
_______________ @
_______________@@
_______ @
_______ @
_______ @
_______ @
_______ @
_______ @
_______ @
__/\\\_ @
_\///__@@
________________/\\\_ @
______________/\\\/__ @
____________/\\\/____ @
__________/\\\/______ @
________/\\\/________ @
______/\\\/__________ @
____/\\\/____________ @
__/\\\/______________ @
_\///________________@@
_____/\\\\\\\____ @
___/\\\/////\\\__ @
__/\\\____\//\\\_ @
_\/\\\_____\/\\\_ @
_\/\\\_____\/\\\_ @
_\/\\\_____\/\\\_ @
_\//\\\____/\\\__ @
__\///\\\\\\\/___ @
____\///////_____@@
______/\\\_ @
__/\\\\\\\_ @
_\/////\\\_ @
_____\/\\\_ @
_____\/\\\_ @
_____\/\\\_ @
_____\/\\\_ @
_____\/\\\_ @
_____\///_ @@
____/\\\\\\\\\_____ @
__/\\\///////\\\___ @
_\///______\//\\\__ @
___________/\\\/___ @
________/\\\//_____ @
_____/\\\//________ @
___/\\\/___________ @
__/\\\\\\\\\\\\\\\_ @
_\///////////////__@@
_____/\\\\\\\\\\__ @
___/\\\///////\\\_ @
__\///______/\\\__ @
_________/\\\//___ @
________\////\\\__ @
___________\//\\\_ @
__/\\\______/\\\__ @
_\///\\\\\\\\\/___ @
___\/////////_____@@
____________/\\\____ @
__________/\\\\\____ @
________/\\\/\\\____ @
______/\\\/\/\\\____ @
____/\\\/__\/\\\____ @
__/\\\\\\\\\\\\\\\\_ @
_\///////////\\\//__ @
___________\/\\\____ @
___________\///_____@@
___/\\\\\\\\\\\\\\\_ @
__\/\\\///////////__ @
__\/\\\_____________ @
__\/\\\\\\\\\\\\_____ @
__\////////////\\\___ @
_____________\//\\\__ @
__/\\\________\/\\\__ @
_\//\\\\\\\\\\\\\/___ @
__\/////////////_____@@
____________/\\\\\_ @
________/\\\\////__ @
_____/\\\///_______ @
___/\\\\\\\\\\\____ @
__/\\\\///////\\\__ @
_\/\\\______\//\\\_ @
_\//\\\______/\\\__ @
__\///\\\\\\\\\/___ @
____\/////////_____@@
__/\\\\\\\\\\\\\\\_ @
_\/////////////\\\_ @
____________/\\\/__ @
__________/\\\/____ @
________/\\\/______ @
______/\\\/________ @
____/\\\/__________ @
__/\\\/____________ @
_\///______________@@
_____/\\\\\\\\\____ @
___/\\\///////\\\__ @
__\/\\\_____\/\\\__ @
__\///\\\\\\\\\/___ @
___/\\\///////\\\__ @
__/\\\______\//\\\_ @
_\//\\\______/\\\__ @
__\///\\\\\\\\\/___ @
____\/////////_____@@
______/\\\\\\\\\____ @
____/\\\///////\\\__ @
___/\\\______\//\\\_ @
__\//\\\_____/\\\\\_ @
___\///\\\\\\\\/\\\_ @
_____\////////\/\\\_ @
___/\\________/\\\__ @
__\//\\\\\\\\\\\/___ @
___\///////////_____@@
_______ @
_______ @
_______ @
_______ @
__/\\\_ @
_\///__ @
_______ @
__/\\\_ @
_\///__@@
________ @
________ @
________ @
__/\\\__ @
_\///___ @
__/\\\\_ @
_\///\\_ @
__/\\/__ @
_\//____@@
________________ @
___________/\\\_ @
________/\\\//__ @
_____/\\\//_____ @
__/\\\//________ @
_\////\\\_______ @
____\////\\\____ @
_______\////\\\_ @
__________\///__@@
______________ @
______________ @
______________ @
__/\\\\\\\\\\_ @
_\//////////__ @
__/\\\\\\\\\\_ @
_\//////////__ @
______________ @
______________@@
________________ @
__/\\\__________ @
_\////\\\_______ @
____\////\\\____ @
_______\////\\\_ @
________/\\\//__ @
_____/\\\//_____ @
__/\\\//________ @
_\///___________@@
____/\\\\\\\____ @
_/\\\//////\\\__ @
\///_____\//\\\_ @
__________/\\\__ @
_______/\\\\/___ @
______/\\\/_____ @
_____\///_______ @
______/\\\______ @
_____\///_______@@
____/\\\\\\\\\\____ @
__/\\\////////\\\__ @
_\/\\\__/\\\\\\\\\_ @
_\/\\\_\/\\\///\\\_ @
_\/\\\_\/\\\\\\\\__ @
_\/\\\_\////////___ @
_\//\\\____________ @
__\///\\\\\\\\\\\\_ @
____\////////////__@@
_____/\\\\\\\\\____ @
___/\\\\\\\\\\\\\__ @
__/\\\/////////\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\\\\\\\\\\\\\_ @
_\/\\\/////////\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\///________\///__@@
__/\\\\\\\\\\\\\___ @
_\/\\\/////////\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\\\\\\\\\\\\__ @
_\/\\\/////////\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\\\\\\\\\\\/__ @
_\/////////////____@@
________/\\\\\\\\\_ @
_____/\\\////////__ @
___/\\\/___________ @
__/\\\_____________ @
_\/\\\_____________ @
_\//\\\____________ @
__\///\\\__________ @
____\////\\\\\\\\\_ @
_______\/////////__@@
__/\\\\\\\\\\\\____ @
_\/\\\////////\\\__ @
_\/\\\______\//\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______/\\\__ @
_\/\\\\\\\\\\\\/___ @
_\////////////_____@@
__/\\\\\\\\\\\\\\\_ @
_\/\\\///////////__ @
_\/\\\_____________ @
_\/\\\\\\\\\\\_____ @
_\/\\\///////______ @
_\/\\\_____________ @
_\/\\\_____________ @
_\/\\\\\\\\\\\\\\\_ @
_\///////////////__@@
__/\\\\\\\\\\\\\\\_ @
_\/\\\///////////__ @
_\/\\\_____________ @
_\/\\\\\\\\\\\_____ @
_\/\\\///////______ @
_\/\\\_____________ @
_\/\\\_____________ @
_\/\\\_____________ @
_\///______________@@
_____/\\\\\\\\\\\\_ @
___/\\\//////////__ @
__/\\\_____________ @
_\/\\\____/\\\\\\\_ @
_\/\\\___\/////\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\//\\\\\\\\\\\\/__ @
__\////////////____@@
__/\\\________/\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\\\\\\\\\\\\\_ @
_\/\\\/////////\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\///________\///__@@
__/\\\\\\\\\\\_ @
_\/////\\\///__ @
_____\/\\\_____ @
_____\/\\\_____ @
_____\/\\\_____ @
_____\/\\\_____ @
_____\/\\\_____ @
__/\\\\\\\\\\\_ @
_\///////////__@@
______/\\\\\\\\\\\_ @
_____\/////\\\///__ @
_________\/\\\_____ @
_________\/\\\_____ @
_________\/\\\_____ @
_________\/\\\_____ @
__/\\\___\/\\\_____ @
_\//\\\\\\\\\______ @
__\/////////_______@@
__/\\\________/\\\_ @
_\/\\\_____/\\\//__ @
_\/\\\__/\\\//_____ @
_\/\\\\\\//\\\_____ @
_\/\\\//_\//\\\____ @
_\/\\\____\//\\\___ @
_\/\\\_____\//\\\__ @
_\/\\\______\//\\\_ @
_\///________\///__@@
__/\\\_____________ @
_\/\\\_____________ @
_\/\\\_____________ @
_\/\\\_____________ @
_\/\\\_____________ @
_\/\\\_____________ @
_\/\\\_____________ @
_\/\\\\\\\\\\\\\\\_ @
_\///////////////__@@
__/\\\\____________/\\\\_ @
_\/\\\\\\________/\\\\\\_ @
_\/\\\//\\\____/\\\//\\\_ @
_\/\\\\///\\\/\\\/_\/\\\_ @
_\/\\\__\///\\\/___\/\\\_ @
_\/\\\____\///_____\/\\\_ @
_\/\\\_____________\/\\\_ @
_\/\\\_____________\/\\\_ @
_\///______________\///__@@
__/\\\\\_____/\\\_ @
_\/\\\\\\___\/\\\_ @
_\/\\\/\\\__\/\\\_ @
_\/\\\//\\\_\/\\\_ @
_\/\\\\//\\\\/\\\_ @
_\/\\\_\//\\\/\\\_ @
_\/\\\__\//\\\\\\_ @
_\/\\\___\//\\\\\_ @
_\///_____\/////__@@
_______/\\\\\______ @
_____/\\\///\\\____ @
___/\\\/__\///\\\__ @
__/\\\______\//\\\_ @
_\/\\\_______\/\\\_ @
_\//\\\______/\\\__ @
__\///\\\__/\\\____ @
____\///\\\\\/_____ @
______\/////_______@@
__/\\\\\\\\\\\\\___ @
_\/\\\/////////\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\\\\\\\\\\\/__ @
_\/\\\/////////____ @
_\/\\\_____________ @
_\/\\\_____________ @
_\/\\\_____________ @
_\///______________@@
________/\\\_______ @
_____/\\\\/\\\\____ @
___/\\\//\////\\\__ @
__/\\\______\//\\\_ @
_\//\\\______/\\\__ @
__\///\\\\/\\\\/___ @
____\////\\\//_____ @
_______\///\\\\\\__ @
_________\//////___@@
____/\\\\\\\\\_____ @
__/\\\///////\\\___ @
_\/\\\_____\/\\\___ @
_\/\\\\\\\\\\\/____ @
_\/\\\//////\\\____ @
_\/\\\____\//\\\___ @
_\/\\\_____\//\\\__ @
_\/\\\______\//\\\_ @
_\///________\///__@@
_____/\\\\\\\\\\\___ @
___/\\\/////////\\\_ @
__\//\\\______\///__ @
___\////\\\_________ @
______\////\\\______ @
_________\////\\\___ @
__/\\\______\//\\\__ @
_\///\\\\\\\\\\\/___ @
___\///////////_____@@
__/\\\\\\\\\\\\\\\_ @
_\///////\\\/////__ @
_______\/\\\_______ @
_______\/\\\_______ @
_______\/\\\_______ @
_______\/\\\_______ @
_______\/\\\_______ @
_______\/\\\_______ @
_______\///________@@
__/\\\________/\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\/\\\_______\/\\\_ @
_\//\\\______/\\\__ @
__\///\\\\\\\\\/___ @
____\/////////_____@@
__/\\\________/\\\_ @
_\/\\\_______\/\\\_ @
_\//\\\______/\\\__ @
__\//\\\____/\\\___ @
___\//\\\__/\\\____ @
____\//\\\/\\\_____ @
_____\//\\\\\______ @
______\//\\\_______ @
_______\///________@@
__/\\\______________/\\\_ @
_\/\\\_____________\/\\\_ @
_\/\\\_____________\/\\\_ @
_\//\\\____/\\\____/\\\__ @
__\//\\\__/\\\\\__/\\\___ @
___\//\\\/\\\/\\\/\\\____ @
____\//\\\\\\//\\\\\_____ @
_____\//\\\__\//\\\______ @
______\///____\///_______@@
__/\\\_______/\\\_ @
_\///\\\___/\\\/__ @
___\///\\\\\\/____ @
_____\//\\\\______ @
______\/\\\\______ @
______/\\\\\\_____ @
____/\\\////\\\___ @
__/\\\/___\///\\\_ @
_\///_______\///__@@
__/\\\________/\\\_ @
_\///\\\____/\\\/__ @
___\///\\\/\\\/____ @
_____\///\\\/______ @
_______\/\\\_______ @
_______\/\\\_______ @
_______\/\\\_______ @
_______\/\\\_______ @
_______\///________@@
__/\\\\\\\\\\\\\\\_ @
_\////////////\\\__ @
___________/\\\/___ @
_________/\\\/_____ @
_______/\\\/_______ @
_____/\\\/_________ @
___/\\\/___________ @
__/\\\\\\\\\\\\\\\_ @
_\///////////////__@@
__/\\\\\\_ @
_\/\\\//__ @
_\/\\\____ @
_\/\\\____ @
_\/\\\____ @
_\/\\\____ @
_\/\\\____ @
_\/\\\\\\_ @
_\//////__@@
__/\\\_______________ @
_\///\\\_____________ @
___\///\\\___________ @
_____\///\\\_________ @
_______\///\\\_______ @
_________\///\\\_____ @
___________\///\\\___ @
_____________\///\\\_ @
_______________\///__@@
__/\\\\\\_ @
_\////\\\_ @
____\/\\\_ @
____\/\\\_ @
____\/\\\_ @
____\/\\\_ @
____\/\\\_ @
__/\\\\\\_ @
_\//////__@@
____/\\\___ @
___/\\/\\__ @
__/\\\//\\_ @
_\//__\//__ @
___________ @
___________ @
___________ @
___________ @
___________@@
___________________ @
___________________ @
___________________ @
___________________ @
___________________ @
___________________ @
___________________ @
__/\\\\\\\\\\\\\\\_ @
_\///////////////__@@
____/\\_ @
__/\\/__ @
_\/\\\\_ @
_\////__ @
________ @
________ @
________ @
________ @
________@@
________________ @
________________ @
________________ @
__/\\\\\\\\\____ @
_\////////\\\___ @
___/\\\\\\\\\\__ @
__/\\\/////\\\__ @
_\//\\\\\\\\/\\_ @
__\////////\//__@@
__/\\\________ @
_\/\\\________ @
_\/\\\________ @
_\/\\\________ @
_\/\\\\\\\\\__ @
_\/\\\////\\\_ @
_\/\\\__\/\\\_ @
_\/\\\\\\\\\__ @
_\/////////___@@
_______________ @
_______________ @
_______________ @
_____/\\\\\\\\_ @
___/\\\//////__ @
__/\\\_________ @
_\//\\\________ @
__\///\\\\\\\\_ @
____\////////__@@
_________/\\\__ @
________\/\\\__ @
________\/\\\__ @
________\/\\\__ @
___/\\\\\\\\\__ @
__/\\\////\\\__ @
_\/\\\__\/\\\__ @
_\//\\\\\\\/\\_ @
__\///////\//__@@
________________ @
________________ @
________________ @
_____/\\\\\\\\__ @
___/\\\/////\\\_ @
__/\\\\\\\\\\\__ @
_\//\\///////___ @
__\//\\\\\\\\\\_ @
___\//////////__@@
________/\\\\\_ @
______/\\\///__ @
_____/\\\______ @
__/\\\\\\\\\___ @
_\////\\\//____ @
____\/\\\______ @
____\/\\\______ @
____\/\\\______ @
____\///_______@@
______________ @
______________ @
___/\\\\\\\\__ @
__/\\\////\\\_ @
_\//\\\\\\\\\_ @
__\///////\\\_ @
__/\\_____\\\_ @
_\//\\\\\\\\__ @
__\////////___@@
__/\\\_________ @
_\/\\\_________ @
_\/\\\_________ @
_\/\\\_________ @
_\/\\\\\\\\\\__ @
_\/\\\/////\\\_ @
_\/\\\___\/\\\_ @
_\/\\\___\/\\\_ @
_\///____\///__@@
_______ @
_______ @
__/\\\_ @
_\///__ @
__/\\\_ @
_\/\\\_ @
_\/\\\_ @
_\/\\\_ @
_\///__@@
____________ @
_______/\\\_ @
______\///__ @
_______/\\\_ @
______\/\\\_ @
______\/\\\_ @
__/\\_\/\\\_ @
_\//\\\\\\__ @
__\//////___@@
_______________ @
__/\\\_________ @
_\/\\\_________ @
_\/\\\\\\\\____ @
_\/\\\////\\\__ @
_\/\\\\\\\\/___ @
_\/\\\///\\\___ @
_\/\\\_\///\\\_ @
_\///____\///__@@
__/\\\\\\____ @
_\////\\\____ @
____\/\\\____ @
____\/\\\____ @
____\/\\\____ @
____\/\\\____ @
____\/\\\____ @
__/\\\\\\\\\_ @
_\/////////__@@
_____________________ @
_____________________ @
_____________________ @
____/\\\\\__/\\\\\___ @
__/\\\///\\\\\///\\\_ @
_\/\\\_\//\\\__\/\\\_ @
_\/\\\__\/\\\__\/\\\_ @
_\/\\\__\/\\\__\/\\\_ @
_\///___\///___\///__@@
_______________ @
_______________ @
_______________ @
__/\\/\\\\\\___ @
_\/\\\////\\\__ @
_\/\\\__\//\\\_ @
_\/\\\___\/\\\_ @
_\/\\\___\/\\\_ @
_\///____\///__@@
_______________ @
_______________ @
_______________ @
_____/\\\\\____ @
___/\\\///\\\__ @
__/\\\__\//\\\_ @
_\//\\\__/\\\__ @
__\///\\\\\/___ @
____\/////_____@@
_______________ @
_______________ @
___/\\\\\\\\\__ @
__/\\\/////\\\_ @
_\/\\\\\\\\\\__ @
_\/\\\//////___ @
_\/\\\_________ @
_\/\\\_________ @
_\///__________@@
_______________ @
_______________ @
___/\\\\\\\\___ @
__/\\\////\\\__ @
_\//\\\\\\\\\__ @
__\///////\\\__ @
________\/\\\__ @
________\/\\\\_ @
________\////__@@
_______________ @
_______________ @
_______________ @
__/\\/\\\\\\\__ @
_\/\\\/////\\\_ @
_\/\\\___\///__ @
_\/\\\_________ @
_\/\\\_________ @
_\///__________@@
______________ @
______________ @
______________ @
__/\\\\\\\\\\_ @
_\/\\\//////__ @
_\/\\\\\\\\\\_ @
_\////////\\\_ @
__/\\\\\\\\\\_ @
_\//////////__@@
_______________ @
_______________ @
_____/\\\______ @
__/\\\\\\\\\\\_ @
_\////\\\////__ @
____\/\\\______ @
____\/\\\_/\\__ @
____\//\\\\\___ @
_____\/////____@@
_______________ @
_______________ @
_______________ @
__/\\\____/\\\_ @
_\/\\\___\/\\\_ @
_\/\\\___\/\\\_ @
_\/\\\___\/\\\_ @
_\//\\\\\\\\\__ @
__\/////////___@@
_______________ @
_______________ @
_______________ @
__/\\\____/\\\_ @
_\//\\\__/\\\__ @
__\//\\\/\\\___ @
___\//\\\\\____ @
____\//\\\_____ @
_____\///______@@
___________________ @
___________________ @
___________________ @
__/\\____/\\___/\\_ @
_\/\\\__/\\\\_/\\\_ @
_\//\\\/\\\\\/\\\__ @
__\//\\\\\/\\\\\___ @
___\//\\\\//\\\____ @
____\///__\///_____@@
_______________ @
_______________ @
_______________ @
__/\\\____/\\\_ @
_\///\\\/\\\/__ @
___\///\\\/____ @
____/\\\/\\\___ @
__/\\\/\///\\\_ @
_\///____\///__@@
_______________ @
_______________ @
____/\\\__/\\\_ @
___\//\\\/\\\__ @
____\//\\\\\___ @
_____\//\\\____ @
__/\\_/\\\_____ @
_\//\\\\/______ @
__\////________@@
_______________ @
_______________ @
_______________ @
__/\\\\\\\\\\\_ @
_\///////\\\/__ @
______/\\\/____ @
____/\\\/______ @
__/\\\\\\\\\\\_ @
_\///////////__@@
______________ @
_______/\\\\\_ @
_____/\\\///__ @
____\//\\\____ @
__/\\\\\\_____ @
_\/////\\\____ @
_____/\\\_____ @
____\///\\\\\_ @
______\/////__@@
__/\\\_ @
_\/\\\_ @
_\/\\\_ @
_\///__ @
_______ @
__/\\\_ @
_\/\\\_ @
_\/\\\_ @
_\///__@@
_____________ @
__/\\\\\_____ @
_\////\\\____ @
____/\\\_____ @
___\//\\\\\\_ @
____/\\\///__ @
___\//\\\____ @
__/\\\\\_____ @
_\/////______@@
___________________ @
___________________ @
____/\\\\\_________ @
__/\\\///\\\__/\\\_ @
_\///__\///\\\\\/__ @
_________\/////____ @
___________________ @
___________________ @
___________________@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/focus-scope.tsx"],
"sourcesContent": ["import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\nconst AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';\nconst AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\ntype FocusableTarget = HTMLElement | { focus(): void };\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope\n * -----------------------------------------------------------------------------------------------*/\n\nconst FOCUS_SCOPE_NAME = 'FocusScope';\n\ntype FocusScopeElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface FocusScopeProps extends PrimitiveDivProps {\n /**\n * When `true`, tabbing from last item will focus first tabbable\n * and shift+tab from first item will focus last tababble.\n * @defaultValue false\n */\n loop?: boolean;\n\n /**\n * When `true`, focus cannot escape the focus scope via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapped?: boolean;\n\n /**\n * Event handler called when auto-focusing on mount.\n * Can be prevented.\n */\n onMountAutoFocus?: (event: Event) => void;\n\n /**\n * Event handler called when auto-focusing on unmount.\n * Can be prevented.\n */\n onUnmountAutoFocus?: (event: Event) => void;\n}\n\nconst FocusScope = React.forwardRef<FocusScopeElement, FocusScopeProps>((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState<HTMLElement | null>(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef<HTMLElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n },\n }).current;\n\n // Takes care of trapping focus if focus is moved outside programmatically for example\n React.useEffect(() => {\n if (trapped) {\n function handleFocusIn(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const target = event.target as HTMLElement | null;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n function handleFocusOut(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget as HTMLElement | null;\n\n // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:\n //\n // 1. When the user switches app/tabs/windows/the browser itself loses focus.\n // 2. In Google Chrome, when the focused element is removed from the DOM.\n //\n // We let the browser do its thing here because:\n //\n // 1. The browser already keeps a memory of what's focused for when the page gets refocused.\n // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it\n // throws the CPU to 100%, so we avoid doing anything for this reason here too.\n if (relatedTarget === null) return;\n\n // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)\n // that is outside the container, we move focus to the last valid focused element inside.\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n // When the focused element gets removed from the DOM, browsers move focus\n // back to the document.body. In this case, we move focus to the container\n // to keep focus trapped correctly.\n function handleMutations(mutations: MutationRecord[]) {\n const focusedElement = document.activeElement as HTMLElement | null;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n }\n\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n const mutationObserver = new MutationObserver(handleMutations);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n\n return Line truncated
"mappings": "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 truncated
"names": ["handleFocusIn", "handleFocusOut", "handleMutations", "container"]
}
@@ -0,0 +1 @@
{"version":3,"file":"megaphone.js","sources":["../../../src/icons/megaphone.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Megaphone\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMyAxMSAxOC01djEyTDMgMTR2LTN6IiAvPgogIDxwYXRoIGQ9Ik0xMS42IDE2LjhhMyAzIDAgMSAxLTUuOC0xLjYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/megaphone\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 Megaphone = createLucideIcon('Megaphone', [\n ['path', { d: 'm3 11 18-5v12L3 14v-3z', key: 'n962bs' }],\n ['path', { d: 'M11.6 16.8a3 3 0 1 1-5.8-1.6', key: '1yl0tm' }],\n]);\n\nexport default Megaphone;\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,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACvD,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;AAC/D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,52 @@
import * as core from "./core.js";
import * as errors from "./errors.js";
import type * as schemas from "./schemas.js";
import * as util from "./util.js";
export type $ZodErrorClass = {
new (issues: errors.$ZodIssue[]): errors.$ZodError;
};
type $ParseParams = {
callee?: util.AnyFunc;
Err?: $ZodErrorClass | undefined;
};
export type $Parse = <T extends schemas.$ZodType>(schema: T, value: unknown, _ctx?: schemas.ParseContext<errors.$ZodIssue>, _params?: $ParseParams) => core.output<T>;
export declare const _parse: (_Err: $ZodErrorClass) => $Parse;
export declare const parse: $Parse;
export type $ParseAsync = <T extends schemas.$ZodType>(schema: T, value: unknown, _ctx?: schemas.ParseContext<errors.$ZodIssue>, _params?: $ParseParams) => Promise<core.output<T>>;
export declare const _parseAsync: (_Err: $ZodErrorClass) => $ParseAsync;
export declare const parseAsync: $ParseAsync;
export type $SafeParse = <T extends schemas.$ZodType>(schema: T, value: unknown, _ctx?: schemas.ParseContext<errors.$ZodIssue>) => util.SafeParseResult<core.output<T>>;
export declare const _safeParse: (_Err: $ZodErrorClass) => $SafeParse;
export declare const safeParse: $SafeParse;
export type $SafeParseAsync = <T extends schemas.$ZodType>(schema: T, value: unknown, _ctx?: schemas.ParseContext<errors.$ZodIssue>) => Promise<util.SafeParseResult<core.output<T>>>;
export declare const _safeParseAsync: (_Err: $ZodErrorClass) => $SafeParseAsync;
export declare const safeParseAsync: $SafeParseAsync;
export type $Validate = <T extends schemas.$ZodType>(schema: T, value: unknown, _ctx?: schemas.ParseContext<errors.$ZodIssue>) => value is core.input<T>;
export declare const validate: $Validate;
export type $ValidateAsync = <T extends schemas.$ZodType>(schema: T, value: unknown, _ctx?: schemas.ParseContext<errors.$ZodIssue>) => Promise<boolean>;
export declare const validateAsync: $ValidateAsync;
export type $Encode = <T extends schemas.$ZodType>(schema: T, value: core.output<T>, _ctx?: schemas.ParseContext<errors.$ZodIssue>, _params?: $ParseParams) => core.input<T>;
export declare const _encode: (_Err: $ZodErrorClass) => $Encode;
export declare const encode: $Encode;
export type $Decode = <T extends schemas.$ZodType>(schema: T, value: core.input<T>, _ctx?: schemas.ParseContext<errors.$ZodIssue>, _params?: $ParseParams) => core.output<T>;
export declare const _decode: (_Err: $ZodErrorClass) => $Decode;
export declare const decode: $Decode;
export type $EncodeAsync = <T extends schemas.$ZodType>(schema: T, value: core.output<T>, _ctx?: schemas.ParseContext<errors.$ZodIssue>, _params?: $ParseParams) => Promise<core.input<T>>;
export declare const _encodeAsync: (_Err: $ZodErrorClass) => $EncodeAsync;
export declare const encodeAsync: $EncodeAsync;
export type $DecodeAsync = <T extends schemas.$ZodType>(schema: T, value: core.input<T>, _ctx?: schemas.ParseContext<errors.$ZodIssue>, _params?: $ParseParams) => Promise<core.output<T>>;
export declare const _decodeAsync: (_Err: $ZodErrorClass) => $DecodeAsync;
export declare const decodeAsync: $DecodeAsync;
export type $SafeEncode = <T extends schemas.$ZodType>(schema: T, value: core.output<T>, _ctx?: schemas.ParseContext<errors.$ZodIssue>) => util.SafeParseResult<core.input<T>>;
export declare const _safeEncode: (_Err: $ZodErrorClass) => $SafeEncode;
export declare const safeEncode: $SafeEncode;
export type $SafeDecode = <T extends schemas.$ZodType>(schema: T, value: core.input<T>, _ctx?: schemas.ParseContext<errors.$ZodIssue>) => util.SafeParseResult<core.output<T>>;
export declare const _safeDecode: (_Err: $ZodErrorClass) => $SafeDecode;
export declare const safeDecode: $SafeDecode;
export type $SafeEncodeAsync = <T extends schemas.$ZodType>(schema: T, value: core.output<T>, _ctx?: schemas.ParseContext<errors.$ZodIssue>) => Promise<util.SafeParseResult<core.input<T>>>;
export declare const _safeEncodeAsync: (_Err: $ZodErrorClass) => $SafeEncodeAsync;
export declare const safeEncodeAsync: $SafeEncodeAsync;
export type $SafeDecodeAsync = <T extends schemas.$ZodType>(schema: T, value: core.input<T>, _ctx?: schemas.ParseContext<errors.$ZodIssue>) => Promise<util.SafeParseResult<core.output<T>>>;
export declare const _safeDecodeAsync: (_Err: $ZodErrorClass) => $SafeDecodeAsync;
export declare const safeDecodeAsync: $SafeDecodeAsync;
export {};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"2":"_J"},C:{"33":"_w","164":"_f"},D:{"2":"_Q"},E:{"2":"_R"},F:{"2":"_c"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"33":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"33":"_C"}},B:5,C:"CSS element() function",D:true};
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_FI","2":"_g J _L","33":"_DJ G"},D:{"1":"_kQ","33":"_LE"},E:{"1":"_PB","2":"_e","33":"_HB _VJ","292":"_5"},F:{"1":"_nR aC","2":"_0D","33":"C _9I"},G:{"1":"_s","33":"_SD","164":"_1"},H:{"2":"1D"},I:{"1":"I","33":"_HL","164":"_LB"},J:{"33":"_B"},K:{"1":"_ZB","2":"_cB"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:5,C:"CSS Animation",D:true};
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_E"},B:{"1":"_J"},C:{"1":"_zH","2":"_tG"},D:{"1":"_1P _mD","4":"_SO"},E:{"1":"_PB","4":"_UB"},F:{"1":"_H _vB","2":"_T","4":"_nE"},G:{"1":"_s","4":"_3"},H:{"2":"1D"},I:{"1":"I","4":"_G"},J:{"4":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:4,C:"CSS3 word-break",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../../src/shared/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE,eAAO,MAAM,6BAA6B,QAAmB,CAAC;AAE9D;;GAEG;AACH,qBAAa,UAAU;IACnB,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,cAAc,CAAS;gBAEnB,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE;IAIhD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAS3B,WAAW,IAAI,cAAc,GAAG,IAAI;IAepC,KAAK,IAAI,IAAI;CAGhB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAEhE"}
@@ -0,0 +1,31 @@
const React = require('react');
module.exports = function FileBreadcrumbs({ fileFilter = '', setFileFilter }) {
const parts = fileFilter.split('/');
const breadcrumbs = [
{
path: '',
name: 'all files'
},
...parts.map((part, i) => ({
path: parts.slice(0, i + 1).join('/'),
name: part
}))
];
return breadcrumbs.map(({ path, name }) =>
path === fileFilter ? (
name
) : (
<>
<a
href="javascript:void(0)"
onClick={() => setFileFilter(path)}
>
{name}
</a>
/
</>
)
);
};
@@ -0,0 +1,29 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
test("string to number pipeline", () => {
const schema = z.string().transform(Number).pipe(z.number());
expect(schema.parse("1234")).toEqual(1234);
});
test("string to number pipeline async", async () => {
const schema = z
.string()
.transform(async (val) => Number(val))
.pipe(z.number());
expect(await schema.parseAsync("1234")).toEqual(1234);
});
test("break if dirty", () => {
const schema = z
.string()
.refine((c) => c === "1234")
.transform(async (val) => Number(val))
.pipe(z.number().refine((v) => v < 100));
const r1: any = schema.safeParse("12345");
expect(r1.error.issues.length).toBe(1);
const r2: any = schema.safeParse("3");
expect(r2.error.issues.length).toBe(1);
});
@@ -0,0 +1,144 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "merkkiä", subject: "merkkijonon" },
file: { unit: "tavua", subject: "tiedoston" },
array: { unit: "alkiota", subject: "listan" },
set: { unit: "alkiota", subject: "joukon" },
map: { unit: "alkiota", subject: "kuvauksen" },
number: { unit: "", subject: "luvun" },
bigint: { unit: "", subject: "suuren kokonaisluvun" },
int: { unit: "", subject: "kokonaisluvun" },
date: { unit: "", subject: "päivämäärän" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "säännöllinen lauseke",
email: "sähköpostiosoite",
url: "URL-osoite",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO-aikaleima",
date: "ISO-päivämäärä",
time: "ISO-aika",
duration: "ISO-kesto",
ipv4: "IPv4-osoite",
ipv6: "IPv6-osoite",
mac: "MAC-osoite",
cidrv4: "IPv4-alue",
cidrv6: "IPv6-alue",
base64: "base64-koodattu merkkijono",
base64url: "base64url-koodattu merkkijono",
json_string: "JSON-merkkijono",
e164: "E.164-luku",
credit_card: "luottokortin numero",
currency_code: "valuuttakoodi",
iban: "IBAN",
jwt: "JWT",
template_literal: "templaattimerkkijono",
};
const TypeDictionary = {
nan: "NaN",
};
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 `Virheellinen tyyppi: odotettiin instanceof ${issue.expected}, oli ${received}`;
}
return `Virheellinen tyyppi: odotettiin ${expected}, oli ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Virheellinen syöte: täytyy olla ${util.stringifyPrimitive(issue.values[0])}`;
return `Virheellinen valinta: täytyy olla yksi seuraavista: ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Liian suuri: ${sizing.subject} täytyy olla ${adj}${issue.maximum.toString()} ${sizing.unit}`.trim();
}
return `Liian suuri: arvon täytyy olla ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Liian pieni: ${sizing.subject} täytyy olla ${adj}${issue.minimum.toString()} ${sizing.unit}`.trim();
}
return `Liian pieni: arvon täytyy olla ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Virheellinen syöte: täytyy alkaa "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Virheellinen syöte: täytyy loppua "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Virheellinen syöte: täytyy sisältää "${_issue.includes}"`;
if (_issue.format === "regex") {
return `Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${_issue.pattern}`;
}
return `Virheellinen ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Virheellinen luku: täytyy olla luvun ${issue.divisor} monikerta`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Tuntemattomat avaimet" : "Tuntematon avain"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return "Virheellinen avain tietueessa";
case "invalid_union":
return "Virheellinen unioni";
case "invalid_element":
return "Virheellinen arvo joukossa";
default:
return `Virheellinen syöte`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;
@@ -0,0 +1 @@
{"version":3,"file":"scroll-restoration.js","names":[],"sources":["../../src/scroll-restoration.ts"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { functionalUpdate, isPlainObject } from './utils'\nimport type { AnyRouter } from './router'\nimport type { ParsedLocation } from './location'\nimport type { NonNullableUpdater } from './utils'\n\nexport type ScrollRestorationEntry = { scrollX: number; scrollY: number }\n\ntype ScrollRestorationByElement = Record<string, ScrollRestorationEntry>\n\ntype ScrollRestorationByKey = Record<string, ScrollRestorationByElement>\n\ntype ScrollRestorationCache = {\n readonly state: ScrollRestorationByKey\n set: (updater: NonNullableUpdater<ScrollRestorationByKey>) => void\n persist: () => void\n}\n\nexport type ScrollRestorationOptions = {\n getKey?: (location: ParsedLocation) => string\n scrollBehavior?: ScrollToOptions['behavior']\n}\n\nfunction getSafeSessionStorage() {\n try {\n return typeof window !== 'undefined' &&\n typeof window.sessionStorage === 'object'\n ? window.sessionStorage\n : undefined\n } catch {\n // silent\n return undefined\n }\n}\n\n// SessionStorage key used to store scroll positions across navigations.\nexport const storageKey = 'tsr-scroll-restoration-v1_3'\n\nfunction createScrollRestorationCache(): ScrollRestorationCache | null {\n const safeSessionStorage = getSafeSessionStorage()\n if (!safeSessionStorage) {\n return null\n }\n\n let state: ScrollRestorationByKey = {}\n\n try {\n const parsed = JSON.parse(safeSessionStorage.getItem(storageKey) || '{}')\n if (isPlainObject(parsed)) {\n state = parsed as ScrollRestorationByKey\n }\n } catch {\n // ignore invalid session storage payloads\n }\n\n const persist = () => {\n try {\n safeSessionStorage.setItem(storageKey, JSON.stringify(state))\n } catch {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n '[ts-router] Could not persist scroll restoration state to sessionStorage.',\n )\n }\n }\n }\n\n return {\n get state() {\n return state\n },\n set: (updater) => {\n state = functionalUpdate(updater, state) || state\n },\n persist,\n }\n}\n\nexport const scrollRestorationCache = createScrollRestorationCache()\n\n/**\n * The default `getKey` function for `useScrollRestoration`.\n * It returns the `key` from the location state or the `href` of the location.\n *\n * The `location.href` is used as a fallback to support the use case where the location state is not available like the initial render.\n */\nexport const defaultGetScrollRestorationKey = (location: ParsedLocation) => {\n return location.state.__TSR_key! || location.href\n}\n\nfunction getCssSelector(el: any): string {\n const path = []\n let parent: HTMLElement\n while ((parent = el.parentNode)) {\n path.push(\n `${el.tagName}:nth-child(${Array.prototype.indexOf.call(parent.children, el) + 1})`,\n )\n el = parent\n }\n return `${path.reverse().join(' > ')}`.toLowerCase()\n}\n\nexport function getElementScrollRestorationEntry(\n router: AnyRouter,\n options: (\n | {\n id: string\n getElement?: () => Window | Element | undefined | null\n }\n | {\n id?: string\n getElement: () => Window | Element | undefined | null\n }\n ) & {\n getKey?: (location: ParsedLocation) => string\n },\n): ScrollRestorationEntry | undefined {\n const getKey = options.getKey || defaultGetScrollRestorationKey\n const restoreKey = getKey(router.latestLocation)\n\n if (options.id) {\n return scrollRestorationCache?.state[restoreKey]?.[\n `[${scrollRestorationIdAttribute}=\"${options.id}\"]`\n ]\n }\n\n const element = options.getElement?.()\n if (!element) {\n return\n }\n\n return scrollRestorationCache?.state[restoreKey]?.[\n element instanceof Window ? windowScrollTarget : getCssSelector(element)\n ]\n}\n\nlet ignoreScroll = false\nconst windowScrollTarget = 'window'\nconst scrollRestorationIdAttribute = 'data-scroll-restoration-id'\ntype ScrollTarget = typeof windowScrollTarget | Element\n\nexport function setupScrollRestoration(router: AnyRouter, force?: boolean) {\n if (!scrollRestorationCache && !(isServer ?? router.isServer)) {\n return\n }\n\n const cache = scrollRestorationCache\n\n const shouldScrollRestoration =\n force ?? router.options.scrollRestoration ?? false\n\n if (shouldScrollRestoration) {\n router.isScrollRestoring = true\n }\n\n if (\n (isServer ?? router.isServer) ||\n router.isScrollRestorationSetup ||\n !cache\n ) {\n return\n }\n\n router.isScrollRestorationSetup = true\n ignoreScroll = false\n\n const getKey =\n router.options.getScrollRestorationKey || defaultGetScrollRestorationKey\n const trackedScrollEntries = new Map<ScrollTarget, ScrollRestorationEntry>()\n\n window.history.scrollRestoration = 'manual'\n\n const onScrolLine truncated
@@ -0,0 +1,6 @@
function isIterable(value) {
return value != null && typeof value[Symbol.iterator] === "function";
}
export {
isIterable
};
@@ -0,0 +1,56 @@
import { DateInput, Unit } from './types';
/**
* Checks if a date is before another date or a specified time unit.
* 检查一个日期是否在另一个日期或指定的时间单位之前。
*
* @param date - The date to compare. (要比较的日期。)
* @param input - The date or time unit to compare against. (要比较的日期或时间单位。)
* @param unit - The unit of time to compare (e.g., 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond').
* (要比较的时间单位,例如 'year'、'month'、'day'、'hour'、'minute'、'second'、'millisecond'。)
* @returns A boolean indicating whether the first date is before the second date or time unit.
* (布尔值,表示第一个日期是否在第二个日期或时间单位之前。)
* @example
* ```ts
* // Checking if a date is before another date (检查一个日期是否在另一个日期之前)
* const date1 = new Date('2023-09-01');
* const date2 = new Date('2023-10-01');
* const isBeforeDate = isBefore(date1, date2, 'day');
* console.log(isBeforeDate); // Outputs: true (输出: true)
*
* // Checking if a date is before a specific year (检查一个日期是否在特定年份之前)
* const date3 = new Date('2022-12-31');
* const isBeforeYear = isBefore(date3, 2023, 'year');
* console.log(isBeforeYear); // Outputs: true (输出: true)
*
* // Checking if a date is before a specific month (检查一个日期是否在特定月份之前)
* const date4 = new Date('2023-09-01');
* const isBeforeMonth = isBefore(date4, '2023-10', 'month');
* console.log(isBeforeMonth); // Outputs: true (输出: true)
*
* // Checking if a date is before a specific day (检查一个日期是否在特定天数之前)
* const date5 = new Date('2023-10-01');
* const isBeforeDay = isBefore(date5, '2023-10-02', 'day');
* console.log(isBeforeDay); // Outputs: true (输出: true)
*
* // Checking if a date is before a specific hour (检查一个日期是否在特定小时之前)
* const date6 = new Date('2023-10-01T12:00:00');
* const isBeforeHour = isBefore(date6, '2023-10-01T13:00:00', 'hour');
* console.log(isBeforeHour); // Outputs: true (输出: true)
*
* // Checking if a date is before a specific minute (检查一个日期是否在特定分钟之前)
* const date7 = new Date('2023-10-01T12:00:00');
* const isBeforeMinute = isBefore(date7, '2023-10-01T12:01:00', 'minute');
* console.log(isBeforeMinute); // Outputs: true (输出: true)
*
* // Checking if a date is before a specific second (检查一个日期是否在特定秒数之前)
* const date8 = new Date('2023-10-01T12:00:00');
* const isBeforeSecond = isBefore(date8, '2023-10-01T12:00:01', 'second');
* console.log(isBeforeSecond); // Outputs: true (输出: true)
*
* // Checking if a date is before a specific millisecond (检查一个日期是否在特定毫秒数之前)
* const date9 = new Date('2023-10-01T12:00:00.000');
* const isBeforeMillisecond = isBefore(date9, '2023-10-01T12:00:00.500', 'millisecond');
* console.log(isBeforeMillisecond); // Outputs: true (输出: true)
* ```
*/
export default function isBefore(date: Date, input: DateInput, unit?: Unit): boolean;
@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = regeneratorDefine;
function regeneratorDefine(obj, key, value, noFlags) {
var define = Object.defineProperty;
try {
define({}, "", {});
} catch (_) {
define = 0;
}
exports.default = regeneratorDefine = function (obj, key, value, noFlags) {
function defineIteratorMethod(method, i) {
regeneratorDefine(obj, method, function (arg) {
return this._invoke(method, i, arg);
});
}
if (!key) {
defineIteratorMethod("next", 0);
defineIteratorMethod("throw", 1);
defineIteratorMethod("return", 2);
} else {
if (define) {
define(obj, key, {
value: value,
enumerable: !noFlags,
configurable: !noFlags,
writable: !noFlags
});
} else {
obj[key] = value;
}
}
};
regeneratorDefine(obj, key, value, noFlags);
}
//# sourceMappingURL=regeneratorDefine.js.map
@@ -0,0 +1 @@
{"version":3,"file":"origami.js","sources":["../../../src/icons/origami.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Origami\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTJWNGExIDEgMCAwIDEgMS0xaDYuMjk3YTEgMSAwIDAgMSAuNjUxIDEuNzU5bC00LjY5NiA0LjAyNSIgLz4KICA8cGF0aCBkPSJtMTIgMjEtNy40MTQtNy40MTRBMiAyIDAgMCAxIDQgMTIuMTcyVjYuNDE1YTEuMDAyIDEuMDAyIDAgMCAxIDEuNzA3LS43MDdMMjAgMjAuMDA5IiAvPgogIDxwYXRoIGQ9Im0xMi4yMTQgMy4zODEgOC40MTQgMTQuOTY2YTEgMSAwIDAgMS0uMTY3IDEuMTk5bC0xLjE2OCAxLjE2M2ExIDEgMCAwIDEtLjcwNi4yOTFINi4zNTFhMSAxIDAgMCAxLS42MjUtLjIxOUwzLjI1IDE4LjhhMSAxIDAgMCAxIC42MzEtMS43ODFsNC4xNjUuMDI3IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/origami\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 Origami = createLucideIcon('Origami', [\n ['path', { d: 'M12 12V4a1 1 0 0 1 1-1h6.297a1 1 0 0 1 .651 1.759l-4.696 4.025', key: '1bx4vc' }],\n [\n 'path',\n {\n d: 'm12 21-7.414-7.414A2 2 0 0 1 4 12.172V6.415a1.002 1.002 0 0 1 1.707-.707L20 20.009',\n key: '1h3km6',\n },\n ],\n [\n 'path',\n {\n d: 'm12.214 3.381 8.414 14.966a1 1 0 0 1-.167 1.199l-1.168 1.163a1 1 0 0 1-.706.291H6.351a1 1 0 0 1-.625-.219L3.25 18.8a1 1 0 0 1 .631-1.781l4.165.027',\n key: '1hj4wg',\n },\n ],\n]);\n\nexport default Origami;\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,334 @@
import { expect, expectTypeOf, test } from "vitest";
import type { util } from "zod/v4/core";
import * as z from "zod/v4";
test("object intersection", () => {
const A = z.object({ a: z.string() });
const B = z.object({ b: z.string() });
const C = z.intersection(A, B); // BaseC.merge(HasID);
type C = z.infer<typeof C>;
expectTypeOf<C>().toEqualTypeOf<{ a: string } & { b: string }>();
const data = { a: "foo", b: "foo" };
expect(C.parse(data)).toEqual(data);
expect(() => C.parse({ a: "foo" })).toThrow();
});
test("object intersection: loose", () => {
const A = z.looseObject({ a: z.string() });
const B = z.object({ b: z.string() });
const C = z.intersection(A, B); // BaseC.merge(HasID);
type C = z.infer<typeof C>;
expectTypeOf<C>().toEqualTypeOf<{ a: string; [x: string]: unknown } & { b: string }>();
const data = { a: "foo", b: "foo", c: "extra" };
expect(C.parse(data)).toEqual(data);
expect(() => C.parse({ a: "foo" })).toThrow();
});
test("object intersection: strict + strip", () => {
const A = z.strictObject({ a: z.string() });
const B = z.object({ b: z.string() });
const C = z.intersection(A, B);
type C = z.infer<typeof C>;
expectTypeOf<C>().toEqualTypeOf<{ a: string } & { b: string }>();
// Keys recognized by either side should work
expect(C.parse({ a: "foo", b: "bar" })).toEqual({ a: "foo", b: "bar" });
// Extra keys are stripped (follows strip behavior from B)
expect(C.parse({ a: "foo", b: "bar", c: "extra" })).toEqual({ a: "foo", b: "bar" });
});
test("object intersection: strict + strict", () => {
const A = z.strictObject({ a: z.string() });
const B = z.strictObject({ b: z.string() });
const C = z.intersection(A, B);
// Keys recognized by either side should work
expect(C.parse({ a: "foo", b: "bar" })).toEqual({ a: "foo", b: "bar" });
// Keys unrecognized by BOTH sides should error
const result = C.safeParse({ a: "foo", b: "bar", c: "extra" });
expect(result.error?.issues).toMatchInlineSnapshot(`
[
{
"code": "unrecognized_keys",
"keys": [
"c",
],
"message": "Unrecognized key: "c"",
"path": [],
},
]
`);
});
test("object intersection strips __proto__ from pass-through operands", () => {
const cases = [
[
z.intersection(z.object({ name: z.string() }), z.unknown()),
JSON.parse('{"__proto__":{"isAdmin":true},"name":"alice"}'),
{ name: "alice" },
],
[z.intersection(z.record(z.string(), z.unknown()), z.any()), JSON.parse('{"__proto__":{},"a":1}'), { a: 1 }],
] as const;
for (const [schema, input, expected] of cases) {
const parsed = schema.parse(input);
expect(parsed).toEqual(expected);
expect(Object.getPrototypeOf(parsed)).toBe(Object.prototype);
expect(Object.prototype.hasOwnProperty.call(parsed, "__proto__")).toBe(false);
}
});
test("deep intersection", () => {
const Animal = z.object({
properties: z.object({
is_animal: z.boolean(),
}),
});
const Cat = z.intersection(
z.object({
properties: z.object({
jumped: z.boolean(),
}),
}),
Animal
);
type Cat = util.Flatten<z.infer<typeof Cat>>;
expectTypeOf<Cat>().toEqualTypeOf<{ properties: { is_animal: boolean } & { jumped: boolean } }>();
const a = Cat.safeParse({ properties: { is_animal: true, jumped: true } });
expect(a.data!.properties).toEqual({ is_animal: true, jumped: true });
});
test("deep intersection of arrays", async () => {
const Author = z.object({
posts: z.array(
z.object({
post_id: z.number(),
})
),
});
const Registry = z.intersection(
Author,
z.object({
posts: z.array(
z.object({
title: z.string(),
})
),
})
);
const posts = [
{ post_id: 1, title: "Novels" },
{ post_id: 2, title: "Fairy tales" },
];
const cat = Registry.parse({ posts });
expect(cat.posts).toEqual(posts);
const asyncCat = await Registry.parseAsync({ posts });
expect(asyncCat.posts).toEqual(posts);
});
test("invalid intersection types", async () => {
const numberIntersection = z.intersection(
z.number(),
z.number().transform((x) => x + 1)
);
expect(() => {
numberIntersection.parse(1234);
}).toThrowErrorMatchingInlineSnapshot(`[Error: Unmergable intersection. Error path: []]`);
});
test("invalid array merge (incompatible lengths)", async () => {
const stringArrInt = z.intersection(
z.string().array(),
z
.string()
.array()
.transform((val) => [...val, "asdf"])
);
expect(() => stringArrInt.safeParse(["asdf", "qwer"])).toThrowErrorMatchingInlineSnapshot(
`[Error: Unmergable intersection. Error path: []]`
);
});
test("invalid array merge (incompatible elements)", async () => {
const stringArrInt = z.intersection(
z.string().array(),
z
.string()
.array()
.transform((val) => [...val.slice(0, -1), "asdf"])
);
expect(() => stringArrInt.safeParse(["asdf", "qwer"])).toThrowErrorMatchingInlineSnapshot(
`[Error: Unmergable intersection. Error path: [1]]`
);
});
test("invalid object merge", async () => {
const Cat = z.object({
phrase: z.string().transform((val) => `${val} Meow`),
});
const Dog = z.object({
phrase: z.string().transform((val) => `${val} Woof`),
});
const CatDog = z.intersection(Cat, Dog);
expect(() => CatDog.parse({ phrase: "Hello, my name is CatDog." })).toThrowErrorMatchingInlineSnapshot(
`[Error: Unmergable intersection. Error path: ["phrase"]]`
);
});
test("invalid deep merge of object and array combination", async () => {
const University = z.object({
students: z.array(
z.object({
name: z.string().transform((val) => `Student name: ${val}`),
})
),
});
const Registry = z.intersection(
University,
z.object({
students: z.array(
z.object({
name: z.string(),
surname: z.string(),
})
),
})
);
const students = [{ name: "John", surname: "Doe" }];
expect(() => Registry.parse({ students })).toThrowErrorMatchingInlineSnapshot(
`[Error: Unmergable intersection. Error path: ["students",0,"name"]]`
);
});
// A record's key schema says which keys that record GOVERNS; it is not a predicate
// every key in the result must satisfy. TypeScript works the same way: in
// `{name: string} & Record<`S_${string}`, string>` the index signature constrains
// only the keys matching it, so `name` is fine. So a key one side does not govern
// is reconciled against the other side, exactly as unrecognized_keys already is.
test("a record's key schema governs only its own keys inside an intersection", () => {
const Obj = z.object({ name: z.string() });
const value = { name: "a", S_a: "s" };
// Every key-schema flavor behaves the same: `name` belongs to the object side.
expect(z.intersection(Obj, z.record(z.string().regex(/^S_/), z.string())).parse(value)).toEqual(value);
expect(z.intersection(Obj, z.record(z.templateLiteral(["S_", z.string()]), z.string())).parse(value)).toEqual(value);
expect(z.intersection(Obj, z.partialRecord(z.enum(["p1", "p2"]), z.string())).parse({ name: "a", p1: "x" })).toEqual({
name: "a",
p1: "x",
});
expect(z.intersection(Obj, z.record(z.enum(["p1"]), z.string())).parse({ name: "a", p1: "x" })).toEqual({
name: "a",
p1: "x",
});
// A key the record DOES govern still has its value validated across the intersection.
const governed = z.intersection(z.object({ S_x: z.number() }), z.record(z.string().regex(/^S_/), z.string()));
expect(governed.safeParse({ S_x: 1 }).success).toBe(false);
// A key NEITHER side governs is still rejected.
const strict = z.intersection(z.strictObject({ name: z.string() }), z.record(z.string().regex(/^S_/), z.string()));
expect(strict.parse(value)).toEqual(value);
expect(strict.safeParse({ ...value, evil: "q" }).success).toBe(false);
// Standalone, a record still rejects a key it does not govern.
expect(z.record(z.string().regex(/^S_/), z.string()).safeParse({ S_a: "s", bad: "x" }).success).toBe(false);
});
test("partialRecord reports an out-of-set key as unrecognized, not invalid", () => {
const enumKeys = z.partialRecord(z.enum(["a", "b"]), z.string()).safeParse({ a: "x", zzz: "q" });
expect(enumKeys.success).toBe(false);
expect(enumKeys.error!.issues[0].code).toBe("unrecognized_keys");
// A regex key schema still reports the failure as an invalid key.
const regexKeys = z.record(z.string().regex(/^S_/), z.string()).safeParse({ S_a: "x", zzz: "q" });
expect(regexKeys.success).toBe(false);
expect(regexKeys.error!.issues[0].code).toBe("invalid_key");
});
test("intersection operands run their own checks, refinements and transforms", () => {
let checks = 0;
const failing = z.intersection(
z.strictObject({ x: z.string() }).check(() => {
checks++;
}),
z.strictObject({ a: z.string() }).superRefine((_data, ctx) => {
checks++;
ctx.addIssue({ code: "custom", message: "boom" });
})
);
expect(failing.safeParse({ x: "test", a: "hello" })).toMatchObject({
success: false,
error: { issues: [{ code: "custom", message: "boom" }] },
});
expect(checks).toBe(2);
const transformed = z.intersection(
z.strictObject({ x: z.string() }).transform((v) => ({ ...v, x: v.x.toUpperCase() })),
z.strictObject({ a: z.string() }).transform((v) => ({ ...v, seen: true }))
);
expect(transformed.parse({ x: "test", a: "hello" })).toEqual({ x: "TEST", a: "hello", seen: true });
});
test("intersection operands apply defaults, including through a nested intersection", () => {
const inner = z.intersection(
z.strictObject({ x: z.string().default("X default"), y: z.number() }),
z.strictObject({ z: z.boolean() })
);
const schema = z.intersection(inner, z.strictObject({ a: z.string() }));
expectTypeOf<z.output<typeof schema>>().toEqualTypeOf<{ x: string; y: number } & { z: boolean } & { a: string }>();
expect(schema.parse({ y: 34, z: true, a: "hello" })).toEqual({ x: "X default", y: 34, z: true, a: "hello" });
});
test("a record operand runs its own refinements inside an intersection", () => {
let calls = 0;
const schema = z
.record(z.enum(["p1", "p2"]), z.string())
.superRefine((_data, ctx) => {
calls++;
ctx.addIssue({ code: "custom", message: "record refined" });
})
.and(z.strictObject({ name: z.string() }));
expect(schema.safeParse({ p1: "a", p2: "b", name: "n" })).toMatchObject({
success: false,
error: { issues: [{ code: "custom", message: "record refined" }] },
});
expect(calls).toBe(1);
});
test("a strict object nested under an operand keeps its strictness", () => {
const schema = z.intersection(
z.object({ inner: z.strictObject({ a: z.string() }) }),
z.object({ other: z.string() })
);
expect(schema.parse({ inner: { a: "x" }, other: "y" })).toEqual({ inner: { a: "x" }, other: "y" });
expect(schema.safeParse({ inner: { a: "x", extra: 1 }, other: "y" })).toMatchObject({
success: false,
error: { issues: [{ code: "unrecognized_keys", keys: ["extra"], path: ["inner"] }] },
});
});
test("a strict object composes with a refined object", () => {
const A = z.object({ key1: z.boolean() }).strict();
const B = z.object({ key2: z.boolean() }).refine(({ key2 }) => key2, "key2 must be true");
expect(A.and(B).parse({ key1: true, key2: true })).toEqual({ key1: true, key2: true });
expect(A.and(B).safeParse({ key1: true, key2: false }).success).toBe(false);
});
@@ -0,0 +1,132 @@
import { d as safeReplaceTextBetween, f as createRule, g as import_ast_utils } from "../utils.js";
var function_call_spacing_default = createRule({
name: "function-call-spacing",
meta: {
type: "layout",
docs: { description: "Require or disallow spacing between function identifiers and their invocations" },
fixable: "whitespace",
schema: { anyOf: [{
type: "array",
items: [{
type: "string",
enum: ["never"]
}],
minItems: 0,
maxItems: 1
}, {
type: "array",
items: [{
type: "string",
enum: ["always"]
}, {
type: "object",
properties: {
allowNewlines: { type: "boolean" },
optionalChain: {
type: "object",
properties: {
before: { type: "boolean" },
after: { type: "boolean" }
},
additionalProperties: false
}
},
additionalProperties: false
}],
minItems: 0,
maxItems: 2
}] },
defaultOptions: ["never"],
messages: {
unexpectedWhitespace: "Unexpected whitespace between function name and paren.",
unexpectedNewline: "Unexpected newline between function name and paren.",
missing: "Missing space between function name and paren."
}
},
create(context, [option, config]) {
const sourceCode = context.sourceCode;
const text = sourceCode.getText();
const { allowNewlines = false, optionalChain = {
before: true,
after: true
} } = config ?? {};
function checkSpacing(node, leftToken, rightToken) {
const isOptionalCall = (0, import_ast_utils.isOptionalCallExpression)(node);
const textBetweenTokens = text.slice(leftToken.range[1], rightToken.range[0]).replace(/\/\*.*?\*\//gu, "");
const hasWhitespace = /\s/u.test(textBetweenTokens);
const hasNewline = hasWhitespace && import_ast_utils.LINEBREAK_MATCHER.test(textBetweenTokens);
if (option === "never") {
if (hasWhitespace) return context.report({
node,
loc: {
start: leftToken.loc.end,
end: rightToken.loc.start
},
messageId: "unexpectedWhitespace",
fix: safeReplaceTextBetween(sourceCode, leftToken, rightToken, isOptionalCall ? "?." : "")
});
} else if (isOptionalCall) {
const { before: beforeOptionChain = true, after: afterOptionChain = true } = optionalChain;
const hasPrefixSpace = /^\s/u.test(textBetweenTokens);
const hasSuffixSpace = /\s$/u.test(textBetweenTokens);
const hasCorrectPrefixSpace = beforeOptionChain ? hasPrefixSpace : !hasPrefixSpace;
const hasCorrectSuffixSpace = afterOptionChain ? hasSuffixSpace : !hasSuffixSpace;
const hasCorrectNewline = allowNewlines || !hasNewline;
if (!hasCorrectPrefixSpace || !hasCorrectSuffixSpace || !hasCorrectNewline) {
const messageId = !hasCorrectNewline ? "unexpectedNewline" : !beforeOptionChain && hasPrefixSpace || !afterOptionChain && hasSuffixSpace ? "unexpectedWhitespace" : "missing";
context.report({
node,
loc: {
start: leftToken.loc.end,
end: rightToken.loc.start
},
messageId,
fix: safeReplaceTextBetween(sourceCode, leftToken, rightToken, () => {
let text = textBetweenTokens;
if (!allowNewlines) {
const GLOBAL_LINEBREAK_MATCHER = new RegExp(import_ast_utils.LINEBREAK_MATCHER.source, "g");
text = text.replaceAll(GLOBAL_LINEBREAK_MATCHER, " ");
}
if (!hasCorrectPrefixSpace) text = beforeOptionChain ? ` ${text}` : text.trimStart();
if (!hasCorrectSuffixSpace) text = afterOptionChain ? `${text} ` : text.trimEnd();
return text;
})
});
}
} else if (!hasWhitespace) context.report({
node,
loc: {
start: leftToken.loc.end,
end: rightToken.loc.start
},
messageId: "missing",
fix(fixer) {
return fixer.insertTextBefore(rightToken, " ");
}
});
else if (!allowNewlines && hasNewline) context.report({
node,
loc: {
start: leftToken.loc.end,
end: rightToken.loc.start
},
messageId: "unexpectedNewline",
fix: safeReplaceTextBetween(sourceCode, leftToken, rightToken, " ")
});
}
return {
"CallExpression, NewExpression": function(node) {
const closingParenToken = sourceCode.getLastToken(node);
const lastCalleeTokenWithoutPossibleParens = sourceCode.getLastToken(node.typeArguments ?? node.callee);
const openingParenToken = sourceCode.getFirstTokenBetween(lastCalleeTokenWithoutPossibleParens, closingParenToken, import_ast_utils.isOpeningParenToken);
if (!openingParenToken || openingParenToken.range[1] >= node.range[1]) return;
checkSpacing(node, sourceCode.getTokenBefore(openingParenToken, import_ast_utils.isNotOptionalChainPunctuator), openingParenToken);
},
ImportExpression(node) {
const leftToken = sourceCode.getFirstToken(node);
checkSpacing(node, leftToken, sourceCode.getTokenAfter(leftToken));
}
};
}
});
export { function_call_spacing_default as t };
@@ -0,0 +1,581 @@
/**
* @fileoverview Enforces empty lines around comments.
* @author Jamund Ferguson
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Return an array with any line numbers that are empty.
* @param {Array} lines An array of each line of the file.
* @returns {Array} An array of line numbers.
*/
function getEmptyLineNums(lines) {
const emptyLines = lines
.map((line, i) => ({
code: line.trim(),
num: i + 1,
}))
.filter(line => !line.code)
.map(line => line.num);
return emptyLines;
}
/**
* Return an array with any line numbers that contain comments.
* @param {Array} comments An array of comment tokens.
* @returns {Array} An array of line numbers.
*/
function getCommentLineNums(comments) {
const lines = [];
comments.forEach(token => {
const start = token.loc.start.line;
const end = token.loc.end.line;
lines.push(start, end);
});
return lines;
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "lines-around-comment",
url: "https://eslint.style/rules/lines-around-comment",
},
},
],
},
type: "layout",
docs: {
description: "Require empty lines around comments",
recommended: false,
url: "https://eslint.org/docs/latest/rules/lines-around-comment",
},
fixable: "whitespace",
schema: [
{
type: "object",
properties: {
beforeBlockComment: {
type: "boolean",
default: true,
},
afterBlockComment: {
type: "boolean",
default: false,
},
beforeLineComment: {
type: "boolean",
default: false,
},
afterLineComment: {
type: "boolean",
default: false,
},
allowBlockStart: {
type: "boolean",
default: false,
},
allowBlockEnd: {
type: "boolean",
default: false,
},
allowClassStart: {
type: "boolean",
},
allowClassEnd: {
type: "boolean",
},
allowObjectStart: {
type: "boolean",
},
allowObjectEnd: {
type: "boolean",
},
allowArrayStart: {
type: "boolean",
},
allowArrayEnd: {
type: "boolean",
},
ignorePattern: {
type: "string",
},
applyDefaultIgnorePatterns: {
type: "boolean",
},
afterHashbangComment: {
type: "boolean",
default: false,
},
},
additionalProperties: false,
},
],
messages: {
after: "Expected line after comment.",
before: "Expected line before comment.",
},
},
create(context) {
const options = Object.assign({}, context.options[0]);
const ignorePattern = options.ignorePattern;
const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN;
const customIgnoreRegExp = new RegExp(ignorePattern, "u");
const applyDefaultIgnorePatterns =
options.applyDefaultIgnorePatterns !== false;
options.beforeBlockComment =
typeof options.beforeBlockComment !== "undefined"
? options.beforeBlockComment
: true;
const sourceCode = context.sourceCode;
const lines = sourceCode.lines,
numLines = lines.length + 1,
comments = sourceCode.getAllComments(),
commentLines = getCommentLineNums(comments),
emptyLines = getEmptyLineNums(lines),
commentAndEmptyLines = new Set(commentLines.concat(emptyLines));
/**
* Returns whether or not comments are on lines starting with or ending with code
* @param {token} token The comment token to check.
* @returns {boolean} True if the comment is not alone.
*/
function codeAroundComment(token) {
let currentToken = token;
do {
currentToken = sourceCode.getTokenBefore(currentToken, {
includeComments: true,
});
} while (currentToken && astUtils.isCommentToken(currentToken));
if (
currentToken &&
astUtils.isTokenOnSameLine(currentToken, token)
) {
return true;
}
currentToken = token;
do {
currentToken = sourceCode.getTokenAfter(currentToken, {
includeComments: true,
});
} while (currentToken && astUtils.isCommentToken(currentToken));
if (
currentToken &&
astUtils.isTokenOnSameLine(token, currentToken)
) {
return true;
}
return false;
}
/**
* Returns whether or not comments are inside a node type or not.
* @param {ASTNode} parent The Comment parent node.
* @param {string} nodeType The parent type to check against.
* @returns {boolean} True if the comment is inside nodeType.
*/
function isParentNodeType(parent, nodeType) {
return (
parent.type === nodeType ||
(parent.body && parent.body.type === nodeType) ||
(parent.consequent && parent.consequent.type === nodeType)
);
}
/**
* Returns the parent node that contains the given token.
* @param {token} token The token to check.
* @returns {ASTNode|null} The parent node that contains the given token.
*/
function getParentNodeOfToken(token) {
const node = sourceCode.getNodeByRangeIndex(token.range[0]);
/*
* For the purpose of this rule, the comment token is in a `StaticBlock` node only
* if it's inside the braces of that `StaticBlock` node.
*
* Example where this function returns `null`:
*
* static
* // comment
* {
* }
*
* Example where this function returns `StaticBlock` node:
*
* static
* {
* // comment
* }
*
*/
if (node && node.type === "StaticBlock") {
const openingBrace = sourceCode.getFirstToken(node, {
skip: 1,
}); // skip the `static` token
return token.range[0] >= openingBrace.range[0] ? node : null;
}
return node;
}
/**
* Returns whether or not comments are at the parent start or not.
* @param {token} token The Comment token.
* @param {string} nodeType The parent type to check against.
* @returns {boolean} True if the comment is at parent start.
*/
function isCommentAtParentStart(token, nodeType) {
const parent = getParentNodeOfToken(token);
if (parent && isParentNodeType(parent, nodeType)) {
let parentStartNodeOrToken = parent;
if (parent.type === "StaticBlock") {
parentStartNodeOrToken = sourceCode.getFirstToken(parent, {
skip: 1,
}); // opening brace of the static block
} else if (parent.type === "SwitchStatement") {
parentStartNodeOrToken = sourceCode.getTokenAfter(
parent.discriminant,
{
filter: astUtils.isOpeningBraceToken,
},
); // opening brace of the switch statement
}
return (
token.loc.start.line -
parentStartNodeOrToken.loc.start.line ===
1
);
}
return false;
}
/**
* Returns whether or not comments are at the parent end or not.
* @param {token} token The Comment token.
* @param {string} nodeType The parent type to check against.
* @returns {boolean} True if the comment is at parent end.
*/
function isCommentAtParentEnd(token, nodeType) {
const parent = getParentNodeOfToken(token);
return (
!!parent &&
isParentNodeType(parent, nodeType) &&
parent.loc.end.line - token.loc.end.line === 1
);
}
/**
* Returns whether or not comments are at the block start or not.
* @param {token} token The Comment token.
* @returns {boolean} True if the comment is at block start.
*/
function isCommentAtBlockStart(token) {
return (
isCommentAtParentStart(token, "ClassBody") ||
isCommentAtParentStart(token, "BlockStatement") ||
isCommentAtParentStart(token, "StaticBlock") ||
isCommentAtParentStart(token, "SwitchCase") ||
isCommentAtParentStart(token, "SwitchStatement")
);
}
/**
* Returns whether or not comments are at the block end or not.
* @param {token} token The Comment token.
* @returns {boolean} True if the comment is at block end.
*/
function isCommentAtBlockEnd(token) {
return (
isCommentAtParentEnd(token, "ClassBody") ||
isCommentAtParentEnd(token, "BlockStatement") ||
isCommentAtParentEnd(token, "StaticBlock") ||
isCommentAtParentEnd(token, "SwitchCase") ||
isCommentAtParentEnd(token, "SwitchStatement")
);
}
/**
* Returns whether or not comments are at the class start or not.
* @param {token} token The Comment token.
* @returns {boolean} True if the comment is at class start.
*/
function isCommentAtClassStart(token) {
return isCommentAtParentStart(token, "ClassBody");
}
/**
* Returns whether or not comments are at the class end or not.
* @param {token} token The Comment token.
* @returns {boolean} True if the comment is at class end.
*/
function isCommentAtClassEnd(token) {
return isCommentAtParentEnd(token, "ClassBody");
}
/**
* Returns whether or not comments are at the object start or not.
* @param {token} token The Comment token.
* @returns {boolean} True if the comment is at object start.
*/
function isCommentAtObjectStart(token) {
return (
isCommentAtParentStart(token, "ObjectExpression") ||
isCommentAtParentStart(token, "ObjectPattern")
);
}
/**
* Returns whether or not comments are at the object end or not.
* @param {token} token The Comment token.
* @returns {boolean} True if the comment is at object end.
*/
function isCommentAtObjectEnd(token) {
return (
isCommentAtParentEnd(token, "ObjectExpression") ||
isCommentAtParentEnd(token, "ObjectPattern")
);
}
/**
* Returns whether or not comments are at the array start or not.
* @param {token} token The Comment token.
* @returns {boolean} True if the comment is at array start.
*/
function isCommentAtArrayStart(token) {
return (
isCommentAtParentStart(token, "ArrayExpression") ||
isCommentAtParentStart(token, "ArrayPattern")
);
}
/**
* Returns whether or not comments are at the array end or not.
* @param {token} token The Comment token.
* @returns {boolean} True if the comment is at array end.
*/
function isCommentAtArrayEnd(token) {
return (
isCommentAtParentEnd(token, "ArrayExpression") ||
isCommentAtParentEnd(token, "ArrayPattern")
);
}
/**
* Checks if a comment token has lines around it (ignores inline comments)
* @param {token} token The Comment token.
* @param {Object} opts Options to determine the newline.
* @param {boolean} opts.after Should have a newline after this line.
* @param {boolean} opts.before Should have a newline before this line.
* @returns {void}
*/
function checkForEmptyLine(token, opts) {
if (
applyDefaultIgnorePatterns &&
defaultIgnoreRegExp.test(token.value)
) {
return;
}
if (ignorePattern && customIgnoreRegExp.test(token.value)) {
return;
}
let after = opts.after,
before = opts.before;
const prevLineNum = token.loc.start.line - 1,
nextLineNum = token.loc.end.line + 1,
commentIsNotAlone = codeAroundComment(token);
const blockStartAllowed =
options.allowBlockStart &&
isCommentAtBlockStart(token) &&
!(
options.allowClassStart === false &&
isCommentAtClassStart(token)
),
blockEndAllowed =
options.allowBlockEnd &&
isCommentAtBlockEnd(token) &&
!(
options.allowClassEnd === false &&
isCommentAtClassEnd(token)
),
classStartAllowed =
options.allowClassStart && isCommentAtClassStart(token),
classEndAllowed =
options.allowClassEnd && isCommentAtClassEnd(token),
objectStartAllowed =
options.allowObjectStart && isCommentAtObjectStart(token),
objectEndAllowed =
options.allowObjectEnd && isCommentAtObjectEnd(token),
arrayStartAllowed =
options.allowArrayStart && isCommentAtArrayStart(token),
arrayEndAllowed =
options.allowArrayEnd && isCommentAtArrayEnd(token);
const exceptionStartAllowed =
blockStartAllowed ||
classStartAllowed ||
objectStartAllowed ||
arrayStartAllowed;
const exceptionEndAllowed =
blockEndAllowed ||
classEndAllowed ||
objectEndAllowed ||
arrayEndAllowed;
// ignore top of the file and bottom of the file
if (prevLineNum < 1) {
before = false;
}
if (nextLineNum >= numLines) {
after = false;
}
// we ignore all inline comments
if (commentIsNotAlone) {
return;
}
const previousTokenOrComment = sourceCode.getTokenBefore(token, {
includeComments: true,
});
const nextTokenOrComment = sourceCode.getTokenAfter(token, {
includeComments: true,
});
// check for newline before
if (
!exceptionStartAllowed &&
before &&
!commentAndEmptyLines.has(prevLineNum) &&
!(
astUtils.isCommentToken(previousTokenOrComment) &&
astUtils.isTokenOnSameLine(previousTokenOrComment, token)
)
) {
const lineStart = token.range[0] - token.loc.start.column;
const range = [lineStart, lineStart];
context.report({
node: token,
messageId: "before",
fix(fixer) {
return fixer.insertTextBeforeRange(range, "\n");
},
});
}
// check for newline after
if (
!exceptionEndAllowed &&
after &&
!commentAndEmptyLines.has(nextLineNum) &&
!(
astUtils.isCommentToken(nextTokenOrComment) &&
astUtils.isTokenOnSameLine(token, nextTokenOrComment)
)
) {
context.report({
node: token,
messageId: "after",
fix(fixer) {
return fixer.insertTextAfter(token, "\n");
},
});
}
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
Program() {
comments.forEach(token => {
if (token.type === "Line") {
if (
options.beforeLineComment ||
options.afterLineComment
) {
checkForEmptyLine(token, {
after: options.afterLineComment,
before: options.beforeLineComment,
});
}
} else if (token.type === "Block") {
if (
options.beforeBlockComment ||
options.afterBlockComment
) {
checkForEmptyLine(token, {
after: options.afterBlockComment,
before: options.beforeBlockComment,
});
}
} else if (token.type === "Shebang") {
if (options.afterHashbangComment) {
checkForEmptyLine(token, {
after: options.afterHashbangComment,
before: false,
});
}
}
});
},
};
},
};
@@ -0,0 +1,16 @@
export * as core from "../core/index.js";
export * from "./parse.js";
export * from "./schemas.js";
export * from "./checks.js";
export { deepPartial } from "./deep-partial.js";
export { input, output } from "./in-out.js";
export type { infer } from "../core/index.js";
export type { JSONType } from "../core/util.js";
export type { CompileOptions } from "../core/index.js";
export { globalRegistry, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, INVALID, toZod, compile, withParser, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
export { toJSONSchema } from "../core/json-schema-processors.js";
export * as locales from "../locales/index.js";
/** A special constant with type `never` */
export * as iso from "./iso.js";
export { ZodMiniISODateTime, ZodMiniISODate, ZodMiniISOTime, ZodMiniISODuration, } from "./iso.js";
export * as coerce from "./coerce.js";
@@ -0,0 +1,37 @@
import {eatTypeToken, lookaheadType, match} from "../tokenizer/index";
import {TokenType as tt} from "../tokenizer/types";
import {isFlowEnabled, isTypeScriptEnabled} from "../traverser/base";
import {baseParseConditional} from "../traverser/expression";
import {flowParseTypeAnnotation} from "./flow";
import {tsParseTypeAnnotation} from "./typescript";
/**
* Common parser code for TypeScript and Flow.
*/
// An apparent conditional expression could actually be an optional parameter in an arrow function.
export function typedParseConditional(noIn) {
// If we see ?:, this can't possibly be a valid conditional. typedParseParenItem will be called
// later to finish off the arrow parameter. We also need to handle bare ? tokens for optional
// parameters without type annotations, i.e. ?, and ?) .
if (match(tt.question)) {
const nextType = lookaheadType();
if (nextType === tt.colon || nextType === tt.comma || nextType === tt.parenR) {
return;
}
}
baseParseConditional(noIn);
}
// Note: These "type casts" are *not* valid TS expressions.
// But we parse them here and change them when completing the arrow function.
export function typedParseParenItem() {
eatTypeToken(tt.question);
if (match(tt.colon)) {
if (isTypeScriptEnabled) {
tsParseTypeAnnotation();
} else if (isFlowEnabled) {
flowParseTypeAnnotation();
}
}
}
@@ -0,0 +1,11 @@
import { c as createCLI } from './chunks/cac.DzDtg8hz.js';
import '@vitest/utils/helpers';
import 'events';
import 'pathe';
import 'tinyrainbow';
import './chunks/env.D4Lgay0q.js';
import 'std-env';
import './chunks/constants.CPYnjOGj.js';
import 'node:assert';
createCLI().parse();
@@ -0,0 +1,291 @@
/**
* @fileoverview Rule to enforce linebreaks after open and before close array brackets
* @author Jan Peer Stöcklmair <https://github.com/JPeer264>
* @deprecated in ESLint v8.53.0
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "array-bracket-newline",
url: "https://eslint.style/rules/array-bracket-newline",
},
},
],
},
type: "layout",
docs: {
description:
"Enforce linebreaks after opening and before closing array brackets",
recommended: false,
url: "https://eslint.org/docs/latest/rules/array-bracket-newline",
},
fixable: "whitespace",
schema: [
{
oneOf: [
{
enum: ["always", "never", "consistent"],
},
{
type: "object",
properties: {
multiline: {
type: "boolean",
},
minItems: {
type: ["integer", "null"],
minimum: 0,
},
},
additionalProperties: false,
},
],
},
],
messages: {
unexpectedOpeningLinebreak:
"There should be no linebreak after '['.",
unexpectedClosingLinebreak:
"There should be no linebreak before ']'.",
missingOpeningLinebreak: "A linebreak is required after '['.",
missingClosingLinebreak: "A linebreak is required before ']'.",
},
},
create(context) {
const sourceCode = context.sourceCode;
//----------------------------------------------------------------------
// Helpers
//----------------------------------------------------------------------
/**
* Normalizes a given option value.
* @param {string|Object|undefined} option An option value to parse.
* @returns {{multiline: boolean, minItems: number}} Normalized option object.
*/
function normalizeOptionValue(option) {
let consistent = false;
let multiline = false;
let minItems;
if (option) {
if (option === "consistent") {
consistent = true;
minItems = Number.POSITIVE_INFINITY;
} else if (option === "always" || option.minItems === 0) {
minItems = 0;
} else if (option === "never") {
minItems = Number.POSITIVE_INFINITY;
} else {
multiline = Boolean(option.multiline);
minItems = option.minItems || Number.POSITIVE_INFINITY;
}
} else {
consistent = false;
multiline = true;
minItems = Number.POSITIVE_INFINITY;
}
return { consistent, multiline, minItems };
}
/**
* Normalizes a given option value.
* @param {string|Object|undefined} options An option value to parse.
* @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object.
*/
function normalizeOptions(options) {
const value = normalizeOptionValue(options);
return { ArrayExpression: value, ArrayPattern: value };
}
/**
* Reports that there shouldn't be a linebreak after the first token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportNoBeginningLinebreak(node, token) {
context.report({
node,
loc: token.loc,
messageId: "unexpectedOpeningLinebreak",
fix(fixer) {
const nextToken = sourceCode.getTokenAfter(token, {
includeComments: true,
});
if (astUtils.isCommentToken(nextToken)) {
return null;
}
return fixer.removeRange([
token.range[1],
nextToken.range[0],
]);
},
});
}
/**
* Reports that there shouldn't be a linebreak before the last token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportNoEndingLinebreak(node, token) {
context.report({
node,
loc: token.loc,
messageId: "unexpectedClosingLinebreak",
fix(fixer) {
const previousToken = sourceCode.getTokenBefore(token, {
includeComments: true,
});
if (astUtils.isCommentToken(previousToken)) {
return null;
}
return fixer.removeRange([
previousToken.range[1],
token.range[0],
]);
},
});
}
/**
* Reports that there should be a linebreak after the first token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportRequiredBeginningLinebreak(node, token) {
context.report({
node,
loc: token.loc,
messageId: "missingOpeningLinebreak",
fix(fixer) {
return fixer.insertTextAfter(token, "\n");
},
});
}
/**
* Reports that there should be a linebreak before the last token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportRequiredEndingLinebreak(node, token) {
context.report({
node,
loc: token.loc,
messageId: "missingClosingLinebreak",
fix(fixer) {
return fixer.insertTextBefore(token, "\n");
},
});
}
/**
* Reports a given node if it violated this rule.
* @param {ASTNode} node A node to check. This is an ArrayExpression node or an ArrayPattern node.
* @returns {void}
*/
function check(node) {
const elements = node.elements;
const normalizedOptions = normalizeOptions(context.options[0]);
const options = normalizedOptions[node.type];
const openBracket = sourceCode.getFirstToken(node);
const closeBracket = sourceCode.getLastToken(node);
const firstIncComment = sourceCode.getTokenAfter(openBracket, {
includeComments: true,
});
const lastIncComment = sourceCode.getTokenBefore(closeBracket, {
includeComments: true,
});
const first = sourceCode.getTokenAfter(openBracket);
const last = sourceCode.getTokenBefore(closeBracket);
const needsLinebreaks =
elements.length >= options.minItems ||
(options.multiline &&
elements.length > 0 &&
firstIncComment.loc.start.line !==
lastIncComment.loc.end.line) ||
(elements.length === 0 &&
firstIncComment.type === "Block" &&
firstIncComment.loc.start.line !==
lastIncComment.loc.end.line &&
firstIncComment === lastIncComment) ||
(options.consistent &&
openBracket.loc.end.line !== first.loc.start.line);
/*
* Use tokens or comments to check multiline or not.
* But use only tokens to check whether linebreaks are needed.
* This allows:
* var arr = [ // eslint-disable-line foo
* 'a'
* ]
*/
if (needsLinebreaks) {
if (astUtils.isTokenOnSameLine(openBracket, first)) {
reportRequiredBeginningLinebreak(node, openBracket);
}
if (astUtils.isTokenOnSameLine(last, closeBracket)) {
reportRequiredEndingLinebreak(node, closeBracket);
}
} else {
if (!astUtils.isTokenOnSameLine(openBracket, first)) {
reportNoBeginningLinebreak(node, openBracket);
}
if (!astUtils.isTokenOnSameLine(last, closeBracket)) {
reportNoEndingLinebreak(node, closeBracket);
}
}
}
//----------------------------------------------------------------------
// Public
//----------------------------------------------------------------------
return {
ArrayPattern: check,
ArrayExpression: check,
};
},
};
@@ -0,0 +1,229 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports._containerInsert = _containerInsert;
exports._containerInsertAfter = _containerInsertAfter;
exports._containerInsertBefore = _containerInsertBefore;
exports._verifyNodeList = _verifyNodeList;
exports.insertAfter = insertAfter;
exports.insertBefore = insertBefore;
exports.pushContainer = pushContainer;
exports.unshiftContainer = unshiftContainer;
exports.updateSiblingKeys = updateSiblingKeys;
var _cache = require("../cache.js");
var _index = require("./index.js");
var _context = require("./context.js");
var _removal = require("./removal.js");
var _t = require("@babel/types");
var _hoister = require("./lib/hoister.js");
const {
arrowFunctionExpression,
assertExpression,
assignmentExpression,
blockStatement,
callExpression,
cloneNode,
expressionStatement,
isAssignmentExpression,
isCallExpression,
isExportNamedDeclaration,
isExpression,
isIdentifier,
isSequenceExpression,
isSuper,
thisExpression
} = _t;
function insertBefore(nodes_) {
_removal._assertUnremoved.call(this);
const nodes = _verifyNodeList.call(this, nodes_);
const {
parentPath,
parent
} = this;
if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || isExportNamedDeclaration(parent) || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
return parentPath.insertBefore(nodes);
} else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
if (this.node) nodes.push(this.node);
return this.replaceExpressionWithStatements(nodes);
} else if (Array.isArray(this.container)) {
return _containerInsertBefore.call(this, nodes);
} else if (this.isStatementOrBlock()) {
const node = this.node;
const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null);
const [blockPath] = this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : []));
return blockPath.unshiftContainer("body", nodes);
} else {
throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
}
}
function _containerInsert(from, nodes) {
updateSiblingKeys.call(this, from, nodes.length);
const paths = [];
this.container.splice(from, 0, ...nodes);
for (let i = 0; i < nodes.length; i++) {
var _this$context;
const to = from + i;
const path = this.getSibling(to);
paths.push(path);
if ((_this$context = this.context) != null && _this$context.queue) {
_context.pushContext.call(path, this.context);
}
}
const contexts = _context._getQueueContexts.call(this);
for (const path of paths) {
_context.setScope.call(path);
path.debug("Inserted.");
for (const context of contexts) {
context.maybeQueue(path, true);
}
}
return paths;
}
function _containerInsertBefore(nodes) {
return _containerInsert.call(this, this.key, nodes);
}
function _containerInsertAfter(nodes) {
return _containerInsert.call(this, this.key + 1, nodes);
}
const last = arr => arr[arr.length - 1];
function isHiddenInSequenceExpression(path) {
return isSequenceExpression(path.parent) && (last(path.parent.expressions) !== path.node || isHiddenInSequenceExpression(path.parentPath));
}
function isAlmostConstantAssignment(node, scope) {
if (!isAssignmentExpression(node) || !isIdentifier(node.left)) {
return false;
}
const blockScope = scope.getBlockParent();
return blockScope.hasOwnBinding(node.left.name) && blockScope.getOwnBinding(node.left.name).constantViolations.length <= 1;
}
function insertAfter(nodes_) {
_removal._assertUnremoved.call(this);
if (this.isSequenceExpression()) {
return last(this.get("expressions")).insertAfter(nodes_);
}
const nodes = _verifyNodeList.call(this, nodes_);
const {
parentPath,
parent
} = this;
if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || isExportNamedDeclaration(parent) || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
return parentPath.insertAfter(nodes.map(node => {
return isExpression(node) ? expressionStatement(node) : node;
}));
} else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
const self = this;
if (self.node) {
const node = self.node;
let {
scope
} = this;
if (scope.path.isPattern()) {
assertExpression(node);
self.replaceWith(callExpression(arrowFunctionExpression([], node), []));
self.get("callee.body").insertAfter(nodes);
return [self];
}
if (isHiddenInSequenceExpression(self)) {
nodes.unshift(node);
} else if (isCallExpression(node) && isSuper(node.callee)) {
nodes.unshift(node);
nodes.push(thisExpression());
} else if (isAlmostConstantAssignment(node, scope)) {
nodes.unshift(node);
nodes.push(cloneNode(node.left));
} else if (scope.isPure(node, true)) {
nodes.push(node);
} else {
if (parentPath.isMethod({
computed: true,
key: node
})) {
scope = scope.parent;
}
const temp = scope.generateDeclaredUidIdentifier();
nodes.unshift(expressionStatement(assignmentExpression("=", cloneNode(temp), node)));
nodes.push(expressionStatement(cloneNode(temp)));
}
}
return this.replaceExpressionWithStatements(nodes);
} else if (Array.isArray(this.container)) {
return _containerInsertAfter.call(this, nodes);
} else if (this.isStatementOrBlock()) {
const node = this.node;
const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null);
const [blockPath] = this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : []));
return blockPath.pushContainer("body", nodes);
} else {
throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
}
}
function updateSiblingKeys(fromIndex, incrementBy) {
if (!this.parent) return;
const paths = (0, _cache.getCachedPaths)(this);
if (!paths) return;
for (const [, path] of paths) {
if (typeof path.key === "number" && path.container === this.container && path.key >= fromIndex) {
path.key += incrementBy;
}
}
}
function _verifyNodeList(nodes) {
if (!nodes) {
return [];
}
if (!Array.isArray(nodes)) {
nodes = [nodes];
}
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
let msg;
if (!node) {
msg = "has falsy node";
} else if (typeof node !== "object") {
msg = "contains a non-object node";
} else if (!node.type) {
msg = "without a type";
} else if (node instanceof _index.default) {
msg = "has a NodePath when it expected a raw object";
}
if (msg) {
const type = Array.isArray(node) ? "array" : typeof node;
throw new Error(`Node list ${msg} with the index of ${i} and type of ${type}`);
}
}
return nodes;
}
function unshiftContainer(listKey, nodes) {
_removal._assertUnremoved.call(this);
const verifiedNodes = _verifyNodeList.call(this, nodes);
const container = this.node[listKey];
const path = _index.default.get({
parentPath: this,
parent: this.node,
container,
listKey,
key: 0
}).setContext(this.context);
return _containerInsertBefore.call(path, verifiedNodes);
}
function pushContainer(listKey, nodes) {
_removal._assertUnremoved.call(this);
const verifiedNodes = _verifyNodeList.call(this, nodes);
const container = this.node[listKey];
const path = _index.default.get({
parentPath: this,
parent: this.node,
container,
listKey,
key: container.length
}).setContext(this.context);
return path.replaceWithMultiple(verifiedNodes);
}
exports.hoist = function hoist(scope = this.scope) {
const hoister = new _hoister.default(this, scope);
return hoister.run();
};
//# sourceMappingURL=modification.js.map
@@ -0,0 +1,616 @@
flf2a$ 6 3 8 0 3
Cursive By Joan Stark
Website: http://www.geocities.com/SoHo/7373/
Figlet conversion by patorjk, April 17, 2008
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
__, @
(_/(_@
@
@
@@
@
/_@
_/_)@
@
@
@@
@
__ @
_(_,_@
@
@
@@
@
__/ @
_(_/(_@
@
@
@@
@
_ @
_(/_@
@
@
@@
@
/)@
_//_@
_/ @
/) @
` @@
@
__ @
_(_/_@
_/_ @
(/ @
@@
@
/_ @
_/ (_@
@
@
@@
@
.@
_/_@
@
@
@@
@
.@
_/_@
_/_ @
(/ @
@@
@
/,@
_/(_@
@
@
@@
_@
//@
_(/_@
@
@
@@
@
,____, @
_/ / / (_@
@
@
@@
@
,__, @
_/ / (_@
@
@
@@
@
_,_@
_(_/ @
@
@
@@
@
,_ @
_/_)_@
/ @
/ @
@@
@
__ @
_(_/_@
_/ @
/) @
` @@
@
,_ @
_/ (_@
@
@
@@
@
, @
_/_)_@
@
@
@@
@
-/-@
_/_ @
@
@
@@
@
@
_(_/_@
@
@
@@
@
_, @
(_/_@
@
@
@@
@
,_@
_/_/_/ @
@
@
@@
_ ,_@
_/ )/ @
_/(_ @
@
@
@@
@
_(_/_@
_/_ @
(/ @
@
@@
@
_/)_ @
_/_@
(/ @
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
__, @
(_/(_@
@
@
@@
@
/_@
_/_)@
@
@
@@
@
__ @
_(_,_@
@
@
@@
@
__/ @
_(_/(_@
@
@
@@
@
_ @
_(/_@
@
@
@@
@
/)@
_//_@
_/ @
/) @
` @@
@
__ @
_(_/_@
_/_ @
(/ @
@@
@
/_ @
_/ (_@
@
@
@@
@
.@
_/_@
@
@
@@
@
.@
_/_@
_/_ @
(/ @
@@
@
/,@
_/(_@
@
@
@@
_@
//@
_(/_@
@
@
@@
@
,____, @
_/ / / (_@
@
@
@@
@
,__, @
_/ / (_@
@
@
@@
@
_,_@
_(_/ @
@
@
@@
@
,_ @
_/_)_@
/ @
/ @
@@
@
__ @
_(_/_@
_/ @
/) @
` @@
@
,_ @
_/ (_@
@
@
@@
@
, @
_/_)_@
@
@
@@
@
-/-@
_/_ @
@
@
@@
@
@
_(_/_@
@
@
@@
@
_, @
(_/_@
@
@
@@
@
,_@
_/_/_/ @
@
@
@@
_ ,_@
_/ )/ @
_/(_ @
@
@
@@
@
@
_(_/_@
_/_ @
(/ @
@@
@
@
_/)_ @
_/_@
(/ @
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@
@
@
@
@
@@
@@ -0,0 +1 @@
{"version":3,"file":"chevron-right.js","sources":["../../../src/icons/chevron-right.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChevronRight\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtOSAxOCA2LTYtNi02IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/chevron-right\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 ChevronRight = createLucideIcon('ChevronRight', [\n ['path', { d: 'm9 18 6-6-6-6', key: 'mthhwq' }],\n]);\n\nexport default ChevronRight;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,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;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,70 @@
deep-is
==========
Node's `assert.deepEqual() algorithm` as a standalone module. Exactly like
[deep-equal](https://github.com/substack/node-deep-equal) except for the fact that `deepEqual(NaN, NaN) === true`.
This module is around [5 times faster](https://gist.github.com/2790507)
than wrapping `assert.deepEqual()` in a `try/catch`.
[![browser support](http://ci.testling.com/thlorenz/deep-is.png)](http://ci.testling.com/thlorenz/deep-is)
[![build status](https://secure.travis-ci.org/thlorenz/deep-is.png)](http://travis-ci.org/thlorenz/deep-is)
example
=======
``` js
var equal = require('deep-is');
console.dir([
equal(
{ a : [ 2, 3 ], b : [ 4 ] },
{ a : [ 2, 3 ], b : [ 4 ] }
),
equal(
{ x : 5, y : [6] },
{ x : 5, y : 6 }
)
]);
```
methods
=======
var deepIs = require('deep-is')
deepIs(a, b)
---------------
Compare objects `a` and `b`, returning whether they are equal according to a
recursive equality algorithm.
install
=======
With [npm](http://npmjs.org) do:
```
npm install deep-is
```
test
====
With [npm](http://npmjs.org) do:
```
npm test
```
license
=======
Copyright (c) 2012, 2013 Thorsten Lorenz <thlorenz@gmx.de>
Copyright (c) 2012 James Halliday <mail@substack.net>
Derived largely from node's assert module, which has the copyright statement:
Copyright (c) 2009 Thomas Robinson <280north.com>
Released under the MIT license, see LICENSE for details.
@@ -0,0 +1,119 @@
'use strict';
var _const = require('../../data/const.cjs');
var types = require('../../types.cjs');
/*
*-------------------------------------------------------------------------------
* sequences (abcdef) ------------------------------
*-------------------------------------------------------------------------------
*/
class MatchSequence extends types.MatcherBaseClass {
constructor() {
super(...arguments);
this.MAX_DELTA = 5;
}
// eslint-disable-next-line max-statements
match({
password
}) {
/*
* Identifies sequences by looking for repeated differences in unicode codepoint.
* this allows skipping, such as 9753, and also matches some extended unicode sequences
* such as Greek and Cyrillic alphabets.
*
* for example, consider the input 'abcdb975zy'
*
* password: a b c d b 9 7 5 z y
* index: 0 1 2 3 4 5 6 7 8 9
* delta: 1 1 1 -2 -41 -2 -2 69 1
*
* expected result:
* [(i, j, delta), ...] = [(0, 3, 1), (5, 7, -2), (8, 9, 1)]
*/
const result = [];
if (password.length === 1) {
return [];
}
let i = 0;
let lastDelta = null;
const passwordLength = password.length;
for (let k = 1; k < passwordLength; k += 1) {
const delta = password.charCodeAt(k) - password.charCodeAt(k - 1);
if (lastDelta === null) {
lastDelta = delta;
}
if (delta !== lastDelta) {
const j = k - 1;
this.update({
i,
j,
delta: lastDelta,
password,
result
});
i = j;
lastDelta = delta;
}
}
this.update({
i,
j: passwordLength - 1,
delta: lastDelta,
password,
result
});
return result;
}
update({
i,
j,
delta,
password,
result
}) {
if (j - i > 1 || Math.abs(delta) === 1) {
const absoluteDelta = Math.abs(delta);
if (absoluteDelta > 0 && absoluteDelta <= this.MAX_DELTA) {
const token = password.slice(i, j + 1 || 9e9);
const {
sequenceName,
sequenceSpace
} = this.getSequence(token);
return result.push({
pattern: 'sequence',
i,
j,
token: password.slice(i, j + 1 || 9e9),
sequenceName,
sequenceSpace,
ascending: delta > 0
});
}
}
return null;
}
getSequence(token) {
// TODO conservatively stick with roman alphabet size.
// (this could be improved)
let sequenceName = 'unicode';
let sequenceSpace = 26;
if (_const.ALL_LOWER.test(token)) {
sequenceName = 'lower';
sequenceSpace = 26;
} else if (_const.ALL_UPPER.test(token)) {
sequenceName = 'upper';
sequenceSpace = 26;
} else if (_const.ALL_DIGIT.test(token)) {
sequenceName = 'digits';
sequenceSpace = 10;
}
return {
sequenceName,
sequenceSpace
};
}
}
module.exports = MatchSequence;
//# sourceMappingURL=matching.cjs.map
@@ -0,0 +1,65 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = removeTypeDuplicates;
var _index = require("../../validators/generated/index.js");
function getQualifiedName(node) {
return (0, _index.isIdentifier)(node) ? node.name : `${node.id.name}.${getQualifiedName(node.qualification)}`;
}
function removeTypeDuplicates(nodesIn) {
const nodes = Array.from(nodesIn);
const generics = new Map();
const bases = new Map();
const typeGroups = new Set();
const types = [];
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (!node) continue;
if (types.includes(node)) {
continue;
}
if ((0, _index.isAnyTypeAnnotation)(node)) {
return [node];
}
if ((0, _index.isFlowBaseAnnotation)(node)) {
bases.set(node.type, node);
continue;
}
if ((0, _index.isUnionTypeAnnotation)(node)) {
if (!typeGroups.has(node.types)) {
nodes.push(...node.types);
typeGroups.add(node.types);
}
continue;
}
if ((0, _index.isGenericTypeAnnotation)(node)) {
const name = getQualifiedName(node.id);
if (generics.has(name)) {
let existing = generics.get(name);
if (existing.typeParameters) {
if (node.typeParameters) {
existing.typeParameters.params.push(...node.typeParameters.params);
existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params);
}
} else {
existing = node.typeParameters;
}
} else {
generics.set(name, node);
}
continue;
}
types.push(node);
}
for (const [, baseType] of bases) {
types.push(baseType);
}
for (const [, genericName] of generics) {
types.push(genericName);
}
return types;
}
//# sourceMappingURL=removeTypeDuplicates.js.map
@@ -0,0 +1 @@
{"version":3,"file":"git-pull-request-create-arrow.js","sources":["../../../src/icons/git-pull-request-create-arrow.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name GitPullRequestCreateArrow\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSI1IiBjeT0iNiIgcj0iMyIgLz4KICA8cGF0aCBkPSJNNSA5djEyIiAvPgogIDxwYXRoIGQ9Im0xNSA5LTMtMyAzLTMiIC8+CiAgPHBhdGggZD0iTTEyIDZoNWEyIDIgMCAwIDEgMiAydjMiIC8+CiAgPHBhdGggZD0iTTE5IDE1djYiIC8+CiAgPHBhdGggZD0iTTIyIDE4aC02IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/git-pull-request-create-arrow\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 GitPullRequestCreateArrow = createLucideIcon('GitPullRequestCreateArrow', [\n ['circle', { cx: '5', cy: '6', r: '3', key: '1qnov2' }],\n ['path', { d: 'M5 9v12', key: 'ih889a' }],\n ['path', { d: 'm15 9-3-3 3-3', key: '1lwv8l' }],\n ['path', { d: 'M12 6h5a2 2 0 0 1 2 2v3', key: '1rbwk6' }],\n ['path', { d: 'M19 15v6', key: '10aioa' }],\n ['path', { d: 'M22 18h-6', key: '1d5gi5' }],\n]);\n\nexport default GitPullRequestCreateArrow;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA4B,iBAAiB,2BAA6B,CAAA,CAAA,CAAA;AAAA,CAC9E,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxD,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,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,136 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReadEntry = void 0;
const minipass_1 = require("minipass");
const normalize_windows_path_js_1 = require("./normalize-windows-path.js");
class ReadEntry extends minipass_1.Minipass {
extended;
globalExtended;
header;
startBlockSize;
blockRemain;
remain;
type;
meta = false;
ignore = false;
path;
mode;
uid;
gid;
uname;
gname;
size = 0;
mtime;
atime;
ctime;
linkpath;
dev;
ino;
nlink;
invalid = false;
absolute;
unsupported = false;
constructor(header, ex, gex) {
super({});
// read entries always start life paused. this is to avoid the
// situation where Minipass's auto-ending empty streams results
// in an entry ending before we're ready for it.
this.pause();
this.extended = ex;
this.globalExtended = gex;
this.header = header;
/* c8 ignore start */
this.remain = header.size ?? 0;
/* c8 ignore stop */
this.startBlockSize = 512 * Math.ceil(this.remain / 512);
this.blockRemain = this.startBlockSize;
this.type = header.type;
switch (this.type) {
case 'File':
case 'OldFile':
case 'Link':
case 'SymbolicLink':
case 'CharacterDevice':
case 'BlockDevice':
case 'Directory':
case 'FIFO':
case 'ContiguousFile':
case 'GNUDumpDir':
break;
case 'NextFileHasLongLinkpath':
case 'NextFileHasLongPath':
case 'OldGnuLongPath':
case 'GlobalExtendedHeader':
case 'ExtendedHeader':
case 'OldExtendedHeader':
this.meta = true;
break;
// NOTE: gnutar and bsdtar treat unrecognized types as 'File'
// it may be worth doing the same, but with a warning.
default:
this.ignore = true;
}
/* c8 ignore start */
if (!header.path) {
throw new Error('no path provided for tar.ReadEntry');
}
/* c8 ignore stop */
this.path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(header.path);
this.mode = header.mode;
if (this.mode) {
this.mode = this.mode & 0o7777;
}
this.uid = header.uid;
this.gid = header.gid;
this.uname = header.uname;
this.gname = header.gname;
this.size = this.remain;
this.mtime = header.mtime;
this.atime = header.atime;
this.ctime = header.ctime;
/* c8 ignore start */
this.linkpath =
header.linkpath ? (0, normalize_windows_path_js_1.normalizeWindowsPath)(header.linkpath) : undefined;
/* c8 ignore stop */
this.uname = header.uname;
this.gname = header.gname;
if (ex) {
this.#slurp(ex);
}
if (gex) {
this.#slurp(gex, true);
}
}
write(data) {
const writeLen = data.length;
if (writeLen > this.blockRemain) {
throw new Error('writing more to entry than is appropriate');
}
const r = this.remain;
const br = this.blockRemain;
this.remain = Math.max(0, r - writeLen);
this.blockRemain = Math.max(0, br - writeLen);
if (this.ignore) {
return true;
}
if (r >= writeLen) {
return super.write(data);
}
// r < writeLen
return super.write(data.subarray(0, r));
}
#slurp(ex, gex = false) {
if (ex.path)
ex.path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(ex.path);
if (ex.linkpath)
ex.linkpath = (0, normalize_windows_path_js_1.normalizeWindowsPath)(ex.linkpath);
Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
// we slurp in everything except for the path attribute in
// a global extended header, because that's weird. Also, any
// null/undefined values are ignored.
return !(v === null || v === undefined || (k === 'path' && gex));
})));
}
}
exports.ReadEntry = ReadEntry;
//# sourceMappingURL=read-entry.js.map
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ReceiptPoundSterling = createLucideIcon("ReceiptPoundSterling", [
[
"path",
{ d: "M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z", key: "q3az6g" }
],
["path", { d: "M8 13h5", key: "1k9z8w" }],
["path", { d: "M10 17V9.5a2.5 2.5 0 0 1 5 0", key: "1dzgp0" }],
["path", { d: "M8 17h7", key: "8mjdqu" }]
]);
export { ReceiptPoundSterling as default };
//# sourceMappingURL=receipt-pound-sterling.js.map
@@ -0,0 +1,2 @@
export * from "./node-hfs.js";
export { Hfs } from "@humanfs/core";
@@ -0,0 +1 @@
{"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/nullable.ts"],"names":[],"mappings":";;;AACA,mDAA6D;AAE7D,SAAgB,aAAa,CAC3B,EAAC,GAAG,EAAE,IAAI,EAAE,YAAY,EAAa,EACrC,OAAa,aAAG;IAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC1B,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,CAAC,CAAA;QACnC,IAAI,GAAG,IAAA,aAAG,EAAC,KAAK,CAAC,CAAA;IACnB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IACvB,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAZD,sCAYC;AAED,SAAgB,mBAAmB,CAAC,GAAe,EAAE,IAAU;IAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC/C,OAAO,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,KAAK,cAAc,GAAG,CAAC,IAAI,kCAAkC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAA;AAC9F,CAAC;AAHD,kDAGC"}
@@ -0,0 +1 @@
{"version":3,"file":"clamp.mjs","sources":["../../src/clamp.ts"],"sourcesContent":["export const clamp = (min: number, max: number, v: number) => {\n if (v > max) return max\n if (v < min) return min\n return v\n}\n"],"names":[],"mappings":"AAAO,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,CAAS,KAAI;IACzD,IAAI,CAAC,GAAG,GAAG;AAAE,QAAA,OAAO,GAAG;IACvB,IAAI,CAAC,GAAG,GAAG;AAAE,QAAA,OAAO,GAAG;AACvB,IAAA,OAAO,CAAC;AACZ;;;;"}
@@ -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 SquarePilcrow = createLucideIcon("SquarePilcrow", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M12 12H9.5a2.5 2.5 0 0 1 0-5H17", key: "1l9586" }],
["path", { d: "M12 7v10", key: "jspqdw" }],
["path", { d: "M16 7v10", key: "lavkr4" }]
]);
export { SquarePilcrow as default };
//# sourceMappingURL=square-pilcrow.js.map
@@ -0,0 +1,154 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const React = require("react");
const reactDom = require("react-dom");
const virtualCore = require("@tanstack/virtual-core");
function _interopNamespaceDefault(e) {
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
if (e) {
for (const k in e) {
if (k !== "default") {
const d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: () => e[k]
});
}
}
}
n.default = e;
return Object.freeze(n);
}
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
const useIsomorphicLayoutEffect = typeof document !== "undefined" ? React__namespace.useLayoutEffect : React__namespace.useEffect;
function useVirtualizerBase({
useFlushSync = true,
directDomUpdates = false,
directDomUpdatesMode = "transform",
...options
}) {
const rerender = React__namespace.useReducer((x) => x + 1, 0)[1];
const directRef = React__namespace.useRef({
enabled: directDomUpdates,
mode: directDomUpdatesMode,
container: null,
lastSize: null,
// Keyed by the element itself so a remounted node (same key, new DOM
// node — e.g. when `enabled` is toggled off then on) is treated as fresh
// and gets its style written.
lastPositions: /* @__PURE__ */ new WeakMap(),
prevRange: null
});
directRef.current.enabled = directDomUpdates;
directRef.current.mode = directDomUpdatesMode;
const applyDirectStyles = (instance2) => {
const state = directRef.current;
if (!state.enabled || !state.container) return;
const totalSize = instance2.getTotalSize();
if (totalSize !== state.lastSize) {
state.lastSize = totalSize;
const sizeAxis = instance2.options.horizontal ? "width" : "height";
state.container.style[sizeAxis] = `${totalSize}px`;
}
const horizontal = !!instance2.options.horizontal;
const useTransform = state.mode === "transform";
const posAxis = horizontal ? "left" : "top";
const scrollMargin = instance2.options.scrollMargin;
const items = instance2.getVirtualItems();
for (const item of items) {
const next = item.start - scrollMargin;
const el = instance2.elementsCache.get(item.key);
if (!el) continue;
if (state.lastPositions.get(el) === next) continue;
state.lastPositions.set(el, next);
if (useTransform) {
el.style.transform = horizontal ? `translate3d(${next}px, 0, 0)` : `translate3d(0, ${next}px, 0)`;
} else {
el.style[posAxis] = `${next}px`;
}
}
};
const resolvedOptions = {
...options,
onChange: (instance2, sync) => {
var _a;
const state = directRef.current;
let shouldRerender = true;
if (state.enabled) {
applyDirectStyles(instance2);
const range = instance2.range;
const prev = state.prevRange;
shouldRerender = !prev || prev.isScrolling !== instance2.isScrolling || prev.startIndex !== (range == null ? void 0 : range.startIndex) || prev.endIndex !== (range == null ? void 0 : range.endIndex);
if (shouldRerender) {
state.prevRange = range ? {
startIndex: range.startIndex,
endIndex: range.endIndex,
isScrolling: instance2.isScrolling
} : null;
}
}
if (shouldRerender) {
if (useFlushSync && sync) {
reactDom.flushSync(rerender);
} else {
rerender();
}
}
(_a = options.onChange) == null ? void 0 : _a.call(options, instance2, sync);
}
};
const [instance] = React__namespace.useState(() => {
const v = new virtualCore.Virtualizer(resolvedOptions);
return Object.assign(v, {
containerRef: (node) => {
const state = directRef.current;
state.container = node;
state.lastSize = null;
if (node && state.enabled) {
const total = v.getTotalSize();
state.lastSize = total;
const axis = v.options.horizontal ? "width" : "height";
node.style[axis] = `${total}px`;
}
}
});
});
instance.setOptions(resolvedOptions);
useIsomorphicLayoutEffect(() => {
return instance._didMount();
}, []);
useIsomorphicLayoutEffect(() => {
return instance._willUpdate();
});
useIsomorphicLayoutEffect(() => {
applyDirectStyles(instance);
});
return instance;
}
function useVirtualizer(options) {
return useVirtualizerBase({
observeElementRect: virtualCore.observeElementRect,
observeElementOffset: virtualCore.observeElementOffset,
scrollToFn: virtualCore.elementScroll,
...options
});
}
function useWindowVirtualizer(options) {
return useVirtualizerBase({
getScrollElement: () => typeof document !== "undefined" ? window : null,
observeElementRect: virtualCore.observeWindowRect,
observeElementOffset: virtualCore.observeWindowOffset,
scrollToFn: virtualCore.windowScroll,
initialOffset: () => typeof document !== "undefined" ? window.scrollY : 0,
...options
});
}
exports.useVirtualizer = useVirtualizer;
exports.useWindowVirtualizer = useWindowVirtualizer;
Object.keys(virtualCore).forEach((k) => {
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
enumerable: true,
get: () => virtualCore[k]
});
});
//# sourceMappingURL=index.cjs.map
@@ -0,0 +1,40 @@
# Acorn-JSX
[![Build Status](https://travis-ci.org/acornjs/acorn-jsx.svg?branch=master)](https://travis-ci.org/acornjs/acorn-jsx)
[![NPM version](https://img.shields.io/npm/v/acorn-jsx.svg)](https://www.npmjs.org/package/acorn-jsx)
This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript.
It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser. Later, it replaced the [official parser](https://github.com/facebookarchive/esprima) and these days is used by many prominent development tools.
## Transpiler
Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out [Babel](https://babeljs.io/) and [Buble](https://buble.surge.sh/) transpilers which use `acorn-jsx` under the hood.
## Usage
Requiring this module provides you with an Acorn plugin that you can use like this:
```javascript
var acorn = require("acorn");
var jsx = require("acorn-jsx");
acorn.Parser.extend(jsx()).parse("my(<jsx/>, 'code');");
```
Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in `<namespace:Object.Property />`, so it was deprecated in `acorn-jsx@3.0`. If you still want to opt-in to support of such constructions, you can pass the following option:
```javascript
acorn.Parser.extend(jsx({ allowNamespacedObjects: true }))
```
Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely:
```javascript
acorn.Parser.extend(jsx({ allowNamespaces: false }))
```
Note that by default `allowNamespaces` is enabled for spec compliancy.
## License
This plugin is issued under the [MIT license](./LICENSE).
@@ -0,0 +1,91 @@
/**
* dd-elements.ts 12.6.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/
import { DDResizable } from './dd-resizable';
import { DDDraggable } from './dd-draggable';
import { DDDroppable } from './dd-droppable';
export class DDElement {
static init(el) {
if (!el.ddElement) {
el.ddElement = new DDElement(el);
}
return el.ddElement;
}
constructor(el) {
this.el = el;
}
on(eventName, callback) {
if (this.ddDraggable && ['drag', 'dragstart', 'dragstop'].indexOf(eventName) > -1) {
this.ddDraggable.on(eventName, callback);
}
else if (this.ddDroppable && ['drop', 'dropover', 'dropout'].indexOf(eventName) > -1) {
this.ddDroppable.on(eventName, callback);
}
else if (this.ddResizable && ['resizestart', 'resize', 'resizestop'].indexOf(eventName) > -1) {
this.ddResizable.on(eventName, callback);
}
return this;
}
off(eventName) {
if (this.ddDraggable && ['drag', 'dragstart', 'dragstop'].indexOf(eventName) > -1) {
this.ddDraggable.off(eventName);
}
else if (this.ddDroppable && ['drop', 'dropover', 'dropout'].indexOf(eventName) > -1) {
this.ddDroppable.off(eventName);
}
else if (this.ddResizable && ['resizestart', 'resize', 'resizestop'].indexOf(eventName) > -1) {
this.ddResizable.off(eventName);
}
return this;
}
setupDraggable(opts) {
if (!this.ddDraggable) {
this.ddDraggable = new DDDraggable(this.el, opts);
}
else {
this.ddDraggable.updateOption(opts);
}
return this;
}
cleanDraggable() {
if (this.ddDraggable) {
this.ddDraggable.destroy();
delete this.ddDraggable;
}
return this;
}
setupResizable(opts) {
if (!this.ddResizable) {
this.ddResizable = new DDResizable(this.el, opts);
}
else {
this.ddResizable.updateOption(opts);
}
return this;
}
cleanResizable() {
if (this.ddResizable) {
this.ddResizable.destroy();
delete this.ddResizable;
}
return this;
}
setupDroppable(opts) {
if (!this.ddDroppable) {
this.ddDroppable = new DDDroppable(this.el, opts);
}
else {
this.ddDroppable.updateOption(opts);
}
return this;
}
cleanDroppable() {
if (this.ddDroppable) {
this.ddDroppable.destroy();
delete this.ddDroppable;
}
return this;
}
}
//# sourceMappingURL=dd-element.js.map
@@ -0,0 +1,630 @@
export default `flf2a$ 6 5 10 16 16
Avatar by Claude Martins 02/95
Figlet release 2.1 -- 12 Aug 1994
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be \`a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
6 - height of a character
5 - height of a character, not including descenders
10 - max line length (excluding comment lines) + a fudge factor
16 - default smushmode for this font
16 - number of comment lines
$$@
$$@
$$@
$$@
$$@
$$@@
_ @
/ \\@
| |@
\\_/@
(_)@
@@
_ _@
\\||/@
@
@
@
@@
@
_/|_|\\_@
\\ _ /@
/ _ \\@
\\| |/ @
@@
/| @
/ _\\@
\\ \\ @
_\\ \\@
\\ /@
|/ @@
_ @
\\|/\\ @
/ / @
/ /_ @
\\/ \\|@
@@
_ @
/.\\ @
\\ _\\_@
/|/ /@
\\__/\\@
@@
_@
|/@
@
@
@
@@
___@
/ _/@
|/ @
|\\_ @
\\__\\@
@@
___ @
\\_ \\@
\\|@
_/|@
/__/@
@@
@
_/||\\_@
\\ /@
/ \\@
\\||/ @
@@
_ @
_| |_ @
|_ _|@
|_| @
@
@@
@
@
@
@
_@
|/@@
@
@
_____ @
\\____\\@
@
@@
@
@
@
__@
\\/@
@@
@
/\\@
/ /@
/ / @
\\/ @
@@
____ @
/ _ \\@
| / \\|@
| \\_/|@
\\____/@
@@
_ @
/ \\@
| |@
| |@
\\_/@
@@
____ @
/_ \\@
/ /@
/ /_@
\\____/@
@@
_____ @
\\__ \\@
/ |@
_\\ |@
/____/@
@@
_ @
/\\ / |@
\\_\\| |@
| |@
\\_|@
@@
____ @
/ ___\\@
| \\@
\\___ |@
\\____/@
@@
_ @
__/ \\@
/__ |@
|\\/ |@
\\____/@
@@
____ @
/ _ \\@
\\/ | |@
| |@
\\_/@
@@
____ @
/ ___\\@
\\ \\ //@
/ /_\\\\@
\\____/@
@@
____ @
/__ \\@
|\\/ |@
\\__ |@
\\_/@
@@
@
__@
\\/@
__@
\\/@
@@
@
@
__@
\\/@
_@
|/@@
___@
/ _/@
/ / @
\\ \\_ @
\\__\\@
@@
@
_____ @
\\____\\@
_____ @
\\____\\@
@@
___ @
\\_ \\ @
\\ \\@
_/ /@
/__/ @
@@
____ @
/ _ \\@
\\/ \\ |@
/ /@
\\/ @
\\/ @@
____ @
/ __\\@
| /_//@
| \\\\/_@
\\____/@
@@
____ @
/ _ \\@
| / \\|@
| |-||@
\\_/ \\|@
@@
____ @
/ __\\@
| | //@
| |_\\\\@
\\____/@
@@
____ @
/ _\\@
| / @
| \\__@
\\____/@
@@
____ @
/ _ \\@
| | \\|@
| |_/|@
\\____/@
@@
_____@
/ __/@
| \\ @
| /_ @
\\____\\@
@@
_____@
/ /@
| __\\@
| | @
\\_/ @
@@
_____@
/ __/@
| | _@
| |_//@
\\____\\@
@@
_ @
/ \\ /|@
| |_||@
| | ||@
\\_/ \\|@
@@
_ @
/ \\@
| |@
| |@
\\_/@
@@
_ @
/ |@
| |@
/\\_| |@
\\____/@
@@
_ __@
/ |/ /@
| / @
| \\ @
\\_|\\_\\@
@@
_ @
/ \\ @
| | @
| |_/\\@
\\____/@
@@
_ @
/ \\__/|@
| |\\/||@
| | ||@
\\_/ \\|@
@@
_ @
/ \\ /|@
| |\\ ||@
| | \\||@
\\_/ \\|@
@@
____ @
/ _ \\@
| / \\|@
| \\_/|@
\\____/@
@@
____ @
/ __\\@
| \\/|@
| __/@
\\_/ @
@@
____ @
/ _ \\@
| / \\|@
| \\_\\|@
\\____\\@
@@
____ @
/ __\\@
| \\/|@
| /@
\\_/\\_\\@
@@
____ @
/ ___\\@
| \\@
\\___ |@
\\____/@
@@
_____ @
/__ __\\@
/ \\ @
| | @
\\_/ @
@@
_ @
/ \\ /\\@
| | ||@
| \\_/|@
\\____/@
@@
_ @
/ \\ |\\@
| | //@
| \\// @
\\__/ @
@@
_ @
/ \\ /|@
| | ||@
| |/\\||@
\\_/ \\|@
@@
___ _@
\\ \\//@
\\ / @
/ \\ @
/__/\\\\@
@@
___ _@
\\ \\//@
\\ / @
/ / @
/_/ @
@@
____ @
/_ \\@
/ /@
/ /_@
\\____/@
@@
___@
/ _/@
|| @
||_ @
\\__\\@
@@
@
/\\ @
\\ \\ @
\\ \\@
\\/@
@@
___ @
\\_ \\@
||@
_||@
/__/@
@@
/\\@
$$@
$$@
$$@
$$@
$$@@
@
@
@
@
_____ @
\\____\\@@
_ @
\\|@
@
@
@
@@
____ @
/ _ \\@
| / \\|@
| |-||@
\\_/ \\|@
@@
____ @
/ _ \\@
| | //@
| |_\\\\@
\\____/@
@@
____ @
/ _\\@
| / @
| \\_ @
\\____/@
@@
____ @
/ _ \\@
| | \\|@
| |_/|@
\\____/@
@@
_____@
/ __/@
| \\ @
| /_ @
\\____\\@
@@
_____@
/ /@
| __\\@
| | @
\\_/ @
@@
_____@
/ __/@
| | _@
| |_//@
\\____\\@
@@
_ @
/ \\ /|@
| |_||@
| | ||@
\\_/ \\|@
@@
_ @
/ \\@
| |@
| |@
\\_/@
@@
_ @
/ |@
| |@
/\\_| |@
\\____/@
@@
_ __@
/ |/ /@
| / @
| \\ @
\\_|\\_\\@
@@
_ @
/ \\ @
| | @
| |_/\\@
\\____/@
@@
_ @
/ \\__/|@
| |\\/||@
| | ||@
\\_/ \\|@
@@
_ @
/ \\ /|@
| |\\ ||@
| | \\||@
\\_/ \\|@
@@
____ @
/ _ \\@
| / \\|@
| \\_/|@
\\____/@
@@
____ @
/ __\\@
| \\/|@
| __/@
\\_/ @
@@
____ @
/ _ \\@
| / \\|@
| \\_\\|@
\\____\\@
@@
____ @
/ __\\@
| \\/|@
| /@
\\_/\\_\\@
@@
____ @
/ ___\\@
| \\@
\\___ |@
\\____/@
@@
_____ @
/__ __\\@
/ \\ @
| | @
\\_/ @
@@
_ @
/ \\ /\\@
| | ||@
| \\_/|@
\\____/@
@@
_ @
/ \\ |\\@
| | //@
| \\// @
\\__/ @
@@
_ @
/ \\ /|@
| | ||@
| |/\\||@
\\_/ \\|@
@@
___ _@
\\ \\//@
\\ / @
/ \\ @
/__/\\\\@
@@
___ _@
\\ \\//@
\\ / @
/ / @
/_/ @
@@
____ @
/_ \\@
/ /@
/ /_@
\\____/@
@@
____@
\\ _/@
// @
\\\\_ @
/__\\@
@@
_ @
| |@
\\_/@
_ @
/ \\@
|_|@@
____@
\\_ /@
\\\\@
_//@
/__\\@
@@
/\\//@
$\\/$@
@
@
@
@@
\\/\\/ @
/ _ \\@
| / \\|@
| |-||@
\\_/ \\|@
@@
\\/\\/ @
/ _ \\@
| / \\|@
| \\_/|@
\\____/@
@@
\\/\\/ @
/ \\ /\\@
| | ||@
| \\_/|@
\\____/@
@@
\\/\\/ @
/ _ \\@
| / \\|@
| |-||@
\\_/ \\|@
@@
\\/\\/ @
/ _ \\@
| / \\|@
| \\_/|@
\\____/@
@@
\\/\\/ @
/ \\ /\\@
| | ||@
| \\_/|@
\\____/@
@@
____ @
/ _ \\@
| | //@
| |_\\\\@
\\_/\\_/@
@@
`