fix(products): fix breadcrumbs and product filtering (backport from main)
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions

View File

@@ -0,0 +1,13 @@
pre.diff-highlight > code .token.deleted:not(.prefix),
pre > code.diff-highlight .token.deleted:not(.prefix) {
background-color: rgba(255, 0, 0, .1);
color: inherit;
display: block;
}
pre.diff-highlight > code .token.inserted:not(.prefix),
pre > code.diff-highlight .token.inserted:not(.prefix) {
background-color: rgba(0, 255, 128, .1);
color: inherit;
display: block;
}

View File

@@ -0,0 +1,345 @@
# Help
* [Log rotation](#rotate)
* [Reopening log files](#reopening)
* [Saving to multiple files](#multiple)
* [Log filtering](#filter-logs)
* [Transports and systemd](#transport-systemd)
* [Log to different streams](#multi-stream)
* [Duplicate keys](#dupe-keys)
* [Log levels as labels instead of numbers](#level-string)
* [Pino with `debug`](#debug)
* [Unicode and Windows terminal](#windows)
* [Mapping Pino Log Levels to Google Cloud Logging (Stackdriver) Severity Levels](#stackdriver)
* [Using Grafana Loki to evaluate pino logs in a kubernetes cluster](#grafana-loki)
* [Avoid Message Conflict](#avoid-message-conflict)
* [Best performance for logging to `stdout`](#best-performance-for-stdout)
* [Testing](#testing)
<a id="rotate"></a>
## Log rotation
Use a separate tool for log rotation:
We recommend [logrotate](https://github.com/logrotate/logrotate).
Consider we output our logs to `/var/log/myapp.log` like so:
```
$ node server.js > /var/log/myapp.log
```
We would rotate our log files with logrotate, by adding the following to `/etc/logrotate.d/myapp`:
```
/var/log/myapp.log {
su root
daily
rotate 7
delaycompress
compress
notifempty
missingok
copytruncate
}
```
The `copytruncate` configuration has a very slight possibility of lost log lines due
to a gap between copying and truncating - the truncate may occur after additional lines
have been written. To perform log rotation without `copytruncate`, see the [Reopening log files](#reopening)
help.
<a id="reopening"></a>
## Reopening log files
In cases where a log rotation tool doesn't offer copy-truncate capabilities,
or where using them is deemed inappropriate, `pino.destination`
can reopen file paths after a file has been moved away.
One way to use this is to set up a `SIGUSR2` or `SIGHUP` signal handler that
reopens the log file destination, making sure to write the process PID out
somewhere so the log rotation tool knows where to send the signal.
```js
// write the process pid to a well known location for later
const fs = require('node:fs')
fs.writeFileSync('/var/run/myapp.pid', process.pid)
const dest = pino.destination('/log/file')
const logger = require('pino')(dest)
process.on('SIGHUP', () => dest.reopen())
```
The log rotation tool can then be configured to send this signal to the process
after a log rotation event has occurred.
Given a similar scenario as in the [Log rotation](#rotate) section a basic
`logrotate` config that aligns with this strategy would look similar to the following:
```
/var/log/myapp.log {
su root
daily
rotate 7
delaycompress
compress
notifempty
missingok
postrotate
kill -HUP `cat /var/run/myapp.pid`
endscript
}
```
<a id="multiple"></a>
## Saving to multiple files
See [`pino.multistream`](/docs/api.md#pino-multistream).
<a id="filter-logs"></a>
## Log Filtering
The Pino philosophy advocates common, preexisting, system utilities.
Some recommendations in line with this philosophy are:
1. Use [`grep`](https://linux.die.net/man/1/grep):
```sh
$ # View all "INFO" level logs
$ node app.js | grep '"level":30'
```
1. Use [`jq`](https://stedolan.github.io/jq/):
```sh
$ # View all "ERROR" level logs
$ node app.js | jq 'select(.level == 50)'
```
<a id="transport-systemd"></a>
## Transports and systemd
`systemd` makes it complicated to use pipes in services. One method for overcoming
this challenge is to use a subshell:
```
ExecStart=/bin/sh -c '/path/to/node app.js | pino-transport'
```
<a id="multi-stream"></a>
## Log to different streams
Pino's default log destination is the singular destination of `stdout`. While
not recommended for performance reasons, multiple destinations can be targeted
by using [`pino.multistream`](/docs/api.md#pino-multistream).
In this example, we use `stderr` for `error` level logs and `stdout` as default
for all other levels (e.g. `debug`, `info`, and `warn`).
```js
const pino = require('pino')
var streams = [
{level: 'debug', stream: process.stdout},
{level: 'error', stream: process.stderr},
{level: 'fatal', stream: process.stderr}
]
const logger = pino({
name: 'my-app',
level: 'debug', // must be the lowest level of all streams
}, pino.multistream(streams))
```
<a id="dupe-keys"></a>
## How Pino handles duplicate keys
Duplicate keys are possibly when a child logger logs an object with a key that
collides with a key in the child loggers bindings.
See the [child logger duplicate keys caveat](/docs/child-loggers.md#duplicate-keys-caveat)
for information on this is handled.
<a id="level-string"></a>
## Log levels as labels instead of numbers
Pino log lines are meant to be parsable. Thus, Pino's default mode of operation
is to print the level value instead of the string name.
However, you can use the [`formatters`](/docs/api.md#formatters-object) option
with a [`level`](/docs/api.md#level) function to print the string name instead of the level value :
```js
const pino = require('pino')
const log = pino({
formatters: {
level: (label) => {
return {
level: label
}
}
}
})
log.info('message')
// {"level":"info","time":1661632832200,"pid":18188,"hostname":"foo","msg":"message"}
```
Although it works, we recommend using one of these options instead if you are able:
1. If the only change desired is the name then a transport can be used. One such
transport is [`pino-text-level-transport`](https://npm.im/pino-text-level-transport).
1. Use a prettifier like [`pino-pretty`](https://npm.im/pino-pretty) to make
the logs human friendly.
<a id="debug"></a>
## Pino with `debug`
The popular [`debug`](https://npm.im/debug) is used in many modules across the ecosystem.
The [`pino-debug`](https://github.com/pinojs/pino-debug) module
can capture calls to `debug` loggers and run them
through `pino` instead. This results in a 10x (20x in asynchronous mode)
performance improvement - even though `pino-debug` is logging additional
data and wrapping it in JSON.
To quickly enable this install [`pino-debug`](https://github.com/pinojs/pino-debug)
and preload it with the `-r` flag, enabling any `debug` logs with the
`DEBUG` environment variable:
```sh
$ npm i pino-debug
$ DEBUG=* node -r pino-debug app.js
```
[`pino-debug`](https://github.com/pinojs/pino-debug) also offers fine-grain control to map specific `debug`
namespaces to `pino` log levels. See [`pino-debug`](https://github.com/pinojs/pino-debug)
for more.
<a id="windows"></a>
## Unicode and Windows terminal
Pino uses [sonic-boom](https://github.com/mcollina/sonic-boom) to speed
up logging. Internally, it uses [`fs.write`](https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_write_fd_string_position_encoding_callback) to write log lines directly to a file
descriptor. On Windows, Unicode output is not handled properly in the
terminal (both `cmd.exe` and PowerShell), and as such the output could
be visualized incorrectly if the log lines include utf8 characters. It
is possible to configure the terminal to visualize those characters
correctly with the use of [`chcp`](https://ss64.com/nt/chcp.html) by
executing in the terminal `chcp 65001`. This is a known limitation of
Node.js.
<a id="stackdriver"></a>
## Mapping Pino Log Levels to Google Cloud Logging (Stackdriver) Severity Levels
Google Cloud Logging uses `severity` levels instead of log levels. As a result, all logs may show as INFO
level logs while completely ignoring the level set in the pino log. Google Cloud Logging also prefers that
log data is present inside a `message` key instead of the default `msg` key that Pino uses. Use a technique
similar to the one below to retain log levels in Google Cloud Logging
```js
const pino = require('pino')
// https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity
const PinoLevelToSeverityLookup = {
trace: 'DEBUG',
debug: 'DEBUG',
info: 'INFO',
warn: 'WARNING',
error: 'ERROR',
fatal: 'CRITICAL',
};
const defaultPinoConf = {
messageKey: 'message',
formatters: {
level(label, number) {
return {
severity: PinoLevelToSeverityLookup[label] || PinoLevelToSeverityLookup['info'],
level: number,
}
}
},
}
module.exports = function createLogger(options) {
return pino(Object.assign({}, options, defaultPinoConf))
}
```
A library that configures Pino for
[Google Cloud Structured Logging](https://cloud.google.com/logging/docs/structured-logging)
is available at:
[@google-cloud/pino-logging-gcp-config](https://www.npmjs.com/package/@google-cloud/pino-logging-gcp-config)
This library has the following features:
+ Converts Pino log levels to Google Cloud Logging log levels, as above
+ Uses `message` instead of `msg` for the message key, as above
+ Adds a millisecond-granularity timestamp in the
[structure](https://cloud.google.com/logging/docs/agent/logging/configuration#timestamp-processing)
recognised by Google Cloud Logging eg: \
`"timestamp":{"seconds":1445470140,"nanos":123000000}`
+ Adds a sequential
[`insertId`](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#FIELDS.insert_id)
to ensure log messages with identical timestamps are ordered correctly.
+ Logs including an `Error` object have the
[`stack_trace`](https://cloud.google.com/error-reporting/docs/formatting-error-messages#log-error)
property set so that the error is forwarded to Google Cloud Error Reporting.
+ Includes a
[`ServiceContext`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext)
object in the logs for Google Cloud Error Reporting, auto detected from the
environment if not specified
+ Maps the OpenTelemetry properties `span_id`, `trace_id`, and `trace_flags`
to the equivalent Google Cloud Logging fields.
<a id="grafana-loki"></a>
## Using Grafana Loki to evaluate pino logs in a kubernetes cluster
To get pino logs into Grafana Loki there are two options:
1. **Push:** Use [pino-loki](https://github.com/Julien-R44/pino-loki) to send logs directly to Loki.
1. **Pull:** Configure Grafana Promtail to read and properly parse the logs before sending them to Loki.
Similar to Google Cloud logging, this involves remapping the log levels. See this [article](https://medium.com/@janpaepke/structured-logging-in-the-grafana-monitoring-stack-8aff0a5af2f5) for details.
<a id="avoid-message-conflict"></a>
## Avoid Message Conflict
As described in the [`message` documentation](/docs/api.md#message), when a log
is written like `log.info({ msg: 'a message' }, 'another message')` then the
final output JSON will have `"msg":"another message"` and the `'a message'`
string will be lost. To overcome this, the [`logMethod` hook](/docs/api.md#logmethod)
can be used:
```js
'use strict'
const log = require('pino')({
level: 'debug',
hooks: {
logMethod (inputArgs, method) {
if (inputArgs.length === 2 && inputArgs[0].msg) {
inputArgs[0].originalMsg = inputArgs[0].msg
}
return method.apply(this, inputArgs)
}
}
})
log.info('no original message')
log.info({ msg: 'mapped to originalMsg' }, 'a message')
// {"level":30,"time":1596313323106,"pid":63739,"hostname":"foo","msg":"no original message"}
// {"level":30,"time":1596313323107,"pid":63739,"hostname":"foo","msg":"a message","originalMsg":"mapped to originalMsg"}
```
<a id="best-performance-for-stdout"></a>
## Best performance for logging to `stdout`
The best performance for logging directly to stdout is _usually_ achieved by using the
default configuration:
```js
const log = require('pino')();
```
You should only have to configure custom transports or other settings
if you have broader logging requirements.
<a id="testing"></a>
## Testing
See [`pino-test`](https://github.com/pinojs/pino-test).

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/mysql-core/query-builders/index.ts"],"sourcesContent":["export * from './delete.ts';\nexport * from './insert.ts';\nexport * from './query-builder.ts';\nexport * from './select.ts';\nexport * from './select.types.ts';\nexport * from './update.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/instrument/fetch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAWlE;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,EACzC,oBAAoB,CAAC,EAAE,OAAO,GAC7B,IAAI,CAIN;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,GAAG,IAAI,CAIjG;AA6MD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAwBpF"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../src/exports/i18n/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,uCAAuC,CAAA"}

View File

@@ -0,0 +1,47 @@
import { useState } from 'react';
import { initPrefersReducedMotion } from './index.mjs';
import { warnOnce } from '../warn-once.mjs';
import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';
/**
* A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.
*
* This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing
* `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.
*
* It will actively respond to changes and re-render your components with the latest setting.
*
* ```jsx
* export function Sidebar({ isOpen }) {
* const shouldReduceMotion = useReducedMotion()
* const closedX = shouldReduceMotion ? 0 : "-100%"
*
* return (
* <motion.div animate={{
* opacity: isOpen ? 1 : 0,
* x: isOpen ? 0 : closedX
* }} />
* )
* }
* ```
*
* @return boolean
*
* @public
*/
function useReducedMotion() {
/**
* Lazy initialisation of prefersReducedMotion
*/
!hasReducedMotionListener.current && initPrefersReducedMotion();
const [shouldReduceMotion] = useState(prefersReducedMotion.current);
if (process.env.NODE_ENV !== "production") {
warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.");
}
/**
* TODO See if people miss automatically updating shouldReduceMotion setting
*/
return shouldReduceMotion;
}
export { useReducedMotion };

View File

@@ -0,0 +1,6 @@
type DefaultDrawerTitleActionsProps = {
hasCreatePermission: boolean;
};
export declare function ListDrawerCreateNewDocButton({ hasCreatePermission, }: DefaultDrawerTitleActionsProps): import("react").JSX.Element;
export {};
//# sourceMappingURL=ListDrawerCreateNewDocButton.d.ts.map

View File

@@ -0,0 +1 @@
{"v0.8":{"start":"2012-06-25","end":"2014-07-31"},"v0.10":{"start":"2013-03-11","end":"2016-10-31"},"v0.12":{"start":"2015-02-06","end":"2016-12-31"},"v4":{"start":"2015-09-08","lts":"2015-10-12","maintenance":"2017-04-01","end":"2018-04-30","codename":"Argon"},"v5":{"start":"2015-10-29","maintenance":"2016-04-30","end":"2016-06-30"},"v6":{"start":"2016-04-26","lts":"2016-10-18","maintenance":"2018-04-30","end":"2019-04-30","codename":"Boron"},"v7":{"start":"2016-10-25","maintenance":"2017-04-30","end":"2017-06-30"},"v8":{"start":"2017-05-30","lts":"2017-10-31","maintenance":"2019-01-01","end":"2019-12-31","codename":"Carbon"},"v9":{"start":"2017-10-01","maintenance":"2018-04-01","end":"2018-06-30"},"v10":{"start":"2018-04-24","lts":"2018-10-30","maintenance":"2020-05-19","end":"2021-04-30","codename":"Dubnium"},"v11":{"start":"2018-10-23","maintenance":"2019-04-22","end":"2019-06-01"},"v12":{"start":"2019-04-23","lts":"2019-10-21","maintenance":"2020-11-30","end":"2022-04-30","codename":"Erbium"},"v13":{"start":"2019-10-22","maintenance":"2020-04-01","end":"2020-06-01"},"v14":{"start":"2020-04-21","lts":"2020-10-27","maintenance":"2021-10-19","end":"2023-04-30","codename":"Fermium"},"v15":{"start":"2020-10-20","maintenance":"2021-04-01","end":"2021-06-01"},"v16":{"start":"2021-04-20","lts":"2021-10-26","maintenance":"2022-10-18","end":"2023-09-11","codename":"Gallium"},"v17":{"start":"2021-10-19","maintenance":"2022-04-01","end":"2022-06-01"},"v18":{"start":"2022-04-19","lts":"2022-10-25","maintenance":"2023-10-18","end":"2025-04-30","codename":"Hydrogen"},"v19":{"start":"2022-10-18","maintenance":"2023-04-01","end":"2023-06-01"},"v20":{"start":"2023-04-18","lts":"2023-10-24","maintenance":"2024-10-22","end":"2026-04-30","codename":"Iron"},"v21":{"start":"2023-10-17","maintenance":"2024-04-01","end":"2024-06-01"},"v22":{"start":"2024-04-24","lts":"2024-10-29","maintenance":"2025-10-21","end":"2027-04-30","codename":"Jod"},"v23":{"start":"2024-10-16","maintenance":"2025-04-01","end":"2025-06-01"},"v24":{"start":"2025-05-06","lts":"2025-10-28","maintenance":"2026-10-20","end":"2028-04-30","codename":"Krypton"},"v25":{"start":"2025-10-15","maintenance":"2026-04-01","end":"2026-06-01"},"v26":{"start":"2026-04-22","lts":"2026-10-28","maintenance":"2027-10-20","end":"2029-04-30","codename":""}}

View File

@@ -0,0 +1,64 @@
/** The Standard Schema interface. */
export interface StandardSchemaV1<Input = unknown, Output = Input> {
/** The Standard Schema properties. */
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
}
export declare namespace StandardSchemaV1 {
/** The Standard Schema properties interface. */
export interface Props<Input = unknown, Output = Input> {
/** The version number of the standard. */
readonly version: 1;
/** The vendor name of the schema library. */
readonly vendor: string;
/** Validates unknown input values. */
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
/** Inferred types associated with the schema. */
readonly types?: Types<Input, Output> | undefined;
}
/** The result interface of the validate function. */
export type Result<Output> = SuccessResult<Output> | FailureResult;
/** The result interface if validation succeeds. */
export interface SuccessResult<Output> {
/** The typed output value. */
readonly value: Output;
/** The non-existent issues. */
readonly issues?: undefined;
}
/** The result interface if validation fails. */
export interface FailureResult {
/** The issues of failed validation. */
readonly issues: ReadonlyArray<Issue>;
}
/** The issue interface of the failure output. */
export interface Issue {
/** The error message of the issue. */
readonly message: string;
/** The path of the issue, if any. */
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
}
/** The path segment interface of the issue. */
export interface PathSegment {
/** The key representing a path segment. */
readonly key: PropertyKey;
}
/** The Standard Schema types interface. */
export interface Types<Input = unknown, Output = Input> {
/** The input type of the schema. */
readonly input: Input;
/** The output type of the schema. */
readonly output: Output;
}
/** Infers the input type of a Standard Schema. */
export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
/** Infers the output type of a Standard Schema. */
export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
}

View File

@@ -0,0 +1,417 @@
const { serialize } = require('.');
const formDataAppend = global.FormData.prototype.append;
beforeEach(() => {
global.FormData.prototype.append = jest.fn(formDataAppend);
});
test('undefined', () => {
const formData = serialize({
foo: undefined,
});
expect(formData.append).not.toHaveBeenCalled();
expect(formData.get('foo')).toBe(null);
});
test('null', () => {
const formData = serialize({
foo: null,
});
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenCalledWith('foo', '');
expect(formData.get('foo')).toBe('');
});
test('null with nullsAsUndefineds option', () => {
const formData = serialize(
{
foo: null,
},
{
nullsAsUndefineds: true,
},
);
expect(formData.append).not.toHaveBeenCalled();
expect(formData.get('foo')).toBe(null);
});
test('boolean', () => {
const formData = serialize({
foo: true,
bar: false,
});
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo', true);
expect(formData.append).toHaveBeenNthCalledWith(2, 'bar', false);
expect(formData.get('foo')).toBe('true');
expect(formData.get('bar')).toBe('false');
});
test('boolean with booleansAsIntegers option', () => {
const formData = serialize(
{
foo: true,
bar: false,
},
{
booleansAsIntegers: true,
},
);
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo', 1);
expect(formData.append).toHaveBeenNthCalledWith(2, 'bar', 0);
expect(formData.get('foo')).toBe('1');
expect(formData.get('bar')).toBe('0');
});
test('integer', () => {
const formData = serialize({
foo: 1,
});
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenCalledWith('foo', 1);
expect(formData.get('foo')).toBe('1');
});
test('float', () => {
const formData = serialize({
foo: 1.01,
});
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenCalledWith('foo', 1.01);
expect(formData.get('foo')).toBe('1.01');
});
test('string', () => {
const formData = serialize({
foo: 'bar',
});
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenCalledWith('foo', 'bar');
expect(formData.get('foo')).toBe('bar');
});
test('empty string', () => {
const formData = serialize({
foo: '',
});
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenCalledWith('foo', '');
expect(formData.get('foo')).toBe('');
});
test('Object', () => {
const formData = serialize({
foo: {
bar: 'baz',
qux: 'quux',
},
});
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo[bar]', 'baz');
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo[qux]', 'quux');
expect(formData.get('foo[bar]')).toBe('baz');
expect(formData.get('foo[qux]')).toBe('quux');
});
test('empty Object', () => {
const formData = serialize({
foo: {},
});
expect(formData.append).not.toHaveBeenCalled();
expect(formData.get('foo')).toBe(null);
});
test('Object in Array', () => {
const formData = serialize({
foo: [
{
bar: 'baz',
},
{
qux: 'quux',
},
],
});
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo[][bar]', 'baz');
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo[][qux]', 'quux');
expect(formData.get('foo[][bar]')).toBe('baz');
expect(formData.get('foo[][qux]')).toBe('quux');
});
test('Object in Object', () => {
const formData = serialize({
foo: {
bar: {
baz: {
qux: 'quux',
},
},
},
});
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenCalledWith('foo[bar][baz][qux]', 'quux');
expect(formData.get('foo[bar][baz][qux]')).toBe('quux');
});
test('Object with dotsForObjectNotation option', () => {
const formData = serialize(
{
foo: {
bar: 'baz',
qux: [
{
quux: 'corge',
},
],
},
},
{
dotsForObjectNotation: true,
},
);
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo.bar', 'baz');
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo.qux[].quux', 'corge');
expect(formData.get('foo.bar')).toBe('baz');
expect(formData.get('foo.qux[].quux')).toBe('corge');
});
test('Array', () => {
const formData = serialize({
foo: ['bar', 'baz'],
});
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo[]', 'bar');
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo[]', 'baz');
expect(formData.getAll('foo[]')).toEqual(['bar', 'baz']);
});
test('Array with noAttributesWithArrayNotation option', () => {
const formData = serialize(
{
foo: ['bar', 'baz'],
},
{
noAttributesWithArrayNotation: true,
},
);
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo', 'bar');
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo', 'baz');
expect(formData.getAll('foo')).toEqual(['bar', 'baz']);
});
test('empty Array', () => {
const formData = serialize({
foo: [],
});
expect(formData.append).not.toHaveBeenCalled();
expect(formData.get('foo')).toBe(null);
});
test('Array in Array', () => {
const formData = serialize({
foo: [[['bar', 'baz']]],
});
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo[][][]', 'bar');
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo[][][]', 'baz');
expect(formData.getAll('foo[][][]')).toEqual(['bar', 'baz']);
});
test('Array in Array with noAttributesWithArrayNotation option', () => {
const formData = serialize(
{
foo: [[['bar', 'baz']]],
},
{
noAttributesWithArrayNotation: true,
},
);
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo', 'bar');
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo', 'baz');
expect(formData.getAll('foo')).toEqual(['bar', 'baz']);
});
test('Array in Object', () => {
const formData = serialize({
foo: {
bar: ['baz', 'qux'],
},
});
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo[bar][]', 'baz');
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo[bar][]', 'qux');
expect(formData.getAll('foo[bar][]')).toEqual(['baz', 'qux']);
});
test('Array where key ends with "[]"', () => {
const formData = serialize({
'foo[]': ['bar', 'baz'],
});
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo[]', 'bar');
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo[]', 'baz');
expect(formData.getAll('foo[]')).toEqual(['bar', 'baz']);
});
test('Array with indices option', () => {
const formData = serialize(
{
foo: ['bar', 'baz'],
},
{
indices: true,
},
);
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo[0]', 'bar');
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo[1]', 'baz');
expect(formData.get('foo[0]')).toBe('bar');
expect(formData.get('foo[1]')).toBe('baz');
});
test('Array with indices and noAttributesWithArrayNotation option', () => {
const formData = serialize(
{
foo: ['bar', 'baz'],
},
{
indices: true,
noAttributesWithArrayNotation: true,
},
);
expect(formData.append).toHaveBeenCalledTimes(2);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo', 'bar');
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo', 'baz');
expect(formData.get('foo')).toBe('bar');
});
test('Array with allowEmptyArrays option', () => {
const formData = serialize(
{
foo: [],
},
{
allowEmptyArrays: true,
},
);
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo[]', '');
expect(formData.get('foo[]')).toBe('');
});
test('Array with allowEmptyArrays and noAttributesWithArrayNotation options', () => {
const formData = serialize(
{
foo: [],
},
{
allowEmptyArrays: true,
noAttributesWithArrayNotation: true,
},
);
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo', '');
expect(formData.get('foo')).toBe('');
});
test('Date', () => {
const foo = new Date(2000, 0, 1, 1, 1, 1);
const formData = serialize({
foo,
});
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenCalledWith('foo', foo.toISOString());
expect(formData.get('foo')).toBe(foo.toISOString());
});
test('File', () => {
const foo = new File([], '');
const formData = serialize({
foo,
});
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenCalledWith('foo', foo);
expect(formData.get('foo')).toBe(foo);
});
test('File with noFilesWithArrayNotation option', () => {
const bar = new File([], '');
const baz = new File([], '');
const foo = [bar, baz, 'qux'];
const formData = serialize(
{
foo,
},
{
noFilesWithArrayNotation: true,
},
);
expect(formData.append).toHaveBeenCalledTimes(3);
expect(formData.append).toHaveBeenNthCalledWith(1, 'foo', bar);
expect(formData.append).toHaveBeenNthCalledWith(2, 'foo', baz);
expect(formData.append).toHaveBeenNthCalledWith(3, 'foo[]', 'qux');
expect(formData.getAll('foo')).toEqual([bar, baz]);
expect(formData.getAll('foo[]')).toEqual(['qux']);
});
test('Blob', () => {
const foo = new Blob([]);
const formData = serialize({
foo,
});
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenCalledWith('foo', foo);
expect(formData.get('foo')).toEqual(new File([], ''));
});
test('React Native Blob', () => {
global.FormData.prototype.getParts = () => {};
const foo = {
uri: 'content://...',
};
const formData = serialize({
foo,
});
delete global.FormData.prototype.getParts;
expect(formData.append).toHaveBeenCalledTimes(1);
expect(formData.append).toHaveBeenCalledWith('foo', foo);
expect(formData.get('foo')).toBe('[object Object]');
});

View File

@@ -0,0 +1,6 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
const t=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function e(s,{instancePath:r="",parentData:n,parentDataProperty:a,rootData:i=s}={}){let o=null,l=0;if(0===l){if(!s||"object"!=typeof s||Array.isArray(s))return e.errors=[{params:{type:"object"}}],!1;{const r=l;for(const t in s)if("context"!==t&&"hashDigest"!==t&&"hashDigestLength"!==t&&"hashFunction"!==t)return e.errors=[{params:{additionalProperty:t}}],!1;if(r===l){if(void 0!==s.context){let r=s.context;const n=l;if(l===n){if("string"!=typeof r)return e.errors=[{params:{type:"string"}}],!1;if(r.includes("!")||!0!==t.test(r))return e.errors=[{params:{}}],!1}var u=n===l}else u=!0;if(u){if(void 0!==s.hashDigest){let t=s.hashDigest;const r=l;if("base64"!==t&&"base64url"!==t&&"hex"!==t&&"binary"!==t&&"utf8"!==t&&"utf-8"!==t&&"utf16le"!==t&&"utf-16le"!==t&&"latin1"!==t&&"ascii"!==t&&"ucs2"!==t&&"ucs-2"!==t)return e.errors=[{params:{}}],!1;u=r===l}else u=!0;if(u){if(void 0!==s.hashDigestLength){let t=s.hashDigestLength;const r=l;if(l===r){if("number"!=typeof t)return e.errors=[{params:{type:"number"}}],!1;if(t<1||isNaN(t))return e.errors=[{params:{comparison:">=",limit:1}}],!1}u=r===l}else u=!0;if(u)if(void 0!==s.hashFunction){let t=s.hashFunction;const r=l,n=l;let a=!1,i=null;const c=l,p=l;let h=!1;const m=l;if(l===m)if("string"==typeof t){if(t.length<1){const t={params:{}};null===o?o=[t]:o.push(t),l++}}else{const t={params:{type:"string"}};null===o?o=[t]:o.push(t),l++}var f=m===l;if(h=h||f,!h){const e=l;if(!(t instanceof Function)){const t={params:{}};null===o?o=[t]:o.push(t),l++}f=e===l,h=h||f}if(h)l=p,null!==o&&(p?o.length=p:o=null);else{const t={params:{}};null===o?o=[t]:o.push(t),l++}if(c===l&&(a=!0,i=0),!a){const t={params:{passingSchemas:i}};return null===o?o=[t]:o.push(t),l++,e.errors=o,!1}l=n,null!==o&&(n?o.length=n:o=null),u=r===l}else u=!0}}}}}return e.errors=o,0===l}module.exports=e,module.exports.default=e;

View File

@@ -0,0 +1 @@
{"version":3,"file":"signal-low.js","sources":["../../../src/icons/signal-low.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SignalLow\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAyMGguMDEiIC8+CiAgPHBhdGggZD0iTTcgMjB2LTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/signal-low\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst SignalLow = createLucideIcon('SignalLow', [\n ['path', { d: 'M2 20h.01', key: '4haj6o' }],\n ['path', { d: 'M7 20v-4', key: 'j294jx' }],\n]);\n\nexport default SignalLow;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,34 @@
import { CSSToken, DimensionToken, NumberValueToken, StringValueToken, TokenType } from './tokenizer';
export declare type CSSBlockType = TokenType.LEFT_PARENTHESIS_TOKEN | TokenType.LEFT_SQUARE_BRACKET_TOKEN | TokenType.LEFT_CURLY_BRACKET_TOKEN;
export interface CSSBlock {
type: CSSBlockType;
values: CSSValue[];
}
export interface CSSFunction {
type: TokenType.FUNCTION;
name: string;
values: CSSValue[];
}
export declare type CSSValue = CSSFunction | CSSToken | CSSBlock;
export declare class Parser {
private _tokens;
constructor(tokens: CSSToken[]);
static create(value: string): Parser;
static parseValue(value: string): CSSValue;
static parseValues(value: string): CSSValue[];
parseComponentValue(): CSSValue;
parseComponentValues(): CSSValue[];
private consumeComponentValue;
private consumeSimpleBlock;
private consumeFunction;
private consumeToken;
private reconsumeToken;
}
export declare const isDimensionToken: (token: CSSValue) => token is DimensionToken;
export declare const isNumberToken: (token: CSSValue) => token is NumberValueToken;
export declare const isIdentToken: (token: CSSValue) => token is StringValueToken;
export declare const isStringToken: (token: CSSValue) => token is StringValueToken;
export declare const isIdentWithValue: (token: CSSValue, value: string) => boolean;
export declare const nonWhiteSpace: (token: CSSValue) => boolean;
export declare const nonFunctionArgSeparator: (token: CSSValue) => boolean;
export declare const parseFunctionArgs: (tokens: CSSValue[]) => CSSValue[][];

View File

@@ -0,0 +1,52 @@
import { entityKind } from "../entity.js";
import { Table } from "../table.js";
import { getSQLiteColumnBuilders } from "./columns/all.js";
const InlineForeignKeys = Symbol.for("drizzle:SQLiteInlineForeignKeys");
class SQLiteTable extends Table {
static [entityKind] = "SQLiteTable";
/** @internal */
static Symbol = Object.assign({}, Table.Symbol, {
InlineForeignKeys
});
/** @internal */
[Table.Symbol.Columns];
/** @internal */
[InlineForeignKeys] = [];
/** @internal */
[Table.Symbol.ExtraConfigBuilder] = void 0;
}
function sqliteTableBase(name, columns, extraConfig, schema, baseName = name) {
const rawTable = new SQLiteTable(name, schema, baseName);
const parsedColumns = typeof columns === "function" ? columns(getSQLiteColumnBuilders()) : columns;
const builtColumns = Object.fromEntries(
Object.entries(parsedColumns).map(([name2, colBuilderBase]) => {
const colBuilder = colBuilderBase;
colBuilder.setName(name2);
const column = colBuilder.build(rawTable);
rawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable));
return [name2, column];
})
);
const table = Object.assign(rawTable, builtColumns);
table[Table.Symbol.Columns] = builtColumns;
table[Table.Symbol.ExtraConfigColumns] = builtColumns;
if (extraConfig) {
table[SQLiteTable.Symbol.ExtraConfigBuilder] = extraConfig;
}
return table;
}
const sqliteTable = (name, columns, extraConfig) => {
return sqliteTableBase(name, columns, extraConfig);
};
function sqliteTableCreator(customizeTableName) {
return (name, columns, extraConfig) => {
return sqliteTableBase(customizeTableName(name), columns, extraConfig, void 0, name);
};
}
export {
InlineForeignKeys,
SQLiteTable,
sqliteTable,
sqliteTableCreator
};
//# sourceMappingURL=table.js.map

View File

@@ -0,0 +1,28 @@
"use strict";
exports.arDZ = void 0;
var _index = require("./ar-DZ/_lib/formatDistance.cjs");
var _index2 = require("./ar-DZ/_lib/formatLong.cjs");
var _index3 = require("./ar-DZ/_lib/formatRelative.cjs");
var _index4 = require("./ar-DZ/_lib/localize.cjs");
var _index5 = require("./ar-DZ/_lib/match.cjs");
/**
* @category Locales
* @summary Arabic locale (Algerian Arabic).
* @language Algerian Arabic
* @iso-639-2 ara
* @author Badreddine Boumaza [@badre429](https://github.com/badre429)
* @author Ahmed ElShahat [@elshahat](https://github.com/elshahat)
*/
const arDZ = (exports.arDZ = {
code: "ar-DZ",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 0 /* Sunday */,
firstWeekContainsDate: 1,
},
});

View File

@@ -0,0 +1,33 @@
function _apply_decorated_descriptor(target, property, decorators, descriptor, context) {
var desc = {};
Object["ke" + "ys"](descriptor).forEach(function(key) {
desc[key] = descriptor[key];
});
desc.enumerable = !!desc.enumerable;
desc.configurable = !!desc.configurable;
if ("value" in desc || desc.initializer) desc.writable = true;
desc = decorators.slice().reverse().reduce(function(desc, decorator) {
return decorator ? decorator(target, property, desc) || desc : desc;
}, desc);
var hasAccessor = Object.prototype.hasOwnProperty.call(desc, "get") || Object.prototype.hasOwnProperty.call(desc, "set");
if (context && desc.initializer !== void 0 && !hasAccessor) {
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
desc.initializer = undefined;
}
if (hasAccessor) {
delete desc.writable;
delete desc.initializer;
delete desc.value;
}
if (desc.initializer === void 0) {
Object["define" + "Property"](target, property, desc);
desc = null;
}
return desc;
}
export { _apply_decorated_descriptor as _ };

View File

@@ -0,0 +1,104 @@
[![Prettier Banner](https://unpkg.com/prettier-logo@1.0.3/images/prettier-banner-light.svg)](https://prettier.io)
<h2 align="center">Opinionated Code Formatter</h2>
<p align="center">
<em>
JavaScript
· TypeScript
· Flow
· JSX
· JSON
</em>
<br />
<em>
CSS
· SCSS
· Less
</em>
<br />
<em>
HTML
· Vue
· Angular
</em>
<br />
<em>
GraphQL
· Markdown
· YAML
</em>
<br />
<em>
<a href="https://prettier.io/docs/plugins">
Your favorite language?
</a>
</em>
</p>
<p align="center">
<a href="https://github.com/prettier/prettier/actions?query=branch%3Amain">
<img alt="CI Status" src="https://img.shields.io/github/check-runs/prettier/prettier/main?style=flat-square&label=CI"></a>
<a href="https://codecov.io/gh/prettier/prettier">
<img alt="Coverage Status" src="https://img.shields.io/codecov/c/github/prettier/prettier.svg?style=flat-square"></a>
<a href="https://x.com/acdlite/status/974390255393505280">
<img alt="Blazing Fast" src="https://img.shields.io/badge/speed-blazing%20%F0%9F%94%A5-brightgreen.svg?style=flat-square"></a>
<br/>
<a href="https://www.npmjs.com/package/prettier">
<img alt="npm version" src="https://img.shields.io/npm/v/prettier.svg?style=flat-square"></a>
<a href="https://www.npmjs.com/package/prettier">
<img alt="weekly downloads from npm" src="https://img.shields.io/npm/dw/prettier.svg?style=flat-square"></a>
<a href="https://github.com/prettier/prettier#badge">
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"></a>
<a href="https://x.com/intent/follow?screen_name=PrettierCode">
<img alt="Follow Prettier on X" src="https://img.shields.io/badge/%40PrettierCode-9f9f9f?style=flat-square&logo=x&labelColor=555"></a>
</p>
## Intro
Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
### Input
<!-- prettier-ignore -->
```js
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());
```
### Output
```js
foo(
reallyLongArg(),
omgSoManyParameters(),
IShouldRefactorThis(),
isThereSeriouslyAnotherOne(),
);
```
Prettier can be run [in your editor](https://prettier.io/docs/editors) on-save, in a [pre-commit hook](https://prettier.io/docs/precommit), or in [CI environments](https://prettier.io/docs/cli#list-different) to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!
---
**[Documentation](https://prettier.io/docs/)**
[Install](https://prettier.io/docs/install) ·
[Options](https://prettier.io/docs/options) ·
[CLI](https://prettier.io/docs/cli) ·
[API](https://prettier.io/docs/api)
**[Playground](https://prettier.io/playground/)**
---
## Badge
Show the world you're using _Prettier_ → [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
```md
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
```
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md).

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./async').timeout;

View File

@@ -0,0 +1,11 @@
A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/)
```js
var colors = require('color-name');
colors.red //[255,0,0]
```
<a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a>

View File

@@ -0,0 +1,14 @@
/**
* Original by Scott Helme.
*
* Reference: https://scotthelme.co.uk/hpkp-cheat-sheet/
*/
Prism.languages.hpkp = {
'directive': {
pattern: /\b(?:includeSubDomains|max-age|pin-sha256|preload|report-to|report-uri|strict)(?=[\s;=]|$)/i,
alias: 'property'
},
'operator': /=/,
'punctuation': /;/
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/errors/DuplicateFieldName.ts"],"sourcesContent":["import { APIError } from './APIError.js'\n\nexport class DuplicateFieldName extends APIError {\n constructor(fieldName: string) {\n super(\n `A field with the name '${fieldName}' was found multiple times on the same level. Field names must be unique.`,\n )\n }\n}\n"],"names":["APIError","DuplicateFieldName","fieldName"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAe;AAExC,OAAO,MAAMC,2BAA2BD;IACtC,YAAYE,SAAiB,CAAE;QAC7B,KAAK,CACH,CAAC,uBAAuB,EAAEA,UAAU,yEAAyE,CAAC;IAElH;AACF"}

View File

@@ -0,0 +1,20 @@
{
"name": "@esbuild/linux-arm64",
"version": "0.25.12",
"description": "The Linux ARM 64-bit binary for esbuild, a JavaScript bundler.",
"repository": {
"type": "git",
"url": "git+https://github.com/evanw/esbuild.git"
},
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=18"
},
"os": [
"linux"
],
"cpu": [
"arm64"
]
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"arrow-down-az.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"between-horizonal-end.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}

View File

@@ -0,0 +1,18 @@
var baseGetTag = require('./_baseGetTag'),
isObjectLike = require('./isObjectLike');
/** `Object#toString` result references. */
var dateTag = '[object Date]';
/**
* The base implementation of `_.isDate` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
*/
function baseIsDate(value) {
return isObjectLike(value) && baseGetTag(value) == dateTag;
}
module.exports = baseIsDate;

View File

@@ -0,0 +1,11 @@
{
"title": "OccurrenceModuleIdsPluginOptions",
"type": "object",
"additionalProperties": false,
"properties": {
"prioritiseInitial": {
"description": "Prioritise initial size over total size.",
"type": "boolean"
}
}
}

View File

@@ -0,0 +1,8 @@
import type { NextConfigObject, SentryBuildOptions } from '../types';
/**
* Materializes the final Next.js config object with Sentry's build-time integrations applied.
*
* Note: this mutates both `incomingUserNextConfigObject` and `userSentryOptions` (to apply defaults/migrations).
*/
export declare function getFinalConfigObject(incomingUserNextConfigObject: NextConfigObject, userSentryOptions: SentryBuildOptions): NextConfigObject;
//# sourceMappingURL=getFinalConfigObject.d.ts.map

View File

@@ -0,0 +1,11 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict'
const LexicalText = process.env.NODE_ENV !== 'production' ? require('./LexicalText.dev.js') : require('./LexicalText.prod.js');
module.exports = LexicalText;

View File

@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Signal = createLucideIcon("Signal", [
["path", { d: "M2 20h.01", key: "4haj6o" }],
["path", { d: "M7 20v-4", key: "j294jx" }],
["path", { d: "M12 20v-8", key: "i3yub9" }],
["path", { d: "M17 20V8", key: "1tkaf5" }],
["path", { d: "M22 4v16", key: "sih9yq" }]
]);
export { Signal as default };
//# sourceMappingURL=signal.js.map

View File

@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ClipboardX = createLucideIcon("ClipboardX", [
["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
[
"path",
{
d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",
key: "116196"
}
],
["path", { d: "m15 11-6 6", key: "1toa9n" }],
["path", { d: "m9 11 6 6", key: "wlibny" }]
]);
export { ClipboardX as default };
//# sourceMappingURL=clipboard-x.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"EventBufferArray.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/EventBufferArray.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI7F;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,mDAAmD;IAC5C,MAAM,EAAE,cAAc,EAAE,CAAC;IAEhC,kBAAkB;IACX,WAAW,EAAE,OAAO,CAAC;IAE5B,kBAAkB;IACX,eAAe,EAAE,OAAO,CAAC;IAEhC,OAAO,CAAC,UAAU,CAAS;;IAS3B,kBAAkB;IAClB,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,kBAAkB;IAClB,IAAW,IAAI,IAAI,eAAe,CAEjC;IAED,kBAAkB;IACX,OAAO,IAAI,IAAI;IAItB,kBAAkB;IACL,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAUrE,kBAAkB;IACX,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAWhC,kBAAkB;IACX,KAAK,IAAI,IAAI;IAMpB,kBAAkB;IACX,oBAAoB,IAAI,MAAM,GAAG,IAAI;CAS7C"}

View File

@@ -0,0 +1,6 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function r(t,{instancePath:e="",parentData:s,parentDataProperty:a,rootData:n=t}={}){let o=null,i=0;if(0===i){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{let e;if(void 0===t.paths&&(e="paths"))return r.errors=[{params:{missingProperty:e}}],!1;{const e=i;for(const e in t)if("paths"!==e)return r.errors=[{params:{additionalProperty:e}}],!1;if(e===i&&void 0!==t.paths){let e=t.paths;if(i==i){if(!Array.isArray(e))return r.errors=[{params:{type:"array"}}],!1;if(e.length<1)return r.errors=[{params:{limit:1}}],!1;{const t=e.length;for(let s=0;s<t;s++){let t=e[s];const a=i,n=i;let l=!1;const u=i;if(!(t instanceof RegExp)){const r={params:{}};null===o?o=[r]:o.push(r),i++}var p=u===i;if(l=l||p,!l){const r=i;if("string"!=typeof t){const r={params:{type:"string"}};null===o?o=[r]:o.push(r),i++}p=r===i,l=l||p}if(!l){const t={params:{}};return null===o?o=[t]:o.push(t),i++,r.errors=o,!1}if(i=n,null!==o&&(n?o.length=n:o=null),a!==i)break}}}}}}}return r.errors=o,0===i}module.exports=r,module.exports.default=r;

View File

@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Underline = createLucideIcon("Underline", [
["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
]);
export { Underline as default };
//# sourceMappingURL=underline.js.map

View File

@@ -0,0 +1,9 @@
function _defaults(e, r) {
for (var t = Object.getOwnPropertyNames(r), o = 0; o < t.length; o++) {
var n = t[o],
a = Object.getOwnPropertyDescriptor(r, n);
a && a.configurable && void 0 === e[n] && Object.defineProperty(e, n, a);
}
return e;
}
export { _defaults as default };

View File

@@ -0,0 +1 @@
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AACvC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAA;AAalE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAE5B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAElB;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IAEvC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IAE1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;IAEnB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IAEpB;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAE9B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;OAGG;IACH,EAAE,CAAC,EAAE,QAAQ,CAAA;IAEb;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,MAAM,MAAM,4BAA4B,GAAG,WAAW,GAAG;IACvD,aAAa,EAAE,IAAI,CAAA;IAEnB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,WAAW,GAAG;IACxD,aAAa,CAAC,EAAE,KAAK,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,WAAW,GAAG;IACxD,aAAa,CAAC,EAAE,SAAS,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,MAAM,CAAC,IAAI,IACrB,IAAI,SAAS,4BAA4B,GAAG,IAAI,GAC9C,IAAI,SAAS,6BAA6B,GAAG,MAAM,GACnD,IAAI,SAAS,6BAA6B,GAAG,MAAM,GACnD,MAAM,GAAG,IAAI,CAAA;AACjB,MAAM,MAAM,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAA;AAE1C,MAAM,MAAM,SAAS,CAAC,IAAI,IACxB,IAAI,SAAS,4BAA4B,GAAG,IAAI,GAC9C,IAAI,SAAS,6BAA6B,GAAG,KAAK,GAClD,IAAI,SAAS,6BAA6B,GAAG,KAAK,GAClD,OAAO,CAAA;AAEX;;GAEG;AACH,qBAAa,IAAI,CAAC,IAAI,SAAS,WAAW,CAAE,YAAW,WAAW;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,OAAO,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IACvC,aAAa,EAAE,OAAO,CAAA;IACtB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,UAAU,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;IAC9B,mBAAmB,EAAE,OAAO,CAAA;IAE5B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAA;IAEV;;OAEG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAA;IAEnB;;;;;;;;;;;OAWG;gBACS,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI;IA2HlD;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAoBpC;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBzB;;OAEG;IACH,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAc9C;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAclD;;;OAGG;IACH,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGlD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;OAGG;IACH,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"}

View File

@@ -0,0 +1,121 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
export const parsedType = (data: any): string => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "number";
}
case "object": {
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "karakter", verb: "olmalı" },
file: { unit: "bayt", verb: "olmalı" },
array: { unit: "öğe", verb: "olmalı" },
set: { unit: "öğe", verb: "olmalı" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const Nouns: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "girdi",
email: "e-posta adresi",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO tarih ve saat",
date: "ISO tarih",
time: "ISO saat",
duration: "ISO süre",
ipv4: "IPv4 adresi",
ipv6: "IPv6 adresi",
cidrv4: "IPv4 aralığı",
cidrv6: "IPv6 aralığı",
base64: "base64 ile şifrelenmiş metin",
base64url: "base64url ile şifrelenmiş metin",
json_string: "JSON dizesi",
e164: "E.164 sayısı",
jwt: "JWT",
template_literal: "Şablon dizesi",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Geçersiz değer: beklenen ${issue.expected}, alınan ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1) return `Geçersiz değer: beklenen ${util.stringifyPrimitive(issue.values[0])}`;
return `Geçersiz seçenek: aşağıdakilerden biri olmalı: ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Çok büyük: beklenen ${issue.origin ?? "değer"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "öğe"}`;
return `Çok büyük: beklenen ${issue.origin ?? "değer"} ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) return `Çok küçük: beklenen ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
return `Çok küçük: beklenen ${issue.origin} ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `Geçersiz metin: "${_issue.prefix}" ile başlamalı`;
if (_issue.format === "ends_with") return `Geçersiz metin: "${_issue.suffix}" ile bitmeli`;
if (_issue.format === "includes") return `Geçersiz metin: "${_issue.includes}" içermeli`;
if (_issue.format === "regex") return `Geçersiz metin: ${_issue.pattern} desenine uymalı`;
return `Geçersiz ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Geçersiz sayı: ${issue.divisor} ile tam bölünebilmeli`;
case "unrecognized_keys":
return `Tanınmayan anahtar${issue.keys.length > 1 ? "lar" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `${issue.origin} içinde geçersiz anahtar`;
case "invalid_union":
return "Geçersiz değer";
case "invalid_element":
return `${issue.origin} içinde geçersiz değer`;
default:
return `Geçersiz değer`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","useNav","React","Wrapper","props","$","baseClass","children","className","hydrated","navOpen","shouldAnimate","t0","t1","t2","t3","filter","Boolean","t4","join","t5","_jsx"],"sources":["../../../../src/templates/Default/Wrapper/index.tsx"],"sourcesContent":["'use client'\nimport { useNav } from '@payloadcms/ui'\nimport React from 'react'\n\nimport './index.scss'\n\nexport const Wrapper: React.FC<{\n baseClass?: string\n children?: React.ReactNode\n className?: string\n}> = (props) => {\n const { baseClass, children, className } = props\n const { hydrated, navOpen, shouldAnimate } = useNav()\n\n return (\n <div\n className={[\n baseClass,\n className,\n navOpen && `${baseClass}--nav-open`,\n shouldAnimate && `${baseClass}--nav-animate`,\n hydrated && `${baseClass}--nav-hydrated`,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {children}\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,MAAM,QAAQ;AACvB,OAAOC,KAAA,MAAW;AAIlB,OAAO,MAAMC,OAAA,GAIRC,KAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACH;IAAAM,SAAA;IAAAC,QAAA;IAAAC;EAAA,IAA2CJ,KAAA;EAC3C;IAAAK,QAAA;IAAAC,OAAA;IAAAC;EAAA,IAA6CV,MAAA;EAOvC,MAAAW,EAAA,GAAAF,OAAA,IAAW,GAAGJ,SAAA,YAAqB;EACnC,MAAAO,EAAA,GAAAF,aAAA,IAAiB,GAAGL,SAAA,eAAwB;EAC5C,MAAAQ,EAAA,GAAAL,QAAA,IAAY,GAAGH,SAAA,gBAAyB;EAAA,IAAAS,EAAA;EAAA,IAAAV,CAAA,QAAAC,SAAA,IAAAD,CAAA,QAAAG,SAAA,IAAAH,CAAA,QAAAO,EAAA,IAAAP,CAAA,QAAAQ,EAAA,IAAAR,CAAA,QAAAS,EAAA;IAL/BC,EAAA,IACTT,SAAA,EACAE,SAAA,EACAI,EAAmC,EACnCC,EAA4C,EAC5CC,EAAwC,EAAAE,MAAA,CAAAC,OAEhC;IAAAZ,CAAA,MAAAC,SAAA;IAAAD,CAAA,MAAAG,SAAA;IAAAH,CAAA,MAAAO,EAAA;IAAAP,CAAA,MAAAQ,EAAA;IAAAR,CAAA,MAAAS,EAAA;IAAAT,CAAA,MAAAU,EAAA;EAAA;IAAAA,EAAA,GAAAV,CAAA;EAAA;EAPC,MAAAa,EAAA,GAAAH,EAOD,CAAAI,IAAA,CACF;EAAA,IAAAC,EAAA;EAAA,IAAAf,CAAA,QAAAE,QAAA,IAAAF,CAAA,QAAAa,EAAA;IATVE,EAAA,GAAAC,IAAA,CAAC;MAAAb,SAAA,EACYU,EAQH;MAAAX;IAAA,C;;;;;;;SATVa,E;CAcJ","ignoreList":[]}

View File

@@ -0,0 +1,121 @@
/// <reference path="../objectid.d.ts" />
import ObjectID from '../objectid';
// ----------------------------------------------------------------------------
// setup test data
const time:number = 1414093117;
const array:number[] = [ 84, 73, 90, 217, 76, 147, 71, 33, 237, 231, 109, 144 ];
const buffer:Buffer = new Buffer([84, 73, 90, 217, 76, 147, 71, 33, 237, 231, 109, 144 ]);
const hexString:string = "54495ad94c934721ede76d90";
const idString:string = "TIZÙL“G!íçm";
// ----------------------------------------------------------------------------
// should construct with no arguments
let oid = new ObjectID();
// ----------------------------------------------------------------------------
// should have an `id` property
oid.id;
// ----------------------------------------------------------------------------
// should have a `str` property
oid.str;
// ----------------------------------------------------------------------------
// should construct with a `time` argument
oid = new ObjectID(time);
// ----------------------------------------------------------------------------
// should construct with an `array` argument
oid = new ObjectID(array);
// ----------------------------------------------------------------------------
// should construct with a `buffer` argument
oid = new ObjectID(buffer);
// ----------------------------------------------------------------------------
// should construct with a `hexString` argument
oid = new ObjectID(hexString);
// ----------------------------------------------------------------------------
// should construct with a `idString` argument
oid = new ObjectID(idString);
// ----------------------------------------------------------------------------
// should construct with `ObjectID.createFromTime(time)` and should have 0's at the end
oid = ObjectID.createFromTime(time);
// ----------------------------------------------------------------------------
// should construct with `ObjectID.createFromHexString(hexString)`
oid = ObjectID.createFromHexString(hexString);
// ----------------------------------------------------------------------------
// should construct with no arguments
oid = ObjectID();
// ----------------------------------------------------------------------------
// should have an `id` property
oid.id;
// ----------------------------------------------------------------------------
// should have a `str` property
oid.str;
// ----------------------------------------------------------------------------
// should construct with a `time` argument
oid = ObjectID(time);
// ----------------------------------------------------------------------------
// should construct with an `array` argument
oid = ObjectID(array);
// ----------------------------------------------------------------------------
// should construct with a `buffer` argument
oid = ObjectID(buffer);
// ----------------------------------------------------------------------------
// should construct with a `hexString` argument
oid = ObjectID(hexString);
// ----------------------------------------------------------------------------
// should construct with a `idString` argument
oid = ObjectID(idString);
// ----------------------------------------------------------------------------
// should correctly retrieve timestamp
const timestamp:Date = oid.getTimestamp();
// ----------------------------------------------------------------------------
// should validate valid hex strings
let isValid:boolean = ObjectID.isValid(hexString);
// ----------------------------------------------------------------------------
// should validate legit ObjectID objects
isValid = ObjectID.isValid(oid);
// ----------------------------------------------------------------------------
// should invalidate bad strings
// not necessary for typescript
// ----------------------------------------------------------------------------
// should evaluate equality with .equals()
const id1 = new ObjectID();
const id2 = new ObjectID(id1.str);
const equals:boolean = id1.equals(id2);
// ----------------------------------------------------------------------------
// should evaluate equality with via deepEqual
// not necessary for typescript
// ----------------------------------------------------------------------------
// should convert to a hex string for JSON.stringify
// not necessary for typescript
// ----------------------------------------------------------------------------
// should convert to a hex string for ObjectID.toString()
const toStr:string = oid.toString();
// ----------------------------------------------------------------------------
// should throw and error if constructing with an invalid string
// not necessary for typescript

View File

@@ -0,0 +1 @@
{"version":3,"file":"folder-pen.js","sources":["../../../src/icons/folder-pen.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FolderPen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAxMS41VjVhMiAyIDAgMCAxIDItMmgzLjljLjcgMCAxLjMuMyAxLjcuOWwuOCAxLjJjLjQuNiAxIC45IDEuNy45SDIwYTIgMiAwIDAgMSAyIDJ2MTBhMiAyIDAgMCAxLTIgMmgtOS41IiAvPgogIDxwYXRoIGQ9Ik0xMS4zNzggMTMuNjI2YTEgMSAwIDEgMC0zLjAwNC0zLjAwNGwtNS4wMSA1LjAxMmEyIDIgMCAwIDAtLjUwNi44NTRsLS44MzcgMi44N2EuNS41IDAgMCAwIC42Mi42MmwyLjg3LS44MzdhMiAyIDAgMCAwIC44NTQtLjUwNnoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/folder-pen\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FolderPen = createLucideIcon('FolderPen', [\n [\n 'path',\n {\n d: 'M2 11.5V5a2 2 0 0 1 2-2h3.9c.7 0 1.3.3 1.7.9l.8 1.2c.4.6 1 .9 1.7.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-9.5',\n key: 'a8xqs0',\n },\n ],\n [\n 'path',\n {\n d: 'M11.378 13.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z',\n key: '1saktj',\n },\n ],\n]);\n\nexport default FolderPen;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,35 @@
import type * as core from "./core.cjs";
import type { $ZodType } from "./schemas.cjs";
export declare const $output: unique symbol;
export type $output = typeof $output;
export declare const $input: unique symbol;
export type $input = typeof $input;
export type $replace<Meta, S extends $ZodType> = Meta extends $output ? core.output<S> : Meta extends $input ? core.input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends (...args: infer P) => infer R ? (...args: {
[K in keyof P]: $replace<P[K], S>;
}) => $replace<R, S> : Meta extends object ? {
[K in keyof Meta]: $replace<Meta[K], S>;
} : Meta;
type MetadataType = Record<string, unknown> | undefined;
export declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
_meta: Meta;
_schema: Schema;
_map: Map<Schema, $replace<Meta, Schema>>;
_idmap: Map<string, Schema>;
add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
clear(): this;
remove(schema: Schema): this;
get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;
has(schema: Schema): boolean;
}
export interface JSONSchemaMeta {
id?: string | undefined;
title?: string | undefined;
description?: string | undefined;
deprecated?: boolean | undefined;
[k: string]: unknown;
}
export interface GlobalMeta extends JSONSchemaMeta {
}
export declare function registry<T extends MetadataType = MetadataType, S extends $ZodType = $ZodType>(): $ZodRegistry<T, S>;
export declare const globalRegistry: $ZodRegistry<GlobalMeta>;
export {};

View File

@@ -0,0 +1,221 @@
#!/usr/bin/env node
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// lib/npm/node-platform.ts
var fs = require("fs");
var os = require("os");
var path = require("path");
var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";
var packageDarwin_arm64 = "@esbuild/darwin-arm64";
var packageDarwin_x64 = "@esbuild/darwin-x64";
var knownWindowsPackages = {
"win32 arm64 LE": "@esbuild/win32-arm64",
"win32 ia32 LE": "@esbuild/win32-ia32",
"win32 x64 LE": "@esbuild/win32-x64"
};
var knownUnixlikePackages = {
"android arm64 LE": "@esbuild/android-arm64",
"darwin arm64 LE": "@esbuild/darwin-arm64",
"darwin x64 LE": "@esbuild/darwin-x64",
"freebsd arm64 LE": "@esbuild/freebsd-arm64",
"freebsd x64 LE": "@esbuild/freebsd-x64",
"linux arm LE": "@esbuild/linux-arm",
"linux arm64 LE": "@esbuild/linux-arm64",
"linux ia32 LE": "@esbuild/linux-ia32",
"linux mips64el LE": "@esbuild/linux-mips64el",
"linux ppc64 LE": "@esbuild/linux-ppc64",
"linux riscv64 LE": "@esbuild/linux-riscv64",
"linux s390x BE": "@esbuild/linux-s390x",
"linux x64 LE": "@esbuild/linux-x64",
"linux loong64 LE": "@esbuild/linux-loong64",
"netbsd x64 LE": "@esbuild/netbsd-x64",
"openbsd x64 LE": "@esbuild/openbsd-x64",
"sunos x64 LE": "@esbuild/sunos-x64"
};
var knownWebAssemblyFallbackPackages = {
"android arm LE": "@esbuild/android-arm",
"android x64 LE": "@esbuild/android-x64"
};
function pkgAndSubpathForCurrentPlatform() {
let pkg;
let subpath;
let isWASM2 = false;
let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`;
if (platformKey in knownWindowsPackages) {
pkg = knownWindowsPackages[platformKey];
subpath = "esbuild.exe";
} else if (platformKey in knownUnixlikePackages) {
pkg = knownUnixlikePackages[platformKey];
subpath = "bin/esbuild";
} else if (platformKey in knownWebAssemblyFallbackPackages) {
pkg = knownWebAssemblyFallbackPackages[platformKey];
subpath = "bin/esbuild";
isWASM2 = true;
} else {
throw new Error(`Unsupported platform: ${platformKey}`);
}
return { pkg, subpath, isWASM: isWASM2 };
}
function pkgForSomeOtherPlatform() {
const libMainJS = require.resolve("esbuild");
const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS)));
if (path.basename(nodeModulesDirectory) === "node_modules") {
for (const unixKey in knownUnixlikePackages) {
try {
const pkg = knownUnixlikePackages[unixKey];
if (fs.existsSync(path.join(nodeModulesDirectory, pkg)))
return pkg;
} catch {
}
}
for (const windowsKey in knownWindowsPackages) {
try {
const pkg = knownWindowsPackages[windowsKey];
if (fs.existsSync(path.join(nodeModulesDirectory, pkg)))
return pkg;
} catch {
}
}
}
return null;
}
function downloadedBinPath(pkg, subpath) {
const esbuildLibDir = path.dirname(require.resolve("esbuild"));
return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`);
}
function generateBinPath() {
if (isValidBinaryPath(ESBUILD_BINARY_PATH)) {
if (!fs.existsSync(ESBUILD_BINARY_PATH)) {
console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
} else {
return { binPath: ESBUILD_BINARY_PATH, isWASM: false };
}
}
const { pkg, subpath, isWASM: isWASM2 } = pkgAndSubpathForCurrentPlatform();
let binPath2;
try {
binPath2 = require.resolve(`${pkg}/${subpath}`);
} catch (e) {
binPath2 = downloadedBinPath(pkg, subpath);
if (!fs.existsSync(binPath2)) {
try {
require.resolve(pkg);
} catch {
const otherPkg = pkgForSomeOtherPlatform();
if (otherPkg) {
let suggestions = `
Specifically the "${otherPkg}" package is present but this platform
needs the "${pkg}" package instead. People often get into this
situation by installing esbuild on Windows or macOS and copying "node_modules"
into a Docker image that runs Linux, or by copying "node_modules" between
Windows and WSL environments.
If you are installing with npm, you can try not copying the "node_modules"
directory when you copy the files over, and running "npm ci" or "npm install"
on the destination platform after the copy. Or you could consider using yarn
instead of npm which has built-in support for installing a package on multiple
platforms simultaneously.
If you are installing with yarn, you can try listing both this platform and the
other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
Keep in mind that this means multiple copies of esbuild will be present.
`;
if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) {
suggestions = `
Specifically the "${otherPkg}" package is present but this platform
needs the "${pkg}" package instead. People often get into this
situation by installing esbuild with npm running inside of Rosetta 2 and then
trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
2 is Apple's on-the-fly x86_64-to-arm64 translation service).
If you are installing with npm, you can try ensuring that both npm and node are
not running under Rosetta 2 and then reinstalling esbuild. This likely involves
changing how you installed npm and/or node. For example, installing node with
the universal installer here should work: https://nodejs.org/en/download/. Or
you could consider using yarn instead of npm which has built-in support for
installing a package on multiple platforms simultaneously.
If you are installing with yarn, you can try listing both "arm64" and "x64"
in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
Keep in mind that this means multiple copies of esbuild will be present.
`;
}
throw new Error(`
You installed esbuild for another platform than the one you're currently using.
This won't work because esbuild is written with native code and needs to
install a platform-specific binary executable.
${suggestions}
Another alternative is to use the "esbuild-wasm" package instead, which works
the same way on all platforms. But it comes with a heavy performance cost and
can sometimes be 10x slower than the "esbuild" package, so you may also not
want to do that.
`);
}
throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild.
If you are installing esbuild with npm, make sure that you don't specify the
"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
of "package.json" is used by esbuild to install the correct binary executable
for your current platform.`);
}
throw e;
}
}
if (/\.zip\//.test(binPath2)) {
let pnpapi;
try {
pnpapi = require("pnpapi");
} catch (e) {
}
if (pnpapi) {
const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation;
const binTargetPath = path.join(
root,
"node_modules",
".cache",
"esbuild",
`pnpapi-${pkg.replace("/", "-")}-${"0.18.20"}-${path.basename(subpath)}`
);
if (!fs.existsSync(binTargetPath)) {
fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
fs.copyFileSync(binPath2, binTargetPath);
fs.chmodSync(binTargetPath, 493);
}
return { binPath: binTargetPath, isWASM: isWASM2 };
}
}
return { binPath: binPath2, isWASM: isWASM2 };
}
// lib/npm/node-shim.ts
var { binPath, isWASM } = generateBinPath();
if (isWASM) {
require("child_process").execFileSync("node", [binPath].concat(process.argv.slice(2)), { stdio: "inherit" });
} else {
require("child_process").execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
}

View File

@@ -0,0 +1,191 @@
import { debug } from '@sentry/core';
import { DEBUG_BUILD } from '../debug-build.js';
/**
* Strip the basename from a pathname if exists.
*
* Vendored and modified from `react-router`
* https://github.com/remix-run/react-router/blob/462bb712156a3f739d6139a0f14810b76b002df6/packages/router/utils.ts#L1038
*/
function stripBasenameFromPathname(pathname, basename) {
if (!basename || basename === '/') {
return pathname;
}
if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
return pathname;
}
// We want to leave trailing slash behavior in the user's control, so if they
// specify a basename with a trailing slash, we should support it
const startIndex = basename.endsWith('/') ? basename.length - 1 : basename.length;
const nextChar = pathname.charAt(startIndex);
if (nextChar && nextChar !== '/') {
// pathname does not start with basename/
return pathname;
}
return pathname.slice(startIndex) || '/';
}
// Cache for sorted manifests - keyed by manifest array reference
const SORTED_MANIFEST_CACHE = new WeakMap();
/**
* Matches a pathname against a route manifest and returns the matching pattern.
* Optionally strips a basename prefix before matching.
*/
function matchRouteManifest(pathname, manifest, basename) {
if (!pathname || !manifest || !manifest.length) {
return null;
}
const normalizedPathname = basename ? stripBasenameFromPathname(pathname, basename) : pathname;
let sorted = SORTED_MANIFEST_CACHE.get(manifest);
if (!sorted) {
sorted = sortBySpecificity(manifest);
SORTED_MANIFEST_CACHE.set(manifest, sorted);
DEBUG_BUILD && debug.log('[React Router] Sorted route manifest by specificity:', sorted.length, 'patterns');
}
for (const pattern of sorted) {
if (matchesPattern(normalizedPathname, pattern)) {
DEBUG_BUILD && debug.log('[React Router] Matched pathname', normalizedPathname, 'to pattern', pattern);
return pattern;
}
}
DEBUG_BUILD && debug.log('[React Router] No manifest match found for pathname:', normalizedPathname);
return null;
}
/**
* Checks if a pathname matches a route pattern.
*/
function matchesPattern(pathname, pattern) {
// Handle root path special case
if (pattern === '/') {
return pathname === '/' || pathname === '';
}
const pathSegments = splitPath(pathname);
const patternSegments = splitPath(pattern);
// Handle wildcard at end
const hasWildcard = patternSegments.length > 0 && patternSegments[patternSegments.length - 1] === '*';
if (hasWildcard) {
// Pattern with wildcard: path must have at least as many segments as pattern (minus wildcard)
const patternSegmentsWithoutWildcard = patternSegments.slice(0, -1);
if (pathSegments.length < patternSegmentsWithoutWildcard.length) {
return false;
}
for (const [i, patternSegment] of patternSegmentsWithoutWildcard.entries()) {
if (!segmentMatches(pathSegments[i], patternSegment)) {
return false;
}
}
return true;
}
// Exact segment count match required
if (pathSegments.length !== patternSegments.length) {
return false;
}
for (const [i, patternSegment] of patternSegments.entries()) {
if (!segmentMatches(pathSegments[i], patternSegment)) {
return false;
}
}
return true;
}
/**
* Checks if a path segment matches a pattern segment.
*/
function segmentMatches(pathSegment, patternSegment) {
if (pathSegment === undefined || patternSegment === undefined) {
return false;
}
// Parameter matches anything
if (PARAM_RE.test(patternSegment)) {
return true;
}
// Literal must match exactly
return pathSegment === patternSegment;
}
/**
* Splits a path into segments, filtering out empty strings.
*/
function splitPath(path) {
return path.split('/').filter(Boolean);
}
/**
* React Router scoring weights and param detection.
* https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/router/utils.ts
*/
const PARAM_RE = /^:[\w-]+$/;
const STATIC_SEGMENT_SCORE = 10;
const DYNAMIC_SEGMENT_SCORE = 3;
const EMPTY_SEGMENT_SCORE = 1;
const SPLAT_PENALTY = -2;
/**
* Computes a specificity score for a route pattern.
* Matches React Router's computeScore() algorithm exactly.
*/
function computeScore(pattern) {
const segments = pattern.split('/');
// Base score is segment count (including empty segment from leading slash)
let score = segments.length;
// Apply splat penalty once if pattern contains wildcard
if (segments.includes('*')) {
score += SPLAT_PENALTY;
}
for (const segment of segments) {
if (segment === '*') {
// Splat penalty already applied globally above
continue;
} else if (PARAM_RE.test(segment)) {
score += DYNAMIC_SEGMENT_SCORE;
} else if (segment === '') {
score += EMPTY_SEGMENT_SCORE;
} else {
score += STATIC_SEGMENT_SCORE;
}
}
return score;
}
/**
* Sorts route patterns by specificity (most specific first).
* Implements React Router's ranking algorithm from computeScore():
* https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/router/utils.ts
*
* React Router scoring: base=segments.length, static=+10, dynamic=+3, empty=+1, splat=-2 (once)
* Higher score = more specific pattern.
* Equal scores preserve manifest order (same as React Router).
*
* Note: Users should order their manifest from most specific to least specific
* when patterns have equal specificity (e.g., `/users/:id/settings` and `/:type/123/settings`).
*/
function sortBySpecificity(manifest) {
return [...manifest].sort((a, b) => {
const aScore = computeScore(a);
const bScore = computeScore(b);
return bScore - aScore;
});
}
export { matchRouteManifest, stripBasenameFromPathname };
//# sourceMappingURL=route-manifest.js.map

View File

@@ -0,0 +1,3 @@
import { KeyboardCoordinateGetter, KeyboardCodes } from './types';
export declare const defaultKeyboardCodes: KeyboardCodes;
export declare const defaultKeyboardCoordinateGetter: KeyboardCoordinateGetter;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/mysql-core/columns/int.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyMySqlTable } from '~/mysql-core/table.ts';\nimport { getColumnNameAndConfig } from '~/utils.ts';\nimport { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common.ts';\n\nexport type MySqlIntBuilderInitial<TName extends string> = MySqlIntBuilder<{\n\tname: TName;\n\tdataType: 'number';\n\tcolumnType: 'MySqlInt';\n\tdata: number;\n\tdriverParam: number | string;\n\tenumValues: undefined;\n}>;\n\nexport class MySqlIntBuilder<T extends ColumnBuilderBaseConfig<'number', 'MySqlInt'>>\n\textends MySqlColumnBuilderWithAutoIncrement<T, MySqlIntConfig>\n{\n\tstatic override readonly [entityKind]: string = 'MySqlIntBuilder';\n\n\tconstructor(name: T['name'], config?: MySqlIntConfig) {\n\t\tsuper(name, 'number', 'MySqlInt');\n\t\tthis.config.unsigned = config ? config.unsigned : false;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyMySqlTable<{ name: TTableName }>,\n\t): MySqlInt<MakeColumnConfig<T, TTableName>> {\n\t\treturn new MySqlInt<MakeColumnConfig<T, TTableName>>(table, this.config as ColumnBuilderRuntimeConfig<any, any>);\n\t}\n}\n\nexport class MySqlInt<T extends ColumnBaseConfig<'number', 'MySqlInt'>>\n\textends MySqlColumnWithAutoIncrement<T, MySqlIntConfig>\n{\n\tstatic override readonly [entityKind]: string = 'MySqlInt';\n\n\tgetSQLType(): string {\n\t\treturn `int${this.config.unsigned ? ' unsigned' : ''}`;\n\t}\n\n\toverride mapFromDriverValue(value: number | string): number {\n\t\tif (typeof value === 'string') {\n\t\t\treturn Number(value);\n\t\t}\n\t\treturn value;\n\t}\n}\n\nexport interface MySqlIntConfig {\n\tunsigned?: boolean;\n}\n\nexport function int(): MySqlIntBuilderInitial<''>;\nexport function int(\n\tconfig?: MySqlIntConfig,\n): MySqlIntBuilderInitial<''>;\nexport function int<TName extends string>(\n\tname: TName,\n\tconfig?: MySqlIntConfig,\n): MySqlIntBuilderInitial<TName>;\nexport function int(a?: string | MySqlIntConfig, b?: MySqlIntConfig) {\n\tconst { name, config } = getColumnNameAndConfig<MySqlIntConfig>(a, b);\n\treturn new MySqlIntBuilder(name, config);\n}\n"],"mappings":"AAEA,SAAS,kBAAkB;AAE3B,SAAS,8BAA8B;AACvC,SAAS,qCAAqC,oCAAoC;AAW3E,MAAM,wBACJ,oCACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB,QAAyB;AACrD,UAAM,MAAM,UAAU,UAAU;AAChC,SAAK,OAAO,WAAW,SAAS,OAAO,WAAW;AAAA,EACnD;AAAA;AAAA,EAGS,MACR,OAC4C;AAC5C,WAAO,IAAI,SAA0C,OAAO,KAAK,MAA8C;AAAA,EAChH;AACD;AAEO,MAAM,iBACJ,6BACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO,MAAM,KAAK,OAAO,WAAW,cAAc,EAAE;AAAA,EACrD;AAAA,EAES,mBAAmB,OAAgC;AAC3D,QAAI,OAAO,UAAU,UAAU;AAC9B,aAAO,OAAO,KAAK;AAAA,IACpB;AACA,WAAO;AAAA,EACR;AACD;AAcO,SAAS,IAAI,GAA6B,GAAoB;AACpE,QAAM,EAAE,MAAM,OAAO,IAAI,uBAAuC,GAAG,CAAC;AACpE,SAAO,IAAI,gBAAgB,MAAM,MAAM;AACxC;","names":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"with-search.js","names":[],"sources":["../../../src/rest/helpers/with-search.ts"],"sourcesContent":["import { formatFields } from '../../utils/format-fields.js';\nimport type { RestCommand } from '../types.js';\n\nexport function withSearch<Schema, Output>(getOptions: RestCommand<Output, Schema>): RestCommand<Output, Schema> {\n\treturn () => {\n\t\tconst options = getOptions();\n\n\t\tif (options.method === 'GET' && options.params) {\n\t\t\toptions.method = 'SEARCH';\n\n\t\t\toptions.body = JSON.stringify({\n\t\t\t\tquery: {\n\t\t\t\t\t...options.params,\n\t\t\t\t\tfields: formatFields(options.params['fields'] ?? []),\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tdelete options.params;\n\t\t}\n\n\t\treturn options;\n\t};\n}\n"],"mappings":"4DAGA,SAAgB,EAA2B,EAAsE,CAChH,UAAa,CACZ,IAAM,EAAU,GAAY,CAe5B,OAbI,EAAQ,SAAW,OAAS,EAAQ,SACvC,EAAQ,OAAS,SAEjB,EAAQ,KAAO,KAAK,UAAU,CAC7B,MAAO,CACN,GAAG,EAAQ,OACX,OAAQ,EAAa,EAAQ,OAAO,QAAa,EAAE,CAAC,CACpD,CACD,CAAC,CAEF,OAAO,EAAQ,QAGT"}

View File

@@ -0,0 +1,43 @@
/**
* Securely detect if an XML buffer contains a valid SVG document
*/ export function detectSvgFromXml(buffer) {
try {
// Limit buffer size to prevent processing large malicious files
const maxSize = 2048;
const content = buffer.toString('utf8', 0, Math.min(buffer.length, maxSize));
// Check for XML declaration and extract encoding if present
const xmlDeclMatch = content.match(/^<\?xml[^>]*encoding=["']([^"']+)["']/i);
const declaredEncoding = xmlDeclMatch?.[1]?.toLowerCase();
// Only support safe encodings
if (declaredEncoding && ![
'ascii',
'utf-8',
'utf8'
].includes(declaredEncoding)) {
return false;
}
// Remove XML declarations, comments, and processing instructions
const cleanContent = content.replace(/<\?xml[^>]*\?>/gi, '').replace(/<!--[\s\S]*?-->/g, '').replace(/<\?[^>]*\?>/g, '').trim();
// Find the first actual element (root element)
const rootElementMatch = cleanContent.match(/^<(\w+)(?:\s|>)/);
if (!rootElementMatch || rootElementMatch[1] !== 'svg') {
return false;
}
// Validate SVG namespace - must be present for valid SVG
const svgNamespaceRegex = /xmlns=["']http:\/\/www\.w3\.org\/2000\/svg["']/;
if (!svgNamespaceRegex.test(content)) {
return false;
}
// Additional validation: ensure it's not malformed
const svgOpenTag = content.match(/<svg[\s>]/);
if (!svgOpenTag) {
return false;
}
return true;
} catch (_error) {
// If any error occurs during parsing, treat as not SVG
return false;
}
}
//# sourceMappingURL=detectSvgFromXml.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","useNav","React","NavWrapper","props","$","baseClass","children","hydrated","navOpen","navRef","shouldAnimate","t0","t1","t2","t3","filter","Boolean","t4","join","t5","undefined","t6","t7","_jsx","className","inert","ref"],"sources":["../../../../src/elements/Nav/NavWrapper/index.tsx"],"sourcesContent":["'use client'\nimport { useNav } from '@payloadcms/ui'\nimport React from 'react'\n\nimport './index.scss'\n\n/**\n * @internal\n */\nexport const NavWrapper: React.FC<{\n baseClass?: string\n children: React.ReactNode\n}> = (props) => {\n const { baseClass, children } = props\n\n const { hydrated, navOpen, navRef, shouldAnimate } = useNav()\n\n return (\n <aside\n className={[\n baseClass,\n navOpen && `${baseClass}--nav-open`,\n shouldAnimate && `${baseClass}--nav-animate`,\n hydrated && `${baseClass}--nav-hydrated`,\n ]\n .filter(Boolean)\n .join(' ')}\n inert={!navOpen ? true : undefined}\n >\n <div className={`${baseClass}__scroll`} ref={navRef}>\n {children}\n </div>\n </aside>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,MAAM,QAAQ;AACvB,OAAOC,KAAA,MAAW;AAIlB;;;AAGA,OAAO,MAAMC,UAAA,GAGRC,KAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACH;IAAAM,SAAA;IAAAC;EAAA,IAAgCH,KAAA;EAEhC;IAAAI,QAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC;EAAA,IAAqDV,MAAA;EAM/C,MAAAW,EAAA,GAAAH,OAAA,IAAW,GAAGH,SAAA,YAAqB;EACnC,MAAAO,EAAA,GAAAF,aAAA,IAAiB,GAAGL,SAAA,eAAwB;EAC5C,MAAAQ,EAAA,GAAAN,QAAA,IAAY,GAAGF,SAAA,gBAAyB;EAAA,IAAAS,EAAA;EAAA,IAAAV,CAAA,QAAAC,SAAA,IAAAD,CAAA,QAAAO,EAAA,IAAAP,CAAA,QAAAQ,EAAA,IAAAR,CAAA,QAAAS,EAAA;IAJ/BC,EAAA,IACTT,SAAA,EACAM,EAAmC,EACnCC,EAA4C,EAC5CC,EAAwC,EAAAE,MAAA,CAAAC,OAEhC;IAAAZ,CAAA,MAAAC,SAAA;IAAAD,CAAA,MAAAO,EAAA;IAAAP,CAAA,MAAAQ,EAAA;IAAAR,CAAA,MAAAS,EAAA;IAAAT,CAAA,MAAAU,EAAA;EAAA;IAAAA,EAAA,GAAAV,CAAA;EAAA;EANC,MAAAa,EAAA,GAAAH,EAMD,CAAAI,IAAA,CACF;EACD,MAAAC,EAAA,IAACX,OAAA,UAAAY,SAAiB;EAET,MAAAC,EAAA,MAAGhB,SAAA,UAAmB;EAAA,IAAAiB,EAAA;EAAA,IAAAlB,CAAA,QAAAE,QAAA,IAAAF,CAAA,QAAAK,MAAA,IAAAL,CAAA,QAAAa,EAAA,IAAAb,CAAA,QAAAe,EAAA,IAAAf,CAAA,QAAAiB,EAAA;IAXxCC,EAAA,GAAAC,IAAA,CAAC;MAAAC,SAAA,EACYP,EAOH;MAAAQ,KAAA,EACDN,EAAkB;MAAAb,QAAA,EAEzBiB,IAAA,CAAC;QAAAC,SAAA,EAAeH,EAAsB;QAAAK,GAAA,EAAOjB,MAAA;QAAAH;MAAA,C;;;;;;;;;;;SAX/CgB,E;CAgBJ","ignoreList":[]}

View File

@@ -0,0 +1,5 @@
/**
* Symbol used to make BaggageEntryMetadata an opaque type
*/
export declare const baggageEntryMetadataSymbol: unique symbol;
//# sourceMappingURL=symbol.d.ts.map

View File

@@ -0,0 +1,50 @@
{
"name": "@lexical/devtools-core",
"description": "This package contains tools necessary to debug and develop Lexical.",
"keywords": [
"lexical",
"editor",
"rich-text",
"utils"
],
"license": "MIT",
"version": "0.35.0",
"main": "LexicalDevtoolsCore.js",
"types": "index.d.ts",
"dependencies": {
"@lexical/html": "0.35.0",
"@lexical/link": "0.35.0",
"@lexical/mark": "0.35.0",
"@lexical/table": "0.35.0",
"@lexical/utils": "0.35.0",
"lexical": "0.35.0"
},
"peerDependencies": {
"react": ">=17.x",
"react-dom": ">=17.x"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/lexical",
"directory": "packages/lexical-devtools-core"
},
"module": "LexicalDevtoolsCore.mjs",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./index.d.ts",
"development": "./LexicalDevtoolsCore.dev.mjs",
"production": "./LexicalDevtoolsCore.prod.mjs",
"node": "./LexicalDevtoolsCore.node.mjs",
"default": "./LexicalDevtoolsCore.mjs"
},
"require": {
"types": "./index.d.ts",
"development": "./LexicalDevtoolsCore.dev.js",
"production": "./LexicalDevtoolsCore.prod.js",
"default": "./LexicalDevtoolsCore.js"
}
}
}
}

View File

@@ -0,0 +1,25 @@
import { LoggerProvider } from '../types/LoggerProvider';
import { Logger } from '../types/Logger';
import { LoggerOptions } from '../types/LoggerOptions';
export declare class LogsAPI {
private static _instance?;
private _proxyLoggerProvider;
private constructor();
static getInstance(): LogsAPI;
setGlobalLoggerProvider(provider: LoggerProvider): LoggerProvider;
/**
* Returns the global logger provider.
*
* @returns LoggerProvider
*/
getLoggerProvider(): LoggerProvider;
/**
* Returns a logger from the global logger provider.
*
* @returns Logger
*/
getLogger(name: string, version?: string, options?: LoggerOptions): Logger;
/** Remove the global logger provider */
disable(): void;
}
//# sourceMappingURL=logs.d.ts.map

View File

@@ -0,0 +1 @@
!function(){function t(t){var e=document.createElement("textarea");e.value=t.getText(),e.style.top="0",e.style.left="0",e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{var o=document.execCommand("copy");setTimeout((function(){o?t.success():t.error()}),1)}catch(e){setTimeout((function(){t.error(e)}),1)}document.body.removeChild(e)}"undefined"!=typeof Prism&&"undefined"!=typeof document&&(Prism.plugins.toolbar?Prism.plugins.toolbar.registerButton("copy-to-clipboard",(function(e){var o=e.element,n=function(t){var e={copy:"Copy","copy-error":"Press Ctrl+C to copy","copy-success":"Copied!","copy-timeout":5e3};for(var o in e){for(var n="data-prismjs-"+o,c=t;c&&!c.hasAttribute(n);)c=c.parentElement;c&&(e[o]=c.getAttribute(n))}return e}(o),c=document.createElement("button");c.className="copy-to-clipboard-button",c.setAttribute("type","button");var r=document.createElement("span");return c.appendChild(r),u("copy"),function(e,o){e.addEventListener("click",(function(){!function(e){navigator.clipboard?navigator.clipboard.writeText(e.getText()).then(e.success,(function(){t(e)})):t(e)}(o)}))}(c,{getText:function(){return o.textContent},success:function(){u("copy-success"),i()},error:function(){u("copy-error"),setTimeout((function(){!function(t){window.getSelection().selectAllChildren(t)}(o)}),1),i()}}),c;function i(){setTimeout((function(){u("copy")}),n["copy-timeout"])}function u(t){r.textContent=n[t],c.setAttribute("data-copy-state",t)}})):console.warn("Copy to Clipboard plugin loaded before Toolbar plugin."))}();

View File

@@ -0,0 +1,201 @@
/// <reference types="node" />
import { inspect } from "util";
/**
* The default export of the "ono" module.
*/
export interface OnoSingleton extends Ono<Error> {
error: Ono<Error>;
eval: Ono<EvalError>;
range: Ono<RangeError>;
reference: Ono<ReferenceError>;
syntax: Ono<SyntaxError>;
type: Ono<TypeError>;
uri: Ono<URIError>;
}
/**
* Creates an `Ono` instance for a specifc error type.
*/
export interface OnoConstructor {
<T extends ErrorLike>(constructor: ErrorLikeConstructor<T>, options?: OnoOptions): Ono<T>;
new <T extends ErrorLike>(constructor: ErrorLikeConstructor<T>, options?: OnoOptions): Ono<T>;
/**
* Returns an object containing all properties of the given Error object,
* which can be used with `JSON.stringify()`.
*/
toJSON<E extends ErrorLike>(error: E): ErrorPOJO & E;
/**
* Extends the given Error object with enhanced Ono functionality, such as improved support for
* `JSON.stringify()`.
*
* @param error - The error object to extend. This object instance will be modified and returned.
*/
extend<T extends ErrorLike>(error: T): T & OnoError<T>;
/**
* Extends the given Error object with enhanced Ono functionality, such as additional properties
* and improved support for `JSON.stringify()`.
*
* @param error - The error object to extend. This object instance will be modified and returned.
* @param props - An object whose properties will be added to the error
*/
extend<T extends ErrorLike, P extends object>(error: T, props?: P): T & P & OnoError<T & P>;
/**
* Extends the given Error object with enhanced Ono functionality, such as nested stack traces
* and improved support for `JSON.stringify()`.
*
* @param error - The error object to extend. This object instance will be modified and returned.
* @param originalError - The original error. This error's stack trace will be added to the error's stack trace.
*/
extend<T extends ErrorLike, E extends ErrorLike>(error: T, originalError?: E): T & E & OnoError<T & E>;
/**
* Extends the given Error object with enhanced Ono functionality, such as nested stack traces,
* additional properties, and improved support for `JSON.stringify()`.
*
* @param error - The error object to extend. This object instance will be modified and returned.
* @param originalError - The original error. This error's stack trace will be added to the error's stack trace.
* @param props - An object whose properties will be added to the error
*/
extend<T extends ErrorLike, E extends ErrorLike, P extends object>(error: T, originalError?: E, props?: P): T & E & P & OnoError<T & E & P>;
}
/**
* An `Ono` is a function that creates errors of a specific type.
*/
export interface Ono<T extends ErrorLike> {
/**
* The type of Error that this `Ono` function produces.
*/
readonly [Symbol.species]: ErrorLikeConstructor<T>;
/**
* Creates a new error with the message, stack trace, and properties of another error.
*
* @param error - The original error
*/
<E extends ErrorLike>(error: E): T & E & OnoError<T & E>;
/**
* Creates a new error with the message, stack trace, and properties of another error,
* as well as aditional properties.
*
* @param error - The original error
* @param props - An object whose properties will be added to the returned error
*/
<E extends ErrorLike, P extends object>(error: E, props: P): T & E & P & OnoError<T & E & P>;
/**
* Creates a new error with a formatted message and the stack trace and properties of another error.
*
* @param error - The original error
* @param message - The new error message, possibly including argument placeholders
* @param params - Optional arguments to replace the corresponding placeholders in the message
*/
<E extends ErrorLike>(error: E, message: string, ...params: unknown[]): T & E & OnoError<T & E>;
/**
* Creates a new error with a formatted message and the stack trace and properties of another error,
* as well as additional properties.
*
* @param error - The original error
* @param props - An object whose properties will be added to the returned error
* @param message - The new error message, possibly including argument placeholders
* @param params - Optional arguments to replace the corresponding placeholders in the message
*/
<E extends ErrorLike, P extends object>(error: E, props: P, message: string, ...params: unknown[]): T & E & P & OnoError<T & E & P>;
/**
* Creates an error with a formatted message.
*
* @param message - The new error message, possibly including argument placeholders
* @param params - Optional arguments to replace the corresponding placeholders in the message
*/
(message: string, ...params: unknown[]): T & OnoError<T>;
/**
* Creates an error with additional properties.
*
* @param props - An object whose properties will be added to the returned error
*/
<P extends object>(props: P): T & P & OnoError<T & P>;
/**
* Creates an error with a formatted message and additional properties.
*
* @param props - An object whose properties will be added to the returned error
* @param message - The new error message, possibly including argument placeholders
* @param params - Optional arguments to replace the corresponding placeholders in the message
*/
<P extends object>(props: P, message: string, ...params: unknown[]): T & P & OnoError<T & P>;
}
/**
* All error objects returned by Ono have these properties.
*/
export interface OnoError<T> extends ErrorPOJO {
/**
* Returns a JSON representation of the error, including all built-in error properties,
* as well as properties that were dynamically added.
*/
toJSON(): ErrorPOJO & T;
/**
* Returns a representation of the error for Node's `util.inspect()` method.
*
* @see https://nodejs.org/api/util.html#util_custom_inspection_functions_on_objects
*/
[inspect.custom](): ErrorPOJO & T;
}
/**
* An error object that doesn't inherit from the `Error` class, such as `DOMError`, `DOMException`,
* and some third-party error types.
*/
export interface ErrorPOJO {
message?: string;
stack?: string;
name?: string;
}
/**
* Any object that "looks like" an `Error` object.
*/
export declare type ErrorLike = Error | ErrorPOJO;
/**
* A constructor for `ErrorLike` objects.
*/
export declare type ErrorLikeConstructor<T extends ErrorLike> = ErrorLikeConstructorFunction<T> | ErrorLikeConstructorClass<T>;
/**
* A constructor function for `ErrorLike` objects.
* Constructor functions can be called without the `new` keyword.
*
* @example
* throw TypeError();
*/
export interface ErrorLikeConstructorFunction<T extends ErrorLike> {
readonly prototype: T;
(): T;
}
/**
* A constructor class for `ErrorLike` objects.
* Constructor classes must be called with the `new` keyword.
*
* @example
* throw new TypeError();
*/
export interface ErrorLikeConstructorClass<T extends ErrorLike> {
readonly prototype: T;
new (...args: unknown[]): T;
}
/**
* Options that determine the behavior of an `Ono` instance.
*/
export interface OnoOptions {
/**
* When `Ono` is used to wrap an error, this setting determines whether the inner error's message
* is appended to the new error message.
*
* Defaults to `true`.
*/
concatMessages?: boolean;
/**
* A function that replaces placeholders like "%s" or "%d" in error messages with values.
* If set to `false`, then error messages will be treated as literals and no placeholder replacement will occur.
*
* Defaults to `utils.inspect()` in Node.js. Defaults to `Array.join()` in browsers.
*/
format?: MessageFormatter | false;
}
/**
* A function that accepts a message template and arguments to replace template parameters.
*
* @example
* format("Hello, %s! You have %d unread messages.", "John", 5);
*/
export declare type MessageFormatter = (message: string, ...args: unknown[]) => string;

View File

@@ -0,0 +1,12 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import * as modDev from './LexicalPlainText.dev.mjs';
import * as modProd from './LexicalPlainText.prod.mjs';
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
export const registerPlainText = mod.registerPlainText;

View File

@@ -0,0 +1 @@
{"version":3,"file":"wrapApiHandlerWithSentry.d.ts","sourceRoot":"","sources":["../../../../src/common/pages-router-instrumentation/wrapApiHandlerWithSentry.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAA4B,cAAc,EAAE,MAAM,UAAU,CAAC;AAIzE,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG;IACrD,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,GAAG,cAAc,CA6G/G"}

View File

@@ -0,0 +1 @@
Prism.languages.moonscript={comment:/--.*/,string:[{pattern:/'[^']*'|\[(=*)\[[\s\S]*?\]\1\]/,greedy:!0},{pattern:/"[^"]*"/,greedy:!0,inside:{interpolation:{pattern:/#\{[^{}]*\}/,inside:{moonscript:{pattern:/(^#\{)[\s\S]+(?=\})/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/#\{|\}/,alias:"punctuation"}}}}}],"class-name":[{pattern:/(\b(?:class|extends)[ \t]+)\w+/,lookbehind:!0},/\b[A-Z]\w*/],keyword:/\b(?:class|continue|do|else|elseif|export|extends|for|from|if|import|in|local|nil|return|self|super|switch|then|unless|using|when|while|with)\b/,variable:/@@?\w*/,property:{pattern:/\b(?!\d)\w+(?=:)|(:)(?!\d)\w+/,lookbehind:!0},function:{pattern:/\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:create|resume|running|status|wrap|yield)|debug\.(?:debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|setfenv|sethook|setlocal|setmetatable|setupvalue|traceback)|dofile|error|getfenv|getmetatable|io\.(?:close|flush|input|lines|open|output|popen|read|stderr|stdin|stdout|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|cos|cosh|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pi|pow|rad|random|randomseed|sin|sinh|sqrt|tan|tanh)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\.(?:concat|insert|maxn|remove|sort)|tonumber|tostring|type|unpack|xpcall)\b/,inside:{punctuation:/\./}},boolean:/\b(?:false|true)\b/,number:/(?:\B\.\d+|\b\d+\.\d+|\b\d+(?=[eE]))(?:[eE][-+]?\d+)?\b|\b(?:0x[a-fA-F\d]+|\d+)(?:U?LL)?\b/,operator:/\.{3}|[-=]>|~=|(?:[-+*/%<>!=]|\.\.)=?|[:#^]|\b(?:and|or)\b=?|\b(?:not)\b/,punctuation:/[.,()[\]{}\\]/},Prism.languages.moonscript.string[1].inside.interpolation.inside.moonscript.inside=Prism.languages.moonscript,Prism.languages.moon=Prism.languages.moonscript;

View File

@@ -0,0 +1,7 @@
/**
* A function that accepts and identity object and a class object and returns
* either a new instance of that class or an existing instance, if the
* identity object was previously used.
*/
export declare function initUnique<T>(identityObj: object, ClassObj: new () => T): T;
//# sourceMappingURL=initUnique.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","names":[],"sources":["../../../src/fields/Relationship/types.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type {\n ClientCollectionConfig,\n ClientConfig,\n CollectionSlug,\n FilterOptionsResult,\n LabelFunction,\n StaticDescription,\n StaticLabel,\n ValueWithRelation,\n} from 'payload'\n\nexport type Option = {\n allowEdit: boolean\n label: string\n options?: Option[]\n relationTo?: string\n value: number | string\n}\n\nexport type OptionGroup = {\n label: string\n options: Option[]\n}\n\nexport type MonomorphicRelationValue = number | string\n\nexport type Value =\n | MonomorphicRelationValue\n | MonomorphicRelationValue[]\n | ValueWithRelation\n | ValueWithRelation[]\n\ntype CLEAR = {\n exemptValues?: ValueWithRelation | ValueWithRelation[]\n type: 'CLEAR'\n}\n\ntype UPDATE = {\n collection: ClientCollectionConfig\n config: ClientConfig\n doc: any\n i18n: I18nClient\n type: 'UPDATE'\n}\n\ntype ADD = {\n collection: ClientCollectionConfig\n config: ClientConfig\n docs: any[]\n i18n: I18nClient\n ids?: (number | string)[]\n sort?: boolean\n type: 'ADD'\n}\n\ntype REMOVE = {\n collection: ClientCollectionConfig\n config: ClientConfig\n i18n: I18nClient\n id: string\n type: 'REMOVE'\n}\n\nexport type Action = ADD | CLEAR | REMOVE | UPDATE\n\nexport type HasManyValueUnion =\n | {\n hasMany: false\n value?: ValueWithRelation\n }\n | {\n hasMany: true\n value?: ValueWithRelation[]\n }\n\nexport type UpdateResults = (\n args: {\n filterOptions?: FilterOptionsResult\n lastFullyLoadedRelation?: number\n lastLoadedPage: Record<string, number>\n onSuccess?: () => void\n search?: string\n sort?: boolean\n } & HasManyValueUnion,\n) => void\n\nexport type RelationshipInputProps = {\n readonly AfterInput?: React.ReactNode\n readonly allowCreate?: boolean\n readonly allowEdit?: boolean\n readonly appearance?: 'drawer' | 'select'\n readonly BeforeInput?: React.ReactNode\n readonly className?: string\n readonly Description?: React.ReactNode\n readonly description?: StaticDescription\n readonly Error?: React.ReactNode\n readonly filterOptions?: FilterOptionsResult\n readonly formatDisplayedOptions?: (options: OptionGroup[]) => Option[] | OptionGroup[]\n readonly isSortable?: boolean\n readonly Label?: React.ReactNode\n readonly label?: StaticLabel\n readonly localized?: boolean\n readonly maxResultsPerRequest?: number\n readonly maxRows?: number\n readonly minRows?: number\n readonly path: string\n readonly placeholder?: LabelFunction | string\n readonly readOnly?: boolean\n readonly relationTo: string[]\n readonly required?: boolean\n readonly showError?: boolean\n readonly sortOptions?: Partial<Record<CollectionSlug, string>>\n readonly style?: React.CSSProperties\n} & SharedRelationshipInputProps\n\ntype SharedRelationshipInputProps =\n | {\n readonly hasMany: false\n readonly initialValue?: null | ValueWithRelation\n readonly onChange: (value: ValueWithRelation) => void\n readonly value?: null | ValueWithRelation\n }\n | {\n readonly hasMany: true\n readonly initialValue?: null | ValueWithRelation[]\n readonly onChange: (value: ValueWithRelation[]) => void\n readonly value?: null | ValueWithRelation[]\n }\n"],"mappings":"AAuFA","ignoreList":[]}

View File

@@ -0,0 +1,39 @@
/**
* Takes image sizes and a target range and returns the url of the image within that range.
* If no images fit within the range, it selects the next smallest adequate image, the original,
* or the largest smaller image if no better fit exists.
*
* @param sizes The given FileSizes.
* @param targetSizeMax The ideal image maximum width. Defaults to 180.
* @param targetSizeMin The ideal image minimum width. Defaults to 40.
* @param thumbnailURL The thumbnail url set in config. If passed a url, will return early with it.
* @param url The url of the original file.
* @param width The width of the original file.
* @returns A url of the best fit file.
*/ export const getBestFitFromSizes = ({ sizes, targetSizeMax = 180, targetSizeMin = 40, thumbnailURL, url, width })=>{
if (thumbnailURL) {
return thumbnailURL;
}
if (!sizes) {
return url;
}
const bestFit = Object.values(sizes).reduce((closest, current)=>{
if (!current.width || current.width < targetSizeMin) {
return closest;
}
if (current.width >= targetSizeMin && current.width <= targetSizeMax) {
return !closest.width || current.width < closest.width || closest.width < targetSizeMin || closest.width > targetSizeMax ? current : closest;
}
if (!closest.width || !closest.original && closest.width < targetSizeMin && current.width > closest.width || closest.width > targetSizeMax && current.width < closest.width) {
return current;
}
return closest;
}, {
original: true,
url,
width
});
return bestFit.url || url;
};
//# sourceMappingURL=getBestFitFromSizes.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mergeFormStateFromClipboard.d.ts","sourceRoot":"","sources":["../../../src/elements/ClipboardAction/mergeFormStateFromClipboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,SAAS,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,8BAyBA;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,iBAAiB,EAAE,aAAa,EAChC,SAAS,EACT,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,iBAAiB,EAAE,kBAAkB,CAAA;IACrC,SAAS,EAAE,SAAS,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,aAiFA"}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"0 1 2 3 4 5 6 7 8 e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","2":"C L M G N O P Q H","516":"R S T U V W X Y Z a b c d"},C:{"2":"0 1 2 3 4 5 6 7 8 9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB 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 WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C 4C 5C"},D:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"J bB K D E F A B C L M G N O EB FB GB HB IB 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 WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X","130":"9 P cB AB BB CB DB","1028":"0 1 2 3 4 5 6 7 8 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 JB KB"},E:{"1":"M G CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D E F A B C 6C bC 7C 8C 9C AD cC PC","2049":"L QC BD"},F:{"1":"0 1 2 3 4 5 6 7 8 x y z","2":"9 F B C G N O P cB AB BB CB DB EB FB GB HB IB 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 MC NC Q H R YC 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 JD KD LD MD PC xC ND QC"},G:{"1":"fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"E bC OD yC PD QD RD SD TD UD VD WD XD YD ZD","2049":"aD bD cD dD eD"},H:{"2":"mD"},I:{"2":"VC J nD oD pD qD yC rD","258":"I sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"2":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB wD xD cC yD zD 0D 1D 2D SC TC UC 3D","2":"J","258":"tD uD vD"},Q:{"2":"4D"},R:{"2":"5D"},S:{"2":"6D 7D"}},B:4,C:"Web Share API",D:true};

View File

@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { RangeSelection, TextNode } from '.';
export declare function $normalizeTextNode(textNode: TextNode): void;
export declare function $normalizeSelection(selection: RangeSelection): RangeSelection;

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../../../../src/integrations/tracing/vercelai/constants.ts"],"sourcesContent":["export const INTEGRATION_NAME = 'VercelAI';\n"],"names":[],"mappings":"AAAO,MAAM,gBAAA,GAAmB;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"meta.js","sources":["../../../src/utils/meta.ts"],"sourcesContent":["import type { SerializedTraceData } from '../types-hoist/tracing';\nimport { getTraceData } from './traceData';\n\n/**\n * Returns a string of meta tags that represent the current trace data.\n *\n * You can use this to propagate a trace from your server-side rendered Html to the browser.\n * This function returns up to two meta tags, `sentry-trace` and `baggage`, depending on the\n * current trace data state.\n *\n * @example\n * Usage example:\n *\n * ```js\n * function renderHtml() {\n * return `\n * <head>\n * ${getTraceMetaTags()}\n * </head>\n * `;\n * }\n * ```\n *\n */\nexport function getTraceMetaTags(traceData?: SerializedTraceData): string {\n return Object.entries(traceData || getTraceData())\n .map(([key, value]) => `<meta name=\"${key}\" content=\"${value}\"/>`)\n .join('\\n');\n}\n"],"names":[],"mappings":";;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,SAAS,EAAgC;AAC1E,EAAE,OAAO,MAAM,CAAC,OAAO,CAAC,SAAA,IAAa,YAAY,EAAE;AACnD,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC;AACrE,KAAK,IAAI,CAAC,IAAI,CAAC;AACf;;;;"}

View File

@@ -0,0 +1,857 @@
# Changelog
## v5.46.0
- Add "observedAttributes" domprop (#1652)
- More domprops (mostly `Temporal` related) suggested in #1652
## v5.45.0
- Produce `void 0` instead of `undefined`, which is more safe
## v5.44.1
- fix bitwise optimization changing the result of `&&`, `||`
- switches: make sure `var` is extracted from a deleted default case
## v5.44.0
- Support `using` and `await using` declarations (#1635)
## v5.43.1
- Prevent niche optimizations that would move around block declarations
- Add `lhs_constants` to `CompressOptions` type (#1621)
## v5.43.0
- Do not wrap callbacks in parentheses (`wrap_func_args` format option is now false by default)
- Do not inline functions into for loops (for performance reasons)
## v5.42.0
- Improved performance in the parse step by adding a fast path for simple identifiers.
- Improved ESTree conversion
## v5.41.0
- fixed semicolon insertion between class fields, when the field names are number literals
- `keep_numbers` format option now works for bigint
- internal: correctly mark accessors' is_generator property
- internal: do not read or assign quote properties without need
- internal: add missing equivalent_to comparison
## v5.40.0
- Fix exporting AssignmentExpression (default assign pattern) to ESTree
- Fix ESTree output of object keys with quotes
- Fix handling of an ESTree empty `export {}` (#1601)
- Fix some `const` and `let` resulting from ESTree input (#1599)
## v5.39.2
- Fix crash when parsing bare `yield` inside a template string.
- Update internally used acorn version requirement
## v5.39.1
- Fix bitwise operations that could mix `BigInt` and `number`
## v5.39.0
- Remove unnecessary `console.assert` calls (#1590)
## v5.38.2
- internal: Flatten inheritance tree for object/class members
## v5.38.1
- Fix inlining non-call expressions into an `optional_call?.()`
## v5.38.0
- Remove `console` method-of-method calls (eg `console.log.apply()`) when `drop_console` option is used (#1585)
- Remove more object spreads, such as `{ ...void !0 }` (#1142)
## v5.37.0
- Reserved object properties from chrome extensions (domprops)
- Fix semicolon insertion between a class property without a semicolon `a` and a computed class property `["prop"]`
## v5.36.0
- Support import attributes `with` syntax
## v5.35.0
- Ensure parent directory exists when using --output on CLI (#1530)
## v5.34.1
- bump the rollup devDependency to disable CVE warnings (Terser was not affected)
## v5.34.0
- internal: stop assigning properties to objects they don't belong in
- internal: run compress tests in parallel
- `drop_console`: emit an empty function if the return value of `console.METHOD(...)` may be called.
## v5.33.0
- `reduce_vars` improved when dealing with hoisted function definitions (#1544)
## v5.32.0
- `import("module")` can now be input and output from ESTree AST (#1557)
- `BigInt` literals can now be input and output from ESTree AST (#1555)
- `typeof` an object or array (`typeof {}` and `typeof []`) can now be statically evaluated. (#1546)
## v5.31.6
- Retain side effects in a `case` when the expression is a sequence (comma) expression
## v5.31.5
- Revert v5.31.4, which created mysterious issues #1548, #1549
## v5.31.4 (reverted)
- drop_unused: drop classes which only have side effects in the `extends` part
## v5.31.3
- drop_unused: drop unused parameters from IIFEs in some more situations.
## v5.31.2
- drop_unused: scan variables in self-referential class declarations that contain side effects.
- Don't add parens to arrow function when it's the default for an argument (#1540)
- Update domprops (#1538)
## v5.31.1
- Allow drop-unused to drop the whole assignment (not just the assigned name) in more situations, in order to avoid duplication of long strings.
## v5.31.0
- Sync up property mangler exceptions with current contents of Firefox and Chrome environments
- Add more webcomponent properties to property mangler exceptions (#1525)
- Drop non-nullish constants in `...spreads` in objects (#1141)
## v5.30.4
- Fix parsing `#private in ...` when next to other operators
## v5.30.3
- Fix precedence of `#private in ...` operator
## v5.30.2
- Avoid optimizations inside computed keys, because they can cause js-engine-specific bugs.
## v5.30.1
- Removed useless `\` escapes for non-ascii characters
- Make modern identifier characters quoted for older environments (#1512)
## v5.30.0
- Improve removal of classes referring to themselves
## v5.29.2
- Make sure 'computed_props' creates string keys
- Take into account the evaluated size when inlining
## v5.29.1
- fix optimisation of all-bits mask check
## v5.29.0
- Re-releases previously reverted 5.28.0
- Fix crash while optimizing some bitwise ops
- (internal) Remove needless wrapper for from_moz (#1499)
## v5.28.1
(hotfix release)
- Reverts v5.28.0
## v5.28.0
- Optimise redundant or shrinkable bitwise operations (`|`, `^`, `&`, `>>`, `<<`)
- Evaluate some `BigInt` math operations
## v5.27.2
- Recognise `this` as a reference to the surrounding class in `drop_unused`. Closes #1472
## v5.27.1
- Fixed case where `collapse_vars` inlines `await` expressions into non-async functions.
## v5.27.0
- Created `minify_sync()` alternative to `minify()` since there's no async code left.
## v5.26.0
- Do not take the `/*#__PURE__*/` annotation into account when the `side_effects` compress option is off.
- The `preserve_annotations` option now automatically opts annotation comments in, instead of requiring the `comments` option to be configured for this.
- Refuse to parse empty parenthesized expressions (`()`)
## v5.25.0
- Regex properties added to reserved property mangler (#1471)
- `pure_new` option added to drop unused `new` expressions.
## v5.24.0
- Improve formatting performance in V8 by keeping a small work string and a large output string
## v5.23.0
- When top_retain will keep a variable assignment around, inline the assignee when it's shorter than the name (#1434)
- Remove empty class `static {}` blocks.
## v5.22.0
- Do not `unsafe`ly shorten expressions like a?.toString() when they're conditional.
- Avoid running drop_unused in nodes that aren't scopes. Fixes a rare crash.
- When 'module' is enabled, assume strict mode when figuring out scopes.
## v5.21.0
- Do not inline functions that would be retained in the toplevel (as this would cause code duplication).
- Fix precedence of arrow function and ternary operator when formatting output.
## v5.20.0
- Passing `minify()` zero files will now throw a clean exception (#1450)
- `drop_console` supports passing in an array of `console.*` method names (#1445)
- New DOM properties from the WebGPU API have been added for use in the property mangler (#1436)
- Internal code simplification (#1437)
## v5.19.4
- Prevent creating very deeply nested ternaries from a long list of `if..return`
- Prevent inlining classes into other functions, to avoid constructors being compared.
## v5.19.3
- Fix side effect detection of `optional?.chains`.
- Add roundRect to domprops.js (#1426)
## v5.19.2
- fix performance hit from avoiding HTML comments in the output
## v5.19.1
- Better avoid outputting `</script>` and HTML comments.
- Fix unused variables in class static blocks not being dropped correctly.
- Fix sourcemap names of methods that are `async` or `static`
## v5.19.0
- Allow `/*@__MANGLE_PROP__*/` annotation in `object.property`, in addition to property declarations.
## v5.18.2
- Stop using recursion in hoisted defuns fix.
## v5.18.1
- Fix major performance issue caused by hoisted defuns' scopes bugfix.
## v5.18.0
- Add new `/*@__MANGLE_PROP__*/` annotation, to mark properties that should be mangled.
## v5.17.7
- Update some dependencies
- Add consistent sorting for `v` RegExp flag
- Add `inert` DOM attribute to domprops
## v5.17.6
- Fixes to mozilla AST input and output, for class properties, private properties and static blocks
- Fix outputting a shorthand property in quotes when safari10 and ecma=2015 options are enabled
- `configurable` and `enumerable`, used in Object.defineProperty, added to domprops (#1393)
## v5.17.5
- Take into account the non-deferred bits of a class, such as static properties, while dropping unused code.
## v5.17.4
- Fix crash when trying to negate a class (`!class{}`)
- Avoid outputting comments between `yield`/`await` and its argument
- Fix detection of left-hand-side of assignment, to avoid optimizing it like any other expression in some edge cases
## v5.17.3
- Fix issue with trimming a static class property's contents accessing the class as `this`.
## v5.17.2
- Be less conservative when detecting use-before-definition of `var` in hoisted functions.
- Support unusual (but perfectly valid) initializers of for-in and for-of loops.
- Fix issue where hoisted function would be dropped if it was after a `continue` statement
## v5.17.1
- Fix evaluating `.length` when the source array might've been mutated
## v5.17.0
- Drop vestigial `= undefined` default argument in IIFE calls (#1366)
- Evaluate known arrays' `.length` property when statically determinable
- Add `@__KEY__` annotation to mangle string literals (#1365)
## v5.16.9
- Fix parentheses in output of optional chains (`a?.b`) (#1374)
- More documentation on source maps (#1368)
- New `lhs_constants` option, allowing to stop Terser from swapping comparison operands (#1361)
## v5.16.8
- Become even less conservative around function definitions for `reduce_vars`
- Fix parsing context of `import.meta` expressions such that method calls are allowed
## v5.16.6
- Become less conservative with analyzing function definitions for `reduce_vars`
- Parse `import.meta` as a real AST node and not an `object.property`
## v5.16.5
- Correctly handle AST transform functions that mutate children arrays
- Don't mutate the options object passed to Terser (#1342)
- Do not treat BigInt like a number
## v5.16.4
- Keep `(defaultArg = undefined) => ...`, because default args don't count for function length
- Prevent inlining variables into `?.` optional chains
- Avoid removing unused arguments while transforming
- Optimize iterating AST node lists
- Make sure `catch` and `finally` aren't children of `try` in the AST
- Use modern unicode property escapes (`\p{...}`) to parse identifiers when available
## v5.16.3
- Ensure function definitions, don't assume the values of variables defined after them.
## v5.16.2
- Fix sourcemaps with non-ascii characters (#1318)
- Support string module name and export * as (#1336)
- Do not move `let` out of `for` initializers, as it can change scoping
- Fix a corner case that would generate the invalid syntax `if (something) let x` ("let" in braceless if body)
- Knowledge of more native object properties (#1330)
- Got rid of Travis (#1323)
- Added semi-secret `asObject` sourcemap option to typescript defs (#1321)
## v5.16.1
- Properly handle references in destructurings (`const { [reference]: val } = ...`)
- Allow parsing of `.#privatefield` in nested classes
- Do not evaluate operations that return large strings if that would make the output code larger
- Make `collapse_vars` handle block scope correctly
- Internal improvements: Typos (#1311), more tests, small-scale refactoring
## v5.16.0
- Disallow private fields in object bodies (#1011)
- Parse `#privatefield in object` (#1279)
- Compress `#privatefield in object`
## v5.15.1
- Fixed missing parentheses around optional chains
- Avoid bare `let` or `const` as the bodies of `if` statements (#1253)
- Small internal fixes (#1271)
- Avoid inlining a class twice and creating two equivalent but `!==` classes.
## v5.15.0
- Basic support for ES2022 class static initializer blocks.
- Add `AudioWorkletNode` constructor options to domprops list (#1230)
- Make identity function inliner not inline `id(...expandedArgs)`
## v5.14.2
- Security fix for RegExps that should not be evaluated (regexp DDOS)
- Source maps improvements (#1211)
- Performance improvements in long property access evaluation (#1213)
## v5.14.1
- keep_numbers option added to TypeScript defs (#1208)
- Fixed parsing of nested template strings (#1204)
## v5.14.0
- Switched to @jridgewell/source-map for sourcemap generation (#1190, #1181)
- Fixed source maps with non-terminated segments (#1106)
- Enabled typescript types to be imported from the package (#1194)
- Extra DOM props have been added (#1191)
- Delete the AST while generating code, as a means to save RAM
## v5.13.1
- Removed self-assignments (`varname=varname`) (closes #1081)
- Separated inlining code (for inlining things into references, or removing IIFEs)
- Allow multiple identifiers with the same name in `var` destructuring (eg `var { a, a } = x`) (#1176)
## v5.13.0
- All calls to eval() were removed (#1171, #1184)
- `source-map` was updated to 0.8.0-beta.0 (#1164)
- NavigatorUAData was added to domprops to avoid property mangling (#1166)
## v5.12.1
- Fixed an issue with function definitions inside blocks (#1155)
- Fixed parens of `new` in some situations (closes #1159)
## v5.12.0
- `TERSER_DEBUG_DIR` environment variable
- @copyright comments are now preserved with the comments="some" option (#1153)
## v5.11.0
- Unicode code point escapes (`\u{abcde}`) are not emitted inside RegExp literals anymore (#1147)
- acorn is now a regular dependency
## v5.10.0
- Massive optimization to max_line_len (#1109)
- Basic support for import assertions
- Marked ES2022 Object.hasOwn as a pure function
- Fix `delete optional?.property`
- New CI/CD pipeline with github actions (#1057)
- Fix reordering of switch branches (#1092), (#1084)
- Fix error when creating a class property called `get`
- Acorn dependency is now an optional peerDependency
- Fix mangling collision with exported variables (#1072)
- Fix an issue with `return someVariable = (async () => { ... })()` (#1073)
## v5.9.0
- Collapsing switch cases with the same bodies (even if they're not next to each other) (#1070).
- Fix evaluation of optional chain expressions (#1062)
- Fix mangling collision in ESM exports (#1063)
- Fix issue with mutating function objects after a second pass (#1047)
- Fix for inlining object spread `{ ...obj }` (#1071)
- Typescript typings fix (#1069)
## v5.8.0
- Fixed shadowing variables while moving code in some cases (#1065)
- Stop mangling computed & quoted properties when keep_quoted is enabled.
- Fix for mangling private getter/setter and .#private access (#1060, #1068)
- Array.from has a new optimization when the unsafe option is set (#737)
- Mangle/propmangle let you generate your own identifiers through the nth_identifier option (#1061)
- More optimizations to switch statements (#1044)
## v5.7.2
- Fixed issues with compressing functions defined in `global_defs` option (#1036)
- New recipe for using Terser in gulp was added to RECIPES.md (#1035)
- Fixed issues with `??` and `?.` (#1045)
- Future reserved words such as `package` no longer require you to disable strict mode to be used as names.
- Refactored huge compressor file into multiple more focused files.
- Avoided unparenthesized `in` operator in some for loops (it breaks parsing because of for..in loops)
- Improved documentation (#1021, #1025)
- More type definitions (#1021)
## v5.7.1
- Avoided collapsing assignments together if it would place a chain assignment on the left hand side, which is invalid syntax (`a?.b = c`)
- Removed undefined from object expansions (`{ ...void 0 }` -> `{}`)
- Fix crash when checking if something is nullish or undefined (#1009)
- Fixed comparison of private class properties (#1015)
- Minor performance improvements (#993)
- Fixed scope of function defs in strict mode (they are block scoped)
## v5.7.0
- Several compile-time evaluation and inlining fixes
- Allow `reduce_funcs` to be disabled again.
- Add `spidermonkey` options to parse and format (#974)
- Accept `{get = "default val"}` and `{set = "default val"}` in destructuring arguments.
- Change package.json export map to help require.resolve (#971)
- Improve docs
- Fix `export default` of an anonymous class with `extends`
## v5.6.1
- Mark assignments to the `.prototype` of a class as pure
- Parenthesize `await` on the left of `**` (while accepting legacy non-parenthesised input)
- Avoided outputting NUL bytes in optimized RegExps, to stop the output from breaking other tools
- Added `exports` to domprops (#939)
- Fixed a crash when spreading `...this`
- Fixed the computed size of arrow functions, which improves their inlining
## v5.6.0
- Added top-level await
- Beautify option has been removed in #895
- Private properties, getters and setters have been added in #913 and some more commits
- Docs improvements: #896, #903, #916
## v5.5.1
- Fixed object properties with unicode surrogates on safari.
## v5.5.0
- Fixed crash when inlining uninitialized variable into template string.
- The sourcemap for dist was removed for being too large.
## v5.4.0
- Logical assignment
- Change `let x = undefined` to just `let x`
- Removed some optimizations for template strings, placing them behind `unsafe` options. Reason: adding strings is not equivalent to template strings, due to valueOf differences.
- The AST_Token class was slimmed down in order to use less memory.
## v5.3.8
- Restore node 13 support
## v5.3.7
Hotfix release, fixes package.json "engines" syntax
## v5.3.6
- Fixed parentheses when outputting `??` mixed with `||` and `&&`
- Improved hygiene of the symbol generator
## v5.3.5
- Avoid moving named functions into default exports.
- Enabled transform() for chain expressions. This allows AST transformers to reach inside chain expressions.
## v5.3.4
- Fixed a crash when hoisting (with `hoist_vars`) a destructuring variable declaration
## v5.3.3
- `source-map` library has been updated, bringing memory usage and CPU time improvements when reading input source maps (the SourceMapConsumer is now WASM based).
- The `wrap_func_args` option now also wraps arrow functions, as opposed to only function expressions.
## v5.3.2
- Prevented spread operations from being expanded when the expanded array/object contains getters, setters, or array holes.
- Fixed _very_ slow self-recursion in some cases of removing extraneous parentheses from `+` operations.
## v5.3.1
- An issue with destructuring declarations when `pure_getters` is enabled has been fixed
- Fixed a crash when chain expressions need to be shallowly compared
- Made inlining functions more conservative to make sure a function that contains a reference to itself isn't moved into a place that can create multiple instances of itself.
## v5.3.0
- Fixed a crash when compressing object spreads in some cases
- Fixed compiletime evaluation of optional chains (caused typeof a?.b to always return "object")
- domprops has been updated to contain every single possible prop
## v5.2.1
- The parse step now doesn't accept an `ecma` option, so that all ES code is accepted.
- Optional dotted chains now accept keywords, just like dotted expressions (`foo?.default`)
## v5.2.0
- Optional chaining syntax is now supported.
- Consecutive await expressions don't have unnecessary parens
- Taking the variable name's length (after mangling) into consideration when deciding to inline
## v5.1.0
- `import.meta` is now supported
- Typescript typings have been improved
## v5.0.0
- `in` operator now taken into account during property mangle.
- Fixed infinite loop in face of a reference loop in some situations.
- Kept exports and imports around even if there's something which will throw before them.
- The main exported bundle for commonjs, dist/bundle.min.js is no longer minified.
## v5.0.0-beta.0
- BREAKING: `minify()` is now async and rejects a promise instead of returning an error.
- BREAKING: Internal AST is no longer exposed, so that it can be improved without releasing breaking changes.
- BREAKING: Lowest supported node version is 10
- BREAKING: There are no more warnings being emitted
- Module is now distributed as a dual package - You can `import` and `require()` too.
- Inline improvements were made
-----
## v4.8.1 (backport)
- Security fix for RegExps that should not be evaluated (regexp DDOS)
## v4.8.0
- Support for numeric separators (`million = 1_000_000`) was added.
- Assigning properties to a class is now assumed to be pure.
- Fixed bug where `yield` wasn't considered a valid property key in generators.
## v4.7.0
- A bug was fixed where an arrow function would have the wrong size
- `arguments` object is now considered safe to retrieve properties from (useful for `length`, or `0`) even when `pure_getters` is not set.
- Fixed erroneous `const` declarations without value (which is invalid) in some corner cases when using `collapse_vars`.
## v4.6.13
- Fixed issue where ES5 object properties were being turned into ES6 object properties due to more lax unicode rules.
- Fixed parsing of BigInt with lowercase `e` in them.
## v4.6.12
- Fixed subtree comparison code, making it see that `[1,[2, 3]]` is different from `[1, 2, [3]]`
- Printing of unicode identifiers has been improved
## v4.6.11
- Read unused classes' properties and method keys, to figure out if they use other variables.
- Prevent inlining into block scopes when there are name collisions
- Functions are no longer inlined into parameter defaults, because they live in their own special scope.
- When inlining identity functions, take into account the fact they may be used to drop `this` in function calls.
- Nullish coalescing operator (`x ?? y`), plus basic optimization for it.
- Template literals in binary expressions such as `+` have been further optimized
## v4.6.10
- Do not use reduce_vars when classes are present
## v4.6.9
- Check if block scopes actually exist in blocks
## v4.6.8
- Take into account "executed bits" of classes like static properties or computed keys, when checking if a class evaluation might throw or have side effects.
## v4.6.7
- Some new performance gains through a `AST_Node.size()` method which measures a node's source code length without printing it to a string first.
- An issue with setting `--comments` to `false` in the CLI has been fixed.
- Fixed some issues with inlining
- `unsafe_symbols` compress option was added, which turns `Symbol("name")` into just `Symbol()`
- Brought back compress performance improvement through the `AST_Node.equivalent_to(other)` method (which was reverted in v4.6.6).
## v4.6.6
(hotfix release)
- Reverted code to 4.6.4 to allow for more time to investigate an issue.
## v4.6.5 (REVERTED)
- Improved compress performance through using a new method to see if two nodes are equivalent, instead of printing them to a string.
## v4.6.4
- The `"some"` value in the `comments` output option now preserves `@lic` and other important comments when using `//`
- `</script>` is now better escaped in regex, and in comments, when using the `inline_script` output option
- Fixed an issue when transforming `new RegExp` into `/.../` when slashes are included in the source
- `AST_Node.prototype.constructor` now exists, allowing for easier debugging of crashes
- Multiple if statements with the same consequents are now collapsed
- Typescript typings improvements
- Optimizations while looking for surrogate pairs in strings
## v4.6.3
- Annotations such as `/*#__NOINLINE__*/` and `/*#__PURE__*/` may now be preserved using the `preserve_annotations` output option
- A TypeScript definition update for the `keep_quoted` output option.
## v4.6.2
- A bug where functions were inlined into other functions with scope conflicts has been fixed.
- `/*#__NOINLINE__*/` annotation fixed for more use cases where inlining happens.
## v4.6.1
- Fixed an issue where a class is duplicated by reduce_vars when there's a recursive reference to the class.
## v4.6.0
- Fixed issues with recursive class references.
- BigInt evaluation has been prevented, stopping Terser from evaluating BigInts like it would do regular numbers.
- Class property support has been added
## v4.5.1
(hotfix release)
- Fixed issue where `() => ({})[something]` was not parenthesised correctly.
## v4.5.0
- Inlining has been improved
- An issue where keep_fnames combined with functions declared through variables was causing name shadowing has been fixed
- You can now set the ES version through their year
- The output option `keep_numbers` has been added, which prevents Terser from turning `1000` into `1e3` and such
- Internal small optimisations and refactors
## v4.4.3
- Number and BigInt parsing has been fixed
- `/*#__INLINE__*/` annotation fixed for arrow functions with non-block bodies.
- Functional tests have been added, using [this repository](https://github.com/terser/terser-functional-tests).
- A memory leak, where the entire AST lives on after compression, has been plugged.
## v4.4.2
- Fixed a problem with inlining identity functions
## v4.4.1
*note:* This introduced a feature, therefore it should have been a minor release.
- Fixed a crash when `unsafe` was enabled.
- An issue has been fixed where `let` statements might be collapsed out of their scope.
- Some error messages have been improved by adding quotes around variable names.
## v4.4.0
- Added `/*#__INLINE__*/` and `/*#__NOINLINE__*/` annotations for calls. If a call has one of these, it either forces or forbids inlining.
## v4.3.11
- Fixed a problem where `window` was considered safe to access, even though there are situations where it isn't (Node.js, workers...)
- Fixed an error where `++` and `--` were considered side-effect free
- `Number(x)` now needs both `unsafe` and and `unsafe_math` to be compressed into `+x` because `x` might be a `BigInt`
- `keep_fnames` now correctly supports regexes when the function is in a variable declaration
## v4.3.10
- Fixed syntax error when repeated semicolons were encountered in classes
- Fixed invalid output caused by the creation of empty sequences internally
- Scopes are now updated when scopes are inlined into them
## v4.3.9
- Fixed issue with mangle's `keep_fnames` option, introduced when adding code to keep variable names of anonymous functions
## v4.3.8
- Typescript typings fix
## v4.3.7
- Parsing of regex options in the CLI (which broke in v4.3.5) was fixed.
- typescript definition updates
## v4.3.6
(crash hotfix)
## v4.3.5
- Fixed an issue with DOS line endings strings separated by `\` and a new line.
- Improved fix for the output size regression related to unused references within the extends section of a class.
- Variable names of anonymous functions (eg: `const x = () => { ... }` or `var func = function () {...}`) are now preserved when keep_fnames is true.
- Fixed performance degradation introduced for large payloads in v4.2.0
## v4.3.4
- Fixed a regression where the output size was increased when unused classes were referred to in the extends clause of a class.
- Small typescript typings fixes.
- Comments with `@preserve`, `@license`, `@cc_on` as well as comments starting with `/*!` and `/**!` are now preserved by default.
## v4.3.3
- Fixed a problem where parsing template strings would mix up octal notation and a slash followed by a zero representing a null character.
- Started accepting the name `async` in destructuring arguments with default value.
- Now Terser takes into account side effects inside class `extends` clauses.
- Added parens whenever there's a comment between a return statement and the returned value, to prevent issues with ASI.
- Stopped using raw RegExp objects, since the spec is going to continue to evolve. This ensures Terser is able to process new, unknown RegExp flags and features. This is a breaking change in the AST node AST_RegExp.
## v4.3.2
- Typescript typing fix
- Ensure that functions can't be inlined, by reduce_vars, into places where they're accessing variables with the same name, but from somewhere else.
## v4.3.1
- Fixed an issue from 4.3.0 where any block scope within a for loop erroneously had its parent set to the function scopee
- Fixed an issue where compressing IIFEs with argument expansions would result in some parameters becoming undefined
- addEventListener options argument's properties are now part of the DOM properties list.
## v4.3.0
- Do not drop computed object keys with side effects
- Functions passed to other functions in calls are now wrapped in parentheses by default, which speeds up loading most modules
- Objects with computed properties are now less likely to be hoisted
- Speed and memory efficiency optimizations
- Fixed scoping issues with `try` and `switch`
## v4.2.1
- Minor refactors
- Fixed a bug similar to #369 in collapse_vars
- Functions can no longer be inlined into a place where they're going to be compared with themselves.
- reduce_funcs option is now legacy, as using reduce_vars without reduce_funcs caused some weird corner cases. As a result, it is now implied in reduce_vars and can't be turned off without turning off reduce_vars.
- Bug which would cause a random stack overflow has now been fixed.
## v4.2.0
- When the source map URL is `inline`, don't write it to a file.
- Fixed output parens when a lambda literal is the tag on a tagged template string.
- The `mangle.properties.undeclared` option was added. This enables the property mangler to mangle properties of variables which can be found in the name cache, but whose properties are not known to this Terser run.
- The v8 bug where the toString and source representations of regexes like `RegExp("\\\n")` includes an actual newline is now fixed.
- Now we're guaranteed to not have duplicate comments in the output
- Domprops updates
## v4.1.4
- Fixed a crash when inlining a function into somewhere else when it has interdependent, non-removable variables.
## v4.1.3
- Several issues with the `reduce_vars` option were fixed.
- Starting this version, we only have a dist/bundle.min.js
## v4.1.2
- The hotfix was hotfixed
## v4.1.1
- Fixed a bug where toplevel scopes were being mixed up with lambda scopes
## v4.1.0
- Internal functions were replaced by `Object.assign`, `Array.prototype.some`, `Array.prototype.find` and `Array.prototype.every`.
- A serious issue where some ESM-native code was broken was fixed.
- Performance improvements were made.
- Support for BigInt was added.
- Inline efficiency was improved. Functions are now being inlined more proactively instead of being inlined only after another Compressor pass.
## v4.0.2
(Hotfix release. Reverts unmapped segments PR [#342](https://github.com/terser/terser/pull/342), which will be put back on Terser when the upstream issue is resolved)
## v4.0.1
- Collisions between the arguments of inlined functions and names in the outer scope are now being avoided while inlining
- Unmapped segments are now preserved when compressing a file which has source maps
- Default values of functions are now correctly converted from Mozilla AST to Terser AST
- JSON ⊂ ECMAScript spec (if you don't know what this is you don't need to)
- Export AST_* classes to library users
- Fixed issue with `collapse_vars` when functions are created with the same name as a variable which already exists
- Added `MutationObserverInit` (Object with options for initialising a mutation observer) properties to the DOM property list
- Custom `Error` subclasses are now internally used instead of old-school Error inheritance hacks.
- Documentation fixes
- Performance optimizations
## v4.0.0
- **breaking change**: The `variables` property of all scopes has become a standard JavaScript `Map` as opposed to the old bespoke `Dictionary` object.
- Typescript definitions were fixed
- `terser --help` was fixed
- The public interface was cleaned up
- Fixed optimisation of `Array` and `new Array`
- Added the `keep_quoted=strict` mode to mangle_props, which behaves more like Google Closure Compiler by mangling all unquoted property names, instead of reserving quoted property names automatically.
- Fixed parent functions' parameters being shadowed in some cases
- Allowed Terser to run in a situation where there are custom functions attached to Object.prototype
- And more bug fixes, optimisations and internal changes
## v3.17.0
- More DOM properties added to --mangle-properties's DOM property list
- Closed issue where if 2 functions had the same argument name, Terser would not inline them together properly
- Fixed issue with `hasOwnProperty.call`
- You can now list files to minify in a Terser config file
- Started replacing `new Array(<number>)` with an array literal
- Started using ES6 capabilities like `Set` and the `includes` method for strings and arrays
## v3.16.1
- Fixed issue where Terser being imported with `import` would cause it not to work due to the `__esModule` property. (PR #254 was submitted, which was nice, but since it wasn't a pure commonJS approach I decided to go with my own solution)
## v3.16.0
- No longer leaves names like Array or Object or window as a SimpleStatement (statement which is just a single expression).
- Add support for sections sourcemaps (IndexedSourceMapConsumer)
- Drops node.js v4 and starts using commonJS
- Is now built with rollup
## v3.15.0
- Inlined spread syntax (`[...[1, 2, 3], 4, 5] => [1, 2, 3, 4, 5]`) in arrays and objects.
- Fixed typo in compressor warning
- Fixed inline source map input bug
- Fixed parsing of template literals with unnecessary escapes (Like `\\a`)

View File

@@ -0,0 +1,9 @@
import type { Span } from '@sentry/core';
/**
* Handles the on span start event for Next.js spans.
* This function is used to enhance the span with additional information such as the route, the method, the headers, etc.
* It is called for every span that is started by Next.js.
* @param span The span that is starting.
*/
export declare function handleOnSpanStart(span: Span): void;
//# sourceMappingURL=handleOnSpanStart.d.ts.map

View File

@@ -0,0 +1,506 @@
import {JSONSchema4Type, JSONSchema4TypeName} from 'json-schema'
import {findKey, includes, isPlainObject, map, memoize, omit} from 'lodash'
import {format} from 'util'
import {Options} from './'
import {applySchemaTyping} from './applySchemaTyping'
import type {AST, TInterface, TInterfaceParam, TIntersection, TNamedInterface, TTuple} from './types/AST'
import {T_ANY, T_ANY_ADDITIONAL_PROPERTIES, T_UNKNOWN, T_UNKNOWN_ADDITIONAL_PROPERTIES} from './types/AST'
import type {
EnumJSONSchema,
JSONSchemaWithDefinitions,
LinkedJSONSchema,
NormalizedJSONSchema,
SchemaSchema,
SchemaType,
} from './types/JSONSchema'
import {Intersection, Types, getRootSchema, isBoolean, isPrimitive} from './types/JSONSchema'
import {generateName, log, maybeStripDefault} from './utils'
export type Processed = Map<NormalizedJSONSchema, Map<SchemaType, AST>>
export type UsedNames = Set<string>
export function parse(
schema: NormalizedJSONSchema | JSONSchema4Type,
options: Options,
keyName?: string,
processed: Processed = new Map(),
usedNames = new Set<string>(),
): AST {
if (isPrimitive(schema)) {
if (isBoolean(schema)) {
return parseBooleanSchema(schema, keyName, options)
}
return parseLiteral(schema, keyName)
}
const intersection = schema[Intersection]
const types = schema[Types]
if (intersection) {
const ast = parseAsTypeWithCache(intersection, 'ALL_OF', options, keyName, processed, usedNames) as TIntersection
types.forEach(type => {
ast.params.push(parseAsTypeWithCache(schema, type, options, keyName, processed, usedNames))
})
log('blue', 'parser', 'Types:', [...types], 'Input:', schema, 'Output:', ast)
return ast
}
if (types.size === 1) {
const type = [...types][0]
const ast = parseAsTypeWithCache(schema, type, options, keyName, processed, usedNames)
log('blue', 'parser', 'Type:', type, 'Input:', schema, 'Output:', ast)
return ast
}
throw new ReferenceError('Expected intersection schema. Please file an issue on GitHub.')
}
function parseAsTypeWithCache(
schema: NormalizedJSONSchema,
type: SchemaType,
options: Options,
keyName?: string,
processed: Processed = new Map(),
usedNames = new Set<string>(),
): AST {
// If we've seen this node before, return it.
let cachedTypeMap = processed.get(schema)
if (!cachedTypeMap) {
cachedTypeMap = new Map()
processed.set(schema, cachedTypeMap)
}
const cachedAST = cachedTypeMap.get(type)
if (cachedAST) {
return cachedAST
}
// Cache processed ASTs before they are actually computed, then update
// them in place using set(). This is to avoid cycles.
// TODO: Investigate alternative approaches (lazy-computing nodes, etc.)
const ast = {} as AST
cachedTypeMap.set(type, ast)
// Update the AST in place. This updates the `processed` cache, as well
// as any nodes that directly reference the node.
return Object.assign(ast, parseNonLiteral(schema, type, options, keyName, processed, usedNames))
}
function parseBooleanSchema(schema: boolean, keyName: string | undefined, options: Options): AST {
if (schema) {
return {
keyName,
type: options.unknownAny ? 'UNKNOWN' : 'ANY',
}
}
return {
keyName,
type: 'NEVER',
}
}
function parseLiteral(schema: JSONSchema4Type, keyName: string | undefined): AST {
return {
keyName,
params: schema,
type: 'LITERAL',
}
}
function parseNonLiteral(
schema: NormalizedJSONSchema,
type: SchemaType,
options: Options,
keyName: string | undefined,
processed: Processed,
usedNames: UsedNames,
): AST {
const definitions = getDefinitionsMemoized(getRootSchema(schema as any)) // TODO
const keyNameFromDefinition = findKey(definitions, _ => _ === schema)
switch (type) {
case 'ALL_OF':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
params: schema.allOf!.map(_ => parse(_, options, undefined, processed, usedNames)),
type: 'INTERSECTION',
}
case 'ANY':
return {
...(options.unknownAny ? T_UNKNOWN : T_ANY),
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
}
case 'ANY_OF':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
params: schema.anyOf!.map(_ => parse(_, options, undefined, processed, usedNames)),
type: 'UNION',
}
case 'BOOLEAN':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
type: 'BOOLEAN',
}
case 'CUSTOM_TYPE':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
params: schema.tsType!,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
type: 'CUSTOM_TYPE',
}
case 'NAMED_ENUM':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition ?? keyName, usedNames, options)!,
params: (schema as EnumJSONSchema).enum!.map((_, n) => ({
ast: parseLiteral(_, undefined),
keyName: schema.tsEnumNames![n],
})),
type: 'ENUM',
}
case 'NAMED_SCHEMA':
return newInterface(schema as SchemaSchema, options, processed, usedNames, keyName)
case 'NEVER':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
type: 'NEVER',
}
case 'NULL':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
type: 'NULL',
}
case 'NUMBER':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
type: 'NUMBER',
}
case 'OBJECT':
return {
comment: schema.description,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
type: 'OBJECT',
deprecated: schema.deprecated,
}
case 'ONE_OF':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
params: schema.oneOf!.map(_ => parse(_, options, undefined, processed, usedNames)),
type: 'UNION',
}
case 'REFERENCE':
throw Error(format('Refs should have been resolved by the resolver!', schema))
case 'STRING':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
type: 'STRING',
}
case 'TYPED_ARRAY':
if (Array.isArray(schema.items)) {
// normalised to not be undefined
const minItems = schema.minItems!
const maxItems = schema.maxItems!
const arrayType: TTuple = {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
maxItems,
minItems,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
params: schema.items.map(_ => parse(_, options, undefined, processed, usedNames)),
type: 'TUPLE',
}
if (schema.additionalItems === true) {
arrayType.spreadParam = options.unknownAny ? T_UNKNOWN : T_ANY
} else if (schema.additionalItems) {
arrayType.spreadParam = parse(schema.additionalItems, options, undefined, processed, usedNames)
}
return arrayType
} else {
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
params: parse(schema.items!, options, `{keyNameFromDefinition}Items`, processed, usedNames),
type: 'ARRAY',
}
}
case 'UNION':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
params: (schema.type as JSONSchema4TypeName[]).map(type => {
const member: LinkedJSONSchema = {...omit(schema, '$id', 'description', 'title'), type}
maybeStripDefault(member)
applySchemaTyping(member)
return parse(member, options, undefined, processed, usedNames)
}),
type: 'UNION',
}
case 'UNNAMED_ENUM':
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
params: (schema as EnumJSONSchema).enum!.map(_ => parseLiteral(_, undefined)),
type: 'UNION',
}
case 'UNNAMED_SCHEMA':
return newInterface(schema as SchemaSchema, options, processed, usedNames, keyName, keyNameFromDefinition)
case 'UNTYPED_ARRAY':
// normalised to not be undefined
const minItems = schema.minItems!
const maxItems = typeof schema.maxItems === 'number' ? schema.maxItems : -1
const params = options.unknownAny ? T_UNKNOWN : T_ANY
if (minItems > 0 || maxItems >= 0) {
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
maxItems: schema.maxItems,
minItems,
// create a tuple of length N
params: Array(Math.max(maxItems, minItems) || 0).fill(params),
// if there is no maximum, then add a spread item to collect the rest
spreadParam: maxItems >= 0 ? undefined : params,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
type: 'TUPLE',
}
}
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
params,
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames, options),
type: 'ARRAY',
}
}
}
/**
* Compute a schema name using a series of fallbacks
*/
function standaloneName(
schema: NormalizedJSONSchema,
keyNameFromDefinition: string | undefined,
usedNames: UsedNames,
options: Options,
): string | undefined {
const name =
options.customName?.(schema, keyNameFromDefinition) || schema.title || schema.$id || keyNameFromDefinition
if (name) {
return generateName(name, usedNames)
}
}
function newInterface(
schema: SchemaSchema,
options: Options,
processed: Processed,
usedNames: UsedNames,
keyName?: string,
keyNameFromDefinition?: string,
): TInterface {
const name = standaloneName(schema, keyNameFromDefinition, usedNames, options)!
return {
comment: schema.description,
deprecated: schema.deprecated,
keyName,
params: parseSchema(schema, options, processed, usedNames, name),
standaloneName: name,
superTypes: parseSuperTypes(schema, options, processed, usedNames),
type: 'INTERFACE',
}
}
function parseSuperTypes(
schema: SchemaSchema,
options: Options,
processed: Processed,
usedNames: UsedNames,
): TNamedInterface[] {
// Type assertion needed because of dereferencing step
// TODO: Type it upstream
const superTypes = schema.extends as SchemaSchema[] | undefined
if (!superTypes) {
return []
}
return superTypes.map(_ => parse(_, options, undefined, processed, usedNames) as TNamedInterface)
}
/**
* Helper to parse schema properties into params on the parent schema's type
*/
function parseSchema(
schema: SchemaSchema,
options: Options,
processed: Processed,
usedNames: UsedNames,
parentSchemaName: string,
): TInterfaceParam[] {
let asts: TInterfaceParam[] = map(schema.properties, (value, key: string) => ({
ast: parse(value, options, key, processed, usedNames),
isPatternProperty: false,
isRequired: includes(schema.required || [], key),
isUnreachableDefinition: false,
keyName: key,
}))
let singlePatternProperty = false
if (schema.patternProperties) {
// partially support patternProperties. in the case that
// additionalProperties is not set, and there is only a single
// value definition, we can validate against that.
singlePatternProperty = !schema.additionalProperties && Object.keys(schema.patternProperties).length === 1
asts = asts.concat(
map(schema.patternProperties, (value, key: string) => {
const ast = parse(value, options, key, processed, usedNames)
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema definition
via the \`patternProperty\` "${key.replace('*/', '*\\/')}".`
ast.comment = ast.comment ? `${ast.comment}\n\n${comment}` : comment
return {
ast,
isPatternProperty: !singlePatternProperty,
isRequired: singlePatternProperty || includes(schema.required || [], key),
isUnreachableDefinition: false,
keyName: singlePatternProperty ? '[k: string]' : key,
}
}),
)
}
if (options.unreachableDefinitions) {
asts = asts.concat(
map(schema.$defs, (value, key: string) => {
const ast = parse(value, options, key, processed, usedNames)
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema
via the \`definition\` "${key}".`
ast.comment = ast.comment ? `${ast.comment}\n\n${comment}` : comment
return {
ast,
isPatternProperty: false,
isRequired: includes(schema.required || [], key),
isUnreachableDefinition: true,
keyName: key,
}
}),
)
}
// handle additionalProperties
switch (schema.additionalProperties) {
case undefined:
case true:
if (singlePatternProperty) {
return asts
}
return asts.concat({
ast: options.unknownAny ? T_UNKNOWN_ADDITIONAL_PROPERTIES : T_ANY_ADDITIONAL_PROPERTIES,
isPatternProperty: false,
isRequired: true,
isUnreachableDefinition: false,
keyName: '[k: string]',
})
case false:
return asts
// pass "true" as the last param because in TS, properties
// defined via index signatures are already optional
default:
return asts.concat({
ast: parse(schema.additionalProperties, options, '[k: string]', processed, usedNames),
isPatternProperty: false,
isRequired: true,
isUnreachableDefinition: false,
keyName: '[k: string]',
})
}
}
type Definitions = {[k: string]: NormalizedJSONSchema}
function getDefinitions(
schema: NormalizedJSONSchema,
isSchema = true,
processed = new Set<NormalizedJSONSchema>(),
): Definitions {
if (processed.has(schema)) {
return {}
}
processed.add(schema)
if (Array.isArray(schema)) {
return schema.reduce(
(prev, cur) => ({
...prev,
...getDefinitions(cur, false, processed),
}),
{},
)
}
if (isPlainObject(schema)) {
return {
...(isSchema && hasDefinitions(schema) ? schema.$defs : {}),
...Object.keys(schema).reduce<Definitions>(
(prev, cur) => ({
...prev,
...getDefinitions(schema[cur], false, processed),
}),
{},
),
}
}
return {}
}
const getDefinitionsMemoized = memoize(getDefinitions)
/**
* TODO: Reduce rate of false positives
*/
function hasDefinitions(schema: NormalizedJSONSchema): schema is JSONSchemaWithDefinitions {
return '$defs' in schema
}

View File

@@ -0,0 +1,225 @@
'use strict'
const diagnosticsChannel = require('node:diagnostics_channel')
const util = require('node:util')
const undiciDebugLog = util.debuglog('undici')
const fetchDebuglog = util.debuglog('fetch')
const websocketDebuglog = util.debuglog('websocket')
const channels = {
// Client
beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'),
connected: diagnosticsChannel.channel('undici:client:connected'),
connectError: diagnosticsChannel.channel('undici:client:connectError'),
sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'),
// Request
create: diagnosticsChannel.channel('undici:request:create'),
bodySent: diagnosticsChannel.channel('undici:request:bodySent'),
bodyChunkSent: diagnosticsChannel.channel('undici:request:bodyChunkSent'),
bodyChunkReceived: diagnosticsChannel.channel('undici:request:bodyChunkReceived'),
headers: diagnosticsChannel.channel('undici:request:headers'),
trailers: diagnosticsChannel.channel('undici:request:trailers'),
error: diagnosticsChannel.channel('undici:request:error'),
// WebSocket
open: diagnosticsChannel.channel('undici:websocket:open'),
close: diagnosticsChannel.channel('undici:websocket:close'),
socketError: diagnosticsChannel.channel('undici:websocket:socket_error'),
ping: diagnosticsChannel.channel('undici:websocket:ping'),
pong: diagnosticsChannel.channel('undici:websocket:pong'),
// ProxyAgent
proxyConnected: diagnosticsChannel.channel('undici:proxy:connected')
}
let isTrackingClientEvents = false
function trackClientEvents (debugLog = undiciDebugLog) {
if (isTrackingClientEvents) {
return
}
// Check if any of the channels already have subscribers to prevent duplicate subscriptions
// This can happen when both Node.js built-in undici and undici as a dependency are present
if (channels.beforeConnect.hasSubscribers || channels.connected.hasSubscribers ||
channels.connectError.hasSubscribers || channels.sendHeaders.hasSubscribers) {
isTrackingClientEvents = true
return
}
isTrackingClientEvents = true
diagnosticsChannel.subscribe('undici:client:beforeConnect',
evt => {
const {
connectParams: { version, protocol, port, host }
} = evt
debugLog(
'connecting to %s%s using %s%s',
host,
port ? `:${port}` : '',
protocol,
version
)
})
diagnosticsChannel.subscribe('undici:client:connected',
evt => {
const {
connectParams: { version, protocol, port, host }
} = evt
debugLog(
'connected to %s%s using %s%s',
host,
port ? `:${port}` : '',
protocol,
version
)
})
diagnosticsChannel.subscribe('undici:client:connectError',
evt => {
const {
connectParams: { version, protocol, port, host },
error
} = evt
debugLog(
'connection to %s%s using %s%s errored - %s',
host,
port ? `:${port}` : '',
protocol,
version,
error.message
)
})
diagnosticsChannel.subscribe('undici:client:sendHeaders',
evt => {
const {
request: { method, path, origin }
} = evt
debugLog('sending request to %s %s%s', method, origin, path)
})
}
let isTrackingRequestEvents = false
function trackRequestEvents (debugLog = undiciDebugLog) {
if (isTrackingRequestEvents) {
return
}
// Check if any of the channels already have subscribers to prevent duplicate subscriptions
// This can happen when both Node.js built-in undici and undici as a dependency are present
if (channels.headers.hasSubscribers || channels.trailers.hasSubscribers ||
channels.error.hasSubscribers) {
isTrackingRequestEvents = true
return
}
isTrackingRequestEvents = true
diagnosticsChannel.subscribe('undici:request:headers',
evt => {
const {
request: { method, path, origin },
response: { statusCode }
} = evt
debugLog(
'received response to %s %s%s - HTTP %d',
method,
origin,
path,
statusCode
)
})
diagnosticsChannel.subscribe('undici:request:trailers',
evt => {
const {
request: { method, path, origin }
} = evt
debugLog('trailers received from %s %s%s', method, origin, path)
})
diagnosticsChannel.subscribe('undici:request:error',
evt => {
const {
request: { method, path, origin },
error
} = evt
debugLog(
'request to %s %s%s errored - %s',
method,
origin,
path,
error.message
)
})
}
let isTrackingWebSocketEvents = false
function trackWebSocketEvents (debugLog = websocketDebuglog) {
if (isTrackingWebSocketEvents) {
return
}
// Check if any of the channels already have subscribers to prevent duplicate subscriptions
// This can happen when both Node.js built-in undici and undici as a dependency are present
if (channels.open.hasSubscribers || channels.close.hasSubscribers ||
channels.socketError.hasSubscribers || channels.ping.hasSubscribers ||
channels.pong.hasSubscribers) {
isTrackingWebSocketEvents = true
return
}
isTrackingWebSocketEvents = true
diagnosticsChannel.subscribe('undici:websocket:open',
evt => {
const {
address: { address, port }
} = evt
debugLog('connection opened %s%s', address, port ? `:${port}` : '')
})
diagnosticsChannel.subscribe('undici:websocket:close',
evt => {
const { websocket, code, reason } = evt
debugLog(
'closed connection to %s - %s %s',
websocket.url,
code,
reason
)
})
diagnosticsChannel.subscribe('undici:websocket:socket_error',
err => {
debugLog('connection errored - %s', err.message)
})
diagnosticsChannel.subscribe('undici:websocket:ping',
evt => {
debugLog('ping received')
})
diagnosticsChannel.subscribe('undici:websocket:pong',
evt => {
debugLog('pong received')
})
}
if (undiciDebugLog.enabled || fetchDebuglog.enabled) {
trackClientEvents(fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog)
trackRequestEvents(fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog)
}
if (websocketDebuglog.enabled) {
trackClientEvents(undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog)
trackWebSocketEvents(websocketDebuglog)
}
module.exports = {
channels
}

View File

@@ -0,0 +1,41 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://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 CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.HapiLifecycleMethodNames = exports.HapiLayerType = exports.handlerPatched = exports.HapiComponentName = void 0;
exports.HapiComponentName = '@hapi/hapi';
/**
* This symbol is used to mark a Hapi route handler or server extension handler as
* already patched, since its possible to use these handlers multiple times
* i.e. when allowing multiple versions of one plugin, or when registering a plugin
* multiple times on different servers.
*/
exports.handlerPatched = Symbol('hapi-handler-patched');
exports.HapiLayerType = {
ROUTER: 'router',
PLUGIN: 'plugin',
EXT: 'server.ext',
};
exports.HapiLifecycleMethodNames = new Set([
'onPreAuth',
'onCredentials',
'onPostAuth',
'onPreHandler',
'onPostHandler',
'onPreResponse',
'onRequest',
]);
//# sourceMappingURL=internal-types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"globalListeners.js","sources":["../../../../../src/metrics/web-vitals/lib/globalListeners.ts"],"sourcesContent":["import { WINDOW } from '../../../types';\n\n/**\n * web-vitals 5.1.0 switched listeners to be added on the window rather than the document.\n * Instead of having to check for window/document every time we add a listener, we can use this function.\n */\nexport function addPageListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions) {\n if (WINDOW.document) {\n WINDOW.addEventListener(type, listener, options);\n }\n}\n/**\n * web-vitals 5.1.0 switched listeners to be removed from the window rather than the document.\n * Instead of having to check for window/document every time we remove a listener, we can use this function.\n */\nexport function removePageListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions) {\n if (WINDOW.document) {\n WINDOW.removeEventListener(type, listener, options);\n }\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,IAAI,EAAU,QAAQ,EAAiB,OAAO,EAAsC;AACpH,EAAE,IAAI,MAAM,CAAC,QAAQ,EAAE;AACvB,IAAI,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC;AACpD,EAAE;AACF;AACA;AACA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,IAAI,EAAU,QAAQ,EAAiB,OAAO,EAAsC;AACvH,EAAE,IAAI,MAAM,CAAC,QAAQ,EAAE;AACvB,IAAI,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC;AACvD,EAAE;AACF;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"context-utils.js","sourceRoot":"","sources":["../../../src/trace/context-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;GAEG;AACH,IAAM,QAAQ,GAAG,gBAAgB,CAAC,gCAAgC,CAAC,CAAC;AAEpE;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,OAAgB;IACtC,OAAQ,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU,IAAI,SAAS,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;AACpD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,OAAgB,EAAE,IAAU;IAClD,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAO,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAgB,EAChB,WAAwB;IAExB,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAgB;;IAC7C,OAAO,MAAA,OAAO,CAAC,OAAO,CAAC,0CAAE,WAAW,EAAE,CAAC;AACzC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createContextKey } from '../context/context';\nimport { Context } from '../context/types';\nimport { Span } from './span';\nimport { SpanContext } from './span_context';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { ContextAPI } from '../api/context';\n\n/**\n * span key\n */\nconst SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');\n\n/**\n * Return the span if one exists\n *\n * @param context context to get span from\n */\nexport function getSpan(context: Context): Span | undefined {\n return (context.getValue(SPAN_KEY) as Span) || undefined;\n}\n\n/**\n * Gets the span from the current context, if one exists.\n */\nexport function getActiveSpan(): Span | undefined {\n return getSpan(ContextAPI.getInstance().active());\n}\n\n/**\n * Set the span on a context\n *\n * @param context context to use as parent\n * @param span span to set active\n */\nexport function setSpan(context: Context, span: Span): Context {\n return context.setValue(SPAN_KEY, span);\n}\n\n/**\n * Remove current span stored in the context\n *\n * @param context context to delete span from\n */\nexport function deleteSpan(context: Context): Context {\n return context.deleteValue(SPAN_KEY);\n}\n\n/**\n * Wrap span context in a NoopSpan and set as span in a new\n * context\n *\n * @param context context to set active span on\n * @param spanContext span context to be wrapped\n */\nexport function setSpanContext(\n context: Context,\n spanContext: SpanContext\n): Context {\n return setSpan(context, new NonRecordingSpan(spanContext));\n}\n\n/**\n * Get the span context of the span if it exists.\n *\n * @param context context to get values from\n */\nexport function getSpanContext(context: Context): SpanContext | undefined {\n return getSpan(context)?.spanContext();\n}\n"]}

View File

@@ -0,0 +1,16 @@
import { Element } from 'domhandler';
import { Picker, Ast } from 'selderee';
/**
* A {@link BuilderFunction} implementation.
*
* Creates a function (in a {@link Picker} wrapper) that can run
* the decision tree against `htmlparser2` `Element` nodes.
*
* @typeParam V - the type of values associated with selectors.
*
* @param nodes - nodes ({@link DecisionTreeNode})
* from the root level of the decision tree.
*
* @returns a {@link Picker} object.
*/
export declare function hp2Builder<V>(nodes: Ast.DecisionTreeNode<V>[]): Picker<Element, V>;

View File

@@ -0,0 +1,7 @@
import type { NextRequest, NextResponse } from 'next/server.js';
import type { Locale } from 'use-intl';
import type { InitializedLocaleCookieConfig, ResolvedRoutingConfig } from '../routing/config.js';
import type { DomainConfig, DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types.js';
export default function syncCookie<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined>(request: NextRequest, response: NextResponse, locale: Locale, routing: Pick<ResolvedRoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>, 'locales' | 'defaultLocale'> & {
localeCookie: InitializedLocaleCookieConfig;
}, domain?: DomainConfig<AppLocales>): void;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/getRequestLanguage.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\nimport type { ReadonlyRequestCookies } from 'next/dist/server/web/spec-extension/adapters/request-cookies.js'\n\nimport { extractHeaderLanguage } from '@payloadcms/translations'\n\nimport type { SanitizedConfig } from '../config/types.js'\n\ntype GetRequestLanguageArgs = {\n config: SanitizedConfig\n cookies: Map<string, string> | ReadonlyRequestCookies\n defaultLanguage?: AcceptedLanguages\n headers: Request['headers']\n}\n\nexport const getRequestLanguage = ({\n config,\n cookies,\n headers,\n}: GetRequestLanguageArgs): AcceptedLanguages => {\n const supportedLanguageKeys = Object.keys(config.i18n.supportedLanguages) as AcceptedLanguages[]\n const langCookie = cookies.get(`${config.cookiePrefix || 'payload'}-lng`)\n\n const languageFromCookie: AcceptedLanguages = (\n typeof langCookie === 'string' ? langCookie : langCookie?.value\n ) as AcceptedLanguages\n\n if (languageFromCookie && supportedLanguageKeys.includes(languageFromCookie)) {\n return languageFromCookie\n }\n\n const languageFromHeader = headers.get('Accept-Language')\n ? extractHeaderLanguage(headers.get('Accept-Language')!)\n : undefined\n\n if (languageFromHeader && supportedLanguageKeys.includes(languageFromHeader)) {\n return languageFromHeader\n }\n\n return config.i18n.fallbackLanguage\n}\n"],"names":["extractHeaderLanguage","getRequestLanguage","config","cookies","headers","supportedLanguageKeys","Object","keys","i18n","supportedLanguages","langCookie","get","cookiePrefix","languageFromCookie","value","includes","languageFromHeader","undefined","fallbackLanguage"],"mappings":"AAGA,SAASA,qBAAqB,QAAQ,2BAA0B;AAWhE,OAAO,MAAMC,qBAAqB,CAAC,EACjCC,MAAM,EACNC,OAAO,EACPC,OAAO,EACgB;IACvB,MAAMC,wBAAwBC,OAAOC,IAAI,CAACL,OAAOM,IAAI,CAACC,kBAAkB;IACxE,MAAMC,aAAaP,QAAQQ,GAAG,CAAC,GAAGT,OAAOU,YAAY,IAAI,UAAU,IAAI,CAAC;IAExE,MAAMC,qBACJ,OAAOH,eAAe,WAAWA,aAAaA,YAAYI;IAG5D,IAAID,sBAAsBR,sBAAsBU,QAAQ,CAACF,qBAAqB;QAC5E,OAAOA;IACT;IAEA,MAAMG,qBAAqBZ,QAAQO,GAAG,CAAC,qBACnCX,sBAAsBI,QAAQO,GAAG,CAAC,sBAClCM;IAEJ,IAAID,sBAAsBX,sBAAsBU,QAAQ,CAACC,qBAAqB;QAC5E,OAAOA;IACT;IAEA,OAAOd,OAAOM,IAAI,CAACU,gBAAgB;AACrC,EAAC"}

View File

@@ -0,0 +1,187 @@
'use strict'
const { test } = require('node:test')
const assert = require('node:assert')
const serializer = require('../lib/err-with-cause')
const { wrapErrorSerializer } = require('../')
test('serializes Error objects', () => {
const serialized = serializer(Error('foo'))
assert.strictEqual(serialized.type, 'Error')
assert.strictEqual(serialized.message, 'foo')
assert.match(serialized.stack, /err-with-cause\.test\.js:/)
})
test('serializes Error objects with extra properties', () => {
const err = Error('foo')
err.statusCode = 500
const serialized = serializer(err)
assert.strictEqual(serialized.type, 'Error')
assert.strictEqual(serialized.message, 'foo')
assert.ok(serialized.statusCode)
assert.strictEqual(serialized.statusCode, 500)
assert.match(serialized.stack, /err-with-cause\.test\.js:/)
})
test('serializes Error objects with subclass "type"', () => {
class MyError extends Error {}
const err = new MyError('foo')
const serialized = serializer(err)
assert.strictEqual(serialized.type, 'MyError')
})
test('serializes nested errors', () => {
const err = Error('foo')
err.inner = Error('bar')
const serialized = serializer(err)
assert.strictEqual(serialized.type, 'Error')
assert.strictEqual(serialized.message, 'foo')
assert.match(serialized.stack, /err-with-cause\.test\.js:/)
assert.strictEqual(serialized.inner.type, 'Error')
assert.strictEqual(serialized.inner.message, 'bar')
assert.match(serialized.inner.stack, /Error: bar/)
assert.match(serialized.inner.stack, /err-with-cause\.test\.js:/)
})
test('serializes error causes', () => {
const innerErr = Error('inner')
const middleErr = Error('middle')
middleErr.cause = innerErr
const outerErr = Error('outer')
outerErr.cause = middleErr
const serialized = serializer(outerErr)
assert.strictEqual(serialized.type, 'Error')
assert.strictEqual(serialized.message, 'outer')
assert.match(serialized.stack, /err-with-cause\.test\.js:/)
assert.strictEqual(serialized.cause.type, 'Error')
assert.strictEqual(serialized.cause.message, 'middle')
assert.match(serialized.cause.stack, /err-with-cause\.test\.js:/)
assert.strictEqual(serialized.cause.cause.type, 'Error')
assert.strictEqual(serialized.cause.cause.message, 'inner')
assert.match(serialized.cause.cause.stack, /err-with-cause\.test\.js:/)
})
test('keeps non-error cause', () => {
const err = Error('foo')
err.cause = 'abc'
const serialized = serializer(err)
assert.strictEqual(serialized.type, 'Error')
assert.strictEqual(serialized.message, 'foo')
assert.strictEqual(serialized.cause, 'abc')
})
test('prevents infinite recursion', () => {
const err = Error('foo')
err.inner = err
const serialized = serializer(err)
assert.strictEqual(serialized.type, 'Error')
assert.strictEqual(serialized.message, 'foo')
assert.match(serialized.stack, /err-with-cause\.test\.js:/)
assert.ok(!serialized.inner)
})
test('cleans up infinite recursion tracking', () => {
const err = Error('foo')
const bar = Error('bar')
err.inner = bar
bar.inner = err
serializer(err)
const serialized = serializer(err)
assert.strictEqual(serialized.type, 'Error')
assert.strictEqual(serialized.message, 'foo')
assert.match(serialized.stack, /err-with-cause\.test\.js:/)
assert.ok(serialized.inner)
assert.strictEqual(serialized.inner.type, 'Error')
assert.strictEqual(serialized.inner.message, 'bar')
assert.match(serialized.inner.stack, /Error: bar/)
assert.ok(!serialized.inner.inner)
})
test('err.raw is available', () => {
const err = Error('foo')
const serialized = serializer(err)
assert.strictEqual(serialized.raw, err)
})
test('redefined err.constructor doesnt crash serializer', () => {
function check (a, name) {
assert.strictEqual(a.type, name)
assert.strictEqual(a.message, 'foo')
}
const err1 = TypeError('foo')
err1.constructor = '10'
const err2 = TypeError('foo')
err2.constructor = undefined
const err3 = Error('foo')
err3.constructor = null
const err4 = Error('foo')
err4.constructor = 10
class MyError extends Error {}
const err5 = new MyError('foo')
err5.constructor = undefined
check(serializer(err1), 'TypeError')
check(serializer(err2), 'TypeError')
check(serializer(err3), 'Error')
check(serializer(err4), 'Error')
// We do not expect 'MyError' because err5.constructor has been blown away.
// `err5.name` is 'Error' from the base class prototype.
check(serializer(err5), 'Error')
})
test('pass through anything that does not look like an Error', () => {
function check (a) {
assert.strictEqual(serializer(a), a)
}
check('foo')
check({ hello: 'world' })
check([1, 2])
})
test('can wrap err serializers', () => {
const err = Error('foo')
err.foo = 'foo'
const serializer = wrapErrorSerializer(function (err) {
delete err.foo
err.bar = 'bar'
return err
})
const serialized = serializer(err)
assert.strictEqual(serialized.type, 'Error')
assert.strictEqual(serialized.message, 'foo')
assert.match(serialized.stack, /err-with-cause\.test\.js:/)
assert.ok(!serialized.foo)
assert.strictEqual(serialized.bar, 'bar')
})
test('serializes aggregate errors', { skip: !global.AggregateError }, () => {
const foo = new Error('foo')
const bar = new Error('bar')
for (const aggregate of [
new AggregateError([foo, bar], 'aggregated message'),
{ errors: [foo, bar], message: 'aggregated message', stack: 'err-with-cause.test.js:' }
]) {
const serialized = serializer(aggregate)
assert.strictEqual(serialized.message, 'aggregated message')
assert.strictEqual(serialized.aggregateErrors.length, 2)
assert.strictEqual(serialized.aggregateErrors[0].message, 'foo')
assert.strictEqual(serialized.aggregateErrors[1].message, 'bar')
assert.match(serialized.aggregateErrors[0].stack, /^Error: foo/)
assert.match(serialized.aggregateErrors[1].stack, /^Error: bar/)
assert.match(serialized.stack, /err-with-cause\.test\.js:/)
}
})

View File

@@ -0,0 +1 @@
{"version":3,"file":"GroupByPageControls.js","names":["c","_c","React","useCallback","useListQuery","PageControlsComponent","GroupByPageControls","t0","$","AfterPageControls","collectionConfig","data","groupByValue","refineListData","t1","page","queryByGroup","handlePageChange","t2","limit","handlePerPageChange","t3","_jsx"],"sources":["../../../src/elements/PageControls/GroupByPageControls.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, PaginatedDocs } from 'payload'\n\nimport React, { useCallback } from 'react'\n\nimport type { IListQueryContext } from '../../providers/ListQuery/types.js'\n\nimport { useListQuery } from '../../providers/ListQuery/context.js'\nimport { PageControlsComponent } from './index.js'\n\n/**\n * If `groupBy` is set in the query, multiple tables will render, one for each group.\n * In this case, each table needs its own `PageControls` to handle pagination.\n * These page controls, however, should not modify the global `ListQuery` state.\n * Instead, they should only handle the pagination for the current group.\n * To do this, build a wrapper around `PageControlsComponent` that handles the pagination logic for the current group.\n */\nexport const GroupByPageControls: React.FC<{\n AfterPageControls?: React.ReactNode\n collectionConfig: ClientCollectionConfig\n data: PaginatedDocs\n groupByValue?: number | string\n}> = ({ AfterPageControls, collectionConfig, data, groupByValue }) => {\n const { refineListData } = useListQuery()\n\n const handlePageChange: IListQueryContext['handlePageChange'] = useCallback(\n async (page) => {\n await refineListData({\n queryByGroup: {\n [groupByValue]: {\n page,\n },\n },\n })\n },\n [refineListData, groupByValue],\n )\n\n const handlePerPageChange: IListQueryContext['handlePerPageChange'] = useCallback(\n async (limit) => {\n await refineListData({\n queryByGroup: {\n [groupByValue]: {\n limit,\n page: 1,\n },\n },\n })\n },\n [refineListData, groupByValue],\n )\n\n return (\n <PageControlsComponent\n AfterPageControls={AfterPageControls}\n collectionConfig={collectionConfig}\n data={data}\n handlePageChange={handlePageChange}\n handlePerPageChange={handlePerPageChange}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,OAAOC,KAAA,IAASC,WAAW,QAAQ;AAInC,SAASC,YAAY,QAAQ;AAC7B,SAASC,qBAAqB,QAAQ;AAEtC;;;;;;;AAOA,OAAO,MAAMC,mBAAA,GAKRC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAC;IAAAQ,iBAAA;IAAAC,gBAAA;IAAAC,IAAA;IAAAC;EAAA,IAAAL,EAA2D;EAC/D;IAAAM;EAAA,IAA2BT,YAAA;EAAA,IAAAU,EAAA;EAAA,IAAAN,CAAA,QAAAI,YAAA,IAAAJ,CAAA,QAAAK,cAAA;IAGzBC,EAAA,SAAAC,IAAA;MAAA,MACQF,cAAA;QAAAG,YAAA;UAAA,CAEDJ,YAAA;YAAAG;UAAA;QAAA;MAAA,CAIL;IAAA;IACFP,CAAA,MAAAI,YAAA;IAAAJ,CAAA,MAAAK,cAAA;IAAAL,CAAA,MAAAM,EAAA;EAAA;IAAAA,EAAA,GAAAN,CAAA;EAAA;EATF,MAAAS,gBAAA,GAAgEH,EAUhC;EAAA,IAAAI,EAAA;EAAA,IAAAV,CAAA,QAAAI,YAAA,IAAAJ,CAAA,QAAAK,cAAA;IAI9BK,EAAA,SAAAC,KAAA;MAAA,MACQN,cAAA;QAAAG,YAAA;UAAA,CAEDJ,YAAA;YAAAO,KAAA;YAAAJ,IAAA;UAAA;QAAA;MAAA,CAKL;IAAA;IACFP,CAAA,MAAAI,YAAA;IAAAJ,CAAA,MAAAK,cAAA;IAAAL,CAAA,MAAAU,EAAA;EAAA;IAAAA,EAAA,GAAAV,CAAA;EAAA;EAVF,MAAAY,mBAAA,GAAsEF,EAWtC;EAAA,IAAAG,EAAA;EAAA,IAAAb,CAAA,QAAAC,iBAAA,IAAAD,CAAA,QAAAE,gBAAA,IAAAF,CAAA,QAAAG,IAAA,IAAAH,CAAA,QAAAS,gBAAA,IAAAT,CAAA,SAAAY,mBAAA;IAI9BC,EAAA,GAAAC,IAAA,CAAAjB,qBAAA;MAAAI,iBAAA;MAAAC,gBAAA;MAAAC,IAAA;MAAAM,gBAAA;MAAAG;IAAA,C;;;;;;;;;;SAAAC,E;CAQJ","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"roles.cjs","names":[],"sources":["../../../../src/rest/commands/create/roles.ts"],"sourcesContent":["import type { DirectusRole } from '../../../schema/role.js';\nimport type { ApplyQueryFields, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\n\nexport type CreateRoleOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusRole<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Create multiple new roles.\n *\n * @param items The roles to create\n * @param query Optional return data query\n *\n * @returns Returns the role objects for the created roles.\n */\nexport const createRoles =\n\t<Schema, const TQuery extends Query<Schema, DirectusRole<Schema>>>(\n\t\titems: NestedPartial<DirectusRole<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<CreateRoleOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/roles`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'POST',\n\t});\n\n/**\n * Create a new role.\n *\n * @param item The role to create\n * @param query Optional return data query\n *\n * @returns Returns the role object for the created role.\n */\nexport const createRole =\n\t<Schema, const TQuery extends Query<Schema, DirectusRole<Schema>>>(\n\t\titem: NestedPartial<DirectusRole<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<CreateRoleOutput<Schema, TQuery>, Schema> =>\n\t() => ({\n\t\tpath: `/roles`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(item),\n\t\tmethod: 'POST',\n\t});\n"],"mappings":"AAkBA,MAAa,GAEX,EACA,SAEM,CACN,KAAM,SACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,OACR,EAUW,GAEX,EACA,SAEM,CACN,KAAM,SACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,OACR"}

View File

@@ -0,0 +1,10 @@
"use strict";
exports.lastDayOfDecade = void 0;
var _index = require("../lastDayOfDecade.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const lastDayOfDecade = (exports.lastDayOfDecade = (0, _index2.convertToFP)(
_index.lastDayOfDecade,
1,
));

View File

@@ -0,0 +1,23 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FolderOutput = createLucideIcon("FolderOutput", [
[
"path",
{
d: "M2 7.5V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-1.5",
key: "1yk7aj"
}
],
["path", { d: "M2 13h10", key: "pgb2dq" }],
["path", { d: "m5 10-3 3 3 3", key: "1r8ie0" }]
]);
export { FolderOutput as default };
//# sourceMappingURL=folder-output.js.map

View File

@@ -0,0 +1,85 @@
"use strict";
exports.LocalWeekYearParser = void 0;
var _index = require("../../../getWeekYear.cjs");
var _index2 = require("../../../startOfWeek.cjs");
var _Parser = require("../Parser.cjs");
var _utils = require("../utils.cjs");
// Local week-numbering year
class LocalWeekYearParser extends _Parser.Parser {
priority = 130;
parse(dateString, token, match) {
const valueCallback = (year) => ({
year,
isTwoDigitYear: token === "YY",
});
switch (token) {
case "Y":
return (0, _utils.mapValue)(
(0, _utils.parseNDigits)(4, dateString),
valueCallback,
);
case "Yo":
return (0, _utils.mapValue)(
match.ordinalNumber(dateString, {
unit: "year",
}),
valueCallback,
);
default:
return (0, _utils.mapValue)(
(0, _utils.parseNDigits)(token.length, dateString),
valueCallback,
);
}
}
validate(_date, value) {
return value.isTwoDigitYear || value.year > 0;
}
set(date, flags, value, options) {
const currentYear = (0, _index.getWeekYear)(date, options);
if (value.isTwoDigitYear) {
const normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)(
value.year,
currentYear,
);
date.setFullYear(
normalizedTwoDigitYear,
0,
options.firstWeekContainsDate,
);
date.setHours(0, 0, 0, 0);
return (0, _index2.startOfWeek)(date, options);
}
const year =
!("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
date.setFullYear(year, 0, options.firstWeekContainsDate);
date.setHours(0, 0, 0, 0);
return (0, _index2.startOfWeek)(date, options);
}
incompatibleTokens = [
"y",
"R",
"u",
"Q",
"q",
"M",
"L",
"I",
"d",
"D",
"i",
"t",
"T",
];
}
exports.LocalWeekYearParser = LocalWeekYearParser;

View File

@@ -0,0 +1,85 @@
import { numericPatterns } from "../constants.js";
import { Parser } from "../Parser.js";
import { mapValue, parseNDigits, parseNumericPattern } from "../utils.js";
export class StandAloneMonthParser extends Parser {
priority = 110;
parse(dateString, token, match) {
const valueCallback = (value) => value - 1;
switch (token) {
// 1, 2, ..., 12
case "L":
return mapValue(
parseNumericPattern(numericPatterns.month, dateString),
valueCallback,
);
// 01, 02, ..., 12
case "LL":
return mapValue(parseNDigits(2, dateString), valueCallback);
// 1st, 2nd, ..., 12th
case "Lo":
return mapValue(
match.ordinalNumber(dateString, {
unit: "month",
}),
valueCallback,
);
// Jan, Feb, ..., Dec
case "LLL":
return (
match.month(dateString, {
width: "abbreviated",
context: "standalone",
}) ||
match.month(dateString, { width: "narrow", context: "standalone" })
);
// J, F, ..., D
case "LLLLL":
return match.month(dateString, {
width: "narrow",
context: "standalone",
});
// January, February, ..., December
case "LLLL":
default:
return (
match.month(dateString, { width: "wide", context: "standalone" }) ||
match.month(dateString, {
width: "abbreviated",
context: "standalone",
}) ||
match.month(dateString, { width: "narrow", context: "standalone" })
);
}
}
validate(_date, value) {
return value >= 0 && value <= 11;
}
set(date, _flags, value) {
date.setMonth(value, 1);
date.setHours(0, 0, 0, 0);
return date;
}
incompatibleTokens = [
"Y",
"R",
"q",
"Q",
"M",
"w",
"I",
"D",
"i",
"e",
"c",
"t",
"T",
];
}

View File

@@ -0,0 +1 @@
export { _ as default } from "../esm/_array_with_holes.js";

View File

@@ -0,0 +1,62 @@
export interface Options {
/* a list of files to search */
files?: string[]
/* the directory to search from */
cwd?: string
/* the directory to stop searching */
stopDir?: string
/* the key in package.json to read data at */
packageKey?: string
/* the function used to parse json */
parseJSON?: (str: string) => any
}
export interface LoadResult {
/* file path */
path?: string
/* file data */
data?: any
}
export interface AsyncLoader {
/** Optional loader name */
name?: string
test: RegExp
load(filepath: string): Promise<any>
}
export interface SyncLoader {
/** Optional loader name */
name?: string
test: RegExp
loadSync(filepath: string): any
}
export interface MultiLoader {
/** Optional loader name */
name?: string
test: RegExp
load(filepath: string): Promise<any>
loadSync(filepath: string): any
}
declare class JoyCon {
constructor(options?: Options)
options: Options
resolve(files?: string[] | Options, cwd?: string, stopDir?: string): Promise<string | null>
resolveSync(files?: string[] | Options, cwd?: string, stopDir?: string): string | null
load(files?: string[] | Options, cwd?: string, stopDir?: string): Promise<LoadResult>
loadSync(files?: string[] | Options, cwd?: string, stopDir?: string): LoadResult
addLoader(loader: AsyncLoader | SyncLoader | MultiLoader): this
removeLoader(name: string): this
/** Clear internal cache */
clearCache(): this
}
export default JoyCon

View File

@@ -0,0 +1,413 @@
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
var util = require('./util');
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
// operating systems these days (capturing the result).
var REGEX_NEWLINE = /(\r?\n)/;
// Newline character code for charCodeAt() comparisons
var NEWLINE_CODE = 10;
// Private symbol for identifying `SourceNode`s when multiple versions of
// the source-map library are loaded. This MUST NOT CHANGE across
// versions!
var isSourceNode = "$$$isSourceNode$$$";
/**
* SourceNodes provide a way to abstract over interpolating/concatenating
* snippets of generated JavaScript source code while maintaining the line and
* column information associated with the original source code.
*
* @param aLine The original line number.
* @param aColumn The original column number.
* @param aSource The original source's filename.
* @param aChunks Optional. An array of strings which are snippets of
* generated JS, or other SourceNodes.
* @param aName The original identifier.
*/
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
this.children = [];
this.sourceContents = {};
this.line = aLine == null ? null : aLine;
this.column = aColumn == null ? null : aColumn;
this.source = aSource == null ? null : aSource;
this.name = aName == null ? null : aName;
this[isSourceNode] = true;
if (aChunks != null) this.add(aChunks);
}
/**
* Creates a SourceNode from generated code and a SourceMapConsumer.
*
* @param aGeneratedCode The generated code
* @param aSourceMapConsumer The SourceMap for the generated code
* @param aRelativePath Optional. The path that relative sources in the
* SourceMapConsumer should be relative to.
*/
SourceNode.fromStringWithSourceMap =
function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
// The SourceNode we want to fill with the generated code
// and the SourceMap
var node = new SourceNode();
// All even indices of this array are one line of the generated code,
// while all odd indices are the newlines between two adjacent lines
// (since `REGEX_NEWLINE` captures its match).
// Processed fragments are accessed by calling `shiftNextLine`.
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
var remainingLinesIndex = 0;
var shiftNextLine = function() {
var lineContents = getNextLine();
// The last line of a file might not have a newline.
var newLine = getNextLine() || "";
return lineContents + newLine;
function getNextLine() {
return remainingLinesIndex < remainingLines.length ?
remainingLines[remainingLinesIndex++] : undefined;
}
};
// We need to remember the position of "remainingLines"
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
// The generate SourceNodes we need a code range.
// To extract it current and last mapping is used.
// Here we store the last mapping.
var lastMapping = null;
aSourceMapConsumer.eachMapping(function (mapping) {
if (lastMapping !== null) {
// We add the code from "lastMapping" to "mapping":
// First check if there is a new line in between.
if (lastGeneratedLine < mapping.generatedLine) {
// Associate first line with "lastMapping"
addMappingWithCode(lastMapping, shiftNextLine());
lastGeneratedLine++;
lastGeneratedColumn = 0;
// The remaining code is added without mapping
} else {
// There is no new line in between.
// Associate the code between "lastGeneratedColumn" and
// "mapping.generatedColumn" with "lastMapping"
var nextLine = remainingLines[remainingLinesIndex];
var code = nextLine.substr(0, mapping.generatedColumn -
lastGeneratedColumn);
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
lastGeneratedColumn);
lastGeneratedColumn = mapping.generatedColumn;
addMappingWithCode(lastMapping, code);
// No more remaining code, continue
lastMapping = mapping;
return;
}
}
// We add the generated code until the first mapping
// to the SourceNode without any mapping.
// Each line is added as separate string.
while (lastGeneratedLine < mapping.generatedLine) {
node.add(shiftNextLine());
lastGeneratedLine++;
}
if (lastGeneratedColumn < mapping.generatedColumn) {
var nextLine = remainingLines[remainingLinesIndex];
node.add(nextLine.substr(0, mapping.generatedColumn));
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
lastGeneratedColumn = mapping.generatedColumn;
}
lastMapping = mapping;
}, this);
// We have processed all mappings.
if (remainingLinesIndex < remainingLines.length) {
if (lastMapping) {
// Associate the remaining code in the current line with "lastMapping"
addMappingWithCode(lastMapping, shiftNextLine());
}
// and add the remaining lines without any mapping
node.add(remainingLines.splice(remainingLinesIndex).join(""));
}
// Copy sourcesContent into SourceNode
aSourceMapConsumer.sources.forEach(function (sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
if (aRelativePath != null) {
sourceFile = util.join(aRelativePath, sourceFile);
}
node.setSourceContent(sourceFile, content);
}
});
return node;
function addMappingWithCode(mapping, code) {
if (mapping === null || mapping.source === undefined) {
node.add(code);
} else {
var source = aRelativePath
? util.join(aRelativePath, mapping.source)
: mapping.source;
node.add(new SourceNode(mapping.originalLine,
mapping.originalColumn,
source,
code,
mapping.name));
}
}
};
/**
* Add a chunk of generated JS to this source node.
*
* @param aChunk A string snippet of generated JS code, another instance of
* SourceNode, or an array where each member is one of those things.
*/
SourceNode.prototype.add = function SourceNode_add(aChunk) {
if (Array.isArray(aChunk)) {
aChunk.forEach(function (chunk) {
this.add(chunk);
}, this);
}
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
if (aChunk) {
this.children.push(aChunk);
}
}
else {
throw new TypeError(
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
);
}
return this;
};
/**
* Add a chunk of generated JS to the beginning of this source node.
*
* @param aChunk A string snippet of generated JS code, another instance of
* SourceNode, or an array where each member is one of those things.
*/
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
if (Array.isArray(aChunk)) {
for (var i = aChunk.length-1; i >= 0; i--) {
this.prepend(aChunk[i]);
}
}
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
this.children.unshift(aChunk);
}
else {
throw new TypeError(
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
);
}
return this;
};
/**
* Walk over the tree of JS snippets in this node and its children. The
* walking function is called once for each snippet of JS and is passed that
* snippet and the its original associated source's line/column location.
*
* @param aFn The traversal function.
*/
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
var chunk;
for (var i = 0, len = this.children.length; i < len; i++) {
chunk = this.children[i];
if (chunk[isSourceNode]) {
chunk.walk(aFn);
}
else {
if (chunk !== '') {
aFn(chunk, { source: this.source,
line: this.line,
column: this.column,
name: this.name });
}
}
}
};
/**
* Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
* each of `this.children`.
*
* @param aSep The separator.
*/
SourceNode.prototype.join = function SourceNode_join(aSep) {
var newChildren;
var i;
var len = this.children.length;
if (len > 0) {
newChildren = [];
for (i = 0; i < len-1; i++) {
newChildren.push(this.children[i]);
newChildren.push(aSep);
}
newChildren.push(this.children[i]);
this.children = newChildren;
}
return this;
};
/**
* Call String.prototype.replace on the very right-most source snippet. Useful
* for trimming whitespace from the end of a source node, etc.
*
* @param aPattern The pattern to replace.
* @param aReplacement The thing to replace the pattern with.
*/
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
var lastChild = this.children[this.children.length - 1];
if (lastChild[isSourceNode]) {
lastChild.replaceRight(aPattern, aReplacement);
}
else if (typeof lastChild === 'string') {
this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
}
else {
this.children.push(''.replace(aPattern, aReplacement));
}
return this;
};
/**
* Set the source content for a source file. This will be added to the SourceMapGenerator
* in the sourcesContent field.
*
* @param aSourceFile The filename of the source file
* @param aSourceContent The content of the source file
*/
SourceNode.prototype.setSourceContent =
function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
};
/**
* Walk over the tree of SourceNodes. The walking function is called for each
* source file content and is passed the filename and source content.
*
* @param aFn The traversal function.
*/
SourceNode.prototype.walkSourceContents =
function SourceNode_walkSourceContents(aFn) {
for (var i = 0, len = this.children.length; i < len; i++) {
if (this.children[i][isSourceNode]) {
this.children[i].walkSourceContents(aFn);
}
}
var sources = Object.keys(this.sourceContents);
for (var i = 0, len = sources.length; i < len; i++) {
aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
}
};
/**
* Return the string representation of this source node. Walks over the tree
* and concatenates all the various snippets together to one string.
*/
SourceNode.prototype.toString = function SourceNode_toString() {
var str = "";
this.walk(function (chunk) {
str += chunk;
});
return str;
};
/**
* Returns the string representation of this source node along with a source
* map.
*/
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
var generated = {
code: "",
line: 1,
column: 0
};
var map = new SourceMapGenerator(aArgs);
var sourceMappingActive = false;
var lastOriginalSource = null;
var lastOriginalLine = null;
var lastOriginalColumn = null;
var lastOriginalName = null;
this.walk(function (chunk, original) {
generated.code += chunk;
if (original.source !== null
&& original.line !== null
&& original.column !== null) {
if(lastOriginalSource !== original.source
|| lastOriginalLine !== original.line
|| lastOriginalColumn !== original.column
|| lastOriginalName !== original.name) {
map.addMapping({
source: original.source,
original: {
line: original.line,
column: original.column
},
generated: {
line: generated.line,
column: generated.column
},
name: original.name
});
}
lastOriginalSource = original.source;
lastOriginalLine = original.line;
lastOriginalColumn = original.column;
lastOriginalName = original.name;
sourceMappingActive = true;
} else if (sourceMappingActive) {
map.addMapping({
generated: {
line: generated.line,
column: generated.column
}
});
lastOriginalSource = null;
sourceMappingActive = false;
}
for (var idx = 0, length = chunk.length; idx < length; idx++) {
if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
generated.line++;
generated.column = 0;
// Mappings end at eol
if (idx + 1 === length) {
lastOriginalSource = null;
sourceMappingActive = false;
} else if (sourceMappingActive) {
map.addMapping({
source: original.source,
original: {
line: original.line,
column: original.column
},
generated: {
line: generated.line,
column: generated.column
},
name: original.name
});
}
} else {
generated.column++;
}
}
});
this.walkSourceContents(function (sourceFile, sourceContent) {
map.setSourceContent(sourceFile, sourceContent);
});
return { code: generated.code, map: map };
};
exports.SourceNode = SourceNode;

View File

@@ -0,0 +1 @@
{"version":3,"file":"ref_error.js","sourceRoot":"","sources":["../../lib/compile/ref_error.ts"],"names":[],"mappings":";;AAAA,uCAA8D;AAG9D,MAAqB,eAAgB,SAAQ,KAAK;IAIhD,YAAY,QAAqB,EAAE,MAAc,EAAE,GAAW,EAAE,GAAY;QAC1E,KAAK,CAAC,GAAG,IAAI,2BAA2B,GAAG,YAAY,MAAM,EAAE,CAAC,CAAA;QAChE,IAAI,CAAC,UAAU,GAAG,IAAA,oBAAU,EAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QACnD,IAAI,CAAC,aAAa,GAAG,IAAA,qBAAW,EAAC,IAAA,qBAAW,EAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;IAC1E,CAAC;CACF;AATD,kCASC"}

View File

@@ -0,0 +1,29 @@
import { formatRelative } from "./en-US/_lib/formatRelative.mjs";
import { localize } from "./en-US/_lib/localize.mjs";
import { match } from "./en-US/_lib/match.mjs";
import { formatDistance } from "./en-CA/_lib/formatDistance.mjs";
import { formatLong } from "./en-CA/_lib/formatLong.mjs";
/**
* @category Locales
* @summary English locale (Canada).
* @language English
* @iso-639-2 eng
* @author Mark Owsiak [@markowsiak](https://github.com/markowsiak)
* @author Marco Imperatore [@mimperatore](https://github.com/mimperatore)
*/
export const enCA = {
code: "en-CA",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 0 /* Sunday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default enCA;

View File

@@ -0,0 +1,37 @@
"use strict";
exports.Hour1To24Parser = void 0;
var _constants = require("../constants.js");
var _Parser = require("../Parser.js");
var _utils = require("../utils.js");
class Hour1To24Parser extends _Parser.Parser {
priority = 70;
parse(dateString, token, match) {
switch (token) {
case "k":
return (0, _utils.parseNumericPattern)(
_constants.numericPatterns.hour24h,
dateString,
);
case "ko":
return match.ordinalNumber(dateString, { unit: "hour" });
default:
return (0, _utils.parseNDigits)(token.length, dateString);
}
}
validate(_date, value) {
return value >= 1 && value <= 24;
}
set(date, _flags, value) {
const hours = value <= 24 ? value % 24 : value;
date.setHours(hours, 0, 0, 0);
return date;
}
incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
}
exports.Hour1To24Parser = Hour1To24Parser;

View File

@@ -0,0 +1,49 @@
import type { HTTPQueryOptions, HTTPTransactionOptions, NeonQueryFunction } from '@neondatabase/serverless';
import type { BatchItem, BatchResponse } from "../batch.js";
import type { Cache } from "../cache/core/cache.js";
import { entityKind } from "../entity.js";
import type { Logger } from "../logger.js";
import { PgDatabase } from "../pg-core/db.js";
import { PgDialect } from "../pg-core/dialect.js";
import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js";
import { type DrizzleConfig } from "../utils.js";
import { type NeonHttpClient, type NeonHttpQueryResultHKT, NeonHttpSession } from "./session.js";
export interface NeonDriverOptions {
logger?: Logger;
cache?: Cache;
}
export declare class NeonHttpDriver {
private client;
private dialect;
private options;
static readonly [entityKind]: string;
constructor(client: NeonHttpClient, dialect: PgDialect, options?: NeonDriverOptions);
createSession(schema: RelationalSchemaConfig<TablesRelationalConfig> | undefined): NeonHttpSession<Record<string, unknown>, TablesRelationalConfig>;
initMappers(): void;
}
export declare class NeonHttpDatabase<TSchema extends Record<string, unknown> = Record<string, never>> extends PgDatabase<NeonHttpQueryResultHKT, TSchema> {
static readonly [entityKind]: string;
$withAuth(token: Exclude<HTTPQueryOptions<true, true>['authToken'], undefined>): Omit<this, Exclude<keyof this, '$count' | 'delete' | 'select' | 'selectDistinct' | 'selectDistinctOn' | 'update' | 'insert' | 'with' | 'query' | 'execute' | 'refreshMaterializedView'>>;
batch<U extends BatchItem<'pg'>, T extends Readonly<[U, ...U[]]>>(batch: T): Promise<BatchResponse<T>>;
}
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>, TClient extends NeonQueryFunction<any, any> = NeonQueryFunction<false, false>>(...params: [
TClient | string
] | [
TClient | string,
DrizzleConfig<TSchema>
] | [
(DrizzleConfig<TSchema> & ({
connection: string | ({
connectionString: string;
} & HTTPTransactionOptions<boolean, boolean>);
} | {
client: TClient;
}))
]): NeonHttpDatabase<TSchema> & {
$client: TClient;
};
export declare namespace drizzle {
function mock<TSchema extends Record<string, unknown> = Record<string, never>>(config?: DrizzleConfig<TSchema>): NeonHttpDatabase<TSchema> & {
$client: '$client is not available on drizzle.mock()';
};
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"spell-check-2.js","sources":["../../../src/icons/spell-check-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SpellCheck2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNiAxNiA2LTEyIDYgMTIiIC8+CiAgPHBhdGggZD0iTTggMTJoOCIgLz4KICA8cGF0aCBkPSJNNCAyMWMxLjEgMCAxLjEtMSAyLjMtMXMxLjEgMSAyLjMgMWMxLjEgMCAxLjEtMSAyLjMtMSAxLjEgMCAxLjEgMSAyLjMgMSAxLjEgMCAxLjEtMSAyLjMtMSAxLjEgMCAxLjEgMSAyLjMgMSAxLjEgMCAxLjEtMSAyLjMtMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/spell-check-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst SpellCheck2 = createLucideIcon('SpellCheck2', [\n ['path', { d: 'm6 16 6-12 6 12', key: '1b4byz' }],\n ['path', { d: 'M8 12h8', key: '1wcyev' }],\n [\n 'path',\n {\n d: 'M4 21c1.1 0 1.1-1 2.3-1s1.1 1 2.3 1c1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1 1.1 0 1.1 1 2.3 1 1.1 0 1.1-1 2.3-1',\n key: '8mdmtu',\n },\n ],\n]);\n\nexport default SpellCheck2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A zC","132":"B"},B:{"1":"0 1 2 3 4 5 6 7 8 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","16":"C"},C:{"1":"0 1 2 3 4 5 6 7 8 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 WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 N O P cB AB BB CB DB EB FB GB HB IB 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 WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC 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 JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","16":"J bB K D E F A B C L M G"},E:{"1":"bB K D E F A B C L M G 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J 6C bC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P cB AB BB CB DB EB FB GB HB IB 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 MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C JD KD LD MD PC xC ND QC"},G:{"1":"E OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"bC"},H:{"2":"mD"},I:{"1":"VC J I pD qD yC rD sD","16":"nD oD"},J:{"1":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:1,C:"Link type \"noreferrer\"",D:true};

View File

@@ -0,0 +1,29 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://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 CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.SDK_INFO = void 0;
const version_1 = require("../../version");
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
const semconv_1 = require("../../semconv");
/** Constants describing the SDK in use */
exports.SDK_INFO = {
[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: 'opentelemetry',
[semconv_1.ATTR_PROCESS_RUNTIME_NAME]: 'browser',
[semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,
[semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION,
};
//# sourceMappingURL=sdk-info.js.map

View File

@@ -0,0 +1,194 @@
@import '../../scss/styles.scss';
@layer payload-default {
.app-header {
position: relative;
width: 100%;
height: var(--app-header-height);
z-index: var(--z-modal);
&__mobile-nav-toggler {
display: none;
}
&__localizer.localizer {
position: absolute;
top: 50%;
right: base(4.5);
transform: translate3d(0, -50%, 0);
}
// place the localizer outside the `overflow: hidden` container so that the popup is visible
// this means we need to use a placeholder div so that the space is retained in the DOM
[dir='rtl'] &__localizer {
right: unset;
left: base(4.5);
}
&__localizer-spacing {
visibility: hidden;
}
&__bg {
opacity: 0;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
&--show-bg {
opacity: 1;
}
&__content {
display: flex;
align-items: center;
height: 100%;
padding: 0 var(--gutter-h);
position: relative;
flex-grow: 1;
}
&__wrapper {
display: flex;
gap: calc(var(--base) / 2);
align-items: center;
height: 100%;
flex-grow: 1;
justify-content: space-between;
width: 100%;
}
&__account {
position: relative;
flex-shrink: 0;
&:focus:not(:focus-visible) {
opacity: 1;
}
// Use a pseudo element for the accessability so that it doesn't take up DOM space
// Also because the parent element has `overflow: hidden` which would clip an outline
&:focus-visible {
outline: none;
&::after {
content: '';
border: var(--accessibility-outline);
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
pointer-events: none;
}
}
}
&__controls-wrapper {
display: flex;
align-items: center;
flex: 1;
min-width: 0;
}
&__step-nav-wrapper {
flex-grow: 0;
display: flex;
width: 100%;
&::-webkit-scrollbar {
display: none;
}
}
&__actions-wrapper {
position: relative;
display: flex;
align-items: center;
gap: calc(var(--base) / 2);
margin-right: var(--base);
}
&__gradient-placeholder {
position: absolute;
top: 0;
right: 0;
width: var(--base);
height: var(--base);
background: linear-gradient(to right, transparent, var(--theme-bg));
}
&__actions {
display: flex;
align-items: center;
gap: calc(var(--base) / 2);
flex-shrink: 0;
max-width: 600px;
white-space: nowrap;
&::-webkit-scrollbar {
display: none;
}
}
&__last-action {
margin-right: var(--base);
}
@include large-break {
&__actions {
max-width: 500px;
}
}
@include mid-break {
&__gradient-placeholder {
right: var(--base);
}
&__actions {
max-width: 300px;
margin-right: var(--base);
}
}
@include small-break {
&__localizer.localizer {
right: base(2);
}
&--nav-open {
.app-header__localizer {
display: none;
}
}
&__mobile-nav-toggler {
display: flex;
align-items: center;
&.nav-toggler--is-open {
opacity: 0.5;
}
}
&__step-header {
// TODO: overflow the step header instead of hide it
display: none;
}
&__gradient-placeholder {
right: 0;
}
&__actions {
max-width: 150px;
margin-right: 0;
}
}
}
}

View File

@@ -0,0 +1,103 @@
/// <reference types="node" />
import type { Http2ServerRequest, Http2ServerResponse } from 'http2';
import { HandlerOptions as RawHandlerOptions, OperationContext } from '../handler.mjs';
import { RequestParams } from '../common.mjs';
/**
* The context in the request for the handler.
*
* @category Server/http2
*/
export interface RequestContext {
res: Http2ServerResponse;
}
/**
* The GraphQL over HTTP spec compliant request parser for an incoming GraphQL request.
*
* If the HTTP request _is not_ a [well-formatted GraphQL over HTTP request](https://graphql.github.io/graphql-over-http/draft/#sec-Request), the function will respond
* on the `Http2ServerResponse` argument and return `null`.
*
* If the HTTP request _is_ a [well-formatted GraphQL over HTTP request](https://graphql.github.io/graphql-over-http/draft/#sec-Request), but is invalid or malformed,
* the function will throw an error and it is up to the user to handle and respond as they see fit.
*
* ```shell
* $ openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \
* -keyout localhost-privkey.pem -out localhost-cert.pem
* ```
*
* ```js
* import fs from 'fs';
* import http2 from 'http2';
* import { parseRequestParams } from 'graphql-http/lib/use/http2';
*
* const server = http2.createSecureServer(
* {
* key: fs.readFileSync('localhost-privkey.pem'),
* cert: fs.readFileSync('localhost-cert.pem'),
* },
* async (req, res) => {
* if (req.url.startsWith('/graphql')) {
* try {
* const maybeParams = await parseRequestParams(req, res);
* if (!maybeParams) {
* // not a well-formatted GraphQL over HTTP request,
* // parser responded and there's nothing else to do
* return;
* }
*
* // well-formatted GraphQL over HTTP request,
* // with valid parameters
* res.writeHead(200).end(JSON.stringify(maybeParams, null, ' '));
* } catch (err) {
* // well-formatted GraphQL over HTTP request,
* // but with invalid parameters
* res.writeHead(400).end(err.message);
* }
* } else {
* res.writeHead(404).end();
* }
* },
* );
*
* server.listen(4000);
* console.log('Listening to port 4000');
* ```
*
* @category Server/http2
*/
export declare function parseRequestParams(req: Http2ServerRequest, res: Http2ServerResponse): Promise<RequestParams | null>;
/**
* Handler options when using the http adapter.
*
* @category Server/http2
*/
export type HandlerOptions<Context extends OperationContext = undefined> = RawHandlerOptions<Http2ServerRequest, RequestContext, Context>;
/**
* Create a GraphQL over HTTP spec compliant request handler for
* the Node environment http2 module.
*
* ```shell
* $ openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \
* -keyout localhost-privkey.pem -out localhost-cert.pem
* ```
*
* ```js
* import fs from 'fs';
* import http2 from 'http2';
* import { createHandler } from 'graphql-http/lib/use/http2';
* import { schema } from './my-graphql-schema/index.mjs';
*
* const server = http2.createSecureServer(
* {
* key: fs.readFileSync('localhost-privkey.pem'),
* cert: fs.readFileSync('localhost-cert.pem'),
* },
* createHandler({ schema }),
* );
*
* server.listen(4000);
* console.log('Listening to port 4000');
* ```
*
* @category Server/http2
*/
export declare function createHandler<Context extends OperationContext = undefined>(options: HandlerOptions<Context>): (req: Http2ServerRequest, res: Http2ServerResponse) => Promise<void>;

View File

@@ -0,0 +1,2 @@
const e={fetch:globalThis.fetch,WebSocket:globalThis.WebSocket,URL:globalThis.URL,logger:globalThis.console},t=(t,n={})=>{let r=n.globals?{...e,...n.globals}:e;return{globals:r,url:new r.URL(t),with(e){return{...this,...e(this)}}}};export{t as createDirectus};
//# sourceMappingURL=client.js.map

Some files were not shown because too many files have changed in this diff Show More