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,57 @@
import { useMemo } from 'react';
import { isForcedMotionValue } from '../../motion/utils/is-forced-motion-value.mjs';
import { isMotionValue } from '../../value/utils/is-motion-value.mjs';
import { buildHTMLStyles } from './utils/build-styles.mjs';
import { createHtmlRenderState } from './utils/create-render-state.mjs';
function copyRawValuesOnly(target, source, props) {
for (const key in source) {
if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {
target[key] = source[key];
}
}
}
function useInitialMotionValues({ transformTemplate }, visualState) {
return useMemo(() => {
const state = createHtmlRenderState();
buildHTMLStyles(state, visualState, transformTemplate);
return Object.assign({}, state.vars, state.style);
}, [visualState]);
}
function useStyle(props, visualState) {
const styleProp = props.style || {};
const style = {};
/**
* Copy non-Motion Values straight into style
*/
copyRawValuesOnly(style, styleProp, props);
Object.assign(style, useInitialMotionValues(props, visualState));
return style;
}
function useHTMLProps(props, visualState) {
// The `any` isn't ideal but it is the type of createElement props argument
const htmlProps = {};
const style = useStyle(props, visualState);
if (props.drag && props.dragListener !== false) {
// Disable the ghost element when a user drags
htmlProps.draggable = false;
// Disable text selection
style.userSelect =
style.WebkitUserSelect =
style.WebkitTouchCallout =
"none";
// Disable scrolling on the draggable direction
style.touchAction =
props.drag === true
? "none"
: `pan-${props.drag === "x" ? "y" : "x"}`;
}
if (props.tabIndex === undefined &&
(props.onTap || props.onTapStart || props.whileTap)) {
htmlProps.tabIndex = 0;
}
htmlProps.style = style;
return htmlProps;
}
export { copyRawValuesOnly, useHTMLProps };

View File

@@ -0,0 +1,58 @@
import { GraphQLScalarType, Kind } from 'graphql';
import { createGraphQLError } from '../error.js';
const LOCAL_DATE_TIME_REGEX = /^((?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[\+-]\d{2}:\d{2})?)$/;
function validateLocalDateTime(value, ast) {
if (typeof value !== 'string') {
throw createGraphQLError(`Value is not string: ${value}`, ast
? {
nodes: [ast],
}
: undefined);
}
if (!LOCAL_DATE_TIME_REGEX.test(value.toUpperCase())) {
throw createGraphQLError(`LocalDateTime cannot represent an invalid local date-time-string ${value}.`, ast
? {
nodes: [ast],
}
: undefined);
}
const valueAsDate = new Date(value);
const isValidDate = !isNaN(valueAsDate.getTime());
if (!isValidDate) {
throw createGraphQLError(`Value is not a valid LocalDateTime: ${value}`, ast
? {
nodes: [ast],
}
: undefined);
}
return value;
}
export const LocalDateTimeConfig = /*#__PURE__*/ {
name: 'LocalDateTime',
description: 'A local date-time string (i.e., with no associated timezone) in `YYYY-MM-DDTHH:mm:ss` format, e.g. `2020-01-01T00:00:00`.',
serialize(value) {
return validateLocalDateTime(value);
},
parseValue(value) {
return validateLocalDateTime(value);
},
parseLiteral(ast) {
if (ast.kind !== Kind.STRING) {
throw createGraphQLError(`Can only validate strings as local date-times but got a: ${ast.kind}`, {
nodes: [ast],
});
}
return validateLocalDateTime(ast.value, ast);
},
extensions: {
codegenScalarType:
// eslint-disable-next-line no-template-curly-in-string
'`${number}${number}${number}${number}-${number}${number}-${number}${number}T${number}${number}:${number}${number}:${number}${number}`',
jsonSchema: {
title: 'LocalDateTime',
type: 'string',
format: 'date-time',
},
},
};
export const GraphQLLocalDateTime = /*#__PURE__*/ new GraphQLScalarType(LocalDateTimeConfig);

View File

@@ -0,0 +1,56 @@
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
// src/link.tsx
import * as React from "react";
import { jsx } from "react/jsx-runtime";
var Link = React.forwardRef(
(_a, ref) => {
var _b = _a, { target = "_blank", style } = _b, props = __objRest(_b, ["target", "style"]);
return /* @__PURE__ */ jsx(
"a",
__spreadProps(__spreadValues({}, props), {
ref,
style: __spreadValues({
color: "#067df7",
textDecorationLine: "none"
}, style),
target,
children: props.children
})
);
}
);
Link.displayName = "Link";
export {
Link
};

View File

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

View File

@@ -0,0 +1 @@
Prism.languages.applescript={comment:[/\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/,/--.+/,/#.+/],string:/"(?:\\.|[^"\\\r\n])*"/,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?\b/i,operator:[/[&=≠≤≥*+\-\/÷^]|[<>]=?/,/\b(?:(?:begin|end|start)s? with|(?:contains?|(?:does not|doesn't) contain)|(?:is|isn't|is not) (?:contained by|in)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:comes|(?:does not|doesn't) come) (?:after|before)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equal to|equals|is not|isn't)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|as|div|mod|not|or))\b/],keyword:/\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,"class-name":/\b(?:POSIX file|RGB color|alias|application|boolean|centimeters|centimetres|class|constant|cubic centimeters|cubic centimetres|cubic feet|cubic inches|cubic meters|cubic metres|cubic yards|date|degrees Celsius|degrees Fahrenheit|degrees Kelvin|feet|file|gallons|grams|inches|integer|kilograms|kilometers|kilometres|list|liters|litres|meters|metres|miles|number|ounces|pounds|quarts|real|record|reference|script|square feet|square kilometers|square kilometres|square meters|square metres|square miles|square yards|text|yards)\b/,punctuation:/[{}():,¬«»《》]/};

View File

@@ -0,0 +1,22 @@
/**
* 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 { $getEndOfCodeInLine, $getFirstCodeNodeOfLine, $getLastCodeNodeOfLine, $getStartOfCodeInLine } from './FlatStructureUtils';
export { PrismTokenizer, registerCodeHighlighting } from './CodeHighlighterPrism';
export { $createCodeHighlightNode, $isCodeHighlightNode, CodeHighlightNode, } from './CodeHighlightNode';
export type { SerializedCodeNode } from './CodeNode';
export { $createCodeNode, $isCodeNode, CodeNode, DEFAULT_CODE_LANGUAGE, getDefaultCodeLanguage, } from './CodeNode';
export { CODE_LANGUAGE_FRIENDLY_NAME_MAP, CODE_LANGUAGE_MAP, getCodeLanguageOptions, getCodeLanguages, getCodeThemeOptions, getLanguageFriendlyName, normalizeCodeLang, normalizeCodeLang as normalizeCodeLanguage, } from './FacadePrism';
export { $getEndOfCodeInLine, $getFirstCodeNodeOfLine, $getLastCodeNodeOfLine, $getStartOfCodeInLine, } from './FlatStructureUtils';
/** @deprecated renamed to {@link $getFirstCodeNodeOfLine} by @lexical/eslint-plugin rules-of-lexical */
export declare const getFirstCodeNodeOfLine: typeof $getFirstCodeNodeOfLine;
/** @deprecated renamed to {@link $getLastCodeNodeOfLine} by @lexical/eslint-plugin rules-of-lexical */
export declare const getLastCodeNodeOfLine: typeof $getLastCodeNodeOfLine;
/** @deprecated renamed to {@link $getEndOfCodeInLine} by @lexical/eslint-plugin rules-of-lexical */
export declare const getEndOfCodeInLine: typeof $getEndOfCodeInLine;
/** @deprecated renamed to {@link $getStartOfCodeInLine} by @lexical/eslint-plugin rules-of-lexical */
export declare const getStartOfCodeInLine: typeof $getStartOfCodeInLine;

View File

@@ -0,0 +1,13 @@
import toPropertyKey from "./toPropertyKey.js";
function _defineProperties(e, r) {
for (var t = 0; t < r.length; t++) {
var o = r[t];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
}
}
function _createClass(e, r, t) {
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
writable: !1
}), e;
}
export { _createClass as default };

View File

@@ -0,0 +1,24 @@
import { buildVersionGlobalFields } from 'payload';
import toSnakeCase from 'to-snake-case';
import { findMany } from './find/findMany.js';
export const findGlobalVersions = async function findGlobalVersions({ global, limit, locale, page, pagination, req, select, sort: sortArg, where }) {
const globalConfig = this.payload.globals.config.find(({ slug })=>slug === global);
const sort = sortArg !== undefined && sortArg !== null ? sortArg : '-createdAt';
const tableName = this.tableNameMap.get(`_${toSnakeCase(globalConfig.slug)}${this.versionsSuffix}`);
const fields = buildVersionGlobalFields(this.payload.config, globalConfig, true);
return findMany({
adapter: this,
fields,
limit,
locale,
page,
pagination,
req,
select,
sort,
tableName,
where
});
};
//# sourceMappingURL=findGlobalVersions.js.map

View File

@@ -0,0 +1,155 @@
/**
* @license React
* scheduler-unstable_post_task.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
function runTask(priorityLevel, postTaskPriority, node, callback) {
deadline = getCurrentTime() + 5;
try {
currentPriorityLevel_DEPRECATED = priorityLevel;
var result = callback(!1);
if ("function" === typeof result) {
var continuationOptions = { signal: node._controller.signal },
nextTask = runTask.bind(
null,
priorityLevel,
postTaskPriority,
node,
result
);
void 0 !== scheduler.yield
? scheduler
.yield(continuationOptions)
.then(nextTask)
.catch(handleAbortError)
: scheduler
.postTask(nextTask, continuationOptions)
.catch(handleAbortError);
}
} catch (error) {
setTimeout(function () {
throw error;
});
} finally {
currentPriorityLevel_DEPRECATED = 3;
}
}
function handleAbortError() {}
var perf = window.performance,
setTimeout = window.setTimeout,
scheduler = global.scheduler,
getCurrentTime = perf.now.bind(perf),
deadline = 0,
currentPriorityLevel_DEPRECATED = 3;
exports.unstable_IdlePriority = 5;
exports.unstable_ImmediatePriority = 1;
exports.unstable_LowPriority = 4;
exports.unstable_NormalPriority = 3;
exports.unstable_Profiling = null;
exports.unstable_UserBlockingPriority = 2;
exports.unstable_cancelCallback = function (node) {
node._controller.abort();
};
exports.unstable_continueExecution = function () {};
exports.unstable_forceFrameRate = function () {};
exports.unstable_getCurrentPriorityLevel = function () {
return currentPriorityLevel_DEPRECATED;
};
exports.unstable_getFirstCallbackNode = function () {
return null;
};
exports.unstable_next = function (callback) {
switch (currentPriorityLevel_DEPRECATED) {
case 1:
case 2:
case 3:
var priorityLevel = 3;
break;
default:
priorityLevel = currentPriorityLevel_DEPRECATED;
}
var previousPriorityLevel = currentPriorityLevel_DEPRECATED;
currentPriorityLevel_DEPRECATED = priorityLevel;
try {
return callback();
} finally {
currentPriorityLevel_DEPRECATED = previousPriorityLevel;
}
};
exports.unstable_now = getCurrentTime;
exports.unstable_pauseExecution = function () {};
exports.unstable_requestPaint = function () {};
exports.unstable_runWithPriority = function (priorityLevel, callback) {
var previousPriorityLevel = currentPriorityLevel_DEPRECATED;
currentPriorityLevel_DEPRECATED = priorityLevel;
try {
return callback();
} finally {
currentPriorityLevel_DEPRECATED = previousPriorityLevel;
}
};
exports.unstable_scheduleCallback = function (
priorityLevel,
callback,
options
) {
switch (priorityLevel) {
case 1:
case 2:
var postTaskPriority = "user-blocking";
break;
case 4:
case 3:
postTaskPriority = "user-visible";
break;
case 5:
postTaskPriority = "background";
break;
default:
postTaskPriority = "user-visible";
}
var controller = new TaskController({ priority: postTaskPriority });
options = {
delay:
"object" === typeof options && null !== options ? options.delay : 0,
signal: controller.signal
};
controller = { _controller: controller };
scheduler
.postTask(
runTask.bind(
null,
priorityLevel,
postTaskPriority,
controller,
callback
),
options
)
.catch(handleAbortError);
return controller;
};
exports.unstable_shouldYield = function () {
return getCurrentTime() >= deadline;
};
exports.unstable_wrapCallback = function (callback) {
var parentPriorityLevel = currentPriorityLevel_DEPRECATED;
return function () {
var previousPriorityLevel = currentPriorityLevel_DEPRECATED;
currentPriorityLevel_DEPRECATED = parentPriorityLevel;
try {
return callback();
} finally {
currentPriorityLevel_DEPRECATED = previousPriorityLevel;
}
};
};
})();

View File

@@ -0,0 +1,189 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
wide: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
};
const dayValues = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
// If ordinal numbers depend on context, for example,
// if they are different for different grammatical genders,
// use `options.unit`.
//
// `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
// 'day', 'hour', 'minute', 'second'.
const rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "st";
case 2:
return number + "nd";
case 3:
return number + "rd";
}
}
return number + "th";
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/elements/BulkUpload/EditForm/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE3D,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAC7B,GAAG,IAAI,CAAC,cAAc,EAAE,kBAAkB,GAAG,mBAAmB,GAAG,aAAa,CAAC,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"addOriginToSpan.js","sources":["../../../src/utils/addOriginToSpan.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { SpanOrigin } from '@sentry/core';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\n\n/** Adds an origin to an OTEL Span. */\nexport function addOriginToSpan(span: Span, origin: SpanOrigin): void {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, origin);\n}\n"],"names":[],"mappings":";;AAIA;AACO,SAAS,eAAe,CAAC,IAAI,EAAQ,MAAM,EAAoB;AACtE,EAAE,IAAI,CAAC,YAAY,CAAC,gCAAgC,EAAE,MAAM,CAAC;AAC7D;;;;"}

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1 @@
{"version":3,"file":"captureRequestError.js","sources":["../../../src/common/captureRequestError.ts"],"sourcesContent":["import type { RequestEventData } from '@sentry/core';\nimport { captureException, headersToDict, withScope } from '@sentry/core';\nimport { flushSafelyWithTimeout, waitUntil } from './utils/responseEnd';\n\ntype RequestInfo = {\n path: string;\n method: string;\n headers: Record<string, string | string[] | undefined>;\n};\n\ntype ErrorContext = {\n routerKind: string; // 'Pages Router' | 'App Router'\n routePath: string;\n routeType: string; // 'render' | 'route' | 'middleware'\n};\n\n/**\n * Reports errors passed to the the Next.js `onRequestError` instrumentation hook.\n */\nexport function captureRequestError(error: unknown, request: RequestInfo, errorContext: ErrorContext): void {\n withScope(scope => {\n scope.setSDKProcessingMetadata({\n normalizedRequest: {\n headers: headersToDict(request.headers),\n method: request.method,\n } satisfies RequestEventData,\n });\n\n scope.setContext('nextjs', {\n request_path: request.path,\n router_kind: errorContext.routerKind,\n router_path: errorContext.routePath,\n route_type: errorContext.routeType,\n });\n\n scope.setTransactionName(errorContext.routePath);\n\n captureException(error, {\n mechanism: {\n handled: false,\n type: 'auto.function.nextjs.on_request_error',\n },\n });\n\n waitUntil(flushSafelyWithTimeout());\n });\n}\n"],"names":[],"mappings":";;;AAgBA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,KAAK,EAAW,OAAO,EAAe,YAAY,EAAsB;AAC5G,EAAE,SAAS,CAAC,KAAA,IAAS;AACrB,IAAI,KAAK,CAAC,wBAAwB,CAAC;AACnC,MAAM,iBAAiB,EAAE;AACzB,QAAQ,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC;AAC/C,QAAQ,MAAM,EAAE,OAAO,CAAC,MAAM;AAC9B,OAAM;AACN,KAAK,CAAC;;AAEN,IAAI,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE;AAC/B,MAAM,YAAY,EAAE,OAAO,CAAC,IAAI;AAChC,MAAM,WAAW,EAAE,YAAY,CAAC,UAAU;AAC1C,MAAM,WAAW,EAAE,YAAY,CAAC,SAAS;AACzC,MAAM,UAAU,EAAE,YAAY,CAAC,SAAS;AACxC,KAAK,CAAC;;AAEN,IAAI,KAAK,CAAC,kBAAkB,CAAC,YAAY,CAAC,SAAS,CAAC;;AAEpD,IAAI,gBAAgB,CAAC,KAAK,EAAE;AAC5B,MAAM,SAAS,EAAE;AACjB,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,IAAI,EAAE,uCAAuC;AACrD,OAAO;AACP,KAAK,CAAC;;AAEN,IAAI,SAAS,CAAC,sBAAsB,EAAE,CAAC;AACvC,EAAE,CAAC,CAAC;AACJ;;;;"}

View File

