docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Type Check & Test (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:25:58 +08:00
1 parent f954252a34
commit e311ca3275
35554 files changed
+6229626 -4

No files matched your search

@@ -0,0 +1,22 @@
**1.1.2 / 2025-02-27**
- fix skiplike for 0
**1.1.1 / 2025-02-21**
- All recent fixes of version 2
**2.0.4 / 2025-02-20**
- remove console log
**2.0.3 / 2025-02-20**
- fix for string which are falsly identified as e-notation
**2.0.1 / 2025-02-20**
- fix: handle only zeros
- fix: return original string when NaN
**2.0.0 / 2025-02-20**
- Migrating to ESM modules. No functional change
**1.1.0 / 2025-02-20**
- fix (#9): support missing floating point and e notations
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildUnmanagedMetadataFromMaybeManagedMetadata = buildUnmanagedMetadataFromMaybeManagedMetadata;
const InversifyCoreError_1 = require("../../error/models/InversifyCoreError");
const InversifyCoreErrorKind_1 = require("../../error/models/InversifyCoreErrorKind");
const assertMetadataFromTypescriptIfManaged_1 = require("./assertMetadataFromTypescriptIfManaged");
const buildDefaultUnmanagedMetadata_1 = require("./buildDefaultUnmanagedMetadata");
function buildUnmanagedMetadataFromMaybeManagedMetadata(metadata) {
(0, assertMetadataFromTypescriptIfManaged_1.assertMetadataFromTypescriptIfManaged)(metadata);
if (hasManagedMetadata(metadata)) {
throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.injectionDecoratorConflict, 'Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections');
}
return (0, buildDefaultUnmanagedMetadata_1.buildDefaultUnmanagedMetadata)();
}
function hasManagedMetadata(metadata) {
return (metadata.name !== undefined || metadata.optional || metadata.tags.size > 0);
}
//# sourceMappingURL=buildUnmanagedMetadataFromMaybeManagedMetadata.js.map
@@ -0,0 +1,42 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var define = require('define-data-property');
var hasDescriptors = require('has-property-descriptors')();
var gOPD = require('gopd');
var $TypeError = require('es-errors/type');
var $floor = GetIntrinsic('%Math.floor%');
/** @type {import('.')} */
module.exports = function setFunctionLength(fn, length) {
if (typeof fn !== 'function') {
throw new $TypeError('`fn` is not a function');
}
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
throw new $TypeError('`length` must be a positive 32-bit integer');
}
var loose = arguments.length > 2 && !!arguments[2];
var functionLengthIsConfigurable = true;
var functionLengthIsWritable = true;
if ('length' in fn && gOPD) {
var desc = gOPD(fn, 'length');
if (desc && !desc.configurable) {
functionLengthIsConfigurable = false;
}
if (desc && !desc.writable) {
functionLengthIsWritable = false;
}
}
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
if (hasDescriptors) {
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
} else {
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
}
}
return fn;
};
@@ -0,0 +1,37 @@
{
"name": "@dnd-kit/utilities",
"version": "3.2.2",
"description": "Internal utilities to bee shared between `@dnd-kit` packages",
"author": "Claudéric Demers",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/clauderic/dnd-kit.git",
"directory": "packages/utilities"
},
"scripts": {
"start": "tsdx watch --tsconfig tsconfig.build.json --verbose --noClean",
"build": "tsdx build --tsconfig tsconfig.build.json",
"test": "tsdx test",
"lint": "tsdx lint",
"prepublish": "npm run build"
},
"main": "dist/index.js",
"module": "dist/utilities.esm.js",
"typings": "dist/index.d.ts",
"files": [
"README.md",
"CHANGELOG.md",
"LICENSE",
"dist"
],
"dependencies": {
"tslib": "^2.0.0"
},
"peerDependencies": {
"react": ">=16.8.0"
},
"publishConfig": {
"access": "public"
}
}
@@ -0,0 +1,110 @@
/**
* @import {
* Construct,
* State,
* TokenizeContext,
* Tokenizer
* } from 'micromark-util-types'
*/
import {ok as assert} from 'devlop'
import {codes, types} from 'micromark-util-symbol'
import {labelEnd} from './label-end.js'
/** @type {Construct} */
export const labelStartImage = {
name: 'labelStartImage',
resolveAll: labelEnd.resolveAll,
tokenize: tokenizeLabelStartImage
}
/**
* @this {TokenizeContext}
* Context.
* @type {Tokenizer}
*/
function tokenizeLabelStartImage(effects, ok, nok) {
const self = this
return start
/**
* Start of label (image) start.
*
* ```markdown
* > | a ![b] c
* ^
* ```
*
* @type {State}
*/
function start(code) {
assert(code === codes.exclamationMark, 'expected `!`')
effects.enter(types.labelImage)
effects.enter(types.labelImageMarker)
effects.consume(code)
effects.exit(types.labelImageMarker)
return open
}
/**
* After `!`, at `[`.
*
* ```markdown
* > | a ![b] c
* ^
* ```
*
* @type {State}
*/
function open(code) {
if (code === codes.leftSquareBracket) {
effects.enter(types.labelMarker)
effects.consume(code)
effects.exit(types.labelMarker)
effects.exit(types.labelImage)
return after
}
return nok(code)
}
/**
* After `![`.
*
* ```markdown
* > | a ![b] c
* ^
* ```
*
* This is needed in because, when GFM footnotes are enabled, images never
* form when started with a `^`.
* Instead, links form:
*
* ```markdown
* ![^a](b)
*
* ![^a][b]
*
* [b]: c
* ```
*
* ```html
* <p>!<a href=\"b\">^a</a></p>
* <p>!<a href=\"c\">^a</a></p>
* ```
*
* @type {State}
*/
function after(code) {
// To do: use a new field to do this, this is still needed for
// `micromark-extension-gfm-footnote`, but the `label-start-link`
// behavior isn’t.
// Hidden footnotes hook.
/* c8 ignore next 3 */
return code === codes.caret &&
'_hiddenFootnoteSupport' in self.parser.constructs
? nok(code)
: ok(code)
}
}
@@ -0,0 +1,3 @@
# @react-aria/menu
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1,205 @@
# micromark-util-classify-character
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]
[micromark][] utility to classify whether a character is whitespace or
punctuation.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`classifyCharacter(code)`](#classifycharactercode)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package exposes an algorithm to classify characters into 3 categories.
## When should I use this?
This package might be useful when you are making your own micromark extensions.
## Install
This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:
```sh
npm install micromark-util-classify-character
```
In Deno with [`esm.sh`][esmsh]:
```js
import {classifyCharacter} from 'https://esm.sh/micromark-util-classify-character@1'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {classifyCharacter} from 'https://esm.sh/micromark-util-classify-character@1?bundle'
</script>
```
## Use
```js
/**
* @this {TokenizeContext}
* Context.
* @type {Tokenizer}
*/
function tokenizeAttention(effects, ok) {
return start
// …
/** @type {State} */
function sequence(code) {
if (code === marker) {
// …
}
const token = effects.exit('attentionSequence')
const after = classifyCharacter(code)
const open =
!after || (after === constants.characterGroupPunctuation && before)
const close =
!before || (before === constants.characterGroupPunctuation && after)
// …
}
// …
}
```
## API
This module exports the identifier
[`classifyCharacter`][api-classify-character].
There is no default export.
### `classifyCharacter(code)`
Classify whether a code represents whitespace, punctuation, or something
else.
Used for attention (emphasis, strong), whose sequences can open or close
based on the class of surrounding characters.
> 👉 **Note**: eof (`null`) is seen as whitespace.
###### Parameters
* `code` (`Code`)
— code
###### Returns
Group (`constants.characterGroupWhitespace`,
`constants.characterGroupPunctuation`, or `undefined`).
## Types
This package is fully typed with [TypeScript][].
It exports no additional types.
## Compatibility
Projects maintained by the unified collective are compatible with maintained
versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-classify-character@2`, compatible with Node.js 16.
This package works with `micromark@3`.
## Security
This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.
## Contribute
See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.
This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
[build]: https://github.com/micromark/micromark/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
[coverage]: https://codecov.io/github/micromark/micromark
[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-classify-character.svg
[downloads]: https://www.npmjs.com/package/micromark-util-classify-character
[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-classify-character
[bundle-size]: https://bundlejs.com/?q=micromark-util-classify-character
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[opencollective]: https://opencollective.com/unified
[npm]: https://docs.npmjs.com/cli/install
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[esmsh]: https://esm.sh
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[chat]: https://github.com/micromark/micromark/discussions
[license]: https://github.com/micromark/micromark/blob/main/license
[author]: https://wooorm.com
[health]: https://github.com/micromark/.github
[securitymd]: https://github.com/micromark/.github/blob/main/security.md
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
[support]: https://github.com/micromark/.github/blob/main/support.md
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
[typescript]: https://www.typescriptlang.org
[micromark]: https://github.com/micromark/micromark
[api-classify-character]: #classifycharactercode
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2013-present, Facebook, Inc.
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,12 @@
import { NumberFormatInternal, NumberFormatLocaleInternalData, NumberFormatOptions } from '../types/number';
/**
* https://tc39.es/ecma402/#sec-initializenumberformat
*/
export declare function InitializeNumberFormat(nf: Intl.NumberFormat, locales: string | ReadonlyArray<string> | undefined, opts: NumberFormatOptions | undefined, { getInternalSlots, localeData, availableLocales, numberingSystemNames, getDefaultLocale, currencyDigitsData, }: {
getInternalSlots(nf: Intl.NumberFormat): NumberFormatInternal;
localeData: Record<string, NumberFormatLocaleInternalData | undefined>;
availableLocales: Set<string>;
numberingSystemNames: ReadonlyArray<string>;
getDefaultLocale(): string;
currencyDigitsData: Record<string, number>;
}): Intl.NumberFormat;
@@ -0,0 +1,39 @@
/**
* @flow
*/
import toAST from 'to-ast'; // eslint-disable-line import/no-extraneous-dependencies
import JSXExpressionContainerMock from './JSXExpressionContainerMock';
export type JSXAttributeMockType = {
type: 'JSXAttribute',
name: {
type: 'JSXIdentifier',
name: string,
},
value: mixed,
};
export default function JSXAttributeMock(prop: string, value: mixed, isExpressionContainer?: boolean = false): JSXAttributeMockType {
let astValue;
if (value && value.type !== undefined) {
astValue = value;
} else {
astValue = toAST(value);
}
let attributeValue = astValue;
if (isExpressionContainer || astValue.type !== 'Literal') {
attributeValue = JSXExpressionContainerMock(astValue);
} else if (attributeValue.type === 'Literal' && !('raw' in (attributeValue: any))) {
(attributeValue: any).raw = JSON.stringify((attributeValue: any).value);
}
return {
type: 'JSXAttribute',
name: {
type: 'JSXIdentifier',
name: prop,
},
value: attributeValue,
};
}
@@ -0,0 +1,2 @@
// Note: types exposed from `index.d.ts`.
export {gfmFromMarkdown, gfmToMarkdown} from './lib/index.js'
@@ -0,0 +1,14 @@
module.exports = {
"ascending": `nouseva`,
"ascendingSort": (args)=>`lajiteltu sarakkeen ${args.columnName} mukaan nousevassa j\xe4rjestyksess\xe4`,
"columnSize": (args)=>`${args.value} pikseli\xe4`,
"descending": `laskeva`,
"descendingSort": (args)=>`lajiteltu sarakkeen ${args.columnName} mukaan laskevassa j\xe4rjestyksess\xe4`,
"resizerDescription": `Aloita koon muutos painamalla Enter-n\xe4pp\xe4int\xe4`,
"select": `Valitse`,
"selectAll": `Valitse kaikki`,
"sortable": `lajiteltava sarake`
};
//# sourceMappingURL=fi-FI.main.js.map
@@ -0,0 +1,56 @@
<p align="center">
<a href="http://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>
# to-through
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
Wrap a ReadableStream in a TransformStream.
## Usage
```js
var from = require('from2');
var concat = require('concat-stream');
var toThrough = require('to-through');
var readable = from([' ', 'hello', ' ', 'world']);
// Can be used as a Readable or Transform
var maybeTransform = toThrough(readable);
from(['hi', ' ', 'there', ','])
.pipe(maybeTransform)
.pipe(concat(function(result) {
// result.toString() === 'hi there, hello world'
}));
```
## API
### `toThrough(readableStream)`
Takes a `readableStream` as the only argument and returns a `through2` stream. If the returned stream is piped before `nextTick`, the wrapped `readableStream` will not flow until the upstream is flushed. If the stream is not piped before `nextTick`, it is ended and flushed (acting as a proper readable).
## License
MIT
[downloads-image]: http://img.shields.io/npm/dm/to-through.svg
[npm-url]: https://npmjs.com/package/to-through
[npm-image]: http://img.shields.io/npm/v/to-through.svg
[travis-url]: https://travis-ci.org/gulpjs/to-through
[travis-image]: http://img.shields.io/travis/gulpjs/to-through.svg?label=travis-ci
[appveyor-url]: https://ci.appveyor.com/project/gulpjs/to-through
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/to-through.svg?label=appveyor
[coveralls-url]: https://coveralls.io/r/gulpjs/to-through
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/to-through/master.svg
[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.png
@@ -0,0 +1,12 @@
/**
* GlobalSign Root CA
*
* Downloaded from https://pki.goog/roots.pem
*
* Valid until 2028-01-28 @ 04:00 PST
*
* SHA256 Fingerprint
* EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99
*/
export declare const GlobalSign_Root_CA = "-----BEGIN CERTIFICATE-----\nMIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG\nA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv\nb3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw\nMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i\nYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT\naWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ\njc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp\nxy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp\n1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG\nsnUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ\nU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8\n9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E\nBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B\nAQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz\nyj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE\n38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP\nAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad\nDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME\nHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\n-----END CERTIFICATE-----\n";
//# sourceMappingURL=android-safetynet.d.ts.map
@@ -0,0 +1,204 @@
/**
* @fileoverview Rule to disallow unnecessary computed property keys in object literals
* @author Burak Yigit Kaya
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Determines whether the computed key syntax is unnecessarily used for the given node.
* In particular, it determines whether removing the square brackets and using the content between them
* directly as the key (e.g. ['foo'] -> 'foo') would produce valid syntax and preserve the same behavior.
* Valid non-computed keys are only: identifiers, number literals and string literals.
* Only literals can preserve the same behavior, with a few exceptions for specific node types:
* Property
* - { ["__proto__"]: foo } defines a property named "__proto__"
* { "__proto__": foo } defines object's prototype
* PropertyDefinition
* - class C { ["constructor"]; } defines an instance field named "constructor"
* class C { "constructor"; } produces a parsing error
* - class C { static ["constructor"]; } defines a static field named "constructor"
* class C { static "constructor"; } produces a parsing error
* - class C { static ["prototype"]; } produces a runtime error (doesn't break the whole script)
* class C { static "prototype"; } produces a parsing error (breaks the whole script)
* MethodDefinition
* - class C { ["constructor"]() {} } defines a prototype method named "constructor"
* class C { "constructor"() {} } defines the constructor
* - class C { static ["prototype"]() {} } produces a runtime error (doesn't break the whole script)
* class C { static "prototype"() {} } produces a parsing error (breaks the whole script)
* @param {ASTNode} node The node to check. It can be `Property`, `PropertyDefinition` or `MethodDefinition`.
* @throws {Error} (Unreachable.)
* @returns {void} `true` if the node has useless computed key.
*/
function hasUselessComputedKey(node) {
if (!node.computed) {
return false;
}
const { key } = node;
if (key.type !== "Literal") {
return false;
}
const { value } = key;
if (typeof value !== "number" && typeof value !== "string") {
return false;
}
switch (node.type) {
case "Property":
if (node.parent.type === "ObjectExpression") {
return value !== "__proto__";
}
return true;
case "PropertyDefinition":
if (node.static) {
return value !== "constructor" && value !== "prototype";
}
return value !== "constructor";
case "MethodDefinition":
if (node.static) {
return value !== "prototype";
}
return value !== "constructor";
/* c8 ignore next */
default:
throw new Error(`Unexpected node type: ${node.type}`);
}
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [
{
enforceForClassMembers: true,
},
],
docs: {
description:
"Disallow unnecessary computed property keys in objects and classes",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/no-useless-computed-key",
},
schema: [
{
type: "object",
properties: {
enforceForClassMembers: {
type: "boolean",
},
},
additionalProperties: false,
},
],
fixable: "code",
messages: {
unnecessarilyComputedProperty:
"Unnecessarily computed property [{{property}}] found.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const [{ enforceForClassMembers }] = context.options;
/**
* Reports a given node if it violated this rule.
* @param {ASTNode} node The node to check.
* @returns {void}
*/
function check(node) {
if (hasUselessComputedKey(node)) {
const { key } = node;
context.report({
node,
messageId: "unnecessarilyComputedProperty",
data: { property: sourceCode.getText(key) },
fix(fixer) {
const leftSquareBracket = sourceCode.getTokenBefore(
key,
astUtils.isOpeningBracketToken,
);
const rightSquareBracket = sourceCode.getTokenAfter(
key,
astUtils.isClosingBracketToken,
);
// If there are comments between the brackets and the property name, don't do a fix.
if (
sourceCode.commentsExistBetween(
leftSquareBracket,
rightSquareBracket,
)
) {
return null;
}
const tokenBeforeLeftBracket =
sourceCode.getTokenBefore(leftSquareBracket);
// Insert a space before the key to avoid changing identifiers, e.g. ({ get[2]() {} }) to ({ get2() {} })
const needsSpaceBeforeKey =
tokenBeforeLeftBracket.range[1] ===
leftSquareBracket.range[0] &&
!astUtils.canTokensBeAdjacent(
tokenBeforeLeftBracket,
sourceCode.getFirstToken(key),
);
const replacementKey =
(needsSpaceBeforeKey ? " " : "") + key.raw;
return fixer.replaceTextRange(
[
leftSquareBracket.range[0],
rightSquareBracket.range[1],
],
replacementKey,
);
},
});
}
}
/**
* A no-op function to act as placeholder for checking a node when the `enforceForClassMembers` option is `false`.
* @returns {void}
* @private
*/
function noop() {}
return {
Property: check,
MethodDefinition: enforceForClassMembers ? check : noop,
PropertyDefinition: enforceForClassMembers ? check : noop,
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"curryBuildServiceNodeBindings.d.ts","sourceRoot":"","sources":["../../../../src/planning/actions/curryBuildServiceNodeBindings.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAEL,0BAA0B,EAC3B,MAAM,uDAAuD,CAAC;AAK/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAI1F,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAG5D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,CACP,MAAM,EAAE,aAAa,EACrB,sBAAsB,EAAE,yBAAyB,CAAC,0BAA0B,CAAC,KAC1E,eAAe,GACnB,CACD,MAAM,EAAE,cAAc,EACtB,sBAAsB,EAAE,yBAAyB,CAAC,0BAA0B,CAAC,EAC7E,eAAe,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EACnC,UAAU,EAAE,iBAAiB,EAC7B,eAAe,EAAE,OAAO,KACrB,eAAe,EAAE,CA2FrB"}
@@ -0,0 +1,10 @@
import { defineInjectionTokenMetadata } from "../reflection-helpers";
function injectAll(token, options) {
const data = {
token,
multiple: true,
isOptional: options && options.isOptional
};
return defineInjectionTokenMetadata(data);
}
export default injectAll;
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _nullishReceiverError;
function _nullishReceiverError(r) {
throw new TypeError("Cannot set property of null or undefined.");
}
//# sourceMappingURL=nullishReceiverError.js.map
@@ -0,0 +1,13 @@
import { type Extension } from '@codemirror/state';
import { type BasicSetupOptions } from '@uiw/codemirror-extensions-basic-setup';
export * from '@codemirror/theme-one-dark';
export * from './theme/light';
export interface DefaultExtensionsOptions {
indentWithTab?: boolean;
basicSetup?: boolean | BasicSetupOptions;
placeholder?: string | HTMLElement;
theme?: 'light' | 'dark' | 'none' | Extension;
readOnly?: boolean;
editable?: boolean;
}
export declare const getDefaultExtensions: (optios?: DefaultExtensionsOptions) => Extension[];
@@ -0,0 +1,8 @@
var $c68c2e4fc74398d1$exports = {};
$c68c2e4fc74398d1$exports = {
"dismiss": `Schlie\xdfen`
};
export {$c68c2e4fc74398d1$exports as default};
//# sourceMappingURL=de-DE.module.js.map
@@ -0,0 +1,490 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/slider.tsx
var slider_exports = {};
__export(slider_exports, {
default: () => slider_default
});
module.exports = __toCommonJS(slider_exports);
var import_react_utils4 = require("@heroui/react-utils");
var import_system3 = require("@heroui/system");
// src/slider-thumb.tsx
var import_system = require("@heroui/system");
var import_tooltip = require("@heroui/tooltip");
var import_react_utils2 = require("@heroui/react-utils");
var import_visually_hidden = require("@react-aria/visually-hidden");
// src/use-slider-thumb.ts
var import_slider = require("@react-aria/slider");
var import_react_utils = require("@heroui/react-utils");
var import_react = require("react");
var import_interactions = require("@react-aria/interactions");
var import_focus = require("@react-aria/focus");
var import_utils = require("@react-aria/utils");
var import_shared_utils = require("@heroui/shared-utils");
var import_i18n = require("@react-aria/i18n");
function useSliderThumb(props) {
const {
ref,
as,
state,
index,
name,
trackRef,
className,
tooltipProps,
isVertical,
showTooltip,
formatOptions,
renderThumb,
...otherProps
} = props;
const Component = as || "div";
const domRef = (0, import_react_utils.useDOMRef)(ref);
const inputRef = (0, import_react.useRef)(null);
const numberFormatter = (0, import_i18n.useNumberFormatter)(formatOptions);
const { thumbProps, inputProps, isDragging, isFocused } = (0, import_slider.useSliderThumb)(
{
index,
trackRef,
inputRef,
name,
...otherProps
},
state
);
const { hoverProps, isHovered } = (0, import_interactions.useHover)({
isDisabled: state.isDisabled
});
const { focusProps, isFocusVisible } = (0, import_focus.useFocusRing)();
const { pressProps, isPressed } = (0, import_interactions.usePress)({
isDisabled: state.isDisabled
});
const getThumbProps = (props2 = {}) => {
return {
ref: domRef,
"data-slot": "thumb",
"data-hover": (0, import_shared_utils.dataAttr)(isHovered),
"data-pressed": (0, import_shared_utils.dataAttr)(isPressed),
"data-dragging": (0, import_shared_utils.dataAttr)(isDragging),
"data-focused": (0, import_shared_utils.dataAttr)(isFocused),
"data-focus-visible": (0, import_shared_utils.dataAttr)(isFocusVisible),
...(0, import_utils.mergeProps)(thumbProps, pressProps, hoverProps, otherProps),
className,
...props2
};
};
const getTooltipProps = () => {
const value = numberFormatter ? numberFormatter.format(state.values[index != null ? index : 0]) : state.values[index != null ? index : 0];
return {
...tooltipProps,
placement: (tooltipProps == null ? void 0 : tooltipProps.placement) ? tooltipProps == null ? void 0 : tooltipProps.placement : isVertical ? "right" : "top",
content: (tooltipProps == null ? void 0 : tooltipProps.content) ? tooltipProps == null ? void 0 : tooltipProps.content : value,
updatePositionDeps: [isDragging, isHovered, value],
isOpen: (tooltipProps == null ? void 0 : tooltipProps.isOpen) !== void 0 ? tooltipProps == null ? void 0 : tooltipProps.isOpen : isHovered || isDragging
};
};
const getInputProps = (props2 = {}) => {
return {
ref: inputRef,
...(0, import_utils.mergeProps)(inputProps, focusProps),
...props2
};
};
return {
Component,
index,
showTooltip,
renderThumb,
getThumbProps,
getTooltipProps,
getInputProps
};
}
// src/slider-thumb.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var SliderThumb = (0, import_system.forwardRef)((props, ref) => {
const {
Component,
index,
renderThumb,
showTooltip,
getTooltipProps,
getThumbProps,
getInputProps
} = useSliderThumb({
...props,
ref
});
const thumbProps = {
...getThumbProps(),
index,
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_visually_hidden.VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ...getInputProps() }) })
};
const content = (0, import_react_utils2.renderFn)({
Component,
props: thumbProps,
renderCustom: renderThumb
});
return showTooltip ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tooltip.Tooltip, { ...getTooltipProps(), children: content }) : content;
});
SliderThumb.displayName = "HeroUI.SliderThumb";
var slider_thumb_default = SliderThumb;
// src/use-slider.ts
var import_system2 = require("@heroui/system");
var import_theme = require("@heroui/theme");
var import_react_utils3 = require("@heroui/react-utils");
var import_slider2 = require("@react-stately/slider");
var import_react2 = require("react");
var import_i18n2 = require("@react-aria/i18n");
var import_utils2 = require("@react-aria/utils");
var import_slider3 = require("@react-aria/slider");
var import_shared_utils2 = require("@heroui/shared-utils");
var import_interactions2 = require("@react-aria/interactions");
function useSlider(originalProps) {
var _a, _b, _c, _d;
const globalContext = (0, import_system2.useProviderContext)();
const [props, variantProps] = (0, import_system2.mapPropsVariants)(originalProps, import_theme.slider.variantKeys);
const {
ref,
as,
name,
label,
formatOptions,
value: valueProp,
maxValue = 100,
minValue = 0,
step = 1,
showSteps = false,
showTooltip = false,
orientation = "horizontal",
marks = [],
startContent,
endContent,
fillOffset,
className,
classNames,
renderThumb,
renderLabel,
renderValue,
onChange,
onChangeEnd,
getValue,
tooltipValueFormatOptions = formatOptions,
tooltipProps: userTooltipProps = {},
...otherProps
} = props;
const Component = as || "div";
const shouldFilterDOMProps = typeof Component === "string";
const disableAnimation = (_b = (_a = originalProps == null ? void 0 : originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const domRef = (0, import_react_utils3.useDOMRef)(ref);
const trackRef = (0, import_react2.useRef)(null);
const numberFormatter = (0, import_i18n2.useNumberFormatter)(formatOptions);
const { direction } = (0, import_i18n2.useLocale)();
const clampValue = (0, import_react2.useCallback)(
(valueToClamp) => Math.min(Math.max(valueToClamp, minValue), maxValue),
[minValue, maxValue]
);
const validatedValue = (0, import_react2.useMemo)(() => {
if (valueProp === void 0)
return void 0;
if (Array.isArray(valueProp)) {
return valueProp.map(clampValue);
}
return clampValue(valueProp);
}, [valueProp, clampValue]);
const state = (0, import_slider2.useSliderState)({
...otherProps,
value: validatedValue,
isDisabled: (_c = originalProps == null ? void 0 : originalProps.isDisabled) != null ? _c : false,
orientation,
step,
minValue,
maxValue,
numberFormatter,
onChange,
onChangeEnd
});
const tooltipProps = {
offset: 5,
delay: 0,
size: "sm",
showArrow: true,
color: (originalProps == null ? void 0 : originalProps.color) ? originalProps == null ? void 0 : originalProps.color : (_d = import_theme.slider.defaultVariants) == null ? void 0 : _d.color,
isDisabled: originalProps.isDisabled,
...userTooltipProps
};
const { groupProps, trackProps, labelProps, outputProps } = (0, import_slider3.useSlider)(
originalProps,
state,
trackRef
);
const { isHovered, hoverProps } = (0, import_interactions2.useHover)({ isDisabled: originalProps.isDisabled });
const baseStyles = (0, import_shared_utils2.clsx)(classNames == null ? void 0 : classNames.base, className);
const isVertical = orientation === "vertical";
const hasMarks = (marks == null ? void 0 : marks.length) > 0;
const hasSingleThumb = fillOffset === void 0 ? state.values.length === 1 : false;
const slots = (0, import_react2.useMemo)(
() => (0, import_theme.slider)({
...variantProps,
hasMarks,
disableAnimation,
hasSingleThumb,
isVertical,
className
}),
[(0, import_shared_utils2.objectToDeps)(variantProps), isVertical, disableAnimation, hasSingleThumb, hasMarks, className]
);
const [startOffset, endOffset] = [
state.values.length > 1 ? state.getThumbPercent(0) : fillOffset !== void 0 ? state.getValuePercent(fillOffset) : 0,
state.getThumbPercent(state.values.length - 1)
].sort();
const value = state.values.length === 1 ? numberFormatter.format(state.values[0]) : numberFormatter.formatRange(state.values[0], state.values[state.values.length - 1]);
const steps = showSteps ? Math.floor((maxValue - minValue) / step) + 1 : 0;
const getBaseProps = (props2 = {}) => {
return {
ref: domRef,
"data-orientation": state.orientation,
"data-slot": "base",
"data-hover": isHovered,
className: slots.base({ class: baseStyles }),
...(0, import_utils2.mergeProps)(
groupProps,
hoverProps,
(0, import_react_utils3.filterDOMProps)(otherProps, {
enabled: shouldFilterDOMProps
}),
(0, import_react_utils3.filterDOMProps)(props2)
)
};
};
const getLabelWrapperProps = (props2 = {}) => {
return {
className: slots.labelWrapper({ class: classNames == null ? void 0 : classNames.labelWrapper }),
"data-slot": "labelWrapper",
...props2
};
};
const getLabelProps = (props2 = {}) => {
return {
"data-slot": "label",
className: slots.label({ class: classNames == null ? void 0 : classNames.label }),
children: label,
...labelProps,
...props2
};
};
const getValueProps = (props2 = {}) => {
return {
"data-slot": "value",
className: slots.value({ class: classNames == null ? void 0 : classNames.value }),
children: getValue && typeof getValue === "function" ? getValue(state.values) : value,
...outputProps,
...props2
};
};
const getTrackProps = (props2 = {}) => {
return {
ref: trackRef,
"data-slot": "track",
"data-thumb-hidden": !!(originalProps == null ? void 0 : originalProps.hideThumb),
"data-vertical": isVertical,
className: slots.track({ class: classNames == null ? void 0 : classNames.track }),
...trackProps,
...props2
};
};
const getTrackWrapperProps = (props2 = {}) => {
return {
"data-slot": "track-wrapper",
className: slots.trackWrapper({ class: classNames == null ? void 0 : classNames.trackWrapper }),
...props2
};
};
const getFillerProps = (props2 = {}) => {
return {
"data-slot": "filler",
className: slots.filler({ class: classNames == null ? void 0 : classNames.filler }),
...props2,
style: {
...props2.style,
[isVertical ? "bottom" : direction === "rtl" ? "right" : "left"]: `${startOffset * 100}%`,
...isVertical ? {
height: `${(endOffset - startOffset) * 100}%`
} : {
width: `${(endOffset - startOffset) * 100}%`
}
}
};
};
const getThumbProps = (index) => {
return {
name,
index,
state,
trackRef,
orientation,
isVertical,
tooltipProps,
showTooltip,
renderThumb,
formatOptions: tooltipValueFormatOptions,
className: slots.thumb({ class: classNames == null ? void 0 : classNames.thumb })
};
};
const getStepProps = (index) => {
const percent = state.getValuePercent(index * step + minValue);
return {
className: slots.step({ class: classNames == null ? void 0 : classNames.step }),
"data-slot": "step",
"data-in-range": percent <= endOffset && percent >= startOffset,
style: {
[isVertical ? "bottom" : direction === "rtl" ? "right" : "left"]: `${percent * 100}%`
}
};
};
const getMarkProps = (mark) => {
const percent = state.getValuePercent(mark.value);
return {
className: slots.mark({ class: classNames == null ? void 0 : classNames.mark }),
"data-slot": "mark",
"data-in-range": percent <= endOffset && percent >= startOffset,
style: {
[isVertical ? "bottom" : direction === "rtl" ? "right" : "left"]: `${percent * 100}%`
},
onMouseDown: (e) => e.stopPropagation(),
onPointerDown: (e) => e.stopPropagation(),
onClick: (e) => {
e.stopPropagation();
if (state.values.length === 1) {
state.setThumbPercent(0, percent);
} else {
const leftThumbVal = state.values[0];
const rightThumbVal = state.values[1];
if (mark.value < leftThumbVal) {
state.setThumbPercent(0, percent);
} else if (mark.value > rightThumbVal) {
state.setThumbPercent(1, percent);
} else if (Math.abs(mark.value - leftThumbVal) < Math.abs(mark.value - rightThumbVal)) {
state.setThumbPercent(0, percent);
} else {
state.setThumbPercent(1, percent);
}
}
}
};
};
const getStartContentProps = (props2 = {}) => ({
"data-slot": "startContent",
className: slots.startContent({ class: classNames == null ? void 0 : classNames.startContent }),
...props2
});
const getEndContentProps = (props2 = {}) => ({
"data-slot": "endContent",
className: slots.endContent({ class: classNames == null ? void 0 : classNames.endContent }),
...props2
});
return {
Component,
state,
value,
domRef,
label,
steps,
marks,
startContent,
endContent,
getStepProps,
getBaseProps,
getValue,
renderLabel,
renderValue,
getTrackWrapperProps,
getLabelWrapperProps,
getLabelProps,
getValueProps,
getTrackProps,
getFillerProps,
getThumbProps,
getMarkProps,
getStartContentProps,
getEndContentProps
};
}
// src/slider.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var Slider = (0, import_system3.forwardRef)((props, ref) => {
const {
Component,
state,
label,
steps,
marks,
startContent,
endContent,
getStepProps,
getBaseProps,
renderValue,
renderLabel,
getTrackWrapperProps,
getLabelWrapperProps,
getLabelProps,
getValueProps,
getTrackProps,
getFillerProps,
getThumbProps,
getMarkProps,
getStartContentProps,
getEndContentProps
} = useSlider({ ...props, ref });
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Component, { ...getBaseProps(), children: [
label && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { ...getLabelWrapperProps(), children: [
(0, import_react_utils4.renderFn)({
Component: "label",
props: getLabelProps(),
renderCustom: renderLabel
}),
(0, import_react_utils4.renderFn)({
Component: "output",
props: getValueProps(),
renderCustom: renderValue
})
] }),
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { ...getTrackWrapperProps(), children: [
startContent && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ...getStartContentProps(), children: startContent }),
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { ...getTrackProps(), children: [
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ...getFillerProps() }),
Number.isFinite(steps) && Array.from({ length: steps }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ...getStepProps(index) }, index)),
state.values.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(slider_thumb_default, { ...getThumbProps(index) }, index)),
(marks == null ? void 0 : marks.length) > 0 && marks.map((mark, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ...getMarkProps(mark), children: mark.label }, index))
] }),
endContent && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ...getEndContentProps(), children: endContent })
] })
] });
});
Slider.displayName = "HeroUI.Slider";
var slider_default = Slider;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {});
@@ -0,0 +1,39 @@
{
"author": "Brian J. Brennan <brianloveswords@gmail.com>",
"name": "buffer-crc32",
"description": "A pure javascript CRC32 algorithm that plays nice with binary data",
"version": "0.2.13",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/brianloveswords/buffer-crc32/raw/master/LICENSE"
}
],
"contributors": [
{
"name": "Vladimir Kuznetsov",
"github": "mistakster"
}
],
"homepage": "https://github.com/brianloveswords/buffer-crc32",
"repository": {
"type": "git",
"url": "git://github.com/brianloveswords/buffer-crc32.git"
},
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/tap tests/*.test.js"
},
"dependencies": {},
"devDependencies": {
"tap": "~0.2.5"
},
"optionalDependencies": {},
"engines": {
"node": "*"
},
"license": "MIT",
"files": [
"index.js"
]
}
@@ -0,0 +1,10 @@
"use strict";
module.exports = function (it) {
const { pattern, globDisabled } = it;
return `
No files matching the pattern "${pattern}"${globDisabled ? " (with disabling globs)" : ""} were found.
Please check for typing mistakes in the pattern.
`.trimStart();
};
@@ -0,0 +1,19 @@
Copyright (c) 2011 Debuggable Limited <felix@debuggable.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,9 @@
import type { TSESLint } from '@typescript-eslint/utils';
export declare function getFixOrSuggest<MessageId extends string>({ fixOrSuggest, suggestion, }: {
fixOrSuggest: 'fix' | 'none' | 'suggest';
suggestion: TSESLint.SuggestionReportDescriptor<MessageId>;
}): {
fix: TSESLint.ReportFixFunction;
} | {
suggest: TSESLint.SuggestionReportDescriptor<MessageId>[];
} | undefined;
@@ -0,0 +1,52 @@
import type { QueryCacheKey } from './core/apiState'
import type { EndpointDefinition } from './endpointDefinitions'
import { isPlainObject } from './core/rtkImports'
const cache: WeakMap<any, string> | undefined = WeakMap
? new WeakMap()
: undefined
export const defaultSerializeQueryArgs: SerializeQueryArgs<any> = ({
endpointName,
queryArgs,
}) => {
let serialized = ''
const cached = cache?.get(queryArgs)
if (typeof cached === 'string') {
serialized = cached
} else {
const stringified = JSON.stringify(queryArgs, (key, value) => {
// Handle bigints
value = typeof value === 'bigint' ? { $bigint: value.toString() } : value
// Sort the object keys before stringifying, to prevent useQuery({ a: 1, b: 2 }) having a different cache key than useQuery({ b: 2, a: 1 })
value = isPlainObject(value)
? Object.keys(value)
.sort()
.reduce<any>((acc, key) => {
acc[key] = (value as any)[key]
return acc
}, {})
: value
return value
})
if (isPlainObject(queryArgs)) {
cache?.set(queryArgs, stringified)
}
serialized = stringified
}
return `${endpointName}(${serialized})`
}
export type SerializeQueryArgs<QueryArgs, ReturnType = string> = (_: {
queryArgs: QueryArgs
endpointDefinition: EndpointDefinition<any, any, any, any>
endpointName: string
}) => ReturnType
export type InternalSerializeQueryArgs = (_: {
queryArgs: any
endpointDefinition: EndpointDefinition<any, any, any, any>
endpointName: string
}) => QueryCacheKey
@@ -0,0 +1,26 @@
{
"name": "@xterm/addon-web-links",
"version": "0.11.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
},
"main": "lib/addon-web-links.js",
"types": "typings/addon-web-links.d.ts",
"repository": "https://github.com/xtermjs/xterm.js/tree/master/addons/addon-web-links",
"license": "MIT",
"keywords": [
"terminal",
"xterm",
"xterm.js"
],
"scripts": {
"build": "../../node_modules/.bin/tsc -p .",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
},
"peerDependencies": {
"@xterm/xterm": "^5.0.0"
}
}
@@ -0,0 +1,127 @@
import { makeRe } from 'minimatch';
import { importType, createRule, moduleVisitor, resolve, } from '../utils/index.js';
function normalizeSep(somePath) {
return somePath.split('\\').join('/');
}
function toSteps(somePath) {
return normalizeSep(somePath)
.split('/')
.filter(step => step && step !== '.')
.reduce((acc, step) => {
if (step === '..') {
return acc.slice(0, -1);
}
return [...acc, step];
}, []);
}
const potentialViolationTypes = new Set([
'parent',
'index',
'sibling',
'external',
'internal',
]);
export default createRule({
name: 'no-internal-modules',
meta: {
type: 'suggestion',
docs: {
category: 'Static analysis',
description: 'Forbid importing the submodules of other modules.',
},
schema: [
{
anyOf: [
{
type: 'object',
properties: {
allow: {
type: 'array',
items: {
type: 'string',
},
},
},
additionalProperties: false,
},
{
type: 'object',
properties: {
forbid: {
type: 'array',
items: {
type: 'string',
},
},
},
additionalProperties: false,
},
],
},
],
messages: {
noAllowed: `Reaching to "{{importPath}}" is not allowed.`,
},
},
defaultOptions: [],
create(context) {
const options = context.options[0] || {};
const allowRegexps = (options.allow || [])
.map(p => makeRe(p))
.filter(Boolean);
const forbidRegexps = (options.forbid || [])
.map(p => makeRe(p))
.filter(Boolean);
function reachingAllowed(importPath) {
return allowRegexps.some(re => re.test(importPath));
}
function reachingForbidden(importPath) {
return forbidRegexps.some(re => re.test(importPath));
}
function isAllowViolation(importPath) {
const steps = toSteps(importPath);
const nonScopeSteps = steps.filter(step => step.indexOf('@') !== 0);
if (nonScopeSteps.length <= 1) {
return false;
}
const justSteps = steps.join('/');
if (reachingAllowed(justSteps) || reachingAllowed(`/${justSteps}`)) {
return false;
}
const resolved = resolve(importPath, context);
if (!resolved || reachingAllowed(normalizeSep(resolved))) {
return false;
}
return true;
}
function isForbidViolation(importPath) {
const steps = toSteps(importPath);
const justSteps = steps.join('/');
if (reachingForbidden(justSteps) || reachingForbidden(`/${justSteps}`)) {
return true;
}
const resolved = resolve(importPath, context);
if (resolved && reachingForbidden(normalizeSep(resolved))) {
return true;
}
return false;
}
const isReachViolation = options.forbid
? isForbidViolation
: isAllowViolation;
return moduleVisitor(source => {
const importPath = source.value;
if (potentialViolationTypes.has(importType(importPath, context)) &&
isReachViolation(importPath)) {
context.report({
node: source,
messageId: 'noAllowed',
data: {
importPath,
},
});
}
}, { commonjs: true });
},
});
//# sourceMappingURL=no-internal-modules.js.map
@@ -0,0 +1,6 @@
import {
ArrowRightIcon
} from "./chunk-SJODKNZO.mjs";
export {
ArrowRightIcon
};
@@ -0,0 +1,26 @@
var baseIteratee = require('./_baseIteratee'),
baseSortedUniq = require('./_baseSortedUniq');
/**
* This method is like `_.uniqBy` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
* // => [1.1, 2.3]
*/
function sortedUniqBy(array, iteratee) {
return (array && array.length)
? baseSortedUniq(array, baseIteratee(iteratee, 2))
: [];
}
module.exports = sortedUniqBy;
@@ -0,0 +1,144 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
declare namespace Reflect {
/**
* Calls the function with the specified object as the this value
* and the elements of specified array as the arguments.
* @param target The function to call.
* @param thisArgument The object to be used as the this object.
* @param argumentsList An array of argument values to be passed to the function.
*/
function apply<T, A extends readonly any[], R>(
target: (this: T, ...args: A) => R,
thisArgument: T,
argumentsList: Readonly<A>,
): R;
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
/**
* Constructs the target with the elements of specified array as the arguments
* and the specified constructor as the `new.target` value.
* @param target The constructor to invoke.
* @param argumentsList An array of argument values to be passed to the constructor.
* @param newTarget The constructor to be used as the `new.target` object.
*/
function construct<A extends readonly any[], R>(
target: new (...args: A) => R,
argumentsList: Readonly<A>,
newTarget?: new (...args: any) => any,
): R;
function construct(target: Function, argumentsList: ArrayLike<any>, newTarget?: Function): any;
/**
* Adds a property to an object, or modifies attributes of an existing property.
* @param target Object on which to add or modify the property. This can be a native JavaScript object
* (that is, a user-defined object or a built in object) or a DOM object.
* @param propertyKey The property name.
* @param attributes Descriptor for the property. It can be for a data property or an accessor property.
*/
function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): boolean;
/**
* Removes a property from an object, equivalent to `delete target[propertyKey]`,
* except it won't throw if `target[propertyKey]` is non-configurable.
* @param target Object from which to remove the own property.
* @param propertyKey The property name.
*/
function deleteProperty(target: object, propertyKey: PropertyKey): boolean;
/**
* Gets the property of target, equivalent to `target[propertyKey]` when `receiver === target`.
* @param target Object that contains the property on itself or in its prototype chain.
* @param propertyKey The property name.
* @param receiver The reference to use as the `this` value in the getter function,
* if `target[propertyKey]` is an accessor property.
*/
function get<T extends object, P extends PropertyKey>(
target: T,
propertyKey: P,
receiver?: unknown,
): P extends keyof T ? T[P] : any;
/**
* Gets the own property descriptor of the specified object.
* An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.
* @param target Object that contains the property.
* @param propertyKey The property name.
*/
function getOwnPropertyDescriptor<T extends object, P extends PropertyKey>(
target: T,
propertyKey: P,
): TypedPropertyDescriptor<P extends keyof T ? T[P] : any> | undefined;
/**
* Returns the prototype of an object.
* @param target The object that references the prototype.
*/
function getPrototypeOf(target: object): object | null;
/**
* Equivalent to `propertyKey in target`.
* @param target Object that contains the property on itself or in its prototype chain.
* @param propertyKey Name of the property.
*/
function has(target: object, propertyKey: PropertyKey): boolean;
/**
* Returns a value that indicates whether new properties can be added to an object.
* @param target Object to test.
*/
function isExtensible(target: object): boolean;
/**
* Returns the string and symbol keys of the own properties of an object. The own properties of an object
* are those that are defined directly on that object, and are not inherited from the object's prototype.
* @param target Object that contains the own properties.
*/
function ownKeys(target: object): (string | symbol)[];
/**
* Prevents the addition of new properties to an object.
* @param target Object to make non-extensible.
* @return Whether the object has been made non-extensible.
*/
function preventExtensions(target: object): boolean;
/**
* Sets the property of target, equivalent to `target[propertyKey] = value` when `receiver === target`.
* @param target Object that contains the property on itself or in its prototype chain.
* @param propertyKey Name of the property.
* @param receiver The reference to use as the `this` value in the setter function,
* if `target[propertyKey]` is an accessor property.
*/
function set<T extends object, P extends PropertyKey>(
target: T,
propertyKey: P,
value: P extends keyof T ? T[P] : any,
receiver?: any,
): boolean;
function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
/**
* Sets the prototype of a specified object o to object proto or null.
* @param target The object to change its prototype.
* @param proto The value of the new prototype or null.
* @return Whether setting the prototype was successful.
*/
function setPrototypeOf(target: object, proto: object | null): boolean;
}
@@ -0,0 +1,22 @@
import { CreateType } from '../create/type.mjs';
import { ReadonlyKind } from '../symbols/index.mjs';
import { Discard } from '../discard/index.mjs';
import { ReadonlyFromMappedResult } from './readonly-from-mapped-result.mjs';
import { IsMappedResult } from '../guard/kind.mjs';
function RemoveReadonly(schema) {
return CreateType(Discard(schema, [ReadonlyKind]));
}
function AddReadonly(schema) {
return CreateType({ ...schema, [ReadonlyKind]: 'Readonly' });
}
// prettier-ignore
function ReadonlyWithFlag(schema, F) {
return (F === false
? RemoveReadonly(schema)
: AddReadonly(schema));
}
/** `[Json]` Creates a Readonly property */
export function Readonly(schema, enable) {
const F = enable ?? true;
return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
}
@@ -0,0 +1,54 @@
{
"name": "vp-runtime-helper",
"version": "1.0.10",
"description": "Vite plugin runtime helper.",
"types": "./dist/index.d.ts",
"module": "./dist/index.mjs",
"main": "./dist/index.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
}
},
"engines": {
"node": ">=14.18.0",
"vite": ">=3.1.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fengxinming/vite-plugins.git",
"directory": "packages/vp-runtime-helper"
},
"keywords": [
"vite-plugin",
"vp-runtime-helper"
],
"author": "Jesse Feng <fxm0016@126.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/fengxinming/vite-plugins/issues"
},
"homepage": "https://fengxinming.github.io/vite-plugins/",
"dependencies": {
"@types/fs-extra": "^11.0.4",
"base-log-factory": "^2.1.4",
"blf-debug-appender": "^1.0.2",
"figlet": "^1.8.0",
"fs-extra": "^11.3.0",
"picocolors": "^1.0.0"
},
"devDependencies": {
"@rollup/plugin-typescript": "^12.1.2",
"vite": "^6.1.0"
},
"files": [
"dist"
],
"scripts": {
"build": "vite build",
"watch": "vite build --watch",
"release": "npm publish"
}
}
@@ -0,0 +1,89 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PredefinedFormatToCheckFunction = void 0;
const enums_1 = require("./enums");
/*
These format functions are taken from `tslint-consistent-codestyle/naming-convention`:
https://github.com/ajafff/tslint-consistent-codestyle/blob/ab156cc8881bcc401236d999f4ce034b59039e81/rules/namingConventionRule.ts#L603-L645
The license for the code can be viewed here:
https://github.com/ajafff/tslint-consistent-codestyle/blob/ab156cc8881bcc401236d999f4ce034b59039e81/LICENSE
*/
/*
Why not regex here? Because it's actually really, really difficult to create a regex to handle
all of the unicode cases, and we have many non-english users that use non-english characters.
https://gist.github.com/mathiasbynens/6334847
*/
function isPascalCase(name) {
return (name.length === 0 ||
(name[0] === name[0].toUpperCase() && !name.includes('_')));
}
function isStrictPascalCase(name) {
return (name.length === 0 ||
(name[0] === name[0].toUpperCase() && hasStrictCamelHumps(name, true)));
}
function isCamelCase(name) {
return (name.length === 0 ||
(name[0] === name[0].toLowerCase() && !name.includes('_')));
}
function isStrictCamelCase(name) {
return (name.length === 0 ||
(name[0] === name[0].toLowerCase() && hasStrictCamelHumps(name, false)));
}
function hasStrictCamelHumps(name, isUpper) {
function isUppercaseChar(char) {
return char === char.toUpperCase() && char !== char.toLowerCase();
}
if (name.startsWith('_')) {
return false;
}
for (let i = 1; i < name.length; ++i) {
if (name[i] === '_') {
return false;
}
if (isUpper === isUppercaseChar(name[i])) {
if (isUpper) {
return false;
}
}
else {
isUpper = !isUpper;
}
}
return true;
}
function isSnakeCase(name) {
return (name.length === 0 ||
(name === name.toLowerCase() && validateUnderscores(name)));
}
function isUpperCase(name) {
return (name.length === 0 ||
(name === name.toUpperCase() && validateUnderscores(name)));
}
/** Check for leading trailing and adjacent underscores */
function validateUnderscores(name) {
if (name.startsWith('_')) {
return false;
}
let wasUnderscore = false;
for (let i = 1; i < name.length; ++i) {
if (name[i] === '_') {
if (wasUnderscore) {
return false;
}
wasUnderscore = true;
}
else {
wasUnderscore = false;
}
}
return !wasUnderscore;
}
exports.PredefinedFormatToCheckFunction = {
[enums_1.PredefinedFormats.camelCase]: isCamelCase,
[enums_1.PredefinedFormats.PascalCase]: isPascalCase,
[enums_1.PredefinedFormats.snake_case]: isSnakeCase,
[enums_1.PredefinedFormats.strictCamelCase]: isStrictCamelCase,
[enums_1.PredefinedFormats.StrictPascalCase]: isStrictPascalCase,
[enums_1.PredefinedFormats.UPPER_CASE]: isUpperCase,
};
@@ -0,0 +1,91 @@
import { Queue } from 'queue-lit';
/**
* pLimit creates a "limiter" function that can be used to enqueue
* promise returning functions with limited concurrency.
* @param {number} concurrency
*/
function pLimit(concurrency) {
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
throw new TypeError('Expected `concurrency` to be a number greater than 1');
}
const queue = new Queue();
let activeCount = 0;
/**
* next updates the activeCount and executes the next queued item.
*/
const next = () => {
activeCount--;
if (queue.size > 0) {
queue.pop()();
}
};
/**
* run executes a given `fn` passing `args`. Inside the `run` closure any
* thrown errors/rejections are swallowed, but by resolving the `fn` result
* immediatly we surface any rejections/errors to a parent function.
* @param {Function} fn
* @param {Promise.resolve} resolve
* @param {*} args
*/
const run = async (fn, resolve, args) => {
activeCount++;
const result = (async () => fn(...args))();
resolve(result);
try {
await result;
} catch {}
next();
};
/**
* enqueue enqueues a given `fn` to be executed while limiting concurrency.
* @param {Function} fn
* @param {Promise.resolve} resolve
* @param {*} args
*/
const enqueue = (fn, resolve, args) => {
queue.push(run.bind(null, fn, resolve, args));
(async () => {
// NOTE(joel): This function needs to wait until the next microtask
// before comparing `activeCount` to `concurrency` because `activeCount`
// is updated asynchronously when the run function is popped and
// called.
await Promise.resolve();
if (activeCount < concurrency && queue.size > 0) {
queue.pop()();
}
})();
};
/**
* generator defines the public api of `pLimit` and allows enqueueing promise
* returning functions while limiting their concurrency.
* @param {(...args: Arguments) => PromiseLike<RType> | RType} fn
* @param {Arguments} args
* @returns {Promise<RType>}
* @template {unknown[]} Arguments
* @template RType
*/
const generator = (fn, ...args) => new Promise(resolve => {
enqueue(fn, resolve, args);
});
Object.defineProperties(generator, {
activeCount: {
get: () => activeCount
},
pendingCount: {
get: () => queue.size
},
clearQueue: {
value: () => {
queue.clear();
}
}
});
return generator;
}
export { pLimit };
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stringifyServiceIdentifier = stringifyServiceIdentifier;
function stringifyServiceIdentifier(serviceIdentifier) {
switch (typeof serviceIdentifier) {
case 'string':
case 'symbol':
return serviceIdentifier.toString();
case 'function':
return serviceIdentifier.name;
default:
throw new Error(`Unexpected ${typeof serviceIdentifier} service id type`);
}
}
//# sourceMappingURL=stringifyServiceIdentifier.js.map
@@ -0,0 +1,13 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-configs.js" script.
*/
"use strict"
module.exports = {
plugins: ["es-x"],
rules: {
"es-x/no-array-prototype-includes": "error",
"es-x/no-exponential-operators": "error",
},
}
@@ -0,0 +1,25 @@
var $d84f98b140466b44$exports = require("./useToggleState.main.js");
var $40e5a2b1abaa0aa5$exports = require("./useToggleGroupState.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useToggleState", () => $d84f98b140466b44$exports.useToggleState);
$parcel$export(module.exports, "useToggleGroupState", () => $40e5a2b1abaa0aa5$exports.useToggleGroupState);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
//# sourceMappingURL=main.js.map
@@ -0,0 +1,8 @@
var $659de19a00ff9617$exports = {};
$659de19a00ff9617$exports = {
"breadcrumbs": `Nar\u{161}ymo kelias`
};
export {$659de19a00ff9617$exports as default};
//# sourceMappingURL=lt-LT.module.js.map
@@ -0,0 +1 @@
!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(a="undefined"!=typeof globalThis?globalThis:a||self).dayjs_locale_bm=e(a.dayjs)}(this,(function(a){"use strict";function e(a){return a&&"object"==typeof a&&"default"in a?a:{default:a}}var l=e(a),t={name:"bm",weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),weekStart:1,weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),ordinal:function(a){return a},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"}};return l.default.locale(t,null,!0),t}));
@@ -0,0 +1,5 @@
function hasTarget(target, targets) {
return targets.has(target) && Object.keys(targets.get(target)).length > 0;
}
export { hasTarget };
@@ -0,0 +1,178 @@
/**
* @typedef {object} ScreenValue
* @property {number|undefined} min
* @property {number|undefined} max
* @property {string|undefined} raw
*/ /**
* @typedef {object} Screen
* @property {string} name
* @property {boolean} not
* @property {ScreenValue[]} values
*/ /**
* A function that normalizes the various forms that the screens object can be
* provided in.
*
* Input(s):
* - ['100px', '200px'] // Raw strings
* - { sm: '100px', md: '200px' } // Object with string values
* - { sm: { min: '100px' }, md: { max: '100px' } } // Object with object values
* - { sm: [{ min: '100px' }, { max: '200px' }] } // Object with object array (multiple values)
*
* Output(s):
* - [{ name: 'sm', values: [{ min: '100px', max: '200px' }] }] // List of objects, that contains multiple values
*
* @returns {Screen[]}
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
normalizeScreens: function() {
return normalizeScreens;
},
isScreenSortable: function() {
return isScreenSortable;
},
compareScreens: function() {
return compareScreens;
},
toScreen: function() {
return toScreen;
}
});
function normalizeScreens(screens, root = true) {
if (Array.isArray(screens)) {
return screens.map((screen)=>{
if (root && Array.isArray(screen)) {
throw new Error("The tuple syntax is not supported for `screens`.");
}
if (typeof screen === "string") {
return {
name: screen.toString(),
not: false,
values: [
{
min: screen,
max: undefined
}
]
};
}
let [name, options] = screen;
name = name.toString();
if (typeof options === "string") {
return {
name,
not: false,
values: [
{
min: options,
max: undefined
}
]
};
}
if (Array.isArray(options)) {
return {
name,
not: false,
values: options.map((option)=>resolveValue(option))
};
}
return {
name,
not: false,
values: [
resolveValue(options)
]
};
});
}
return normalizeScreens(Object.entries(screens !== null && screens !== void 0 ? screens : {}), false);
}
function isScreenSortable(screen) {
if (screen.values.length !== 1) {
return {
result: false,
reason: "multiple-values"
};
} else if (screen.values[0].raw !== undefined) {
return {
result: false,
reason: "raw-values"
};
} else if (screen.values[0].min !== undefined && screen.values[0].max !== undefined) {
return {
result: false,
reason: "min-and-max"
};
}
return {
result: true,
reason: null
};
}
function compareScreens(type, a, z) {
let aScreen = toScreen(a, type);
let zScreen = toScreen(z, type);
let aSorting = isScreenSortable(aScreen);
let bSorting = isScreenSortable(zScreen);
// These cases should never happen and indicate a bug in Tailwind CSS itself
if (aSorting.reason === "multiple-values" || bSorting.reason === "multiple-values") {
throw new Error("Attempted to sort a screen with multiple values. This should never happen. Please open a bug report.");
} else if (aSorting.reason === "raw-values" || bSorting.reason === "raw-values") {
throw new Error("Attempted to sort a screen with raw values. This should never happen. Please open a bug report.");
} else if (aSorting.reason === "min-and-max" || bSorting.reason === "min-and-max") {
throw new Error("Attempted to sort a screen with both min and max values. This should never happen. Please open a bug report.");
}
// Let the sorting begin
let { min: aMin , max: aMax } = aScreen.values[0];
let { min: zMin , max: zMax } = zScreen.values[0];
// Negating screens flip their behavior. Basically `not min-width` is `max-width`
if (a.not) [aMin, aMax] = [
aMax,
aMin
];
if (z.not) [zMin, zMax] = [
zMax,
zMin
];
aMin = aMin === undefined ? aMin : parseFloat(aMin);
aMax = aMax === undefined ? aMax : parseFloat(aMax);
zMin = zMin === undefined ? zMin : parseFloat(zMin);
zMax = zMax === undefined ? zMax : parseFloat(zMax);
let [aValue, zValue] = type === "min" ? [
aMin,
zMin
] : [
zMax,
aMax
];
return aValue - zValue;
}
function toScreen(value, type) {
if (typeof value === "object") {
return value;
}
return {
name: "arbitrary-screen",
values: [
{
[type]: value
}
]
};
}
function resolveValue({ "min-width": _minWidth , min =_minWidth , max , raw } = {}) {
return {
min,
max,
raw
};
}
@@ -0,0 +1,10 @@
import { PluginFunc, ConfigType, OpUnitType } from 'dayjs'
declare const plugin: PluginFunc
export = plugin
declare module 'dayjs' {
interface Dayjs {
isBetween(a: ConfigType, b: ConfigType, c?: OpUnitType | null, d?: '()' | '[]' | '[)' | '(]'): boolean
}
}
@@ -0,0 +1,16 @@
range-set ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range ::= hyphen | simple ( ' ' simple ) * | ''
hyphen ::= partial ' - ' partial
simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr ::= 'x' | 'X' | '*' | nr
nr ::= '0' | [1-9] ( [0-9] ) *
tilde ::= '~' partial
caret ::= '^' partial
qualifier ::= ( '-' pre )? ( '+' build )?
pre ::= parts
build ::= parts
parts ::= part ( '.' part ) *
part ::= nr | [-0-9A-Za-z]+
@@ -0,0 +1,141 @@
/**
* container.js: Inversion of control container for winston logger instances.
*
* (C) 2010 Charlie Robbins
* MIT LICENCE
*/
'use strict';
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var createLogger = require('./create-logger');
/**
* Inversion of control container for winston logger instances.
* @type {Container}
*/
module.exports = /*#__PURE__*/function () {
/**
* Constructor function for the Container object responsible for managing a
* set of `winston.Logger` instances based on string ids.
* @param {!Object} [options={}] - Default pass-thru options for Loggers.
*/
function Container() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, Container);
this.loggers = new Map();
this.options = options;
}
/**
* Retrieves a `winston.Logger` instance for the specified `id`. If an
* instance does not exist, one is created.
* @param {!string} id - The id of the Logger to get.
* @param {?Object} [options] - Options for the Logger instance.
* @returns {Logger} - A configured Logger instance with a specified id.
*/
return _createClass(Container, [{
key: "add",
value: function add(id, options) {
var _this = this;
if (!this.loggers.has(id)) {
// Remark: Simple shallow clone for configuration options in case we pass
// in instantiated protoypal objects
options = Object.assign({}, options || this.options);
var existing = options.transports || this.options.transports;
// Remark: Make sure if we have an array of transports we slice it to
// make copies of those references.
if (existing) {
options.transports = Array.isArray(existing) ? existing.slice() : [existing];
} else {
options.transports = [];
}
var logger = createLogger(options);
logger.on('close', function () {
return _this._delete(id);
});
this.loggers.set(id, logger);
}
return this.loggers.get(id);
}
/**
* Retreives a `winston.Logger` instance for the specified `id`. If
* an instance does not exist, one is created.
* @param {!string} id - The id of the Logger to get.
* @param {?Object} [options] - Options for the Logger instance.
* @returns {Logger} - A configured Logger instance with a specified id.
*/
}, {
key: "get",
value: function get(id, options) {
return this.add(id, options);
}
/**
* Check if the container has a logger with the id.
* @param {?string} id - The id of the Logger instance to find.
* @returns {boolean} - Boolean value indicating if this instance has a
* logger with the specified `id`.
*/
}, {
key: "has",
value: function has(id) {
return !!this.loggers.has(id);
}
/**
* Closes a `Logger` instance with the specified `id` if it exists.
* If no `id` is supplied then all Loggers are closed.
* @param {?string} id - The id of the Logger instance to close.
* @returns {undefined}
*/
}, {
key: "close",
value: function close(id) {
var _this2 = this;
if (id) {
return this._removeLogger(id);
}
this.loggers.forEach(function (val, key) {
return _this2._removeLogger(key);
});
}
/**
* Remove a logger based on the id.
* @param {!string} id - The id of the logger to remove.
* @returns {undefined}
* @private
*/
}, {
key: "_removeLogger",
value: function _removeLogger(id) {
if (!this.loggers.has(id)) {
return;
}
var logger = this.loggers.get(id);
logger.close();
this._delete(id);
}
/**
* Deletes a `Logger` instance with the specified `id`.
* @param {!string} id - The id of the Logger instance to delete from
* container.
* @returns {undefined}
* @private
*/
}, {
key: "_delete",
value: function _delete(id) {
this.loggers["delete"](id);
}
}]);
}();
@@ -0,0 +1,87 @@
2.0.2 / 2025-06-06
==================
* Migrate to `String.prototype.slice()`
2.0.1 / 2021-01-03
==================
* Fix returning values from `Object.prototype`
2.0.0 / 2020-04-19
==================
* Drop support for Node.js 0.6
* Fix messaging casing of `418 I'm a Teapot`
* Remove code 306
* Remove `status[code]` exports; use `status.message[code]`
* Remove `status[msg]` exports; use `status.code[msg]`
* Rename `425 Unordered Collection` to standard `425 Too Early`
* Rename `STATUS_CODES` export to `message`
* Return status message for `statuses(code)` when given code
1.5.0 / 2018-03-27
==================
* Add `103 Early Hints`
1.4.0 / 2017-10-20
==================
* Add `STATUS_CODES` export
1.3.1 / 2016-11-11
==================
* Fix return type in JSDoc
1.3.0 / 2016-05-17
==================
* Add `421 Misdirected Request`
* perf: enable strict mode
1.2.1 / 2015-02-01
==================
* Fix message for status 451
- `451 Unavailable For Legal Reasons`
1.2.0 / 2014-09-28
==================
* Add `208 Already Repored`
* Add `226 IM Used`
* Add `306 (Unused)`
* Add `415 Unable For Legal Reasons`
* Add `508 Loop Detected`
1.1.1 / 2014-09-24
==================
* Add missing 308 to `codes.json`
1.1.0 / 2014-09-21
==================
* Add `codes.json` for universal support
1.0.4 / 2014-08-20
==================
* Package cleanup
1.0.3 / 2014-06-08
==================
* Add 308 to `.redirect` category
1.0.2 / 2014-03-13
==================
* Add `.retry` category
1.0.1 / 2014-03-12
==================
* Initial release
@@ -0,0 +1,7 @@
{
"name": "beep-boop",
"version": "1.2.3",
"repository" : {
"url": "https://github.com/substack/beep-boop"
}
}
@@ -0,0 +1,2 @@
export {gfmAutolinkLiteral} from './lib/syntax.js'
export {gfmAutolinkLiteralHtml} from './lib/html.js'
@@ -0,0 +1,147 @@
/**
* @fileoverview Rule to enforce declarations in program or function body root.
* @author Brandon Mills
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
const validParent = new Set([
"Program",
"StaticBlock",
"ExportNamedDeclaration",
"ExportDefaultDeclaration",
]);
const validBlockStatementParent = new Set([
"FunctionDeclaration",
"FunctionExpression",
"ArrowFunctionExpression",
]);
/**
* Finds the nearest enclosing context where this rule allows declarations and returns its description.
* @param {ASTNode} node Node to search from.
* @returns {string} Description. One of "program", "function body", "class static block body".
*/
function getAllowedBodyDescription(node) {
let { parent } = node;
while (parent) {
if (parent.type === "StaticBlock") {
return "class static block body";
}
if (astUtils.isFunction(parent)) {
return "function body";
}
({ parent } = parent);
}
return "program";
}
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: ["functions", { blockScopedFunctions: "allow" }],
docs: {
description:
"Disallow variable or `function` declarations in nested blocks",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-inner-declarations",
},
schema: [
{
enum: ["functions", "both"],
},
{
type: "object",
properties: {
blockScopedFunctions: {
enum: ["allow", "disallow"],
},
},
additionalProperties: false,
},
],
messages: {
moveDeclToRoot: "Move {{type}} declaration to {{body}} root.",
},
},
create(context) {
const both = context.options[0] === "both";
const { blockScopedFunctions } = context.options[1];
const sourceCode = context.sourceCode;
const ecmaVersion = context.languageOptions.ecmaVersion;
/**
* Ensure that a given node is at a program or function body's root.
* @param {ASTNode} node Declaration node to check.
* @returns {void}
*/
function check(node) {
const parent = node.parent;
if (
parent.type === "BlockStatement" &&
validBlockStatementParent.has(parent.parent.type)
) {
return;
}
if (validParent.has(parent.type)) {
return;
}
context.report({
node,
messageId: "moveDeclToRoot",
data: {
type:
node.type === "FunctionDeclaration"
? "function"
: "variable",
body: getAllowedBodyDescription(node),
},
});
}
return {
FunctionDeclaration(node) {
const isInStrictCode = sourceCode.getScope(node).upper.isStrict;
if (
blockScopedFunctions === "allow" &&
ecmaVersion >= 2015 &&
isInStrictCode
) {
return;
}
check(node);
},
VariableDeclaration(node) {
if (both && node.kind === "var") {
check(node);
}
},
};
},
};
@@ -0,0 +1,14 @@
import * as react from 'react';
import { ContextType } from './use-button-group.js';
import '@heroui/system';
import './button.js';
import './use-button.js';
import '@heroui/theme';
import '@heroui/use-aria-button';
import '@heroui/ripple';
import '@heroui/react-utils';
declare const ButtonGroupProvider: react.Provider<ContextType>;
declare const useButtonGroupContext: () => ContextType;
export { ButtonGroupProvider, useButtonGroupContext };
@@ -0,0 +1 @@
{"name":"date-manip","version":"2.0.6","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532099282,"integrity":"sha512-v9ES9Q4Lj8EvQQPnE5WDjoATwyH6RP7qz5z7pyfiQGOh24FJIBZD6JKybS0niZOVgyQ6XOrAe1JyyGwTCxD3vg==","mode":420,"size":1067},"dist/absFloor-CImRXpov.js":{"checkedAt":1794532099282,"integrity":"sha512-eOlu3+3/2tKOAkHefqFQjjnke4QxG/lqRk/FPvt9l3kb4WTa0MLcFyb0PL59/fIWxU22aNsHDfV++NSYxll6HA==","mode":420,"size":120},"dist/add.js":{"checkedAt":1794532099282,"integrity":"sha512-RVNbL9jJLdFGuAIqnJkuVhHXlHQ2g59/GexQqfaDbN2yy2md4HEoJtAOvQUJTn9prEP5iHfkNWhZ9dyOC3BVkw==","mode":420,"size":249},"dist/addDays.js":{"checkedAt":1794532099282,"integrity":"sha512-N1tszfPAxX9FRAs/xF4jalftxexfYb5eYZNOVI3rWwQNgVhABERBq1xL8pU3iqVGffC7xaBst3YDP5M+W1NzfQ==","mode":420,"size":244},"dist/addHours.js":{"checkedAt":1794532099282,"integrity":"sha512-J19uoDnVvclwdlrL/V/73eoIbVGpZPy46zkCM01NIFfASrUti/n/ueWKdJneCnPfINekzBocy2T4cJIv7PNgHw==","mode":420,"size":249},"dist/addMilliseconds.js":{"checkedAt":1794532099282,"integrity":"sha512-yTUjXcHx6V78qlhc49sQYx5FbChMo7NJ8NweVZOei69+NmlkfeAKFyRqWTpLx1S7DtUmnp9IggSXvqsMqnpOyg==","mode":420,"size":130},"dist/addMinutes.js":{"checkedAt":1794532099282,"integrity":"sha512-71Vf+WPx6tvxc7Fq5mEduyL/ljUbFvqVEI/BuO/KB3FZzTyn/VRU4HOK8QpYPa7RXfifYsfcmRmpEtqI+/nOVg==","mode":420,"size":259},"dist/addMonths.js":{"checkedAt":1794532099283,"integrity":"sha512-3Bkvm7b2URlbZrhFWOw1XMJHzcsvN/0O1yPwBXJrk3sTIxNA774n1e7wk3AN5V0pJuxR8SZPFu2xKJc4+f3TFw==","mode":420,"size":407},"dist/addObject-BB40bW2H.js":{"checkedAt":1794532099283,"integrity":"sha512-kmi/6N/4P9jhSmMR+Sl/CjEEAvYunI76jO2MKLnsN0np6czWWcMt7UW9ZCXhyFtDgu1O8Ca7O+miXBJA+cIoqA==","mode":420,"size":2235},"dist/addSeconds.js":{"checkedAt":1794532099283,"integrity":"sha512-m8zcWCJ1NY8tW1s0inTuGV9YUjFb3uKXgwlITiW8ESUuKcZIzhkzn8Ajo+P7fnscSRz6M/29IMFNa+1qulu2Sw==","mode":420,"size":259},"dist/addYears.js":{"checkedAt":1794532099283,"integrity":"sha512-GHHno8kDpwenB2IW3Wb31azop2k6zXvO8hrA79ks4pEQ16SXR8j82v3ZkMaCyUvR2Xw3nvHTSCLTZVxp4/R7SQ==","mode":420,"size":159},"dist/chain.js":{"checkedAt":1794532099283,"integrity":"sha512-DXxjO13WUFAu1KxLq8QWNQ4PW3hI+Pb4hd5WvDXvqTfCVmqHiValPX6oK2PjWhm4zevEgZljk9G9rAICIQJhBQ==","mode":420,"size":2409},"dist/chain.umd.js":{"checkedAt":1794532099283,"integrity":"sha512-BlIJ18iz4END5XcB14p9s8CoZGS4k+f0a8bBPCnZ3Ggw0pWKOvBZ+rH1bdHNRRvBIeUABq/e43f5P0cauISfwg==","mode":420,"size":28550},"dist/compile.js":{"checkedAt":1794532099284,"integrity":"sha512-nsR4FSsUzTJ2gdV2WIV/TECETaulxorW83AqxiWzmlEdiQ4roNlVz41R70sgChvXAKjgaHztwS1khJf1ktHnCg==","mode":420,"size":1202},"dist/constants-DR3SPJ7u.js":{"checkedAt":1794532099284,"integrity":"sha512-KhCmP9fCjZeQwqKHglOI5fcRRQQbaOJriZj+Gcu1nLQMXsBlfnsS5BwRQ+2LwKPeDjZP1dixgsQQ1czTvr+uBw==","mode":420,"size":432},"dist/dayOfYear.js":{"checkedAt":1794532099284,"integrity":"sha512-O81xs06OB155UHAT9UL4M1h+M/nene9n2mDZteKwCd6XGtuKzI+698uCwiJ7e9gooMpi+N9IDWINEDXcZ2bfXA==","mode":420,"size":527},"dist/daysInMonth.js":{"checkedAt":1794532099284,"integrity":"sha512-JCE8zGhJpzldanPguUQp4cTmxY3Dh91xPvIac2xJPRngOjvDlfYvCOqtbzSo+xtPNpINMkdsWPg+uTy/iM4teQ==","mode":420,"size":200},"dist/daysOfYear-Bif7I3Cq.js":{"checkedAt":1794532099284,"integrity":"sha512-V2eWi+NDb325ImlXG39I/NqbOiAuLq0CGLMkLNB/XdYFrnhtdO5W9D1GsGTMhYJnKHJ0rJ7Sh5yWLy4ihHNulQ==","mode":420,"size":309},"dist/diff.js":{"checkedAt":1794532099284,"integrity":"sha512-TtBJID+lKvkcTuu1dd0kCtru2WncCy38PexMFUcd1AWmXOdsq5DCaFRt6lcs4cWTxrgaOVdXu9vatAc7EFMLAQ==","mode":420,"size":1155},"dist/diffInDays.js":{"checkedAt":1794532099284,"integrity":"sha512-HkuKug/MLZ5/iS92QD78XdXbnKU11QOaQaLHhYDMPaUjIia0gYULWKlv6bIscuqOJc4iAozPacgbpUcR4N/fNw==","mode":420,"size":376},"dist/diffInHours.js":{"checkedAt":1794532099284,"integrity":"sha512-4lwBgsbtGKv899jHmm22Q5tFBuwoSkxUzINOh8mRCam43wWMJAcwcLYnHU0MV6NQkBZOKP9w4HlGjqacD7LkRA==","mode":420,"size":379},"dist/diffInMilliseconds.js":{"checkedAt":1794532099284,"integrity":"sha512-IGGVCLSEN0lIvOpdat7PXyJuMpwdsVQoPGwHDbpi0Znq93I8A5gY1y4QMFm9Wwt1R2EfGkU913CNzF3Trv+KYg==","mode":420,"size":314},"dist/diffInMinutes.js":{"checkedAt":1794532099285,"integrity":"sha512-m2NSp+hYidJaDPIBvTWY7M5Z6qbD9TLORTknF03FzhooaSrOZLm4WFh70ZIpk+f879vmF1AELgpKAri52tP7xg==","mode":420,"size":385},"dist/diffInMonths.js":{"checkedAt":1794532099285,"integrity":"sha512-3UJbjBi0gLC+hShFoI/MD7K8JOQ9PsyUAuWBc4zXeBG2iT8eQaLYXRnvuo+/TwtOLCrrOMzce1ZZ+6v6hhg4YQ==","mode":420,"size":374},"dist/diffInSeconds.js":{"checkedAt":1794532099285,"integrity":"sha512-kWbkfbSiWfiC3pY/ZXxs17b8lqxJ3eg8UR9t+DcR8IDSNZM/8cHnyM/lE0PooXEiD8wLnclmoae2VQ6Cs4ggGw==","mode":420,"size":385},"dist/diffInYears.js":{"checkedAt":1794532099285,"integrity":"sha512-eWuc6iEc2K3/aNWEvrxqNpx9LWj/gMEabVr6jrDc7HgXhGROpzuIz5GZHx6Q9hH0pS/k6+Pi5pvnXvAumN5hnA==","mode":420,"size":377},"dist/endOf.js":{"checkedAt":1794532099285,"integrity":"sha512-eGAv79UrFV6r+yYIPqVX0Lj9GlROGFBVsPEJTZ6TYtEUDPv6Ry+iYJfXNtf4JOWwSwJwlcNF3ybVmGTp6eHXjg==","mode":420,"size":1173},"dist/format.js":{"checkeLine truncated
@@ -0,0 +1 @@
export { renderToReadableStream, renderToStaticMarkup, renderToString } from "./server";
@@ -0,0 +1 @@
{"name":"mdast-util-to-hast","version":"13.2.0","requiresBuild":false,"files":{"license":{"checkedAt":1794532115847,"integrity":"sha512-cQvy4TvDNGTww5W7wo7SHRjv/0G8g3u/v8V2BhwwrAM+M5M2Z7W8hy+cQrU+e4exnULY2LrZ0EQqBk6Fj/Sdrw==","mode":420,"size":1099},"lib/handlers/blockquote.js":{"checkedAt":1794532115847,"integrity":"sha512-29g1J6HSgL83fVR4LRcNSljlD2D4dcXhQi9A044Q4Avlqu3tWQCYFFtaWQHX/NiZH1fP06K6TQWXbcyNE//8Tw==","mode":420,"size":674},"lib/handlers/break.js":{"checkedAt":1794532115848,"integrity":"sha512-I0nExzwCmNRtc6jil9QpkrlxsIANnru27DprOyrLc0Br9wVZoSvTaCjY4n0iQaMyTzY3s1DcbUutFJlAqMINHQ==","mode":420,"size":689},"lib/handlers/code.js":{"checkedAt":1794532115848,"integrity":"sha512-Cthq5sX8xTTBfWn26jt7OuIzC84Luw+Df4BJN8ETBDmDteePN0tlLWw8+T46xScJDtSb2TJBgKQiv/WfpIuQnA==","mode":420,"size":1087},"lib/handlers/delete.js":{"checkedAt":1794532115848,"integrity":"sha512-yokjO6PwfWLmuN+PxRq5ZlVAWOXGh2uukYBZwHKzk6pym6UwerNFjWKVTZ1l8QuXFPo8djaPl5FXk8h+B2GNKA==","mode":420,"size":636},"lib/handlers/emphasis.js":{"checkedAt":1794532115848,"integrity":"sha512-4OqdYaC9GFjla2kKFdOTJpchNDI/GnqJ/nBL7kFJzb/1PirdqRVXgK6kr0gxRSflr0nZtYVo2YNJ0a6IQkyPyg==","mode":420,"size":638},"lib/footer.js":{"checkedAt":1794532115848,"integrity":"sha512-rhSbFH0tCSuow1lCSeRALsYOXi/Ubi8lkyj0jYc+DEHPXMaUgimcOqZOBe+WZCoyvbBHTcrazrFVViov9TlKqA==","mode":420,"size":7673},"lib/handlers/footnote-reference.js":{"checkedAt":1794532115848,"integrity":"sha512-LW+DICVvuboaHErj6qtsz9ZiWnBywBxCEghQSouawuvrBC8NJsB2kor7RuD0LVnxeZZ+NYVz4dizy2RSJ9pynA==","mode":420,"size":1715},"lib/handlers/heading.js":{"checkedAt":1794532115848,"integrity":"sha512-q0EiDJMiQZDG3x35UmIq0D/uqWCgFYPcsRW1YiwcEQ9SOELeUw6HlzFoebZXqRuqRDgjOiAhJEKicQNJ/Cdcxg==","mode":420,"size":645},"lib/handlers/html.js":{"checkedAt":1794532115849,"integrity":"sha512-Rm7j8PtdMBgovEYagLMrNKgumiao6bbW/RRIiMej1DvpvHdaFNXvWazubjw2Himz8Z4HV3BkhIenXXixWL4oQA==","mode":420,"size":743},"lib/handlers/image-reference.js":{"checkedAt":1794532115849,"integrity":"sha512-nhtDcFMPhlmrQMYb/KOhw5yvBHQh6fOim5UDD0Z7anXeLC0UbgYShTKQu3rWacfu2RNTajhejF2lWuMWNChYDQ==","mode":420,"size":1191},"lib/handlers/image.js":{"checkedAt":1794532115849,"integrity":"sha512-yQtb0K3gnKEIxKGd9dDBoj14BO89SDjU+pA40I84MyTgsJMqtjRuiau07kCGTdQWLsMgHOXtHQmpIQRTXtoCOw==","mode":420,"size":904},"index.js":{"checkedAt":1794532115849,"integrity":"sha512-cs7phqlLdyzffvPmKZjfEL6a/QRVQgzl6m1479aRAzrtb1fBUpI8xxlBq5tjhfjD86B2dJ39lIp8ZiWOyvnLAw==","mode":420,"size":239},"lib/handlers/index.js":{"checkedAt":1794532115849,"integrity":"sha512-x9YDjMtO4fLYzoaxe44T2SmKsIXDp60zvQkt4Euebg6CqCYo5frAg2Z5E/6dbfz9HcX48XZ9kiLFt16u7DB5Ig==","mode":420,"size":1546},"lib/index.js":{"checkedAt":1794532115849,"integrity":"sha512-SMYx5bZ0CIEn5h2vmKkIf1nWBU7HtMe/A+MnuHXWW7+MGNchunl8+XG9CYiUmEHkaC8fMlsAdlJZa/+3/ZJZ9w==","mode":420,"size":3631},"lib/handlers/inline-code.js":{"checkedAt":1794532115849,"integrity":"sha512-lvIYK07eZahOtJhEFevJvp3kFV0fEQl391KFR+mJXA48ch1PkvAnfKuFdJX7JpmSkTfgl7cIsngmRE+ngnYLLw==","mode":420,"size":804},"lib/handlers/link-reference.js":{"checkedAt":1794532115849,"integrity":"sha512-mEetCIaUfUnQ20jV6lXzzBWsCwQmuV1A/UrXqy1oYw88+LlPRIxV0eeIu3IufFcbXcvyz+HfYIP+bcyOctKgIg==","mode":420,"size":1203},"lib/handlers/link.js":{"checkedAt":1794532115850,"integrity":"sha512-Afy9No78TUUk3dXwcmq4gKA98Tn0zHAzzPzLeEtcTTgVjElXKfL8VLbANTcPr2HESZUs+WGnbmseSk1Jslf24w==","mode":420,"size":843},"lib/handlers/list-item.js":{"checkedAt":1794532115850,"integrity":"sha512-d6c1fkgoteSL6qiPtsGC4mzldMBuVB3UcLnIMb9d4y/2uwgMIFu4ly3BEb3i30EO9aodyjRMBgOKO5WBcmJe8g==","mode":420,"size":3097},"lib/handlers/list.js":{"checkedAt":1794532115850,"integrity":"sha512-X1rxpLbHyyLW3D5C+AMmin8apI/hGXTXrwWaMnk1HLboYOO/36mdhalURofCmCiGahl673k4O4bpfhsAejJSqg==","mode":420,"size":1316},"lib/handlers/paragraph.js":{"checkedAt":1794532115850,"integrity":"sha512-Dd22OfzYDWlqY4UJ+tKSUNO4wtopPFMQEKDp2fbL/ympLxe69+u3EuWkrrgxrxsQQg1Gw/OoA/GU3ocy3kr5Qg==","mode":420,"size":642},"lib/revert.js":{"checkedAt":1794532115850,"integrity":"sha512-2GfZGUnx6JODOa1R45vleiGSR83kvGlsv01qd4Uag9jAfkdYaUVhV7DJWuUWjn9/htTDcunLJlCzhTlQPS4Qig==","mode":420,"size":1278},"lib/handlers/root.js":{"checkedAt":1794532115850,"integrity":"sha512-7OsBjYbQpwREWS/0io3XK2+vS26ZErc7sM5QcApG9vfvrpdhu80V4YEajmI6V06jIP4IBjdiGE0YVtXK3WG3tA==","mode":420,"size":638},"lib/state.js":{"checkedAt":1794532115850,"integrity":"sha512-i3VSsfFqipgEZ43Tc8PqWn2I1/7BGVjT6oAqM6NidEGSCLTo5zSQdR8+44pF9yMfa3tVQfu/63NHLV44+WRn5A==","mode":420,"size":15054},"lib/handlers/strong.js":{"checkedAt":1794532115850,"integrity":"sha512-+h/IuBdiu2iNGTYTPrW4ntAbIlEwkHkMBybqHQ0k7DdtzSgPccIIiZJmylBxijRfVeB4TA+bRtpVv7icJTnwFg==","mode":420,"size":632},"lib/handlers/table-cell.js":{"checkedAt":1794532115851,"integrity":"sha512-or3GZT5FNH1dq1Cu6d3ivafqaT+sIY5J2H0LOe2pW/uCSTk41QaeH/UMxPd2MY+cwXGHYNed5WdQAc+g14DYxw==","mode":420,"size":777},"lib/handlers/table-row.js":{"checkedAt":1794532115851,"integrity":"sha512-lmr9RxuQHHA79GOGzySbBB2u+cYiAkBX6QWZssMYNF8wgEATDsxLine truncated
@@ -0,0 +1,44 @@
type ModeWriter = (doc: Doc, modes: { execution: "sync" | "async" }) => void;
export class Doc {
args!: string[];
content: string[] = [];
indent = 0;
constructor(args: string[] = []) {
if (this) this.args = args;
}
indented(fn: (doc: Doc) => void) {
this.indent += 1;
fn(this);
this.indent -= 1;
}
write(fn: ModeWriter): void;
write(line: string): void;
write(arg: any) {
if (typeof arg === "function") {
(arg as ModeWriter)(this, { execution: "sync" });
(arg as ModeWriter)(this, { execution: "async" });
return;
}
const content = arg as string;
const lines = content.split("\n").filter((x) => x);
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
for (const line of dedented) {
this.content.push(line);
}
}
compile() {
const F = Function;
const args = this?.args;
const content = this?.content ?? [``];
const lines = [...content.map((x) => ` ${x}`)];
// console.log(lines.join("\n"));
return new F(...args, lines.join("\n"));
}
}
@@ -0,0 +1,16 @@
import baseGet from './_baseGet.js';
import baseSlice from './_baseSlice.js';
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
}
export default parent;
@@ -0,0 +1,68 @@
'use strict';
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var Call = require('./Call');
var CreateDataProperty = require('./CreateDataProperty');
var EnumerableOwnProperties = require('./EnumerableOwnProperties');
var Get = require('./Get');
var IsArray = require('./IsArray');
var LengthOfArrayLike = require('./LengthOfArrayLike');
var ToString = require('./ToString');
var forEach = require('../helpers/forEach');
// https://262.ecma-international.org/14.0/#sec-internalizejsonproperty
// note: `reviver` was implicitly closed-over until ES2020, where it becomes a third argument
module.exports = function InternalizeJSONProperty(holder, name, reviver) {
if (!isObject(holder)) {
throw new $TypeError('Assertion failed: `holder` is not an Object');
}
if (typeof name !== 'string') {
throw new $TypeError('Assertion failed: `name` is not a String');
}
if (typeof reviver !== 'function') {
throw new $TypeError('Assertion failed: `reviver` is not a Function');
}
var val = Get(holder, name); // step 1
if (isObject(val)) { // step 2
var isArray = IsArray(val); // step 2.a
if (isArray) { // step 2.b
var I = 0; // step 2.b.i
var len = LengthOfArrayLike(val); // step 2.b.ii
while (I < len) { // step 2.b.iii
var newElement = InternalizeJSONProperty(val, ToString(I), reviver); // step 2.b.iv.1
if (typeof newElement === 'undefined') { // step 2.b.iii.2
delete val[ToString(I)]; // step 2.b.iii.2.a
} else { // step 2.b.iii.3
CreateDataProperty(val, ToString(I), newElement); // step 2.b.iii.3.a
}
I += 1; // step 2.b.iii.4
}
} else { // step 2.c
var keys = EnumerableOwnProperties(val, 'key'); // step 2.c.i
forEach(keys, function (P) { // step 2.c.ii
// eslint-disable-next-line no-shadow
var newElement = InternalizeJSONProperty(val, P, reviver); // step 2.c.ii.1
if (typeof newElement === 'undefined') { // step 2.c.ii.2
delete val[P]; // step 2.c.ii.2.a
} else { // step 2.c.ii.3
CreateDataProperty(val, P, newElement); // step 2.c.ii.3.a
}
});
}
}
return Call(reviver, holder, [name, val]); // step 3
};
@@ -0,0 +1,36 @@
'use strict';
require('../auto');
var test = require('tape');
var defineProperties = require('define-properties');
var callBind = require('call-bind');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = require('functions-have-names')();
var runTests = require('./tests');
test('shimmed', function (t) {
t.equal(String.prototype.trim.length, 0, 'String#trim has a length of 0');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(String.prototype.trim.name, 'trim', 'String#trim has name "trim"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(String.prototype, 'trim'), 'String#trim is not enumerable');
et.end();
});
var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
t.test('bad string/this value', { skip: !supportsStrictMode }, function (st) {
st['throws'](function () { return String.prototype.trim.call(undefined, 'a'); }, TypeError, 'undefined is not an object');
st['throws'](function () { return String.prototype.trim.call(null, 'a'); }, TypeError, 'null is not an object');
st.end();
});
runTests(callBind(String.prototype.trim), t);
t.end();
});
@@ -0,0 +1,33 @@
import parser from 'postcss-selector-parser'
/**
* @template {string | import('postcss-selector-parser').Root} T
*
* Prefix all classes in the selector with the given prefix
*
* It can take either a string or a selector AST and will return the same type
*
* @param {string} prefix
* @param {T} selector
* @param {boolean} prependNegative
* @returns {T}
*/
export default function (prefix, selector, prependNegative = false) {
if (prefix === '') {
return selector
}
/** @type {import('postcss-selector-parser').Root} */
let ast = typeof selector === 'string' ? parser().astSync(selector) : selector
ast.walkClasses((classSelector) => {
let baseClass = classSelector.value
let shouldPlaceNegativeBeforePrefix = prependNegative && baseClass.startsWith('-')
classSelector.value = shouldPlaceNegativeBeforePrefix
? `-${prefix}${baseClass.slice(1)}`
: `${prefix}${baseClass}`
})
return typeof selector === 'string' ? ast.toString() : ast
}
@@ -0,0 +1 @@
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAW1C,MAAM,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;AAE9B,UAAU,IAAK,SAAQ,IAAI;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,QAAQ;IAChB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,SAAS,GACjB,IAAI,GACJ,SAAS,GACT,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG;KAAG,CAAC,IAAI,MAAM,GAAG,MAAM,GAAG,KAAK;CAAE,CAAC;AAE5D,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAE9D,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,SAAS,IACrD,CAAC,GACD,CAAC,CAAC,GAAG;IAAE,CAAC,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAExB,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,GAC7C,CAAC,SAAS,MAAM,GACd,CAAC,GACD,KAAK,GACP,KAAK,CAAC;AAEV,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,mBAAmB,GAAG,WAAW,GACpE,CAAC,GACD;KACG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GAC/C,CAAC,CAAC,CAAC,CAAC,GACJ,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACtB,CAAC;AAEN,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI,CAAC,SACtC,mBAAmB,GACnB,WAAW,GACX,CAAC,GACD,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,GAC1B;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACjD;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEzD;;;;;;;;GAQG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,OAAO,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GACvC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,GAAG,CAAC,GACnE,IAAI,GACJ,KAAK,GACP,KAAK,CAAC;AAEV,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,MAAM,IAC3B,KAAK,CAAC,CAAC,CAAC,SAAS,IAAI,GACjB,GAAG,GACH,CAAC,SAAS,mBAAmB,GAAG,WAAW,GACzC,MAAM,GACN,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;CAAE,GACvD,MAAM,CAAC;AAEjB,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IACvC,OAAO,CACL,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,QAAQ,CAAC,EAClD,GAAG,EAAE,GAAG,MAAM,CACf,SAAS,KAAK,GACX,IAAI,GACJ,KAAK,CAAC;AAEZ,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,GAClD,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GACjB,CAAC,CAAC,CAAC,CAAC,GACN,CAAC,SAAS,MAAM,CAAC,GACf,CAAC,CAAC,CAAC,CAAC,GACJ,CAAC,SAAS,MAAM,CAAC,GACf,CAAC,CAAC,CAAC,CAAC,GACJ,KAAK;CACd,CAAC"}
@@ -0,0 +1,85 @@
import {
VOID, PRIMITIVE,
ARRAY, OBJECT,
DATE, REGEXP, MAP, SET,
ERROR, BIGINT
} from './types.js';
const env = typeof self === 'object' ? self : globalThis;
const deserializer = ($, _) => {
const as = (out, index) => {
$.set(index, out);
return out;
};
const unpair = index => {
if ($.has(index))
return $.get(index);
const [type, value] = _[index];
switch (type) {
case PRIMITIVE:
case VOID:
return as(value, index);
case ARRAY: {
const arr = as([], index);
for (const index of value)
arr.push(unpair(index));
return arr;
}
case OBJECT: {
const object = as({}, index);
for (const [key, index] of value)
object[unpair(key)] = unpair(index);
return object;
}
case DATE:
return as(new Date(value), index);
case REGEXP: {
const {source, flags} = value;
return as(new RegExp(source, flags), index);
}
case MAP: {
const map = as(new Map, index);
for (const [key, index] of value)
map.set(unpair(key), unpair(index));
return map;
}
case SET: {
const set = as(new Set, index);
for (const index of value)
set.add(unpair(index));
return set;
}
case ERROR: {
const {name, message} = value;
return as(new env[name](message), index);
}
case BIGINT:
return as(BigInt(value), index);
case 'BigInt':
return as(Object(BigInt(value)), index);
case 'ArrayBuffer':
return as(new Uint8Array(value).buffer, value);
case 'DataView': {
const { buffer } = new Uint8Array(value);
return as(new DataView(buffer), value);
}
}
return as(new env[type](value), index);
};
return unpair;
};
/**
* @typedef {Array<string,any>} Record a type representation
*/
/**
* Returns a deserialized value from a serialized array of Records.
* @param {Record[]} serialized a previously serialized value.
* @returns {any}
*/
export const deserialize = serialized => deserializer(new Map, serialized)(0);
@@ -0,0 +1,146 @@
const FOLD_FLOW = 'flow';
const FOLD_BLOCK = 'block';
const FOLD_QUOTED = 'quoted';
/**
* Tries to keep input at up to `lineWidth` characters, splitting only on spaces
* not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are
* terminated with `\n` and started with `indent`.
*/
function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
if (!lineWidth || lineWidth < 0)
return text;
if (lineWidth < minContentWidth)
minContentWidth = 0;
const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
if (text.length <= endStep)
return text;
const folds = [];
const escapedFolds = {};
let end = lineWidth - indent.length;
if (typeof indentAtStart === 'number') {
if (indentAtStart > lineWidth - Math.max(2, minContentWidth))
folds.push(0);
else
end = lineWidth - indentAtStart;
}
let split = undefined;
let prev = undefined;
let overflow = false;
let i = -1;
let escStart = -1;
let escEnd = -1;
if (mode === FOLD_BLOCK) {
i = consumeMoreIndentedLines(text, i, indent.length);
if (i !== -1)
end = i + endStep;
}
for (let ch; (ch = text[(i += 1)]);) {
if (mode === FOLD_QUOTED && ch === '\\') {
escStart = i;
switch (text[i + 1]) {
case 'x':
i += 3;
break;
case 'u':
i += 5;
break;
case 'U':
i += 9;
break;
default:
i += 1;
}
escEnd = i;
}
if (ch === '\n') {
if (mode === FOLD_BLOCK)
i = consumeMoreIndentedLines(text, i, indent.length);
end = i + indent.length + endStep;
split = undefined;
}
else {
if (ch === ' ' &&
prev &&
prev !== ' ' &&
prev !== '\n' &&
prev !== '\t') {
// space surrounded by non-space can be replaced with newline + indent
const next = text[i + 1];
if (next && next !== ' ' && next !== '\n' && next !== '\t')
split = i;
}
if (i >= end) {
if (split) {
folds.push(split);
end = split + endStep;
split = undefined;
}
else if (mode === FOLD_QUOTED) {
// white-space collected at end may stretch past lineWidth
while (prev === ' ' || prev === '\t') {
prev = ch;
ch = text[(i += 1)];
overflow = true;
}
// Account for newline escape, but don't break preceding escape
const j = i > escEnd + 1 ? i - 2 : escStart - 1;
// Bail out if lineWidth & minContentWidth are shorter than an escape string
if (escapedFolds[j])
return text;
folds.push(j);
escapedFolds[j] = true;
end = j + endStep;
split = undefined;
}
else {
overflow = true;
}
}
}
prev = ch;
}
if (overflow && onOverflow)
onOverflow();
if (folds.length === 0)
return text;
if (onFold)
onFold();
let res = text.slice(0, folds[0]);
for (let i = 0; i < folds.length; ++i) {
const fold = folds[i];
const end = folds[i + 1] || text.length;
if (fold === 0)
res = `\n${indent}${text.slice(0, end)}`;
else {
if (mode === FOLD_QUOTED && escapedFolds[fold])
res += `${text[fold]}\\`;
res += `\n${indent}${text.slice(fold + 1, end)}`;
}
}
return res;
}
/**
* Presumes `i + 1` is at the start of a line
* @returns index of last newline in more-indented block
*/
function consumeMoreIndentedLines(text, i, indent) {
let end = i;
let start = i + 1;
let ch = text[start];
while (ch === ' ' || ch === '\t') {
if (i < start + indent) {
ch = text[++i];
}
else {
do {
ch = text[++i];
} while (ch && ch !== '\n');
end = i;
start = i + 1;
ch = text[start];
}
}
return end;
}
export { FOLD_BLOCK, FOLD_FLOW, FOLD_QUOTED, foldFlowLines };
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L M G N","132":"O"},C:{"1":"0 1 2 3 4 5 bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB 0C 1C"},D:{"1":"0 1 2 3 4 5 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB","132":"vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B"},E:{"1":"F A B C L M G 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB K D E 2C ZC 3C 4C 5C"},F:{"1":"0 1 2 3 4 5 xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"6 7 8 9 F B C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB FD GD HD ID NC uC JD OC","132":"iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB"},G:{"1":"PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","2":"E ZC KD vC LD MD ND OD"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 AB BB CB DB EB FB sD aC tD uD vD wD xD QC RC SC yD","2":"J","132":"oD pD qD rD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:1,C:"relList (DOMTokenList)",D:true};
@@ -0,0 +1,19 @@
import Set from './_Set.js';
import noop from './noop.js';
import setToArray from './_setToArray.js';
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Creates a set object of `values`.
*
* @private
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
return new Set(values);
};
export default createSet;
@@ -0,0 +1,17 @@
export function defaults(target, ...sources) {
for (let source of sources) {
for (let k in source) {
if (!target?.hasOwnProperty?.(k)) {
target[k] = source[k]
}
}
for (let k of Object.getOwnPropertySymbols(source)) {
if (!target?.hasOwnProperty?.(k)) {
target[k] = source[k]
}
}
}
return target
}
@@ -0,0 +1 @@
export { _ as default } from "../esm/_class_private_field_init.js";
@@ -0,0 +1,9 @@
// Declaration files in this directory contain types relating to TypeScript library features
// that are not included in all TypeScript versions supported by DefinitelyTyped, but
// which can be made backwards-compatible without needing `typesVersions`.
// If adding declarations to this directory, please specify which versions of TypeScript require them,
// so that they can be removed when no longer needed.
/// <reference path="disposable.d.ts" />
/// <reference path="indexable.d.ts" />
/// <reference path="iterators.d.ts" />
@@ -0,0 +1 @@
module.exports={C:{"4":0.01081,"115":0.04322,"138":0.01081,"140":0.01081,"141":0.0054,"142":0.02702,"143":0.31878,"144":0.33499,_:"2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 139 145 146 147 3.5 3.6"},D:{"39":0.01081,"40":0.01081,"41":0.01621,"42":0.01081,"43":0.01081,"44":0.01081,"45":0.01621,"46":0.01621,"47":0.01081,"48":0.01621,"49":0.01621,"50":0.01621,"51":0.01621,"52":0.01081,"53":0.01621,"54":0.01081,"55":0.01621,"56":0.01621,"57":0.01621,"58":0.01621,"59":0.01081,"60":0.01621,"65":0.0054,"75":0.01081,"76":0.0054,"79":0.09185,"85":0.01081,"87":0.07024,"93":0.03242,"94":0.01081,"97":0.01621,"98":0.0054,"103":0.04863,"105":0.0054,"106":0.0054,"108":0.05943,"109":0.47546,"110":0.0054,"111":0.02702,"112":8.86632,"114":0.0054,"115":0.0054,"116":0.02702,"117":0.0054,"119":0.03782,"120":0.02702,"121":0.0054,"122":0.05403,"123":0.0054,"124":0.0054,"125":9.87668,"126":0.68618,"127":0.02161,"128":0.04322,"129":0.01081,"130":0.01081,"131":0.07024,"132":0.03782,"133":0.03782,"134":0.02702,"135":0.10806,"136":0.03782,"137":0.05403,"138":0.28096,"139":0.39442,"140":4.71682,"141":12.67004,"142":0.1837,"143":0.0054,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 62 63 64 66 67 68 69 70 71 72 73 74 77 78 80 81 83 84 86 88 89 90 91 92 95 96 99 100 101 102 104 107 113 118 144 145"},F:{"91":0.01081,"92":0.01081,"95":0.02161,"117":0.02161,"120":0.07564,"121":0.1837,"122":1.72356,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.01621,"109":0.01081,"114":0.33499,"129":0.0054,"130":0.0054,"131":0.0054,"132":0.0054,"133":0.0054,"134":0.08645,"135":0.0054,"136":0.0054,"137":0.01081,"138":0.02702,"139":0.05943,"140":0.69699,"141":4.35482,"142":0.01081,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 120 121 122 123 124 125 126 127 128"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.2 18.2 26.2","5.1":0.0054,"13.1":0.0054,"15.6":0.02702,"16.6":0.03782,"17.1":0.01621,"17.3":0.0054,"17.4":0.0054,"17.5":0.0054,"17.6":0.05403,"18.0":0.03242,"18.1":0.0054,"18.3":0.02702,"18.4":0.21072,"18.5-18.6":0.03782,"26.0":0.39442,"26.1":0.0054},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00121,"5.0-5.1":0,"6.0-6.1":0.00484,"7.0-7.1":0.00363,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01089,"10.0-10.2":0.00121,"10.3":0.02056,"11.0-11.2":0.30479,"11.3-11.4":0.00726,"12.0-12.1":0.00242,"12.2-12.5":0.05926,"13.0-13.1":0,"13.2":0.00605,"13.3":0.00242,"13.4-13.7":0.00968,"14.0-14.4":0.02056,"14.5-14.8":0.02177,"15.0-15.1":0.02056,"15.2-15.3":0.01572,"15.4":0.01814,"15.5":0.02056,"15.6-15.8":0.2685,"16.0":0.03628,"16.1":0.06773,"16.2":0.03507,"16.3":0.06289,"16.4":0.01572,"16.5":0.02782,"16.6-16.7":0.35921,"17.0":0.0254,"17.1":0.0387,"17.2":0.02782,"17.3":0.04112,"17.4":0.07257,"17.5":0.12458,"17.6-17.7":0.31446,"18.0":0.07136,"18.1":0.14756,"18.2":0.07983,"18.3":0.25641,"18.4":0.13183,"18.5-18.6":6.72224,"26.0":0.83091,"26.1":0.03024},P:{"4":0.09332,"20":0.01037,"21":0.01037,"22":0.01037,"24":0.03111,"25":0.05185,"26":0.02074,"27":0.04148,"28":1.29617,"29":0.10369,_:"23 6.2-6.4 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 18.0 19.0","5.0-5.4":0.02074,"7.2-7.4":0.09332,"8.2":0.01037,"16.0":0.02074,"17.0":0.01037},I:{"0":0.03672,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.1563,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{"2.5":0.0046,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.11033},Q:{_:"14.9"},O:{"0":0.02758},H:{"0":0},L:{"0":34.88943}};
@@ -0,0 +1,46 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
test("parse async test", async () => {
const schema1 = z.string().refine(async (_val) => false);
expect(() => schema1.parse("asdf")).toThrow();
const schema2 = z.string().refine((_val) => Promise.resolve(true));
return await expect(() => schema2.parse("asdf")).toThrow();
});
test("parseAsync async test", async () => {
const schema1 = z.string().refine(async (_val) => true);
await schema1.parseAsync("asdf");
const schema2 = z.string().refine(async (_val) => false);
return await expect(schema2.parseAsync("asdf")).rejects.toBeDefined();
// expect(async () => await schema2.parseAsync('asdf')).toThrow();
});
test("parseAsync async test", async () => {
// expect.assertions(2);
const schema1 = z.string().refine((_val) => Promise.resolve(true));
const v1 = await schema1.parseAsync("asdf");
expect(v1).toEqual("asdf");
const schema2 = z.string().refine((_val) => Promise.resolve(false));
await expect(schema2.parseAsync("asdf")).rejects.toBeDefined();
const schema3 = z.string().refine((_val) => Promise.resolve(true));
await expect(schema3.parseAsync("asdf")).resolves.toEqual("asdf");
return await expect(schema3.parseAsync("qwer")).resolves.toEqual("qwer");
});
test("parseAsync async with value", async () => {
const schema1 = z.string().refine(async (val) => {
return val.length > 5;
});
await expect(schema1.parseAsync("asdf")).rejects.toBeDefined();
const v = await schema1.parseAsync("asdf123");
return await expect(v).toEqual("asdf123");
});
@@ -0,0 +1,15 @@
/** Used to match words composed of alphanumeric characters. */
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
/**
* Splits an ASCII `string` into an array of its words.
*
* @private
* @param {string} The string to inspect.
* @returns {Array} Returns the words of `string`.
*/
function asciiWords(string) {
return string.match(reAsciiWord) || [];
}
export default asciiWords;
@@ -0,0 +1,122 @@
import {
tv
} from "./chunk-UWE6H66T.mjs";
// src/components/spinner.ts
var spinner = tv({
slots: {
base: "relative inline-flex flex-col gap-2 items-center justify-center",
wrapper: "relative flex",
circle1: [
"absolute",
"w-full",
"h-full",
"rounded-full",
"animate-spinner-ease-spin",
"border-2",
"border-solid",
"border-t-transparent",
"border-l-transparent",
"border-r-transparent"
],
circle2: [
"absolute",
"w-full",
"h-full",
"rounded-full",
"opacity-75",
"animate-spinner-linear-spin",
"border-2",
"border-dotted",
"border-t-transparent",
"border-l-transparent",
"border-r-transparent"
],
label: "text-foreground dark:text-foreground-dark font-regular"
},
variants: {
size: {
sm: {
wrapper: "w-5 h-5",
circle1: "border-2",
circle2: "border-2",
label: "text-small"
},
md: {
wrapper: "w-8 h-8",
circle1: "border-3",
circle2: "border-3",
label: "text-medium"
},
lg: {
wrapper: "w-10 h-10",
circle1: "border-3",
circle2: "border-3",
label: "text-large"
}
},
color: {
current: {
circle1: "border-b-current",
circle2: "border-b-current"
},
white: {
circle1: "border-b-white",
circle2: "border-b-white"
},
default: {
circle1: "border-b-default",
circle2: "border-b-default"
},
primary: {
circle1: "border-b-primary",
circle2: "border-b-primary"
},
secondary: {
circle1: "border-b-secondary",
circle2: "border-b-secondary"
},
success: {
circle1: "border-b-success",
circle2: "border-b-success"
},
warning: {
circle1: "border-b-warning",
circle2: "border-b-warning"
},
danger: {
circle1: "border-b-danger",
circle2: "border-b-danger"
}
},
labelColor: {
foreground: {
label: "text-foreground"
},
primary: {
label: "text-primary"
},
secondary: {
label: "text-secondary"
},
success: {
label: "text-success"
},
warning: {
label: "text-warning"
},
danger: {
label: "text-danger"
}
}
},
defaultVariants: {
size: "md",
color: "primary",
labelColor: "foreground"
}
});
export {
spinner
};
@@ -0,0 +1,4 @@
import { ResolutionContext } from '../../resolution/models/ResolutionContext';
import { Resolved } from '../../resolution/models/Resolved';
export type BindingActivation<T = unknown> = (context: ResolutionContext, injectable: T) => Resolved<T>;
//# sourceMappingURL=BindingActivation.d.ts.map
@@ -0,0 +1,23 @@
/**
* @import {Info, State} from 'mdast-util-to-markdown'
* @import {Parents, Root} from 'mdast'
*/
import {phrasing} from 'mdast-util-phrasing'
/**
* @param {Root} node
* @param {Parents | undefined} _
* @param {State} state
* @param {Info} info
* @returns {string}
*/
export function root(node, _, state, info) {
// Note: `html` nodes are ambiguous.
const hasPhrasing = node.children.some(function (d) {
return phrasing(d)
})
const container = hasPhrasing ? state.containerPhrasing : state.containerFlow
return container.call(state, node, info)
}
@@ -0,0 +1,161 @@
import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f} from "./CalendarDate.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // Portions of the code in this file are based on code from ICU.
// Original licensing can be found in the NOTICE file in the root directory of this source tree.
const $b956b2d7a6cf451f$var$ETHIOPIC_EPOCH = 1723856;
const $b956b2d7a6cf451f$var$COPTIC_EPOCH = 1824665;
// The delta between Amete Alem 1 and Amete Mihret 1
// AA 5501 = AM 1
const $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA = 5500;
function $b956b2d7a6cf451f$var$ceToJulianDay(epoch, year, month, day) {
return epoch // difference from Julian epoch to 1,1,1
+ 365 * year // number of days from years
+ Math.floor(year / 4) // extra day of leap year
+ 30 * (month - 1 // number of days from months (1 based)
) + day - 1 // number of days for present month (1 based)
;
}
function $b956b2d7a6cf451f$var$julianDayToCE(epoch, jd) {
let year = Math.floor(4 * (jd - epoch) / 1461);
let month = 1 + Math.floor((jd - $b956b2d7a6cf451f$var$ceToJulianDay(epoch, year, 1, 1)) / 30);
let day = jd + 1 - $b956b2d7a6cf451f$var$ceToJulianDay(epoch, year, month, 1);
return [
year,
month,
day
];
}
function $b956b2d7a6cf451f$var$getLeapDay(year) {
return Math.floor(year % 4 / 3);
}
function $b956b2d7a6cf451f$var$getDaysInMonth(year, month) {
// The Ethiopian and Coptic calendars have 13 months, 12 of 30 days each and
// an intercalary month at the end of the year of 5 or 6 days, depending whether
// the year is a leap year or not. The Leap Year follows the same rules as the
// Julian Calendar so that the extra month always has six days in the year before
// a Julian Leap Year.
if (month % 13 !== 0) // not intercalary month
return 30;
else // intercalary month 5 days + possible leap day
return $b956b2d7a6cf451f$var$getLeapDay(year) + 5;
}
class $b956b2d7a6cf451f$export$26ba6eab5e20cd7d {
fromJulianDay(jd) {
let [year, month, day] = $b956b2d7a6cf451f$var$julianDayToCE($b956b2d7a6cf451f$var$ETHIOPIC_EPOCH, jd);
let era = 'AM';
if (year <= 0) {
era = 'AA';
year += $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA;
}
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, era, year, month, day);
}
toJulianDay(date) {
let year = date.year;
if (date.era === 'AA') year -= $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA;
return $b956b2d7a6cf451f$var$ceToJulianDay($b956b2d7a6cf451f$var$ETHIOPIC_EPOCH, year, date.month, date.day);
}
getDaysInMonth(date) {
return $b956b2d7a6cf451f$var$getDaysInMonth(date.year, date.month);
}
getMonthsInYear() {
return 13;
}
getDaysInYear(date) {
return 365 + $b956b2d7a6cf451f$var$getLeapDay(date.year);
}
getYearsInEra(date) {
// 9999-12-31 gregorian is 9992-20-02 ethiopic.
// Round down to 9991 for the last full year.
// AA 9999-01-01 ethiopic is 4506-09-30 gregorian.
return date.era === 'AA' ? 9999 : 9991;
}
getEras() {
return [
'AA',
'AM'
];
}
constructor(){
this.identifier = 'ethiopic';
}
}
class $b956b2d7a6cf451f$export$d72e0c37005a4914 extends $b956b2d7a6cf451f$export$26ba6eab5e20cd7d {
fromJulianDay(jd) {
let [year, month, day] = $b956b2d7a6cf451f$var$julianDayToCE($b956b2d7a6cf451f$var$ETHIOPIC_EPOCH, jd);
year += $b956b2d7a6cf451f$var$AMETE_MIHRET_DELTA;
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, 'AA', year, month, day);
}
getEras() {
return [
'AA'
];
}
getYearsInEra() {
// 9999-13-04 ethioaa is the maximum date, which is equivalent to 4506-09-29 gregorian.
return 9999;
}
constructor(...args){
super(...args), this.identifier = 'ethioaa' // also known as 'ethiopic-amete-alem' in ICU
;
}
}
class $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1 extends $b956b2d7a6cf451f$export$26ba6eab5e20cd7d {
fromJulianDay(jd) {
let [year, month, day] = $b956b2d7a6cf451f$var$julianDayToCE($b956b2d7a6cf451f$var$COPTIC_EPOCH, jd);
let era = 'CE';
if (year <= 0) {
era = 'BCE';
year = 1 - year;
}
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, era, year, month, day);
}
toJulianDay(date) {
let year = date.year;
if (date.era === 'BCE') year = 1 - year;
return $b956b2d7a6cf451f$var$ceToJulianDay($b956b2d7a6cf451f$var$COPTIC_EPOCH, year, date.month, date.day);
}
getDaysInMonth(date) {
let year = date.year;
if (date.era === 'BCE') year = 1 - year;
return $b956b2d7a6cf451f$var$getDaysInMonth(year, date.month);
}
isInverseEra(date) {
return date.era === 'BCE';
}
balanceDate(date) {
if (date.year <= 0) {
date.era = date.era === 'BCE' ? 'CE' : 'BCE';
date.year = 1 - date.year;
}
}
getEras() {
return [
'BCE',
'CE'
];
}
getYearsInEra(date) {
// 9999-12-30 gregorian is 9716-02-20 coptic.
// Round down to 9715 for the last full year.
// BCE 9999-01-01 coptic is BC 9716-06-15 gregorian.
return date.era === 'BCE' ? 9999 : 9715;
}
constructor(...args){
super(...args), this.identifier = 'coptic';
}
}
export {$b956b2d7a6cf451f$export$26ba6eab5e20cd7d as EthiopicCalendar, $b956b2d7a6cf451f$export$d72e0c37005a4914 as EthiopicAmeteAlemCalendar, $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1 as CopticCalendar};
//# sourceMappingURL=EthiopicCalendar.module.js.map
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReadonlyFromMappedResult = ReadonlyFromMappedResult;
const index_1 = require("../mapped/index");
const readonly_1 = require("./readonly");
// prettier-ignore
function FromProperties(K, F) {
const Acc = {};
for (const K2 of globalThis.Object.getOwnPropertyNames(K))
Acc[K2] = (0, readonly_1.Readonly)(K[K2], F);
return Acc;
}
// prettier-ignore
function FromMappedResult(R, F) {
return FromProperties(R.properties, F);
}
// prettier-ignore
function ReadonlyFromMappedResult(R, F) {
const P = FromMappedResult(R, F);
return (0, index_1.MappedResult)(P);
}
@@ -0,0 +1,24 @@
/**
Create a type from an object type without certain keys.
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
@example
```
import {Except} from 'type-fest';
type Foo = {
a: number;
b: string;
c: boolean;
};
type FooWithoutA = Except<Foo, 'a' | 'c'>;
//=> {b: string};
```
@category Utilities
*/
export type Except<ObjectType, KeysType extends keyof ObjectType> = Pick<ObjectType, Exclude<keyof ObjectType, KeysType>>;
@@ -0,0 +1,9 @@
'use strict';
var CompletionRecord = require('./CompletionRecord');
// https://262.ecma-international.org/6.0/#sec-normalcompletion
module.exports = function NormalCompletion(value) {
return new CompletionRecord('normal', value);
};
@@ -0,0 +1,6 @@
import {
CheckLinearIcon
} from "../chunk-6O2NYG7W.mjs";
export {
CheckLinearIcon
};
@@ -0,0 +1,103 @@
👋 Check out [Radashi](https://github.com/radashi-org/radashi), my latest endeavor.
<a href="https://github.com/radashi-org/radashi"><img src="https://github.com/radashi-org/radashi/raw/main/.github/img/notice.png" alt="Radashi" width="100%" /></a>
---
&nbsp;
# vite-tsconfig-paths
[![npm](https://img.shields.io/npm/v/vite-tsconfig-paths.svg)](https://www.npmjs.com/package/vite-tsconfig-paths)
[![Code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
Give [`vite`] the ability to resolve imports using TypeScript's path mapping.
[`vite`]: https://github.com/vitejs/vite
## Usage
1. Install as dev dependency
2. Ensure the project either has `"type": "module"` set or that the Vite config is renamed to `vite.config.mjs` / `vite.config.mts` depending on whether TypeScript is used
3. Inject `vite-tsconfig-paths` in the Vite config
```ts
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
export default defineConfig({
plugins: [tsconfigPaths()],
})
```
4. (optional) ⚠️ To enable path resolution in non-TypeScript modules (e.g. `.vue`, `.svelte`, `.mdx`), you must set the `allowJs` option to true in your `tsconfig.json` file. If that doesn't work, you might need to enable `loose: true` to resolve all files. Note that, due to a Vite limitation, CSS files (and CSS dialects) cannot be resolved with this plugin (see [#30](https://github.com/aleclarson/vite-tsconfig-paths/issues/30)).
**Note:** You need to restart Vite when you update your `paths` mappings. This is being tracked in [#17](https://github.com/aleclarson/vite-tsconfig-paths/issues/17) (contributions welcome).
### Options
- `root: string`
The directory to search for `tsconfig.json` files.
The default value of this option depends on whether `projects` is defined. If it is, then the [Vite project root](https://vitejs.dev/config/shared-options.html#root) is used. Otherwise, Vite's [`searchForWorkspaceRoot`](https://vitejs.dev/guide/api-javascript.html#searchforworkspaceroot) function is used.
- `projects: string[]`
If you have an esoteric setup, you _might_ need this option to specify where your tsconfig files are located. The paths within are relative to the `root` option.
If defined, the `root` directory won't be searched for tsconfig files. You should **always** try using just the `root` option first, because this option is more brittle.
- `loose: boolean`
Disable strictness that limits path resolution to TypeScript and JavaScript importers.
Useful if you want imports in Vue templates to be resolved, but don't want to use `allowJs` in your tsconfig, for example.
In other words, when `loose: true` is used, any file that gets transpiled into JavaScript will have its imports resolved by this plugin.
- `parseNative: boolean`
Enable use of the [`tsconfck.parseNative`](https://github.com/dominikg/tsconfck/blob/main/docs/api.md#parsenative) function, which delegates the loading of tsconfig files to the TypeScript compiler. You'll probably never need this, but I added it just in case.
⚠️ This option can slow down Vite's startup time by as much as
600ms, due to the size of the TypeScript compiler. Only use it when
necessary.
- `ignoreConfigErrors: boolean`
When true, parsing errors encountered while loading tsconfig files will be ignored. This is useful if you have a monorepo with multiple tsconfig files, and you don't want to see errors for the ones that aren't relevant to the current project.
- `skip: (dir: string) => boolean`
A function that determines which directories to skip when searching for tsconfig.json files. While `.git` and `node_modules` directories are always skipped, this option allows you to skip additional directories, which is useful in large monorepos to improve performance.
&nbsp;
### allowJs
If your tsconfig file has `"allowJs": true` in it, path resolution will be expanded beyond TypeScript importers. The following extensions will have their imports resolved by this plugin: `.vue`, `.svelte`, `.mdx`, `.mjs`, `.js`, `.jsx`
&nbsp;
### baseUrl
If the `baseUrl` is defined, it gets prepended to all bare imports, and its resolution will take precedence over node_modules. This is also how TypeScript does it.
Say the `baseUrl` is `../root` and you import `react`. This plugin will use `../root/react` if it exists. If not found, then `react` is resolved normally. The `baseUrl` is relative to the project root (where `tsconfig.json` lives).
&nbsp;
### include/exclude
The `include` and `exclude` tsconfig options are respected.
Internally, [globrex](https://github.com/terkelg/globrex) is used for glob matching.
&nbsp;
### Troubleshooting
The `DEBUG` environment variable can be used to figure out why this plugin isn't working as you may have expected.
```sh
DEBUG=vite-tsconfig-paths yarn vite
```
Also, check out the [Troubleshooting](https://github.com/aleclarson/vite-tsconfig-paths/wiki/Troubleshooting) wiki page for more guidance.
@@ -0,0 +1,191 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}
{{
var $rule = this
, $definition = 'definition' + $lvl
, $rDef = $rule.definition
, $closingBraces = '';
var $validate = $rDef.validate;
var $compile, $inline, $macro, $ruleValidate, $validateCode;
}}
{{? $isData && $rDef.$data }}
{{
$validateCode = 'keywordValidate' + $lvl;
var $validateSchema = $rDef.validateSchema;
}}
var {{=$definition}} = RULES.custom['{{=$keyword}}'].definition;
var {{=$validateCode}} = {{=$definition}}.validate;
{{??}}
{{
$ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
if (!$ruleValidate) return;
$schemaValue = 'validate.schema' + $schemaPath;
$validateCode = $ruleValidate.code;
$compile = $rDef.compile;
$inline = $rDef.inline;
$macro = $rDef.macro;
}}
{{?}}
{{
var $ruleErrs = $validateCode + '.errors'
, $i = 'i' + $lvl
, $ruleErr = 'ruleErr' + $lvl
, $asyncKeyword = $rDef.async;
if ($asyncKeyword && !it.async)
throw new Error('async keyword in sync schema');
}}
{{? !($inline || $macro) }}{{=$ruleErrs}} = null;{{?}}
var {{=$errs}} = errors;
var {{=$valid}};
{{## def.callRuleValidate:
{{=$validateCode}}.call(
{{? it.opts.passContext }}this{{??}}self{{?}}
{{? $compile || $rDef.schema === false }}
, {{=$data}}
{{??}}
, {{=$schemaValue}}
, {{=$data}}
, validate.schema{{=it.schemaPath}}
{{?}}
, {{# def.dataPath }}
{{# def.passParentData }}
, rootData
)
#}}
{{## def.extendErrors:_inline:
for (var {{=$i}}={{=$errs}}; {{=$i}}<errors; {{=$i}}++) {
var {{=$ruleErr}} = vErrors[{{=$i}}];
if ({{=$ruleErr}}.dataPath === undefined)
{{=$ruleErr}}.dataPath = (dataPath || '') + {{= it.errorPath }};
{{# _inline ? 'if (\{\{=$ruleErr\}\}.schemaPath === undefined) {' : '' }}
{{=$ruleErr}}.schemaPath = "{{=$errSchemaPath}}";
{{# _inline ? '}' : '' }}
{{? it.opts.verbose }}
{{=$ruleErr}}.schema = {{=$schemaValue}};
{{=$ruleErr}}.data = {{=$data}};
{{?}}
}
#}}
{{? $isData && $rDef.$data }}
{{ $closingBraces += '}'; }}
if ({{=$schemaValue}} === undefined) {
{{=$valid}} = true;
} else {
{{? $validateSchema }}
{{ $closingBraces += '}'; }}
{{=$valid}} = {{=$definition}}.validateSchema({{=$schemaValue}});
if ({{=$valid}}) {
{{?}}
{{?}}
{{? $inline }}
{{? $rDef.statements }}
{{= $ruleValidate.validate }}
{{??}}
{{=$valid}} = {{= $ruleValidate.validate }};
{{?}}
{{?? $macro }}
{{# def.setupNextLevel }}
{{
$it.schema = $ruleValidate.validate;
$it.schemaPath = '';
}}
{{# def.setCompositeRule }}
{{ var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); }}
{{# def.resetCompositeRule }}
{{= $code }}
{{??}}
{{# def.beginDefOut}}
{{# def.callRuleValidate }}
{{# def.storeDefOut:def_callRuleValidate }}
{{? $rDef.errors === false }}
{{=$valid}} = {{? $asyncKeyword }}await {{?}}{{= def_callRuleValidate }};
{{??}}
{{? $asyncKeyword }}
{{ $ruleErrs = 'customErrors' + $lvl; }}
var {{=$ruleErrs}} = null;
try {
{{=$valid}} = await {{= def_callRuleValidate }};
} catch (e) {
{{=$valid}} = false;
if (e instanceof ValidationError) {{=$ruleErrs}} = e.errors;
else throw e;
}
{{??}}
{{=$ruleErrs}} = null;
{{=$valid}} = {{= def_callRuleValidate }};
{{?}}
{{?}}
{{?}}
{{? $rDef.modifying }}
if ({{=$parentData}}) {{=$data}} = {{=$parentData}}[{{=$parentDataProperty}}];
{{?}}
{{= $closingBraces }}
{{## def.notValidationResult:
{{? $rDef.valid === undefined }}
!{{? $macro }}{{=$nextValid}}{{??}}{{=$valid}}{{?}}
{{??}}
{{= !$rDef.valid }}
{{?}}
#}}
{{? $rDef.valid }}
{{? $breakOnError }} if (true) { {{?}}
{{??}}
if ({{# def.notValidationResult }}) {
{{ $errorKeyword = $rule.keyword; }}
{{# def.beginDefOut}}
{{# def.error:'custom' }}
{{# def.storeDefOut:def_customError }}
{{? $inline }}
{{? $rDef.errors }}
{{? $rDef.errors != 'full' }}
{{# def.extendErrors:true }}
{{?}}
{{??}}
{{? $rDef.errors === false}}
{{= def_customError }}
{{??}}
if ({{=$errs}} == errors) {
{{= def_customError }}
} else {
{{# def.extendErrors:true }}
}
{{?}}
{{?}}
{{?? $macro }}
{{# def.extraError:'custom' }}
{{??}}
{{? $rDef.errors === false}}
{{= def_customError }}
{{??}}
if (Array.isArray({{=$ruleErrs}})) {
if (vErrors === null) vErrors = {{=$ruleErrs}};
else vErrors = vErrors.concat({{=$ruleErrs}});
errors = vErrors.length;
{{# def.extendErrors:false }}
} else {
{{= def_customError }}
}
{{?}}
{{?}}
} {{? $breakOnError }} else { {{?}}
{{?}}
@@ -0,0 +1,503 @@
/**
* The `dns.promises` API provides an alternative set of asynchronous DNS methods
* that return `Promise` objects rather than using callbacks. The API is accessible
* via `import { promises as dnsPromises } from 'node:dns'` or `import dnsPromises from 'node:dns/promises'`.
* @since v10.6.0
*/
declare module "dns/promises" {
import {
AnyRecord,
CaaRecord,
LookupAddress,
LookupAllOptions,
LookupOneOptions,
LookupOptions,
MxRecord,
NaptrRecord,
RecordWithTtl,
ResolveOptions,
ResolverOptions,
ResolveWithTtlOptions,
SoaRecord,
SrvRecord,
TlsaRecord,
} from "node:dns";
/**
* Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
* that are currently configured for DNS resolution. A string will include a port
* section if a custom port is used.
*
* ```js
* [
* '4.4.4.4',
* '2001:4860:4860::8888',
* '4.4.4.4:1053',
* '[2001:4860:4860::8888]:1053',
* ]
* ```
* @since v10.6.0
*/
function getServers(): string[];
/**
* Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or
* AAAA (IPv6) record. All `option` properties are optional. If `options` is an
* integer, then it must be `4` or `6` – if `options` is not provided, then IPv4
* and IPv6 addresses are both returned if found.
*
* With the `all` option set to `true`, the `Promise` is resolved with `addresses` being an array of objects with the properties `address` and `family`.
*
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code.
* Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
* the host name does not exist but also when the lookup fails in other ways
* such as no available file descriptors.
*
* [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options) does not necessarily have anything to do with the DNS
* protocol. The implementation uses an operating system facility that can
* associate names with addresses and vice versa. This implementation can have
* subtle but important consequences on the behavior of any Node.js program. Please
* take some time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) before
* using `dnsPromises.lookup()`.
*
* Example usage:
*
* ```js
* import dns from 'node:dns';
* const dnsPromises = dns.promises;
* const options = {
* family: 6,
* hints: dns.ADDRCONFIG | dns.V4MAPPED,
* };
*
* dnsPromises.lookup('example.com', options).then((result) => {
* console.log('address: %j family: IPv%s', result.address, result.family);
* // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6
* });
*
* // When options.all is true, the result will be an Array.
* options.all = true;
* dnsPromises.lookup('example.com', options).then((result) => {
* console.log('addresses: %j', result);
* // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
* });
* ```
* @since v10.6.0
*/
function lookup(hostname: string, family: number): Promise<LookupAddress>;
function lookup(hostname: string, options: LookupOneOptions): Promise<LookupAddress>;
function lookup(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
function lookup(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
function lookup(hostname: string): Promise<LookupAddress>;
/**
* Resolves the given `address` and `port` into a host name and service using
* the operating system's underlying `getnameinfo` implementation.
*
* If `address` is not a valid IP address, a `TypeError` will be thrown.
* The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown.
*
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code` is the error code.
*
* ```js
* import dnsPromises from 'node:dns';
* dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
* console.log(result.hostname, result.service);
* // Prints: localhost ssh
* });
* ```
* @since v10.6.0
*/
function lookupService(
address: string,
port: number,
): Promise<{
hostname: string;
service: string;
}>;
/**
* Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
* of the resource records. When successful, the `Promise` is resolved with an
* array of resource records. The type and structure of individual results vary
* based on `rrtype`:
*
* <omitted>
*
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code`
* is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes).
* @since v10.6.0
* @param hostname Host name to resolve.
* @param [rrtype='A'] Resource record type.
*/
function resolve(hostname: string): Promise<string[]>;
function resolve(hostname: string, rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
function resolve(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
function resolve(hostname: string, rrtype: string): Promise<
| string[]
| CaaRecord[]
| MxRecord[]
| NaptrRecord[]
| SoaRecord
| SrvRecord[]
| TlsaRecord[]
| string[][]
| AnyRecord[]
>;
/**
* Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4
* addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
* @since v10.6.0
* @param hostname Host name to resolve.
*/
function resolve4(hostname: string): Promise<string[]>;
function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
function resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
/**
* Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv6
* addresses.
* @since v10.6.0
* @param hostname Host name to resolve.
*/
function resolve6(hostname: string): Promise<string[]>;
function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
function resolve6(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
/**
* Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query).
* On success, the `Promise` is resolved with an array containing various types of
* records. Each object has a property `type` that indicates the type of the
* current record. And depending on the `type`, additional properties will be
* present on the object:
*
* <omitted>
*
* Here is an example of the result object:
*
* ```js
* [ { type: 'A', address: '127.0.0.1', ttl: 299 },
* { type: 'CNAME', value: 'example.com' },
* { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },
* { type: 'NS', value: 'ns1.example.com' },
* { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },
* { type: 'SOA',
* nsname: 'ns1.example.com',
* hostmaster: 'admin.example.com',
* serial: 156696742,
* refresh: 900,
* retry: 900,
* expire: 1800,
* minttl: 60 } ]
* ```
* @since v10.6.0
*/
function resolveAny(hostname: string): Promise<AnyRecord[]>;
/**
* Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success,
* the `Promise` is resolved with an array of objects containing available
* certification authority authorization records available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`).
* @since v15.0.0, v14.17.0
*/
function resolveCaa(hostname: string): Promise<CaaRecord[]>;
/**
* Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success,
* the `Promise` is resolved with an array of canonical name records available for
* the `hostname` (e.g. `['bar.example.com']`).
* @since v10.6.0
*/
function resolveCname(hostname: string): Promise<string[]>;
/**
* Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects
* containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`).
* @since v10.6.0
*/
function resolveMx(hostname: string): Promise<MxRecord[]>;
/**
* Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. On success, the `Promise` is resolved with an array
* of objects with the following properties:
*
* * `flags`
* * `service`
* * `regexp`
* * `replacement`
* * `order`
* * `preference`
*
* ```js
* {
* flags: 's',
* service: 'SIP+D2U',
* regexp: '',
* replacement: '_sip._udp.example.com',
* order: 30,
* preference: 100
* }
* ```
* @since v10.6.0
*/
function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
/**
* Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. On success, the `Promise` is resolved with an array of name server
* records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`).
* @since v10.6.0
*/
function resolveNs(hostname: string): Promise<string[]>;
/**
* Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. On success, the `Promise` is resolved with an array of strings
* containing the reply records.
* @since v10.6.0
*/
function resolvePtr(hostname: string): Promise<string[]>;
/**
* Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
* the `hostname`. On success, the `Promise` is resolved with an object with the
* following properties:
*
* * `nsname`
* * `hostmaster`
* * `serial`
* * `refresh`
* * `retry`
* * `expire`
* * `minttl`
*
* ```js
* {
* nsname: 'ns.example.com',
* hostmaster: 'root.example.com',
* serial: 2013101809,
* refresh: 10000,
* retry: 2400,
* expire: 604800,
* minttl: 3600
* }
* ```
* @since v10.6.0
*/
function resolveSoa(hostname: string): Promise<SoaRecord>;
/**
* Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. On success, the `Promise` is resolved with an array of objects with
* the following properties:
*
* * `priority`
* * `weight`
* * `port`
* * `name`
*
* ```js
* {
* priority: 10,
* weight: 5,
* port: 21223,
* name: 'service.example.com'
* }
* ```
* @since v10.6.0
*/
function resolveSrv(hostname: string): Promise<SrvRecord[]>;
/**
* Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
* the `hostname`. On success, the `Promise` is resolved with an array of objectsAdd commentMore actions
* with these properties:
*
* * `certUsage`
* * `selector`
* * `match`
* * `data`
*
* ```js
* {
* certUsage: 3,
* selector: 1,
* match: 1,
* data: [ArrayBuffer]
* }
* ```
* @since v22.15.0
*/
function resolveTlsa(hostname: string): Promise<TlsaRecord[]>;
/**
* Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array
* of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
* one record. Depending on the use case, these could be either joined together or
* treated separately.
* @since v10.6.0
*/
function resolveTxt(hostname: string): Promise<string[][]>;
/**
* Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
* array of host names.
*
* On error, the `Promise` is rejected with an [`Error`](https://nodejs.org/docs/latest-v20.x/api/errors.html#class-error) object, where `err.code`
* is one of the [DNS error codes](https://nodejs.org/docs/latest-v20.x/api/dns.html#error-codes).
* @since v10.6.0
*/
function reverse(ip: string): Promise<string[]>;
/**
* Get the default value for `verbatim` in {@link lookup} and [dnsPromises.lookup()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromiseslookuphostname-options).
* The value could be:
*
* * `ipv4first`: for `verbatim` defaulting to `false`.
* * `verbatim`: for `verbatim` defaulting to `true`.
* @since v20.1.0
*/
function getDefaultResultOrder(): "ipv4first" | "verbatim";
/**
* Sets the IP address and port of servers to be used when performing DNS
* resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
* addresses. If the port is the IANA default DNS port (53) it can be omitted.
*
* ```js
* dnsPromises.setServers([
* '4.4.4.4',
* '[2001:4860:4860::8888]',
* '4.4.4.4:1053',
* '[2001:4860:4860::8888]:1053',
* ]);
* ```
*
* An error will be thrown if an invalid address is provided.
*
* The `dnsPromises.setServers()` method must not be called while a DNS query is in
* progress.
*
* This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
* That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
* subsequent servers provided. Fallback DNS servers will only be used if the
* earlier ones time out or result in some other error.
* @since v10.6.0
* @param servers array of `RFC 5952` formatted addresses
*/
function setServers(servers: readonly string[]): void;
/**
* Set the default value of `order` in `dns.lookup()` and `{@link lookup}`. The value could be:
*
* * `ipv4first`: sets default `order` to `ipv4first`.
* * `ipv6first`: sets default `order` to `ipv6first`.
* * `verbatim`: sets default `order` to `verbatim`.
*
* The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
* have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
* When using [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
* from the main thread won't affect the default dns orders in workers.
* @since v16.4.0, v14.18.0
* @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
*/
function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void;
// Error codes
const NODATA: "ENODATA";
const FORMERR: "EFORMERR";
const SERVFAIL: "ESERVFAIL";
const NOTFOUND: "ENOTFOUND";
const NOTIMP: "ENOTIMP";
const REFUSED: "EREFUSED";
const BADQUERY: "EBADQUERY";
const BADNAME: "EBADNAME";
const BADFAMILY: "EBADFAMILY";
const BADRESP: "EBADRESP";
const CONNREFUSED: "ECONNREFUSED";
const TIMEOUT: "ETIMEOUT";
const EOF: "EOF";
const FILE: "EFILE";
const NOMEM: "ENOMEM";
const DESTRUCTION: "EDESTRUCTION";
const BADSTR: "EBADSTR";
const BADFLAGS: "EBADFLAGS";
const NONAME: "ENONAME";
const BADHINTS: "EBADHINTS";
const NOTINITIALIZED: "ENOTINITIALIZED";
const LOADIPHLPAPI: "ELOADIPHLPAPI";
const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS";
const CANCELLED: "ECANCELLED";
/**
* An independent resolver for DNS requests.
*
* Creating a new resolver uses the default server settings. Setting
* the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetserversservers) does not affect
* other resolvers:
*
* ```js
* import { promises } from 'node:dns';
* const resolver = new promises.Resolver();
* resolver.setServers(['4.4.4.4']);
*
* // This request will use the server at 4.4.4.4, independent of global settings.
* resolver.resolve4('example.org').then((addresses) => {
* // ...
* });
*
* // Alternatively, the same code can be written using async-await style.
* (async function() {
* const addresses = await resolver.resolve4('example.org');
* })();
* ```
*
* The following methods from the `dnsPromises` API are available:
*
* * `resolver.getServers()`
* * `resolver.resolve()`
* * `resolver.resolve4()`
* * `resolver.resolve6()`
* * `resolver.resolveAny()`
* * `resolver.resolveCaa()`
* * `resolver.resolveCname()`
* * `resolver.resolveMx()`
* * `resolver.resolveNaptr()`
* * `resolver.resolveNs()`
* * `resolver.resolvePtr()`
* * `resolver.resolveSoa()`
* * `resolver.resolveSrv()`
* * `resolver.resolveTxt()`
* * `resolver.reverse()`
* * `resolver.setServers()`
* @since v10.6.0
*/
class Resolver {
constructor(options?: ResolverOptions);
/**
* Cancel all outstanding DNS queries made by this resolver. The corresponding
* callbacks will be called with an error with code `ECANCELLED`.
* @since v8.3.0
*/
cancel(): void;
getServers: typeof getServers;
resolve: typeof resolve;
resolve4: typeof resolve4;
resolve6: typeof resolve6;
resolveAny: typeof resolveAny;
resolveCaa: typeof resolveCaa;
resolveCname: typeof resolveCname;
resolveMx: typeof resolveMx;
resolveNaptr: typeof resolveNaptr;
resolveNs: typeof resolveNs;
resolvePtr: typeof resolvePtr;
resolveSoa: typeof resolveSoa;
resolveSrv: typeof resolveSrv;
resolveTlsa: typeof resolveTlsa;
resolveTxt: typeof resolveTxt;
reverse: typeof reverse;
/**
* The resolver instance will send its requests from the specified IP address.
* This allows programs to specify outbound interfaces when used on multi-homed
* systems.
*
* If a v4 or v6 address is not specified, it is set to the default and the
* operating system will choose a local address automatically.
*
* The resolver will use the v4 local address when making requests to IPv4 DNS
* servers, and the v6 local address when making requests to IPv6 DNS servers.
* The `rrtype` of resolution requests has no impact on the local address used.
* @since v15.1.0, v14.17.0
* @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
* @param [ipv6='::0'] A string representation of an IPv6 address.
*/
setLocalAddress(ipv4?: string, ipv6?: string): void;
setServers: typeof setServers;
}
}
declare module "node:dns/promises" {
export * from "dns/promises";
}
@@ -0,0 +1,5 @@
import hash from 'object-hash'
export default function hashConfig(config) {
return hash(config, { ignoreUnknown: true })
}
@@ -0,0 +1,24 @@
# @heroui/checkbox
Checkboxes allow users to select multiple items from a list of individual items, or to mark one individual item as selected.
Please refer to the [documentation](https://heroui.com/docs/components/checkbox) for more information.
## Installation
```sh
yarn add @heroui/checkbox
# or
npm i @heroui/checkbox
```
## Contribution
Yes please! See the
[contributing guidelines](https://github.com/frontio-ai/heroui/blob/master/CONTRIBUTING.md)
for details.
## License
This project is licensed under the terms of the
[MIT license](https://github.com/frontio-ai/heroui/blob/master/LICENSE).
@@ -0,0 +1,86 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
getDefaultExtensions: true
};
exports.getDefaultExtensions = void 0;
var _commands = require("@codemirror/commands");
var _codemirrorExtensionsBasicSetup = require("@uiw/codemirror-extensions-basic-setup");
var _view = require("@codemirror/view");
var _themeOneDark = require("@codemirror/theme-one-dark");
Object.keys(_themeOneDark).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _themeOneDark[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _themeOneDark[key];
}
});
});
var _state = require("@codemirror/state");
var _light = require("./theme/light");
Object.keys(_light).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _light[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _light[key];
}
});
});
var getDefaultExtensions = exports.getDefaultExtensions = function getDefaultExtensions() {
var optios = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _optios$indentWithTab = optios.indentWithTab,
defaultIndentWithTab = _optios$indentWithTab === void 0 ? true : _optios$indentWithTab,
_optios$editable = optios.editable,
editable = _optios$editable === void 0 ? true : _optios$editable,
_optios$readOnly = optios.readOnly,
readOnly = _optios$readOnly === void 0 ? false : _optios$readOnly,
_optios$theme = optios.theme,
theme = _optios$theme === void 0 ? 'light' : _optios$theme,
_optios$placeholder = optios.placeholder,
placeholderStr = _optios$placeholder === void 0 ? '' : _optios$placeholder,
_optios$basicSetup = optios.basicSetup,
defaultBasicSetup = _optios$basicSetup === void 0 ? true : _optios$basicSetup;
var getExtensions = [];
if (defaultIndentWithTab) {
getExtensions.unshift(_view.keymap.of([_commands.indentWithTab]));
}
if (defaultBasicSetup) {
if (typeof defaultBasicSetup === 'boolean') {
getExtensions.unshift((0, _codemirrorExtensionsBasicSetup.basicSetup)());
} else {
getExtensions.unshift((0, _codemirrorExtensionsBasicSetup.basicSetup)(defaultBasicSetup));
}
}
if (placeholderStr) {
getExtensions.unshift((0, _view.placeholder)(placeholderStr));
}
switch (theme) {
case 'light':
getExtensions.push(_light.defaultLightThemeOption);
break;
case 'dark':
getExtensions.push(_themeOneDark.oneDark);
break;
case 'none':
break;
default:
getExtensions.push(theme);
break;
}
if (editable === false) {
getExtensions.push(_view.EditorView.editable.of(false));
}
if (readOnly) {
getExtensions.push(_state.EditorState.readOnly.of(true));
}
return [].concat(getExtensions);
};
@@ -0,0 +1,39 @@
// Number.isNaN as it is not supported in IE11 so conditionally using ponyfill
// Using Number.isNaN where possible as it is ~10% faster
const safeIsNaN =
Number.isNaN ||
function ponyfill(value: unknown): boolean {
return typeof value === 'number' && value !== value;
};
function isEqual(first: unknown, second: unknown): boolean {
if (first === second) {
return true;
}
// Special case for NaN (NaN !== NaN)
if (safeIsNaN(first) && safeIsNaN(second)) {
return true;
}
return false;
}
export default function areInputsEqual(
newInputs: readonly unknown[],
lastInputs: readonly unknown[],
): boolean {
// no checks needed if the inputs length has changed
if (newInputs.length !== lastInputs.length) {
return false;
}
// Using for loop for speed. It generally performs better than array.every
// https://github.com/alexreardon/memoize-one/pull/59
for (let i = 0; i < newInputs.length; i++) {
if (!isEqual(newInputs[i], lastInputs[i])) {
return false;
}
}
return true;
}
@@ -0,0 +1,52 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {useCallback, useEffect, useRef} from 'react';
interface GlobalListeners {
addGlobalListener<K extends keyof WindowEventMap>(el: Window, type: K, listener: (this: Document, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void,
addGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void,
addGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void,
removeGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void,
removeGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void,
removeAllGlobalListeners(): void
}
export function useGlobalListeners(): GlobalListeners {
let globalListeners = useRef(new Map());
let addGlobalListener = useCallback((eventTarget, type, listener, options) => {
// Make sure we remove the listener after it is called with the `once` option.
let fn = options?.once ? (...args) => {
globalListeners.current.delete(listener);
listener(...args);
} : listener;
globalListeners.current.set(listener, {type, eventTarget, fn, options});
eventTarget.addEventListener(type, fn, options);
}, []);
let removeGlobalListener = useCallback((eventTarget, type, listener, options) => {
let fn = globalListeners.current.get(listener)?.fn || listener;
eventTarget.removeEventListener(type, fn, options);
globalListeners.current.delete(listener);
}, []);
let removeAllGlobalListeners = useCallback(() => {
globalListeners.current.forEach((value, key) => {
removeGlobalListener(value.eventTarget, value.type, key, value.options);
});
}, [removeGlobalListener]);
useEffect(() => {
return removeAllGlobalListeners;
}, [removeAllGlobalListeners]);
return {addGlobalListener, removeGlobalListener, removeAllGlobalListeners};
}
@@ -0,0 +1,55 @@
"use client";
import {
ListboxSelectedIcon
} from "./chunk-65JTUBIW.mjs";
import {
useListboxItem
} from "./chunk-IXUWKP6S.mjs";
// src/listbox-item.tsx
import { useMemo } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
var ListboxItem = (props) => {
const {
Component,
rendered,
description,
isSelectable,
isSelected,
isDisabled,
selectedIcon,
startContent,
endContent,
hideSelectedIcon,
disableAnimation,
getItemProps,
getLabelProps,
getWrapperProps,
getDescriptionProps,
getSelectedIconProps
} = useListboxItem(props);
const selectedContent = useMemo(() => {
const defaultIcon = /* @__PURE__ */ jsx(ListboxSelectedIcon, { disableAnimation, isSelected });
if (typeof selectedIcon === "function") {
return selectedIcon({ icon: defaultIcon, isSelected, isDisabled });
}
if (selectedIcon)
return selectedIcon;
return defaultIcon;
}, [selectedIcon, isSelected, isDisabled, disableAnimation]);
return /* @__PURE__ */ jsxs(Component, { ...getItemProps(), children: [
startContent,
description ? /* @__PURE__ */ jsxs("div", { ...getWrapperProps(), children: [
/* @__PURE__ */ jsx("span", { ...getLabelProps(), children: rendered }),
/* @__PURE__ */ jsx("span", { ...getDescriptionProps(), children: description })
] }) : /* @__PURE__ */ jsx("span", { ...getLabelProps(), children: rendered }),
isSelectable && !hideSelectedIcon && /* @__PURE__ */ jsx("span", { ...getSelectedIconProps(), children: selectedContent }),
endContent
] });
};
ListboxItem.displayName = "HeroUI.ListboxItem";
var listbox_item_default = ListboxItem;
export {
listbox_item_default
};
@@ -0,0 +1,12 @@
import type { SchemaOptions } from '../schema/index';
import type { Ensure, Evaluate } from '../helpers/index';
import type { TProperties } from '../object/index';
import { type TMappedResult } from '../mapped/index';
import { type TRequired } from './required';
type TFromProperties<P extends TProperties> = ({
[K2 in keyof P]: TRequired<P[K2]>;
});
type TFromMappedResult<R extends TMappedResult> = (Evaluate<TFromProperties<R['properties']>>);
export type TRequiredFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>> = (Ensure<TMappedResult<P>>);
export declare function RequiredFromMappedResult<R extends TMappedResult, P extends TProperties = TFromMappedResult<R>>(R: R, options?: SchemaOptions): TMappedResult<P>;
export {};
@@ -0,0 +1,71 @@
/// <reference types="node"/>
import {
PathLike,
readFile as fsReadFile,
readFileSync as fsReadFileSync,
writeFile as fsWriteFile,
writeFileSync as fsWriteFileSync,
} from "fs";
import { Url } from "url";
export type Path = PathLike | Url;
export interface FS {
readFile: typeof fsReadFile;
readFileSync: typeof fsReadFileSync;
writeFile: typeof fsWriteFile;
writeFileSync: typeof fsWriteFileSync;
}
export type JFReadOptions =
| {
encoding?: string | null | undefined;
flag?: string | undefined;
throws?: boolean | undefined;
fs?: FS | undefined;
reviver?: ((key: any, value: any) => any) | undefined;
}
| string
| null
| undefined;
export type JFWriteOptions =
| {
encoding?: string | null | undefined;
mode?: string | number | undefined;
flag?: string | undefined;
fs?: FS | undefined;
EOL?: string | undefined;
spaces?: string | number | undefined;
replacer?: ((key: string, value: any) => any) | undefined;
}
| string
| null;
export type ReadCallback = (err: NodeJS.ErrnoException | null, data: any) => void;
export type WriteCallback = (err: NodeJS.ErrnoException | null) => void;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback}
*/
export function readFile(file: Path, options: JFReadOptions, callback: ReadCallback): void;
export function readFile(file: Path, callback: ReadCallback): void;
export function readFile(file: Path, options?: JFReadOptions): Promise<any>;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options}
*/
export function readFileSync(file: Path, options?: JFReadOptions): any;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#writefilefilename-obj-options-callback}
*/
export function writeFile(file: Path, obj: any, options: JFWriteOptions, callback: WriteCallback): void;
export function writeFile(file: Path, obj: any, callback: WriteCallback): void;
export function writeFile(file: Path, obj: any, options?: JFWriteOptions): Promise<void>;
/**
* @see {@link https://github.com/jprichardson/node-jsonfile#writefilesyncfilename-obj-options}
*/
export function writeFileSync(file: Path, obj: any, options?: JFWriteOptions): void;
@@ -0,0 +1,64 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {Dispatch, MutableRefObject, useRef, useState} from 'react';
import {useEffectEvent, useLayoutEffect} from './';
type SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;
// This hook works like `useState`, but when setting the value, you pass a generator function
// that can yield multiple values. Each yielded value updates the state and waits for the next
// layout effect, then continues the generator. This allows sequential updates to state to be
// written linearly.
export function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>] {
let [value, setValue] = useState(defaultValue);
let effect: MutableRefObject<Generator<S> | null> = useRef<Generator<S> | null>(null);
// Store the function in a ref so we can always access the current version
// which has the proper `value` in scope.
let nextRef = useEffectEvent(() => {
if (!effect.current) {
return;
}
// Run the generator to the next yield.
let newValue = effect.current.next();
// If the generator is done, reset the effect.
if (newValue.done) {
effect.current = null;
return;
}
// If the value is the same as the current value,
// then continue to the next yield. Otherwise,
// set the value in state and wait for the next layout effect.
if (value === newValue.value) {
nextRef();
} else {
setValue(newValue.value);
}
});
useLayoutEffect(() => {
// If there is an effect currently running, continue to the next yield.
if (effect.current) {
nextRef();
}
});
let queue = useEffectEvent(fn => {
effect.current = fn(value);
nextRef();
});
return [value, queue];
}
@@ -0,0 +1,228 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/use-tooltip.ts
var use_tooltip_exports = {};
__export(use_tooltip_exports, {
useTooltip: () => useTooltip
});
module.exports = __toCommonJS(use_tooltip_exports);
var import_react = require("react");
var import_tooltip = require("@react-stately/tooltip");
var import_utils = require("@react-aria/utils");
var import_tooltip2 = require("@react-aria/tooltip");
var import_overlays = require("@react-aria/overlays");
var import_system = require("@heroui/system");
var import_theme = require("@heroui/theme");
var import_shared_utils = require("@heroui/shared-utils");
var import_react_utils = require("@heroui/react-utils");
var import_react_utils2 = require("@heroui/react-utils");
var import_react2 = require("react");
var import_aria_utils = require("@heroui/aria-utils");
var import_use_safe_layout_effect = require("@heroui/use-safe-layout-effect");
function useTooltip(originalProps) {
var _a, _b;
const globalContext = (0, import_system.useProviderContext)();
const [props, variantProps] = (0, import_system.mapPropsVariants)(originalProps, import_theme.popover.variantKeys);
const {
ref,
as,
isOpen: isOpenProp,
content,
children,
defaultOpen,
onOpenChange,
isDisabled,
trigger: triggerAction,
shouldFlip = true,
containerPadding = 12,
placement: placementProp = "top",
delay = 0,
closeDelay = 500,
showArrow = false,
offset = 7,
crossOffset = 0,
isDismissable,
shouldCloseOnBlur = true,
portalContainer,
isKeyboardDismissDisabled = false,
updatePositionDeps = [],
shouldCloseOnInteractOutside,
className,
onClose,
motionProps,
classNames,
...otherProps
} = props;
const Component = as || "div";
const disableAnimation = (_b = (_a = originalProps == null ? void 0 : originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const state = (0, import_tooltip.useTooltipTriggerState)({
delay,
closeDelay,
isDisabled,
defaultOpen,
isOpen: isOpenProp,
onOpenChange: (isOpen2) => {
onOpenChange == null ? void 0 : onOpenChange(isOpen2);
if (!isOpen2) {
onClose == null ? void 0 : onClose();
}
}
});
const triggerRef = (0, import_react2.useRef)(null);
const overlayRef = (0, import_react2.useRef)(null);
const tooltipId = (0, import_react.useId)();
const isOpen = state.isOpen && !isDisabled;
(0, import_react.useImperativeHandle)(
ref,
() => (0, import_react_utils2.createDOMRef)(overlayRef)
);
const { triggerProps, tooltipProps: triggerTooltipProps } = (0, import_tooltip2.useTooltipTrigger)(
{
isDisabled,
trigger: triggerAction
},
state,
triggerRef
);
const { tooltipProps } = (0, import_tooltip2.useTooltip)(
{
isOpen,
...(0, import_utils.mergeProps)(props, triggerTooltipProps)
},
state
);
const {
overlayProps: positionProps,
placement,
updatePosition
} = (0, import_overlays.useOverlayPosition)({
isOpen,
targetRef: triggerRef,
placement: (0, import_aria_utils.toReactAriaPlacement)(placementProp),
overlayRef,
offset: showArrow ? offset + 3 : offset,
crossOffset,
shouldFlip,
containerPadding
});
(0, import_use_safe_layout_effect.useSafeLayoutEffect)(() => {
if (!updatePositionDeps.length)
return;
updatePosition();
}, updatePositionDeps);
const { overlayProps } = (0, import_overlays.useOverlay)(
{
isOpen,
onClose: state.close,
isDismissable,
shouldCloseOnBlur,
isKeyboardDismissDisabled,
shouldCloseOnInteractOutside
},
overlayRef
);
const slots = (0, import_react2.useMemo)(
() => {
var _a2, _b2, _c;
return (0, import_theme.popover)({
...variantProps,
disableAnimation,
radius: (_a2 = originalProps == null ? void 0 : originalProps.radius) != null ? _a2 : "md",
size: (_b2 = originalProps == null ? void 0 : originalProps.size) != null ? _b2 : "md",
shadow: (_c = originalProps == null ? void 0 : originalProps.shadow) != null ? _c : "sm"
});
},
[
(0, import_shared_utils.objectToDeps)(variantProps),
disableAnimation,
originalProps == null ? void 0 : originalProps.radius,
originalProps == null ? void 0 : originalProps.size,
originalProps == null ? void 0 : originalProps.shadow
]
);
const getTriggerProps = (0, import_react2.useCallback)(
(props2 = {}, _ref = null) => ({
...(0, import_utils.mergeProps)(triggerProps, props2),
ref: (0, import_react_utils.mergeRefs)(_ref, triggerRef),
"aria-describedby": isOpen ? tooltipId : void 0
}),
[triggerProps, isOpen, tooltipId, state]
);
const getTooltipProps = (0, import_react2.useCallback)(
() => ({
ref: overlayRef,
"data-slot": "base",
"data-open": (0, import_shared_utils.dataAttr)(isOpen),
"data-arrow": (0, import_shared_utils.dataAttr)(showArrow),
"data-disabled": (0, import_shared_utils.dataAttr)(isDisabled),
"data-placement": (0, import_aria_utils.getArrowPlacement)(placement || "top", placementProp),
...(0, import_utils.mergeProps)(tooltipProps, overlayProps, otherProps),
style: (0, import_utils.mergeProps)(positionProps.style, otherProps.style, props.style),
className: slots.base({ class: classNames == null ? void 0 : classNames.base }),
id: tooltipId
}),
[
slots,
isOpen,
showArrow,
isDisabled,
placement,
placementProp,
tooltipProps,
overlayProps,
otherProps,
positionProps,
props,
tooltipId
]
);
const getTooltipContentProps = (0, import_react2.useCallback)(
() => ({
"data-slot": "content",
"data-open": (0, import_shared_utils.dataAttr)(isOpen),
"data-arrow": (0, import_shared_utils.dataAttr)(showArrow),
"data-disabled": (0, import_shared_utils.dataAttr)(isDisabled),
"data-placement": (0, import_aria_utils.getArrowPlacement)(placement || "top", placementProp),
className: slots.content({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.content, className) })
}),
[slots, isOpen, showArrow, isDisabled, placement, placementProp, classNames]
);
return {
Component,
content,
children,
isOpen,
triggerRef,
showArrow,
portalContainer,
placement: placementProp,
disableAnimation,
isDisabled,
motionProps,
getTooltipContentProps,
getTriggerProps,
getTooltipProps
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useTooltip
});
@@ -0,0 +1,30 @@
# jsx-a11y/aria-proptypes
💼 This rule is enabled in the following configs: ☑️ `recommended`, 🔒 `strict`.
<!-- end auto-generated rule header -->
ARIA state and property values must be valid.
## Rule details
This rule takes no arguments.
### Succeed
```jsx
<!-- Good: the aria-hidden state is of type true/false -->
<span aria-hidden="true">foo</span>
```
### Fail
```jsx
<!-- Bad: the aria-hidden state is of type true/false -->
<span aria-hidden="yes">foo</span>
```
## Accessibility guidelines
- [WCAG 4.1.2](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)
### Resources
- [ARIA Spec, States and Properties](https://www.w3.org/TR/wai-aria/#states_and_properties)
- [Chrome Audit Rules, AX_ARIA_04](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_04)
@@ -0,0 +1,46 @@
import baseKeys from './_baseKeys.js';
import getTag from './_getTag.js';
import isArrayLike from './isArrayLike.js';
import isString from './isString.js';
import stringSize from './_stringSize.js';
/** `Object#toString` result references. */
var mapTag = '[object Map]',
setTag = '[object Set]';
/**
* Gets the size of `collection` by returning its length for array-like
* values or the number of own enumerable string keyed properties for objects.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @returns {number} Returns the collection size.
* @example
*
* _.size([1, 2, 3]);
* // => 3
*
* _.size({ 'a': 1, 'b': 2 });
* // => 2
*
* _.size('pebbles');
* // => 7
*/
function size(collection) {
if (collection == null) {
return 0;
}
if (isArrayLike(collection)) {
return isString(collection) ? stringSize(collection) : collection.length;
}
var tag = getTag(collection);
if (tag == mapTag || tag == setTag) {
return collection.size;
}
return baseKeys(collection).length;
}
export default size;
@@ -0,0 +1,743 @@
import { fileURLToPath, pathToFileURL } from 'node:url';
import vm, { isContext, runInContext } from 'node:vm';
import { dirname, basename, extname, normalize, resolve } from 'pathe';
import { l as loadEnvironment } from './init.BQhNfT0h.js';
import { distDir } from '../path.js';
import { createCustomConsole } from './console.Cf-YriPC.js';
import fs from 'node:fs';
import { createRequire, Module, isBuiltin } from 'node:module';
import { toArray, isBareImport } from '@vitest/utils/helpers';
import { findNearestPackageData } from '@vitest/utils/resolver';
import { dirname as dirname$1 } from 'node:path';
import { CSS_LANGS_RE, KNOWN_ASSET_RE } from '@vitest/utils/constants';
import { getDefaultRequestStubs } from '../module-evaluator.js';
import { s as startVitestModuleRunner, c as createNodeImportMeta, a as VITEST_VM_CONTEXT_SYMBOL } from './startModuleRunner.DLjmA_wU.js';
import { p as provideWorkerState } from './utils.DvEY5TfP.js';
function interopCommonJsModule(interopDefault, mod) {
if (isPrimitive(mod) || Array.isArray(mod) || mod instanceof Promise) return {
keys: [],
moduleExports: {},
defaultExport: mod
};
if (interopDefault !== false && "__esModule" in mod && !isPrimitive(mod.default)) {
const defaultKets = Object.keys(mod.default);
const moduleKeys = Object.keys(mod);
const allKeys = new Set([...defaultKets, ...moduleKeys]);
allKeys.delete("default");
return {
keys: Array.from(allKeys),
moduleExports: new Proxy(mod, { get(mod, prop) {
return mod[prop] ?? mod.default?.[prop];
} }),
defaultExport: mod
};
}
return {
keys: Object.keys(mod).filter((key) => key !== "default"),
moduleExports: mod,
defaultExport: mod
};
}
function isPrimitive(obj) {
return !(obj != null && (typeof obj === "object" || typeof obj === "function"));
}
const SyntheticModule = vm.SyntheticModule;
const SourceTextModule = vm.SourceTextModule;
const _require = createRequire(import.meta.url);
const requiresCache = /* @__PURE__ */ new WeakMap();
class CommonjsExecutor {
context;
requireCache = /* @__PURE__ */ new Map();
publicRequireCache = this.createProxyCache();
moduleCache = /* @__PURE__ */ new Map();
builtinCache = Object.create(null);
extensions = Object.create(null);
fs;
Module;
interopDefault;
constructor(options) {
this.context = options.context;
this.fs = options.fileMap;
this.interopDefault = options.interopDefault;
const primitives = vm.runInContext("({ Object, Array, Error })", this.context);
// eslint-disable-next-line ts/no-this-alias
const executor = this;
this.Module = class Module$1 {
exports;
isPreloading = false;
id;
filename;
loaded;
parent;
children = [];
path;
paths = [];
constructor(id = "", parent) {
this.exports = primitives.Object.create(Object.prototype);
// in our case the path should always be resolved already
this.path = dirname(id);
this.id = id;
this.filename = id;
this.loaded = false;
this.parent = parent;
}
get require() {
const require = requiresCache.get(this);
if (require) return require;
const _require = Module$1.createRequire(this.id);
requiresCache.set(this, _require);
return _require;
}
static getSourceMapsSupport = () => ({
enabled: false,
nodeModules: false,
generatedCode: false
});
static setSourceMapsSupport = () => {
// noop
};
static register = () => {
throw new Error(`[vitest] "register" is not available when running in Vitest.`);
};
static registerHooks = () => {
throw new Error(`[vitest] "registerHooks" is not available when running in Vitest.`);
};
_compile(code, filename) {
const cjsModule = Module$1.wrap(code);
const script = new vm.Script(cjsModule, {
filename,
importModuleDynamically: options.importModuleDynamically
});
// @ts-expect-error mark script with current identifier
script.identifier = filename;
const fn = script.runInContext(executor.context);
const __dirname = dirname(filename);
executor.requireCache.set(filename, this);
try {
fn(this.exports, this.require, this, filename, __dirname);
return this.exports;
} finally {
this.loaded = true;
}
}
// exposed for external use, Node.js does the opposite
static _load = (request, parent, _isMain) => {
return Module$1.createRequire(parent?.filename ?? request)(request);
};
static wrap = (script) => {
return Module$1.wrapper[0] + script + Module$1.wrapper[1];
};
static wrapper = new primitives.Array("(function (exports, require, module, __filename, __dirname) { ", "\n});");
static builtinModules = Module.builtinModules;
static findSourceMap = Module.findSourceMap;
static SourceMap = Module.SourceMap;
static syncBuiltinESMExports = Module.syncBuiltinESMExports;
static _cache = executor.publicRequireCache;
static _extensions = executor.extensions;
static createRequire = (filename) => {
return executor.createRequire(filename);
};
static runMain = () => {
throw new primitives.Error("[vitest] \"runMain\" is not implemented.");
};
// @ts-expect-error not typed
static _resolveFilename = Module._resolveFilename;
// @ts-expect-error not typed
static _findPath = Module._findPath;
// @ts-expect-error not typed
static _initPaths = Module._initPaths;
// @ts-expect-error not typed
static _preloadModules = Module._preloadModules;
// @ts-expect-error not typed
static _resolveLookupPaths = Module._resolveLookupPaths;
// @ts-expect-error not typed
static globalPaths = Module.globalPaths;
static isBuiltin = Module.isBuiltin;
static constants = Module.constants;
static enableCompileCache = Module.enableCompileCache;
static getCompileCacheDir = Module.getCompileCacheDir;
static flushCompileCache = Module.flushCompileCache;
static stripTypeScriptTypes = Module.stripTypeScriptTypes;
static findPackageJSON = Module.findPackageJSON;
static Module = Module$1;
};
this.extensions[".js"] = this.requireJs;
this.extensions[".json"] = this.requireJson;
}
requireJs = (m, filename) => {
const content = this.fs.readFile(filename);
m._compile(content, filename);
};
requireJson = (m, filename) => {
const code = this.fs.readFile(filename);
m.exports = JSON.parse(code);
};
createRequire = (filename) => {
const _require = createRequire(filename);
const require = ((id) => {
const resolved = _require.resolve(id);
if (extname(resolved) === ".node" || isBuiltin(resolved)) return this.requireCoreModule(resolved);
const module = new this.Module(resolved);
return this.loadCommonJSModule(module, resolved);
});
require.resolve = _require.resolve;
Object.defineProperty(require, "extensions", {
get: () => this.extensions,
set: () => {},
configurable: true
});
require.main = void 0;
require.cache = this.publicRequireCache;
return require;
};
createProxyCache() {
return new Proxy(Object.create(null), {
defineProperty: () => true,
deleteProperty: () => true,
set: () => true,
get: (_, key) => this.requireCache.get(key),
has: (_, key) => this.requireCache.has(key),
ownKeys: () => Array.from(this.requireCache.keys()),
getOwnPropertyDescriptor() {
return {
configurable: true,
enumerable: true
};
}
});
}
// very naive implementation for Node.js require
loadCommonJSModule(module, filename) {
const cached = this.requireCache.get(filename);
if (cached) return cached.exports;
const extension = this.findLongestRegisteredExtension(filename);
(this.extensions[extension] || this.extensions[".js"])(module, filename);
return module.exports;
}
findLongestRegisteredExtension(filename) {
const name = basename(filename);
let currentExtension;
let index;
let startIndex = 0;
// eslint-disable-next-line no-cond-assign
while ((index = name.indexOf(".", startIndex)) !== -1) {
startIndex = index + 1;
if (index === 0) continue;
currentExtension = name.slice(index);
if (this.extensions[currentExtension]) return currentExtension;
}
return ".js";
}
getCoreSyntheticModule(identifier) {
if (this.moduleCache.has(identifier)) return this.moduleCache.get(identifier);
const exports$1 = this.require(identifier);
const keys = Object.keys(exports$1);
const module = new SyntheticModule([...keys, "default"], () => {
for (const key of keys) module.setExport(key, exports$1[key]);
module.setExport("default", exports$1);
}, {
context: this.context,
identifier
});
this.moduleCache.set(identifier, module);
return module;
}
getCjsSyntheticModule(path, identifier) {
if (this.moduleCache.has(identifier)) return this.moduleCache.get(identifier);
const exports$1 = this.require(path);
// TODO: technically module should be parsed to find static exports, implement for strict mode in #2854
const { keys, moduleExports, defaultExport } = interopCommonJsModule(this.interopDefault, exports$1);
const module = new SyntheticModule([...keys, "default"], function() {
for (const key of keys) this.setExport(key, moduleExports[key]);
this.setExport("default", defaultExport);
}, {
context: this.context,
identifier
});
this.moduleCache.set(identifier, module);
return module;
}
// TODO: use this in strict mode, when available in #2854
// private _getNamedCjsExports(path: string): Set<string> {
// const cachedNamedExports = this.cjsNamedExportsMap.get(path)
// if (cachedNamedExports) {
// return cachedNamedExports
// }
// if (extname(path) === '.node') {
// const moduleExports = this.require(path)
// const namedExports = new Set(Object.keys(moduleExports))
// this.cjsNamedExportsMap.set(path, namedExports)
// return namedExports
// }
// const code = this.fs.readFile(path)
// const { exports, reexports } = parseCjs(code, path)
// const namedExports = new Set(exports)
// this.cjsNamedExportsMap.set(path, namedExports)
// for (const reexport of reexports) {
// if (isNodeBuiltin(reexport)) {
// const exports = this.require(reexport)
// if (exports !== null && typeof exports === 'object') {
// for (const e of Object.keys(exports)) {
// namedExports.add(e)
// }
// }
// }
// else {
// const require = this.createRequire(path)
// const resolved = require.resolve(reexport)
// const exports = this._getNamedCjsExports(resolved)
// for (const e of exports) {
// namedExports.add(e)
// }
// }
// }
// return namedExports
// }
require(identifier) {
if (extname(identifier) === ".node" || isBuiltin(identifier)) return this.requireCoreModule(identifier);
const module = new this.Module(identifier);
return this.loadCommonJSModule(module, identifier);
}
requireCoreModule(identifier) {
const normalized = identifier.replace(/^node:/, "");
if (this.builtinCache[normalized]) return this.builtinCache[normalized].exports;
const moduleExports = _require(identifier);
if (identifier === "node:module" || identifier === "module") {
const module = new this.Module("/module.js");
module.exports = this.Module;
this.builtinCache[normalized] = module;
return module.exports;
}
this.builtinCache[normalized] = _require.cache[normalized];
// TODO: should we wrap module to rethrow context errors?
return moduleExports;
}
}
const dataURIRegex = /^data:(?<mime>text\/javascript|application\/json|application\/wasm)(?:;(?<encoding>charset=utf-8|base64))?,(?<code>.*)$/;
class EsmExecutor {
moduleCache = /* @__PURE__ */ new Map();
esmLinkMap = /* @__PURE__ */ new WeakMap();
context;
#httpIp = IPnumber("127.0.0.0");
constructor(executor, options) {
this.executor = executor;
this.context = options.context;
}
async evaluateModule(m) {
if (m.status === "unlinked") this.esmLinkMap.set(m, m.link((identifier, referencer) => this.executor.resolveModule(identifier, referencer.identifier)));
await this.esmLinkMap.get(m);
if (m.status === "linked") await m.evaluate();
return m;
}
async createEsModule(fileURL, getCode) {
const cached = this.moduleCache.get(fileURL);
if (cached) return cached;
const promise = this.loadEsModule(fileURL, getCode);
this.moduleCache.set(fileURL, promise);
return promise;
}
async loadEsModule(fileURL, getCode) {
const code = await getCode();
// TODO: should not be allowed in strict mode, implement in #2854
if (fileURL.endsWith(".json")) {
const m = new SyntheticModule(["default"], function() {
const result = JSON.parse(code);
this.setExport("default", result);
});
this.moduleCache.set(fileURL, m);
return m;
}
const m = new SourceTextModule(code, {
identifier: fileURL,
context: this.context,
importModuleDynamically: this.executor.importModuleDynamically,
initializeImportMeta: (meta, mod) => {
meta.url = mod.identifier;
if (mod.identifier.startsWith("file:")) {
const filename = fileURLToPath(mod.identifier);
meta.filename = filename;
meta.dirname = dirname$1(filename);
}
meta.resolve = (specifier, importer) => {
return this.executor.resolve(specifier, importer != null ? importer.toString() : mod.identifier);
};
}
});
this.moduleCache.set(fileURL, m);
return m;
}
async createWebAssemblyModule(fileUrl, getCode) {
const cached = this.moduleCache.get(fileUrl);
if (cached) return cached;
const m = this.loadWebAssemblyModule(getCode(), fileUrl);
this.moduleCache.set(fileUrl, m);
return m;
}
async createNetworkModule(fileUrl) {
// https://nodejs.org/api/esm.html#https-and-http-imports
if (fileUrl.startsWith("http:")) {
const url = new URL(fileUrl);
if (url.hostname !== "localhost" && url.hostname !== "::1" && (IPnumber(url.hostname) & IPmask(8)) !== this.#httpIp) throw new Error(
// we don't know the importer, so it's undefined (the same happens in --pool=threads)
`import of '${fileUrl}' by undefined is not supported: http can only be used to load local resources (use https instead).`
);
}
return this.createEsModule(fileUrl, () => fetch(fileUrl).then((r) => r.text()));
}
async loadWebAssemblyModule(source, identifier) {
const cached = this.moduleCache.get(identifier);
if (cached) return cached;
const wasmModule = await WebAssembly.compile(source);
const exports$1 = WebAssembly.Module.exports(wasmModule);
const imports = WebAssembly.Module.imports(wasmModule);
const moduleLookup = {};
for (const { module } of imports) if (moduleLookup[module] === void 0) moduleLookup[module] = await this.executor.resolveModule(module, identifier);
const evaluateModule = (module) => this.evaluateModule(module);
return new SyntheticModule(exports$1.map(({ name }) => name), async function() {
const importsObject = {};
for (const { module, name } of imports) {
if (!importsObject[module]) importsObject[module] = {};
await evaluateModule(moduleLookup[module]);
importsObject[module][name] = moduleLookup[module].namespace[name];
}
const wasmInstance = new WebAssembly.Instance(wasmModule, importsObject);
for (const { name } of exports$1) this.setExport(name, wasmInstance.exports[name]);
}, {
context: this.context,
identifier
});
}
cacheModule(identifier, module) {
this.moduleCache.set(identifier, module);
}
resolveCachedModule(identifier) {
return this.moduleCache.get(identifier);
}
async createDataModule(identifier) {
const cached = this.moduleCache.get(identifier);
if (cached) return cached;
const match = identifier.match(dataURIRegex);
if (!match || !match.groups) throw new Error("Invalid data URI");
const mime = match.groups.mime;
const encoding = match.groups.encoding;
if (mime === "application/wasm") {
if (!encoding) throw new Error("Missing data URI encoding");
if (encoding !== "base64") throw new Error(`Invalid data URI encoding: ${encoding}`);
const module = this.loadWebAssemblyModule(Buffer.from(match.groups.code, "base64"), identifier);
this.moduleCache.set(identifier, module);
return module;
}
let code = match.groups.code;
if (!encoding || encoding === "charset=utf-8") code = decodeURIComponent(code);
else if (encoding === "base64") code = Buffer.from(code, "base64").toString();
else throw new Error(`Invalid data URI encoding: ${encoding}`);
if (mime === "application/json") {
const module = new SyntheticModule(["default"], function() {
const obj = JSON.parse(code);
this.setExport("default", obj);
}, {
context: this.context,
identifier
});
this.moduleCache.set(identifier, module);
return module;
}
return this.createEsModule(identifier, () => code);
}
}
function IPnumber(address) {
const ip = address.match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/);
if (ip) return (+ip[1] << 24) + (+ip[2] << 16) + (+ip[3] << 8) + +ip[4];
throw new Error(`Expected IP address, received ${address}`);
}
function IPmask(maskSize) {
return -1 << 32 - maskSize;
}
const CLIENT_ID = "/@vite/client";
const CLIENT_FILE = pathToFileURL(CLIENT_ID).href;
class ViteExecutor {
esm;
constructor(options) {
this.options = options;
this.esm = options.esmExecutor;
}
resolve = (identifier) => {
if (identifier === CLIENT_ID) return identifier;
};
get workerState() {
return this.options.context.__vitest_worker__;
}
async createViteModule(fileUrl) {
if (fileUrl === CLIENT_FILE || fileUrl === CLIENT_ID) return this.createViteClientModule();
const cached = this.esm.resolveCachedModule(fileUrl);
if (cached) return cached;
return this.esm.createEsModule(fileUrl, async () => {
try {
const result = await this.options.transform(fileUrl);
if (result.code) return result.code;
} catch (cause) {
// rethrow vite error if it cannot load the module because it's not resolved
if (typeof cause === "object" && cause.code === "ERR_LOAD_URL" || typeof cause?.message === "string" && cause.message.includes("Failed to load url")) {
const error = new Error(`Cannot find module '${fileUrl}'`, { cause });
error.code = "ERR_MODULE_NOT_FOUND";
throw error;
}
}
throw new Error(`[vitest] Failed to transform ${fileUrl}. Does the file exist?`);
});
}
createViteClientModule() {
const identifier = CLIENT_ID;
const cached = this.esm.resolveCachedModule(identifier);
if (cached) return cached;
const stub = this.options.viteClientModule;
const moduleKeys = Object.keys(stub);
const module = new SyntheticModule(moduleKeys, function() {
moduleKeys.forEach((key) => {
this.setExport(key, stub[key]);
});
}, {
context: this.options.context,
identifier
});
this.esm.cacheModule(identifier, module);
return module;
}
canResolve = (fileUrl) => {
if (fileUrl === CLIENT_FILE) return true;
const config = this.workerState.config.deps?.web || {};
const [modulePath] = fileUrl.split("?");
if (config.transformCss && CSS_LANGS_RE.test(modulePath)) return true;
if (config.transformAssets && KNOWN_ASSET_RE.test(modulePath)) return true;
if (toArray(config.transformGlobPattern).some((pattern) => pattern.test(modulePath))) return true;
return false;
};
}
const { existsSync } = fs;
// always defined when we use vm pool
const nativeResolve = import.meta.resolve;
// TODO: improve Node.js strict mode support in #2854
class ExternalModulesExecutor {
cjs;
esm;
vite;
context;
fs;
resolvers = [];
#networkSupported = null;
constructor(options) {
this.options = options;
this.context = options.context;
this.fs = options.fileMap;
this.esm = new EsmExecutor(this, { context: this.context });
this.cjs = new CommonjsExecutor({
context: this.context,
importModuleDynamically: this.importModuleDynamically,
fileMap: options.fileMap,
interopDefault: options.interopDefault
});
this.vite = new ViteExecutor({
esmExecutor: this.esm,
context: this.context,
transform: options.transform,
viteClientModule: options.viteClientModule
});
this.resolvers = [this.vite.resolve];
}
async import(identifier) {
const module = await this.createModule(identifier);
await this.esm.evaluateModule(module);
return module.namespace;
}
require(identifier) {
return this.cjs.require(identifier);
}
createRequire(identifier) {
return this.cjs.createRequire(identifier);
}
// dynamic import can be used in both ESM and CJS, so we have it in the executor
importModuleDynamically = async (specifier, referencer) => {
const module = await this.resolveModule(specifier, referencer.identifier);
return await this.esm.evaluateModule(module);
};
resolveModule = async (specifier, referencer) => {
let identifier = this.resolve(specifier, referencer);
if (identifier instanceof Promise) identifier = await identifier;
return await this.createModule(identifier);
};
resolve(specifier, parent) {
for (const resolver of this.resolvers) {
const id = resolver(specifier, parent);
if (id) return id;
}
// import.meta.resolve can be asynchronous in older +18 Node versions
return nativeResolve(specifier, parent);
}
getModuleInformation(identifier) {
if (identifier.startsWith("data:")) return {
type: "data",
url: identifier,
path: identifier
};
const extension = extname(identifier);
if (extension === ".node" || isBuiltin(identifier)) return {
type: "builtin",
url: identifier,
path: identifier
};
if (this.isNetworkSupported && (identifier.startsWith("http:") || identifier.startsWith("https:"))) return {
type: "network",
url: identifier,
path: identifier
};
const isFileUrl = identifier.startsWith("file://");
const pathUrl = isFileUrl ? fileURLToPath(identifier.split("?")[0]) : identifier;
const fileUrl = isFileUrl ? identifier : pathToFileURL(pathUrl).toString();
let type;
if (this.vite.canResolve(fileUrl)) type = "vite";
else if (extension === ".mjs") type = "module";
else if (extension === ".cjs") type = "commonjs";
else if (extension === ".wasm")
// still experimental on NodeJS --experimental-wasm-modules
// cf. ESM_FILE_FORMAT(url) in https://nodejs.org/docs/latest-v20.x/api/esm.html#resolution-algorithm
type = "wasm";
else type = findNearestPackageData(normalize(pathUrl)).type === "module" ? "module" : "commonjs";
return {
type,
path: pathUrl,
url: fileUrl
};
}
createModule(identifier) {
const { type, url, path } = this.getModuleInformation(identifier);
// create ERR_MODULE_NOT_FOUND on our own since latest NodeJS's import.meta.resolve doesn't throw on non-existing namespace or path
// https://github.com/nodejs/node/pull/49038
if ((type === "module" || type === "commonjs" || type === "wasm") && !existsSync(path)) {
const error = /* @__PURE__ */ new Error(`Cannot find ${isBareImport(path) ? "package" : "module"} '${path}'`);
error.code = "ERR_MODULE_NOT_FOUND";
throw error;
}
switch (type) {
case "data": return this.esm.createDataModule(identifier);
case "builtin": return this.cjs.getCoreSyntheticModule(identifier);
case "vite": return this.vite.createViteModule(url);
case "wasm": return this.esm.createWebAssemblyModule(url, () => this.fs.readBuffer(path));
case "module": return this.esm.createEsModule(url, () => this.fs.readFileAsync(path));
case "commonjs": return this.cjs.getCjsSyntheticModule(path, identifier);
case "network": return this.esm.createNetworkModule(url);
default: return type;
}
}
get isNetworkSupported() {
if (this.#networkSupported == null) if (process.execArgv.includes("--experimental-network-imports")) this.#networkSupported = true;
else if (process.env.NODE_OPTIONS?.includes("--experimental-network-imports")) this.#networkSupported = true;
else this.#networkSupported = false;
return this.#networkSupported;
}
}
const { promises, readFileSync } = fs;
class FileMap {
fsCache = /* @__PURE__ */ new Map();
fsBufferCache = /* @__PURE__ */ new Map();
async readFileAsync(path) {
const cached = this.fsCache.get(path);
if (cached != null) return cached;
const source = await promises.readFile(path, "utf-8");
this.fsCache.set(path, source);
return source;
}
readFile(path) {
const cached = this.fsCache.get(path);
if (cached != null) return cached;
const source = readFileSync(path, "utf-8");
this.fsCache.set(path, source);
return source;
}
readBuffer(path) {
const cached = this.fsBufferCache.get(path);
if (cached != null) return cached;
const buffer = readFileSync(path);
this.fsBufferCache.set(path, buffer);
return buffer;
}
}
const entryFile = pathToFileURL(resolve(distDir, "workers/runVmTests.js")).href;
const fileMap = new FileMap();
const packageCache = /* @__PURE__ */ new Map();
async function runVmTests(method, state) {
const { ctx, rpc } = state;
const beforeEnvironmentTime = performance.now();
const { environment } = await loadEnvironment(ctx.environment.name, ctx.config.root, rpc);
state.environment = environment;
if (!environment.setupVM) {
const envName = ctx.environment.name;
const packageId = envName[0] === "." ? envName : `vitest-environment-${envName}`;
throw new TypeError(`Environment "${ctx.environment.name}" is not a valid environment. Path "${packageId}" doesn't support vm environment because it doesn't provide "setupVM" method.`);
}
const vm = await environment.setupVM(ctx.environment.options || ctx.config.environmentOptions || {});
state.durations.environment = performance.now() - beforeEnvironmentTime;
process.env.VITEST_VM_POOL = "1";
if (!vm.getVmContext) throw new TypeError(`Environment ${environment.name} doesn't provide "getVmContext" method. It should return a context created by "vm.createContext" method.`);
const context = vm.getVmContext();
if (!isContext(context)) throw new TypeError(`Environment ${environment.name} doesn't provide a valid context. It should be created by "vm.createContext" method.`);
provideWorkerState(context, state);
// this is unfortunately needed for our own dependencies
// we need to find a way to not rely on this by default
// because browser doesn't provide these globals
context.process = process;
context.global = context;
context.console = state.config.disableConsoleIntercept ? console : createCustomConsole(state);
// TODO: don't hardcode setImmediate in fake timers defaults
context.setImmediate = setImmediate;
context.clearImmediate = clearImmediate;
const stubs = getDefaultRequestStubs(context);
const externalModulesExecutor = new ExternalModulesExecutor({
context,
fileMap,
packageCache,
transform: rpc.transform,
viteClientModule: stubs["/@vite/client"]
});
const moduleRunner = startVitestModuleRunner({
context,
evaluatedModules: state.evaluatedModules,
state,
externalModulesExecutor,
createImportMeta: createNodeImportMeta
});
Object.defineProperty(context, VITEST_VM_CONTEXT_SYMBOL, {
value: {
context,
externalModulesExecutor
},
configurable: true,
enumerable: false,
writable: false
});
context.__vitest_mocker__ = moduleRunner.mocker;
if (ctx.config.serializedDefines) try {
runInContext(ctx.config.serializedDefines, context, { filename: "virtual:load-defines.js" });
} catch (error) {
throw new Error(`Failed to load custom "defines": ${error.message}`);
}
await moduleRunner.mocker.initializeSpyModule();
const { run } = await moduleRunner.import(entryFile);
const fileSpecs = ctx.files.map((f) => typeof f === "string" ? {
filepath: f,
testLocations: void 0
} : f);
try {
await run(method, fileSpecs, ctx.config, moduleRunner);
} finally {
await vm.teardown?.();
}
}
export { runVmTests as r };
@@ -0,0 +1,33 @@
'use strict';
//all requires must be explicit because browserify won't work with dynamic requires
module.exports = {
'$ref': require('./ref'),
allOf: require('./allOf'),
anyOf: require('./anyOf'),
'$comment': require('./comment'),
const: require('./const'),
contains: require('./contains'),
dependencies: require('./dependencies'),
'enum': require('./enum'),
format: require('./format'),
'if': require('./if'),
items: require('./items'),
maximum: require('./_limit'),
minimum: require('./_limit'),
maxItems: require('./_limitItems'),
minItems: require('./_limitItems'),
maxLength: require('./_limitLength'),
minLength: require('./_limitLength'),
maxProperties: require('./_limitProperties'),
minProperties: require('./_limitProperties'),
multipleOf: require('./multipleOf'),
not: require('./not'),
oneOf: require('./oneOf'),
pattern: require('./pattern'),
properties: require('./properties'),
propertyNames: require('./propertyNames'),
required: require('./required'),
uniqueItems: require('./uniqueItems'),
validate: require('./validate')
};
@@ -0,0 +1,17 @@
"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 __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./createProjectService"), exports);
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more