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,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/is-date-object
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,30 @@
import isPrototype from './_isPrototype.js';
import nativeKeys from './_nativeKeys.js';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
export default baseKeys;
@@ -0,0 +1,146 @@
/**
* @import {ConstructName, Unsafe} from 'mdast-util-to-markdown'
*/
/**
* List of constructs that occur in phrasing (paragraphs, headings), but cannot
* contain things like attention (emphasis, strong), images, or links.
* So they sort of cancel each other out.
* Note: could use a better name.
*
* @type {Array<ConstructName>}
*/
const fullPhrasingSpans = [
'autolink',
'destinationLiteral',
'destinationRaw',
'reference',
'titleQuote',
'titleApostrophe'
]
/** @type {Array<Unsafe>} */
export const unsafe = [
{character: '\t', after: '[\\r\\n]', inConstruct: 'phrasing'},
{character: '\t', before: '[\\r\\n]', inConstruct: 'phrasing'},
{
character: '\t',
inConstruct: ['codeFencedLangGraveAccent', 'codeFencedLangTilde']
},
{
character: '\r',
inConstruct: [
'codeFencedLangGraveAccent',
'codeFencedLangTilde',
'codeFencedMetaGraveAccent',
'codeFencedMetaTilde',
'destinationLiteral',
'headingAtx'
]
},
{
character: '\n',
inConstruct: [
'codeFencedLangGraveAccent',
'codeFencedLangTilde',
'codeFencedMetaGraveAccent',
'codeFencedMetaTilde',
'destinationLiteral',
'headingAtx'
]
},
{character: ' ', after: '[\\r\\n]', inConstruct: 'phrasing'},
{character: ' ', before: '[\\r\\n]', inConstruct: 'phrasing'},
{
character: ' ',
inConstruct: ['codeFencedLangGraveAccent', 'codeFencedLangTilde']
},
// An exclamation mark can start an image, if it is followed by a link or
// a link reference.
{
character: '!',
after: '\\[',
inConstruct: 'phrasing',
notInConstruct: fullPhrasingSpans
},
// A quote can break out of a title.
{character: '"', inConstruct: 'titleQuote'},
// A number sign could start an ATX heading if it starts a line.
{atBreak: true, character: '#'},
{character: '#', inConstruct: 'headingAtx', after: '(?:[\r\n]|$)'},
// Dollar sign and percentage are not used in markdown.
// An ampersand could start a character reference.
{character: '&', after: '[#A-Za-z]', inConstruct: 'phrasing'},
// An apostrophe can break out of a title.
{character: "'", inConstruct: 'titleApostrophe'},
// A left paren could break out of a destination raw.
{character: '(', inConstruct: 'destinationRaw'},
// A left paren followed by `]` could make something into a link or image.
{
before: '\\]',
character: '(',
inConstruct: 'phrasing',
notInConstruct: fullPhrasingSpans
},
// A right paren could start a list item or break out of a destination
// raw.
{atBreak: true, before: '\\d+', character: ')'},
{character: ')', inConstruct: 'destinationRaw'},
// An asterisk can start thematic breaks, list items, emphasis, strong.
{atBreak: true, character: '*', after: '(?:[ \t\r\n*])'},
{character: '*', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans},
// A plus sign could start a list item.
{atBreak: true, character: '+', after: '(?:[ \t\r\n])'},
// A dash can start thematic breaks, list items, and setext heading
// underlines.
{atBreak: true, character: '-', after: '(?:[ \t\r\n-])'},
// A dot could start a list item.
{atBreak: true, before: '\\d+', character: '.', after: '(?:[ \t\r\n]|$)'},
// Slash, colon, and semicolon are not used in markdown for constructs.
// A less than can start html (flow or text) or an autolink.
// HTML could start with an exclamation mark (declaration, cdata, comment),
// slash (closing tag), question mark (instruction), or a letter (tag).
// An autolink also starts with a letter.
// Finally, it could break out of a destination literal.
{atBreak: true, character: '<', after: '[!/?A-Za-z]'},
{
character: '<',
after: '[!/?A-Za-z]',
inConstruct: 'phrasing',
notInConstruct: fullPhrasingSpans
},
{character: '<', inConstruct: 'destinationLiteral'},
// An equals to can start setext heading underlines.
{atBreak: true, character: '='},
// A greater than can start block quotes and it can break out of a
// destination literal.
{atBreak: true, character: '>'},
{character: '>', inConstruct: 'destinationLiteral'},
// Question mark and at sign are not used in markdown for constructs.
// A left bracket can start definitions, references, labels,
{atBreak: true, character: '['},
{character: '[', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans},
{character: '[', inConstruct: ['label', 'reference']},
// A backslash can start an escape (when followed by punctuation) or a
// hard break (when followed by an eol).
// Note: typical escapes are handled in `safe`!
{character: '\\', after: '[\\r\\n]', inConstruct: 'phrasing'},
// A right bracket can exit labels.
{character: ']', inConstruct: ['label', 'reference']},
// Caret is not used in markdown for constructs.
// An underscore can start emphasis, strong, or a thematic break.
{atBreak: true, character: '_'},
{character: '_', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans},
// A grave accent can start code (fenced or text), or it can break out of
// a grave accent code fence.
{atBreak: true, character: '`'},
{
character: '`',
inConstruct: ['codeFencedLangGraveAccent', 'codeFencedMetaGraveAccent']
},
{character: '`', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans},
// Left brace, vertical bar, right brace are not used in markdown for
// constructs.
// A tilde can start code (fenced).
{atBreak: true, character: '~'}
]
@@ -0,0 +1,523 @@
flf2a$ 5 4 8 -1 12
"infopowr.flf"
Based on a 12 letter font From: "Answers to Frequently Asked Questions
About Today's Cryptography," v2.0 draft 2f, 9/20/93, by Paul Fahn,
copyright 1993, RSA Laboratories
Specifically, the ASCII lettering from the "DISTRIBUTION:" section:
"_ _, _ ___ _, __, _, _ _, ___ _ _, _, _ _ _, __, _, _ _ ___ __, "
| |\ | |_ / \ |_) |\/| / \ | | / \ |\ | | (_ |_) / \ | | |_ | )
| | \| | \ / | \ | | |~| | | \ / | \| | , ) | \ / |/\| | |~\
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~~~ ~ ~
Additional characters & figlet conversion by:
Kent Nassen, kentn@cyberspace.org, 8/16/94
$$@
$$@
$$@
$$@
$$@@
,@
|@
|@
.@
$@@
,,@
''@
$@
$@
$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
,@
'@
$@
$@
$@@
/@
|@
|@
\@
$@@
\@
|@
|@
/@
$@@
@
@
@
@
@@
@
@
@
@
@@
$@
$@
,@
'@
$@@
$@
$@
~~@
$@
$@@
$@
$@
,@
~@
$@@
$@
/@
/ @
$@
$@@
_$@
/ \@
\ /@
~ @
$@@
,@
|@
|@
~@
$@@
_,@
~ )@
/ @
~~~@
$@@
_,@
~_)@
)@
~~ @
$@@
,@
/ |@
~~|@
~@
$@@
_,@
|_ @
)@
~~ @
$@@
_,@
/_ @
\ )@
~ @
$@@
__,@
_/ @
/~ @
@
$@@
_,@
(_)@
( )@
~ @
$@@
_,@
(_/@
/ @
' @
$@@
$@
.@
.@
$@
$@@
$@
.@
,@
'@
$@@
/@
/ @
\ @
\@
$@@
$@
~~@
~~@
$@
$@@
\ @
\@
/@
/ @
$@@
_$@
( )@
/ @
.$@
$@@
$ _,@
$/,)@
$\`'@
$ ~~@
$ $@@
_,@
/ \@
|~|@
~ ~@
$@@
__,@
|_)@
|_)@
~ @
$@@
_,@
/ `@
\ ,@
~ @
$@@
__,@
| \@
|_/@
~ @
$@@
__,@
|_ @
| @
~~~@
$@@
__,@
|_ @
| @
~ @
$@@
_,@
/ _@
\ /@
~ @
$@@
_,_@
|_|@
| |@
~ ~@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\/ @
/\ @
~ ~@
$@@
, _@
\ |@
\|@
)@
~'@@
___,@
` / @
/ @
~~~ @
$@@
@
@
@
@
@@
.@
|@
|@
|@
$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('conformsTo', require('../conformsTo'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,825 @@
export default `flf2a$ 8 7 20 -1 7
PEAKS by Ron Fritz 8/94
Figlet Release 2.0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
/^^@
/^^@
/^^@
/^ @
/^ @
@
/^^@
@@
/^ /^@
/^ /^@
@
@
@
@
@
@@
@
/^^ /^^ @
/^^^^^^ /^^^^@
/^^ /^^ @
/^^ /^^ @
/^^^^^^ /^^^^@
/^^ /^^ @
@@
/^^ @
/^ /^^ @
/^^ @
/^^ @
/^^@
/^^ /^^ @
/^^ @
@@
@
/^^ /^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^ /^^ @
@@
/^ @
/^^ /^^@
/^^ @
/^^^ @
/^^ @
/^^ /^^@
/^ @
@@
/^^@
/^@
@
@
@
@
@
@@
/^^@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^@
@@
/^^ @
/^^ @
/^^@
/^^@
/^^@
/^^ @
/^^ @
@@
/^^ @
/^^ /^^ /^^@
/^ /^ /^^ @
/^^^^ /^^^^^^^@
/^ /^ /^^ @
/^^ /^^ /^^@
/^^ @
@@
@
/^^ @
/^^ @
/^^^ /^^^^^@
/^^ @
/^^ @
@
@@
@
@
@
@
@
@
/^^@
/^@@
@
@
@
/^^^^^@
@
@
@
@@
@
@
@
@
@
@
/^^@
@@
/^^@
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @
/^^ @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@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1 @@
{"name":"trim-newlines","version":"4.1.1","requiresBuild":false,"files":{"license":{"checkedAt":1794532120217,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1794532120217,"integrity":"sha512-pyZ+8Vc61kBb06eP2huKl+wW9MrpBzQor2dhj6HeZAK/vTaujVwOSNJYm4ib4Y3sW3e1JRAilyJcBAnKcb3gQA==","mode":420,"size":800},"package.json":{"checkedAt":1794532120217,"integrity":"sha512-OwTgpiXCX9nyt4X277kRi4AnffFAvkvUkRov9g3aEi0jJpMybnm0oIsC8aId0lOuzxsIYIa/B9geECYCdR5DlQ==","mode":420,"size":790},"readme.md":{"checkedAt":1794532120217,"integrity":"sha512-MGZTRz+IndubF9MdlZ4uQcaXl9LxaoIzVgEm2voZhfHPHEa/wG4kRGmYw+gsUuXvvE3Iecc4sHb9kGMo1LceRA==","mode":420,"size":1280},"index.d.ts":{"checkedAt":1794532120217,"integrity":"sha512-wioat8jWPpUcIdvR6n7Ir3dCFiJkiN39zACCiOpMYqjiyK2j8EksyTpb3ygqDE01YaHmn4a7gLo2rlfeLLwksg==","mode":420,"size":632}}}
@@ -0,0 +1,11 @@
#!/usr/bin/env node
import { UserError, cli, help } from './dist/cli.mjs'
cli(process.stdin, error => {
if (error instanceof UserError) {
if (error.code === UserError.ARGS) console.error(`${help}\n`)
console.error(error.message)
process.exitCode = error.code
} else if (error) throw error
})
@@ -0,0 +1,116 @@
import * as util from "../core/util.js";
export const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "nombro";
}
case "object": {
if (Array.isArray(data)) {
return "tabelo";
}
if (data === null) {
return "senvalora";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const error = () => {
const Sizable = {
string: { unit: "karaktrojn", verb: "havi" },
file: { unit: "bajtojn", verb: "havi" },
array: { unit: "elementojn", verb: "havi" },
set: { unit: "elementojn", verb: "havi" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const Nouns = {
regex: "enigo",
email: "retadreso",
url: "URL",
emoji: "emoĝio",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO-datotempo",
date: "ISO-dato",
time: "ISO-tempo",
duration: "ISO-daŭro",
ipv4: "IPv4-adreso",
ipv6: "IPv6-adreso",
cidrv4: "IPv4-rango",
cidrv6: "IPv6-rango",
base64: "64-ume kodita karaktraro",
base64url: "URL-64-ume kodita karaktraro",
json_string: "JSON-karaktraro",
e164: "E.164-nombro",
jwt: "JWT",
template_literal: "enigo",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Nevalida enigo: atendiĝis ${issue.expected}, riceviĝis ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Nevalida enigo: atendiĝis ${util.stringifyPrimitive(issue.values[0])}`;
return `Nevalida opcio: atendiĝis unu el ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Tro granda: atendiĝis ke ${issue.origin ?? "valoro"} havu ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementojn"}`;
return `Tro granda: atendiĝis ke ${issue.origin ?? "valoro"} havu ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Tro malgranda: atendiĝis ke ${issue.origin} havu ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Tro malgranda: atendiĝis ke ${issue.origin} estu ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Nevalida karaktraro: devas komenciĝi per "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Nevalida karaktraro: devas finiĝi per "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`;
if (_issue.format === "regex")
return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`;
return `Nevalida ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Nevalida nombro: devas esti oblo de ${issue.divisor}`;
case "unrecognized_keys":
return `Nekonata${issue.keys.length > 1 ? "j" : ""} ŝlosilo${issue.keys.length > 1 ? "j" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Nevalida ŝlosilo en ${issue.origin}`;
case "invalid_union":
return "Nevalida enigo";
case "invalid_element":
return `Nevalida valoro en ${issue.origin}`;
default:
return `Nevalida enigo`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,20 @@
/*! https://mths.be/repeat v1.0.0 by @mathias */
'use strict';
var callBind = require('es-abstract/helpers/callBind');
var define = require('define-properties');
var implementation = require('./implementation');
var getPolyfill = require('./polyfill');
var shim = require('./shim');
var boundRepeat = callBind(getPolyfill());
define(boundRepeat, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
module.exports = boundRepeat;
@@ -0,0 +1,560 @@
"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/common/index.ts
var common_exports = {};
__export(common_exports, {
__DEV__: () => __DEV__,
__TEST__: () => __TEST__,
arrayToObject: () => arrayToObject,
callAll: () => callAll,
callAllHandlers: () => callAllHandlers,
capitalize: () => capitalize,
chain: () => chain,
clamp: () => clamp,
clampPercentage: () => clampPercentage,
cleanObject: () => cleanObject,
cleanObjectKeys: () => cleanObjectKeys,
clsx: () => clsx,
compact: () => compact,
copyObject: () => copyObject,
dataAttr: () => dataAttr,
debounce: () => debounce,
extractProperty: () => extractProperty,
get: () => get,
getGregorianYearOffset: () => getGregorianYearOffset,
getKeyValue: () => getKeyValue,
getMargin: () => getMargin,
getProp: () => getProp,
getUniqueID: () => getUniqueID,
idsUpdaterMap: () => idsUpdaterMap,
intersectionBy: () => intersectionBy,
isArray: () => isArray,
isEmpty: () => isEmpty,
isEmptyArray: () => isEmptyArray,
isEmptyObject: () => isEmptyObject,
isFunction: () => isFunction,
isNumeric: () => isNumeric,
isObject: () => isObject,
isPatternNumeric: () => isPatternNumeric,
kebabCase: () => kebabCase,
mapKeys: () => mapKeys,
mergeIds: () => mergeIds,
mergeProps: () => mergeProps,
mergeRefs: () => mergeRefs,
objectToDeps: () => objectToDeps,
omit: () => omit,
omitObject: () => omitObject,
range: () => range,
removeEvents: () => removeEvents,
renameProp: () => renameProp,
safeAriaLabel: () => safeAriaLabel,
safeInitials: () => safeInitials,
safeText: () => safeText,
uniqBy: () => uniqBy,
warn: () => warn
});
module.exports = __toCommonJS(common_exports);
// src/common/assertion.ts
var __DEV__ = process.env.NODE_ENV !== "production";
var __TEST__ = process.env.NODE_ENV === "test";
function isArray(value) {
return Array.isArray(value);
}
function isEmptyArray(value) {
return isArray(value) && value.length === 0;
}
function isObject(value) {
const type = typeof value;
return value != null && (type === "object" || type === "function") && !isArray(value);
}
function isEmptyObject(value) {
return isObject(value) && Object.keys(value).length === 0;
}
function isEmpty(value) {
if (isArray(value)) return isEmptyArray(value);
if (isObject(value)) return isEmptyObject(value);
if (value == null || value === "") return true;
return false;
}
function isFunction(value) {
return typeof value === "function";
}
var dataAttr = (condition) => condition ? "true" : void 0;
var isNumeric = (value) => value != null && parseInt(value.toString(), 10) > 0;
// src/common/clsx.ts
function toVal(mix) {
var k, y, str = "";
if (typeof mix === "string" || typeof mix === "number") {
str += mix;
} else if (typeof mix === "object") {
if (Array.isArray(mix)) {
for (k = 0; k < mix.length; k++) {
if (mix[k]) {
if (y = toVal(mix[k])) {
str && (str += " ");
str += y;
}
}
}
} else {
for (k in mix) {
if (mix[k]) {
str && (str += " ");
str += k;
}
}
}
}
return str;
}
function clsx(...args) {
var i = 0, tmp, x, str = "";
while (i < args.length) {
if (tmp = args[i++]) {
if (x = toVal(tmp)) {
str && (str += " ");
str += x;
}
}
}
return str;
}
// src/common/object.ts
var renameProp = (oldProp, newProp, { [oldProp]: old, ...others }) => ({
[newProp]: old,
...others
});
var copyObject = (obj) => {
if (!isObject(obj)) return obj;
if (obj instanceof Array) return [...obj];
return { ...obj };
};
var omitObject = (obj, omitKeys) => {
if (!isObject(obj)) return obj;
if (obj instanceof Array) return [...obj];
const newObj = { ...obj };
omitKeys.forEach((key) => newObj[key] && delete newObj[key]);
return newObj;
};
var cleanObject = (obj) => {
if (!isObject(obj)) return obj;
if (obj instanceof Array) return [...obj];
const newObj = { ...obj };
Object.keys(newObj).forEach((key) => {
if (newObj[key] === void 0 || newObj[key] === null) {
delete newObj[key];
}
});
return newObj;
};
var cleanObjectKeys = (obj, keys = []) => {
if (!isObject(obj)) return obj;
if (obj instanceof Array) return [...obj];
const newObj = { ...obj };
keys.forEach((key) => {
if (newObj[key]) {
delete newObj[key];
}
});
return newObj;
};
var getKeyValue = (obj, key) => {
if (!isObject(obj)) return obj;
if (obj instanceof Array) return [...obj];
return obj[key];
};
var getProp = (obj, path, fallback, index) => {
const key = typeof path === "string" ? path.split(".") : [path];
for (index = 0; index < key.length; index += 1) {
if (!obj) break;
obj = obj[key[index]];
}
return obj === void 0 ? fallback : obj;
};
var arrayToObject = (arr) => {
if (!arr.length || !Array.isArray(arr)) return {};
return arr.reduce((acc, item) => {
return { ...acc, ...item };
}, {});
};
function compact(object) {
const clone = Object.assign({}, object);
for (let key in clone) {
if (clone[key] === void 0) delete clone[key];
}
return clone;
}
// src/common/text.ts
var safeText = (text) => {
if ((text == null ? void 0 : text.length) <= 4) return text;
return text == null ? void 0 : text.slice(0, 3);
};
var safeInitials = (text) => {
const initials = (text == null ? void 0 : text.trim().split(/[\s\-_.]+/).filter(Boolean).map((word) => word.charAt(0).toUpperCase()).join("")) || "";
return safeText(initials);
};
var safeAriaLabel = (...texts) => {
let ariaLabel = " ";
for (const text of texts) {
if (typeof text === "string" && text.length > 0) {
ariaLabel = text;
break;
}
}
return ariaLabel;
};
// src/common/dimensions.ts
var getMargin = (num) => {
return `calc(${num * 15.25}pt + 1px * ${num - 1})`;
};
// src/common/functions.ts
var capitalize = (s) => {
return s ? s.charAt(0).toUpperCase() + s.slice(1).toLowerCase() : "";
};
function callAllHandlers(...fns) {
return function func(event) {
fns.some((fn) => {
fn == null ? void 0 : fn(event);
return event == null ? void 0 : event.defaultPrevented;
});
};
}
function callAll(...fns) {
return function mergedFn(arg) {
fns.forEach((fn) => {
fn == null ? void 0 : fn(arg);
});
};
}
function extractProperty(key, defaultValue, ...objs) {
let result = defaultValue;
for (const obj of objs) {
if (obj && key in obj && !!obj[key]) {
result = obj[key];
}
}
return result;
}
function getUniqueID(prefix) {
return `${prefix}-${Math.floor(Math.random() * 1e6)}`;
}
function removeEvents(input) {
for (const key in input) {
if (key.startsWith("on")) {
delete input[key];
}
}
return input;
}
function objectToDeps(obj) {
if (!obj || typeof obj !== "object") {
return "";
}
try {
return JSON.stringify(obj);
} catch {
return "";
}
}
function debounce(func, waitMilliseconds = 0) {
let timeout;
return function(...args) {
const later = () => {
timeout = void 0;
func.apply(this, args);
};
if (timeout !== void 0) {
clearTimeout(timeout);
}
timeout = setTimeout(later, waitMilliseconds);
};
}
function uniqBy(arr, iteratee) {
if (typeof iteratee === "string") {
iteratee = (item) => item[iteratee];
}
return arr.filter((x, i, self) => i === self.findIndex((y) => iteratee(x) === iteratee(y)));
}
var omit = (obj, keys) => {
const res = Object.assign({}, obj);
keys.forEach((key) => {
delete res[key];
});
return res;
};
var kebabCase = (s) => {
return s.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
};
var mapKeys = (obj, iteratee) => {
return Object.fromEntries(
Object.entries(obj).map(([key, value]) => [iteratee(value, key), value])
);
};
var get = (object, path, defaultValue) => {
const keys = Array.isArray(path) ? path : path.replace(/\[(\d+)\]/g, ".$1").split(".");
let res = object;
for (const key of keys) {
res = res == null ? void 0 : res[key];
if (res === void 0) {
return defaultValue;
}
}
return res;
};
var intersectionBy = (...args) => {
if (args.length < 2) {
throw new Error("intersectionBy requires at least two arrays and an iteratee");
}
const iteratee = args[args.length - 1];
const arrays = args.slice(0, -1);
if (arrays.length === 0) {
return [];
}
const getIterateeValue = (item) => {
if (typeof iteratee === "function") {
return iteratee(item);
} else if (typeof iteratee === "string") {
return item[iteratee];
} else {
throw new Error("Iteratee must be a function or a string key of the array elements");
}
};
const [first, ...rest] = arrays;
const transformedFirst = first.map((item) => getIterateeValue(item));
const transformedSets = rest.map(
(array) => new Set(array.map((item) => getIterateeValue(item)))
);
const res = [];
const seen = /* @__PURE__ */ new Set();
for (let i = 0; i < first.length; i++) {
const item = first[i];
const transformed = transformedFirst[i];
if (seen.has(transformed)) {
continue;
}
const existsInAll = transformedSets.every((set) => set.has(transformed));
if (existsInAll) {
res.push(item);
seen.add(transformed);
}
}
return res;
};
// src/common/numbers.ts
function range(start, end) {
const length = end - start + 1;
return Array.from({ length }, (_, index) => index + start);
}
function clamp(value, min, max) {
return Math.min(Math.max(value, min), max);
}
function clampPercentage(value, max = 100) {
return Math.min(Math.max(value, 0), max);
}
// src/common/console.ts
var warningStack = {};
function warn(message, component, ...args) {
const tag = component ? ` [${component}]` : " ";
const log = `[Hero UI]${tag}: ${message}`;
if (typeof console === "undefined") return;
if (warningStack[log]) return;
warningStack[log] = true;
if (process.env.NODE_ENV !== "production") {
return console.warn(log, args);
}
}
// src/common/dates.ts
function getGregorianYearOffset(identifier) {
switch (identifier) {
case "buddhist":
return 543;
case "ethiopic":
case "ethioaa":
return -8;
case "coptic":
return -284;
case "hebrew":
return 3760;
case "indian":
return -78;
case "islamic-civil":
case "islamic-tbla":
case "islamic-umalqura":
return -579;
case "persian":
return -600;
case "roc":
case "japanese":
case "gregory":
default:
return 0;
}
}
// src/common/regex.ts
var isPatternNumeric = (pattern) => {
const numericPattern = /(^|\W)[0-9](\W|$)/;
return numericPattern.test(pattern) && !/[^\d\^$\[\]\(\)\*\+\-\.\|]/.test(pattern);
};
// src/common/ra.ts
function chain(...callbacks) {
return (...args) => {
for (let callback of callbacks) {
if (typeof callback === "function") {
callback(...args);
}
}
};
}
var idsUpdaterMap = /* @__PURE__ */ new Map();
function mergeIds(idA, idB) {
if (idA === idB) {
return idA;
}
let setIdsA = idsUpdaterMap.get(idA);
if (setIdsA) {
setIdsA.forEach((ref) => ref.current = idB);
return idB;
}
let setIdsB = idsUpdaterMap.get(idB);
if (setIdsB) {
setIdsB.forEach((ref) => ref.current = idA);
return idA;
}
return idB;
}
function mergeProps(...args) {
let result = { ...args[0] };
for (let i = 1; i < args.length; i++) {
let props = args[i];
for (let key in props) {
let a = result[key];
let b = props[key];
if (typeof a === "function" && typeof b === "function" && // This is a lot faster than a regex.
key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
65 && key.charCodeAt(2) <= /* 'Z' */
90) {
result[key] = chain(a, b);
} else if ((key === "className" || key === "UNSAFE_className") && typeof a === "string" && typeof b === "string") {
result[key] = clsx(a, b);
} else if (key === "id" && a && b) {
result.id = mergeIds(a, b);
} else {
result[key] = b !== void 0 ? b : a;
}
}
}
return result;
}
function mergeRefs(...refs) {
if (refs.length === 1 && refs[0]) {
return refs[0];
}
return (value) => {
let hasCleanup = false;
const cleanups = refs.map((ref) => {
const cleanup = setRef(ref, value);
hasCleanup || (hasCleanup = typeof cleanup == "function");
return cleanup;
});
if (hasCleanup) {
return () => {
cleanups.forEach((cleanup, i) => {
if (typeof cleanup === "function") {
cleanup == null ? void 0 : cleanup();
} else {
setRef(refs[i], null);
}
});
};
}
};
}
function setRef(ref, value) {
if (typeof ref === "function") {
return () => ref(value);
} else if (ref != null) {
if ("current" in ref) {
ref.current = value;
}
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
__DEV__,
__TEST__,
arrayToObject,
callAll,
callAllHandlers,
capitalize,
chain,
clamp,
clampPercentage,
cleanObject,
cleanObjectKeys,
clsx,
compact,
copyObject,
dataAttr,
debounce,
extractProperty,
get,
getGregorianYearOffset,
getKeyValue,
getMargin,
getProp,
getUniqueID,
idsUpdaterMap,
intersectionBy,
isArray,
isEmpty,
isEmptyArray,
isEmptyObject,
isFunction,
isNumeric,
isObject,
isPatternNumeric,
kebabCase,
mapKeys,
mergeIds,
mergeProps,
mergeRefs,
objectToDeps,
omit,
omitObject,
range,
removeEvents,
renameProp,
safeAriaLabel,
safeInitials,
safeText,
uniqBy,
warn
});
@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var sectionRole = {
abstract: true,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: [],
prohibitedProps: [],
props: {},
relatedConcepts: [{
concept: {
name: 'frontmatter'
},
module: 'DTB'
}, {
concept: {
name: 'level'
},
module: 'DTB'
}, {
concept: {
name: 'level'
},
module: 'SMIL'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure']]
};
var _default = exports.default = sectionRole;
@@ -0,0 +1,52 @@
import {ariaHideOutside as $5e3802645cc19319$export$1c3ebcada18427bf} from "./ariaHideOutside.mjs";
import {useOverlay as $a11501f3d1d39e6c$export$ea8f71083e90600f} from "./useOverlay.mjs";
import {useOverlayFocusContain as $337b884510726a0d$export$14c98a7594375490} from "./Overlay.mjs";
import {usePreventScroll as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18} from "./usePreventScroll.mjs";
import {mergeProps as $7Dhkr$mergeProps} from "@react-aria/utils";
import {useEffect as $7Dhkr$useEffect} from "react";
/*
* Copyright 2022 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.
*/
function $8ac8429251c45e4b$export$dbc0f175b25fb0fb(props, state, ref) {
let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
...props,
isOpen: state.isOpen,
onClose: state.close
}, ref);
(0, $49c51c25361d4cd2$export$ee0f7cc6afcd1c18)({
isDisabled: !state.isOpen
});
(0, $337b884510726a0d$export$14c98a7594375490)();
(0, $7Dhkr$useEffect)(()=>{
if (state.isOpen && ref.current) return (0, $5e3802645cc19319$export$1c3ebcada18427bf)([
ref.current
], {
shouldUseInert: true
});
}, [
state.isOpen,
ref
]);
return {
modalProps: (0, $7Dhkr$mergeProps)(overlayProps),
underlayProps: underlayProps
};
}
export {$8ac8429251c45e4b$export$dbc0f175b25fb0fb as useModalOverlay};
//# sourceMappingURL=useModalOverlay.module.js.map
@@ -0,0 +1,48 @@
'use strict';
const _has = (obj, key) => {
return Object.prototype.hasOwnProperty.call(obj, key);
};
module.exports.assign = function (obj /*from1, from2, from3, ...*/) {
const sources = Array.prototype.slice.call(arguments, 1);
while (sources.length) {
const source = sources.shift();
if (!source) { continue; }
if (typeof source !== 'object') {
throw new TypeError(source + 'must be non-object');
}
for (const p in source) {
if (_has(source, p)) {
obj[p] = source[p];
}
}
}
return obj;
};
// Join array of chunks to single array.
module.exports.flattenChunks = (chunks) => {
// calculate data length
let len = 0;
for (let i = 0, l = chunks.length; i < l; i++) {
len += chunks[i].length;
}
// join chunks
const result = new Uint8Array(len);
for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {
let chunk = chunks[i];
result.set(chunk, pos);
pos += chunk.length;
}
return result;
};
@@ -0,0 +1,3 @@
declare const _exports: import('eslint').Rule.RuleModule;
export = _exports;
//# sourceMappingURL=no-did-mount-set-state.d.ts.map
@@ -0,0 +1,38 @@
/**
* The utility consumer functions provide common options for consuming
* streams.
* @since v16.7.0
*/
declare module "stream/consumers" {
import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer";
import { ReadableStream as WebReadableStream } from "node:stream/web";
/**
* @since v16.7.0
* @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream.
*/
function arrayBuffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<ArrayBuffer>;
/**
* @since v16.7.0
* @returns Fulfills with a `Blob` containing the full contents of the stream.
*/
function blob(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<NodeBlob>;
/**
* @since v16.7.0
* @returns Fulfills with a `Buffer` containing the full contents of the stream.
*/
function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<NonSharedBuffer>;
/**
* @since v16.7.0
* @returns Fulfills with the contents of the stream parsed as a
* UTF-8 encoded string that is then passed through `JSON.parse()`.
*/
function json(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<unknown>;
/**
* @since v16.7.0
* @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string.
*/
function text(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<string>;
}
declare module "node:stream/consumers" {
export * from "stream/consumers";
}
@@ -0,0 +1,133 @@
[![npm stat](https://img.shields.io/npm/dm/compute-scroll-into-view.svg?style=flat-square)](https://npm-stat.com/charts.html?package=compute-scroll-into-view)
[![npm version](https://img.shields.io/npm/v/compute-scroll-into-view.svg?style=flat-square)](https://www.npmjs.com/package/compute-scroll-into-view)
[![gzip size][gzip-badge]][unpkg-dist]
[![size][size-badge]][unpkg-dist]
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
![compute-scroll-into-view](https://user-images.githubusercontent.com/81981/43024153-a2cc212c-8c6d-11e8-913b-b4d62efcf105.png)
Lower level API that is used by the [ponyfill](https://ponyfill.com) [scroll-into-view-if-needed](https://github.com/scroll-into-view/scroll-into-view-if-needed) to compute where (if needed) elements should scroll based on [options defined in the spec](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) and the [`scrollMode: "if-needed"` draft spec proposal](https://github.com/w3c/csswg-drafts/pull/1805).
Use this if you want the smallest possible bundlesize and is ok with implementing the actual scrolling yourself.
Scrolling SVG elements are supported, as well as Shadow DOM elements. The [VisualViewport](https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport) API is also supported, ensuring scrolling works properly on modern devices. Quirksmode is also supported as long as you polyfill [`document.scrollingElement`](https://developer.mozilla.org/en-US/docs/Web/API/document/scrollingElement).
- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [compute(target, options)](#computetarget-options)
- [options](#options)
- [block](#block)
- [inline](#inline)
- [scrollMode](#scrollmode)
- [boundary](#boundary)
- [skipOverflowHiddenElements](#skipoverflowhiddenelements)
# Install
```bash
npm i compute-scroll-into-view
```
You can also use it from a CDN:
```js
const { compute } = await import('https://esm.sh/compute-scroll-into-view')
```
# Usage
```js
import { compute } from 'compute-scroll-into-view'
const node = document.getElementById('hero')
// same behavior as Element.scrollIntoView({block: "nearest", inline: "nearest"})
// see: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
const actions = compute(node, {
scrollMode: 'if-needed',
block: 'nearest',
inline: 'nearest',
})
// same behavior as Element.scrollIntoViewIfNeeded(true)
// see: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded
const actions = compute(node, {
scrollMode: 'if-needed',
block: 'center',
inline: 'center',
})
// Then perform the scrolling, use scroll-into-view-if-needed if you don't want to implement this part
actions.forEach(({ el, top, left }) => {
el.scrollTop = top
el.scrollLeft = left
})
```
# API
## compute(target, options)
## options
Type: `Object`
### [block](https://scroll-into-view.dev/#scroll-alignment)
Type: `'start' | 'center' | 'end' | 'nearest'`<br> Default: `'center'`
Control the logical scroll position on the y-axis. The spec states that the `block` direction is related to the [writing-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode), but this is not implemented yet in this library.
This means that `block: 'start'` aligns to the top edge and `block: 'end'` to the bottom.
### [inline](https://scroll-into-view.dev/#scroll-alignment)
Type: `'start' | 'center' | 'end' | 'nearest'`<br> Default: `'nearest'`
Like `block` this is affected by the [writing-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode). In left-to-right pages `inline: 'start'` will align to the left edge. In right-to-left it should be flipped. This will be supported in a future release.
### [scrollMode](https://scroll-into-view.dev/#scrolling-if-needed)
Type: `'always' | 'if-needed'`<br> Default: `'always'`
This is a proposed addition to the spec that you can track here: https://github.com/w3c/csswg-drafts/pull/5677
This library will be updated to reflect any changes to the spec and will provide a migration path.
To be backwards compatible with `Element.scrollIntoViewIfNeeded` if something is not 100% visible it will count as "needs scrolling". If you need a different visibility ratio your best option would be to implement an [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
### [boundary](https://scroll-into-view.dev/#limit-propagation)
Type: `Element | Function`
By default there is no boundary. All the parent elements of your target is checked until it reaches the viewport ([`document.scrollingElement`](https://developer.mozilla.org/en-US/docs/Web/API/document/scrollingElement)) when calculating layout and what to scroll.
By passing a boundary you can short-circuit this loop depending on your needs:
- Prevent the browser window from scrolling.
- Scroll elements into view in a list, without scrolling container elements.
You can also pass a function to do more dynamic checks to override the scroll scoping:
```js
const actions = compute(target, {
boundary: (parent) => {
// By default `overflow: hidden` elements are allowed, only `overflow: visible | clip` is skipped as
// this is required by the CSSOM spec
if (getComputedStyle(parent)['overflow'] === 'hidden') {
return false
}
return true
},
})
```
### skipOverflowHiddenElements
Type: `Boolean`<br> Default: `false`
By default the [spec](https://drafts.csswg.org/cssom-view/#scrolling-box) states that `overflow: hidden` elements should be scrollable because it has [been used to allow programatic scrolling](https://drafts.csswg.org/css-overflow-3/#valdef-overflow-hidden). This behavior can sometimes lead to [scrolling issues](https://github.com/scroll-into-view/scroll-into-view-if-needed/pull/225#issue-186419520) when you have a node that is a child of an `overflow: hidden` node.
This package follows the convention [adopted by Firefox](https://hg.mozilla.org/integration/fx-team/rev/c48c3ec05012#l7.18) of setting a boolean option to _not_ scroll all nodes with `overflow: hidden` set.
[gzip-badge]: https://img.shields.io/bundlephobia/minzip/compute-scroll-into-view?label=gzip%20size&style=flat-square
[size-badge]: https://img.shields.io/bundlephobia/min/compute-scroll-into-view?label=size&style=flat-square
[unpkg-dist]: https://unpkg.com/compute-scroll-into-view/dist/
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F wC","420":"A B"},B:{"2":"0 1 2 3 4 5 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","420":"C L M G N O P"},C:{"2":"0 1 2 3 4 5 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 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 0C 1C"},D:{"2":"0 1 2 3 4 5 J ZB K D E F A B C L M 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 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","36":"G N O P","66":"6 7 8 9 aB AB BB CB DB EB FB bB cB dB eB fB"},E:{"2":"J ZB K C L M G 2C ZC 3C 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","33":"D E F A B 4C 5C 6C aC"},F:{"2":"0 1 2 3 4 5 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 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB 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 FD GD HD ID NC uC JD OC"},G:{"2":"ZC KD vC LD MD 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","33":"E ND OD PD QD RD SD TD"},H:{"2":"hD"},I:{"2":"TC J I iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"2":"A B C H NC uC OC"},L:{"2":"I"},M:{"2":"MC"},N:{"420":"A B"},O:{"2":"PC"},P:{"2":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"2":"zD"},R:{"2":"0D"},S:{"2":"1D 2D"}},B:5,C:"CSS Regions",D:true};
@@ -0,0 +1,248 @@
/**
* Module dependencies.
*/
var tty = require('tty');
var util = require('util');
/**
* This is the Node.js implementation of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = require('./debug');
exports.init = init;
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
/**
* Colors.
*/
exports.colors = [6, 2, 3, 4, 5, 1];
/**
* Build up the default `inspectOpts` object from the environment variables.
*
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
*/
exports.inspectOpts = Object.keys(process.env).filter(function (key) {
return /^debug_/i.test(key);
}).reduce(function (obj, key) {
// camel-case
var prop = key
.substring(6)
.toLowerCase()
.replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
// coerce string value into JS value
var val = process.env[key];
if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
else if (val === 'null') val = null;
else val = Number(val);
obj[prop] = val;
return obj;
}, {});
/**
* The file descriptor to write the `debug()` calls to.
* Set the `DEBUG_FD` env variable to override with another value. i.e.:
*
* $ DEBUG_FD=3 node script.js 3>debug.log
*/
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
if (1 !== fd && 2 !== fd) {
util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
}
var stream = 1 === fd ? process.stdout :
2 === fd ? process.stderr :
createWritableStdioStream(fd);
/**
* Is stdout a TTY? Colored output is enabled when `true`.
*/
function useColors() {
return 'colors' in exports.inspectOpts
? Boolean(exports.inspectOpts.colors)
: tty.isatty(fd);
}
/**
* Map %o to `util.inspect()`, all on a single line.
*/
exports.formatters.o = function(v) {
this.inspectOpts.colors = this.useColors;
return util.inspect(v, this.inspectOpts)
.split('\n').map(function(str) {
return str.trim()
}).join(' ');
};
/**
* Map %o to `util.inspect()`, allowing multiple lines if needed.
*/
exports.formatters.O = function(v) {
this.inspectOpts.colors = this.useColors;
return util.inspect(v, this.inspectOpts);
};
/**
* Adds ANSI color escape codes if enabled.
*
* @api public
*/
function formatArgs(args) {
var name = this.namespace;
var useColors = this.useColors;
if (useColors) {
var c = this.color;
var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
} else {
args[0] = new Date().toUTCString()
+ ' ' + name + ' ' + args[0];
}
}
/**
* Invokes `util.format()` with the specified arguments and writes to `stream`.
*/
function log() {
return stream.write(util.format.apply(util, arguments) + '\n');
}
/**
* Save `namespaces`.
*
* @param {String} namespaces
* @api private
*/
function save(namespaces) {
if (null == namespaces) {
// If you set a process.env field to null or undefined, it gets cast to the
// string 'null' or 'undefined'. Just delete instead.
delete process.env.DEBUG;
} else {
process.env.DEBUG = namespaces;
}
}
/**
* Load `namespaces`.
*
* @return {String} returns the previously persisted debug modes
* @api private
*/
function load() {
return process.env.DEBUG;
}
/**
* Copied from `node/src/node.js`.
*
* XXX: It's lame that node doesn't expose this API out-of-the-box. It also
* relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
*/
function createWritableStdioStream (fd) {
var stream;
var tty_wrap = process.binding('tty_wrap');
// Note stream._type is used for test-module-load-list.js
switch (tty_wrap.guessHandleType(fd)) {
case 'TTY':
stream = new tty.WriteStream(fd);
stream._type = 'tty';
// Hack to have stream not keep the event loop alive.
// See https://github.com/joyent/node/issues/1726
if (stream._handle && stream._handle.unref) {
stream._handle.unref();
}
break;
case 'FILE':
var fs = require('fs');
stream = new fs.SyncWriteStream(fd, { autoClose: false });
stream._type = 'fs';
break;
case 'PIPE':
case 'TCP':
var net = require('net');
stream = new net.Socket({
fd: fd,
readable: false,
writable: true
});
// FIXME Should probably have an option in net.Socket to create a
// stream from an existing fd which is writable only. But for now
// we'll just add this hack and set the `readable` member to false.
// Test: ./node test/fixtures/echo.js < /etc/passwd
stream.readable = false;
stream.read = null;
stream._type = 'pipe';
// FIXME Hack to have stream not keep the event loop alive.
// See https://github.com/joyent/node/issues/1726
if (stream._handle && stream._handle.unref) {
stream._handle.unref();
}
break;
default:
// Probably an error on in uv_guess_handle()
throw new Error('Implement me. Unknown stream file type!');
}
// For supporting legacy API we put the FD here.
stream.fd = fd;
stream._isStdio = true;
return stream;
}
/**
* Init logic for `debug` instances.
*
* Create a new `inspectOpts` object in case `useColors` is set
* differently for a particular `debug` instance.
*/
function init (debug) {
debug.inspectOpts = {};
var keys = Object.keys(exports.inspectOpts);
for (var i = 0; i < keys.length; i++) {
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
}
}
/**
* Enable namespaces listed in `process.env.DEBUG` initially.
*/
exports.enable(load());
@@ -0,0 +1 @@
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC,GAED,kEAAkE;AAClE,2DAA2D;AAC3D,yDAAyD;AACzD,kHAAkH;;;;;AAuBlH,IAAI,wCAAmC;AACvC,IAAI,uCAAiB,IAAI;AAIlB,IAAI,4CAA2D,IAAI,OAAmC,yFAAyF;AACtM,IAAI,4CAAsB;AAC1B,IAAI,iDAA2B;AAE/B,sEAAsE;AACtE,MAAM,iDAA2B;IAC/B,KAAK;IACL,QAAQ;AACV;AAEA,SAAS,4CAAsB,QAAkB,EAAE,CAAe;IAChE,KAAK,IAAI,WAAW,qCAClB,QAAQ,UAAU;AAEtB;AAEA;;CAEC,GACD,SAAS,iCAAW,CAAgB;IAClC,gFAAgF;IAChF,OAAO,CAAE,CAAA,EAAE,OAAO,IAAK,CAAC,CAAA,GAAA,YAAI,OAAO,EAAE,MAAM,IAAK,EAAE,OAAO,IAAI,EAAE,GAAG,KAAK,aAAa,EAAE,GAAG,KAAK,WAAW,EAAE,GAAG,KAAK,MAAK;AAC1H;AAGA,SAAS,0CAAoB,CAAgB;IAC3C,4CAAsB;IACtB,IAAI,iCAAW,IAAI;QACjB,wCAAkB;QAClB,4CAAsB,YAAY;IACpC;AACF;AAEA,SAAS,yCAAmB,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QACA,qCAAe,GAAG,CAAC;QACnB,OAAO;YACL,qCAAe,MAAM,CAAC;QACxB;IACF,uDAAuD;IACvD,GAAG;AACL","sources":["packages/@react-aria/interactions/src/uLine truncated
@@ -0,0 +1,24 @@
'use strict';
var $RangeError = require('es-errors/range');
var ToInteger = require('./ToInteger');
var ToLength = require('./ToLength');
var SameValue = require('./SameValue');
// https://262.ecma-international.org/12.0/#sec-toindex
module.exports = function ToIndex(value) {
if (typeof value === 'undefined') {
return 0;
}
var integerIndex = ToInteger(value);
if (integerIndex < 0) {
throw new $RangeError('index must be >= 0');
}
var index = ToLength(integerIndex);
if (!SameValue(integerIndex, index)) {
throw new $RangeError('index must be >= 0 and < 2 ** 53 - 1');
}
return index;
};
@@ -0,0 +1,35 @@
/**
Check if a value is a plain object.
An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.
@example
```
import isPlainObject from 'is-plain-obj';
import {runInNewContext} from 'node:vm';
isPlainObject({foo: 'bar'});
//=> true
isPlainObject(new Object());
//=> true
isPlainObject(Object.create(null));
//=> true
// This works across realms
isPlainObject(runInNewContext('({})'));
//=> true
isPlainObject([1, 2, 3]);
//=> false
class Unicorn {}
isPlainObject(new Unicorn());
//=> false
isPlainObject(Math);
//=> false
```
*/
export default function isPlainObject<Value>(value: unknown): value is Record<PropertyKey, Value>;
@@ -0,0 +1,16 @@
export type {
ConstructNameMap,
ConstructName,
Handle,
Handlers,
Info,
Join,
Map,
Options,
SafeConfig,
State,
Tracker,
Unsafe
} from './lib/types.js'
export {toMarkdown} from './lib/index.js'
export {handle as defaultHandlers} from './lib/handle/index.js'
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"2":"C L M G N O P Q","1537":"0 1 2 3 4 5 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"},C:{"2":"xC TC 0C 1C","260":"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","513":"0 1 2 3 4 5 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"},D:{"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 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","1537":"0 1 2 3 4 5 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"},E:{"1":"sC tC DD ED","2":"J ZB K D E F A B C L M G 2C ZC 3C 4C 5C 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"},F:{"1":"pB qB rB sB tB uB vB wB xB yB","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 iB jB kB lB mB nB oB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B FD GD HD ID NC uC JD OC","1537":"0 1 2 3 4 5 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"},G:{"1":"sC tC","2":"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","130":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD"},H:{"130":"hD"},I:{"2":"TC J I iD jD kD lD vC mD nD"},J:{"2":"D","130":"A"},K:{"130":"A B C NC uC OC","1537":"H"},L:{"1537":"I"},M:{"2":"MC"},N:{"130":"A B"},O:{"2":"PC"},P:{"2":"J oD pD qD rD sD aC tD uD","1537":"6 7 8 9 AB BB CB DB EB FB vD wD xD QC RC SC yD"},Q:{"2":"zD"},R:{"1537":"0D"},S:{"513":"1D 2D"}},B:1,C:"SVG favicons",D:true};
@@ -0,0 +1,200 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const fs = require("fs")
const path = require("path")
const ignore = require("ignore").default
const Cache = require("./cache")
const exists = require("./exists")
const { getPackageJson } = require("./get-package-json")
const cache = new Cache()
const PARENT_RELATIVE_PATH = /^\.\./u
const NEVER_IGNORED =
/^(?:readme\.[^.]*|(?:licen[cs]e|changes|changelog|history)(?:\.[^.]*)?)$/iu
/**
* Checks whether or not a given file name is a relative path to a ancestor
* directory.
*
* @param {string} filePath - A file name to check.
* @returns {boolean} `true` if the file name is a relative path to a ancestor
* directory.
*/
function isAncestorFiles(filePath) {
return PARENT_RELATIVE_PATH.test(filePath)
}
/**
* @param {(filePath: string) => boolean} f - A function.
* @param {(filePath: string) => boolean} g - A function.
* @returns {(filePath: string) => boolean} A logical-and function of `f` and `g`.
*/
function and(f, g) {
return filePath => f(filePath) && g(filePath)
}
/**
* @param {(filePath: string) => boolean} f - A function.
* @param {(filePath: string) => boolean} g - A function.
* @param {(filePath: string) => boolean} [h] - A function.
* @returns {(filePath: string) => boolean} A logical-or function of `f`, `g`, and `h`.
*/
function or(f, g, h) {
if (h == null) {
return filePath => f(filePath) || g(filePath)
}
return filePath => f(filePath) || g(filePath) || h(filePath)
}
/**
* @param {(filePath: string) => boolean} f - A function.
* @returns {(filePath: string) => boolean} A logical-not function of `f`.
*/
function not(f) {
return filePath => !f(filePath)
}
/**
* Creates a function which checks whether or not a given file is ignoreable.
*
* @param {import('type-fest').JsonObject} packageJson - An object of package.json.
* @returns {(filePath: string) => boolean} A function which checks whether or not a given file is ignoreable.
*/
function filterNeverIgnoredFiles(packageJson) {
if (typeof packageJson?.filePath !== "string") {
return () => false
}
const basedir = path.dirname(packageJson.filePath)
const mainFilePath =
typeof packageJson.main === "string"
? path.join(basedir, packageJson.main)
: null
return filePath =>
path.join(basedir, filePath) !== mainFilePath &&
filePath !== "package.json" &&
!NEVER_IGNORED.test(path.relative(basedir, filePath))
}
/**
* Creates a function which checks whether or not a given file should be ignored.
*
* @param {unknown} files - File names of whitelist.
* @returns {((filePath: string) => boolean) | null} A function which checks whether or not a given file should be ignored.
*/
function parseWhiteList(files) {
if (Array.isArray(files) === false) {
return null
}
const ig = ignore()
const igN = ignore()
let hasN = false
for (const file of files) {
if (typeof file === "string" && file) {
const body = path.posix
.normalize(file.replace(/^!/u, ""))
.replace(/\/+$/u, "")
if (file.startsWith("!")) {
igN.add(`${body}`)
igN.add(`${body}/**`)
hasN = true
} else {
ig.add(`/${body}`)
ig.add(`/${body}/**`)
}
}
}
return hasN
? or(ig.createFilter(), not(igN.createFilter()))
: ig.createFilter()
}
/**
* Creates a function which checks whether or not a given file should be ignored.
*
* @param {string} basedir - The directory path "package.json" exists.
* @param {boolean} filesFieldExists - `true` if `files` field of `package.json` exists.
* @returns {((filePath: string) => boolean)|null} A function which checks whether or not a given file should be ignored.
*/
function parseNpmignore(basedir, filesFieldExists) {
let filePath = path.join(basedir, ".npmignore")
if (!exists(filePath)) {
if (filesFieldExists) {
return null
}
filePath = path.join(basedir, ".gitignore")
if (!exists(filePath)) {
return null
}
}
const ig = ignore()
ig.add(fs.readFileSync(filePath, "utf8"))
return not(ig.createFilter())
}
/**
* Gets an object to check whether a given path should be ignored or not.
* The object is created from:
*
* - `files` field of `package.json`
* - `.npmignore`
*
* @param {string} startPath - A file path to lookup.
* @returns {{ match: (filePath: string) => boolean }}
* An object to check whther or not a given path should be ignored.
* The object has a method `match`.
* `match` returns `true` if a given file path should be ignored.
*/
module.exports = function getNpmignore(startPath) {
const retv = { match: isAncestorFiles }
const packageJson = getPackageJson(startPath)
if (typeof packageJson?.filePath !== "string") {
return retv
}
const data = cache.get(packageJson.filePath)
if (data) {
return data
}
const filesIgnore = parseWhiteList(packageJson.files)
const npmignoreIgnore = parseNpmignore(
path.dirname(packageJson.filePath),
Boolean(filesIgnore)
)
if (filesIgnore && npmignoreIgnore) {
retv.match = and(
filterNeverIgnoredFiles(packageJson),
or(isAncestorFiles, filesIgnore, npmignoreIgnore)
)
} else if (filesIgnore) {
retv.match = and(
filterNeverIgnoredFiles(packageJson),
or(isAncestorFiles, filesIgnore)
)
} else if (npmignoreIgnore) {
retv.match = and(
filterNeverIgnoredFiles(packageJson),
or(isAncestorFiles, npmignoreIgnore)
)
}
cache.set(packageJson.filePath, retv)
return retv
}
@@ -0,0 +1,74 @@
# array.prototype.findlastindex <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
An ESnext spec-compliant `Array.prototype.findLastIndex` shim/polyfill/replacement that works as far down as ES3.
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the proposed [spec](https://tc39.es/proposal-array-find-from-last).
Because `Array.prototype.findLastIndex` depends on a receiver (the `this` value), the main export takes the array to operate on as the first argument.
## Getting started
```sh
npm install --save array.prototype.findlastindex
```
## Usage/Examples
```js
var findLastIndex = require('array.prototype.findlastindex');
var assert = require('assert');
var arr = [1, [2], [], 3, [[4]]];
var isNumber = function (x) { return typeof x === 'number' };
assert.deepEqual(findLastIndex(arr, isNumber), 3);
```
```js
var findLastIndex = require('array.prototype.findlastindex');
var assert = require('assert');
/* when Array#findLastIndex is not present */
delete Array.prototype.findLastIndex;
var shimmed = findLastIndex.shim();
assert.equal(shimmed, findLastIndex.getPolyfill());
assert.deepEqual(arr.findLastIndex(isNumber), findLastIndex(arr, isNumber));
```
```js
var findLastIndex = require('array.prototype.findlastindex');
var assert = require('assert');
/* when Array#findLastIndex is present */
var shimmed = findLastIndex.shim();
assert.equal(shimmed, Array.prototype.findLastIndex);
assert.deepEqual(arr.findLastIndex(isNumber), findLastIndex(arr, isNumber));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/array.prototype.findlastindex
[npm-version-svg]: https://versionbadg.es/es-shims/Array.prototype.findLastIndex.svg
[deps-svg]: https://david-dm.org/es-shims/Array.prototype.findLastIndex.svg
[deps-url]: https://david-dm.org/es-shims/Array.prototype.findLastIndex
[dev-deps-svg]: https://david-dm.org/es-shims/Array.prototype.findLastIndex/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/Array.prototype.findLastIndex#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/array.prototype.findlastindex.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/array.prototype.findlastindex.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/array.prototype.findlastindex.svg
[downloads-url]: https://npm-stat.com/charts.html?package=array.prototype.findlastindex
[codecov-image]: https://codecov.io/gh/es-shims/Array.prototype.findLastIndex/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/Array.prototype.findLastIndex/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Array.prototype.findLastIndex
[actions-url]: https://github.com/es-shims/Array.prototype.findLastIndex
@@ -0,0 +1,49 @@
'use strict';
var $TypeError = require('es-errors/type');
var Get = require('./Get');
var IteratorComplete = require('./IteratorComplete');
var IteratorNext = require('./IteratorNext');
var isIteratorRecord = require('../helpers/records/iterator-record');
// https://262.ecma-international.org/15.0/#sec-iteratorstepvalue
module.exports = function IteratorStepValue(iteratorRecord) {
if (!isIteratorRecord(iteratorRecord)) {
throw new $TypeError('Assertion failed: `iteratorRecord` must be an Iterator Record');
}
/* eslint no-param-reassign: 0 */
var result;
try {
result = IteratorNext(iteratorRecord); // step 1
} catch (e) { // step 2
iteratorRecord['[[Done]]'] = true; // step 2.a
throw e; // step 2.b
}
var done;
try {
done = IteratorComplete(result); // step 4
} catch (e) { // step 5
iteratorRecord['[[Done]]'] = true; // step 5.a
throw e; // step 5.b
}
if (done) { // step 7
iteratorRecord['[[Done]]'] = true; // step 7.a
return 'DONE'; // step 7.b
}
var value;
try {
value = Get(result, 'value'); // step 8
} catch (e) { // step 9
iteratorRecord['[[Done]]'] = true; // step 9.a
throw e; // step 10
}
return value; // step 10
};
@@ -0,0 +1,653 @@
'use strict';
const { Readable, Writable } = require('stream');
const StreamSearch = require('streamsearch');
const {
basename,
convertToUTF8,
getDecoder,
parseContentType,
parseDisposition,
} = require('../utils.js');
const BUF_CRLF = Buffer.from('\r\n');
const BUF_CR = Buffer.from('\r');
const BUF_DASH = Buffer.from('-');
function noop() {}
const MAX_HEADER_PAIRS = 2000; // From node
const MAX_HEADER_SIZE = 16 * 1024; // From node (its default value)
const HPARSER_NAME = 0;
const HPARSER_PRE_OWS = 1;
const HPARSER_VALUE = 2;
class HeaderParser {
constructor(cb) {
this.header = Object.create(null);
this.pairCount = 0;
this.byteCount = 0;
this.state = HPARSER_NAME;
this.name = '';
this.value = '';
this.crlf = 0;
this.cb = cb;
}
reset() {
this.header = Object.create(null);
this.pairCount = 0;
this.byteCount = 0;
this.state = HPARSER_NAME;
this.name = '';
this.value = '';
this.crlf = 0;
}
push(chunk, pos, end) {
let start = pos;
while (pos < end) {
switch (this.state) {
case HPARSER_NAME: {
let done = false;
for (; pos < end; ++pos) {
if (this.byteCount === MAX_HEADER_SIZE)
return -1;
++this.byteCount;
const code = chunk[pos];
if (TOKEN[code] !== 1) {
if (code !== 58/* ':' */)
return -1;
this.name += chunk.latin1Slice(start, pos);
if (this.name.length === 0)
return -1;
++pos;
done = true;
this.state = HPARSER_PRE_OWS;
break;
}
}
if (!done) {
this.name += chunk.latin1Slice(start, pos);
break;
}
// FALLTHROUGH
}
case HPARSER_PRE_OWS: {
// Skip optional whitespace
let done = false;
for (; pos < end; ++pos) {
if (this.byteCount === MAX_HEADER_SIZE)
return -1;
++this.byteCount;
const code = chunk[pos];
if (code !== 32/* ' ' */ && code !== 9/* '\t' */) {
start = pos;
done = true;
this.state = HPARSER_VALUE;
break;
}
}
if (!done)
break;
// FALLTHROUGH
}
case HPARSER_VALUE:
switch (this.crlf) {
case 0: // Nothing yet
for (; pos < end; ++pos) {
if (this.byteCount === MAX_HEADER_SIZE)
return -1;
++this.byteCount;
const code = chunk[pos];
if (FIELD_VCHAR[code] !== 1) {
if (code !== 13/* '\r' */)
return -1;
++this.crlf;
break;
}
}
this.value += chunk.latin1Slice(start, pos++);
break;
case 1: // Received CR
if (this.byteCount === MAX_HEADER_SIZE)
return -1;
++this.byteCount;
if (chunk[pos++] !== 10/* '\n' */)
return -1;
++this.crlf;
break;
case 2: { // Received CR LF
if (this.byteCount === MAX_HEADER_SIZE)
return -1;
++this.byteCount;
const code = chunk[pos];
if (code === 32/* ' ' */ || code === 9/* '\t' */) {
// Folded value
start = pos;
this.crlf = 0;
} else {
if (++this.pairCount < MAX_HEADER_PAIRS) {
this.name = this.name.toLowerCase();
if (this.header[this.name] === undefined)
this.header[this.name] = [this.value];
else
this.header[this.name].push(this.value);
}
if (code === 13/* '\r' */) {
++this.crlf;
++pos;
} else {
// Assume start of next header field name
start = pos;
this.crlf = 0;
this.state = HPARSER_NAME;
this.name = '';
this.value = '';
}
}
break;
}
case 3: { // Received CR LF CR
if (this.byteCount === MAX_HEADER_SIZE)
return -1;
++this.byteCount;
if (chunk[pos++] !== 10/* '\n' */)
return -1;
// End of header
const header = this.header;
this.reset();
this.cb(header);
return pos;
}
}
break;
}
}
return pos;
}
}
class FileStream extends Readable {
constructor(opts, owner) {
super(opts);
this.truncated = false;
this._readcb = null;
this.once('end', () => {
// We need to make sure that we call any outstanding _writecb() that is
// associated with this file so that processing of the rest of the form
// can continue. This may not happen if the file stream ends right after
// backpressure kicks in, so we force it here.
this._read();
if (--owner._fileEndsLeft === 0 && owner._finalcb) {
const cb = owner._finalcb;
owner._finalcb = null;
// Make sure other 'end' event handlers get a chance to be executed
// before busboy's 'finish' event is emitted
process.nextTick(cb);
}
});
}
_read(n) {
const cb = this._readcb;
if (cb) {
this._readcb = null;
cb();
}
}
}
const ignoreData = {
push: (chunk, pos) => {},
destroy: () => {},
};
function callAndUnsetCb(self, err) {
const cb = self._writecb;
self._writecb = null;
if (err)
self.destroy(err);
else if (cb)
cb();
}
function nullDecoder(val, hint) {
return val;
}
class Multipart extends Writable {
constructor(cfg) {
const streamOpts = {
autoDestroy: true,
emitClose: true,
highWaterMark: (typeof cfg.highWaterMark === 'number'
? cfg.highWaterMark
: undefined),
};
super(streamOpts);
if (!cfg.conType.params || typeof cfg.conType.params.boundary !== 'string')
throw new Error('Multipart: Boundary not found');
const boundary = cfg.conType.params.boundary;
const paramDecoder = (typeof cfg.defParamCharset === 'string'
&& cfg.defParamCharset
? getDecoder(cfg.defParamCharset)
: nullDecoder);
const defCharset = (cfg.defCharset || 'utf8');
const preservePath = cfg.preservePath;
const fileOpts = {
autoDestroy: true,
emitClose: true,
highWaterMark: (typeof cfg.fileHwm === 'number'
? cfg.fileHwm
: undefined),
};
const limits = cfg.limits;
const fieldSizeLimit = (limits && typeof limits.fieldSize === 'number'
? limits.fieldSize
: 1 * 1024 * 1024);
const fileSizeLimit = (limits && typeof limits.fileSize === 'number'
? limits.fileSize
: Infinity);
const filesLimit = (limits && typeof limits.files === 'number'
? limits.files
: Infinity);
const fieldsLimit = (limits && typeof limits.fields === 'number'
? limits.fields
: Infinity);
const partsLimit = (limits && typeof limits.parts === 'number'
? limits.parts
: Infinity);
let parts = -1; // Account for initial boundary
let fields = 0;
let files = 0;
let skipPart = false;
this._fileEndsLeft = 0;
this._fileStream = undefined;
this._complete = false;
let fileSize = 0;
let field;
let fieldSize = 0;
let partCharset;
let partEncoding;
let partType;
let partName;
let partTruncated = false;
let hitFilesLimit = false;
let hitFieldsLimit = false;
this._hparser = null;
const hparser = new HeaderParser((header) => {
this._hparser = null;
skipPart = false;
partType = 'text/plain';
partCharset = defCharset;
partEncoding = '7bit';
partName = undefined;
partTruncated = false;
let filename;
if (!header['content-disposition']) {
skipPart = true;
return;
}
const disp = parseDisposition(header['content-disposition'][0],
paramDecoder);
if (!disp || disp.type !== 'form-data') {
skipPart = true;
return;
}
if (disp.params) {
if (disp.params.name)
partName = disp.params.name;
if (disp.params['filename*'])
filename = disp.params['filename*'];
else if (disp.params.filename)
filename = disp.params.filename;
if (filename !== undefined && !preservePath)
filename = basename(filename);
}
if (header['content-type']) {
const conType = parseContentType(header['content-type'][0]);
if (conType) {
partType = `${conType.type}/${conType.subtype}`;
if (conType.params && typeof conType.params.charset === 'string')
partCharset = conType.params.charset.toLowerCase();
}
}
if (header['content-transfer-encoding'])
partEncoding = header['content-transfer-encoding'][0].toLowerCase();
if (partType === 'application/octet-stream' || filename !== undefined) {
// File
if (files === filesLimit) {
if (!hitFilesLimit) {
hitFilesLimit = true;
this.emit('filesLimit');
}
skipPart = true;
return;
}
++files;
if (this.listenerCount('file') === 0) {
skipPart = true;
return;
}
fileSize = 0;
this._fileStream = new FileStream(fileOpts, this);
++this._fileEndsLeft;
this.emit(
'file',
partName,
this._fileStream,
{ filename,
encoding: partEncoding,
mimeType: partType }
);
} else {
// Non-file
if (fields === fieldsLimit) {
if (!hitFieldsLimit) {
hitFieldsLimit = true;
this.emit('fieldsLimit');
}
skipPart = true;
return;
}
++fields;
if (this.listenerCount('field') === 0) {
skipPart = true;
return;
}
field = [];
fieldSize = 0;
}
});
let matchPostBoundary = 0;
const ssCb = (isMatch, data, start, end, isDataSafe) => {
retrydata:
while (data) {
if (this._hparser !== null) {
const ret = this._hparser.push(data, start, end);
if (ret === -1) {
this._hparser = null;
hparser.reset();
this.emit('error', new Error('Malformed part header'));
break;
}
start = ret;
}
if (start === end)
break;
if (matchPostBoundary !== 0) {
if (matchPostBoundary === 1) {
switch (data[start]) {
case 45: // '-'
// Try matching '--' after boundary
matchPostBoundary = 2;
++start;
break;
case 13: // '\r'
// Try matching CR LF before header
matchPostBoundary = 3;
++start;
break;
default:
matchPostBoundary = 0;
}
if (start === end)
return;
}
if (matchPostBoundary === 2) {
matchPostBoundary = 0;
if (data[start] === 45/* '-' */) {
// End of multipart data
this._complete = true;
this._bparser = ignoreData;
return;
}
// We saw something other than '-', so put the dash we consumed
// "back"
const writecb = this._writecb;
this._writecb = noop;
ssCb(false, BUF_DASH, 0, 1, false);
this._writecb = writecb;
} else if (matchPostBoundary === 3) {
matchPostBoundary = 0;
if (data[start] === 10/* '\n' */) {
++start;
if (parts >= partsLimit)
break;
// Prepare the header parser
this._hparser = hparser;
if (start === end)
break;
// Process the remaining data as a header
continue retrydata;
} else {
// We saw something other than LF, so put the CR we consumed
// "back"
const writecb = this._writecb;
this._writecb = noop;
ssCb(false, BUF_CR, 0, 1, false);
this._writecb = writecb;
}
}
}
if (!skipPart) {
if (this._fileStream) {
let chunk;
const actualLen = Math.min(end - start, fileSizeLimit - fileSize);
if (!isDataSafe) {
chunk = Buffer.allocUnsafe(actualLen);
data.copy(chunk, 0, start, start + actualLen);
} else {
chunk = data.slice(start, start + actualLen);
}
fileSize += chunk.length;
if (fileSize === fileSizeLimit) {
if (chunk.length > 0)
this._fileStream.push(chunk);
this._fileStream.emit('limit');
this._fileStream.truncated = true;
skipPart = true;
} else if (!this._fileStream.push(chunk)) {
if (this._writecb)
this._fileStream._readcb = this._writecb;
this._writecb = null;
}
} else if (field !== undefined) {
let chunk;
const actualLen = Math.min(
end - start,
fieldSizeLimit - fieldSize
);
if (!isDataSafe) {
chunk = Buffer.allocUnsafe(actualLen);
data.copy(chunk, 0, start, start + actualLen);
} else {
chunk = data.slice(start, start + actualLen);
}
fieldSize += actualLen;
field.push(chunk);
if (fieldSize === fieldSizeLimit) {
skipPart = true;
partTruncated = true;
}
}
}
break;
}
if (isMatch) {
matchPostBoundary = 1;
if (this._fileStream) {
// End the active file stream if the previous part was a file
this._fileStream.push(null);
this._fileStream = null;
} else if (field !== undefined) {
let data;
switch (field.length) {
case 0:
data = '';
break;
case 1:
data = convertToUTF8(field[0], partCharset, 0);
break;
default:
data = convertToUTF8(
Buffer.concat(field, fieldSize),
partCharset,
0
);
}
field = undefined;
fieldSize = 0;
this.emit(
'field',
partName,
data,
{ nameTruncated: false,
valueTruncated: partTruncated,
encoding: partEncoding,
mimeType: partType }
);
}
if (++parts === partsLimit)
this.emit('partsLimit');
}
};
this._bparser = new StreamSearch(`\r\n--${boundary}`, ssCb);
this._writecb = null;
this._finalcb = null;
// Just in case there is no preamble
this.write(BUF_CRLF);
}
static detect(conType) {
return (conType.type === 'multipart' && conType.subtype === 'form-data');
}
_write(chunk, enc, cb) {
this._writecb = cb;
this._bparser.push(chunk, 0);
if (this._writecb)
callAndUnsetCb(this);
}
_destroy(err, cb) {
this._hparser = null;
this._bparser = ignoreData;
if (!err)
err = checkEndState(this);
const fileStream = this._fileStream;
if (fileStream) {
this._fileStream = null;
fileStream.destroy(err);
}
cb(err);
}
_final(cb) {
this._bparser.destroy();
if (!this._complete)
return cb(new Error('Unexpected end of form'));
if (this._fileEndsLeft)
this._finalcb = finalcb.bind(null, this, cb);
else
finalcb(this, cb);
}
}
function finalcb(self, cb, err) {
if (err)
return cb(err);
err = checkEndState(self);
cb(err);
}
function checkEndState(self) {
if (self._hparser)
return new Error('Malformed part header');
const fileStream = self._fileStream;
if (fileStream) {
self._fileStream = null;
fileStream.destroy(new Error('Unexpected end of file'));
}
if (!self._complete)
return new Error('Unexpected end of form');
}
const TOKEN = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1,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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
];
module.exports = Multipart;
@@ -0,0 +1,2 @@
import picocolors from 'picocolors';
export declare const colorful: Record<keyof Omit<typeof picocolors, "createColors">, (...args: any[]) => void>;
@@ -0,0 +1,26 @@
'use strict';
var config = {
cwd: {
type: 'string',
default: process.cwd,
},
dirMode: {
type: 'number',
},
overwrite: {
type: 'boolean',
default: true,
},
relativeSymlinks: {
type: 'boolean',
default: false,
},
// This option is ignored on non-Windows platforms
useJunctions: {
type: 'boolean',
default: true,
},
};
module.exports = config;
@@ -0,0 +1,17 @@
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/**
* Creates a clone of `regexp`.
*
* @private
* @param {Object} regexp The regexp to clone.
* @returns {Object} Returns the cloned regexp.
*/
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
module.exports = cloneRegExp;
@@ -0,0 +1 @@
{"version":3,"names":["_getPrototypeOf","require","_setPrototypeOf","_isNativeFunction","_construct","_wrapNativeSuper","Class","_cache","Map","undefined","exports","default","isNativeFunction","TypeError","has","get","set","Wrapper","construct","arguments","getPrototypeOf","constructor","prototype","Object","create","value","enumerable","writable","configurable","setPrototypeOf"],"sources":["../../src/helpers/wrapNativeSuper.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\n// Based on https://github.com/WebReflection/babel-plugin-transform-builtin-classes\n\nimport getPrototypeOf from \"./getPrototypeOf.ts\";\nimport setPrototypeOf from \"./setPrototypeOf.ts\";\nimport isNativeFunction from \"./isNativeFunction.ts\";\nimport construct from \"./construct.ts\";\n\nexport default function _wrapNativeSuper(Class: Function | null) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n // @ts-expect-error -- reuse function id for helper size\n _wrapNativeSuper = function _wrapNativeSuper(Class: Function | null) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (_cache !== undefined) {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n // @ts-expect-error -- we are sure Class is a function here\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n });\n\n return setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n"],"mappings":";;;;;;AAIA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEe,SAASI,gBAAgBA,CAACC,KAAsB,EAAE;EAC/D,IAAIC,MAAM,GAAG,OAAOC,GAAG,KAAK,UAAU,GAAG,IAAIA,GAAG,CAAC,CAAC,GAAGC,SAAS;EAG9DC,OAAA,CAAAC,OAAA,GAAAN,gBAAgB,GAAG,SAASA,gBAAgBA,CAACC,KAAsB,EAAE;IACnE,IAAIA,KAAK,KAAK,IAAI,IAAI,CAAC,IAAAM,yBAAgB,EAACN,KAAK,CAAC,EAAE,OAAOA,KAAK;IAC5D,IAAI,OAAOA,KAAK,KAAK,UAAU,EAAE;MAC/B,MAAM,IAAIO,SAAS,CAAC,oDAAoD,CAAC;IAC3E;IACA,IAAI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Gb,OAAO;AACT;AAEO,SAAS,yCAAoB,UAA+B,EAAE,CAAU,EAAE,CAAU;IACzF,gEAAgE;IAChE,IAAI,EAAE,SAAS,KAAK,EAAE,SAAS,EAC7B,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK;IAG1B,4HAA4H;IAC5H,6IAA6I;IAC7I,6BAA6B;IAC7B,IAAI,aAAa;WAAI,mCAAa,YAAY;QAAI;KAAE;IACpD,IAAI,aAAa;WAAI,mCAAa,YAAY;QAAI;KAAE;IACpD,IAAI,2BAA2B,WAAW,KAAK,CAAC,GAAG,WAAW,MAAM,EAAE,SAAS,CAAC,CAAC,GAAG,IAAM,MAAM,UAAU,CAAC,EAAE;IAC7G,IAAI,6BAA6B,IAAI;QACnC,kEAAkE;QAClE,IAAI,UAAU,CAAC,yBAAyB;QACxC,IAAI,UAAU,CAAC,yBAAyB;QACxC,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK;IAC1B;IAEA,qHAAqH;IACrH,IAAI,WAAW,SAAS,CAAC,CAAA,OAAQ,SAAS,MAAM,GAC9C,OAAO;SACF,IAAI,WAAW,SAAS,CAAC,CAAA,OAAQ,SAAS,MAAM,GACrD,OAAO;IAGT,KAAK;IACL,OAAO;AACT;AAEA,SAAS,mCAAgB,UAA+B,EAAE,IAAa;IACrE,IAAI,UAAqB,EAAE;IAE3B,IAAI,WAA2B;IAC/B,MAAO,CAAA,qBAAA,+BAAA,SAAU,SAAS,KAAI,KAAM;QAClC,WAAW,WAAW,OAAO,CAAC,SAAS,SAAS;QAChD,IAAI,UACF,QAAQ,OAAO,CAAC;IAEpB;IAEA,OAAO;AACT","sources":["packages/@react-stately/collections/src/getChildNodes.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {Collection, Node} from '@react-types/shared';\n\nexport function getChildNodes<T>(node: Node<T>, collection: Collection<Node<T>>): Iterable<Node<T>> {\n // New API: call collection.getChildren with the node key.\n if (typeof collection.getChildren === 'function') {\n return collection.getChildren(node.key);\n }\n\n // Old API: access childNodes directly.\n return node.childNodes;\n}\n\nexport function getFirstItem<T>(iterable: Iterable<T>): T | undefined {\n return getNthItem(iterable, 0);\n}\n\nexport function getNthItem<T>(iterable: Iterable<T>, index: number): T | undefined {\n if (index < 0) {\n return undefined;\n }\n\n let i = 0;\n for (let item of iterable) {\n if (i === index) {\n return item;\n }\n\n i++;\n }\n}\n\nexport function getLastItem<T>(iterable: Iterable<T>): T | undefined {\n let lastItem: T | undefined = undefined;\n for (let value of iterable) {\n lastItem = value;\n }\n\n return lastItem;\n}\n\nexport function compareNodeOrder<T>(collection: Collection<Node<T>>, a: Node<T>, b: Node<T>) {\n // If the two nodes have the same parent, compare their indices.\n if (a.parentKey === b.parentKey) {\n return a.index - b.index;\n }\n\n // Otherwise, collect all of the ancestors from each node, and find the first one that doesn't match starting from the root.\n // Include the base nodes in case we are comparing nodes of different levels so that we can compare the higher node to the lower level node's\n // ancestor of the same level\n let aAncestors = [...getAncestors(collection, a), a];\n let bAncestors = [...getAncestors(collection, b), b];\n let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a, i) => a !== bAncestors[i]);\n if (firstNonMatchingAncestor !== -1) {\n // Compare the indices of two children within the common ancestor.\n a = aAncestors[firstNonMatchingAncestor];\n b = bAncestors[firstNonMatchingAncestor];\n return a.index - b.index;\n }\n\n // If there isn't a non matching ancestor, we might be in a case where one of the nodes is the ancestor of the other.\n if (aAncestors.findIndex(node => node === b) >= 0) {\n return 1;\n } else if (bAncestors.findIndex(node => node === a) >= 0) {\n return -1;\n }\n\n // 🤷\n return -1;\n}\n\nfunction getAncestors<T>(collection: Collection<Node<T>>, node: Node<T>): Node<T>[] {\n let parents: Node<T>[] = [];\n\n let currNode: Node<T> | null = node;\n while (currNode?.parentKey != null) {\n currNode = collection.getItem(currNode.parentKey);\n if (currNode) {\n parents.unshift(currNode);\n }\n }\n\n return parents;\n}\n"],"names":[],"version":3,"file":"getChildNodes.main.js.map"}
@@ -0,0 +1,381 @@
import { expect, test } from "vitest";
import * as z from "zod/v4";
/// string
const stringSchema = z.string();
test("string async parse", async () => {
const goodData = "XXX";
const badData = 12;
const goodResult = await stringSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await stringSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// number
const numberSchema = z.number();
test("number async parse", async () => {
const goodData = 1234.2353;
const badData = "1234";
const goodResult = await numberSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await numberSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// bigInt
const bigIntSchema = z.bigint();
test("bigInt async parse", async () => {
const goodData = BigInt(145);
const badData = 134;
const goodResult = await bigIntSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await bigIntSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// boolean
const booleanSchema = z.boolean();
test("boolean async parse", async () => {
const goodData = true;
const badData = 1;
const goodResult = await booleanSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await booleanSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// date
const dateSchema = z.date();
test("date async parse", async () => {
const goodData = new Date();
const badData = new Date().toISOString();
const goodResult = await dateSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await dateSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// undefined
const undefinedSchema = z.undefined();
test("undefined async parse", async () => {
const goodData = undefined;
const badData = "XXX";
const goodResult = await undefinedSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(undefined);
const badResult = await undefinedSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// null
const nullSchema = z.null();
test("null async parse", async () => {
const goodData = null;
const badData = undefined;
const goodResult = await nullSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await nullSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// any
const anySchema = z.any();
test("any async parse", async () => {
const goodData = [{}];
// const badData = 'XXX';
const goodResult = await anySchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
// const badResult = await anySchema.safeParseAsync(badData);
// expect(badResult.success).toBe(false);
// if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// unknown
const unknownSchema = z.unknown();
test("unknown async parse", async () => {
const goodData = ["asdf", 124, () => {}];
// const badData = 'XXX';
const goodResult = await unknownSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
// const badResult = await unknownSchema.safeParseAsync(badData);
// expect(badResult.success).toBe(false);
// if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// void
const voidSchema = z.void();
test("void async parse", async () => {
const goodData = undefined;
const badData = 0;
const goodResult = await voidSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await voidSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// array
const arraySchema = z.array(z.string());
test("array async parse", async () => {
const goodData = ["XXX"];
const badData = "XXX";
const goodResult = await arraySchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await arraySchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// object
const objectSchema = z.object({ string: z.string() });
test("object async parse", async () => {
const goodData = { string: "XXX" };
const badData = { string: 12 };
const goodResult = await objectSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await objectSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// union
const unionSchema = z.union([z.string(), z.undefined()]);
test("union async parse", async () => {
const goodData = undefined;
const badData = null;
const goodResult = await unionSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await unionSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// record
const recordSchema = z.record(z.string(), z.object({}));
test("record async parse", async () => {
const goodData = { adsf: {}, asdf: {} };
const badData = [{}];
const goodResult = await recordSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await recordSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// function
// const functionSchema = z.function();
// test("function async parse", async () => {
// const goodData = () => {};
// const badData = "XXX";
// const goodResult = await functionSchema.safeParseAsync(goodData);
// expect(goodResult.success).toBe(true);
// if (goodResult.success) expect(typeof goodResult.data).toEqual("function");
// const badResult = await functionSchema.safeParseAsync(badData);
// expect(badResult.success).toBe(false);
// if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
// });
/// literal
const literalSchema = z.literal("asdf");
test("literal async parse", async () => {
const goodData = "asdf";
const badData = "asdff";
const goodResult = await literalSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await literalSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// enum
const enumSchema = z.enum(["fish", "whale"]);
test("enum async parse", async () => {
const goodData = "whale";
const badData = "leopard";
const goodResult = await enumSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await enumSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// nativeEnum
enum nativeEnumTest {
asdf = "qwer",
}
// @ts-ignore
const nativeEnumSchema = z.nativeEnum(nativeEnumTest);
test("nativeEnum async parse", async () => {
const goodData = nativeEnumTest.asdf;
const badData = "asdf";
const goodResult = await nativeEnumSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
if (goodResult.success) expect(goodResult.data).toEqual(goodData);
const badResult = await nativeEnumSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
if (!badResult.success) expect(badResult.error).toBeInstanceOf(z.ZodError);
});
/// promise
const promiseSchema = z.promise(z.number());
test("promise async parse good", async () => {
const goodData = Promise.resolve(123);
const goodResult = await promiseSchema.safeParseAsync(goodData);
expect(goodResult.success).toBe(true);
expect(typeof goodResult.data).toEqual("number");
expect(goodResult.data).toEqual(123);
});
test("promise async parse bad", async () => {
const badData = Promise.resolve("XXX");
const badResult = await promiseSchema.safeParseAsync(badData);
expect(badResult.success).toBe(false);
expect(badResult.error).toBeInstanceOf(z.ZodError);
});
test("async validation non-empty strings", async () => {
const base = z.object({
hello: z.string().refine((x) => x && x.length > 0),
foo: z.string().refine((x) => x && x.length > 0),
});
const testval = { hello: "", foo: "" };
const result1 = base.safeParse(testval);
const result2 = base.safeParseAsync(testval);
const r1 = result1;
await result2.then((r2) => {
expect(r1.error!.issues.length).toBe(r2.error!.issues.length);
});
});
test("async validation multiple errors 1", async () => {
const base = z.object({
hello: z.string(),
foo: z.number(),
});
const testval = { hello: 3, foo: "hello" };
const result1 = base.safeParse(testval);
const result2 = base.safeParseAsync(testval);
await result2.then((result2) => {
expect(result2.error!.issues.length).toBe(result1.error!.issues.length);
});
});
test("async validation multiple errors 2", async () => {
const base = (is_async?: boolean) =>
z.object({
hello: z.string(),
foo: z.object({
bar: z.number().refine(
is_async
? async () =>
new Promise((resolve) => {
setTimeout(() => resolve(false), 500);
})
: () => false
),
}),
});
const testval = { hello: 3, foo: { bar: 4 } };
const result1 = base().safeParse(testval);
const result2 = base(true).safeParseAsync(testval);
await result2.then((result2) => {
expect(result1.error!.issues.length).toBe(result2.error!.issues.length);
});
});
test("ensure early async failure prevents follow-up refinement checks", async () => {
let count = 0;
const base = z.object({
hello: z.string(),
foo: z
.number()
.refine(async () => {
count++;
return true;
})
.refine(async () => {
count++;
return true;
}, "Good"),
});
const testval = { hello: "bye", foo: 3 };
const result = await base.safeParseAsync(testval);
if (result.success === false) {
expect(result.error.issues.length).toBe(1);
expect(count).toBe(1);
}
// await result.then((r) => {
// if (r.success === false) expect(r.error.issues.length).toBe(1);
// expect(count).toBe(2);
// });
});
@@ -0,0 +1 @@
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/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C,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YACxE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAE,CAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QAC/D,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACjD,IACE,IAAI,CAAC,KAAK,EAAE;YACZ,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK;gBAClB,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC,EACzD;YACA,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;SACb;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,IAAI,CAAA;QACpC,kDAAkD;QAClD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE;YAAE,OAAO,KAAK,CAAA;QAC1C,IAAI,IAAI,Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"heading-atx.d.ts","sourceRoot":"","sources":["heading-atx.js"],"names":[],"mappings":"AAqBA,wBAAwB;AACxB,yBADW,SAAS,CAKnB;+BAlBS,sBAAsB"}
@@ -0,0 +1,77 @@
var $20aJV$reactariautils = require("@react-aria/utils");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "disableTextSelection", () => $f7e14e656343df57$export$16a4697467175487);
$parcel$export(module.exports, "restoreTextSelection", () => $f7e14e656343df57$export$b0d6fa1ab32e3295);
/*
* 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.
*/
// Note that state only matters here for iOS. Non-iOS gets user-select: none applied to the target element
// rather than at the document level so we just need to apply/remove user-select: none for each pressed element individually
let $f7e14e656343df57$var$state = 'default';
let $f7e14e656343df57$var$savedUserSelect = '';
let $f7e14e656343df57$var$modifiedElementMap = new WeakMap();
function $f7e14e656343df57$export$16a4697467175487(target) {
if ((0, $20aJV$reactariautils.isIOS)()) {
if ($f7e14e656343df57$var$state === 'default') {
const documentObject = (0, $20aJV$reactariautils.getOwnerDocument)(target);
$f7e14e656343df57$var$savedUserSelect = documentObject.documentElement.style.webkitUserSelect;
documentObject.documentElement.style.webkitUserSelect = 'none';
}
$f7e14e656343df57$var$state = 'disabled';
} else if (target instanceof HTMLElement || target instanceof SVGElement) {
// If not iOS, store the target's original user-select and change to user-select: none
// Ignore state since it doesn't apply for non iOS
let property = 'userSelect' in target.style ? 'userSelect' : 'webkitUserSelect';
$f7e14e656343df57$var$modifiedElementMap.set(target, target.style[property]);
target.style[property] = 'none';
}
}
function $f7e14e656343df57$export$b0d6fa1ab32e3295(target) {
if ((0, $20aJV$reactariautils.isIOS)()) {
// If the state is already default, there's nothing to do.
// If it is restoring, then there's no need to queue a second restore.
if ($f7e14e656343df57$var$state !== 'disabled') return;
$f7e14e656343df57$var$state = 'restoring';
// There appears to be a delay on iOS where selection still might occur
// after pointer up, so wait a bit before removing user-select.
setTimeout(()=>{
// Wait for any CSS transitions to complete so we don't recompute style
// for the whole page in the middle of the animation and cause jank.
(0, $20aJV$reactariautils.runAfterTransition)(()=>{
// Avoid race conditions
if ($f7e14e656343df57$var$state === 'restoring') {
const documentObject = (0, $20aJV$reactariautils.getOwnerDocument)(target);
if (documentObject.documentElement.style.webkitUserSelect === 'none') documentObject.documentElement.style.webkitUserSelect = $f7e14e656343df57$var$savedUserSelect || '';
$f7e14e656343df57$var$savedUserSelect = '';
$f7e14e656343df57$var$state = 'default';
}
});
}, 300);
} else if (target instanceof HTMLElement || target instanceof SVGElement) // If not iOS, restore the target's original user-select if any
// Ignore state since it doesn't apply for non iOS
{
if (target && $f7e14e656343df57$var$modifiedElementMap.has(target)) {
let targetOldUserSelect = $f7e14e656343df57$var$modifiedElementMap.get(target);
let property = 'userSelect' in target.style ? 'userSelect' : 'webkitUserSelect';
if (target.style[property] === 'none') target.style[property] = targetOldUserSelect;
if (target.getAttribute('style') === '') target.removeAttribute('style');
$f7e14e656343df57$var$modifiedElementMap.delete(target);
}
}
}
//# sourceMappingURL=textSelection.main.js.map
@@ -0,0 +1,35 @@
let list = require('postcss').list
let Value = require('../value')
class CrossFade extends Value {
replace(string, prefix) {
return list
.space(string)
.map(value => {
if (value.slice(0, +this.name.length + 1) !== this.name + '(') {
return value
}
let close = value.lastIndexOf(')')
let after = value.slice(close + 1)
let args = value.slice(this.name.length + 1, close)
if (prefix === '-webkit-') {
let match = args.match(/\d*.?\d+%?/)
if (match) {
args = args.slice(match[0].length).trim()
args += `, ${match[0]}`
} else {
args += ', 0.5'
}
}
return prefix + this.name + '(' + args + ')' + after
})
.join(' ')
}
}
CrossFade.names = ['cross-fade']
module.exports = CrossFade
@@ -0,0 +1,323 @@
export default `flf2a$ 3 3 7 -1 16 0 0 0
Author : MikeChat & myflix
Date : 2006/5/29 18:09:53
Version: 1.1
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $##
o-- #
#
##
"#
#
##
##
#
##
$#
#
##
%#
#
##
&#
#
##
'#
#
##
#
,.-.,#
##
#
\`'-'\`#
##
*#
#
##
#
+ #
##
,#
#
##
#
| #
##
#
. #
##
/#
#
##
___ #
(___)#
##
#
____\\#
##
#
|\`._)#
##
#
(_|_)#
##
__#
__|__#
##
_ #
(_| |#
##
___ #
(_) \`#
##
#
____|#
##
_ _ #
(_|_)#
##
_ #
__(_)#
##
:#
#
##
;#
#
##
<#
#
##
=#
#
##
> >#
#
##
#
o-_)#
##
@#
#
##
____ #
__|_)#
##
___ #
(_|_)#
##
___ #
( )#
##
___ #
( )#
\`-' ##
___ #
| ' |#
##
____ #
' |#
##
___ #
( )#
\`| ##
_____#
__|__#
##
|___|#
| |#
##
( #
\`--|#
##
_____#
/\\ #
..' ##
____#
| #
##
_____#
____<#
##
_____#
___/_#
##
.-. #
( )#
\`-' ##
____ #
(_)#
##
___ #
(.__)#
' ##
____ #
_/(_)#
##
_ #
(_/ )#
##
____|#
|#
##
____#
(____#
##
____#
<____#
##
____#
(____#
(____##
_ _#
\\_/ #
_/ \\_##
____/#
\\#
##
_ #
| \\_|#
##
___ #
' '#
##
\\#
#
##
#
,___,#
##
#
> #
##
#
| #
##
\`#
#
##
_ #
_|) #
##
__ #
(_) #
##
_ #
| | #
##
_ #
(_)_#
##
_ #
(|) #
##
__ #
|) #
##
_ #
((_) #
##
___ #
_) #
##
#
--o #
##
#
(__ #
##
___ #
/\\ #
##
___ #
#
##
__ #
__< #
##
__. #
__) #
##
_ #
(_) #
##
__ #
(_) #
##
_ #
_(_) #
##
___ #
) #
##
#
(/) #
##
_,_#
( ' #
##
__ #
(__ #
##
__ #
<__ #
##
__ #
(_ #
(__ ##
\\,/ #
/\`\\ #
##
#
(_/_ #
##
#
|\\| #
##
#
,-'-,#
##
#
#
_ ##
#
\`-.-\`#
##
~#
#
##
�#
#
##
�#
#
##
�#
#
##
�#
#
##
�#
#
##
�#
#
##
�#
#
##`
@@ -0,0 +1,12 @@
import { Rule } from 'eslint';
import type { ESLintSettings, Extension } from './types';
declare function ignore(path: string, context: Rule.RuleContext): boolean;
declare function getFileExtensions(settings: ESLintSettings): Set<Extension>;
declare function hasValidExtension(path: string, context: Rule.RuleContext): path is `${string}${Extension}`;
export default ignore;
export { getFileExtensions, hasValidExtension }
@@ -0,0 +1,29 @@
const {dirname} = require('path')
const findMade = (opts, parent, path = undefined) => {
// we never want the 'made' return value to be a root directory
if (path === parent)
return Promise.resolve()
return opts.statAsync(parent).then(
st => st.isDirectory() ? path : undefined, // will fail later
er => er.code === 'ENOENT'
? findMade(opts, dirname(parent), parent)
: undefined
)
}
const findMadeSync = (opts, parent, path = undefined) => {
if (path === parent)
return undefined
try {
return opts.statSync(parent).isDirectory() ? path : undefined
} catch (er) {
return er.code === 'ENOENT'
? findMadeSync(opts, dirname(parent), parent)
: undefined
}
}
module.exports = {findMade, findMadeSync}
@@ -0,0 +1,51 @@
import test from 'tape';
import { elementType } from 'jsx-ast-utils';
import isAbstractRole from '../../../src/util/isAbstractRole';
import {
genElementSymbol,
genAbstractRoleElements,
genNonAbstractRoleElements,
} from '../../../__mocks__/genInteractives';
test('isAbstractRole', (t) => {
t.equal(
isAbstractRole(undefined, []),
false,
'does NOT identify JSX Components (no tagName) as abstract role elements',
);
t.test('elements with an abstract role', (st) => {
genAbstractRoleElements().forEach(({ openingElement }) => {
const { attributes } = openingElement;
st.equal(
isAbstractRole(
elementType(openingElement),
attributes,
),
true,
`identifies \`${genElementSymbol(openingElement)}\` as an abstract role element`,
);
});
st.end();
});
t.test('elements with a non-abstract role', (st) => {
genNonAbstractRoleElements().forEach(({ openingElement }) => {
const { attributes } = openingElement;
st.equal(
isAbstractRole(
elementType(openingElement),
attributes,
),
false,
`does NOT identify \`${genElementSymbol(openingElement)}\` as an abstract role element`,
);
});
st.end();
});
t.end();
});
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,iBAAiB,CAAC;IAC7E,qBAAqB,CAAC,wDAAqD,CAAC;IAC5E,UAAU,CAAC,SAAS,CAAC;IACrB,eAAe,CAAC,+BAA+B,CAAC;IAChD,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,2BAA2B,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,qBAAqB,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,qBAAqB,CAAC;QAAA,GAAG,CAAC,CAAC;IACvP,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,aAAa,CAAC;AACvD","sources":["packages/@react-aria/grid/intl/it-IT.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} non selezionato.\",\n \"longPressToSelect\": \"Premi a lungo per passare alla modalità di selezione.\",\n \"select\": \"Seleziona\",\n \"selectedAll\": \"Tutti gli elementi selezionati.\",\n \"selectedCount\": \"{count, plural, =0 {Nessun elemento selezionato} one {# elemento selezionato} other {# elementi selezionati}}.\",\n \"selectedItem\": \"{item} selezionato.\"\n}\n"],"names":[],"version":3,"file":"it-IT.main.js.map"}
@@ -0,0 +1,2 @@
import type { Transform } from '@dnd-kit/utilities';
export declare function parseTransform(transform: string): Transform | null;
@@ -0,0 +1,270 @@
'use strict';
var URI = require('uri-js')
, equal = require('fast-deep-equal')
, util = require('./util')
, SchemaObject = require('./schema_obj')
, traverse = require('json-schema-traverse');
module.exports = resolve;
resolve.normalizeId = normalizeId;
resolve.fullPath = getFullPath;
resolve.url = resolveUrl;
resolve.ids = resolveIds;
resolve.inlineRef = inlineRef;
resolve.schema = resolveSchema;
/**
* [resolve and compile the references ($ref)]
* @this Ajv
* @param {Function} compile reference to schema compilation funciton (localCompile)
* @param {Object} root object with information about the root schema for the current schema
* @param {String} ref reference to resolve
* @return {Object|Function} schema object (if the schema can be inlined) or validation function
*/
function resolve(compile, root, ref) {
/* jshint validthis: true */
var refVal = this._refs[ref];
if (typeof refVal == 'string') {
if (this._refs[refVal]) refVal = this._refs[refVal];
else return resolve.call(this, compile, root, refVal);
}
refVal = refVal || this._schemas[ref];
if (refVal instanceof SchemaObject) {
return inlineRef(refVal.schema, this._opts.inlineRefs)
? refVal.schema
: refVal.validate || this._compile(refVal);
}
var res = resolveSchema.call(this, root, ref);
var schema, v, baseId;
if (res) {
schema = res.schema;
root = res.root;
baseId = res.baseId;
}
if (schema instanceof SchemaObject) {
v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);
} else if (schema !== undefined) {
v = inlineRef(schema, this._opts.inlineRefs)
? schema
: compile.call(this, schema, root, undefined, baseId);
}
return v;
}
/**
* Resolve schema, its root and baseId
* @this Ajv
* @param {Object} root root object with properties schema, refVal, refs
* @param {String} ref reference to resolve
* @return {Object} object with properties schema, root, baseId
*/
function resolveSchema(root, ref) {
/* jshint validthis: true */
var p = URI.parse(ref)
, refPath = _getFullPath(p)
, baseId = getFullPath(this._getId(root.schema));
if (Object.keys(root.schema).length === 0 || refPath !== baseId) {
var id = normalizeId(refPath);
var refVal = this._refs[id];
if (typeof refVal == 'string') {
return resolveRecursive.call(this, root, refVal, p);
} else if (refVal instanceof SchemaObject) {
if (!refVal.validate) this._compile(refVal);
root = refVal;
} else {
refVal = this._schemas[id];
if (refVal instanceof SchemaObject) {
if (!refVal.validate) this._compile(refVal);
if (id == normalizeId(ref))
return { schema: refVal, root: root, baseId: baseId };
root = refVal;
} else {
return;
}
}
if (!root.schema) return;
baseId = getFullPath(this._getId(root.schema));
}
return getJsonPointer.call(this, p, baseId, root.schema, root);
}
/* @this Ajv */
function resolveRecursive(root, ref, parsedRef) {
/* jshint validthis: true */
var res = resolveSchema.call(this, root, ref);
if (res) {
var schema = res.schema;
var baseId = res.baseId;
root = res.root;
var id = this._getId(schema);
if (id) baseId = resolveUrl(baseId, id);
return getJsonPointer.call(this, parsedRef, baseId, schema, root);
}
}
var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);
/* @this Ajv */
function getJsonPointer(parsedRef, baseId, schema, root) {
/* jshint validthis: true */
parsedRef.fragment = parsedRef.fragment || '';
if (parsedRef.fragment.slice(0,1) != '/') return;
var parts = parsedRef.fragment.split('/');
for (var i = 1; i < parts.length; i++) {
var part = parts[i];
if (part) {
part = util.unescapeFragment(part);
schema = schema[part];
if (schema === undefined) break;
var id;
if (!PREVENT_SCOPE_CHANGE[part]) {
id = this._getId(schema);
if (id) baseId = resolveUrl(baseId, id);
if (schema.$ref) {
var $ref = resolveUrl(baseId, schema.$ref);
var res = resolveSchema.call(this, root, $ref);
if (res) {
schema = res.schema;
root = res.root;
baseId = res.baseId;
}
}
}
}
}
if (schema !== undefined && schema !== root.schema)
return { schema: schema, root: root, baseId: baseId };
}
var SIMPLE_INLINED = util.toHash([
'type', 'format', 'pattern',
'maxLength', 'minLength',
'maxProperties', 'minProperties',
'maxItems', 'minItems',
'maximum', 'minimum',
'uniqueItems', 'multipleOf',
'required', 'enum'
]);
function inlineRef(schema, limit) {
if (limit === false) return false;
if (limit === undefined || limit === true) return checkNoRef(schema);
else if (limit) return countKeys(schema) <= limit;
}
function checkNoRef(schema) {
var item;
if (Array.isArray(schema)) {
for (var i=0; i<schema.length; i++) {
item = schema[i];
if (typeof item == 'object' && !checkNoRef(item)) return false;
}
} else {
for (var key in schema) {
if (key == '$ref') return false;
item = schema[key];
if (typeof item == 'object' && !checkNoRef(item)) return false;
}
}
return true;
}
function countKeys(schema) {
var count = 0, item;
if (Array.isArray(schema)) {
for (var i=0; i<schema.length; i++) {
item = schema[i];
if (typeof item == 'object') count += countKeys(item);
if (count == Infinity) return Infinity;
}
} else {
for (var key in schema) {
if (key == '$ref') return Infinity;
if (SIMPLE_INLINED[key]) {
count++;
} else {
item = schema[key];
if (typeof item == 'object') count += countKeys(item) + 1;
if (count == Infinity) return Infinity;
}
}
}
return count;
}
function getFullPath(id, normalize) {
if (normalize !== false) id = normalizeId(id);
var p = URI.parse(id);
return _getFullPath(p);
}
function _getFullPath(p) {
return URI.serialize(p).split('#')[0] + '#';
}
var TRAILING_SLASH_HASH = /#\/?$/;
function normalizeId(id) {
return id ? id.replace(TRAILING_SLASH_HASH, '') : '';
}
function resolveUrl(baseId, id) {
id = normalizeId(id);
return URI.resolve(baseId, id);
}
/* @this Ajv */
function resolveIds(schema) {
var schemaId = normalizeId(this._getId(schema));
var baseIds = {'': schemaId};
var fullPaths = {'': getFullPath(schemaId, false)};
var localRefs = {};
var self = this;
traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
if (jsonPtr === '') return;
var id = self._getId(sch);
var baseId = baseIds[parentJsonPtr];
var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;
if (keyIndex !== undefined)
fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));
if (typeof id == 'string') {
id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id);
var refVal = self._refs[id];
if (typeof refVal == 'string') refVal = self._refs[refVal];
if (refVal && refVal.schema) {
if (!equal(sch, refVal.schema))
throw new Error('id "' + id + '" resolves to more than one schema');
} else if (id != normalizeId(fullPath)) {
if (id[0] == '#') {
if (localRefs[id] && !equal(sch, localRefs[id]))
throw new Error('id "' + id + '" resolves to more than one schema');
localRefs[id] = sch;
} else {
self._refs[id] = fullPath;
}
}
}
baseIds[jsonPtr] = baseId;
fullPaths[jsonPtr] = fullPath;
});
return localRefs;
}
@@ -0,0 +1,16 @@
'use strict';
module.exports = function isSameType(x, y) {
if (x === y) {
return true;
}
if (typeof x === typeof y) {
if (typeof x !== 'object' || typeof y !== 'object') {
return true;
}
return !!x === !!y;
}
return false;
};
@@ -0,0 +1,67 @@
import * as react from 'react';
import { ReactNode } from 'react';
import * as _heroui_system from '@heroui/system';
import { PropGetter, HTMLHeroUIProps } from '@heroui/system';
import { AvatarGroupVariantProps, SlotsToClasses, AvatarGroupSlots } from '@heroui/theme';
import { ReactRef } from '@heroui/react-utils';
import { AvatarProps } from './avatar.js';
import './use-avatar.js';
import 'tailwind-variants';
interface Props extends HTMLHeroUIProps<"div"> {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLDivElement | null>;
/**
* Whether the avatars should be displayed in a grid
*/
isGrid?: boolean;
/**
* The maximum number of visible avatars
* @default 5
*/
max?: number;
/**
* Control the number of avatar not visible
*/
total?: number;
/**
* This allows you to render a custom count component.
*/
renderCount?: (count: number) => ReactNode;
/**
* Classname or List of classes to change the classNames of the avatar group.
* if `className` is passed, it will be added to the base slot.
*
* @example
* ```ts
* <AvatarGroup classNames={{
* base: "base-classes",
* count: "count-classes"
* }} />
* ```
*/
classNames?: SlotsToClasses<AvatarGroupSlots>;
}
type UseAvatarGroupProps = Props & Omit<AvatarGroupVariantProps, "children" | "isGrid"> & Partial<Pick<AvatarProps, "size" | "color" | "radius" | "isDisabled" | "isBordered">>;
type ContextType = {
size?: AvatarProps["size"];
color?: AvatarProps["color"];
radius?: AvatarProps["radius"];
isGrid?: boolean;
isBordered?: AvatarProps["isBordered"];
isDisabled?: AvatarProps["isDisabled"];
};
declare function useAvatarGroup(props?: UseAvatarGroupProps): {
Component: _heroui_system.As<any>;
context: ContextType;
remainingCount: number;
clones: react.ReactElement<any, string | react.JSXElementConstructor<any>>[];
renderCount: ((count: number) => ReactNode) | undefined;
getAvatarGroupProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getAvatarGroupCountProps: () => AvatarProps;
};
type UseAvatarReturn = ReturnType<typeof useAvatarGroup>;
export { ContextType, UseAvatarGroupProps, UseAvatarReturn, useAvatarGroup };
@@ -0,0 +1,40 @@
'use strict';
var $gOPD = require('gopd');
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var hasOwn = require('hasown');
var callBound = require('call-bound');
var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
var IsArray = require('./IsArray');
var isPropertyKey = require('../helpers/isPropertyKey');
var IsRegExp = require('./IsRegExp');
var ToPropertyDescriptor = require('./ToPropertyDescriptor');
// https://262.ecma-international.org/6.0/#sec-ordinarygetownproperty
module.exports = function OrdinaryGetOwnProperty(O, P) {
if (!isObject(O)) {
throw new $TypeError('Assertion failed: O must be an Object');
}
if (!isPropertyKey(P)) {
throw new $TypeError('Assertion failed: P must be a Property Key');
}
if (!hasOwn(O, P)) {
return void 0;
}
if (!$gOPD) {
// ES3 / IE 8 fallback
var arrayLength = IsArray(O) && P === 'length';
var regexLastIndex = IsRegExp(O) && P === 'lastIndex';
return {
'[[Configurable]]': !(arrayLength || regexLastIndex),
'[[Enumerable]]': $isEnumerable(O, P),
'[[Value]]': O[P],
'[[Writable]]': true
};
}
return ToPropertyDescriptor($gOPD(O, P));
};
@@ -0,0 +1,6 @@
import { CreateType } from '../create/type.mjs';
import { Kind } from '../symbols/index.mjs';
/** `[JavaScript]` Creates a Symbol type */
export function Symbol(options) {
return CreateType({ [Kind]: 'Symbol', type: 'symbol' }, options);
}
@@ -0,0 +1,214 @@
import { resolveBlockScalar } from '../compose/resolve-block-scalar.js';
import { resolveFlowScalar } from '../compose/resolve-flow-scalar.js';
import { YAMLParseError } from '../errors.js';
import { stringifyString } from '../stringify/stringifyString.js';
function resolveAsScalar(token, strict = true, onError) {
if (token) {
const _onError = (pos, code, message) => {
const offset = typeof pos === 'number' ? pos : Array.isArray(pos) ? pos[0] : pos.offset;
if (onError)
onError(offset, code, message);
else
throw new YAMLParseError([offset, offset + 1], code, message);
};
switch (token.type) {
case 'scalar':
case 'single-quoted-scalar':
case 'double-quoted-scalar':
return resolveFlowScalar(token, strict, _onError);
case 'block-scalar':
return resolveBlockScalar({ options: { strict } }, token, _onError);
}
}
return null;
}
/**
* Create a new scalar token with `value`
*
* Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
* as this function does not support any schema operations and won't check for such conflicts.
*
* @param value The string representation of the value, which will have its content properly indented.
* @param context.end Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added.
* @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
* @param context.indent The indent level of the token.
* @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value.
* @param context.offset The offset position of the token.
* @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
*/
function createScalarToken(value, context) {
const { implicitKey = false, indent, inFlow = false, offset = -1, type = 'PLAIN' } = context;
const source = stringifyString({ type, value }, {
implicitKey,
indent: indent > 0 ? ' '.repeat(indent) : '',
inFlow,
options: { blockQuote: true, lineWidth: -1 }
});
const end = context.end ?? [
{ type: 'newline', offset: -1, indent, source: '\n' }
];
switch (source[0]) {
case '|':
case '>': {
const he = source.indexOf('\n');
const head = source.substring(0, he);
const body = source.substring(he + 1) + '\n';
const props = [
{ type: 'block-scalar-header', offset, indent, source: head }
];
if (!addEndtoBlockProps(props, end))
props.push({ type: 'newline', offset: -1, indent, source: '\n' });
return { type: 'block-scalar', offset, indent, props, source: body };
}
case '"':
return { type: 'double-quoted-scalar', offset, indent, source, end };
case "'":
return { type: 'single-quoted-scalar', offset, indent, source, end };
default:
return { type: 'scalar', offset, indent, source, end };
}
}
/**
* Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have.
*
* Best efforts are made to retain any comments previously associated with the `token`,
* though all contents within a collection's `items` will be overwritten.
*
* Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
* as this function does not support any schema operations and won't check for such conflicts.
*
* @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key.
* @param value The string representation of the value, which will have its content properly indented.
* @param context.afterKey In most cases, values after a key should have an additional level of indentation.
* @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
* @param context.inFlow Being within a flow collection may affect the resolved type of the token's value.
* @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
*/
function setScalarValue(token, value, context = {}) {
let { afterKey = false, implicitKey = false, inFlow = false, type } = context;
let indent = 'indent' in token ? token.indent : null;
if (afterKey && typeof indent === 'number')
indent += 2;
if (!type)
switch (token.type) {
case 'single-quoted-scalar':
type = 'QUOTE_SINGLE';
break;
case 'double-quoted-scalar':
type = 'QUOTE_DOUBLE';
break;
case 'block-scalar': {
const header = token.props[0];
if (header.type !== 'block-scalar-header')
throw new Error('Invalid block scalar header');
type = header.source[0] === '>' ? 'BLOCK_FOLDED' : 'BLOCK_LITERAL';
break;
}
default:
type = 'PLAIN';
}
const source = stringifyString({ type, value }, {
implicitKey: implicitKey || indent === null,
indent: indent !== null && indent > 0 ? ' '.repeat(indent) : '',
inFlow,
options: { blockQuote: true, lineWidth: -1 }
});
switch (source[0]) {
case '|':
case '>':
setBlockScalarValue(token, source);
break;
case '"':
setFlowScalarValue(token, source, 'double-quoted-scalar');
break;
case "'":
setFlowScalarValue(token, source, 'single-quoted-scalar');
break;
default:
setFlowScalarValue(token, source, 'scalar');
}
}
function setBlockScalarValue(token, source) {
const he = source.indexOf('\n');
const head = source.substring(0, he);
const body = source.substring(he + 1) + '\n';
if (token.type === 'block-scalar') {
const header = token.props[0];
if (header.type !== 'block-scalar-header')
throw new Error('Invalid block scalar header');
header.source = head;
token.source = body;
}
else {
const { offset } = token;
const indent = 'indent' in token ? token.indent : -1;
const props = [
{ type: 'block-scalar-header', offset, indent, source: head }
];
if (!addEndtoBlockProps(props, 'end' in token ? token.end : undefined))
props.push({ type: 'newline', offset: -1, indent, source: '\n' });
for (const key of Object.keys(token))
if (key !== 'type' && key !== 'offset')
delete token[key];
Object.assign(token, { type: 'block-scalar', indent, props, source: body });
}
}
/** @returns `true` if last token is a newline */
function addEndtoBlockProps(props, end) {
if (end)
for (const st of end)
switch (st.type) {
case 'space':
case 'comment':
props.push(st);
break;
case 'newline':
props.push(st);
return true;
}
return false;
}
function setFlowScalarValue(token, source, type) {
switch (token.type) {
case 'scalar':
case 'double-quoted-scalar':
case 'single-quoted-scalar':
token.type = type;
token.source = source;
break;
case 'block-scalar': {
const end = token.props.slice(1);
let oa = source.length;
if (token.props[0].type === 'block-scalar-header')
oa -= token.props[0].source.length;
for (const tok of end)
tok.offset += oa;
delete token.props;
Object.assign(token, { type, source, end });
break;
}
case 'block-map':
case 'block-seq': {
const offset = token.offset + source.length;
const nl = { type: 'newline', offset, indent: token.indent, source: '\n' };
delete token.items;
Object.assign(token, { type, source, end: [nl] });
break;
}
default: {
const indent = 'indent' in token ? token.indent : -1;
const end = 'end' in token && Array.isArray(token.end)
? token.end.filter(st => st.type === 'space' ||
st.type === 'comment' ||
st.type === 'newline')
: [];
for (const key of Object.keys(token))
if (key !== 'type' && key !== 'offset')
delete token[key];
Object.assign(token, { type, indent, source, end });
}
}
}
export { createScalarToken, resolveAsScalar, setScalarValue };
@@ -0,0 +1,8 @@
var $c4a1b1eabeaa87be$exports = {};
$c4a1b1eabeaa87be$exports = {
"longPressMessage": `Appuyez de mani\xe8re prolong\xe9e ou appuyez sur Alt\xa0+\xa0Fl\xe8che vers le bas pour ouvrir le menu.`
};
export {$c4a1b1eabeaa87be$exports as default};
//# sourceMappingURL=fr-FR.module.js.map
@@ -0,0 +1,34 @@
var chain = require('./chain');
/**
* Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
*
* @name chain
* @memberOf _
* @since 0.1.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* // A sequence without explicit chaining.
* _(users).head();
* // => { 'user': 'barney', 'age': 36 }
*
* // A sequence with explicit chaining.
* _(users)
* .chain()
* .head()
* .pick('user')
* .value();
* // => { 'user': 'barney' }
*/
function wrapperChain() {
return chain(this);
}
module.exports = wrapperChain;
@@ -0,0 +1,6 @@
module.exports = {
"longPressMessage": `Men\xfcy\xfc a\xe7mak i\xe7in uzun bas\u{131}n veya Alt + A\u{15F}a\u{11F}\u{131} Ok tu\u{15F}una bas\u{131}n`
};
//# sourceMappingURL=tr-TR.main.js.map
@@ -0,0 +1,142 @@
'use strict';
var util = require('./util');
var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
var DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31];
var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
var HOSTNAME = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;
var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d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\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
// uri-template: https://tools.ietf.org/html/rfc6570
var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;
// For the source: https://gist.github.com/dperini/729294
// For test cases: https://mathiasbynens.be/demo/url-regex
// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.
// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;
var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;
var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
module.exports = formats;
function formats(mode) {
mode = mode == 'full' ? 'full' : 'fast';
return util.copy(formats[mode]);
}
formats.fast = {
// date: http://tools.ietf.org/html/rfc3339#section-5.6
date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/,
// date-time: http://tools.ietf.org/html/rfc3339#section-5.6
time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,
'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,
// uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
'uri-template': URITEMPLATE,
url: URL,
// email (sources from jsen validator):
// http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
// http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')
email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,
hostname: HOSTNAME,
// optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
// optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses
ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
regex: regex,
// uuid: http://tools.ietf.org/html/rfc4122
uuid: UUID,
// JSON-pointer: https://tools.ietf.org/html/rfc6901
// uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
'json-pointer': JSON_POINTER,
'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
// relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
'relative-json-pointer': RELATIVE_JSON_POINTER
};
formats.full = {
date: date,
time: time,
'date-time': date_time,
uri: uri,
'uri-reference': URIREF,
'uri-template': URITEMPLATE,
url: URL,
email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
hostname: HOSTNAME,
ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
regex: regex,
uuid: UUID,
'json-pointer': JSON_POINTER,
'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
'relative-json-pointer': RELATIVE_JSON_POINTER
};
function isLeapYear(year) {
// https://tools.ietf.org/html/rfc3339#appendix-C
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
}
function date(str) {
// full-date from http://tools.ietf.org/html/rfc3339#section-5.6
var matches = str.match(DATE);
if (!matches) return false;
var year = +matches[1];
var month = +matches[2];
var day = +matches[3];
return month >= 1 && month <= 12 && day >= 1 &&
day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);
}
function time(str, full) {
var matches = str.match(TIME);
if (!matches) return false;
var hour = matches[1];
var minute = matches[2];
var second = matches[3];
var timeZone = matches[5];
return ((hour <= 23 && minute <= 59 && second <= 59) ||
(hour == 23 && minute == 59 && second == 60)) &&
(!full || timeZone);
}
var DATE_TIME_SEPARATOR = /t|\s/i;
function date_time(str) {
// http://tools.ietf.org/html/rfc3339#section-5.6
var dateTime = str.split(DATE_TIME_SEPARATOR);
return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true);
}
var NOT_URI_FRAGMENT = /\/|:/;
function uri(str) {
// http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
return NOT_URI_FRAGMENT.test(str) && URI.test(str);
}
var Z_ANCHOR = /[^\\]\\Z/;
function regex(str) {
if (Z_ANCHOR.test(str)) return false;
try {
new RegExp(str);
return true;
} catch(e) {
return false;
}
}
@@ -0,0 +1,51 @@
import type { TSchema, SchemaOptions } from '../schema/index';
import type { Static } from '../static/index';
import type { Evaluate, UnionToTuple } from '../helpers/index';
import type { TReadonly } from '../readonly/index';
import type { TOptional } from '../optional/index';
import { Kind } from '../symbols/index';
type ReadonlyOptionalPropertyKeys<T extends TProperties> = {
[K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? K : never) : never;
}[keyof T];
type ReadonlyPropertyKeys<T extends TProperties> = {
[K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? never : K) : never;
}[keyof T];
type OptionalPropertyKeys<T extends TProperties> = {
[K in keyof T]: T[K] extends TOptional<TSchema> ? (T[K] extends TReadonly<T[K]> ? never : K) : never;
}[keyof T];
type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
type ObjectStaticProperties<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
type ObjectStatic<T extends TProperties, P extends unknown[]> = ObjectStaticProperties<T, {
[K in keyof T]: Static<T[K], P>;
}>;
export type TPropertyKey = string | number;
export type TProperties = Record<TPropertyKey, TSchema>;
type TIsLiteralString<Type extends string> = ([
Type
] extends [string] ? [string] extends [Type] ? false : true : false);
type IsRequiredArrayLiteralConstant<RequiredTuple extends string[]> = (RequiredTuple extends [infer Left extends string, ...infer _ extends string[]] ? TIsLiteralString<Left> : false);
type TRequiredArray<Properties extends TProperties, RequiredProperties extends TProperties = {
[Key in keyof Properties as Properties[Key] extends TOptional<Properties[Key]> ? never : Key]: Properties[Key];
}, RequiredUnion extends string = Extract<keyof RequiredProperties, string>, RequiredTuple extends string[] = UnionToTuple<RequiredUnion>, Result extends string[] | undefined = (IsRequiredArrayLiteralConstant<RequiredTuple> extends true ? RequiredTuple : string[] | undefined)> = Result;
export type TAdditionalProperties = undefined | TSchema | boolean;
export interface ObjectOptions extends SchemaOptions {
/** Additional property constraints for this object */
additionalProperties?: TAdditionalProperties;
/** The minimum number of properties allowed on this object */
minProperties?: number;
/** The maximum number of properties allowed on this object */
maxProperties?: number;
}
export interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
[Kind]: 'Object';
static: ObjectStatic<T, this['params']>;
additionalProperties?: TAdditionalProperties;
type: 'object';
properties: T;
required: TRequiredArray<T>;
}
/** `[Json]` Creates an Object type */
declare function _Object<T extends TProperties>(properties: T, options?: ObjectOptions): TObject<T>;
/** `[Json]` Creates an Object type */
export declare var Object: typeof _Object;
export {};
@@ -0,0 +1,24 @@
# @heroui/card
Card is a container for text, photos, and actions in the context of a single subject.
Please refer to the [documentation](https://heroui.com/docs/components/card) for more information.
## Installation
```sh
yarn add @heroui/card
# or
npm i @heroui/card
```
## 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,169 @@
/**
* @fileoverview Forbid "button" element without an explicit "type" attribute
* @author Filipp Riabchun
*/
'use strict';
const getProp = require('jsx-ast-utils/getProp');
const getLiteralPropValue = require('jsx-ast-utils/getLiteralPropValue');
const docsUrl = require('../util/docsUrl');
const isCreateElement = require('../util/isCreateElement');
const report = require('../util/report');
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
const optionDefaults = {
button: true,
submit: true,
reset: true,
};
const messages = {
missingType: 'Missing an explicit type attribute for button',
complexType: 'The button type attribute must be specified by a static string or a trivial ternary expression',
invalidValue: '"{{value}}" is an invalid value for button type attribute',
forbiddenValue: '"{{value}}" is an invalid value for button type attribute',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Disallow usage of `button` elements without an explicit `type` attribute',
category: 'Possible Errors',
recommended: false,
url: docsUrl('button-has-type'),
},
messages,
schema: [{
type: 'object',
properties: {
button: {
default: optionDefaults.button,
type: 'boolean',
},
submit: {
default: optionDefaults.submit,
type: 'boolean',
},
reset: {
default: optionDefaults.reset,
type: 'boolean',
},
},
additionalProperties: false,
}],
},
create(context) {
const configuration = Object.assign({}, optionDefaults, context.options[0]);
function reportMissing(node) {
report(context, messages.missingType, 'missingType', {
node,
});
}
function reportComplex(node) {
report(context, messages.complexType, 'complexType', {
node,
});
}
function checkValue(node, value) {
if (!(value in configuration)) {
report(context, messages.invalidValue, 'invalidValue', {
node,
data: {
value,
},
});
} else if (!configuration[value]) {
report(context, messages.forbiddenValue, 'forbiddenValue', {
node,
data: {
value,
},
});
}
}
function checkExpression(node, expression) {
switch (expression.type) {
case 'Literal':
checkValue(node, expression.value);
return;
case 'TemplateLiteral':
if (expression.expressions.length === 0) {
checkValue(node, expression.quasis[0].value.raw);
} else {
reportComplex(expression);
}
return;
case 'ConditionalExpression':
checkExpression(node, expression.consequent);
checkExpression(node, expression.alternate);
return;
default:
reportComplex(expression);
}
}
return {
JSXElement(node) {
if (node.openingElement.name.name !== 'button') {
return;
}
const typeProp = getProp(node.openingElement.attributes, 'type');
if (!typeProp) {
reportMissing(node);
return;
}
if (typeProp.value && typeProp.value.type === 'JSXExpressionContainer') {
checkExpression(node, typeProp.value.expression);
return;
}
const propValue = getLiteralPropValue(typeProp);
checkValue(node, propValue);
},
CallExpression(node) {
if (!isCreateElement(context, node) || node.arguments.length < 1) {
return;
}
if (node.arguments[0].type !== 'Literal' || node.arguments[0].value !== 'button') {
return;
}
if (!node.arguments[1] || node.arguments[1].type !== 'ObjectExpression') {
reportMissing(node);
return;
}
const props = node.arguments[1].properties;
const typeProp = props.find((prop) => (
'key' in prop
&& prop.key
&& 'name' in prop.key
&& prop.key.name === 'type'
));
if (!typeProp) {
reportMissing(node);
return;
}
checkExpression(node, 'value' in typeProp ? typeProp.value : undefined);
},
};
},
};
@@ -0,0 +1,3 @@
import type { TSESLint } from '@typescript-eslint/utils';
declare const _default: TSESLint.RuleModule<"interfaceOverType" | "typeOverInterface", [string], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener>;
export default _default;
@@ -0,0 +1,153 @@
"use strict";
// Some environments don't have global Buffer (e.g. React Native).
// Solution would be installing npm modules "buffer" and "stream" explicitly.
var Buffer = require("safer-buffer").Buffer;
var bomHandling = require("./bom-handling"),
iconv = module.exports;
// All codecs and aliases are kept here, keyed by encoding name/alias.
// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
iconv.encodings = null;
// Characters emitted in case of error.
iconv.defaultCharUnicode = '�';
iconv.defaultCharSingleByte = '?';
// Public API.
iconv.encode = function encode(str, encoding, options) {
str = "" + (str || ""); // Ensure string.
var encoder = iconv.getEncoder(encoding, options);
var res = encoder.write(str);
var trail = encoder.end();
return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;
}
iconv.decode = function decode(buf, encoding, options) {
if (typeof buf === 'string') {
if (!iconv.skipDecodeWarning) {
console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');
iconv.skipDecodeWarning = true;
}
buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
}
var decoder = iconv.getDecoder(encoding, options);
var res = decoder.write(buf);
var trail = decoder.end();
return trail ? (res + trail) : res;
}
iconv.encodingExists = function encodingExists(enc) {
try {
iconv.getCodec(enc);
return true;
} catch (e) {
return false;
}
}
// Legacy aliases to convert functions
iconv.toEncoding = iconv.encode;
iconv.fromEncoding = iconv.decode;
// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
iconv._codecDataCache = {};
iconv.getCodec = function getCodec(encoding) {
if (!iconv.encodings)
iconv.encodings = require("../encodings"); // Lazy load all encoding definitions.
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
var enc = iconv._canonicalizeEncoding(encoding);
// Traverse iconv.encodings to find actual codec.
var codecOptions = {};
while (true) {
var codec = iconv._codecDataCache[enc];
if (codec)
return codec;
var codecDef = iconv.encodings[enc];
switch (typeof codecDef) {
case "string": // Direct alias to other encoding.
enc = codecDef;
break;
case "object": // Alias with options. Can be layered.
for (var key in codecDef)
codecOptions[key] = codecDef[key];
if (!codecOptions.encodingName)
codecOptions.encodingName = enc;
enc = codecDef.type;
break;
case "function": // Codec itself.
if (!codecOptions.encodingName)
codecOptions.encodingName = enc;
// The codec function must load all tables and return object with .encoder and .decoder methods.
// It'll be called only once (for each different options object).
codec = new codecDef(codecOptions, iconv);
iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
return codec;
default:
throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
}
}
}
iconv._canonicalizeEncoding = function(encoding) {
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
}
iconv.getEncoder = function getEncoder(encoding, options) {
var codec = iconv.getCodec(encoding),
encoder = new codec.encoder(options, codec);
if (codec.bomAware && options && options.addBOM)
encoder = new bomHandling.PrependBOM(encoder, options);
return encoder;
}
iconv.getDecoder = function getDecoder(encoding, options) {
var codec = iconv.getCodec(encoding),
decoder = new codec.decoder(options, codec);
if (codec.bomAware && !(options && options.stripBOM === false))
decoder = new bomHandling.StripBOM(decoder, options);
return decoder;
}
// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json.
var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node;
if (nodeVer) {
// Load streaming support in Node v0.10+
var nodeVerArr = nodeVer.split(".").map(Number);
if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {
require("./streams")(iconv);
}
// Load Node primitive extensions.
require("./extend-node")(iconv);
}
if ("Ā" != "\u0100") {
console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.");
}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AA8BM,SAAS,0CAAqB,KAAiC,EAAE,KAAuB,EAAE,GAAkC;IACjI,IAAI,cAAC,UAAU,EAAC,GAAG;IACnB,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,kCAAS,EAAE,OAAO;IAEvC,OAAO;QACL,YAAY;YACV,GAAG,YAAY;YACf,MAAM,MAAM,aAAa,KAAK,WAAW,eAAe,aAAa,IAAI;YACzE,iBAAiB;QACnB;IACF;AACF;AAgBO,SAAS,0CAAyB,KAAoD,EAAE,KAAuB,EAAE,GAAmB;IACzI,IAAI,cAA2B;QAC7B,YAAY,MAAM,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE;QAC3C,aAAY,UAAU;YACpB,MAAM,WAAW,CAAC,MAAM,EAAE,EAAE;QAC9B;QACA;YACE,MAAM,SAAS,CAAC,MAAM,EAAE;QAC1B;IACF;IAEA,IAAI,aAAC,SAAS,cAAE,UAAU,cAAE,UAAU,eAAE,WAAW,EAAC,GAAG,CAAA,GAAA,yCAAc,EAAE;QACrE,GAAG,KAAK;QACR,IAAI;QACJ,YAAY,MAAM,UAAU,IAAI,MAAM,UAAU;IAClD,GAAG,aAAa;IAChB,IAAI,MAAM,aAAa,KAAK,UAAU;QACpC,YAAY,IAAI,GAAG;QACnB,WAAW,CAAC,eAAe,GAAG,YAAY,UAAU;QACpD,OAAO,WAAW,CAAC,eAAe;IACpC;IAEA,OAAO;mBACL;oBACA;oBACA;qBACA;IACF;AACF","sources":["packages/@react-aria/button/src/useToggleButtonGroup.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n AnchorHTMLAttributes,\n ButtonHTMLAttributes,\n ElementType,\n HTMLAttributes,\n InputHTMLAttributes\n} from 'react';\nimport {AriaLabelingProps, DOMAttributes, Orientation, RefObject} from '@react-types/shared';\nimport {AriaToggleButtonGroupItemProps} from '@react-types/button';\nimport {ToggleButtonAria, useToggleButton} from './useToggleButton';\nimport {ToggleGroupProps, ToggleGroupState, ToggleState} from '@react-stately/toggle';\nimport {useToolbar} from '@react-aria/toolbar';\n\nexport interface AriaToggleButtonGroupProps extends ToggleGroupProps, AriaLabelingProps {\n /**\n * The orientation of the the toggle button group.\n * @default 'horizontal'\n */\n orientation?: Orientation\n}\n\nexport interface ToggleButtonGroupAria {\n /**\n * Props for the toggle button group container.\n */\n groupProps: DOMAttributes\n}\n\nexport function useToggleButtonGroup(props: AriaToggleButtonGroupProps, state: ToggleGroupState, ref: RefObject<HTMLElement | null>): ToggleButtonGroupAria {\n let {isDisabled} = props;\n let {toolbarProps} = useToolbar(props, ref);\n\n return {\n groupProps: {\n ...toolbarProps,\n role: state.selectionMode === 'single' ? 'radiogroup' : toolbarProps.role,\n 'aria-disabled': isDisabled\n }\n };\n}\n\nexport type {AriaToggleButtonGroupItemProps};\nexport interface AriaToggleButtonGroupItemOptions<E extends ElementType> extends Omit<AriaToggleButtonGroupItemProps<E>, 'children'> {}\n\n// Order with overrides is important: 'button' should be default\nexport function useToggleButtonGroupItem(props: AriaToggleButtonGroupItemOptions<'button'>, state: ToggleGroupState, ref: RefObject<HTMLButtonElement | null>): ToggleButtonAria<ButtonHTMLAttributes<HTMLButtonElement>>;\nexport function useToggleButtonGroupItem(props: AriaToggleButtonGroupItemOptions<'a'>, state: ToggleGroupState, ref: RefObject<HTMLAnchorElement | null>): ToggleButtonAria<AnchorHTMLAttributes<HTMLAnchorElement>>;\nexport function useToggleButtonGroupItem(props: AriaToggleButtonGroupItemOptions<'div'>, state: ToggleGroupState, ref: RefObject<HTMLDivElement | null>): ToggleButtonAria<HTMLAttributes<HTMLDivElement>>;\nexport function useToggleButtonGroupItem(props: AriaToggleButtonGroupItemOptions<'input'>, state: ToggleGroupState, ref: RefObject<HTMLInputElement | null>): ToggleButtonAria<InputHTMLAttributes<HTMLInputElement>>;\nexport function useToggleButtonGroupItem(props: AriaToggleButtonGroupItemOptions<'span'>, state: ToggleGroupState, ref: RefObject<HTMLSpanElement | null>): ToggleButtonAria<HTMLAttributes<HTMLSpanElement>>;\nexport function useToggleButtonGroupItem(props: AriaToggleButtonGroupItemOptions<ElementType>, state: ToggleGroupState, ref: RefObject<Element | null>): ToggleButtonAria<DOMAttributes>;\n/**\n * Provides the behavior and accessibility implementation for a toggle button component.\n * ToggleButtons allow users to toggle a selection on or off, for example switching between two states or modes.\n */\nexport function useToggleButtonGroupItem(props: AriaToggleButtonGroupItemOptions<ElementType>, state: ToggleGroupState, ref: RefObject<any>): ToggleButtonAria<HTMLAttributes<any>> {\n let toggleState: ToggleState = {\n isSelected: state.selectedKeys.has(props.id),\n setSelected(isSelected) {\n state.setSelected(props.id, isSelected);\n },\n toggle() {\n state.toggleKey(props.id);\n }\n };\n\n let {isPreLine truncated
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const esnext_weakref: LibDefinition;
@@ -0,0 +1,5 @@
import { BindingScope } from './BindingScope';
export interface AutobindOptions {
scope: BindingScope;
}
//# sourceMappingURL=AutobindOptions.d.ts.map
@@ -0,0 +1,72 @@
import { Feature } from '../Feature.mjs';
import { observeIntersection } from './observers.mjs';
const thresholdNames = {
some: 0,
all: 1,
};
class InViewFeature extends Feature {
constructor() {
super(...arguments);
this.hasEnteredView = false;
this.isInView = false;
}
startObserver() {
this.unmount();
const { viewport = {} } = this.node.getProps();
const { root, margin: rootMargin, amount = "some", once } = viewport;
const options = {
root: root ? root.current : undefined,
rootMargin,
threshold: typeof amount === "number" ? amount : thresholdNames[amount],
};
const onIntersectionUpdate = (entry) => {
const { isIntersecting } = entry;
/**
* If there's been no change in the viewport state, early return.
*/
if (this.isInView === isIntersecting)
return;
this.isInView = isIntersecting;
/**
* Handle hasEnteredView. If this is only meant to run once, and
* element isn't visible, early return. Otherwise set hasEnteredView to true.
*/
if (once && !isIntersecting && this.hasEnteredView) {
return;
}
else if (isIntersecting) {
this.hasEnteredView = true;
}
if (this.node.animationState) {
this.node.animationState.setActive("whileInView", isIntersecting);
}
/**
* Use the latest committed props rather than the ones in scope
* when this observer is created
*/
const { onViewportEnter, onViewportLeave } = this.node.getProps();
const callback = isIntersecting ? onViewportEnter : onViewportLeave;
callback && callback(entry);
};
return observeIntersection(this.node.current, options, onIntersectionUpdate);
}
mount() {
this.startObserver();
}
update() {
if (typeof IntersectionObserver === "undefined")
return;
const { props, prevProps } = this.node;
const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps));
if (hasOptionsChanged) {
this.startObserver();
}
}
unmount() { }
}
function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {
return (name) => viewport[name] !== prevViewport[name];
}
export { InViewFeature };
@@ -0,0 +1,17 @@
import {useFormValidation as $e93e671b31057976$export$b8473d3665f3a75a} from "./useFormValidation.mjs";
/*
* Copyright 2023 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.
*/
export {$e93e671b31057976$export$b8473d3665f3a75a as useFormValidation};
//# sourceMappingURL=module.js.map
@@ -0,0 +1,25 @@
/**
* Apple WebAuthn Root CA
*
* Downloaded from https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem
*
* Valid until 2045-03-14 @ 17:00 PST
*
* SHA256 Fingerprint
* 09:15:DD:5C:07:A2:8D:B5:49:D1:F6:77:BB:5A:75:D4:BF:BE:95:61:A7:73:42:43:27:76:2E:9E:02:F9:BB:29
*/
export const Apple_WebAuthn_Root_CA = `-----BEGIN CERTIFICATE-----
MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w
HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ
bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx
NTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG
A1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49
AgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k
xu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/
pcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk
2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA
MGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3
jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B
1bWeT0vT
-----END CERTIFICATE-----
`;
@@ -0,0 +1,171 @@
'use strict';Object.defineProperty(exports, "__esModule", { value: true });var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();var _arrayIncludes = require('array-includes');var _arrayIncludes2 = _interopRequireDefault(_arrayIncludes);
var _eslint = require('eslint');
var _doc = require('./doc');
var _namespace = require('./namespace');var _namespace2 = _interopRequireDefault(_namespace);
var _specifier = require('./specifier');var _specifier2 = _interopRequireDefault(_specifier);
var _captureDependency = require('./captureDependency');
var _patternCapture = require('./patternCapture');var _patternCapture2 = _interopRequireDefault(_patternCapture);
var _remotePath = require('./remotePath');function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}
/**
* sometimes legacy support isn't _that_ hard... right?
*/
function makeSourceCode(text, ast) {
if (_eslint.SourceCode.length > 1) {
// ESLint 3
return new _eslint.SourceCode(text, ast);
} else {
// ESLint 4, 5
return new _eslint.SourceCode({ text: text, ast: ast });
}
}var
ImportExportVisitorBuilder = function () {
function ImportExportVisitorBuilder(
path,
context,
exportMap,
ExportMapBuilder,
content,
ast,
isEsModuleInteropTrue,
thunkFor)
{var _this = this;_classCallCheck(this, ImportExportVisitorBuilder);
this.context = context;
this.namespace = new _namespace2['default'](path, context, ExportMapBuilder);
this.remotePathResolver = new _remotePath.RemotePath(path, context);
this.source = makeSourceCode(content, ast);
this.exportMap = exportMap;
this.ast = ast;
this.isEsModuleInteropTrue = isEsModuleInteropTrue;
this.thunkFor = thunkFor;
var docstyle = this.context.settings && this.context.settings['import/docstyle'] || ['jsdoc'];
this.docStyleParsers = {};
docstyle.forEach(function (style) {
_this.docStyleParsers[style] = _doc.availableDocStyleParsers[style];
});
}_createClass(ImportExportVisitorBuilder, [{ key: 'build', value: function () {function build(
astNode) {var _this3 = this;
return Object.assign({
ExportDefaultDeclaration: function () {function ExportDefaultDeclaration() {
var exportMeta = (0, _doc.captureDoc)(this.source, this.docStyleParsers, astNode);
if (astNode.declaration.type === 'Identifier') {
this.namespace.add(exportMeta, astNode.declaration);
}
this.exportMap.namespace.set('default', exportMeta);
}return ExportDefaultDeclaration;}(),
ExportAllDeclaration: function () {function ExportAllDeclaration() {
var getter = (0, _captureDependency.captureDependency)(astNode, astNode.exportKind === 'type', this.remotePathResolver, this.exportMap, this.context, this.thunkFor);
if (getter) {this.exportMap.dependencies.add(getter);}
if (astNode.exported) {
(0, _specifier2['default'])(astNode, astNode.exported, this.exportMap, this.namespace);
}
}return ExportAllDeclaration;}(),
/** capture namespaces in case of later export */
ImportDeclaration: function () {function ImportDeclaration() {
(0, _captureDependency.captureDependencyWithSpecifiers)(astNode, this.remotePathResolver, this.exportMap, this.context, this.thunkFor);
var ns = astNode.specifiers.find(function (s) {return s.type === 'ImportNamespaceSpecifier';});
if (ns) {
this.namespace.rawSet(ns.local.name, astNode.source.value);
}
}return ImportDeclaration;}(),
ExportNamedDeclaration: function () {function ExportNamedDeclaration() {var _this2 = this;
(0, _captureDependency.captureDependencyWithSpecifiers)(astNode, this.remotePathResolver, this.exportMap, this.context, this.thunkFor);
// capture declaration
if (astNode.declaration != null) {
switch (astNode.declaration.type) {
case 'FunctionDeclaration':
case 'ClassDeclaration':
case 'TypeAlias': // flowtype with babel-eslint parser
case 'InterfaceDeclaration':
case 'DeclareFunction':
case 'TSDeclareFunction':
case 'TSEnumDeclaration':
case 'TSTypeAliasDeclaration':
case 'TSInterfaceDeclaration':
case 'TSAbstractClassDeclaration':
case 'TSModuleDeclaration':
this.exportMap.namespace.set(astNode.declaration.id.name, (0, _doc.captureDoc)(this.source, this.docStyleParsers, astNode));
break;
case 'VariableDeclaration':
astNode.declaration.declarations.forEach(function (d) {
(0, _patternCapture2['default'])(
d.id,
function (id) {return _this2.exportMap.namespace.set(id.name, (0, _doc.captureDoc)(_this2.source, _this2.docStyleParsers, d, astNode));});
});
break;
default:}
}
astNode.specifiers.forEach(function (s) {return (0, _specifier2['default'])(s, astNode, _this2.exportMap, _this2.namespace);});
}return ExportNamedDeclaration;}(),
TSExportAssignment: function () {function TSExportAssignment() {return _this3.typeScriptExport(astNode);}return TSExportAssignment;}() },
this.isEsModuleInteropTrue && { TSNamespaceExportDeclaration: function () {function TSNamespaceExportDeclaration() {return _this3.typeScriptExport(astNode);}return TSNamespaceExportDeclaration;}() });
}return build;}()
// This doesn't declare anything, but changes what's being exported.
}, { key: 'typeScriptExport', value: function () {function typeScriptExport(astNode) {var _this4 = this;
var exportedName = astNode.type === 'TSNamespaceExportDeclaration' ?
(astNode.id || astNode.name).name :
astNode.expression && astNode.expression.name || astNode.expression.id && astNode.expression.id.name || null;
var declTypes = [
'VariableDeclaration',
'ClassDeclaration',
'TSDeclareFunction',
'TSEnumDeclaration',
'TSTypeAliasDeclaration',
'TSInterfaceDeclaration',
'TSAbstractClassDeclaration',
'TSModuleDeclaration'];
var exportedDecls = this.ast.body.filter(function (_ref) {var type = _ref.type,id = _ref.id,declarations = _ref.declarations;return (0, _arrayIncludes2['default'])(declTypes, type) && (
id && id.name === exportedName || declarations && declarations.find(function (d) {return d.id.name === exportedName;}));});
if (exportedDecls.length === 0) {
// Export is not referencing any local declaration, must be re-exporting
this.exportMap.namespace.set('default', (0, _doc.captureDoc)(this.source, this.docStyleParsers, astNode));
return;
}
if (
this.isEsModuleInteropTrue // esModuleInterop is on in tsconfig
&& !this.exportMap.namespace.has('default') // and default isn't added already
) {
this.exportMap.namespace.set('default', {}); // add default export
}
exportedDecls.forEach(function (decl) {
if (decl.type === 'TSModuleDeclaration') {
if (decl.body && decl.body.type === 'TSModuleDeclaration') {
_this4.exportMap.namespace.set(decl.body.id.name, (0, _doc.captureDoc)(_this4.source, _this4.docStyleParsers, decl.body));
} else if (decl.body && decl.body.body) {
decl.body.body.forEach(function (moduleBlockNode) {
// Export-assignment exports all members in the namespace,
// explicitly exported or not.
var namespaceDecl = moduleBlockNode.type === 'ExportNamedDeclaration' ?
moduleBlockNode.declaration :
moduleBlockNode;
if (!namespaceDecl) {
// TypeScript can check this for us; we needn't
} else if (namespaceDecl.type === 'VariableDeclaration') {
namespaceDecl.declarations.forEach(function (d) {return (0, _patternCapture2['default'])(d.id, function (id) {return _this4.exportMap.namespace.set(
id.name,
(0, _doc.captureDoc)(_this4.source, _this4.docStyleParsers, decl, namespaceDecl, moduleBlockNode));});});
} else {
_this4.exportMap.namespace.set(
namespaceDecl.id.name,
(0, _doc.captureDoc)(_this4.source, _this4.docStyleParsers, moduleBlockNode));
}
});
}
} else {
// Export as default
_this4.exportMap.namespace.set('default', (0, _doc.captureDoc)(_this4.source, _this4.docStyleParsers, decl));
}
});
}return typeScriptExport;}() }]);return ImportExportVisitorBuilder;}();exports['default'] = ImportExportVisitorBuilder;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9leHBvcnRNYXAvdmlzaXRvci5qcyJdLCJuYW1lcyI6WyJtYWtlU291cmNlQ29kZSIsInRleHQiLCJhc3QiLCJTb3VyY2VDb2RlIiwibGVuZ3RoIiwiSW1wb3J0RXhwb3J0VmlzaXRvckJ1aWxkZXIiLCJwYXRoIiwiY29udGV4dCIsImV4cG9ydE1hcCIsIkV4cG9ydE1hcEJ1aWxkZXIiLCJjb250ZW50IiwiaXNFc01vZHVsZUludGVyb3BUcnVlIiwidGh1bmtGb3IiLCJuYW1lc3BhY2UiLCJOYW1lc3BhY2UiLCJyZW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QUF3QixLQUFLRyxlQUE3QixFQUE4Q0ksT0FBOUMsQ0FBMUQ7QUFDQTtBQUNGLHVCQUFLLHFCQUFMO0FBQ0VBLDRCQUFRRyxXQUFSLENBQW9Cb0IsWUFBcEIsQ0FBaUMxQixPQUFqQyxDQUF5QyxVQUFDMkIsQ0FBRCxFQUFPO0FBQzlDO0FBQ0VBLHdCQUFFRixFQURKO0FBRUUsZ0NBQUNBLEVBQUQsVUFBUSxPQUFLdEMsU0FBTCxDQUFlSyxTQUFmLENBQXlCaUIsR0FBekIsQ0FBNkJnQixHQUFHSCxJQUFoQyxFQUFzQyxxQkFBVyxPQUFLMUIsTUFBaEIsRUFBd0IsT0FBS0csZUFBN0IsRUFBOEM0QixDQUELine truncated
@@ -0,0 +1,18 @@
/**
* 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-findlast-findlastindex": "error",
"es-x/no-array-prototype-toreversed": "error",
"es-x/no-array-prototype-tosorted": "error",
"es-x/no-array-prototype-tospliced": "error",
"es-x/no-array-prototype-with": "error",
"es-x/no-hashbang": "error",
"es-x/no-regexp-unicode-property-escapes-2023": "error",
},
}
@@ -0,0 +1,18 @@
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(require("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
return CryptoJS.enc.Hex;
}));
@@ -0,0 +1,60 @@
{
"name": "@heroui/react-rsc-utils",
"version": "2.1.9",
"description": "A set of utilities for react compatible with RSC",
"keywords": [
"react-rsc-utils"
],
"author": "HeroUI <support@heroui.com>",
"homepage": "https://heroui.com",
"license": "MIT",
"main": "dist/index.js",
"sideEffects": false,
"files": [
"dist",
"children.d.ts",
"children.js",
"filter-dom-props.d.ts",
"filter-dom-props.js"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"directory": "packages/utilities/react-rsc-utils"
},
"bugs": {
"url": "https://github.com/heroui-inc/heroui/issues"
},
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0"
},
"clean-package": "../../../clean-package.config.json",
"tsup": {
"clean": true,
"target": "es2019",
"format": [
"cjs",
"esm"
]
},
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsup src --dts",
"build:fast": "tsup src",
"dev": "pnpm build:fast --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit"
}
}
@@ -0,0 +1,9 @@
export declare class OneToManyMapStar<TModel, TRelation extends object> {
readonly add: (model: TModel, relation: TRelation) => void;
readonly clone: () => OneToManyMapStar<TModel, TRelation>;
readonly get: <TKey extends keyof TRelation>(key: TKey, value: Required<TRelation>[TKey]) => Iterable<TModel> | undefined;
readonly getAllKeys: <TKey extends keyof TRelation>(key: TKey) => Iterable<TRelation[TKey]>;
readonly removeByRelation: <TKey extends keyof TRelation>(key: TKey, value: Required<TRelation>[TKey]) => void;
constructor();
}
//# sourceMappingURL=OneToManyMapStar.d.ts.map
@@ -0,0 +1,3 @@
# @react-stately/table
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1,76 @@
{
"name": "pvtsutils",
"version": "1.3.6",
"description": "pvtsutils is a set of common utility functions used in various Peculiar Ventures TypeScript based projects.",
"main": "build/index.js",
"module": "build/index.es.js",
"browser": "build/index.js",
"types": "build/index.d.ts",
"files": [
"build/**/*.{ts,js}",
"README.md",
"LICENSE"
],
"scripts": {
"test": "mocha",
"clear": "rimraf build/*",
"rebuild": "npm run clear && npm run build",
"build": "rollup -c",
"lint": "tslint -p .",
"lint:fix": "tslint --fix -p .",
"prepub": "npm run lint && npm run rebuild",
"pub": "npm version patch && npm publish",
"postpub": "git push && git push --tags origin master",
"prepub:next": "npm run lint && npm run rebuild",
"pub:next": "npm version prerelease --preid=next && npm publish --tag next",
"postpub:next": "git push",
"coverage": "nyc npm test",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"keywords": [
"typescript",
"helper",
"util",
"convert",
"hex",
"utf8",
"utf16",
"base64",
"base64url",
"binary",
"assign"
],
"author": "PeculiarVentures",
"contributors": [
"Miroshin Stepan<microshine@mail.ru>"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/PeculiarVentures/pvtsutils"
},
"bugs": {
"url": "https://github.com/PeculiarVentures/pvtsutils/issues"
},
"homepage": "https://github.com/PeculiarVentures/pvtsutils#readme",
"dependencies": {
"tslib": "^2.8.1"
},
"devDependencies": {
"@types/mocha": "^10.0.10",
"@types/node": "^22.9.1",
"mocha": "^10.8.2",
"nyc": "^17.1.0",
"rimraf": "^6.0.1",
"rollup": "^4.27.3",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-typescript2": "^0.36.0",
"ts-node": "^10.9.2",
"tslint": "^6.1.3",
"typescript": "^5.6.3"
},
"resolutions": {
"braces": "^3.0.3",
"cross-spawn": "^7.0.6"
}
}
@@ -0,0 +1 @@
module.exports={C:{"38":0.01027,"43":0.01027,"44":0.0308,"45":0.00513,"50":0.00513,"51":0.00513,"52":0.01027,"53":0.00513,"54":0.0308,"55":0.00513,"56":0.00513,"60":0.00513,"77":0.00513,"78":0.01027,"81":0.0154,"91":0.00513,"102":0.00513,"115":0.15399,"121":0.00513,"125":0.00513,"127":0.00513,"128":0.38498,"132":0.00513,"133":0.00513,"134":0.00513,"135":0.08213,"136":0.0154,"137":0.00513,"138":0.00513,"139":0.01027,"140":0.08213,"141":0.02567,"142":0.05133,"143":1.09333,"144":0.92907,"145":0.00513,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 40 41 42 46 47 48 49 57 58 59 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 79 80 82 83 84 85 86 87 88 89 90 92 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 122 123 124 126 129 130 131 146 147 3.5 3.6"},D:{"38":0.0154,"39":0.01027,"40":0.01027,"41":0.01027,"42":0.01027,"43":0.01027,"44":0.01027,"45":0.01027,"46":0.01027,"47":0.0154,"48":0.09753,"49":0.0462,"50":0.01027,"51":0.01027,"52":0.0154,"53":0.01027,"54":0.01027,"55":0.01027,"56":0.01027,"57":0.01027,"58":0.01027,"59":0.01027,"60":0.01027,"65":0.00513,"66":0.0154,"68":0.03593,"72":0.0308,"74":0.00513,"79":0.01027,"80":0.00513,"87":0.0154,"88":0.0308,"91":0.00513,"92":0.43631,"93":0.0154,"96":0.03593,"98":0.00513,"102":0.00513,"103":0.0308,"104":0.077,"105":0.00513,"108":0.02567,"109":0.41064,"111":0.00513,"112":0.01027,"113":0.0154,"114":0.0308,"115":0.0154,"116":0.08726,"117":0.01027,"118":0.09239,"119":0.02053,"120":0.14886,"121":0.0308,"122":0.23099,"123":0.02053,"124":0.0308,"125":1.14979,"126":0.38498,"127":0.07186,"128":0.08726,"129":0.14372,"130":3.45964,"131":0.09239,"132":0.09239,"133":0.10266,"134":2.78209,"135":0.10779,"136":0.17966,"137":0.17452,"138":0.47224,"139":0.85208,"140":5.73356,"141":12.65285,"142":0.20019,"143":0.00513,_:"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 61 62 63 64 67 69 70 71 73 75 76 77 78 81 83 84 85 86 89 90 94 95 97 99 100 101 106 107 110 144 145"},F:{"85":0.00513,"91":0.02567,"92":0.0462,"95":0.02053,"113":0.00513,"114":0.00513,"119":0.00513,"120":0.09753,"121":0.10266,"122":0.83668,_:"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 86 87 88 89 90 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 115 116 117 118 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"96":0.02567,"109":0.0616,"120":0.01027,"127":0.00513,"129":0.00513,"130":0.00513,"131":0.01027,"132":0.00513,"133":0.00513,"134":0.0154,"135":0.00513,"136":0.01027,"137":0.02567,"138":0.06673,"139":0.07186,"140":1.32431,"141":5.26646,"142":0.0154,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 121 122 123 124 125 126 128"},E:{"8":0.00513,"9":0.01027,"14":0.00513,_:"0 4 5 6 7 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 15.1 26.2","12.1":0.00513,"13.1":0.0154,"14.1":0.0154,"15.2-15.3":0.00513,"15.4":0.00513,"15.5":0.00513,"15.6":0.14886,"16.0":0.01027,"16.1":0.02053,"16.2":0.0154,"16.3":0.02567,"16.4":0.01027,"16.5":0.0154,"16.6":0.23099,"17.0":0.01027,"17.1":0.18479,"17.2":0.02053,"17.3":0.02567,"17.4":0.04106,"17.5":0.0616,"17.6":0.19505,"18.0":0.02053,"18.1":0.0308,"18.2":0.02053,"18.3":0.077,"18.4":0.04106,"18.5-18.6":0.17452,"26.0":0.68269,"26.1":0.02053},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0015,"5.0-5.1":0,"6.0-6.1":0.006,"7.0-7.1":0.0045,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.0135,"10.0-10.2":0.0015,"10.3":0.0255,"11.0-11.2":0.378,"11.3-11.4":0.009,"12.0-12.1":0.003,"12.2-12.5":0.0735,"13.0-13.1":0,"13.2":0.0075,"13.3":0.003,"13.4-13.7":0.012,"14.0-14.4":0.0255,"14.5-14.8":0.027,"15.0-15.1":0.0255,"15.2-15.3":0.0195,"15.4":0.0225,"15.5":0.0255,"15.6-15.8":0.333,"16.0":0.045,"16.1":0.084,"16.2":0.0435,"16.3":0.078,"16.4":0.0195,"16.5":0.0345,"16.6-16.7":0.4455,"17.0":0.0315,"17.1":0.048,"17.2":0.0345,"17.3":0.051,"17.4":0.09,"17.5":0.1545,"17.6-17.7":0.39,"18.0":0.0885,"18.1":0.183,"18.2":0.099,"18.3":0.318,"18.4":0.1635,"18.5-18.6":8.33705,"26.0":1.03051,"26.1":0.0375},P:{"4":0.01049,"21":0.01049,"22":0.01049,"23":0.02098,"24":0.01049,"25":0.02098,"26":0.06295,"27":0.05246,"28":3.54646,"29":0.2833,_:"20 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0 19.0","17.0":0.01049},I:{"0":0.03888,"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.50617,_:"10 11 12 11.1 11.5 12.1"},A:{"8":0.01251,"9":0.08133,"10":0.00626,"11":0.10009,_:"6 7 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.64731},Q:{"14.9":0.00487},O:{"0":0.21902},H:{"0":0},L:{"0":29.92312}};
@@ -0,0 +1,14 @@
import type { TSESTree } from '@typescript-eslint/utils';
import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util';
declare const baseRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unexpected" | "suggestComment", [{
allow?: string[];
}], unknown, {
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
}>;
export type Options = InferOptionsTypeFromRule<typeof baseRule>;
export type MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unexpected" | "suggestComment", [{
allow?: string[];
}], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
export default _default;
@@ -0,0 +1,13 @@
/**
* @param {ListItem} node
* @param {Parents | undefined} parent
* @param {State} state
* @param {Info} info
* @returns {string}
*/
export function listItem(node: ListItem, parent: Parents | undefined, state: State, info: Info): string;
import type { ListItem } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=list-item.d.ts.map
@@ -0,0 +1 @@
{"name":"through2-filter","version":"3.0.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532127658,"integrity":"sha512-b4Dpp8qEfIQx+cQnYKP8ye+PMKOQ7+0594tjAaO2k3ww3Ybypc67obAkubKTz08Mqgxf0ME6qj3NtHYB04Tq9A==","mode":436,"size":952},"index.js":{"checkedAt":1794532127658,"integrity":"sha512-OPUaL1eBZFCyL+1Xm0gz49ercgxfdyp4n5CQ8uaqKMZ/yZwjE6YH0iaG2+v/Y98aNM909L+z6rj5CXQ5LStuPQ==","mode":436,"size":1097},"LICENSE":{"checkedAt":1794532127658,"integrity":"sha512-yxBwIsx7SWmjCwGeMArrlDsLjX3G9BaMMcNcsS6KnUXc7E36v3oY2+pPpf+/C39DnCTV1QS7Veb8bfoEV8oQbg==","mode":436,"size":1094},"README.md":{"checkedAt":1794532127658,"integrity":"sha512-OPnVD1Ui2urDV0pR2ol5iqw+XqokhO0tyI2hvdPjHpitCFxdtrydoP+kmMFmQ8YlavskHoDFY799ANtWaDbCzQ==","mode":436,"size":2377}}}
@@ -0,0 +1,402 @@
/*!
Copyright 2013 Lovell Fuller and others.
SPDX-License-Identifier: Apache-2.0
*/
#ifndef SRC_COMMON_H_
#define SRC_COMMON_H_
#include <atomic>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#include <napi.h>
#include <vips/vips8>
// Verify platform and compiler compatibility
#if (VIPS_MAJOR_VERSION < 8) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 17) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 17 && VIPS_MICRO_VERSION < 3)
#error "libvips version 8.17.3+ is required - please see https://sharp.pixelplumbing.com/install"
#endif
#if defined(__has_include)
#if !__has_include(<filesystem>)
#error "C++17 compiler required - please see https://sharp.pixelplumbing.com/install"
#endif
#endif
using vips::VImage;
namespace sharp {
struct InputDescriptor {
std::string name;
std::string file;
bool autoOrient;
char *buffer;
VipsFailOn failOn;
uint64_t limitInputPixels;
bool unlimited;
VipsAccess access;
size_t bufferLength;
bool isBuffer;
double density;
bool ignoreIcc;
VipsBandFormat rawDepth;
int rawChannels;
int rawWidth;
int rawHeight;
bool rawPremultiplied;
int rawPageHeight;
int pages;
int page;
int createChannels;
int createWidth;
int createHeight;
int createPageHeight;
std::vector<double> createBackground;
std::string createNoiseType;
double createNoiseMean;
double createNoiseSigma;
std::string textValue;
std::string textFont;
std::string textFontfile;
int textWidth;
int textHeight;
VipsAlign textAlign;
bool textJustify;
int textDpi;
bool textRgba;
int textSpacing;
VipsTextWrap textWrap;
int textAutofitDpi;
bool joinAnimated;
int joinAcross;
int joinShim;
std::vector<double> joinBackground;
VipsAlign joinHalign;
VipsAlign joinValign;
std::string svgStylesheet;
bool svgHighBitdepth;
int tiffSubifd;
int openSlideLevel;
std::vector<double> pdfBackground;
bool jp2Oneshot;
InputDescriptor():
autoOrient(false),
buffer(nullptr),
failOn(VIPS_FAIL_ON_WARNING),
limitInputPixels(0x3FFF * 0x3FFF),
unlimited(false),
access(VIPS_ACCESS_SEQUENTIAL),
bufferLength(0),
isBuffer(false),
density(72.0),
ignoreIcc(false),
rawDepth(VIPS_FORMAT_UCHAR),
rawChannels(0),
rawWidth(0),
rawHeight(0),
rawPremultiplied(false),
rawPageHeight(0),
pages(1),
page(0),
createChannels(0),
createWidth(0),
createHeight(0),
createPageHeight(0),
createBackground{ 0.0, 0.0, 0.0, 255.0 },
createNoiseMean(0.0),
createNoiseSigma(0.0),
textWidth(0),
textHeight(0),
textAlign(VIPS_ALIGN_LOW),
textJustify(false),
textDpi(72),
textRgba(false),
textSpacing(0),
textWrap(VIPS_TEXT_WRAP_WORD),
textAutofitDpi(0),
joinAnimated(false),
joinAcross(1),
joinShim(0),
joinBackground{ 0.0, 0.0, 0.0, 255.0 },
joinHalign(VIPS_ALIGN_LOW),
joinValign(VIPS_ALIGN_LOW),
svgHighBitdepth(false),
tiffSubifd(-1),
openSlideLevel(0),
pdfBackground{ 255.0, 255.0, 255.0, 255.0 },
jp2Oneshot(false) {}
};
// Convenience methods to access the attributes of a Napi::Object
bool HasAttr(Napi::Object obj, std::string attr);
std::string AttrAsStr(Napi::Object obj, std::string attr);
std::string AttrAsStr(Napi::Object obj, unsigned int const attr);
uint32_t AttrAsUint32(Napi::Object obj, std::string attr);
int32_t AttrAsInt32(Napi::Object obj, std::string attr);
int32_t AttrAsInt32(Napi::Object obj, unsigned int const attr);
double AttrAsDouble(Napi::Object obj, std::string attr);
double AttrAsDouble(Napi::Object obj, unsigned int const attr);
bool AttrAsBool(Napi::Object obj, std::string attr);
std::vector<double> AttrAsVectorOfDouble(Napi::Object obj, std::string attr);
std::vector<int32_t> AttrAsInt32Vector(Napi::Object obj, std::string attr);
template <class T> T AttrAsEnum(Napi::Object obj, std::string attr, GType type) {
return static_cast<T>(
vips_enum_from_nick(nullptr, type, AttrAsStr(obj, attr).data()));
}
// Create an InputDescriptor instance from a Napi::Object describing an input image
InputDescriptor* CreateInputDescriptor(Napi::Object input);
enum class ImageType {
JPEG,
PNG,
WEBP,
JP2,
TIFF,
GIF,
SVG,
HEIF,
PDF,
MAGICK,
OPENSLIDE,
PPM,
FITS,
EXR,
JXL,
RAD,
DCRAW,
VIPS,
RAW,
UNKNOWN,
MISSING
};
enum class Canvas {
CROP,
EMBED,
MAX,
MIN,
IGNORE_ASPECT
};
// How many tasks are in the queue?
extern std::atomic<int> counterQueue;
// How many tasks are being processed?
extern std::atomic<int> counterProcess;
// Filename extension checkers
bool IsJpeg(std::string const &str);
bool IsPng(std::string const &str);
bool IsWebp(std::string const &str);
bool IsJp2(std::string const &str);
bool IsGif(std::string const &str);
bool IsTiff(std::string const &str);
bool IsHeic(std::string const &str);
bool IsHeif(std::string const &str);
bool IsAvif(std::string const &str);
bool IsJxl(std::string const &str);
bool IsDz(std::string const &str);
bool IsDzZip(std::string const &str);
bool IsV(std::string const &str);
/*
Trim space from end of string.
*/
std::string TrimEnd(std::string const &str);
/*
Provide a string identifier for the given image type.
*/
std::string ImageTypeId(ImageType const imageType);
/*
Determine image format of a buffer.
*/
ImageType DetermineImageType(void *buffer, size_t const length);
/*
Determine image format of a file.
*/
ImageType DetermineImageType(char const *file);
/*
Format-specific options builder
*/
vips::VOption* GetOptionsForImageType(ImageType imageType, InputDescriptor *descriptor);
/*
Open an image from the given InputDescriptor (filesystem, compressed buffer, raw pixel data)
*/
std::tuple<VImage, ImageType> OpenInput(InputDescriptor *descriptor);
/*
Does this image have an embedded profile?
*/
bool HasProfile(VImage image);
/*
Get copy of embedded profile.
*/
std::pair<char*, size_t> GetProfile(VImage image);
/*
Set embedded profile.
*/
VImage SetProfile(VImage image, std::pair<char*, size_t> icc);
/*
Remove all EXIF-related image fields.
*/
VImage RemoveExif(VImage image);
/*
Get EXIF Orientation of image, if any.
*/
int ExifOrientation(VImage image);
/*
Set EXIF Orientation of image.
*/
VImage SetExifOrientation(VImage image, int const orientation);
/*
Remove EXIF Orientation from image.
*/
VImage RemoveExifOrientation(VImage image);
/*
Set animation properties if necessary.
*/
VImage SetAnimationProperties(VImage image, int nPages, int pageHeight, std::vector<int> delay, int loop);
/*
Remove animation properties from image.
*/
VImage RemoveAnimationProperties(VImage image);
/*
Remove GIF palette from image.
*/
VImage RemoveGifPalette(VImage image);
/*
Does this image have a non-default density?
*/
bool HasDensity(VImage image);
/*
Get pixels/mm resolution as pixels/inch density.
*/
int GetDensity(VImage image);
/*
Set pixels/mm resolution based on a pixels/inch density.
*/
VImage SetDensity(VImage image, const double density);
/*
Multi-page images can have a page height. Fetch it, and sanity check it.
If page-height is not set, it defaults to the image height
*/
int GetPageHeight(VImage image);
/*
Check the proposed format supports the current dimensions.
*/
void AssertImageTypeDimensions(VImage image, ImageType const imageType);
/*
Called when a Buffer undergoes GC, required to support mixed runtime libraries in Windows
*/
extern std::function<void(void*, char*)> FreeCallback;
/*
Called with warnings from the glib-registered "VIPS" domain
*/
void VipsWarningCallback(char const* log_domain, GLogLevelFlags log_level, char const* message, void* ignore);
/*
Pop the oldest warning message from the queue
*/
std::string VipsWarningPop();
/*
Attach an event listener for progress updates, used to detect timeout
*/
void SetTimeout(VImage image, int const timeoutSeconds);
/*
Event listener for progress updates, used to detect timeout
*/
void VipsProgressCallBack(VipsImage *image, VipsProgress *progress, int *timeoutSeconds);
/*
Calculate the (left, top) coordinates of the output image
within the input image, applying the given gravity during an embed.
*/
std::tuple<int, int> CalculateEmbedPosition(int const inWidth, int const inHeight,
int const outWidth, int const outHeight, int const gravity);
/*
Calculate the (left, top) coordinates of the output image
within the input image, applying the given gravity.
*/
std::tuple<int, int> CalculateCrop(int const inWidth, int const inHeight,
int const outWidth, int const outHeight, int const gravity);
/*
Calculate the (left, top) coordinates of the output image
within the input image, applying the given x and y offsets of the output image.
*/
std::tuple<int, int> CalculateCrop(int const inWidth, int const inHeight,
int const outWidth, int const outHeight, int const x, int const y);
/*
Are pixel values in this image 16-bit integer?
*/
bool Is16Bit(VipsInterpretation const interpretation);
/*
Convert RGBA value to another colourspace
*/
std::vector<double> GetRgbaAsColourspace(std::vector<double> const rgba,
VipsInterpretation const interpretation, bool premultiply);
/*
Apply the alpha channel to a given colour
*/
std::tuple<VImage, std::vector<double>> ApplyAlpha(VImage image, std::vector<double> colour, bool premultiply);
/*
Removes alpha channels, if any.
*/
VImage RemoveAlpha(VImage image);
/*
Ensures alpha channel, if missing.
*/
VImage EnsureAlpha(VImage image, double const value);
/*
Calculate the horizontal and vertical shrink factors, taking the canvas mode into account.
*/
std::pair<double, double> ResolveShrink(int width, int height, int targetWidth, int targetHeight,
Canvas canvas, bool withoutEnlargement, bool withoutReduction);
/*
Ensure decoding remains sequential.
*/
VImage StaySequential(VImage image, bool condition = true);
} // namespace sharp
#endif // SRC_COMMON_H_
@@ -0,0 +1,14 @@
/**
* Turn an mdast `emphasis` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Emphasis} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function emphasis(state: State, node: Emphasis): Element;
export type Element = import("hast").Element;
export type Emphasis = import("mdast").Emphasis;
export type State = import("../state.js").State;
@@ -0,0 +1,30 @@
import type { TSchema, SchemaOptions } from '../schema/index';
import type { Assert } from '../helpers/index';
import type { TUnion } from '../union/index';
import type { TLiteral } from '../literal/index';
import type { TInteger } from '../integer/index';
import type { TNumber } from '../number/index';
import type { TBigInt } from '../bigint/index';
import type { TString } from '../string/index';
import type { TBoolean } from '../boolean/index';
import type { TNever } from '../never/index';
import type { Static } from '../static/index';
import { type TTemplateLiteralSyntax } from './syntax';
import { EmptyString } from '../helpers/index';
import { Kind } from '../symbols/index';
type TemplateLiteralStaticKind<T, Acc extends string> = T extends TUnion<infer U> ? {
[K in keyof U]: TemplateLiteralStatic<Assert<[U[K]], TTemplateLiteralKind[]>, Acc>;
}[number] : T extends TTemplateLiteral ? `${Static<T>}` : T extends TLiteral<infer U> ? `${U}` : T extends TString ? `${string}` : T extends TNumber ? `${number}` : T extends TBigInt ? `${bigint}` : T extends TBoolean ? `${boolean}` : never;
type TemplateLiteralStatic<T extends TTemplateLiteralKind[], Acc extends string> = T extends [infer L, ...infer R] ? `${TemplateLiteralStaticKind<L, Acc>}${TemplateLiteralStatic<Assert<R, TTemplateLiteralKind[]>, Acc>}` : Acc;
export type TTemplateLiteralKind = TTemplateLiteral | TUnion | TLiteral | TInteger | TNumber | TBigInt | TString | TBoolean | TNever;
export interface TTemplateLiteral<T extends TTemplateLiteralKind[] = TTemplateLiteralKind[]> extends TSchema {
[Kind]: 'TemplateLiteral';
static: TemplateLiteralStatic<T, EmptyString>;
type: 'string';
pattern: string;
}
/** `[Json]` Creates a TemplateLiteral type from template dsl string */
export declare function TemplateLiteral<T extends string>(syntax: T, options?: SchemaOptions): TTemplateLiteralSyntax<T>;
/** `[Json]` Creates a TemplateLiteral type */
export declare function TemplateLiteral<T extends TTemplateLiteralKind[]>(kinds: [...T], options?: SchemaOptions): TTemplateLiteral<T>;
export {};
@@ -0,0 +1,125 @@
'use strict';
/// <reference types="../types/index.d.ts" />
// (c) 2020-present Andrea Giammarchi
const {parse: $parse, stringify: $stringify} = JSON;
const {keys} = Object;
const Primitive = String; // it could be Number
const primitive = 'string'; // it could be 'number'
const ignore = {};
const object = 'object';
const noop = (_, value) => value;
const primitives = value => (
value instanceof Primitive ? Primitive(value) : value
);
const Primitives = (_, value) => (
typeof value === primitive ? new Primitive(value) : value
);
const revive = (input, parsed, output, $) => {
const lazy = [];
for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {
const k = ke[y];
const value = output[k];
if (value instanceof Primitive) {
const tmp = input[value];
if (typeof tmp === object && !parsed.has(tmp)) {
parsed.add(tmp);
output[k] = ignore;
lazy.push({k, a: [input, parsed, tmp, $]});
}
else
output[k] = $.call(output, k, tmp);
}
else if (output[k] !== ignore)
output[k] = $.call(output, k, value);
}
for (let {length} = lazy, i = 0; i < length; i++) {
const {k, a} = lazy[i];
output[k] = $.call(output, k, revive.apply(null, a));
}
return output;
};
const set = (known, input, value) => {
const index = Primitive(input.push(value) - 1);
known.set(value, index);
return index;
};
/**
* Converts a specialized flatted string into a JS value.
* @param {string} text
* @param {(this: any, key: string, value: any) => any} [reviver]
* @returns {any}
*/
const parse = (text, reviver) => {
const input = $parse(text, Primitives).map(primitives);
const value = input[0];
const $ = reviver || noop;
const tmp = typeof value === object && value ?
revive(input, new Set, value, $) :
value;
return $.call({'': tmp}, '', tmp);
};
exports.parse = parse;
/**
* Converts a JS value into a specialized flatted string.
* @param {any} value
* @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer]
* @param {string | number | undefined} [space]
* @returns {string}
*/
const stringify = (value, replacer, space) => {
const $ = replacer && typeof replacer === object ?
(k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :
(replacer || noop);
const known = new Map;
const input = [];
const output = [];
let i = +set(known, input, $.call({'': value}, '', value));
let firstRun = !i;
while (i < input.length) {
firstRun = true;
output[i] = $stringify(input[i++], replace, space);
}
return '[' + output.join(',') + ']';
function replace(key, value) {
if (firstRun) {
firstRun = !firstRun;
return value;
}
const after = $.call(this, key, value);
switch (typeof after) {
case object:
if (after === null) return after;
case primitive:
return known.get(after) || set(known, input, after);
}
return after;
}
};
exports.stringify = stringify;
/**
* Converts a generic value into a JSON serializable object without losing recursion.
* @param {any} value
* @returns {any}
*/
const toJSON = value => $parse(stringify(value));
exports.toJSON = toJSON;
/**
* Converts a previously serialized object with recursion into a recursive one.
* @param {any} value
* @returns {any}
*/
const fromJSON = value => parse($stringify(value));
exports.fromJSON = fromJSON;
@@ -0,0 +1,559 @@
"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/components/menu.ts
var menu_exports = {};
__export(menu_exports, {
menu: () => menu,
menuItem: () => menuItem,
menuSection: () => menuSection
});
module.exports = __toCommonJS(menu_exports);
// src/utils/tv.ts
var import_tailwind_variants = require("tailwind-variants");
// src/utils/tw-merge-config.ts
var COMMON_UNITS = ["small", "medium", "large"];
var twMergeConfig = {
theme: {
opacity: ["disabled"],
spacing: ["divider"],
borderWidth: COMMON_UNITS,
borderRadius: COMMON_UNITS
},
classGroups: {
shadow: [{ shadow: COMMON_UNITS }],
"font-size": [{ text: ["tiny", ...COMMON_UNITS] }],
"bg-image": [
"bg-stripe-gradient-default",
"bg-stripe-gradient-primary",
"bg-stripe-gradient-secondary",
"bg-stripe-gradient-success",
"bg-stripe-gradient-warning",
"bg-stripe-gradient-danger"
]
}
};
// src/utils/tv.ts
var tv = (options, config) => {
var _a, _b, _c;
return (0, import_tailwind_variants.tv)(options, {
...config,
twMerge: (_a = config == null ? void 0 : config.twMerge) != null ? _a : true,
twMergeConfig: {
...config == null ? void 0 : config.twMergeConfig,
theme: {
...(_b = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _b.theme,
...twMergeConfig.theme
},
classGroups: {
...(_c = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _c.classGroups,
...twMergeConfig.classGroups
}
}
});
};
// src/utils/classes.ts
var dataFocusVisibleClasses = [
"outline-none",
"data-[focus-visible=true]:z-10",
"data-[focus-visible=true]:outline-2",
"data-[focus-visible=true]:outline-focus",
"data-[focus-visible=true]:outline-offset-2"
];
// src/components/menu.ts
var menu = tv({
slots: {
base: "w-full relative flex flex-col gap-1 p-1 overflow-clip",
list: "w-full flex flex-col gap-0.5 outline-none",
emptyContent: [
"h-10",
"px-2",
"py-1.5",
"w-full",
"h-full",
"text-foreground-400",
"text-start"
]
}
});
var menuItem = tv({
slots: {
base: [
"flex",
"group",
"gap-2",
"items-center",
"justify-between",
"relative",
"px-2",
"py-1.5",
"w-full",
"h-full",
"box-border",
"rounded-small",
"subpixel-antialiased",
"outline-none",
"cursor-pointer",
"tap-highlight-transparent",
...dataFocusVisibleClasses,
"data-[focus-visible=true]:dark:ring-offset-background-content1"
],
wrapper: "w-full flex flex-col items-start justify-center",
title: "flex-1 text-small font-normal",
description: ["w-full", "text-tiny", "text-foreground-500", "group-hover:text-current"],
selectedIcon: ["text-inherit", "w-3", "h-3", "flex-shrink-0"],
shortcut: [
"px-1",
"py-0.5",
"rounded",
"font-sans",
"text-foreground-500",
"text-tiny",
"border-small",
"border-default-300",
"group-hover:border-current"
]
},
variants: {
variant: {
solid: {
base: ""
},
bordered: {
base: "border-medium border-transparent bg-transparent"
},
light: {
base: "bg-transparent"
},
faded: {
base: [
"border-small border-transparent hover:border-default data-[hover=true]:bg-default-100",
"data-[selectable=true]:focus:border-default data-[selectable=true]:focus:bg-default-100"
]
},
flat: {
base: ""
},
shadow: {
base: "data-[hover=true]:shadow-lg"
}
},
color: {
default: {},
primary: {},
secondary: {},
success: {},
warning: {},
danger: {}
},
showDivider: {
true: {
base: [
"mb-1.5",
"after:content-['']",
"after:absolute",
"after:-bottom-1",
"after:left-0",
"after:right-0",
"after:h-divider",
"after:bg-divider"
]
},
false: {}
},
isDisabled: {
true: {
base: "opacity-disabled pointer-events-none"
}
},
disableAnimation: {
true: {},
false: {
base: "data-[hover=true]:transition-colors"
}
},
hasTitleTextChild: {
true: {
title: "truncate"
}
},
hasDescriptionTextChild: {
true: {
description: "truncate"
}
}
},
defaultVariants: {
variant: "solid",
color: "default",
showDivider: false
},
compoundVariants: [
{
variant: "solid",
color: "default",
class: {
base: [
"data-[hover=true]:bg-default",
"data-[hover=true]:text-default-foreground",
"data-[selectable=true]:focus:bg-default",
"data-[selectable=true]:focus:text-default-foreground"
]
}
},
{
variant: "solid",
color: "primary",
class: {
base: [
"data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground",
"data-[selectable=true]:focus:bg-primary data-[selectable=true]:focus:text-primary-foreground"
]
}
},
{
variant: "solid",
color: "secondary",
class: {
base: [
"data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground",
"data-[selectable=true]:focus:bg-secondary data-[selectable=true]:focus:text-secondary-foreground"
]
}
},
{
variant: "solid",
color: "success",
class: {
base: [
"data-[hover=true]:bg-success data-[hover=true]:text-success-foreground",
"data-[selectable=true]:focus:bg-success data-[selectable=true]:focus:text-success-foreground"
]
}
},
{
variant: "solid",
color: "warning",
class: {
base: [
"data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground",
"data-[selectable=true]:focus:bg-warning data-[selectable=true]:focus:text-warning-foreground"
]
}
},
{
variant: "solid",
color: "danger",
class: {
base: [
"data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground",
"data-[selectable=true]:focus:bg-danger data-[selectable=true]:focus:text-danger-foreground"
]
}
},
{
variant: "shadow",
color: "default",
class: {
base: [
"data-[hover=true]:shadow-default/50 data-[hover=true]:bg-default data-[hover=true]:text-default-foreground",
"data-[selectable=true]:focus:shadow-default/50 data-[selectable=true]:focus:bg-default data-[selectable=true]:focus:text-default-foreground"
]
}
},
{
variant: "shadow",
color: "primary",
class: {
base: [
"data-[hover=true]:shadow-primary/30 data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground",
"data-[selectable=true]:focus:shadow-primary/30 data-[selectable=true]:focus:bg-primary data-[selectable=true]:focus:text-primary-foreground"
]
}
},
{
variant: "shadow",
color: "secondary",
class: {
base: [
"data-[hover=true]:shadow-secondary/30 data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground",
"data-[selectable=true]:focus:shadow-secondary/30 data-[selectable=true]:focus:bg-secondary data-[selectable=true]:focus:text-secondary-foreground"
]
}
},
{
variant: "shadow",
color: "success",
class: {
base: [
"data-[hover=true]:shadow-success/30 data-[hover=true]:bg-success data-[hover=true]:text-success-foreground",
"data-[selectable=true]:focus:shadow-success/30 data-[selectable=true]:focus:bg-success data-[selectable=true]:focus:text-success-foreground"
]
}
},
{
variant: "shadow",
color: "warning",
class: {
base: [
"data-[hover=true]:shadow-warning/30 data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground",
"data-[selectable=true]:focus:shadow-warning/30 data-[selectable=true]:focus:bg-warning data-[selectable=true]:focus:text-warning-foreground"
]
}
},
{
variant: "shadow",
color: "danger",
class: {
base: [
"data-[hover=true]:shadow-danger/30 data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground",
"data-[selectable=true]:focus:shadow-danger/30 data-[selectable=true]:focus:bg-danger data-[selectable=true]:focus:text-danger-foreground"
]
}
},
{
variant: "bordered",
color: "default",
class: {
base: ["data-[hover=true]:border-default", "data-[selectable=true]:focus:border-default"]
}
},
{
variant: "bordered",
color: "primary",
class: {
base: [
"data-[hover=true]:border-primary data-[hover=true]:text-primary",
"data-[selectable=true]:focus:border-primary data-[selectable=true]:focus:text-primary"
]
}
},
{
variant: "bordered",
color: "secondary",
class: {
base: [
"data-[hover=true]:border-secondary data-[hover=true]:text-secondary",
"data-[selectable=true]:focus:border-secondary data-[selectable=true]:focus:text-secondary"
]
}
},
{
variant: "bordered",
color: "success",
class: {
base: [
"data-[hover=true]:border-success data-[hover=true]:text-success",
"data-[selectable=true]:focus:border-success data-[selectable=true]:focus:text-success"
]
}
},
{
variant: "bordered",
color: "warning",
class: {
base: [
"data-[hover=true]:border-warning data-[hover=true]:text-warning",
"data-[selectable=true]:focus:border-warning data-[selectable=true]:focus:text-warning"
]
}
},
{
variant: "bordered",
color: "danger",
class: {
base: [
"data-[hover=true]:border-danger data-[hover=true]:text-danger",
"data-[selectable=true]:focus:border-danger data-[selectable=true]:focus:text-danger"
]
}
},
{
variant: "flat",
color: "default",
class: {
base: [
"data-[hover=true]:bg-default/40",
"data-[hover=true]:text-default-foreground",
"data-[selectable=true]:focus:bg-default/40",
"data-[selectable=true]:focus:text-default-foreground"
]
}
},
{
variant: "flat",
color: "primary",
class: {
base: [
"data-[hover=true]:bg-primary/20 data-[hover=true]:text-primary",
"data-[selectable=true]:focus:bg-primary/20 data-[selectable=true]:focus:text-primary"
]
}
},
{
variant: "flat",
color: "secondary",
class: {
base: [
"data-[hover=true]:bg-secondary/20 data-[hover=true]:text-secondary",
"data-[selectable=true]:focus:bg-secondary/20 data-[selectable=true]:focus:text-secondary"
]
}
},
{
variant: "flat",
color: "success",
class: {
base: [
"data-[hover=true]:bg-success/20 data-[hover=true]:text-success",
"data-[selectable=true]:focus:bg-success/20 data-[selectable=true]:focus:text-success"
]
}
},
{
variant: "flat",
color: "warning",
class: {
base: [
"data-[hover=true]:bg-warning/20 data-[hover=true]:text-warning",
"data-[selectable=true]:focus:bg-warning/20 data-[selectable=true]:focus:text-warning"
]
}
},
{
variant: "flat",
color: "danger",
class: {
base: [
"data-[hover=true]:bg-danger/20 data-[hover=true]:text-danger",
"data-[selectable=true]:focus:bg-danger/20 data-[selectable=true]:focus:text-danger"
]
}
},
{
variant: "faded",
color: "default",
class: {
base: [
"data-[hover=true]:text-default-foreground",
"data-[selectable=true]:focus:text-default-foreground"
]
}
},
{
variant: "faded",
color: "primary",
class: {
base: ["data-[hover=true]:text-primary", "data-[selectable=true]:focus:text-primary"]
}
},
{
variant: "faded",
color: "secondary",
class: {
base: ["data-[hover=true]:text-secondary", "data-[selectable=true]:focus:text-secondary"]
}
},
{
variant: "faded",
color: "success",
class: {
base: ["data-[hover=true]:text-success", "data-[selectable=true]:focus:text-success"]
}
},
{
variant: "faded",
color: "warning",
class: {
base: ["data-[hover=true]:text-warning", "data-[selectable=true]:focus:text-warning"]
}
},
{
variant: "faded",
color: "danger",
class: {
base: ["data-[hover=true]:text-danger", "data-[selectable=true]:focus:text-danger"]
}
},
{
variant: "light",
color: "default",
class: {
base: [
"data-[hover=true]:text-default-500",
"data-[selectable=true]:focus:text-default-500"
]
}
},
{
variant: "light",
color: "primary",
class: {
base: ["data-[hover=true]:text-primary", "data-[selectable=true]:focus:text-primary"]
}
},
{
variant: "light",
color: "secondary",
class: {
base: ["data-[hover=true]:text-secondary", "data-[selectable=true]:focus:text-secondary"]
}
},
{
variant: "light",
color: "success",
class: {
base: ["data-[hover=true]:text-success", "data-[selectable=true]:focus:text-success"]
}
},
{
variant: "light",
color: "warning",
class: {
base: ["data-[hover=true]:text-warning", "data-[selectable=true]:focus:text-warning"]
}
},
{
variant: "light",
color: "danger",
class: {
base: ["data-[hover=true]:text-danger", "data-[selectable=true]:focus:text-danger"]
}
}
]
});
var menuSection = tv({
slots: {
base: "relative mb-2",
heading: "pl-1 text-tiny text-foreground-500",
group: "data-[has-title=true]:pt-1",
divider: "mt-2"
}
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
menu,
menuItem,
menuSection
});
@@ -0,0 +1 @@
{"version":3,"file":"heartbeat.js","sourceRoot":"","sources":["../../src/lib/heartbeat.ts"],"names":[],"mappings":";;AAWA,8BA2CC;AArDD,yCAAgD;AAGhD,SAAS,kBAAkB,CAAC,eAAsE;IAChG,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QACnC,OAAO,eAAe,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,IAAO,OAAO,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/F,CAAC;IACD,OAAO,eAAe,CAAC,OAAO,CAAA;AAChC,CAAC;AAED,SAAgB,SAAS,CAAC,EAAa,EAAE,eAAsE,EAAE,OAA0B;IACnI,IAAA,KAIF,OAAO,IAAI,EAAE,EAHf,gBAAqC,EAArC,QAAQ,mBAAG,6BAAiB,CAAC,QAAQ,KAAA,EACrC,eAAmC,EAAnC,OAAO,mBAAG,6BAAiB,CAAC,OAAO,KAAA,EACnC,eAAmC,EAAnC,OAAO,mBAAG,6BAAiB,CAAC,OAAO,KACpB,CAAC;IAElB,iDAAiD;IACjD,mBAAmB;IACnB,gCAAgC;IAChC,IAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,GAAG,EAAE,CAAC,CAAC;I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": "@peculiar/x509",
"version": "1.14.2",
"description": "@peculiar/x509 is an easy to use TypeScript/Javascript library based on @peculiar/asn1-schema that makes generating X.509 Certificates and Certificate Requests as well as validating certificate chains easy",
"main": "build/x509.cjs.js",
"module": "build/x509.es.js",
"unpkg": "build/x509.js",
"types": "build/index.d.ts",
"scripts": {
"test": "vitest run",
"test:watch": "vitest",
"lint": "eslint",
"lint:fix": "eslint --fix",
"build": "npm run build:module",
"build:module": "rollup -c",
"rebuild": "npm run clear && npm run build",
"coverage": "vitest run --coverage",
"coveralls": "vitest run --coverage && cat coverage/lcov.info | coveralls",
"pub": "npm run pub:patch",
"pub:patch": "npm version patch && npm run git:push",
"pub:minor": "npm version minor && npm run git:push",
"pub:major": "npm version major && npm run git:push",
"git:push": "git push --follow-tags"
},
"repository": {
"type": "git",
"url": "git+https://github.com/PeculiarVentures/x509.git"
},
"keywords": [
"x509",
"certificate",
"csr",
"pkcs10",
"pkcs7",
"cms",
"rsa",
"ec"
],
"author": "Peculiar Ventures LLC",
"contributors": [
"Miroshin Stepan<microshine@mail.ru>"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/PeculiarVentures/x509/issues"
},
"homepage": "https://github.com/PeculiarVentures/x509#readme",
"files": [
"build/**/*.{ts,js}",
"README.md",
"LICENSE"
],
"devDependencies": {
"@babel/core": "^7.28.5",
"@babel/preset-env": "^7.28.5",
"@peculiar/eslint-config-base": "^0.2.8",
"@peculiar/webcrypto": "^1.5.0",
"@rollup/plugin-babel": "^6.1.0",
"@rollup/plugin-commonjs": "^29.0.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-terser": "^0.4.4",
"@types/node": "^24.10.1",
"@vitest/coverage-v8": "^4.0.9",
"rimraf": "^6.1.0",
"rollup": "^4.53.2",
"rollup-plugin-dts": "^6.2.3",
"rollup-plugin-typescript2": "^0.36.0",
"typescript": "^5.9.3",
"vitest": "^4.0.9"
},
"dependencies": {
"@peculiar/asn1-cms": "^2.6.0",
"@peculiar/asn1-csr": "^2.6.0",
"@peculiar/asn1-ecc": "^2.6.0",
"@peculiar/asn1-pkcs9": "^2.6.0",
"@peculiar/asn1-rsa": "^2.6.0",
"@peculiar/asn1-schema": "^2.6.0",
"@peculiar/asn1-x509": "^2.6.0",
"pvtsutils": "^1.3.6",
"reflect-metadata": "^0.2.2",
"tslib": "^2.8.1",
"tsyringe": "^4.10.0"
},
"engines": {
"node": ">=22.0.0"
},
"devEngines": {
"packageManager": {
"name": "npm",
"version": ">=10",
"onFail": "error"
}
}
}
@@ -0,0 +1,10 @@
import { Level } from 'base-log-factory';
export declare const colors: {
[Level.FATAL]: string;
[Level.ERROR]: string;
[Level.WARN]: string;
[Level.INFO]: string;
[Level.DEBUG]: string;
[Level.TRACE]: string;
[Level.OFF]: string;
};
@@ -0,0 +1,47 @@
/*
* 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.
*/
export {Pressable} from './Pressable';
export {PressResponder, ClearPressResponder} from './PressResponder';
export {useFocus} from './useFocus';
export {
isFocusVisible,
getInteractionModality,
setInteractionModality,
addWindowFocusTracking,
useInteractionModality,
useFocusVisible,
useFocusVisibleListener
} from './useFocusVisible';
export {useFocusWithin} from './useFocusWithin';
export {useHover} from './useHover';
export {useInteractOutside} from './useInteractOutside';
export {useKeyboard} from './useKeyboard';
export {useMove} from './useMove';
export {usePress} from './usePress';
export {useScrollWheel} from './useScrollWheel';
export {useLongPress} from './useLongPress';
export {useFocusable, FocusableProvider, Focusable, FocusableContext} from './useFocusable';
export {focusSafely} from './focusSafely';
export type {FocusProps, FocusResult} from './useFocus';
export type {FocusVisibleHandler, FocusVisibleProps, FocusVisibleResult, Modality} from './useFocusVisible';
export type {FocusWithinProps, FocusWithinResult} from './useFocusWithin';
export type {HoverProps, HoverResult} from './useHover';
export type {InteractOutsideProps} from './useInteractOutside';
export type {KeyboardProps, KeyboardResult} from './useKeyboard';
export type {PressProps, PressHookProps, PressResult} from './usePress';
export type {PressEvent, PressEvents, MoveStartEvent, MoveMoveEvent, MoveEndEvent, MoveEvents, HoverEvent, HoverEvents, FocusEvents, KeyboardEvents} from '@react-types/shared';
export type {MoveResult} from './useMove';
export type {LongPressProps, LongPressResult} from './useLongPress';
export type {ScrollWheelProps} from './useScrollWheel';
export type {FocusableAria, FocusableOptions, FocusableProviderProps} from './useFocusable';
@@ -0,0 +1,55 @@
{
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"name": "glob",
"description": "a little globber",
"version": "7.2.3",
"publishConfig": {
"tag": "v7-legacy"
},
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-glob.git"
},
"main": "glob.js",
"files": [
"glob.js",
"sync.js",
"common.js"
],
"engines": {
"node": "*"
},
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"devDependencies": {
"memfs": "^3.2.0",
"mkdirp": "0",
"rimraf": "^2.2.8",
"tap": "^15.0.6",
"tick": "0.0.6"
},
"tap": {
"before": "test/00-setup.js",
"after": "test/zz-cleanup.js",
"jobs": 1
},
"scripts": {
"prepublish": "npm run benchclean",
"profclean": "rm -f v8.log profile.txt",
"test": "tap",
"test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js",
"bench": "bash benchmark.sh",
"prof": "bash prof.sh && cat profile.txt",
"benchclean": "node benchclean.js"
},
"license": "ISC",
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
}
@@ -0,0 +1,16 @@
import type { SourceMapInput } from '@jridgewell/trace-mapping';
export type { SourceMapSegment, DecodedSourceMap, EncodedSourceMap, } from '@jridgewell/trace-mapping';
export type { SourceMapInput };
export type LoaderContext = {
readonly importer: string;
readonly depth: number;
source: string;
content: string | null | undefined;
ignore: boolean | undefined;
};
export type SourceMapLoader = (file: string, ctx: LoaderContext) => SourceMapInput | null | undefined | void;
export type Options = {
excludeContent?: boolean;
decodedMappings?: boolean;
};
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/call-bound
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,617 @@
export default `flf2a$ 6 5 20 -1 3
Bright Font by Dennis Monk 7/94
Identical to contrast.flf, but with different characters, making it
brighter.
........@
........@
........@
........@
........@
........@@
...##...@
...##...@
...##...@
........@
...##...@
........@@
.##..##.@
.##..##.@
..#..#..@
........@
........@
........@@
..#..#..@
.######.@
..#..#..@
.######.@
..#..#..@
........@@
..#####.@
.##.#...@
..####..@
...#.##.@
.#####..@
........@@
.##..##.@
.#..##..@
...##...@
..##..#.@
.##..##.@
........@@
..#####..@
.##...##.@
..##.##..@
.##.##.#.@
..#####..@
.........@@
...##...@
...##...@
....#...@
........@
........@
........@@
....###.@
..##....@
.#......@
..##....@
....###.@
........@@
.###....@
....##..@
......#.@
....##..@
.###....@
........@@
.#..#..#.@
..#.#.#..@
.#######.@
..#.#.#..@
.#..#..#.@
.........@@
...##...@
...##...@
.######.@
...##...@
...##...@
........@@
........@
........@
...##...@
...##...@
....#...@
........@@
........@
........@
.######.@
........@
........@
........@@
........@
........@
........@
...##...@
...##...@
........@@
.....##.@
....##..@
...##...@
..##....@
.##.....@
........@@
..####..@
.##..##.@
.######.@
.##..##.@
..####..@
........@@
...##...@
..###...@
...##...@
...##...@
.######.@
........@@
..####..@
.....##.@
..####..@
.##.....@
.######.@
........@@
.######.@
....##..@
...###..@
.....##.@
.#####..@
........@@
.....##.@
.##..##.@
.######.@
.....##.@
.....##.@
........@@
.######.@
.##.....@
..####..@
.....##.@
.#####..@
........@@
...##...@
..##....@
.#####..@
.##..##.@
..####..@
........@@
.######.@
....##..@
...##...@
..##....@
.##.....@
........@@
..####..@
.##..##.@
..####..@
.##..##.@
..####..@
........@@
..####..@
.##..##.@
..####..@
...##...@
..##....@
........@@
........@
...##...@
........@
...##...@
........@
........@@
........@
...##...@
........@
...##...@
....#...@
........@@
.....##.@
...##...@
.##.....@
...##...@
.....##.@
........@@
........@
.######.@
........@
.######.@
........@
........@@
.##.....@
...##...@
.....##.@
...##...@
.##.....@
........@@
..####..@
.##..##.@
....##..@
...##...@
...##...@
........@@
..####..@
.#.##.#.@
.#.##.#.@
.#..#.#.@
..####..@
........@@
..####..@
.##..##.@
.######.@
.##..##.@
.##..##.@
........@@
.#####..@
.##..##.@
.#####..@
.##..##.@
.#####..@
........@@
..####..@
.##..##.@
.##.....@
.##..##.@
..####..@
........@@
.#####..@
.##..##.@
.##..##.@
.##..##.@
.#####..@
........@@
.######.@
.##.....@
.####...@
.##.....@
.######.@
........@@
.######.@
.##.....@
.####...@
.##.....@
.##.....@
........@@
..####..@
.##.....@
.##.###.@
.##..##.@
..####..@
........@@
.##..##.@
.##..##.@
.######.@
.##..##.@
.##..##.@
........@@
.######.@
...##...@
...##...@
...##...@
.######.@
........@@
.######.@
.....##.@
.....##.@
.##..##.@
..####..@
........@@
.##..##.@
.##.##..@
.####...@
.##.##..@
.##..##.@
........@@
.##.....@
.##.....@
.##.....@
.##.....@
.######.@
........@@
.##...##.@
.###.###.@
.##.#.##.@
.##...##.@
.##...##.@
.........@@
.##..##.@
.###.##.@
.##.###.@
.##..##.@
.##..##.@
........@@
..####..@
.##..##.@
.##..##.@
.##..##.@
..####..@
........@@
.#####..@
.##..##.@
.#####..@
.##.....@
.##.....@
........@@
..####..@
.##..##.@
.##.###.@
.##..##.@
..#####.@
........@@
.#####..@
.##..##.@
.#####..@
.##..##.@
.##..##.@
........@@
..####..@
.##.....@
..####..@
.....##.@
..####..@
........@@
.######.@
...##...@
...##...@
...##...@
...##...@
........@@
.##..##.@
.##..##.@
.##..##.@
.##..##.@
..####..@
........@@
.##..##.@
.##..##.@
.##..##.@
..####..@
...##...@
........@@
.##...##.@
.##...##.@
.##.#.##.@
.#######.@
..##.##..@
.........@@
.##..##.@
..####..@
...##...@
..####..@
.##..##.@
........@@
.##..##.@
..####..@
...##...@
...##...@
...##...@
........@@
.######.@
....##..@
...##...@
..##....@
.######.@
........@@
.######.@
.##.....@
.##.....@
.##.....@
.######.@
........@@
.##.....@
..##....@
...##...@
....##..@
.....##.@
........@@
.######.@
.....##.@
.....##.@
.....##.@
.######.@
........@@
...##...@
..####..@
.##..##.@
........@
........@
........@@
........@
........@
........@
........@
.######.@
........@@
...##...@
...##...@
...#....@
........@
........@
........@@
..####..@
.##..##.@
.######.@
.##..##.@
.##..##.@
........@@
.#####..@
.##..##.@
.#####..@
.##..##.@
.#####..@
........@@
..####..@
.##..##.@
.##.....@
.##..##.@
..####..@
........@@
.#####..@
.##..##.@
.##..##.@
.##..##.@
.#####..@
........@@
.######.@
.##.....@
.####...@
.##.....@
.######.@
........@@
.######.@
.##.....@
.####...@
.##.....@
.##.....@
........@@
..####..@
.##.....@
.##.###.@
.##..##.@
..####..@
........@@
.##..##.@
.##..##.@
.######.@
.##..##.@
.##..##.@
........@@
.######.@
...##...@
...##...@
...##...@
.######.@
........@@
.######.@
.....##.@
.....##.@
.##..##.@
..####..@
........@@
.##..##.@
.##.##..@
.####...@
.##.##..@
.##..##.@
........@@
.##.....@
.##.....@
.##.....@
.##.....@
.######.@
........@@
.##...##.@
.###.###.@
.##.#.##.@
.##...##.@
.##...##.@
.........@@
.##..##.@
.###.##.@
.##.###.@
.##..##.@
.##..##.@
........@@
..####..@
.##..##.@
.##..##.@
.##..##.@
..####..@
........@@
.#####..@
.##..##.@
.#####..@
.##.....@
.##.....@
........@@
..####..@
.##..##.@
.##.###.@
.##..##.@
..#####.@
........@@
.#####..@
.##..##.@
.#####..@
.##..##.@
.##..##.@
........@@
..####..@
.##.....@
..####..@
.....##.@
..####..@
........@@
.######.@
...##...@
...##...@
...##...@
...##...@
........@@
.##..##.@
.##..##.@
.##..##.@
.##..##.@
..####..@
........@@
.##..##.@
.##..##.@
.##..##.@
..####..@
...##...@
........@@
.##...##.@
.##...##.@
.##.#.##.@
.#######.@
..##.##..@
.........@@
.##..##.@
..####..@
...##...@
..####..@
.##..##.@
........@@
.##..##.@
..####..@
...##...@
...##...@
...##...@
........@@
.######.@
....##..@
...##...@
..##....@
.######.@
........@@
...####.@
...##...@
.###....@
...##...@
...####.@
........@@
...##...@
...##...@
...##...@
...##...@
...##...@
...##...@@
.####...@
...##...@
....###.@
...##...@
.####...@
........@@
..###.#.@
.#.###..@
........@
........@
........@
........@@
.##..##.@
........@
..#####.@
.##..##.@
..#####.@
........@@
.##..##.@
........@
..####..@
.##..##.@
..####..@
........@@
.##..##.@
........@
.##..##.@
.##..##.@
..####..@
........@@
.##..##.@
........@
..#####.@
.##..##.@
..#####.@
........@@
.##..##.@
........@
..####..@
.##..##.@
..####..@
........@@
.##..##.@
........@
.##..##.@
.##..##.@
..####..@
........@@
..#####..@
.##...##.@
.##.###..@
.##...##.@
.##.###..@
.##......@@
`
@@ -0,0 +1,46 @@
export { r as runBaseTests } from './chunks/base.CiIV2DDC.js';
export { i as init } from './chunks/init.BQhNfT0h.js';
import 'node:vm';
import '@vitest/spy';
import './chunks/index.CPA8jGhR.js';
import '@vitest/expect';
import './chunks/setup-common.Dw1XgX0v.js';
import './chunks/coverage.D_JHT54q.js';
import '@vitest/snapshot';
import '@vitest/utils/timers';
import './chunks/utils.DvEY5TfP.js';
import './chunks/rpc.BytlcPfC.js';
import './chunks/index.0kCJoeWi.js';
import './chunks/test.w5HLbjmU.js';
import '@vitest/runner';
import '@vitest/utils/helpers';
import './chunks/benchmark.B3N2zMcH.js';
import '@vitest/runner/utils';
import '@vitest/utils/error';
import 'pathe';
import './chunks/vi.CyIUVSoU.js';
import '@vitest/utils/offset';
import '@vitest/utils/source-map';
import './chunks/_commonjsHelpers.BFTU3MAI.js';
import './chunks/date.Bq6ZW5rf.js';
import './chunks/evaluatedModules.Dg1zASAC.js';
import 'vite/module-runner';
import './chunks/startModuleRunner.DLjmA_wU.js';
import 'node:fs';
import 'node:module';
import 'node:url';
import './path.js';
import 'node:path';
import '@vitest/utils/serialize';
import './module-evaluator.js';
import '@vitest/mocker';
import 'node:perf_hooks';
import './chunks/inspector.CvyFGlXm.js';
import 'node:timers';
import 'node:timers/promises';
import 'node:util';
import '@vitest/utils/constants';
import './chunks/index.CGezRSGU.js';
import 'expect-type';
import './chunks/index.BfmpdV5p.js';
import 'node:console';
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","2":"K D wC","260":"F","1026":"E"},B:{"1":"0 1 2 3 4 5 C L M G N O 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"},C:{"1":"0 1 2 3 4 5 7 8 9 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 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","4":"xC TC 0C 1C","132":"6 J ZB K D E F A B C L M G N O P aB"},D:{"1":"0 1 2 3 4 5 9 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 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 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","4":"J ZB K D E F A B C L M G N O P","132":"6 7 8 aB"},E:{"1":"K D E F A B C L M G 4C 5C 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","4":"J ZB 2C ZC 3C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 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 vB wB 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","4":"F B C FD GD HD ID NC uC JD","132":"OC"},G:{"1":"E MD ND OD 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","4":"ZC KD vC LD"},H:{"132":"hD"},I:{"1":"I mD nD","4":"TC iD jD kD","132":"lD vC","900":"J"},J:{"1":"A","4":"D"},K:{"1":"H","4":"A B C NC uC","132":"OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:6,C:"ECMAScript 5",D:true};
@@ -0,0 +1,616 @@
export default `flf2a$ 6 5 20 -1 2
Contrast Font by Dennis Monk 7/94
Original font, I think. Maybe inspired by one of Scarecrow's .sigs.
........@
........@
........@
........@
........@
........@@
...%%...@
...%%...@
...%%...@
........@
...%%...@
........@@
.%%..%%.@
.%%..%%.@
..%..%..@
........@
........@
........@@
..%..%..@
.%%%%%%.@
..%..%..@
.%%%%%%.@
..%..%..@
........@@
..%%%%%.@
.%%.%...@
..%%%%..@
...%.%%.@
.%%%%%..@
........@@
.%%..%%.@
.%..%%..@
...%%...@
..%%..%.@
.%%..%%.@
........@@
..%%%%%..@
.%%...%%.@
..%%.%%..@
.%%.%%.%.@
..%%%%%..@
.........@@
...%%...@
...%%...@
....%...@
........@
........@
........@@
....%%%.@
..%%....@
.%......@
..%%....@
....%%%.@
........@@
.%%%....@
....%%..@
......%.@
....%%..@
.%%%....@
........@@
.%..%..%.@
..%.%.%..@
.%%%%%%%.@
..%.%.%..@
.%..%..%.@
.........@@
...%%...@
...%%...@
.%%%%%%.@
...%%...@
...%%...@
........@@
........@
........@
...%%...@
...%%...@
....%...@
........@@
........@
........@
.%%%%%%.@
........@
........@
........@@
........@
........@
........@
...%%...@
...%%...@
........@@
.....%%.@
....%%..@
...%%...@
..%%....@
.%%.....@
........@@
..%%%%..@
.%%..%%.@
.%%%%%%.@
.%%..%%.@
..%%%%..@
........@@
...%%...@
..%%%...@
...%%...@
...%%...@
.%%%%%%.@
........@@
..%%%%..@
.....%%.@
..%%%%..@
.%%.....@
.%%%%%%.@
........@@
.%%%%%%.@
....%%..@
...%%%..@
.....%%.@
.%%%%%..@
........@@
.....%%.@
.%%..%%.@
.%%%%%%.@
.....%%.@
.....%%.@
........@@
.%%%%%%.@
.%%.....@
..%%%%..@
.....%%.@
.%%%%%..@
........@@
...%%...@
..%%....@
.%%%%%..@
.%%..%%.@
..%%%%..@
........@@
.%%%%%%.@
....%%..@
...%%...@
..%%....@
.%%.....@
........@@
..%%%%..@
.%%..%%.@
..%%%%..@
.%%..%%.@
..%%%%..@
........@@
..%%%%..@
.%%..%%.@
..%%%%..@
...%%...@
..%%....@
........@@
........@
...%%...@
........@
...%%...@
........@
........@@
........@
...%%...@
........@
...%%...@
....%...@
........@@
.....%%.@
...%%...@
.%%.....@
...%%...@
.....%%.@
........@@
........@
.%%%%%%.@
........@
.%%%%%%.@
........@
........@@
.%%.....@
...%%...@
.....%%.@
...%%...@
.%%.....@
........@@
..%%%%..@
.%%..%%.@
....%%..@
...%%...@
...%%...@
........@@
..%%%%..@
.%.%%.%.@
.%.%%.%.@
.%..%.%.@
..%%%%..@
........@@
..%%%%..@
.%%..%%.@
.%%%%%%.@
.%%..%%.@
.%%..%%.@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%..%%.@
.%%%%%..@
........@@
..%%%%..@
.%%..%%.@
.%%.....@
.%%..%%.@
..%%%%..@
........@@
.%%%%%..@
.%%..%%.@
.%%..%%.@
.%%..%%.@
.%%%%%..@
........@@
.%%%%%%.@
.%%.....@
.%%%%...@
.%%.....@
.%%%%%%.@
........@@
.%%%%%%.@
.%%.....@
.%%%%...@
.%%.....@
.%%.....@
........@@
..%%%%..@
.%%.....@
.%%.%%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%..%%.@
.%%%%%%.@
.%%..%%.@
.%%..%%.@
........@@
.%%%%%%.@
...%%...@
...%%...@
...%%...@
.%%%%%%.@
........@@
.%%%%%%.@
.....%%.@
.....%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%.%%..@
.%%%%...@
.%%.%%..@
.%%..%%.@
........@@
.%%.....@
.%%.....@
.%%.....@
.%%.....@
.%%%%%%.@
........@@
.%%...%%.@
.%%%.%%%.@
.%%.%.%%.@
.%%...%%.@
.%%...%%.@
.........@@
.%%..%%.@
.%%%.%%.@
.%%.%%%.@
.%%..%%.@
.%%..%%.@
........@@
..%%%%..@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%.....@
.%%.....@
........@@
..%%%%..@
.%%..%%.@
.%%.%%%.@
.%%..%%.@
..%%%%%.@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%..%%.@
.%%..%%.@
........@@
..%%%%..@
.%%.....@
..%%%%..@
.....%%.@
..%%%%..@
........@@
.%%%%%%.@
...%%...@
...%%...@
...%%...@
...%%...@
........@@
.%%..%%.@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
...%%...@
........@@
.%%...%%.@
.%%...%%.@
.%%.%.%%.@
.%%%%%%%.@
..%%.%%..@
.........@@
.%%..%%.@
..%%%%..@
...%%...@
..%%%%..@
.%%..%%.@
........@@
.%%..%%.@
..%%%%..@
...%%...@
...%%...@
...%%...@
........@@
.%%%%%%.@
....%%..@
...%%...@
..%%....@
.%%%%%%.@
........@@
.%%%%%%.@
.%%.....@
.%%.....@
.%%.....@
.%%%%%%.@
........@@
.%%.....@
..%%....@
...%%...@
....%%..@
.....%%.@
........@@
.%%%%%%.@
.....%%.@
.....%%.@
.....%%.@
.%%%%%%.@
........@@
...%%...@
..%%%%..@
.%%..%%.@
........@
........@
........@@
........@
........@
........@
........@
.%%%%%%.@
........@@
...%%...@
...%%...@
...%....@
........@
........@
........@@
..%%%%..@
.%%..%%.@
.%%%%%%.@
.%%..%%.@
.%%..%%.@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%..%%.@
.%%%%%..@
........@@
..%%%%..@
.%%..%%.@
.%%.....@
.%%..%%.@
..%%%%..@
........@@
.%%%%%..@
.%%..%%.@
.%%..%%.@
.%%..%%.@
.%%%%%..@
........@@
.%%%%%%.@
.%%.....@
.%%%%...@
.%%.....@
.%%%%%%.@
........@@
.%%%%%%.@
.%%.....@
.%%%%...@
.%%.....@
.%%.....@
........@@
..%%%%..@
.%%.....@
.%%.%%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%..%%.@
.%%%%%%.@
.%%..%%.@
.%%..%%.@
........@@
.%%%%%%.@
...%%...@
...%%...@
...%%...@
.%%%%%%.@
........@@
.%%%%%%.@
.....%%.@
.....%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%.%%..@
.%%%%...@
.%%.%%..@
.%%..%%.@
........@@
.%%.....@
.%%.....@
.%%.....@
.%%.....@
.%%%%%%.@
........@@
.%%...%%.@
.%%%.%%%.@
.%%.%.%%.@
.%%...%%.@
.%%...%%.@
.........@@
.%%..%%.@
.%%%.%%.@
.%%.%%%.@
.%%..%%.@
.%%..%%.@
........@@
..%%%%..@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%.....@
.%%.....@
........@@
..%%%%..@
.%%..%%.@
.%%.%%%.@
.%%..%%.@
..%%%%%.@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%..%%.@
.%%..%%.@
........@@
..%%%%..@
.%%.....@
..%%%%..@
.....%%.@
..%%%%..@
........@@
.%%%%%%.@
...%%...@
...%%...@
...%%...@
...%%...@
........@@
.%%..%%.@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
...%%...@
........@@
.%%...%%.@
.%%...%%.@
.%%.%.%%.@
.%%%%%%%.@
..%%.%%..@
.........@@
.%%..%%.@
..%%%%..@
...%%...@
..%%%%..@
.%%..%%.@
........@@
.%%..%%.@
..%%%%..@
...%%...@
...%%...@
...%%...@
........@@
.%%%%%%.@
....%%..@
...%%...@
..%%....@
.%%%%%%.@
........@@
...%%%%.@
...%%...@
.%%%....@
...%%...@
...%%%%.@
........@@
...%%...@
...%%...@
...%%...@
...%%...@
...%%...@
...%%...@@
.%%%%...@
...%%...@
....%%%.@
...%%...@
.%%%%...@
........@@
..%%%.%.@
.%.%%%..@
........@
........@
........@
........@@
.%%..%%.@
........@
..%%%%%.@
.%%..%%.@
..%%%%%.@
........@@
.%%..%%.@
........@
..%%%%..@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
........@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
........@
..%%%%%.@
.%%..%%.@
..%%%%%.@
........@@
.%%..%%.@
........@
..%%%%..@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
........@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
..%%%%%..@
.%%...%%.@
.%%.%%%..@
.%%...%%.@
.%%.%%%..@
.%%......@@
`
@@ -0,0 +1,6 @@
module.exports = {
"longPressMessage": `Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen`
};
//# sourceMappingURL=nl-NL.main.js.map
@@ -0,0 +1,23 @@
# cookie-signature
Sign and unsign cookies.
## Example
```js
var cookie = require('cookie-signature');
var val = cookie.sign('hello', 'tobiiscool');
val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');
var val = cookie.sign('hello', 'tobiiscool');
cookie.unsign(val, 'tobiiscool').should.equal('hello');
cookie.unsign(val, 'luna').should.be.false;
```
## License
MIT.
See LICENSE file for details.
@@ -0,0 +1,28 @@
let newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
let ruleClean = /\/\*[^]*?\*\/| +/g;
let ruleNewline = /\n+/g;
let empty = ' ';
/**
* Convert a css style string into a object
* @param {String} val
* @returns {Object}
*/
export let astish = (val) => {
let tree = [{}];
let block, left;
while ((block = newRule.exec(val.replace(ruleClean, '')))) {
// Remove the current entry
if (block[4]) {
tree.shift();
} else if (block[3]) {
left = block[3].replace(ruleNewline, empty).trim();
tree.unshift((tree[0][left] = tree[0][left] || {}));
} else {
tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
}
}
return tree[0];
};
@@ -0,0 +1 @@
{"name":"value-or-function","version":"3.0.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532123767,"integrity":"sha512-b9a05g1W2P5ph6p0hW8iVR7QDzwmESx7/s//J1FlhGTblHlQD5PdQT1BSIVWs3/PV58WAEEABDWiybuDMuQIAA==","mode":420,"size":1097},"README.md":{"checkedAt":1794532123767,"integrity":"sha512-OCoXXNrxkU/Mf0B8TD1/XfCjggM/tgkSR3lue9dgp6cUHdXz88mM+zQDdGfWeiIvbJMCqObCTNGMMiErT3Lyow==","mode":420,"size":4361},"LICENSE":{"checkedAt":1794532123767,"integrity":"sha512-ap3nXe78RN//RkXEH+ezjwi9pAVMScKg/Zf8MSwLNIRb/1h+t1kNsVVBDdfg726oOXWY5qB5bd81+srkjd6wMw==","mode":420,"size":1122},"index.js":{"checkedAt":1794532123767,"integrity":"sha512-SJPqVbDyE2P0Z4bMNhU8JdfG07S1XJnmnha2+YBzbXQMSzaS0l8Ol33bNp09xHSOKy45uIJI65uTzBSRWgbqGw==","mode":420,"size":2137}}}
@@ -0,0 +1,367 @@
<div align="center">
<a href="https://vitejs.dev/">
<img width="200" height="200" hspace="10" src="https://vitejs.dev/logo.svg" alt="vite logo" />
</a>
<h1>Vite Image Optimizer</h1>
<p>
Plugin for <a href="https://vitejs.dev/">Vite</a> to optimize all images assets using <a href="https://github.com/lovell/sharp">Sharp.js</a> and <a href="https://github.com/svg/svgo">SVGO</a> at build time.
</p>
<img src="https://img.shields.io/node/v/vite-plugin-image-optimizer" alt="node-current" />
<img src="https://img.shields.io/npm/dependency-version/vite-plugin-image-optimizer/peer/vite" alt="npm peer dependency version" />
<img src="https://img.shields.io/bundlephobia/minzip/vite-plugin-image-optimizer?label=minfied" alt="npm bundle size"/>
<img src="https://img.shields.io/github/v/release/fatehak/vite-plugin-image-optimizer" alt="GitHub release" />
<img src="https://img.shields.io/npm/l/vite-plugin-image-optimizer" alt="licence" />
</div>
<p>&nbsp;</p>
## Features
- Optimize SVG assets using [SVGO](https://github.com/svg/svgo) and pass custom configs.
- Optimize Raster assets (png, jpeg, gif, tiff, webp, avif) using [Sharp.js](https://github.com/lovell/sharp) with the option to pass custom configs for each extension type.
- Option to process all assets from your `public` directory defined in the bundler.
- Configure `test`, `include`, and `exclude` to filter assets.
- Caching support to avoid re-optimization (optional)
- Skips processing assets if their optimized size is greater than their original size.
- Log the optimization stats showing the before and after size difference, ratio and total savings (optional)
![terminal output image](https://images2.imgbox.com/6c/e7/DRpgWUM6_o.png)
## Motivation
This plugin is based on the awesome [image-minimizer-webpack-plugin](https://github.com/webpack-contrib/image-minimizer-webpack-plugin) for Webpack. I wanted to combine the
optimization capabilities of
**Sharp.js** and **SVGO** in a single package and I couldn't find a plugin
for Vite that could accomplish this. I initially thought of adding [squoosh](https://github.com/GoogleChromeLabs/squoosh) and [imagemin](https://github.com/imagemin/imagemin) support as well but
dropped the idea since they are no
longer
maintained.
If you find the plugin useful, consider showing your support by giving a ⭐
Contributions are most welcome! We follow [conventional-commits](https://www.conventionalcommits.org/en/v1.0.0/)
## Installation
You can add it as a dev dependency to any of the package managers (NPM, Yarn, PNPM)
Supports `Vite >=3` and `Node >=14`
```console
npm install vite-plugin-image-optimizer --save-dev
```
> **Warning**
>
> `sharp` and `svgo` don't come installed as part of the package. You will have to install them manually and add it as a dev dependency. This is a design decision so you can choose to skip installing
> `sharp`
> if you only want to optimize svg assets using `svgo` and vice versa.
>
> ```console
> npm install sharp --save-dev
> ```
>
> ```console
> npm install svgo --save-dev
> ```
## Usage
```js
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
import { defineConfig } from 'vite';
export default defineConfig(() => {
return {
plugins: [
ViteImageOptimizer({
/* pass your config */
}),
],
};
});
```
## Default Configuration
The default configuration is made for lossless compression of image assets.
```js
const DEFAULT_OPTIONS = {
logStats: true,
ansiColors: true,
test: /\.(jpe?g|png|gif|tiff|webp|svg|avif)$/i,
exclude: undefined,
include: undefined,
includePublic: true,
svg: {
multipass: true,
plugins: [
{
name: 'preset-default',
params: {
overrides: {
cleanupNumericValues: false,
cleanupIds: {
minify: false,
remove: false,
},
convertPathData: false,
},
},
},
'sortAttrs',
{
name: 'addAttributesToSVGElement',
params: {
attributes: [{ xmlns: 'http://www.w3.org/2000/svg' }],
},
},
],
},
png: {
// https://sharp.pixelplumbing.com/api-output#png
quality: 100,
},
jpeg: {
// https://sharp.pixelplumbing.com/api-output#jpeg
quality: 100,
},
jpg: {
// https://sharp.pixelplumbing.com/api-output#jpeg
quality: 100,
},
tiff: {
// https://sharp.pixelplumbing.com/api-output#tiff
quality: 100,
},
// gif does not support lossless compression
// https://sharp.pixelplumbing.com/api-output#gif
gif: {},
webp: {
// https://sharp.pixelplumbing.com/api-output#webp
lossless: true,
},
avif: {
// https://sharp.pixelplumbing.com/api-output#avif
lossless: true,
},
cache: false,
cacheLocation: undefined,
};
```
## Plugin Options
- **[`test`](#test)**
- **[`include`](#include)**
- **[`exclude`](#exclude)**
- **[`includePublic`](#includepublic)**
- **[`logStats`](#logstats)**
- **[`ansiColors`](#ansiColors)**
- **[`svg`](#svg)**
- **[`png`](#png)**
- **[`jpeg`](#jpeg)**
- **[`tiff`](#tiff)**
- **[`gif`](#gif)**
- **[`webp`](#webp)**
- **[`avif`](#webp)**
- **[`cache`](#cache)**
- **[`cacheLocation`](#cache)**
### `test`
Type: `RegExp`
Default: `/\.(jpe?g|png|gif|tiff|webp|svg|avif)$/i`
Test to match files against.
### `exclude`
Type: `String` | `RegExp` | `Array<string>`
Default: `undefined`
Files to exclude. `RegExp` can be used on the source path to exclude a particular folder (`exclude: /textures/`).
### `include`
Type: `String` | `RegExp` | `Array<string>`
Default: `undefined`
Files to include. `RegExp` can be used on the source path to include a particular folder (`include: /textures/`).
> **Warning**
>
> This will override any options set in `test` and `exclude` and has a higher preference. Use this option if you want to include specific assets only.
### `includePublic`
Type: `boolean`
Default: `true`
Include all assets within the public directory defined in Vite. When `true` it will recursively traverse the directory and optimize all the assets.
### `logStats`
Type: `boolean`
Default: `true`
Logs the optimization stats to terminal output with file size difference in kB, percent increase/decrease and total savings.
### `ansiColors`
Type: `boolean`
Default: `true`
Logs the optimization stats or errors with ansi colors in the terminal. Set it to `false` for shells that don't support color text.
### `svg`
Type: [`SVGOConfig`](https://github.com/svg/svgo/blob/main/lib/svgo.d.ts#L28)
Default:
```js
{
multipass: true,
plugins: [
{
name: 'preset-default',
params: {
overrides: {
cleanupNumericValues: false,
removeViewBox: false, // https://github.com/svg/svgo/issues/1128
},
cleanupIDs: {
minify: false,
remove: false,
},
convertPathData: false,
},
},
'sortAttrs',
{
name: 'addAttributesToSVGElement',
params: {
attributes: [{ xmlns: 'http://www.w3.org/2000/svg' }],
},
},
]
}
```
Config object to pass to SVGO, you can override it with your custom config.
### `png`
Type: [`PngOptions`](https://github.com/lovell/sharp/blob/main/lib/index.d.ts#L1200)
Default:
```js
{
// https://sharp.pixelplumbing.com/api-output#png
quality: 100,
}
```
Config object to pass to Sharp.js for assets with `png` extension
### `jpeg`
Type: [`JpegOptions`](https://github.com/lovell/sharp/blob/main/lib/index.d.ts#L1060)
Default:
```js
{
// https://sharp.pixelplumbing.com/api-output#jpeg
quality: 100,
}
```
Config object to pass to Sharp.js for assets with `jpg` or `jpeg` extension
### `gif`
Type: [`GifOptions`](https://github.com/lovell/sharp/blob/main/lib/index.d.ts#L1156)
Default:
```js
{
// https://sharp.pixelplumbing.com/api-output#gif
}
```
Config object to pass to Sharp.js for assets with `gif` extension
### `tiff`
Type: [`TiffOptions`](https://github.com/lovell/sharp/blob/main/lib/index.d.ts#L1175)
Default:
```js
{
// https://sharp.pixelplumbing.com/api-output#tiff
quality: 100,
}
```
Config object to pass to Sharp.js for assets with `tiff` extension
### `webp`
Type: [`WebpOptions`](https://github.com/lovell/sharp/blob/main/lib/index.d.ts#L1113)
Default:
```js
{
// https://sharp.pixelplumbing.com/api-output#webp
lossless: true,
}
```
Config object to pass to Sharp.js for assets with `webp` extension
### `avif`
Type: [`AvifOptions`](https://github.com/lovell/sharp/blob/main/lib/index.d.ts#L1132)
Default:
```js
{
// https://sharp.pixelplumbing.com/api-output#avif
lossless: true,
}
```
Config object to pass to Sharp.js for assets with `avif` extension
### `cache`
Type: `boolean`
Default: `false`
Cache assets in `cacheLocation`. When enabled, reads and writes asset files with their hash suffix from the specified path.
### `cacheLocation`
Type: `String`
Default: `undefined`
Path to the cache directory. Can be used with GitHub Actions and other build servers that support cache directories to speed up consecutive builds.
## License
[MIT](./LICENSE)
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more