@@ -0,0 +1,34 @@
/*
* This module exists for optimizations in the build process through rollup and terser. We define some global
* constants, which can be overridden during build. By guarding certain pieces of code with functions that return these
* constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will
* never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to
* `debug` and preventing node-related code from appearing in browser bundles.
*
* Attention:
* This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by
* users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)
* having issues tree-shaking these constants across package boundaries.
* An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want
* users to be able to shake away expressions that it guards.
*/
/**
* Figures out if we're building a browser bundle.
*
* @returns true if this is a browser bundle build.
*/
function isBrowserBundle() {
return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;
}
/**
* Get source of SDK.
*/
function getSDKSource() {
// This comment is used to identify this line in the CDN bundle build step and replace this with "return 'cdn';"
/* __SENTRY_SDK_SOURCE__ */ return 'npm';
}
export { getSDKSource, isBrowserBundle };
//# sourceMappingURL=env.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/utils/version.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,QAA0F,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/resolvers/collections/count.ts"],"sourcesContent":["import type { Collection, PayloadRequest, Where } from 'payload'\n\nimport { countOperation, isolateObjectProperty } from 'payload'\n\nimport type { Context } from '../types.js'\n\nexport type Resolver = (\n _: unknown,\n args: {\n data: Record<string, unknown>\n locale?: string\n trash?: boolean\n where?: Where\n },\n context: {\n req: PayloadRequest\n },\n) => Promise<{ totalDocs: number }>\n\nexport function countResolver(collection: Collection): Resolver {\n return async function resolver(_, args, context: Context) {\n let { req } = context\n const locale = req.locale\n const fallbackLocale = req.fallbackLocale\n req = isolateObjectProperty(req, 'locale')\n req = isolateObjectProperty(req, 'fallbackLocale')\n req.locale = args.locale || locale\n req.fallbackLocale = fallbackLocale\n context.req = req\n\n const options = {\n collection,\n req: isolateObjectProperty(req, 'transactionID'),\n trash: args.trash,\n where: args.where,\n }\n\n const results = await countOperation(options)\n return results\n }\n}\n"],"names":["countOperation","isolateObjectProperty","countResolver","collection","resolver","_","args","context","req","locale","fallbackLocale","options","trash","where","results"],"mappings":"AAEA,SAASA,cAAc,EAAEC,qBAAqB,QAAQ,UAAS;AAiB/D,OAAO,SAASC,cAAcC,UAAsB;IAClD,OAAO,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QACtD,IAAI,EAAEC,GAAG,EAAE,GAAGD;QACd,MAAME,SAASD,IAAIC,MAAM;QACzB,MAAMC,iBAAiBF,IAAIE,cAAc;QACzCF,MAAMP,sBAAsBO,KAAK;QACjCA,MAAMP,sBAAsBO,KAAK;QACjCA,IAAIC,MAAM,GAAGH,KAAKG,MAAM,IAAIA;QAC5BD,IAAIE,cAAc,GAAGA;QACrBH,QAAQC,GAAG,GAAGA;QAEd,MAAMG,UAAU;YACdR;YACAK,KAAKP,sBAAsBO,KAAK;YAChCI,OAAON,KAAKM,KAAK;YACjBC,OAAOP,KAAKO,KAAK;QACnB;QAEA,MAAMC,UAAU,MAAMd,eAAeW;QACrC,OAAOG;IACT;AACF"}

View File

@@ -0,0 +1,204 @@
{
"name": "webpack",
"version": "5.105.0",
"description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
"homepage": "https://github.com/webpack/webpack",
"bugs": "https://github.com/webpack/webpack/issues",
"repository": {
"type": "git",
"url": "https://github.com/webpack/webpack.git"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
},
"license": "MIT",
"author": "Tobias Koppers @sokra",
"main": "lib/index.js",
"types": "types.d.ts",
"bin": {
"webpack": "bin/webpack.js"
},
"files": [
"lib/",
"bin/",
"hot/",
"schemas/",
"SECURITY.md",
"module.d.ts",
"types.d.ts"
],
"scripts": {
"prepare": "husky",
"setup": "node ./setup/setup.js",
"prelint": "yarn setup",
"lint": "yarn lint:code && yarn lint:special && yarn lint:types && yarn lint:types-test && yarn lint:types-benchmark && yarn lint:types-module-test && yarn lint:types-hot && yarn lint:yarn && yarn fmt:check && yarn lint:spellcheck",
"lint:code": "node node_modules/eslint/bin/eslint.js --cache .",
"lint:special": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/schemas-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-schemas && node tooling/generate-runtime-code.js && node tooling/generate-wasm-code.js && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/precompile-schemas && node node_modules/tooling/generate-types --no-template-literals",
"lint:types": "tsc",
"lint:types-test": "tsc -p tsconfig.types.test.json",
"lint:types-benchmark": "tsc -p tsconfig.types.benchmark.json",
"lint:types-hot": "tsc -p tsconfig.hot.json",
"lint:types-module-test": "tsc -p tsconfig.module.test.json",
"lint:yarn": "yarn-deduplicate --fail --list -s highest yarn.lock",
"lint:spellcheck": "cspell --cache --no-must-find-files --quiet \"**/*.*\"",
"validate:types": "tsc -p tsconfig.validation.json",
"fmt": "yarn fmt:base --log-level warn --write",
"fmt:check": "yarn fmt:base --check",
"fmt:base": "node node_modules/prettier/bin/prettier.cjs --cache --ignore-unknown .",
"fix": "yarn fix:code && yarn fix:yarn && yarn fix:special && yarn fmt",
"fix:code": "yarn lint:code --fix",
"fix:yarn": "yarn-deduplicate -s highest yarn.lock",
"fix:special": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write",
"build:examples": "cd examples && node buildAll.js",
"benchmark": "node --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation --hash-seed=1 --random-seed=1 --no-opt --predictable --predictable-gc-schedule --interpreted-frames-native-stack --allow-natives-syntax --expose-gc --no-concurrent-sweeping ./test/BenchmarkTestCases.benchmark.mjs",
"pretest": "yarn lint",
"test": "yarn test:base",
"test:base": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --logHeapUsage",
"test:basic": "yarn test:base --testMatch \"<rootDir>/test/*.basictest.js\"",
"test:basic:deno": "yarn test:base:deno --testMatch \"<rootDir>/test/*.basictest.js\"",
"test:unit": "yarn test:base --testMatch \"<rootDir>/test/*.unittest.js\"",
"test:integration": "yarn test:base --testMatch \"<rootDir>/test/*.{basictest,longtest,test}.js\"",
"test:base:deno": "deno --allow-read --allow-env --allow-sys --allow-ffi --allow-write --allow-run --v8-flags='--max-old-space-size=4096' ./node_modules/jest-cli/bin/jest.js --logHeapUsage",
"test:update-snapshots": "yarn test:base -u",
"report:cover": "nyc report --reporter=lcov --reporter=text -t coverage",
"report:cover:clean": "rimraf .nyc_output coverage",
"report:cover:merge": "yarn mkdirp .nyc_output && nyc merge .nyc_output coverage/coverage-nyc.json && rimraf .nyc_output",
"types:cover": "node node_modules/tooling/type-coverage",
"types:cover:report": "rimraf coverage && yarn types:cover && yarn report:cover && open-cli coverage/lcov-report/index.html",
"cover": "yarn cover:all && yarn report:cover",
"cover:base": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules node_modules/jest-cli/bin/jest --logHeapUsage",
"cover:all": "yarn cover:base --coverage",
"cover:unit": "yarn cover:base --testMatch \"<rootDir>/test/*.unittest.js\" --coverage",
"cover:basic": "yarn cover:base --testMatch \"<rootDir>/test/*.basictest.js\" --coverage",
"cover:integration": "yarn cover:base --testMatch \"<rootDir>/test/*.{basictest,longtest,test}.js\" --coverage",
"cover:integration:a": "yarn cover:base --testMatch \"<rootDir>/test/*.{basictest,test}.js\" --coverage",
"cover:integration:b": "yarn cover:base --testMatch \"<rootDir>/test/*.longtest.js\" --coverage"
},
"lint-staged": {
"*.{js,cjs,mjs}": [
"node node_modules/eslint/bin/eslint.js --cache --fix"
],
"*": [
"node node_modules/prettier/bin/prettier.cjs --cache --write --ignore-unknown",
"cspell --cache --no-must-find-files"
]
},
"dependencies": {
"@types/eslint-scope": "^3.7.7",
"@types/estree": "^1.0.8",
"@types/json-schema": "^7.0.15",
"@webassemblyjs/ast": "^1.14.1",
"@webassemblyjs/wasm-edit": "^1.14.1",
"@webassemblyjs/wasm-parser": "^1.14.1",
"acorn": "^8.15.0",
"acorn-import-phases": "^1.0.3",
"browserslist": "^4.28.1",
"chrome-trace-event": "^1.0.2",
"enhanced-resolve": "^5.19.0",
"es-module-lexer": "^2.0.0",
"eslint-scope": "5.1.1",
"events": "^3.2.0",
"glob-to-regexp": "^0.4.1",
"graceful-fs": "^4.2.11",
"json-parse-even-better-errors": "^2.3.1",
"loader-runner": "^4.3.1",
"mime-types": "^2.1.27",
"neo-async": "^2.6.2",
"schema-utils": "^4.3.3",
"tapable": "^2.3.0",
"terser-webpack-plugin": "^5.3.16",
"watchpack": "^2.5.1",
"webpack-sources": "^3.3.3"
},
"devDependencies": {
"@babel/core": "^7.27.1",
"@babel/preset-react": "^7.27.1",
"@changesets/cli": "^2.29.8",
"@changesets/get-github-info": "^0.7.0",
"@codspeed/core": "^5.0.1",
"@types/glob-to-regexp": "^0.4.4",
"@types/graceful-fs": "^4.1.9",
"@types/jest": "^30.0.0",
"@types/mime-types": "^2.1.4",
"@types/neo-async": "^2.6.7",
"@types/node": "^25.1.0",
"@types/xxhashjs": "^0.2.4",
"assemblyscript": "^0.28.9",
"babel-loader": "^10.0.0",
"bundle-loader": "^0.5.6",
"coffee-loader": "^5.0.0",
"coffeescript": "^2.5.1",
"core-js": "^3.47.0",
"cspell": "^9.4.0",
"css-loader": "^7.1.2",
"date-fns": "^4.0.0",
"es5-ext": "^0.10.53",
"es6-promise-polyfill": "^1.2.0",
"eslint": "^9.39.2",
"eslint-config-webpack": "^4.9.1",
"file-loader": "^6.0.0",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"globals": "^17.0.0",
"hash-wasm": "^4.9.0",
"husky": "^9.0.11",
"istanbul": "^0.4.5",
"jest": "^30.2.0",
"jest-circus": "^30.2.0",
"jest-cli": "^30.2.0",
"jest-diff": "^30.2.0",
"jest-environment-node": "^30.2.0",
"jest-junit": "^16.0.0",
"json-loader": "^0.5.7",
"json5": "^2.1.3",
"less": "^4.5.1",
"less-loader": "^12.2.0",
"lint-staged": "^16.2.3",
"lodash": "^4.17.19",
"lodash-es": "^4.17.15",
"memfs": "^4.51.1",
"meriyah": "^7.0.0",
"mini-css-extract-plugin": "^2.9.0",
"mini-svg-data-uri": "^1.2.3",
"node-gyp": "^12.1.0",
"nyc": "^17.1.0",
"open-cli": "^8.0.0",
"pkg-pr-new": "^0.0.62",
"prettier": "^3.7.4",
"prettier-2": "npm:prettier@^2",
"pretty-format": "^30.0.5",
"pug": "^3.0.3",
"pug-loader": "^2.4.0",
"raw-loader": "^4.0.1",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"rimraf": "^3.0.2",
"script-loader": "^0.7.2",
"simple-git": "^3.28.0",
"strip-ansi": "^6.0.0",
"style-loader": "^4.0.0",
"terser": "^5.43.1",
"three": "^0.182.0",
"tinybench": "^6.0.0",
"toml": "^3.0.0",
"tooling": "webpack/tooling#v1.24.4",
"ts-loader": "^9.5.4",
"typescript": "^5.9.3",
"url-loader": "^4.1.0",
"wast-loader": "^1.12.1",
"webassembly-feature": "1.3.0",
"webpack-cli": "^6.0.1",
"xxhashjs": "^0.2.2",
"yamljs": "^0.3.0",
"yarn-deduplicate": "^6.0.1"
},
"peerDependenciesMeta": {
"webpack-cli": {
"optional": true
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"engines": {
"node": ">=10.13.0"
}
}

View File

@@ -0,0 +1,24 @@
import type { CollectionAfterChangeHook } from '../../index.js';
/**
* If a parent is moved into a child folder, we need to re-parent the child
*
* @example
*
* ```ts
→ F1
→ F2
→ F2A
→ F3
Moving F1 → F2A becomes:
→ F2A
→ F1
→ F2
→ F3
```
*/
export declare const reparentChildFolder: ({ folderFieldName, }: {
folderFieldName: string;
}) => CollectionAfterChangeHook;
//# sourceMappingURL=reparentChildFolder.d.ts.map

View File

@@ -0,0 +1,21 @@
'use strict'
const { Writable } = require('stream')
// Nop console.error to avoid printing things out
console.error = () => {}
setImmediate(function () {
throw new Error('kaboom')
})
async function run (opts) {
const stream = new Writable({
write (chunk, enc, cb) {
cb()
}
})
return stream
}
module.exports = run

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A zC","388":"B"},B:{"1":"P Q H R S T U","2":"C L M G","129":"N O","513":"0 1 2 3 4 5 6 7 8 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"},C:{"1":"0 1 2 3 4 5 6 7 8 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 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 4C 5C"},D:{"1":"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","2":"9 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","513":"0 1 2 3 4 5 6 7 8 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"},E:{"1":"G 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 6C bC 7C 8C 9C AD cC PC","2052":"M CD","3076":"C L QC BD"},F:{"1":"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","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 JD KD LD MD PC xC ND QC","513":"0 1 2 3 4 5 6 7 8 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"},G:{"1":"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":"E bC OD yC PD QD RD SD TD UD VD WD XD YD","2052":"ZD aD"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"2":"A B C PC xC QC","513":"H"},L:{"513":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"2":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D","2":"J"},Q:{"16":"4D"},R:{"513":"5D"},S:{"1":"7D","2":"6D"}},B:6,C:"'SameSite' cookie attribute",D:true};

View File

@@ -0,0 +1 @@
{"version":3,"file":"generateUniqueID.js","sources":["../../../../../src/metrics/web-vitals/lib/generateUniqueID.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\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\n/**\n * Performantly generate a unique, 30-char string by combining a version\n * number, the current timestamp with a 13-digit number integer.\n * @return {string}\n */\nexport const generateUniqueID = () => {\n return `v5-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;\n};\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,gBAAA,GAAmB,MAAM;AACtC,EAAE,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAC,IAAK,IAAA,GAAO,CAAC,CAAC,CAAA,GAAI,IAAI,CAAC,CAAA;AACA;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"lightbulb.js","sources":["../../../src/icons/lightbulb.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Lightbulb\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMTRjLjItMSAuNy0xLjcgMS41LTIuNSAxLS45IDEuNS0yLjIgMS41LTMuNUE2IDYgMCAwIDAgNiA4YzAgMSAuMiAyLjIgMS41IDMuNS43LjcgMS4zIDEuNSAxLjUgMi41IiAvPgogIDxwYXRoIGQ9Ik05IDE4aDYiIC8+CiAgPHBhdGggZD0iTTEwIDIyaDQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/lightbulb\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 Lightbulb = createLucideIcon('Lightbulb', [\n [\n 'path',\n {\n d: 'M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5',\n key: '1gvzjb',\n },\n ],\n ['path', { d: 'M9 18h6', key: 'x1upvd' }],\n ['path', { d: 'M10 22h4', key: 'ceow96' }],\n]);\n\nexport default Lightbulb;\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;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { endOfSecond as fn } from "../endOfSecond.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const endOfSecond = convertToFP(fn, 1);
// Fallback for modularized imports:
export default endOfSecond;

View File

@@ -0,0 +1,162 @@
import { entityKind } from "../entity.js";
import { NoopLogger } from "../logger.js";
import { PgTransaction } from "../pg-core/index.js";
import { PgPreparedQuery, PgSession } from "../pg-core/session.js";
import { fillPlaceholders, sql } from "../sql/sql.js";
import { mapResultRow } from "../utils.js";
import { types } from "@electric-sql/pglite";
import { NoopCache } from "../cache/core/cache.js";
class PglitePreparedQuery extends PgPreparedQuery {
constructor(client, queryString, params, logger, cache, queryMetadata, cacheConfig, fields, name, _isResponseInArrayMode, customResultMapper) {
super({ sql: queryString, params }, cache, queryMetadata, cacheConfig);
this.client = client;
this.queryString = queryString;
this.params = params;
this.logger = logger;
this.fields = fields;
this._isResponseInArrayMode = _isResponseInArrayMode;
this.customResultMapper = customResultMapper;
this.rawQueryConfig = {
rowMode: "object",
parsers: {
[types.TIMESTAMP]: (value) => value,
[types.TIMESTAMPTZ]: (value) => value,
[types.INTERVAL]: (value) => value,
[types.DATE]: (value) => value,
// numeric[]
[1231]: (value) => value,
// timestamp[]
[1115]: (value) => value,
// timestamp with timezone[]
[1185]: (value) => value,
// interval[]
[1187]: (value) => value,
// date[]
[1182]: (value) => value
}
};
this.queryConfig = {
rowMode: "array",
parsers: {
[types.TIMESTAMP]: (value) => value,
[types.TIMESTAMPTZ]: (value) => value,
[types.INTERVAL]: (value) => value,
[types.DATE]: (value) => value,
// numeric[]
[1231]: (value) => value,
// timestamp[]
[1115]: (value) => value,
// timestamp with timezone[]
[1185]: (value) => value,
// interval[]
[1187]: (value) => value,
// date[]
[1182]: (value) => value
}
};
}
static [entityKind] = "PglitePreparedQuery";
rawQueryConfig;
queryConfig;
async execute(placeholderValues = {}) {
const params = fillPlaceholders(this.params, placeholderValues);
this.logger.logQuery(this.queryString, params);
const { fields, client, queryConfig, joinsNotNullableMap, customResultMapper, queryString, rawQueryConfig } = this;
if (!fields && !customResultMapper) {
return this.queryWithCache(queryString, params, async () => {
return await client.query(queryString, params, rawQueryConfig);
});
}
const result = await this.queryWithCache(queryString, params, async () => {
return await client.query(queryString, params, queryConfig);
});
return customResultMapper ? customResultMapper(result.rows) : result.rows.map((row) => mapResultRow(fields, row, joinsNotNullableMap));
}
all(placeholderValues = {}) {
const params = fillPlaceholders(this.params, placeholderValues);
this.logger.logQuery(this.queryString, params);
return this.queryWithCache(this.queryString, params, async () => {
return await this.client.query(this.queryString, params, this.rawQueryConfig);
}).then((result) => result.rows);
}
/** @internal */
isResponseInArrayMode() {
return this._isResponseInArrayMode;
}
}
class PgliteSession extends PgSession {
constructor(client, dialect, schema, options = {}) {
super(dialect);
this.client = client;
this.schema = schema;
this.options = options;
this.logger = options.logger ?? new NoopLogger();
this.cache = options.cache ?? new NoopCache();
}
static [entityKind] = "PgliteSession";
logger;
cache;
prepareQuery(query, fields, name, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) {
return new PglitePreparedQuery(
this.client,
query.sql,
query.params,
this.logger,
this.cache,
queryMetadata,
cacheConfig,
fields,
name,
isResponseInArrayMode,
customResultMapper
);
}
async transaction(transaction, config) {
return this.client.transaction(async (client) => {
const session = new PgliteSession(
client,
this.dialect,
this.schema,
this.options
);
const tx = new PgliteTransaction(this.dialect, session, this.schema);
if (config) {
await tx.setTransaction(config);
}
return transaction(tx);
});
}
async count(sql2) {
const res = await this.execute(sql2);
return Number(
res["rows"][0]["count"]
);
}
}
class PgliteTransaction extends PgTransaction {
static [entityKind] = "PgliteTransaction";
async transaction(transaction) {
const savepointName = `sp${this.nestedIndex + 1}`;
const tx = new PgliteTransaction(
this.dialect,
this.session,
this.schema,
this.nestedIndex + 1
);
await tx.execute(sql.raw(`savepoint ${savepointName}`));
try {
const result = await transaction(tx);
await tx.execute(sql.raw(`release savepoint ${savepointName}`));
return result;
} catch (err) {
await tx.execute(sql.raw(`rollback to savepoint ${savepointName}`));
throw err;
}
}
}
export {
PglitePreparedQuery,
PgliteSession,
PgliteTransaction
};
//# sourceMappingURL=session.js.map

View File

@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _dispose;
function dispose_SuppressedError(error, suppressed) {
if (typeof SuppressedError !== "undefined") {
dispose_SuppressedError = SuppressedError;
} else {
dispose_SuppressedError = function SuppressedError(error, suppressed) {
this.suppressed = suppressed;
this.error = error;
this.stack = new Error().stack;
};
dispose_SuppressedError.prototype = Object.create(Error.prototype, {
constructor: {
value: dispose_SuppressedError,
writable: true,
configurable: true
}
});
}
return new dispose_SuppressedError(error, suppressed);
}
function _dispose(stack, error, hasError) {
function next() {
while (stack.length > 0) {
try {
var r = stack.pop();
var p = r.d.call(r.v);
if (r.a) return Promise.resolve(p).then(next, err);
} catch (e) {
return err(e);
}
}
if (hasError) throw error;
}
function err(e) {
error = hasError ? new dispose_SuppressedError(error, e) : e;
hasError = true;
return next();
}
return next();
}
//# sourceMappingURL=dispose.js.map

View File

@@ -0,0 +1,303 @@
import type {
AdditionalTokensOptions,
FirstWeekContainsDateOptions,
LocalizedOptions,
WeekOptions,
} from "./types.js";
/**
* The {@link isMatch} function options.
*/
export interface IsMatchOptions
extends LocalizedOptions<"options" | "match" | "formatLong">,
WeekOptions,
FirstWeekContainsDateOptions,
AdditionalTokensOptions {}
/**
* @name isMatch
* @category Common Helpers
* @summary validates the date string against given formats
*
* @description
* Return the true if given date is string correct against the given format else
* will return false.
*
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* The characters in the format string wrapped between two single quotes characters (') are escaped.
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
*
* Format of the format string is based on Unicode Technical Standard #35:
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
* with a few additions (see note 5 below the table).
*
* Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
* and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
*
* ```javascript
* isMatch('23 AM', 'HH a')
* //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
* ```
*
* See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
*
* Accepted format string patterns:
* | Unit |Prior| Pattern | Result examples | Notes |
* |---------------------------------|-----|---------|-----------------------------------|-------|
* | Era | 140 | G..GGG | AD, BC | |
* | | | GGGG | Anno Domini, Before Christ | 2 |
* | | | GGGGG | A, B | |
* | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
* | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
* | | | yy | 44, 01, 00, 17 | 4 |
* | | | yyy | 044, 001, 123, 999 | 4 |
* | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
* | | | yyyyy | ... | 2,4 |
* | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
* | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
* | | | YY | 44, 01, 00, 17 | 4,6 |
* | | | YYY | 044, 001, 123, 999 | 4 |
* | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
* | | | YYYYY | ... | 2,4 |
* | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
* | | | RR | -43, 01, 00, 17 | 4,5 |
* | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
* | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
* | | | RRRRR | ... | 2,4,5 |
* | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
* | | | uu | -43, 01, 99, -99 | 4 |
* | | | uuu | -043, 001, 123, 999, -999 | 4 |
* | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
* | | | uuuuu | ... | 2,4 |
* | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
* | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
* | | | QQ | 01, 02, 03, 04 | |
* | | | QQQ | Q1, Q2, Q3, Q4 | |
* | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
* | | | QQQQQ | 1, 2, 3, 4 | 4 |
* | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
* | | | qo | 1st, 2nd, 3rd, 4th | 5 |
* | | | qq | 01, 02, 03, 04 | |
* | | | qqq | Q1, Q2, Q3, Q4 | |
* | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
* | | | qqqqq | 1, 2, 3, 4 | 3 |
* | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
* | | | Mo | 1st, 2nd, ..., 12th | 5 |
* | | | MM | 01, 02, ..., 12 | |
* | | | MMM | Jan, Feb, ..., Dec | |
* | | | MMMM | January, February, ..., December | 2 |
* | | | MMMMM | J, F, ..., D | |
* | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
* | | | Lo | 1st, 2nd, ..., 12th | 5 |
* | | | LL | 01, 02, ..., 12 | |
* | | | LLL | Jan, Feb, ..., Dec | |
* | | | LLLL | January, February, ..., December | 2 |
* | | | LLLLL | J, F, ..., D | |
* | Local week of year | 100 | w | 1, 2, ..., 53 | |
* | | | wo | 1st, 2nd, ..., 53th | 5 |
* | | | ww | 01, 02, ..., 53 | |
* | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
* | | | Io | 1st, 2nd, ..., 53th | 5 |
* | | | II | 01, 02, ..., 53 | 5 |
* | Day of month | 90 | d | 1, 2, ..., 31 | |
* | | | do | 1st, 2nd, ..., 31st | 5 |
* | | | dd | 01, 02, ..., 31 | |
* | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
* | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
* | | | DD | 01, 02, ..., 365, 366 | 7 |
* | | | DDD | 001, 002, ..., 365, 366 | |
* | | | DDDD | ... | 2 |
* | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | |
* | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
* | | | EEEEE | M, T, W, T, F, S, S | |
* | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
* | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
* | | | io | 1st, 2nd, ..., 7th | 5 |
* | | | ii | 01, 02, ..., 07 | 5 |
* | | | iii | Mon, Tue, Wed, ..., Su | 5 |
* | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
* | | | iiiii | M, T, W, T, F, S, S | 5 |
* | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |
* | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
* | | | eo | 2nd, 3rd, ..., 1st | 5 |
* | | | ee | 02, 03, ..., 01 | |
* | | | eee | Mon, Tue, Wed, ..., Su | |
* | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
* | | | eeeee | M, T, W, T, F, S, S | |
* | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
* | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
* | | | co | 2nd, 3rd, ..., 1st | 5 |
* | | | cc | 02, 03, ..., 01 | |
* | | | ccc | Mon, Tue, Wed, ..., Su | |
* | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
* | | | ccccc | M, T, W, T, F, S, S | |
* | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
* | AM, PM | 80 | a..aaa | AM, PM | |
* | | | aaaa | a.m., p.m. | 2 |
* | | | aaaaa | a, p | |
* | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
* | | | bbbb | a.m., p.m., noon, midnight | 2 |
* | | | bbbbb | a, p, n, mi | |
* | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
* | | | BBBB | at night, in the morning, ... | 2 |
* | | | BBBBB | at night, in the morning, ... | |
* | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
* | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
* | | | hh | 01, 02, ..., 11, 12 | |
* | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
* | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
* | | | HH | 00, 01, 02, ..., 23 | |
* | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
* | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
* | | | KK | 01, 02, ..., 11, 00 | |
* | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
* | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
* | | | kk | 24, 01, 02, ..., 23 | |
* | Minute | 60 | m | 0, 1, ..., 59 | |
* | | | mo | 0th, 1st, ..., 59th | 5 |
* | | | mm | 00, 01, ..., 59 | |
* | Second | 50 | s | 0, 1, ..., 59 | |
* | | | so | 0th, 1st, ..., 59th | 5 |
* | | | ss | 00, 01, ..., 59 | |
* | Seconds timestamp | 40 | t | 512969520 | |
* | | | tt | ... | 2 |
* | Fraction of second | 30 | S | 0, 1, ..., 9 | |
* | | | SS | 00, 01, ..., 99 | |
* | | | SSS | 000, 001, ..., 999 | |
* | | | SSSS | ... | 2 |
* | Milliseconds timestamp | 20 | T | 512969520900 | |
* | | | TT | ... | 2 |
* | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
* | | | XX | -0800, +0530, Z | |
* | | | XXX | -08:00, +05:30, Z | |
* | | | XXXX | -0800, +0530, Z, +123456 | 2 |
* | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
* | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
* | | | xx | -0800, +0530, +0000 | |
* | | | xxx | -08:00, +05:30, +00:00 | 2 |
* | | | xxxx | -0800, +0530, +0000, +123456 | |
* | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
* | Long localized date | NA | P | 05/29/1453 | 5,8 |
* | | | PP | May 29, 1453 | |
* | | | PPP | May 29th, 1453 | |
* | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
* | Long localized time | NA | p | 12:00 AM | 5,8 |
* | | | pp | 12:00:00 AM | |
* | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
* | | | PPpp | May 29, 1453, 12:00:00 AM | |
* | | | PPPpp | May 29th, 1453 at ... | |
* | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
* Notes:
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
* are the same as "stand-alone" units, but are different in some languages.
* "Formatting" units are declined according to the rules of the language
* in the context of a date. "Stand-alone" units are always nominative singular.
* In `format` function, they will produce different result:
*
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
*
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
*
* `isMatch` will try to match both formatting and stand-alone units interchangeably.
*
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
* the single quote characters (see below).
* If the sequence is longer than listed in table:
* - for numerical units (`yyyyyyyy`) `isMatch` will try to match a number
* as wide as the sequence
* - for text units (`MMMMMMMM`) `isMatch` will try to match the widest variation of the unit.
* These variations are marked with "2" in the last column of the table.
*
* 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
* These tokens represent the shortest form of the quarter.
*
* 4. The main difference between `y` and `u` patterns are B.C. years:
*
* | Year | `y` | `u` |
* |------|-----|-----|
* | AC 1 | 1 | 1 |
* | BC 1 | 1 | 0 |
* | BC 2 | 2 | -1 |
*
* Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
*
* `isMatch('50', 'yy') //=> true`
*
* `isMatch('75', 'yy') //=> true`
*
* while `uu` will use the year as is:
*
* `isMatch('50', 'uu') //=> true`
*
* `isMatch('75', 'uu') //=> true`
*
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
* except local week-numbering years are dependent on `options.weekStartsOn`
* and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)
* and [setWeekYear](https://date-fns.org/docs/setWeekYear)).
*
* 5. These patterns are not in the Unicode Technical Standard #35:
* - `i`: ISO day of week
* - `I`: ISO week of year
* - `R`: ISO week-numbering year
* - `o`: ordinal number modifier
* - `P`: long localized date
* - `p`: long localized time
*
* 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* 7. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
* on the given locale.
*
* using `en-US` locale: `P` => `MM/dd/yyyy`
* using `en-US` locale: `p` => `hh:mm a`
* using `pt-BR` locale: `P` => `dd/MM/yyyy`
* using `pt-BR` locale: `p` => `HH:mm`
*
* Values will be checked in the descending order of its unit's priority.
* Units of an equal priority overwrite each other in the order of appearance.
*
* If no values of higher priority are matched (e.g. when matching string 'January 1st' without a year),
* the values will be taken from today's using `new Date()` date which works as a context of parsing.
*
* The result may vary by locale.
*
* If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
*
* @param dateStr - The date string to verify
* @param format - The string of tokens
* @param options - An object with options.
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* @returns Is format string a match for date string?
*
* @throws `options.locale` must contain `match` property
* @throws use `yyyy` instead of `YYYY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `yy` instead of `YY` for formatting years; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `d` instead of `D` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `dd` instead of `DD` for formatting days of the month; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws format string contains an unescaped latin alphabet character
*
* @example
* // Match 11 February 2014 from middle-endian format:
* const result = isMatch('02/11/2014', 'MM/dd/yyyy')
* //=> true
*
* @example
* // Match 28th of February in Esperanto locale in the context of 2010 year:
* import eo from 'date-fns/locale/eo'
* const result = isMatch('28-a de februaro', "do 'de' MMMM", {
* locale: eo
* })
* //=> true
*/
export declare function isMatch(
dateStr: string,
formatStr: string,
options?: IsMatchOptions,
): boolean;

View File

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

View File

@@ -0,0 +1,83 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/**
* This code was originally copied from the 'cookie` module at v0.5.0 and was simplified for our use case.
* https://github.com/jshttp/cookie/blob/a0c84147aab6266bdb3996cf4062e93907c0b0fc/index.js
* It had the following license:
*
* (The MIT License)
*
* Copyright (c) 2012-2014 Roman Shtylman <shtylman@gmail.com>
* Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* 'Software'), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* Parses a cookie string
*/
function parseCookie(str) {
const obj = {};
let index = 0;
while (index < str.length) {
const eqIdx = str.indexOf('=', index);
// no more cookie pairs
if (eqIdx === -1) {
break;
}
let endIdx = str.indexOf(';', index);
if (endIdx === -1) {
endIdx = str.length;
} else if (endIdx < eqIdx) {
// backtrack on prior semicolon
index = str.lastIndexOf(';', eqIdx - 1) + 1;
continue;
}
const key = str.slice(index, eqIdx).trim();
// only assign once
if (undefined === obj[key]) {
let val = str.slice(eqIdx + 1, endIdx).trim();
// quoted values
if (val.charCodeAt(0) === 0x22) {
val = val.slice(1, -1);
}
try {
obj[key] = val.indexOf('%') !== -1 ? decodeURIComponent(val) : val;
} catch {
obj[key] = val;
}
}
index = endIdx + 1;
}
return obj;
}
exports.parseCookie = parseCookie;
//# sourceMappingURL=cookie.js.map

View File

@@ -0,0 +1,6 @@
import { browserTracingIntegrationShim, consoleLoggingIntegrationShim, feedbackIntegrationShim, loggerShim } from '@sentry-internal/integration-shims';
export * from './index.bundle.base';
export { consoleLoggingIntegrationShim as consoleLoggingIntegration, loggerShim as logger };
export { replayIntegration, getReplay } from '@sentry-internal/replay';
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration, };
//# sourceMappingURL=index.bundle.replay.d.ts.map

View File

@@ -0,0 +1,236 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const browser = require('@sentry/browser');
const core = require('@sentry/core');
const React = require('react');
const hoistNonReactStatics = require('./hoist-non-react-statics.js');
// We need to disable eslint no-explicit-any because any is required for the
// react-router typings.
/**
* A browser tracing integration that uses React Router v4 to instrument navigations.
* Expects `history` (and optionally `routes` and `matchPath`) to be passed as options.
*/
function reactRouterV4BrowserTracingIntegration(
options,
) {
const integration = browser.browserTracingIntegration({
...options,
instrumentPageLoad: false,
instrumentNavigation: false,
});
const { history, routes, matchPath, instrumentPageLoad = true, instrumentNavigation = true } = options;
return {
...integration,
afterAllSetup(client) {
integration.afterAllSetup(client);
instrumentReactRouter(
client,
instrumentPageLoad,
instrumentNavigation,
history,
'reactrouter_v4',
routes,
matchPath,
);
},
};
}
/**
* A browser tracing integration that uses React Router v5 to instrument navigations.
* Expects `history` (and optionally `routes` and `matchPath`) to be passed as options.
*/
function reactRouterV5BrowserTracingIntegration(
options,
) {
const integration = browser.browserTracingIntegration({
...options,
instrumentPageLoad: false,
instrumentNavigation: false,
});
const { history, routes, matchPath, instrumentPageLoad = true, instrumentNavigation = true } = options;
return {
...integration,
afterAllSetup(client) {
integration.afterAllSetup(client);
instrumentReactRouter(
client,
instrumentPageLoad,
instrumentNavigation,
history,
'reactrouter_v5',
routes,
matchPath,
);
},
};
}
function instrumentReactRouter(
client,
instrumentPageLoad,
instrumentNavigation,
history,
instrumentationName,
allRoutes = [],
matchPath,
) {
function getInitPathName() {
if (history.location) {
return history.location.pathname;
}
if (browser.WINDOW.location) {
return browser.WINDOW.location.pathname;
}
return undefined;
}
/**
* Normalizes a transaction name. Returns the new name as well as the
* source of the transaction.
*
* @param pathname The initial pathname we normalize
*/
function normalizeTransactionName(pathname) {
if (allRoutes.length === 0 || !matchPath) {
return [pathname, 'url'];
}
const branches = matchRoutes(allRoutes, pathname, matchPath);
for (const branch of branches) {
if (branch.match.isExact) {
return [branch.match.path, 'route'];
}
}
return [pathname, 'url'];
}
if (instrumentPageLoad) {
const initPathName = getInitPathName();
if (initPathName) {
const [name, source] = normalizeTransactionName(initPathName);
browser.startBrowserTracingPageLoadSpan(client, {
name,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: `auto.pageload.react.${instrumentationName}`,
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,
},
});
}
}
if (instrumentNavigation && history.listen) {
history.listen((location, action) => {
if (action && (action === 'PUSH' || action === 'POP')) {
const [name, source] = normalizeTransactionName(location.pathname);
browser.startBrowserTracingNavigationSpan(client, {
name,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: `auto.navigation.react.${instrumentationName}`,
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,
},
});
}
});
}
}
/**
* Matches a set of routes to a pathname
* Based on implementation from
*/
function matchRoutes(
routes,
pathname,
matchPath,
branch = [],
) {
routes.some(route => {
const match = route.path
? matchPath(pathname, route)
: branch.length
? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
branch[branch.length - 1].match // use parent match
: computeRootMatch(pathname); // use default "root" match
if (match) {
branch.push({ route, match });
if (route.routes) {
matchRoutes(route.routes, pathname, matchPath, branch);
}
}
return !!match;
});
return branch;
}
function computeRootMatch(pathname) {
return { path: '/', url: '/', params: {}, isExact: pathname === '/' };
}
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */
function withSentryRouting(Route) {
const componentDisplayName = Route.displayName || Route.name;
const WrappedRoute = (props) => {
if (props?.computedMatch?.isExact) {
const route = props.computedMatch.path;
const activeRootSpan = getActiveRootSpan();
core.getCurrentScope().setTransactionName(route);
if (activeRootSpan) {
activeRootSpan.updateName(route);
activeRootSpan.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');
}
}
// @ts-expect-error Setting more specific React Component typing for `R` generic above
// will break advanced type inference done by react router params:
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13dc4235c069e25fe7ee16e11f529d909f9f3ff8/types/react-router/index.d.ts#L154-L164
return React.createElement(Route, { ...props,} );
};
WrappedRoute.displayName = `sentryRoute(${componentDisplayName})`;
hoistNonReactStatics.hoistNonReactStatics(WrappedRoute, Route);
// @ts-expect-error Setting more specific React Component typing for `R` generic above
// will break advanced type inference done by react router params:
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13dc4235c069e25fe7ee16e11f529d909f9f3ff8/types/react-router/index.d.ts#L154-L164
return WrappedRoute;
}
/* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */
function getActiveRootSpan() {
const span = core.getActiveSpan();
const rootSpan = span && core.getRootSpan(span);
if (!rootSpan) {
return undefined;
}
const op = core.spanToJSON(rootSpan).op;
// Only use this root span if it is a pageload or navigation span
return op === 'navigation' || op === 'pageload' ? rootSpan : undefined;
}
exports.reactRouterV4BrowserTracingIntegration = reactRouterV4BrowserTracingIntegration;
exports.reactRouterV5BrowserTracingIntegration = reactRouterV5BrowserTracingIntegration;
exports.withSentryRouting = withSentryRouting;
//# sourceMappingURL=reactrouter.js.map

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9saWIvZGljdGlvbmFyeS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgS2V5b2ZCYXNlIH0gZnJvbSBcIi4uL2tleS1vZi1iYXNlXCI7XG5cbmV4cG9ydCB0eXBlIERpY3Rpb25hcnk8VHlwZSwgS2V5cyBleHRlbmRzIEtleW9mQmFzZSA9IHN0cmluZz4gPSB7IFtrZXkgaW4gS2V5c106IFR5cGUgfTtcbiJdfQ==

View File

@@ -0,0 +1 @@
{"version":3,"file":"tracer_provider.js","sourceRoot":"","sources":["../../../src/trace/tracer_provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 { Tracer } from './tracer';\nimport { TracerOptions } from './tracer_options';\n\n/**\n * A registry for creating named {@link Tracer}s.\n */\nexport interface TracerProvider {\n /**\n * Returns a Tracer, creating one if one with the given name and version is\n * not already created.\n *\n * This function may return different Tracer types (e.g.\n * {@link NoopTracerProvider} vs. a functional tracer).\n *\n * @param name The name of the tracer or instrumentation library.\n * @param version The version of the tracer or instrumentation library.\n * @param options The options of the tracer or instrumentation library.\n * @returns Tracer A Tracer with the given name and version\n */\n getTracer(name: string, version?: string, options?: TracerOptions): Tracer;\n}\n"]}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/auth/operations/init.ts"],"sourcesContent":["import type { PayloadRequest, Where } from '../../types/index.js'\n\nimport { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js'\n\nexport const initOperation = async (args: {\n collection: string\n req: PayloadRequest\n}): Promise<boolean> => {\n const { collection: slug, req } = args\n\n const collectionConfig = req.payload.config.collections?.find((c) => c.slug === slug)\n\n // Exclude trashed documents unless `trash: true`\n const where: Where = appendNonTrashedFilter({\n enableTrash: Boolean(collectionConfig?.trash),\n trash: false,\n where: {},\n })\n\n const doc = await req.payload.db.findOne({\n collection: slug,\n req,\n where,\n })\n\n return !!doc\n}\n"],"names":["appendNonTrashedFilter","initOperation","args","collection","slug","req","collectionConfig","payload","config","collections","find","c","where","enableTrash","Boolean","trash","doc","db","findOne"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ,4CAA2C;AAElF,OAAO,MAAMC,gBAAgB,OAAOC;IAIlC,MAAM,EAAEC,YAAYC,IAAI,EAAEC,GAAG,EAAE,GAAGH;IAElC,MAAMI,mBAAmBD,IAAIE,OAAO,CAACC,MAAM,CAACC,WAAW,EAAEC,KAAK,CAACC,IAAMA,EAAEP,IAAI,KAAKA;IAEhF,iDAAiD;IACjD,MAAMQ,QAAeZ,uBAAuB;QAC1Ca,aAAaC,QAAQR,kBAAkBS;QACvCA,OAAO;QACPH,OAAO,CAAC;IACV;IAEA,MAAMI,MAAM,MAAMX,IAAIE,OAAO,CAACU,EAAE,CAACC,OAAO,CAAC;QACvCf,YAAYC;QACZC;QACAO;IACF;IAEA,OAAO,CAAC,CAACI;AACX,EAAC"}

View File

@@ -0,0 +1,65 @@
"use strict";
exports.buildLocalizeFn = buildLocalizeFn;
/**
* The localize function argument callback which allows to convert raw value to
* the actual type.
*
* @param value - The value to convert
*
* @returns The converted value
*/
/**
* The map of localized values for each width.
*/
/**
* The index type of the locale unit value. It types conversion of units of
* values that don't start at 0 (i.e. quarters).
*/
/**
* Converts the unit value to the tuple of values.
*/
/**
* The tuple of localized era values. The first element represents BC,
* the second element represents AD.
*/
/**
* The tuple of localized quarter values. The first element represents Q1.
*/
/**
* The tuple of localized day values. The first element represents Sunday.
*/
/**
* The tuple of localized month values. The first element represents January.
*/
function buildLocalizeFn(args) {
return (value, options) => {
const context = options?.context ? String(options.context) : "standalone";
let valuesArray;
if (context === "formatting" && args.formattingValues) {
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
const width = options?.width ? String(options.width) : defaultWidth;
valuesArray =
args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
const defaultWidth = args.defaultWidth;
const width = options?.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[width] || args.values[defaultWidth];
}
const index = args.argumentCallback ? args.argumentCallback(value) : value;
// @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
return valuesArray[index];
};
}

View File

@@ -0,0 +1,17 @@
export const resetLoginAttempts = async ({ collection, doc, payload, req })=>{
if (!('lockUntil' in doc && typeof doc.lockUntil === 'string') && (!('loginAttempts' in doc) || doc.loginAttempts === 0)) {
return;
}
await payload.db.updateOne({
id: doc.id,
collection: collection.slug,
data: {
lockUntil: null,
loginAttempts: 0
},
req,
returning: false
});
};
//# sourceMappingURL=resetLoginAttempts.js.map

View File

@@ -0,0 +1,11 @@
import type { Locale } from "./types.js";
/**
* @category Locales
* @summary Korean locale.
* @language Korean
* @iso-639-2 kor
* @author Hong Chulju [@angdev](https://github.com/angdev)
* @author Lee Seoyoen [@iamssen](https://github.com/iamssen)
* @author Taiki IKeda [@so99ynoodles](https://github.com/so99ynoodles)
*/
export declare const ko: Locale;

View File

@@ -0,0 +1,33 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
const makeSerializable = require("./util/makeSerializable");
/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
class UnsupportedFeatureWarning extends WebpackError {
/**
* @param {string} message description of warning
* @param {DependencyLocation} loc location start and end positions of the module
*/
constructor(message, loc) {
super(message);
/** @type {string} */
this.name = "UnsupportedFeatureWarning";
this.loc = loc;
this.hideStack = true;
}
}
makeSerializable(
UnsupportedFeatureWarning,
"webpack/lib/UnsupportedFeatureWarning"
);
module.exports = UnsupportedFeatureWarning;

View File

@@ -0,0 +1 @@
{"version":3,"file":"import.js","names":[],"sources":["../../../../src/rest/commands/utils/import.ts"],"sourcesContent":["import type { RestCommand } from '../../types.js';\n\n/**\n * Import multiple records from a JSON or CSV file into a collection.\n * @returns Nothing\n */\nexport const utilsImport =\n\t<Schema>(collection: keyof Schema, data: FormData): RestCommand<void, Schema> =>\n\t() => ({\n\t\tpath: `/utils/import/${collection as string}`,\n\t\tmethod: 'POST',\n\t\tbody: data,\n\t\theaders: { 'Content-Type': 'multipart/form-data' },\n\t});\n"],"mappings":"AAMA,MAAa,GACH,EAA0B,SAC5B,CACN,KAAM,iBAAiB,IACvB,OAAQ,OACR,KAAM,EACN,QAAS,CAAE,eAAgB,sBAAuB,CAClD"}

View File

@@ -0,0 +1,21 @@
var getWrapDetails = require('./_getWrapDetails'),
insertWrapDetails = require('./_insertWrapDetails'),
setToString = require('./_setToString'),
updateWrapDetails = require('./_updateWrapDetails');
/**
* Sets the `toString` method of `wrapper` to mimic the source of `reference`
* with wrapper details in a comment at the top of the source body.
*
* @private
* @param {Function} wrapper The function to modify.
* @param {Function} reference The reference function.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Function} Returns `wrapper`.
*/
function setWrapToString(wrapper, reference, bitmask) {
var source = (reference + '');
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
}
module.exports = setWrapToString;

View File

@@ -0,0 +1,59 @@
{
"name": "@react-email/code-block",
"version": "0.0.11",
"description": "Display code with a selected theme and regex highlighting using Prism.js",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/**"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/resend/react-email.git",
"directory": "packages/code-block"
},
"keywords": [
"react",
"email"
],
"engines": {
"node": ">=18.0.0"
},
"peerDependencies": {
"react": "^18.0 || ^19.0 || ^19.0.0-rc"
},
"devDependencies": {
"@types/prismjs": "1.26.5",
"typescript": "5.1.6",
"@react-email/render": "1.0.3",
"tsconfig": "0.0.0",
"eslint-config-custom": "0.0.0"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"prismjs": "1.29.0"
},
"scripts": {
"build": "tsup src/index.ts --format esm,cjs --dts --external react",
"clean": "rm -rf dist",
"dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch",
"lint": "eslint ."
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"isUserLocked.d.ts","sourceRoot":"","sources":["../../src/auth/isUserLocked.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,SAAU,IAAI,KAAG,OAKzC,CAAA"}

View File

@@ -0,0 +1,3 @@
import { useWindowInfo, WindowInfoProvider } from '@faceless-ui/window-info';
export { useWindowInfo, WindowInfoProvider };
//# sourceMappingURL=index.d.ts.map

View File

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

View File

@@ -0,0 +1,11 @@
/*#__NO_SIDE_EFFECTS__*/
function memo(callback) {
let result;
return () => {
if (result === undefined)
result = callback();
return result;
};
}
export { memo };

View File

@@ -0,0 +1,974 @@
'use strict'
const assert = require('node:assert')
const { kDestroyed, kBodyUsed, kListeners, kBody } = require('./symbols')
const { IncomingMessage } = require('node:http')
const stream = require('node:stream')
const net = require('node:net')
const { stringify } = require('node:querystring')
const { EventEmitter: EE } = require('node:events')
const timers = require('../util/timers')
const { InvalidArgumentError, ConnectTimeoutError } = require('./errors')
const { headerNameLowerCasedRecord } = require('./constants')
const { tree } = require('./tree')
const [nodeMajor, nodeMinor] = process.versions.node.split('.', 2).map(v => Number(v))
class BodyAsyncIterable {
constructor (body) {
this[kBody] = body
this[kBodyUsed] = false
}
async * [Symbol.asyncIterator] () {
assert(!this[kBodyUsed], 'disturbed')
this[kBodyUsed] = true
yield * this[kBody]
}
}
function noop () {}
/**
* @param {*} body
* @returns {*}
*/
function wrapRequestBody (body) {
if (isStream(body)) {
// TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
// so that it can be dispatched again?
// TODO (fix): Do we need 100-expect support to provide a way to do this properly?
if (bodyLength(body) === 0) {
body
.on('data', function () {
assert(false)
})
}
if (typeof body.readableDidRead !== 'boolean') {
body[kBodyUsed] = false
EE.prototype.on.call(body, 'data', function () {
this[kBodyUsed] = true
})
}
return body
} else if (body && typeof body.pipeTo === 'function') {
// TODO (fix): We can't access ReadableStream internal state
// to determine whether or not it has been disturbed. This is just
// a workaround.
return new BodyAsyncIterable(body)
} else if (
body &&
typeof body !== 'string' &&
!ArrayBuffer.isView(body) &&
isIterable(body)
) {
// TODO: Should we allow re-using iterable if !this.opts.idempotent
// or through some other flag?
return new BodyAsyncIterable(body)
} else {
return body
}
}
/**
* @param {*} obj
* @returns {obj is import('node:stream').Stream}
*/
function isStream (obj) {
return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
}
/**
* @param {*} object
* @returns {object is Blob}
* based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
*/
function isBlobLike (object) {
if (object === null) {
return false
} else if (object instanceof Blob) {
return true
} else if (typeof object !== 'object') {
return false
} else {
const sTag = object[Symbol.toStringTag]
return (sTag === 'Blob' || sTag === 'File') && (
('stream' in object && typeof object.stream === 'function') ||
('arrayBuffer' in object && typeof object.arrayBuffer === 'function')
)
}
}
/**
* @param {string} url The path to check for query strings or fragments.
* @returns {boolean} Returns true if the path contains a query string or fragment.
*/
function pathHasQueryOrFragment (url) {
return (
url.includes('?') ||
url.includes('#')
)
}
/**
* @param {string} url The URL to add the query params to
* @param {import('node:querystring').ParsedUrlQueryInput} queryParams The object to serialize into a URL query string
* @returns {string} The URL with the query params added
*/
function serializePathWithQuery (url, queryParams) {
if (pathHasQueryOrFragment(url)) {
throw new Error('Query params cannot be passed when url already contains "?" or "#".')
}
const stringified = stringify(queryParams)
if (stringified) {
url += '?' + stringified
}
return url
}
/**
* @param {number|string|undefined} port
* @returns {boolean}
*/
function isValidPort (port) {
const value = parseInt(port, 10)
return (
value === Number(port) &&
value >= 0 &&
value <= 65535
)
}
/**
* Check if the value is a valid http or https prefixed string.
*
* @param {string} value
* @returns {boolean}
*/
function isHttpOrHttpsPrefixed (value) {
return (
value != null &&
value[0] === 'h' &&
value[1] === 't' &&
value[2] === 't' &&
value[3] === 'p' &&
(
value[4] === ':' ||
(
value[4] === 's' &&
value[5] === ':'
)
)
)
}
/**
* @param {string|URL|Record<string,string>} url
* @returns {URL}
*/
function parseURL (url) {
if (typeof url === 'string') {
/**
* @type {URL}
*/
url = new URL(url)
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
}
return url
}
if (!url || typeof url !== 'object') {
throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
}
if (!(url instanceof URL)) {
if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {
throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
}
if (url.path != null && typeof url.path !== 'string') {
throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
}
if (url.pathname != null && typeof url.pathname !== 'string') {
throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
}
if (url.hostname != null && typeof url.hostname !== 'string') {
throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
}
if (url.origin != null && typeof url.origin !== 'string') {
throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
}
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
}
const port = url.port != null
? url.port
: (url.protocol === 'https:' ? 443 : 80)
let origin = url.origin != null
? url.origin
: `${url.protocol || ''}//${url.hostname || ''}:${port}`
let path = url.path != null
? url.path
: `${url.pathname || ''}${url.search || ''}`
if (origin[origin.length - 1] === '/') {
origin = origin.slice(0, origin.length - 1)
}
if (path && path[0] !== '/') {
path = `/${path}`
}
// new URL(path, origin) is unsafe when `path` contains an absolute URL
// From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
// If first parameter is a relative URL, second param is required, and will be used as the base URL.
// If first parameter is an absolute URL, a given second param will be ignored.
return new URL(`${origin}${path}`)
}
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
}
return url
}
/**
* @param {string|URL|Record<string, string>} url
* @returns {URL}
*/
function parseOrigin (url) {
url = parseURL(url)
if (url.pathname !== '/' || url.search || url.hash) {
throw new InvalidArgumentError('invalid url')
}
return url
}
/**
* @param {string} host
* @returns {string}
*/
function getHostname (host) {
if (host[0] === '[') {
const idx = host.indexOf(']')
assert(idx !== -1)
return host.substring(1, idx)
}
const idx = host.indexOf(':')
if (idx === -1) return host
return host.substring(0, idx)
}
/**
* IP addresses are not valid server names per RFC6066
* Currently, the only server names supported are DNS hostnames
* @param {string|null} host
* @returns {string|null}
*/
function getServerName (host) {
if (!host) {
return null
}
assert(typeof host === 'string')
const servername = getHostname(host)
if (net.isIP(servername)) {
return ''
}
return servername
}
/**
* @function
* @template T
* @param {T} obj
* @returns {T}
*/
function deepClone (obj) {
return JSON.parse(JSON.stringify(obj))
}
/**
* @param {*} obj
* @returns {obj is AsyncIterable}
*/
function isAsyncIterable (obj) {
return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
}
/**
* @param {*} obj
* @returns {obj is Iterable}
*/
function isIterable (obj) {
return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
}
/**
* @param {Blob|Buffer|import ('stream').Stream} body
* @returns {number|null}
*/
function bodyLength (body) {
if (body == null) {
return 0
} else if (isStream(body)) {
const state = body._readableState
return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
? state.length
: null
} else if (isBlobLike(body)) {
return body.size != null ? body.size : null
} else if (isBuffer(body)) {
return body.byteLength
}
return null
}
/**
* @param {import ('stream').Stream} body
* @returns {boolean}
*/
function isDestroyed (body) {
return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body)))
}
/**
* @param {import ('stream').Stream} stream
* @param {Error} [err]
* @returns {void}
*/
function destroy (stream, err) {
if (stream == null || !isStream(stream) || isDestroyed(stream)) {
return
}
if (typeof stream.destroy === 'function') {
if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
// See: https://github.com/nodejs/node/pull/38505/files
stream.socket = null
}
stream.destroy(err)
} else if (err) {
queueMicrotask(() => {
stream.emit('error', err)
})
}
if (stream.destroyed !== true) {
stream[kDestroyed] = true
}
}
const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
/**
* @param {string} val
* @returns {number | null}
*/
function parseKeepAliveTimeout (val) {
const m = val.match(KEEPALIVE_TIMEOUT_EXPR)
return m ? parseInt(m[1], 10) * 1000 : null
}
/**
* Retrieves a header name and returns its lowercase value.
* @param {string | Buffer} value Header name
* @returns {string}
*/
function headerNameToString (value) {
return typeof value === 'string'
? headerNameLowerCasedRecord[value] ?? value.toLowerCase()
: tree.lookup(value) ?? value.toString('latin1').toLowerCase()
}
/**
* Receive the buffer as a string and return its lowercase value.
* @param {Buffer} value Header name
* @returns {string}
*/
function bufferToLowerCasedHeaderName (value) {
return tree.lookup(value) ?? value.toString('latin1').toLowerCase()
}
/**
* @param {(Buffer | string)[]} headers
* @param {Record<string, string | string[]>} [obj]
* @returns {Record<string, string | string[]>}
*/
function parseHeaders (headers, obj) {
if (obj === undefined) obj = {}
for (let i = 0; i < headers.length; i += 2) {
const key = headerNameToString(headers[i])
let val = obj[key]
if (val) {
if (typeof val === 'string') {
val = [val]
obj[key] = val
}
val.push(headers[i + 1].toString('utf8'))
} else {
const headersValue = headers[i + 1]
if (typeof headersValue === 'string') {
obj[key] = headersValue
} else {
obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8')
}
}
}
// See https://github.com/nodejs/node/pull/46528
if ('content-length' in obj && 'content-disposition' in obj) {
obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
}
return obj
}
/**
* @param {Buffer[]} headers
* @returns {string[]}
*/
function parseRawHeaders (headers) {
const headersLength = headers.length
/**
* @type {string[]}
*/
const ret = new Array(headersLength)
let hasContentLength = false
let contentDispositionIdx = -1
let key
let val
let kLen = 0
for (let n = 0; n < headersLength; n += 2) {
key = headers[n]
val = headers[n + 1]
typeof key !== 'string' && (key = key.toString())
typeof val !== 'string' && (val = val.toString('utf8'))
kLen = key.length
if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
hasContentLength = true
} else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
contentDispositionIdx = n + 1
}
ret[n] = key
ret[n + 1] = val
}
// See https://github.com/nodejs/node/pull/46528
if (hasContentLength && contentDispositionIdx !== -1) {
ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
}
return ret
}
/**
* @param {string[]} headers
* @param {Buffer[]} headers
*/
function encodeRawHeaders (headers) {
if (!Array.isArray(headers)) {
throw new TypeError('expected headers to be an array')
}
return headers.map(x => Buffer.from(x))
}
/**
* @param {*} buffer
* @returns {buffer is Buffer}
*/
function isBuffer (buffer) {
// See, https://github.com/mcollina/undici/pull/319
return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
}
/**
* Asserts that the handler object is a request handler.
*
* @param {object} handler
* @param {string} method
* @param {string} [upgrade]
* @returns {asserts handler is import('../api/api-request').RequestHandler}
*/
function assertRequestHandler (handler, method, upgrade) {
if (!handler || typeof handler !== 'object') {
throw new InvalidArgumentError('handler must be an object')
}
if (typeof handler.onRequestStart === 'function') {
// TODO (fix): More checks...
return
}
if (typeof handler.onConnect !== 'function') {
throw new InvalidArgumentError('invalid onConnect method')
}
if (typeof handler.onError !== 'function') {
throw new InvalidArgumentError('invalid onError method')
}
if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
throw new InvalidArgumentError('invalid onBodySent method')
}
if (upgrade || method === 'CONNECT') {
if (typeof handler.onUpgrade !== 'function') {
throw new InvalidArgumentError('invalid onUpgrade method')
}
} else {
if (typeof handler.onHeaders !== 'function') {
throw new InvalidArgumentError('invalid onHeaders method')
}
if (typeof handler.onData !== 'function') {
throw new InvalidArgumentError('invalid onData method')
}
if (typeof handler.onComplete !== 'function') {
throw new InvalidArgumentError('invalid onComplete method')
}
}
}
/**
* A body is disturbed if it has been read from and it cannot be re-used without
* losing state or data.
* @param {import('node:stream').Readable} body
* @returns {boolean}
*/
function isDisturbed (body) {
// TODO (fix): Why is body[kBodyUsed] needed?
return !!(body && (stream.isDisturbed(body) || body[kBodyUsed]))
}
/**
* @typedef {object} SocketInfo
* @property {string} [localAddress]
* @property {number} [localPort]
* @property {string} [remoteAddress]
* @property {number} [remotePort]
* @property {string} [remoteFamily]
* @property {number} [timeout]
* @property {number} bytesWritten
* @property {number} bytesRead
*/
/**
* @param {import('net').Socket} socket
* @returns {SocketInfo}
*/
function getSocketInfo (socket) {
return {
localAddress: socket.localAddress,
localPort: socket.localPort,
remoteAddress: socket.remoteAddress,
remotePort: socket.remotePort,
remoteFamily: socket.remoteFamily,
timeout: socket.timeout,
bytesWritten: socket.bytesWritten,
bytesRead: socket.bytesRead
}
}
/**
* @param {Iterable} iterable
* @returns {ReadableStream}
*/
function ReadableStreamFrom (iterable) {
// We cannot use ReadableStream.from here because it does not return a byte stream.
let iterator
return new ReadableStream(
{
start () {
iterator = iterable[Symbol.asyncIterator]()
},
pull (controller) {
return iterator.next().then(({ done, value }) => {
if (done) {
return queueMicrotask(() => {
controller.close()
controller.byobRequest?.respond(0)
})
} else {
const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
if (buf.byteLength) {
return controller.enqueue(new Uint8Array(buf))
} else {
return this.pull(controller)
}
}
})
},
cancel () {
return iterator.return()
},
type: 'bytes'
}
)
}
/**
* The object should be a FormData instance and contains all the required
* methods.
* @param {*} object
* @returns {object is FormData}
*/
function isFormDataLike (object) {
return (
object &&
typeof object === 'object' &&
typeof object.append === 'function' &&
typeof object.delete === 'function' &&
typeof object.get === 'function' &&
typeof object.getAll === 'function' &&
typeof object.has === 'function' &&
typeof object.set === 'function' &&
object[Symbol.toStringTag] === 'FormData'
)
}
function addAbortListener (signal, listener) {
if ('addEventListener' in signal) {
signal.addEventListener('abort', listener, { once: true })
return () => signal.removeEventListener('abort', listener)
}
signal.once('abort', listener)
return () => signal.removeListener('abort', listener)
}
const validTokenChars = new Uint8Array([
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0-15
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16-31
0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32-47 (!"#$%&'()*+,-./)
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48-63 (0-9:;<=>?)
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64-79 (@A-O)
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80-95 (P-Z[\]^_)
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96-111 (`a-o)
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, // 112-127 (p-z{|}~)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 128-143
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 144-159
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 160-175
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 176-191
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 192-207
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 208-223
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 224-239
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 240-255
])
/**
* @see https://tools.ietf.org/html/rfc7230#section-3.2.6
* @param {number} c
* @returns {boolean}
*/
function isTokenCharCode (c) {
return (validTokenChars[c] === 1)
}
const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
/**
* @param {string} characters
* @returns {boolean}
*/
function isValidHTTPToken (characters) {
if (characters.length >= 12) return tokenRegExp.test(characters)
if (characters.length === 0) return false
for (let i = 0; i < characters.length; i++) {
if (validTokenChars[characters.charCodeAt(i)] !== 1) {
return false
}
}
return true
}
// headerCharRegex have been lifted from
// https://github.com/nodejs/node/blob/main/lib/_http_common.js
/**
* Matches if val contains an invalid field-vchar
* field-value = *( field-content / obs-fold )
* field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
* field-vchar = VCHAR / obs-text
*/
const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
/**
* @param {string} characters
* @returns {boolean}
*/
function isValidHeaderValue (characters) {
return !headerCharRegex.test(characters)
}
const rangeHeaderRegex = /^bytes (\d+)-(\d+)\/(\d+)?$/
/**
* @typedef {object} RangeHeader
* @property {number} start
* @property {number | null} end
* @property {number | null} size
*/
/**
* Parse accordingly to RFC 9110
* @see https://www.rfc-editor.org/rfc/rfc9110#field.content-range
* @param {string} [range]
* @returns {RangeHeader|null}
*/
function parseRangeHeader (range) {
if (range == null || range === '') return { start: 0, end: null, size: null }
const m = range ? range.match(rangeHeaderRegex) : null
return m
? {
start: parseInt(m[1]),
end: m[2] ? parseInt(m[2]) : null,
size: m[3] ? parseInt(m[3]) : null
}
: null
}
/**
* @template {import("events").EventEmitter} T
* @param {T} obj
* @param {string} name
* @param {(...args: any[]) => void} listener
* @returns {T}
*/
function addListener (obj, name, listener) {
const listeners = (obj[kListeners] ??= [])
listeners.push([name, listener])
obj.on(name, listener)
return obj
}
/**
* @template {import("events").EventEmitter} T
* @param {T} obj
* @returns {T}
*/
function removeAllListeners (obj) {
if (obj[kListeners] != null) {
for (const [name, listener] of obj[kListeners]) {
obj.removeListener(name, listener)
}
obj[kListeners] = null
}
return obj
}
/**
* @param {import ('../dispatcher/client')} client
* @param {import ('../core/request')} request
* @param {Error} err
*/
function errorRequest (client, request, err) {
try {
request.onError(err)
assert(request.aborted)
} catch (err) {
client.emit('error', err)
}
}
/**
* @param {WeakRef<net.Socket>} socketWeakRef
* @param {object} opts
* @param {number} opts.timeout
* @param {string} opts.hostname
* @param {number} opts.port
* @returns {() => void}
*/
const setupConnectTimeout = process.platform === 'win32'
? (socketWeakRef, opts) => {
if (!opts.timeout) {
return noop
}
let s1 = null
let s2 = null
const fastTimer = timers.setFastTimeout(() => {
// setImmediate is added to make sure that we prioritize socket error events over timeouts
s1 = setImmediate(() => {
// Windows needs an extra setImmediate probably due to implementation differences in the socket logic
s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts))
})
}, opts.timeout)
return () => {
timers.clearFastTimeout(fastTimer)
clearImmediate(s1)
clearImmediate(s2)
}
}
: (socketWeakRef, opts) => {
if (!opts.timeout) {
return noop
}
let s1 = null
const fastTimer = timers.setFastTimeout(() => {
// setImmediate is added to make sure that we prioritize socket error events over timeouts
s1 = setImmediate(() => {
onConnectTimeout(socketWeakRef.deref(), opts)
})
}, opts.timeout)
return () => {
timers.clearFastTimeout(fastTimer)
clearImmediate(s1)
}
}
/**
* @param {net.Socket} socket
* @param {object} opts
* @param {number} opts.timeout
* @param {string} opts.hostname
* @param {number} opts.port
*/
function onConnectTimeout (socket, opts) {
// The socket could be already garbage collected
if (socket == null) {
return
}
let message = 'Connect Timeout Error'
if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {
message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},`
} else {
message += ` (attempted address: ${opts.hostname}:${opts.port},`
}
message += ` timeout: ${opts.timeout}ms)`
destroy(socket, new ConnectTimeoutError(message))
}
/**
* @param {string} urlString
* @returns {string}
*/
function getProtocolFromUrlString (urlString) {
if (
urlString[0] === 'h' &&
urlString[1] === 't' &&
urlString[2] === 't' &&
urlString[3] === 'p'
) {
switch (urlString[4]) {
case ':':
return 'http:'
case 's':
if (urlString[5] === ':') {
return 'https:'
}
}
}
// fallback if none of the usual suspects
return urlString.slice(0, urlString.indexOf(':') + 1)
}
const kEnumerableProperty = Object.create(null)
kEnumerableProperty.enumerable = true
const normalizedMethodRecordsBase = {
delete: 'DELETE',
DELETE: 'DELETE',
get: 'GET',
GET: 'GET',
head: 'HEAD',
HEAD: 'HEAD',
options: 'OPTIONS',
OPTIONS: 'OPTIONS',
post: 'POST',
POST: 'POST',
put: 'PUT',
PUT: 'PUT'
}
const normalizedMethodRecords = {
...normalizedMethodRecordsBase,
patch: 'patch',
PATCH: 'PATCH'
}
// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
Object.setPrototypeOf(normalizedMethodRecordsBase, null)
Object.setPrototypeOf(normalizedMethodRecords, null)
module.exports = {
kEnumerableProperty,
isDisturbed,
isBlobLike,
parseOrigin,
parseURL,
getServerName,
isStream,
isIterable,
isAsyncIterable,
isDestroyed,
headerNameToString,
bufferToLowerCasedHeaderName,
addListener,
removeAllListeners,
errorRequest,
parseRawHeaders,
encodeRawHeaders,
parseHeaders,
parseKeepAliveTimeout,
destroy,
bodyLength,
deepClone,
ReadableStreamFrom,
isBuffer,
assertRequestHandler,
getSocketInfo,
isFormDataLike,
pathHasQueryOrFragment,
serializePathWithQuery,
addAbortListener,
isValidHTTPToken,
isValidHeaderValue,
isTokenCharCode,
parseRangeHeader,
normalizedMethodRecordsBase,
normalizedMethodRecords,
isValidPort,
isHttpOrHttpsPrefixed,
nodeMajor,
nodeMinor,
safeHTTPMethods: Object.freeze(['GET', 'HEAD', 'OPTIONS', 'TRACE']),
wrapRequestBody,
setupConnectTimeout,
getProtocolFromUrlString
}

View File

@@ -0,0 +1,126 @@
{
"name": "ajv",
"version": "8.17.1",
"description": "Another JSON Schema Validator",
"main": "dist/ajv.js",
"types": "dist/ajv.d.ts",
"files": [
"lib/",
"dist/",
".runkit_example.js"
],
"scripts": {
"eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" --ignore-pattern spec/JSON-Schema-Test-Suite",
"prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"",
"prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"",
"test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot",
"test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec",
"test-debug": "npm run test-spec -- --inspect-brk",
"test-cov": "nyc npm run test-spec",
"rollup": "rm -rf bundle && rollup -c",
"bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019 && node ./scripts/bundle.js 2020 ajv2020 ajv2020 && node ./scripts/bundle.js jtd ajvJTD ajvJTD",
"build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts && rm dist/refs/json-schema-2020-12/index.ts && rm dist/refs/jtd-schema.ts",
"json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests",
"test-karma": "karma start",
"test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start",
"test-all": "npm run test-cov && if-node-version 12 npm run test-browser",
"test": "npm run json-tests && npm run prettier:check && npm run eslint && npm link && npm link --legacy-peer-deps ajv && npm run test-cov",
"test-ci": "AJV_FULL_TEST=true npm test",
"prepublish": "npm run build",
"benchmark": "npm i && npm run build && npm link && cd ./benchmark && npm link --legacy-peer-deps ajv && npm i && node ./jtd",
"docs:dev": "./scripts/prepare-site && vuepress dev docs",
"docs:build": "./scripts/prepare-site && vuepress build docs"
},
"nyc": {
"exclude": [
"**/spec/**",
"node_modules"
],
"reporter": [
"lcov",
"text-summary"
]
},
"repository": "ajv-validator/ajv",
"keywords": [
"JSON",
"schema",
"validator",
"validation",
"jsonschema",
"json-schema",
"json-schema-validator",
"json-schema-validation"
],
"author": "Evgeny Poberezkin",
"license": "MIT",
"bugs": "https://github.com/ajv-validator/ajv/issues",
"homepage": "https://ajv.js.org",
"runkitExampleFilename": ".runkit_example.js",
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
"json-schema-traverse": "^1.0.0",
"require-from-string": "^2.0.2"
},
"devDependencies": {
"@ajv-validator/config": "^0.5.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.30",
"@types/require-from-string": "^1.2.3",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"ajv-formats": "^3.0.1",
"browserify": "^17.0.0",
"chai": "^4.4.1",
"cross-env": "^7.0.3",
"dayjs": "^1.11.10",
"dayjs-plugin-utc": "^0.1.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"glob": "^10.3.10",
"husky": "^9.0.11",
"if-node-version": "^1.1.1",
"jimp": "^0.22.10",
"js-beautify": "^1.15.1",
"json-schema-test": "^2.0.0",
"karma": "^6.4.2",
"karma-chrome-launcher": "^3.2.0",
"karma-mocha": "^2.0.1",
"lint-staged": "^15.2.2",
"mocha": "^10.3.0",
"module-from-string": "^3.3.0",
"node-fetch": "^3.3.2",
"nyc": "^15.1.0",
"prettier": "3.0.3",
"re2": "^1.20.9",
"rollup": "^2.79.1",
"rollup-plugin-terser": "^7.0.2",
"ts-node": "^10.9.2",
"tsify": "^5.0.4",
"typescript": "5.3.3",
"uri-js": "^4.4.1"
},
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/ajv"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/epoberezkin"
},
"prettier": "@ajv-validator/config/prettierrc.json",
"husky": {
"hooks": {
"pre-commit": "lint-staged && npm test"
}
},
"lint-staged": {
"*.{json,yaml,js,ts}": "prettier --write"
}
}

View File

@@ -0,0 +1,7 @@
Copyright Mateo Collina, David Mark Clements, James Sumners
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,59 @@
{
"name": "@opentelemetry/instrumentation-graphql",
"version": "0.58.0",
"description": "OpenTelemetry instrumentation for `graphql` gql query language and runtime for GraphQL",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/open-telemetry/opentelemetry-js-contrib.git",
"directory": "packages/instrumentation-graphql"
},
"scripts": {
"clean": "rimraf build/*",
"compile": "tsc -p .",
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-graphql",
"lint:readme": "node ../../scripts/lint-readme.js",
"prepublishOnly": "npm run compile",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "nyc --no-clean mocha 'test/**/*.test.ts'",
"test-all-versions": "tav",
"version:update": "node ../../scripts/version-update.js",
"watch": "tsc -w"
},
"keywords": [
"graphql",
"metrics",
"nodejs",
"opentelemetry",
"stats",
"tracing"
],
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": "^18.19.0 || >=20.6.0"
},
"files": [
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts"
],
"publishConfig": {
"access": "public"
},
"peerDependencies": {
"@opentelemetry/api": "^1.3.0"
},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/sdk-trace-base": "^2.0.0",
"@opentelemetry/semantic-conventions": "^1.27.0",
"graphql": "^16.5.0"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.211.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-graphql#readme",
"gitHead": "7a5f3c0a09b6a2d32c712b2962b95137c906a016"
}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/pg-core/columns/date.common.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnDataType } from '~/column-builder.ts';\nimport { entityKind } from '~/entity.ts';\nimport { sql } from '~/sql/sql.ts';\nimport { PgColumnBuilder } from './common.ts';\n\nexport abstract class PgDateColumnBaseBuilder<\n\tT extends ColumnBuilderBaseConfig<ColumnDataType, string>,\n\tTRuntimeConfig extends object = object,\n> extends PgColumnBuilder<T, TRuntimeConfig> {\n\tstatic override readonly [entityKind]: string = 'PgDateColumnBaseBuilder';\n\n\tdefaultNow() {\n\t\treturn this.default(sql`now()`);\n\t}\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAC3B,SAAS,WAAW;AACpB,SAAS,uBAAuB;AAEzB,MAAe,gCAGZ,gBAAmC;AAAA,EAC5C,QAA0B,UAAU,IAAY;AAAA,EAEhD,aAAa;AACZ,WAAO,KAAK,QAAQ,UAAU;AAAA,EAC/B;AACD;","names":[]}

View File

@@ -0,0 +1,18 @@
import { alpha } from '../../../value/types/numbers/index.mjs';
import { px } from '../../../value/types/numbers/units.mjs';
import { browserNumberValueTypes } from './number-browser.mjs';
import { transformValueTypes } from './transform.mjs';
import { int } from './type-int.mjs';
const numberValueTypes = {
...browserNumberValueTypes,
...transformValueTypes,
zIndex: int,
size: px,
// SVG
fillOpacity: alpha,
strokeOpacity: alpha,
numOctaves: int,
};
export { numberValueTypes };

View File

@@ -0,0 +1 @@
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/views/Account/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAI5D,eAAO,MAAM,2BAA2B,EAAE,oBAOtC,CAAA"}

View File

@@ -0,0 +1,148 @@
Prism.languages.swift = {
'comment': {
// Nested comments are supported up to 2 levels
pattern: /(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,
lookbehind: true,
greedy: true
},
'string-literal': [
// https://docs.swift.org/swift-book/LanguageGuide/StringsAndCharacters.html
{
pattern: RegExp(
/(^|[^"#])/.source
+ '(?:'
// single-line string
+ /"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source
+ '|'
// multi-line string
+ /"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source
+ ')'
+ /(?!["#])/.source
),
lookbehind: true,
greedy: true,
inside: {
'interpolation': {
pattern: /(\\\()(?:[^()]|\([^()]*\))*(?=\))/,
lookbehind: true,
inside: null // see below
},
'interpolation-punctuation': {
pattern: /^\)|\\\($/,
alias: 'punctuation'
},
'punctuation': /\\(?=[\r\n])/,
'string': /[\s\S]+/
}
},
{
pattern: RegExp(
/(^|[^"#])(#+)/.source
+ '(?:'
// single-line string
+ /"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source
+ '|'
// multi-line string
+ /"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source
+ ')'
+ '\\2'
),
lookbehind: true,
greedy: true,
inside: {
'interpolation': {
pattern: /(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,
lookbehind: true,
inside: null // see below
},
'interpolation-punctuation': {
pattern: /^\)|\\#+\($/,
alias: 'punctuation'
},
'string': /[\s\S]+/
}
},
],
'directive': {
// directives with conditions
pattern: RegExp(
/#/.source
+ '(?:'
+ (
/(?:elseif|if)\b/.source
+ '(?:[ \t]*'
// This regex is a little complex. It's equivalent to this:
// (?:![ \t]*)?(?:\b\w+\b(?:[ \t]*<round>)?|<round>)(?:[ \t]*(?:&&|\|\|))?
// where <round> is a general parentheses expression.
+ /(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source
+ ')+'
)
+ '|'
+ /(?:else|endif)\b/.source
+ ')'
),
alias: 'property',
inside: {
'directive-name': /^#\w+/,
'boolean': /\b(?:false|true)\b/,
'number': /\b\d+(?:\.\d+)*\b/,
'operator': /!|&&|\|\||[<>]=?/,
'punctuation': /[(),]/
}
},
'literal': {
pattern: /#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,
alias: 'constant'
},
'other-directive': {
pattern: /#\w+\b/,
alias: 'property'
},
'attribute': {
pattern: /@\w+/,
alias: 'atrule'
},
'function-definition': {
pattern: /(\bfunc\s+)\w+/,
lookbehind: true,
alias: 'function'
},
'label': {
// https://docs.swift.org/swift-book/LanguageGuide/ControlFlow.html#ID141
pattern: /\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,
lookbehind: true,
alias: 'important'
},
'keyword': /\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,
'boolean': /\b(?:false|true)\b/,
'nil': {
pattern: /\bnil\b/,
alias: 'constant'
},
'short-argument': /\$\d+\b/,
'omit': {
pattern: /\b_\b/,
alias: 'keyword'
},
'number': /\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,
// A class name must start with an upper-case letter and be either 1 letter long or contain a lower-case letter.
'class-name': /\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,
'function': /\b[a-z_]\w*(?=\s*\()/i,
'constant': /\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,
// Operators are generic in Swift. Developers can even create new operators (e.g. +++).
// https://docs.swift.org/swift-book/ReferenceManual/zzSummaryOfTheGrammar.html#ID481
// This regex only supports ASCII operators.
'operator': /[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,
'punctuation': /[{}[\]();,.:\\]/
};
Prism.languages.swift['string-literal'].forEach(function (rule) {
rule.inside['interpolation'].inside = Prism.languages.swift;
});

View File

@@ -0,0 +1,43 @@
/*!
Copyright 2013 Lovell Fuller and others.
SPDX-License-Identifier: Apache-2.0
*/
#include <mutex>
#include <napi.h>
#include <vips/vips8>
#include "./common.h"
#include "./metadata.h"
#include "./pipeline.h"
#include "./stats.h"
#include "./utilities.h"
Napi::Object init(Napi::Env env, Napi::Object exports) {
static std::once_flag sharp_vips_init_once;
std::call_once(sharp_vips_init_once, []() {
vips_init("sharp");
});
g_log_set_handler("VIPS", static_cast<GLogLevelFlags>(G_LOG_LEVEL_WARNING),
static_cast<GLogFunc>(sharp::VipsWarningCallback), nullptr);
// Methods available to JavaScript
exports.Set("metadata", Napi::Function::New(env, metadata));
exports.Set("pipeline", Napi::Function::New(env, pipeline));
exports.Set("cache", Napi::Function::New(env, cache));
exports.Set("concurrency", Napi::Function::New(env, concurrency));
exports.Set("counters", Napi::Function::New(env, counters));
exports.Set("simd", Napi::Function::New(env, simd));
exports.Set("libvipsVersion", Napi::Function::New(env, libvipsVersion));
exports.Set("format", Napi::Function::New(env, format));
exports.Set("block", Napi::Function::New(env, block));
exports.Set("_maxColourDistance", Napi::Function::New(env, _maxColourDistance));
exports.Set("_isUsingJemalloc", Napi::Function::New(env, _isUsingJemalloc));
exports.Set("_isUsingX64V2", Napi::Function::New(env, _isUsingX64V2));
exports.Set("stats", Napi::Function::New(env, stats));
return exports;
}
NODE_API_MODULE(sharp, init)

View File

@@ -0,0 +1 @@
{"version":3,"names":["_index","require","_removeTypeDuplicates","createFlowUnionType","types","flattened","removeTypeDuplicates","length","unionTypeAnnotation"],"sources":["../../../src/builders/flow/createFlowUnionType.ts"],"sourcesContent":["import { unionTypeAnnotation } from \"../generated/index.ts\";\nimport removeTypeDuplicates from \"../../modifications/flow/removeTypeDuplicates.ts\";\nimport type * as t from \"../../index.ts\";\n\n/**\n * Takes an array of `types` and flattens them, removing duplicates and\n * returns a `UnionTypeAnnotation` node containing them.\n */\nexport default function createFlowUnionType<T extends t.FlowType>(\n types: [T] | T[],\n): T | t.UnionTypeAnnotation {\n const flattened = removeTypeDuplicates(types);\n\n if (flattened.length === 1) {\n return flattened[0] as T;\n } else {\n return unionTypeAnnotation(flattened);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAOe,SAASE,mBAAmBA,CACzCC,KAAgB,EACW;EAC3B,MAAMC,SAAS,GAAG,IAAAC,6BAAoB,EAACF,KAAK,CAAC;EAE7C,IAAIC,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAOF,SAAS,CAAC,CAAC,CAAC;EACrB,CAAC,MAAM;IACL,OAAO,IAAAG,0BAAmB,EAACH,SAAS,CAAC;EACvC;AACF","ignoreList":[]}

View File

@@ -0,0 +1,9 @@
/**
* 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 { LexicalEditor } from 'lexical';
export declare function registerDragonSupport(editor: LexicalEditor): () => void;

View File

@@ -0,0 +1,17 @@
import { Client } from '@sentry/core';
import { WebVitalReportEvent } from './utils';
/**
* Starts tracking the Largest Contentful Paint on the current page and collects the value once
*
* - the page visibility is hidden
* - a navigation span is started (to stop LCP measurement for SPA soft navigations)
*
* Once either of these events triggers, the LCP value is sent as a standalone span and we stop
* measuring LCP for subsequent routes.
*/
export declare function trackLcpAsStandaloneSpan(client: Client): void;
/**
* Exported only for testing!
*/
export declare function _sendStandaloneLcpSpan(lcpValue: number, entry: LargestContentfulPaint | undefined, pageloadSpanId: string, reportEvent: WebVitalReportEvent): void;
//# sourceMappingURL=lcp.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/transports/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,WAAW,uBAAwB,SAAQ,oBAAoB;IACnE,4DAA4D;IAC5D,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B"}

View File

@@ -0,0 +1,51 @@
{
"name": "safe-buffer",
"description": "Safer Node.js Buffer API",
"version": "5.2.1",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
"url": "https://feross.org"
},
"bugs": {
"url": "https://github.com/feross/safe-buffer/issues"
},
"devDependencies": {
"standard": "*",
"tape": "^5.0.0"
},
"homepage": "https://github.com/feross/safe-buffer",
"keywords": [
"buffer",
"buffer allocate",
"node security",
"safe",
"safe-buffer",
"security",
"uninitialized"
],
"license": "MIT",
"main": "index.js",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "git://github.com/feross/safe-buffer.git"
},
"scripts": {
"test": "standard && tape test/*.js"
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9saWIvbWFyay13cml0YWJsZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgV3JpdGFibGUgfSBmcm9tIFwiLi4vd3JpdGFibGVcIjtcbmltcG9ydCB7IFdyaXRhYmxlS2V5cyB9IGZyb20gXCIuLi93cml0YWJsZS1rZXlzXCI7XG5cbmV4cG9ydCB0eXBlIE1hcmtXcml0YWJsZTxUeXBlLCBLZXlzIGV4dGVuZHMga2V5b2YgVHlwZT4gPSBUeXBlIGV4dGVuZHMgVHlwZVxuICA/IFJlYWRvbmx5PFR5cGU+ICYgV3JpdGFibGU8UGljazxUeXBlLCAoVHlwZSBleHRlbmRzIG9iamVjdCA/IFdyaXRhYmxlS2V5czxUeXBlPiA6IG5ldmVyKSB8IEtleXM+PlxuICA6IG5ldmVyO1xuIl19

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/elements/StepNav/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,aAAa,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,WAAW,CAAA;IACtD,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,IAAI,CAAA;IAC1C,OAAO,EAAE,WAAW,EAAE,CAAA;CACvB,CAAA"}

View File

@@ -0,0 +1,4 @@
var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
export default {
randomUUID
};

View File

@@ -0,0 +1,22 @@
/** Supported Sentry transport protocols in a Dsn. */
export type DsnProtocol = 'http' | 'https';
/** Primitive components of a Dsn. */
export interface DsnComponents {
/** Protocol used to connect to Sentry. */
protocol: DsnProtocol;
/** Public authorization key. */
publicKey?: string;
/** Private authorization key (deprecated, optional). */
pass?: string;
/** Hostname of the Sentry instance. */
host: string;
/** Port of the Sentry instance. */
port?: string;
/** Sub path/ */
path?: string;
/** Project ID */
projectId: string;
}
/** Anything that can be parsed into a Dsn. */
export type DsnLike = string | DsnComponents;
//# sourceMappingURL=dsn.d.ts.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"2":"C L M G N O P Q H R S T","322":"0 1 2 3 4 5 6 7 8 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","450":"U V W X Y"},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:{"2":"9 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","194":"KC LC MC NC Q H R S T","322":"0 1 2 3 4 5 6 7 8 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","450":"U"},E:{"2":"J bB K D E F A B C L M G 6C bC 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"},F:{"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 JD KD LD MD PC xC ND QC","194":"7B 8B 9B AC BC CC DC EC FC GC HC","322":"0 1 2 3 4 5 6 7 8 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"},G:{"2":"E bC 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"},H:{"2":"mD"},I:{"2":"VC J I nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"2":"A B C H PC xC QC"},L:{"450":"I"},M:{"2":"OC"},N:{"2":"A B"},O:{"2":"RC"},P:{"2":"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:{"2":"4D"},R:{"2":"5D"},S:{"2":"6D 7D"}},B:7,C:"Portals",D:true};

View File

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

View File

@@ -0,0 +1,26 @@
"use strict";
exports.ExtendedYearParser = void 0;
var _Parser = require("../Parser.cjs");
var _utils = require("../utils.cjs");
class ExtendedYearParser extends _Parser.Parser {
priority = 130;
parse(dateString, token) {
if (token === "u") {
return (0, _utils.parseNDigitsSigned)(4, dateString);
}
return (0, _utils.parseNDigitsSigned)(token.length, dateString);
}
set(date, _flags, value) {
date.setFullYear(value, 0, 1);
date.setHours(0, 0, 0, 0);
return date;
}
incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
}
exports.ExtendedYearParser = ExtendedYearParser;

View File

@@ -0,0 +1,5 @@
export { DocumentHeader } from '../elements/DocumentHeader/index.js';
export { Logo } from '../elements/Logo/index.js';
export { DefaultNav } from '../elements/Nav/index.js';
export { CollectionCards, FolderField, FolderTableCell } from '@payloadcms/ui/rsc';
//# sourceMappingURL=rsc.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"baggage-impl.js","sourceRoot":"","sources":["../../../../src/baggage/internal/baggage-impl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,OAAO,WAAW;IAGtB,YAAY,OAAmC;QAC7C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;IACzD,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,aAAa;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,QAAQ,CAAC,GAAW,EAAE,KAAmB;QACvC,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACpC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,WAAW,CAAC,GAAW;QACrB,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,aAAa,CAAC,GAAG,IAAc;QAC7B,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACjC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,KAAK;QACH,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;CACF","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 type { Baggage, BaggageEntry } from '../types';\n\nexport class BaggageImpl implements Baggage {\n private _entries: Map<string, BaggageEntry>;\n\n constructor(entries?: Map<string, BaggageEntry>) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n\n getEntry(key: string): BaggageEntry | undefined {\n const entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n\n return Object.assign({}, entry);\n }\n\n getAllEntries(): [string, BaggageEntry][] {\n return Array.from(this._entries.entries()).map(([k, v]) => [k, v]);\n }\n\n setEntry(key: string, entry: BaggageEntry): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n }\n\n removeEntry(key: string): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n }\n\n removeEntries(...keys: string[]): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n for (const key of keys) {\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n }\n\n clear(): BaggageImpl {\n return new BaggageImpl();\n }\n}\n"]}

View File

@@ -0,0 +1,264 @@
'use strict';
const color = require('kleur');
const Prompt = require('./prompt');
const { erase, cursor } = require('sisteransi');
const { style, clear, figures, wrap, entriesToDisplay } = require('../util');
const getVal = (arr, i) => arr[i] && (arr[i].value || arr[i].title || arr[i]);
const getTitle = (arr, i) => arr[i] && (arr[i].title || arr[i].value || arr[i]);
const getIndex = (arr, valOrTitle) => {
const index = arr.findIndex(el => el.value === valOrTitle || el.title === valOrTitle);
return index > -1 ? index : undefined;
};
/**
* TextPrompt Base Element
* @param {Object} opts Options
* @param {String} opts.message Message
* @param {Array} opts.choices Array of auto-complete choices objects
* @param {Function} [opts.suggest] Filter function. Defaults to sort by title
* @param {Number} [opts.limit=10] Max number of results to show
* @param {Number} [opts.cursor=0] Cursor start position
* @param {String} [opts.style='default'] Render style
* @param {String} [opts.fallback] Fallback message - initial to default value
* @param {String} [opts.initial] Index of the default value
* @param {Boolean} [opts.clearFirst] The first ESCAPE keypress will clear the input
* @param {Stream} [opts.stdin] The Readable stream to listen to
* @param {Stream} [opts.stdout] The Writable stream to write readline data to
* @param {String} [opts.noMatches] The no matches found label
*/
class AutocompletePrompt extends Prompt {
constructor(opts={}) {
super(opts);
this.msg = opts.message;
this.suggest = opts.suggest;
this.choices = opts.choices;
this.initial = typeof opts.initial === 'number'
? opts.initial
: getIndex(opts.choices, opts.initial);
this.select = this.initial || opts.cursor || 0;
this.i18n = { noMatches: opts.noMatches || 'no matches found' };
this.fallback = opts.fallback || this.initial;
this.clearFirst = opts.clearFirst || false;
this.suggestions = [];
this.input = '';
this.limit = opts.limit || 10;
this.cursor = 0;
this.transform = style.render(opts.style);
this.scale = this.transform.scale;
this.render = this.render.bind(this);
this.complete = this.complete.bind(this);
this.clear = clear('', this.out.columns);
this.complete(this.render);
this.render();
}
set fallback(fb) {
this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb;
}
get fallback() {
let choice;
if (typeof this._fb === 'number')
choice = this.choices[this._fb];
else if (typeof this._fb === 'string')
choice = { title: this._fb };
return choice || this._fb || { title: this.i18n.noMatches };
}
moveSelect(i) {
this.select = i;
if (this.suggestions.length > 0)
this.value = getVal(this.suggestions, i);
else this.value = this.fallback.value;
this.fire();
}
async complete(cb) {
const p = (this.completing = this.suggest(this.input, this.choices));
const suggestions = await p;
if (this.completing !== p) return;
this.suggestions = suggestions
.map((s, i, arr) => ({ title: getTitle(arr, i), value: getVal(arr, i), description: s.description }));
this.completing = false;
const l = Math.max(suggestions.length - 1, 0);
this.moveSelect(Math.min(l, this.select));
cb && cb();
}
reset() {
this.input = '';
this.complete(() => {
this.moveSelect(this.initial !== void 0 ? this.initial : 0);
this.render();
});
this.render();
}
exit() {
if (this.clearFirst && this.input.length > 0) {
this.reset();
} else {
this.done = this.exited = true;
this.aborted = false;
this.fire();
this.render();
this.out.write('\n');
this.close();
}
}
abort() {
this.done = this.aborted = true;
this.exited = false;
this.fire();
this.render();
this.out.write('\n');
this.close();
}
submit() {
this.done = true;
this.aborted = this.exited = false;
this.fire();
this.render();
this.out.write('\n');
this.close();
}
_(c, key) {
let s1 = this.input.slice(0, this.cursor);
let s2 = this.input.slice(this.cursor);
this.input = `${s1}${c}${s2}`;
this.cursor = s1.length+1;
this.complete(this.render);
this.render();
}
delete() {
if (this.cursor === 0) return this.bell();
let s1 = this.input.slice(0, this.cursor-1);
let s2 = this.input.slice(this.cursor);
this.input = `${s1}${s2}`;
this.complete(this.render);
this.cursor = this.cursor-1;
this.render();
}
deleteForward() {
if(this.cursor*this.scale >= this.rendered.length) return this.bell();
let s1 = this.input.slice(0, this.cursor);
let s2 = this.input.slice(this.cursor+1);
this.input = `${s1}${s2}`;
this.complete(this.render);
this.render();
}
first() {
this.moveSelect(0);
this.render();
}
last() {
this.moveSelect(this.suggestions.length - 1);
this.render();
}
up() {
if (this.select === 0) {
this.moveSelect(this.suggestions.length - 1);
} else {
this.moveSelect(this.select - 1);
}
this.render();
}
down() {
if (this.select === this.suggestions.length - 1) {
this.moveSelect(0);
} else {
this.moveSelect(this.select + 1);
}
this.render();
}
next() {
if (this.select === this.suggestions.length - 1) {
this.moveSelect(0);
} else this.moveSelect(this.select + 1);
this.render();
}
nextPage() {
this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1));
this.render();
}
prevPage() {
this.moveSelect(Math.max(this.select - this.limit, 0));
this.render();
}
left() {
if (this.cursor <= 0) return this.bell();
this.cursor = this.cursor-1;
this.render();
}
right() {
if (this.cursor*this.scale >= this.rendered.length) return this.bell();
this.cursor = this.cursor+1;
this.render();
}
renderOption(v, hovered, isStart, isEnd) {
let desc;
let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : ' ';
let title = hovered ? color.cyan().underline(v.title) : v.title;
prefix = (hovered ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;
if (v.description) {
desc = ` - ${v.description}`;
if (prefix.length + title.length + desc.length >= this.out.columns
|| v.description.split(/\r?\n/).length > 1) {
desc = '\n' + wrap(v.description, { margin: 3, width: this.out.columns })
}
}
return prefix + ' ' + title + color.gray(desc || '');
}
render() {
if (this.closed) return;
if (this.firstRender) this.out.write(cursor.hide);
else this.out.write(clear(this.outputText, this.out.columns));
super.render();
let { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit);
this.outputText = [
style.symbol(this.done, this.aborted, this.exited),
color.bold(this.msg),
style.delimiter(this.completing),
this.done && this.suggestions[this.select]
? this.suggestions[this.select].title
: this.rendered = this.transform.render(this.input)
].join(' ');
if (!this.done) {
const suggestions = this.suggestions
.slice(startIndex, endIndex)
.map((item, i) => this.renderOption(item,
this.select === i + startIndex,
i === 0 && startIndex > 0,
i + startIndex === endIndex - 1 && endIndex < this.choices.length))
.join('\n');
this.outputText += `\n` + (suggestions || color.gray(this.fallback.title));
}
this.out.write(erase.line + cursor.to(0) + this.outputText);
}
}
module.exports = AutocompletePrompt;

View File

@@ -0,0 +1,17 @@
/**
* @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 AlignVerticalJustifyCenter = createLucideIcon("AlignVerticalJustifyCenter", [
["rect", { width: "14", height: "6", x: "5", y: "16", rx: "2", key: "1i8z2d" }],
["rect", { width: "10", height: "6", x: "7", y: "2", rx: "2", key: "ypihtt" }],
["path", { d: "M2 12h20", key: "9i4pu4" }]
]);
export { AlignVerticalJustifyCenter as default };
//# sourceMappingURL=align-vertical-justify-center.js.map

View File

@@ -0,0 +1,4 @@
function _instanceof(n, e) {
return null != e && "undefined" != typeof Symbol && e[Symbol.hasInstance] ? !!e[Symbol.hasInstance](n) : n instanceof e;
}
module.exports = _instanceof, module.exports.__esModule = true, module.exports["default"] = module.exports;

View File

@@ -0,0 +1,24 @@
var bench = require('fastbench')
var utilFormat = require('util').format
var quickFormat = require('./')
var run = bench([
function util(cb) {
utilFormat('%s %j %d', 'a', {a: {x: 1}}, 1)
setImmediate(cb)
},
function quick(cb) {
quickFormat('%s %j %d', 'a', [{a: {x: 1}}, 1], null)
setImmediate(cb)
},
function utilWithTailObj(cb) {
utilFormat('hello %s %j %d', 'world', {obj: true}, 4, {another: 'obj'})
setImmediate(cb)
},
function quickWithTailObj(cb) {
quickFormat('hello %s %j %d', 'world', [{obj: true}, 4, {another: 'obj'}], null)
setImmediate(cb)
}
], 100000)
run(run)

View File

@@ -0,0 +1,28 @@
"use strict";
exports.getHours = getHours;
var _index = require("./toDate.js");
/**
* @name getHours
* @category Hour Helpers
* @summary Get the hours of the given date.
*
* @description
* Get the hours of the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
*
* @returns The hours
*
* @example
* // Get the hours of 29 February 2012 11:45:00:
* const result = getHours(new Date(2012, 1, 29, 11, 45))
* //=> 11
*/
function getHours(date) {
const _date = (0, _index.toDate)(date);
const hours = _date.getHours();
return hours;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","getTranslation","React","useConfig","useTranslation","BlocksCell","t0","$","cellData","field","t1","blockReferences","blocks","labels","i18n","config","selectedBlocks","Array","isArray","map","_temp","translatedBlockLabels","b","block","blocksMap","slug","label","singular","plural","formatBlockList","blocks_0","b_0","filtered","filter","f","join","length","more","t","count","items","slice","t2","_jsx","children","blockType"],"sources":["../../../../../../src/elements/Table/DefaultCell/fields/Blocks/index.tsx"],"sourcesContent":["'use client'\nimport type { BlocksFieldClient, DefaultCellComponentProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport { useConfig } from '../../../../../providers/Config/index.js'\nimport { useTranslation } from '../../../../../providers/Translation/index.js'\n\nexport interface BlocksCellProps extends DefaultCellComponentProps<BlocksFieldClient> {}\n\nexport const BlocksCell: React.FC<BlocksCellProps> = ({\n cellData,\n field: { blockReferences, blocks, labels },\n}) => {\n const { i18n } = useTranslation()\n const { config } = useConfig()\n\n const selectedBlocks = Array.isArray(cellData) ? cellData.map(({ blockType }) => blockType) : []\n\n const translatedBlockLabels = (blockReferences ?? blocks)?.map((b) => {\n const block = typeof b === 'string' ? config.blocksMap[b] : b\n return {\n slug: block.slug,\n label: getTranslation(block.labels.singular, i18n),\n }\n })\n\n let label = `0 ${getTranslation(labels?.plural, i18n)}`\n\n const formatBlockList = (blocks) =>\n blocks\n .map((b) => {\n const filtered = translatedBlockLabels.filter((f) => f.slug === b)?.[0]\n return filtered?.label\n })\n .join(', ')\n\n const itemsToShow = 5\n\n if (selectedBlocks.length > itemsToShow) {\n const more = selectedBlocks.length - itemsToShow\n label = `${selectedBlocks.length} ${getTranslation(labels?.plural, i18n)} - ${i18n.t(\n 'fields:itemsAndMore',\n { count: more, items: formatBlockList(selectedBlocks.slice(0, itemsToShow)) },\n )}`\n } else if (selectedBlocks.length > 0) {\n label = `${selectedBlocks.length} ${getTranslation(\n selectedBlocks.length === 1 ? labels?.singular : labels?.plural,\n i18n,\n )} - ${formatBlockList(selectedBlocks)}`\n }\n\n return <span>{label}</span>\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAElB,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAI/B,OAAO,MAAMC,UAAA,GAAwCC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAC;IAAAQ,QAAA;IAAAC,KAAA,EAAAC;EAAA,IAAAJ,EAGrD;EADQ;IAAAK,eAAA;IAAAC,MAAA;IAAAC;EAAA,IAAAH,EAAmC;EAE1C;IAAAI;EAAA,IAAiBV,cAAA;EACjB;IAAAW;EAAA,IAAmBZ,SAAA;EAEnB,MAAAa,cAAA,GAAuBC,KAAA,CAAAC,OAAA,CAAcV,QAAA,IAAYA,QAAA,CAAAW,GAAA,CAAAC,KAAgC,MAAe;EAEhG,MAAAC,qBAAA,IAA+BV,eAAA,IAAmBC,MAAK,GAAAO,GAAA,CAAAG,CAAA;IACrD,MAAAC,KAAA,GAAc,OAAOD,CAAA,KAAM,WAAWP,MAAA,CAAAS,SAAA,CAAiBF,CAAA,IAAKA,CAAA;IAAA;MAAAG,IAAA,EAEpDF,KAAA,CAAAE,IAAA;MAAAC,KAAA,EACCzB,cAAA,CAAesB,KAAA,CAAAV,MAAA,CAAAc,QAAA,EAAuBb,IAAA;IAAA;EAAA;EAIjD,IAAAY,KAAA,GAAY,KAAKzB,cAAA,CAAeY,MAAA,EAAAe,MAAA,EAAgBd,IAAA,GAAO;EAEvD,MAAAe,eAAA,GAAAC,QAAA,IACElB,QAAA,CAAAO,GAAA,CAAAY,GAAA;IAEI,MAAAC,QAAA,GAAiBX,qBAAA,CAAAY,MAAA,CAAAC,CAAA,IAAoCA,CAAA,CAAAT,IAAA,KAAWH,GAAA;IAAO,OAChEU,QAAA,EAAAN,KAAA;EAAA,CACT,EAAAS,IAAA,CACM;EAAA,IAINnB,cAAA,CAAAoB,MAAA,IAAwB;IAC1B,MAAAC,IAAA,GAAarB,cAAA,CAAAoB,MAAA,IAAwB;IACrCV,KAAA,CAAAA,CAAA,CAAQA,GAAGV,cAAA,CAAAoB,MAAA,IAAyBnC,cAAA,CAAeY,MAAA,EAAAe,MAAA,EAAgBd,IAAA,OAAWA,IAAA,CAAAwB,CAAA,CAC5E;MAAAC,KAAA,EACSF,IAAA;MAAAG,KAAA,EAAaX,eAAA,CAAgBb,cAAA,CAAAyB,KAAA,KAAwB;IAAA,CAAc,GAC3E;EAHH;IAAA,IAISzB,cAAA,CAAAoB,MAAA,IAAwB;MACjCV,KAAA,CAAAA,CAAA,CAAQA,GAAGV,cAAA,CAAAoB,MAAA,IAAyBnC,cAAA,CAClCe,cAAA,CAAAoB,MAAA,MAA0B,GAAIvB,MAAA,EAAAc,QAAA,GAAmBd,MAAA,EAAAe,MAAQ,EACzDd,IAAA,OACKe,eAAA,CAAgBb,cAAA,GAAiB;IAHxC;EAAA;EAAA,IAAA0B,EAAA;EAAA,IAAAnC,CAAA,QAAAmB,KAAA;IAMKgB,EAAA,GAAAC,IAAA,CAAC;MAAAC,QAAA,EAAMlB;IAAA,C;;;;;;SAAPgB,E;CACT;AA3CqD,SAAAtB,MAAAd,EAAA;EAOY;IAAAuC;EAAA,IAAAvC,EAAa;EAAA,OAAKuC,SAAA;AAAA","ignoreList":[]}

View File

@@ -0,0 +1,14 @@
'use strict'
const { doesNotThrow, test } = require('tap')
const proxyquire = require('proxyquire')
test('pino.transport resolves targets in REPL', async ({ same }) => {
// Arrange
const transport = proxyquire('../../lib/transport', {
'./caller': () => ['node:repl']
})
// Act / Assert
doesNotThrow(() => transport({ target: 'pino-pretty' }))
})

View File

@@ -0,0 +1,11 @@
import type { DocumentTabConfig, SanitizedCollectionConfig, SanitizedGlobalConfig } from 'payload';
export declare const documentViewKeys: string[];
export type DocumentViewKey = (typeof documentViewKeys)[number];
export declare const getTabs: ({ collectionConfig, globalConfig, }: {
collectionConfig?: SanitizedCollectionConfig;
globalConfig?: SanitizedGlobalConfig;
}) => {
tab: DocumentTabConfig;
viewPath: string;
}[];
//# sourceMappingURL=index.d.ts.map

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 ArrowDownWideNarrow = createLucideIcon("ArrowDownWideNarrow", [
["path", { d: "m3 16 4 4 4-4", key: "1co6wj" }],
["path", { d: "M7 20V4", key: "1yoxec" }],
["path", { d: "M11 4h10", key: "1w87gc" }],
["path", { d: "M11 8h7", key: "djye34" }],
["path", { d: "M11 12h4", key: "q8tih4" }]
]);
export { ArrowDownWideNarrow as default };
//# sourceMappingURL=arrow-down-wide-narrow.js.map

View File

@@ -0,0 +1,14 @@
export type InstrumentHandlerType = 'console' | 'dom' | 'fetch' | 'fetch-body-resolved' | 'history' | 'xhr' | 'error' | 'unhandledrejection';
export type InstrumentHandlerCallback = (data: any) => void;
/** Add a handler function. */
export declare function addHandler(type: InstrumentHandlerType, handler: InstrumentHandlerCallback): void;
/**
* Reset all instrumentation handlers.
* This can be used by tests to ensure we have a clean slate of instrumentation handlers.
*/
export declare function resetInstrumentationHandlers(): void;
/** Maybe run an instrumentation function, unless it was already called. */
export declare function maybeInstrument(type: InstrumentHandlerType, instrumentFn: () => void): void;
/** Trigger handlers for a given instrumentation type. */
export declare function triggerHandlers(type: InstrumentHandlerType, data: unknown): void;
//# sourceMappingURL=handlers.d.ts.map

View File

@@ -0,0 +1,103 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';
var link = require('@lexical/link');
var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
var utils = require('@lexical/utils');
var lexical = require('lexical');
var react = require('react');
/**
* 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.
*
*/
function findMatchingDOM(startNode, predicate) {
let node = startNode;
while (node != null) {
if (predicate(node)) {
return node;
}
node = node.parentNode;
}
return null;
}
function ClickableLinkPlugin({
newTab = true,
disabled = false
}) {
const [editor] = LexicalComposerContext.useLexicalComposerContext();
react.useEffect(() => {
const onClick = event => {
const target = event.target;
if (!lexical.isDOMNode(target)) {
return;
}
const nearestEditor = lexical.getNearestEditorFromDOMNode(target);
if (nearestEditor === null) {
return;
}
let url = null;
let urlTarget = null;
nearestEditor.update(() => {
const clickedNode = lexical.$getNearestNodeFromDOMNode(target);
if (clickedNode !== null) {
const maybeLinkNode = utils.$findMatchingParent(clickedNode, lexical.$isElementNode);
if (!disabled) {
if (link.$isLinkNode(maybeLinkNode)) {
url = maybeLinkNode.sanitizeUrl(maybeLinkNode.getURL());
urlTarget = maybeLinkNode.getTarget();
} else {
const a = findMatchingDOM(target, utils.isHTMLAnchorElement);
if (a !== null) {
url = a.href;
urlTarget = a.target;
}
}
}
}
});
if (url === null || url === '') {
return;
}
// Allow user to select link text without following url
const selection = editor.getEditorState().read(lexical.$getSelection);
if (lexical.$isRangeSelection(selection) && !selection.isCollapsed()) {
event.preventDefault();
return;
}
const isMiddle = event.type === 'auxclick' && event.button === 1;
window.open(url, newTab || isMiddle || event.metaKey || event.ctrlKey || urlTarget === '_blank' ? '_blank' : '_self');
event.preventDefault();
};
const onMouseUp = event => {
if (event.button === 1) {
onClick(event);
}
};
return editor.registerRootListener((rootElement, prevRootElement) => {
if (prevRootElement !== null) {
prevRootElement.removeEventListener('click', onClick);
prevRootElement.removeEventListener('mouseup', onMouseUp);
}
if (rootElement !== null) {
rootElement.addEventListener('click', onClick);
rootElement.addEventListener('mouseup', onMouseUp);
}
});
}, [editor, newTab, disabled]);
return null;
}
exports.ClickableLinkPlugin = ClickableLinkPlugin;

View File

@@ -0,0 +1 @@
!function(e){e.languages.pure={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0},/#!.+/],"inline-lang":{pattern:/%<[\s\S]+?%>/,greedy:!0,inside:{lang:{pattern:/(^%< *)-\*-.+?-\*-/,lookbehind:!0,alias:"comment"},delimiter:{pattern:/^%<.*|%>$/,alias:"punctuation"}}},string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},number:{pattern:/((?:\.\.)?)(?:\b(?:inf|nan)\b|\b0x[\da-f]+|(?:\b(?:0b)?\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?L?)/i,lookbehind:!0},keyword:/\b(?:NULL|ans|break|bt|case|catch|cd|clear|const|def|del|dump|else|end|exit|extern|false|force|help|if|infix[lr]?|interface|let|ls|mem|namespace|nonfix|of|otherwise|outfix|override|postfix|prefix|private|public|pwd|quit|run|save|show|stats|then|throw|trace|true|type|underride|using|when|with)\b/,function:/\b(?:abs|add_(?:addr|constdef|(?:fundef|interface|macdef|typedef)(?:_at)?|vardef)|all|any|applp?|arity|bigintp?|blob(?:_crc|_size|p)?|boolp?|byte_c?string(?:_pointer)?|byte_(?:matrix|pointer)|calloc|cat|catmap|ceil|char[ps]?|check_ptrtag|chr|clear_sentry|clearsym|closurep?|cmatrixp?|cols?|colcat(?:map)?|colmap|colrev|colvector(?:p|seq)?|complex(?:_float_(?:matrix|pointer)|_matrix(?:_view)?|_pointer|p)?|conj|cookedp?|cst|cstring(?:_(?:dup|list|vector))?|curry3?|cyclen?|del_(?:constdef|fundef|interface|macdef|typedef|vardef)|delete|diag(?:mat)?|dim|dmatrixp?|do|double(?:_matrix(?:_view)?|_pointer|p)?|dowith3?|drop|dropwhile|eval(?:cmd)?|exactp|filter|fix|fixity|flip|float(?:_matrix|_pointer)|floor|fold[lr]1?|frac|free|funp?|functionp?|gcd|get(?:_(?:byte|constdef|double|float|fundef|int(?:64)?|interface(?:_typedef)?|long|macdef|pointer|ptrtag|sentry|short|string|typedef|vardef))?|globsym|hash|head|id|im|imatrixp?|index|inexactp|infp|init|insert|int(?:_matrix(?:_view)?|_pointer|p)?|int64_(?:matrix|pointer)|integerp?|iteraten?|iterwhile|join|keys?|lambdap?|last(?:err(?:pos)?)?|lcd|list[2p]?|listmap|make_ptrtag|malloc|map|matcat|matrixp?|max|member|min|nanp|nargs|nmatrixp?|null|numberp?|ord|pack(?:ed)?|pointer(?:_cast|_tag|_type|p)?|pow|pred|ptrtag|put(?:_(?:byte|double|float|int(?:64)?|long|pointer|short|string))?|rationalp?|re|realp?|realloc|recordp?|redim|reduce(?:_with)?|refp?|repeatn?|reverse|rlistp?|round|rows?|rowcat(?:map)?|rowmap|rowrev|rowvector(?:p|seq)?|same|scan[lr]1?|sentry|sgn|short_(?:matrix|pointer)|slice|smatrixp?|sort|split|str|strcat|stream|stride|string(?:_(?:dup|list|vector)|p)?|subdiag(?:mat)?|submat|subseq2?|substr|succ|supdiag(?:mat)?|symbolp?|tail|take|takewhile|thunkp?|transpose|trunc|tuplep?|typep|ubyte|uint(?:64)?|ulong|uncurry3?|unref|unzip3?|update|ushort|vals?|varp?|vector(?:p|seq)?|void|zip3?|zipwith3?)\b/,special:{pattern:/\b__[a-z]+__\b/i,alias:"builtin"},operator:/(?:[!"#$%&'*+,\-.\/:<=>?@\\^`|~\u00a1-\u00bf\u00d7-\u00f7\u20d0-\u2bff]|\b_+\b)+|\b(?:and|div|mod|not|or)\b/,punctuation:/[(){}\[\];,|]/},["c",{lang:"c++",alias:"cpp"},"fortran"].forEach((function(t){var a=t;if("string"!=typeof t&&(a=t.alias,t=t.lang),e.languages[a]){var r={};r["inline-lang-"+a]={pattern:RegExp("%< *-\\*- *<lang>\\d* *-\\*-[^]+?%>".replace("<lang>",t.replace(/([.+*?\/\\(){}\[\]])/g,"\\$1")),"i"),inside:e.util.clone(e.languages.pure["inline-lang"].inside)},r["inline-lang-"+a].inside.rest=e.util.clone(e.languages[a]),e.languages.insertBefore("pure","inline-lang",r)}})),e.languages.c&&(e.languages.pure["inline-lang"].inside.rest=e.util.clone(e.languages.c))}(Prism);

View File

@@ -0,0 +1 @@
{"version":3,"file":"distDirRewriteFramesIntegration.d.ts","sourceRoot":"","sources":["../../../src/edge/distDirRewriteFramesIntegration.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,+BAA+B;iBAAsD,MAAM;wCAmBtG,CAAC"}

View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _createForOfIteratorHelperLoose;
var _unsupportedIterableToArray = require("./unsupportedIterableToArray.js");
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
if (it) return (it = it.call(o)).next.bind(it);
if (Array.isArray(o) || (it = (0, _unsupportedIterableToArray.default)(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it) o = it;
var i = 0;
return function () {
if (i >= o.length) {
return {
done: true
};
}
return {
done: false,
value: o[i++]
};
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
//# sourceMappingURL=createForOfIteratorHelperLoose.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/batch.ts"],"sourcesContent":["import type { Dialect } from './column-builder.ts';\nimport type { RunnableQuery } from './runnable-query.ts';\n\nexport type BatchItem<TDialect extends Dialect = Dialect> = RunnableQuery<any, TDialect>;\n\nexport type BatchResponse<T extends BatchItem[] | readonly BatchItem[]> = {\n\t[K in keyof T]: T[K]['_']['result'];\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}

View File

@@ -0,0 +1 @@
import e from"../../server/react-server/getConfig.js";async function r(){return(await e()).locale}export{r as default};

View File

@@ -0,0 +1,23 @@
export { SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION } from './semanticAttributes';
export { getRequestSpanData } from './utils/getRequestSpanData';
export type { OpenTelemetryClient } from './types';
export { wrapClientClass } from './custom/client';
export { getSpanKind } from './utils/getSpanKind';
export { getScopesFromContext } from './utils/contextData';
export { spanHasAttributes, spanHasEvents, spanHasKind, spanHasName, spanHasParentId, spanHasStatus, } from './utils/spanTypes';
export { getDynamicSamplingContextFromSpan } from '@sentry/core';
export { isSentryRequestSpan } from './utils/isSentryRequest';
export { enhanceDscWithOpenTelemetryRootSpanName } from './utils/enhanceDscWithOpenTelemetryRootSpanName';
export { getActiveSpan } from './utils/getActiveSpan';
export { startSpan, startSpanManual, startInactiveSpan, withActiveSpan, continueTrace, getTraceContextForScope, } from './trace';
export { suppressTracing } from './utils/suppressTracing';
export { setupEventContextTrace } from './setupEventContextTrace';
export { setOpenTelemetryContextAsyncContextStrategy } from './asyncContextStrategy';
export { wrapContextManagerClass } from './contextManager';
export type { AsyncLocalStorageLookup } from './contextManager';
export { SentryPropagator, shouldPropagateTraceForUrl } from './propagator';
export { SentrySpanProcessor } from './spanProcessor';
export { SentrySampler, wrapSamplingDecision } from './sampler';
export { openTelemetrySetupCheck } from './utils/setupCheck';
export { getClient } from '@sentry/core';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/elements/LivePreview/Toolbar/SizeInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiC,MAAM,OAAO,CAAA;AAGrD,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3C,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAA;CACjB,CA+DA,CAAA"}

View File

@@ -0,0 +1,127 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "знаци", verb: "да имаат" },
file: { unit: "бајти", verb: "да имаат" },
array: { unit: "ставки", verb: "да имаат" },
set: { unit: "ставки", verb: "да имаат" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const parsedType = (data: any): string => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "број";
}
case "object": {
if (Array.isArray(data)) {
return "низа";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "внес",
email: "адреса на е-пошта",
url: "URL",
emoji: "емоџи",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO датум и време",
date: "ISO датум",
time: "ISO време",
duration: "ISO времетраење",
ipv4: "IPv4 адреса",
ipv6: "IPv6 адреса",
cidrv4: "IPv4 опсег",
cidrv6: "IPv6 опсег",
base64: "base64-енкодирана низа",
base64url: "base64url-енкодирана низа",
json_string: "JSON низа",
e164: "E.164 број",
jwt: "JWT",
template_literal: "внес",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Грешен внес: се очекува ${issue.expected}, примено ${parsedType(issue.input)}`;
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1) return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;
return `Грешана опција: се очекува една ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да има ${adj}${issue.maximum.toString()} ${sizing.unit ?? "елементи"}`;
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да биде ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Премногу мал: се очекува ${issue.origin} да има ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Премногу мал: се очекува ${issue.origin} да биде ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") {
return `Неважечка низа: мора да започнува со "${_issue.prefix}"`;
}
if (_issue.format === "ends_with") return `Неважечка низа: мора да завршува со "${_issue.suffix}"`;
if (_issue.format === "includes") return `Неважечка низа: мора да вклучува "${_issue.includes}"`;
if (_issue.format === "regex") return `Неважечка низа: мора да одгоара на патернот ${_issue.pattern}`;
return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Грешен број: мора да биде делив со ${issue.divisor}`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Непрепознаени клучеви" : "Непрепознаен клуч"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Грешен клуч во ${issue.origin}`;
case "invalid_union":
return "Грешен внес";
case "invalid_element":
return `Грешна вредност во ${issue.origin}`;
default:
return `Грешен внес`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1,2 @@
import { forEachRight } from "./index";
export = forEachRight;

View File

@@ -0,0 +1 @@
{"version":3,"file":"signal.js","sources":["../../../src/icons/signal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Signal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAyMGguMDEiIC8+CiAgPHBhdGggZD0iTTcgMjB2LTQiIC8+CiAgPHBhdGggZD0iTTEyIDIwdi04IiAvPgogIDxwYXRoIGQ9Ik0xNyAyMFY4IiAvPgogIDxwYXRoIGQ9Ik0yMiA0djE2IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/signal\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 Signal = createLucideIcon('Signal', [\n ['path', { d: 'M2 20h.01', key: '4haj6o' }],\n ['path', { d: 'M7 20v-4', key: 'j294jx' }],\n ['path', { d: 'M12 20v-8', key: 'i3yub9' }],\n ['path', { d: 'M17 20V8', key: '1tkaf5' }],\n ['path', { d: 'M22 4v16', key: 'sih9yq' }],\n]);\n\nexport default Signal;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,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,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,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,CAAA;AAAA,CAAA,CACzC,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,29 @@
Prism.languages.monkey = {
'comment': {
pattern: /^#Rem\s[\s\S]*?^#End|'.+/im,
greedy: true
},
'string': {
pattern: /"[^"\r\n]*"/,
greedy: true,
},
'preprocessor': {
pattern: /(^[ \t]*)#.+/m,
lookbehind: true,
greedy: true,
alias: 'property'
},
'function': /\b\w+(?=\()/,
'type-char': {
pattern: /\b[?%#$]/,
alias: 'class-name'
},
'number': {
pattern: /((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i,
lookbehind: true
},
'keyword': /\b(?:Abstract|Array|Bool|Case|Catch|Class|Const|Continue|Default|Eachin|Else|ElseIf|End|EndIf|Exit|Extends|Extern|False|Field|Final|Float|For|Forever|Function|Global|If|Implements|Import|Inline|Int|Interface|Local|Method|Module|New|Next|Null|Object|Private|Property|Public|Repeat|Return|Select|Self|Step|Strict|String|Super|Then|Throw|To|True|Try|Until|Void|Wend|While)\b/i,
'operator': /\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i,
'punctuation': /[.,:;()\[\]]/
};

View File

@@ -0,0 +1,34 @@
"use strict";
exports.getDayOfYear = getDayOfYear;
var _index = require("./differenceInCalendarDays.js");
var _index2 = require("./startOfYear.js");
var _index3 = require("./toDate.js");
/**
* @name getDayOfYear
* @category Day Helpers
* @summary Get the day of the year of the given date.
*
* @description
* Get the day of the year of the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
*
* @returns The day of year
*
* @example
* // Which day of the year is 2 July 2014?
* const result = getDayOfYear(new Date(2014, 6, 2))
* //=> 183
*/
function getDayOfYear(date) {
const _date = (0, _index3.toDate)(date);
const diff = (0, _index.differenceInCalendarDays)(
_date,
(0, _index2.startOfYear)(_date),
);
const dayOfYear = diff + 1;
return dayOfYear;
}

View File

@@ -0,0 +1,90 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const InitFragment = require("../InitFragment");
const RuntimeGlobals = require("../RuntimeGlobals");
const Template = require("../Template");
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../Generator").GenerateContext} GenerateContext */
/** @typedef {Map<string, string>} Dependencies */
/**
* @extends {InitFragment<GenerateContext>}
*/
class AwaitDependenciesInitFragment extends InitFragment {
/**
* @param {Dependencies} dependencies maps an import var to an async module that needs to be awaited
*/
constructor(dependencies) {
super(
undefined,
InitFragment.STAGE_ASYNC_DEPENDENCIES,
0,
"await-dependencies"
);
/** @type {Dependencies} */
this.dependencies = dependencies;
}
/**
* @param {AwaitDependenciesInitFragment} other other AwaitDependenciesInitFragment
* @returns {AwaitDependenciesInitFragment} AwaitDependenciesInitFragment
*/
merge(other) {
const dependencies = new Map(other.dependencies);
for (const [key, value] of this.dependencies) {
dependencies.set(key, value);
}
return new AwaitDependenciesInitFragment(dependencies);
}
/**
* @param {GenerateContext} context context
* @returns {string | Source | undefined} the source code that will be included as initialization code
*/
getContent({ runtimeRequirements, runtimeTemplate }) {
runtimeRequirements.add(RuntimeGlobals.module);
if (this.dependencies.size === 0) {
return "";
}
const importVars = [...this.dependencies.keys()];
const asyncModuleValues = [...this.dependencies.values()].join(", ");
const templateInput = [
`var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([${asyncModuleValues}]);`
];
if (
this.dependencies.size === 1 ||
!runtimeTemplate.supportsDestructuring()
) {
templateInput.push(
"var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);"
);
for (const [index, importVar] of importVars.entries()) {
templateInput.push(
`${importVar} = __webpack_async_dependencies_result__[${index}];`
);
}
} else {
const importVarsStr = importVars.join(", ");
templateInput.push(
`([${importVarsStr}] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);`
);
}
templateInput.push("");
return Template.asString(templateInput);
}
}
module.exports = AwaitDependenciesInitFragment;

View File

@@ -0,0 +1,19 @@
'use client';
import { useDocumentInfo } from '@payloadcms/ui';
export const ShouldRenderTabs = t0 => {
const {
children
} = t0;
const {
id: idFromContext,
collectionSlug,
globalSlug
} = useDocumentInfo();
const id = idFromContext !== "create" ? idFromContext : null;
if (collectionSlug && id || globalSlug) {
return children;
}
return null;
};
//# sourceMappingURL=ShouldRenderTabs.js.map

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