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,145 @@
/**
* @license React
* scheduler-unstable_post_task.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
var perf = window.performance,
setTimeout = window.setTimeout,
scheduler = global.scheduler,
getCurrentTime = perf.now.bind(perf),
deadline = 0,
currentPriorityLevel_DEPRECATED = 3;
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() {}
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 @@
module.exports={A:{A:{"1":"A B","16":"zC","132":"K D E F"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 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 9 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","2":"0C VC J bB K D 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 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 KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC"},E:{"1":"J bB K D E F A B C L M G 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"6C bC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z KD LD MD PC xC ND QC","16":"F JD"},G:{"1":"E OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","16":"bC"},H:{"1":"mD"},I:{"1":"VC J I pD qD yC rD sD","16":"nD oD"},J:{"1":"D A"},K:{"1":"A B C H PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"A B"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:4,C:"Element.insertAdjacentHTML()",D:true};

View File

@@ -0,0 +1,6 @@
export const appendPrefixToObjectKeys = (obj, prefix)=>Object.entries(obj).reduce((res, [key, val])=>{
res[`${prefix}_${key}`] = val;
return res;
}, {});
//# sourceMappingURL=appendPrefixToKeys.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"panel-left-open.js","sources":["../../../src/icons/panel-left-open.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PanelLeftOpen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik05IDN2MTgiIC8+CiAgPHBhdGggZD0ibTE0IDkgMyAzLTMgMyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/panel-left-open\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 PanelLeftOpen = createLucideIcon('PanelLeftOpen', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M9 3v18', key: 'fh3hqa' }],\n ['path', { d: 'm14 9 3 3-3 3', key: '8010ee' }],\n]);\n\nexport default PanelLeftOpen;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,21 @@
/**
* @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 CloudSnow = createLucideIcon("CloudSnow", [
["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
["path", { d: "M8 15h.01", key: "a7atzg" }],
["path", { d: "M8 19h.01", key: "puxtts" }],
["path", { d: "M12 17h.01", key: "p32p05" }],
["path", { d: "M12 21h.01", key: "h35vbk" }],
["path", { d: "M16 15h.01", key: "rnfrdf" }],
["path", { d: "M16 19h.01", key: "1vcnzz" }]
]);
export { CloudSnow as default };
//# sourceMappingURL=cloud-snow.js.map

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.
*
*/
"use strict";var e=require("@lexical/utils"),t=require("lexical");class r extends t.TextNode{static getType(){return"hashtag"}static clone(e){return new r(e.__text,e.__key)}createDOM(t){const r=super.createDOM(t);return e.addClassNamesToElement(r,t.theme.hashtag),r}static importJSON(e){return a().updateFromJSON(e)}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function a(e=""){return t.$applyNodeReplacement(new r(e))}exports.$createHashtagNode=a,exports.$isHashtagNode=function(e){return e instanceof r},exports.HashtagNode=r;

View File

@@ -0,0 +1,22 @@
/*
@license
Rollup.js v4.58.0
Fri, 20 Feb 2026 12:44:20 GMT - commit 33f39c1f205ea2eadaf4b589e493453e2baa3662
https://github.com/rollup/rollup
Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
require('./native.js');
const parseAst_js = require('./shared/parseAst.js');
require('node:path');
exports.parseAst = parseAst_js.parseAst;
exports.parseAstAsync = parseAst_js.parseAstAsync;
//# sourceMappingURL=parseAst.js.map

View File

@@ -0,0 +1,33 @@
import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment.cts';
export type MemoState = {
lastKey: number;
lastNeedle: number;
lastIndex: number;
};
export declare let found: boolean;
/**
* A binary search implementation that returns the index if a match is found.
* If no match is found, then the left-index (the index associated with the item that comes just
* before the desired index) is returned. To maintain proper sort order, a splice would happen at
* the next index:
*
* ```js
* const array = [1, 3];
* const needle = 2;
* const index = binarySearch(array, needle, (item, needle) => item - needle);
*
* assert.equal(index, 0);
* array.splice(index + 1, 0, needle);
* assert.deepEqual(array, [1, 2, 3]);
* ```
*/
export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number;
export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number;
export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number;
export declare function memoizedState(): MemoState;
/**
* This overly complicated beast is just to record the last tested line/column and the resulting
* index, allowing us to skip a few tests if mappings are monotonically increasing.
*/
export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number;
//# sourceMappingURL=binary-search.d.ts.map

View File

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

View File

@@ -0,0 +1,77 @@
import { commitTransaction, createLocalReq, initTransaction, killTransaction, readMigrationFiles } from 'payload';
import prompts from 'prompts';
import { getTransaction } from './utilities/getTransaction.js';
import { parseError } from './utilities/parseError.js';
/**
* Drop the current database and run all migrate up functions
*/ export async function migrateFresh({ forceAcceptWarning = false }) {
const { payload } = this;
if (forceAcceptWarning === false) {
const { confirm: acceptWarning } = await prompts({
name: 'confirm',
type: 'confirm',
initial: false,
message: `WARNING: This will drop your database and run all migrations. Are you sure you want to proceed?`
}, {
onCancel: ()=>{
process.exit(0);
}
});
if (!acceptWarning) {
process.exit(0);
}
}
payload.logger.info({
msg: `Dropping database.`
});
await this.dropDatabase({
adapter: this
});
const migrationFiles = await readMigrationFiles({
payload
});
payload.logger.debug({
msg: `Found ${migrationFiles.length} migration files.`
});
const req = await createLocalReq({}, payload);
if ('createExtensions' in this && typeof this.createExtensions === 'function') {
await this.createExtensions();
}
// Run all migrate up
for (const migration of migrationFiles){
payload.logger.info({
msg: `Migrating: ${migration.name}`
});
try {
const start = Date.now();
await initTransaction(req);
const db = await getTransaction(this, req);
await migration.up({
db,
payload,
req
});
await payload.create({
collection: 'payload-migrations',
data: {
name: migration.name,
batch: 1
},
req
});
await commitTransaction(req);
payload.logger.info({
msg: `Migrated: ${migration.name} (${Date.now() - start}ms)`
});
} catch (err) {
await killTransaction(req);
payload.logger.error({
err,
msg: parseError(err, `Error running migration ${migration.name}. Rolling back`)
});
process.exit(1);
}
}
}
//# sourceMappingURL=migrateFresh.js.map

View File

@@ -0,0 +1,12 @@
import type { ASTVisitor } from '../../language/visitor';
import type { ASTValidationContext } from '../ValidationContext';
/**
* Unique operation names
*
* A GraphQL document is only valid if all defined operations have unique names.
*
* See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness
*/
export declare function UniqueOperationNamesRule(
context: ASTValidationContext,
): ASTVisitor;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/graphics/Account/Gravatar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAuBvC,CAAA"}

View File

@@ -0,0 +1,393 @@
/*
This file is copied from https://github.com/nodejs/node/blob/v14.19.3/lib/internal/per_context/primordials.js
under the following license:
Copyright Node.js contributors. All rights reserved.
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.
*/
'use strict';
/* eslint-disable node-core/prefer-primordials */
// This file subclasses and stores the JS builtins that come from the VM
// so that Node.js's builtin modules do not need to later look these up from
// the global proxy, which can be mutated by users.
// Use of primordials have sometimes a dramatic impact on performance, please
// benchmark all changes made in performance-sensitive areas of the codebase.
// See: https://github.com/nodejs/node/pull/38248
const primordials = {};
const {
defineProperty: ReflectDefineProperty,
getOwnPropertyDescriptor: ReflectGetOwnPropertyDescriptor,
ownKeys: ReflectOwnKeys,
} = Reflect;
// `uncurryThis` is equivalent to `func => Function.prototype.call.bind(func)`.
// It is using `bind.bind(call)` to avoid using `Function.prototype.bind`
// and `Function.prototype.call` after it may have been mutated by users.
const { apply, bind, call } = Function.prototype;
const uncurryThis = bind.bind(call);
primordials.uncurryThis = uncurryThis;
// `applyBind` is equivalent to `func => Function.prototype.apply.bind(func)`.
// It is using `bind.bind(apply)` to avoid using `Function.prototype.bind`
// and `Function.prototype.apply` after it may have been mutated by users.
const applyBind = bind.bind(apply);
primordials.applyBind = applyBind;
// Methods that accept a variable number of arguments, and thus it's useful to
// also create `${prefix}${key}Apply`, which uses `Function.prototype.apply`,
// instead of `Function.prototype.call`, and thus doesn't require iterator
// destructuring.
const varargsMethods = [
// 'ArrayPrototypeConcat' is omitted, because it performs the spread
// on its own for arrays and array-likes with a truthy
// @@isConcatSpreadable symbol property.
'ArrayOf',
'ArrayPrototypePush',
'ArrayPrototypeUnshift',
// 'FunctionPrototypeCall' is omitted, since there's 'ReflectApply'
// and 'FunctionPrototypeApply'.
'MathHypot',
'MathMax',
'MathMin',
'StringPrototypeConcat',
'TypedArrayOf',
];
function getNewKey(key) {
return typeof key === 'symbol' ?
`Symbol${key.description[7].toUpperCase()}${key.description.slice(8)}` :
`${key[0].toUpperCase()}${key.slice(1)}`;
}
function copyAccessor(dest, prefix, key, { enumerable, get, set }) {
ReflectDefineProperty(dest, `${prefix}Get${key}`, {
value: uncurryThis(get),
enumerable
});
if (set !== undefined) {
ReflectDefineProperty(dest, `${prefix}Set${key}`, {
value: uncurryThis(set),
enumerable
});
}
}
function copyPropsRenamed(src, dest, prefix) {
for (const key of ReflectOwnKeys(src)) {
const newKey = getNewKey(key);
const desc = ReflectGetOwnPropertyDescriptor(src, key);
if ('get' in desc) {
copyAccessor(dest, prefix, newKey, desc);
} else {
const name = `${prefix}${newKey}`;
ReflectDefineProperty(dest, name, desc);
if (varargsMethods.includes(name)) {
ReflectDefineProperty(dest, `${name}Apply`, {
// `src` is bound as the `this` so that the static `this` points
// to the object it was defined on,
// e.g.: `ArrayOfApply` gets a `this` of `Array`:
value: applyBind(desc.value, src),
});
}
}
}
}
function copyPropsRenamedBound(src, dest, prefix) {
for (const key of ReflectOwnKeys(src)) {
const newKey = getNewKey(key);
const desc = ReflectGetOwnPropertyDescriptor(src, key);
if ('get' in desc) {
copyAccessor(dest, prefix, newKey, desc);
} else {
const { value } = desc;
if (typeof value === 'function') {
desc.value = value.bind(src);
}
const name = `${prefix}${newKey}`;
ReflectDefineProperty(dest, name, desc);
if (varargsMethods.includes(name)) {
ReflectDefineProperty(dest, `${name}Apply`, {
value: applyBind(value, src),
});
}
}
}
}
function copyPrototype(src, dest, prefix) {
for (const key of ReflectOwnKeys(src)) {
const newKey = getNewKey(key);
const desc = ReflectGetOwnPropertyDescriptor(src, key);
if ('get' in desc) {
copyAccessor(dest, prefix, newKey, desc);
} else {
const { value } = desc;
if (typeof value === 'function') {
desc.value = uncurryThis(value);
}
const name = `${prefix}${newKey}`;
ReflectDefineProperty(dest, name, desc);
if (varargsMethods.includes(name)) {
ReflectDefineProperty(dest, `${name}Apply`, {
value: applyBind(value),
});
}
}
}
}
// Create copies of configurable value properties of the global object
[
'Proxy',
'globalThis',
].forEach((name) => {
// eslint-disable-next-line no-restricted-globals
primordials[name] = globalThis[name];
});
// Create copies of URI handling functions
[
decodeURI,
decodeURIComponent,
encodeURI,
encodeURIComponent,
].forEach((fn) => {
primordials[fn.name] = fn;
});
// Create copies of the namespace objects
[
'JSON',
'Math',
'Proxy',
'Reflect',
].forEach((name) => {
// eslint-disable-next-line no-restricted-globals
copyPropsRenamed(global[name], primordials, name);
});
// Create copies of intrinsic objects
[
'Array',
'ArrayBuffer',
'BigInt',
'BigInt64Array',
'BigUint64Array',
'Boolean',
'DataView',
'Date',
'Error',
'EvalError',
'Float32Array',
'Float64Array',
'Function',
'Int16Array',
'Int32Array',
'Int8Array',
'Map',
'Number',
'Object',
'RangeError',
'ReferenceError',
'RegExp',
'Set',
'String',
'Symbol',
'SyntaxError',
'TypeError',
'URIError',
'Uint16Array',
'Uint32Array',
'Uint8Array',
'Uint8ClampedArray',
'WeakMap',
'WeakSet',
].forEach((name) => {
// eslint-disable-next-line no-restricted-globals
const original = global[name];
primordials[name] = original;
copyPropsRenamed(original, primordials, name);
copyPrototype(original.prototype, primordials, `${name}Prototype`);
});
// Create copies of intrinsic objects that require a valid `this` to call
// static methods.
// Refs: https://www.ecma-international.org/ecma-262/#sec-promise.all
[
'Promise',
].forEach((name) => {
// eslint-disable-next-line no-restricted-globals
const original = global[name];
primordials[name] = original;
copyPropsRenamedBound(original, primordials, name);
copyPrototype(original.prototype, primordials, `${name}Prototype`);
});
// Create copies of abstract intrinsic objects that are not directly exposed
// on the global object.
// Refs: https://tc39.es/ecma262/#sec-%typedarray%-intrinsic-object
[
{ name: 'TypedArray', original: Reflect.getPrototypeOf(Uint8Array) },
{ name: 'ArrayIterator', original: {
prototype: Reflect.getPrototypeOf(Array.prototype[Symbol.iterator]()),
} },
{ name: 'StringIterator', original: {
prototype: Reflect.getPrototypeOf(String.prototype[Symbol.iterator]()),
} },
].forEach(({ name, original }) => {
primordials[name] = original;
// The static %TypedArray% methods require a valid `this`, but can't be bound,
// as they need a subclass constructor as the receiver:
copyPrototype(original, primordials, name);
copyPrototype(original.prototype, primordials, `${name}Prototype`);
});
/* eslint-enable node-core/prefer-primordials */
const {
ArrayPrototypeForEach,
FunctionPrototypeCall,
Map,
ObjectFreeze,
ObjectSetPrototypeOf,
Set,
SymbolIterator,
WeakMap,
WeakSet,
} = primordials;
// Because these functions are used by `makeSafe`, which is exposed
// on the `primordials` object, it's important to use const references
// to the primordials that they use:
const createSafeIterator = (factory, next) => {
class SafeIterator {
constructor(iterable) {
this._iterator = factory(iterable);
}
next() {
return next(this._iterator);
}
[SymbolIterator]() {
return this;
}
}
ObjectSetPrototypeOf(SafeIterator.prototype, null);
ObjectFreeze(SafeIterator.prototype);
ObjectFreeze(SafeIterator);
return SafeIterator;
};
primordials.SafeArrayIterator = createSafeIterator(
primordials.ArrayPrototypeSymbolIterator,
primordials.ArrayIteratorPrototypeNext
);
primordials.SafeStringIterator = createSafeIterator(
primordials.StringPrototypeSymbolIterator,
primordials.StringIteratorPrototypeNext
);
const copyProps = (src, dest) => {
ArrayPrototypeForEach(ReflectOwnKeys(src), (key) => {
if (!ReflectGetOwnPropertyDescriptor(dest, key)) {
ReflectDefineProperty(
dest,
key,
ReflectGetOwnPropertyDescriptor(src, key));
}
});
};
const makeSafe = (unsafe, safe) => {
if (SymbolIterator in unsafe.prototype) {
const dummy = new unsafe();
let next; // We can reuse the same `next` method.
ArrayPrototypeForEach(ReflectOwnKeys(unsafe.prototype), (key) => {
if (!ReflectGetOwnPropertyDescriptor(safe.prototype, key)) {
const desc = ReflectGetOwnPropertyDescriptor(unsafe.prototype, key);
if (
typeof desc.value === 'function' &&
desc.value.length === 0 &&
SymbolIterator in (FunctionPrototypeCall(desc.value, dummy) ?? {})
) {
const createIterator = uncurryThis(desc.value);
next = next ?? uncurryThis(createIterator(dummy).next);
const SafeIterator = createSafeIterator(createIterator, next);
desc.value = function() {
return new SafeIterator(this);
};
}
ReflectDefineProperty(safe.prototype, key, desc);
}
});
} else {
copyProps(unsafe.prototype, safe.prototype);
}
copyProps(unsafe, safe);
ObjectSetPrototypeOf(safe.prototype, null);
ObjectFreeze(safe.prototype);
ObjectFreeze(safe);
return safe;
};
primordials.makeSafe = makeSafe;
// Subclass the constructors because we need to use their prototype
// methods later.
// Defining the `constructor` is necessary here to avoid the default
// constructor which uses the user-mutable `%ArrayIteratorPrototype%.next`.
primordials.SafeMap = makeSafe(
Map,
class SafeMap extends Map {
constructor(i) { super(i); } // eslint-disable-line no-useless-constructor
}
);
primordials.SafeWeakMap = makeSafe(
WeakMap,
class SafeWeakMap extends WeakMap {
constructor(i) { super(i); } // eslint-disable-line no-useless-constructor
}
);
primordials.SafeSet = makeSafe(
Set,
class SafeSet extends Set {
constructor(i) { super(i); } // eslint-disable-line no-useless-constructor
}
);
primordials.SafeWeakSet = makeSafe(
WeakSet,
class SafeWeakSet extends WeakSet {
constructor(i) { super(i); } // eslint-disable-line no-useless-constructor
}
);
ObjectSetPrototypeOf(primordials, null);
ObjectFreeze(primordials);
module.exports = primordials;

View File

@@ -0,0 +1,218 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/* eslint-disable max-lines */
/**
* AI SDK Telemetry Attributes
* Based on https://ai-sdk.dev/docs/ai-sdk-core/telemetry#collected-data
*/
// =============================================================================
// COMMON ATTRIBUTES
// =============================================================================
/**
* Common attribute for operation name across all functions and spans
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#collected-data
*/
const OPERATION_NAME_ATTRIBUTE = 'operation.name';
/**
* Common attribute for AI operation ID across all functions and spans
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#collected-data
*/
const AI_OPERATION_ID_ATTRIBUTE = 'ai.operationId';
// =============================================================================
// SHARED ATTRIBUTES
// =============================================================================
/**
* `generateText` function - `ai.generateText` span
* `streamText` function - `ai.streamText` span
*
* The prompt that was used when calling the function
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamtext-function
*/
const AI_PROMPT_ATTRIBUTE = 'ai.prompt';
/**
* `generateObject` function - `ai.generateObject` span
* `streamObject` function - `ai.streamObject` span
*
* The JSON schema version of the schema that was passed into the function
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generateobject-function
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamobject-function
*/
const AI_SCHEMA_ATTRIBUTE = 'ai.schema';
/**
* `generateObject` function - `ai.generateObject` span
* `streamObject` function - `ai.streamObject` span
*
* The object that was generated (stringified JSON)
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generateobject-function
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#streamobject-function
*/
const AI_RESPONSE_OBJECT_ATTRIBUTE = 'ai.response.object';
// =============================================================================
// GENERATETEXT FUNCTION - UNIQUE ATTRIBUTES
// =============================================================================
/**
* `generateText` function - `ai.generateText` span
*
* The text that was generated
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function
*/
const AI_RESPONSE_TEXT_ATTRIBUTE = 'ai.response.text';
/**
* `generateText` function - `ai.generateText` span
*
* The tool calls that were made as part of the generation (stringified JSON)
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function
*/
const AI_RESPONSE_TOOL_CALLS_ATTRIBUTE = 'ai.response.toolCalls';
/**
* `generateText` function - `ai.generateText.doGenerate` span
*
* The messages that were passed into the provider
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function
*/
const AI_PROMPT_MESSAGES_ATTRIBUTE = 'ai.prompt.messages';
/**
* `generateText` function - `ai.generateText.doGenerate` span
*
* Array of stringified tool definitions
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#generatetext-function
*/
const AI_PROMPT_TOOLS_ATTRIBUTE = 'ai.prompt.tools';
/**
* Basic LLM span information
* Multiple spans
*
* The id of the model
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information
*/
const AI_MODEL_ID_ATTRIBUTE = 'ai.model.id';
/**
* Basic LLM span information
* Multiple spans
*
* Provider specific metadata returned with the generation response
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information
*/
const AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE = 'ai.response.providerMetadata';
/**
* Basic LLM span information
* Multiple spans
*
* The number of cached input tokens that were used
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information
*/
const AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE = 'ai.usage.cachedInputTokens';
/**
* Basic LLM span information
* Multiple spans
*
* The functionId that was set through `telemetry.functionId`
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information
*/
const AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE = 'ai.telemetry.functionId';
/**
* Basic LLM span information
* Multiple spans
*
* The number of completion tokens that were used
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information
*/
const AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE = 'ai.usage.completionTokens';
/**
* Basic LLM span information
* Multiple spans
*
* The number of prompt tokens that were used
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#basic-llm-span-information
*/
const AI_USAGE_PROMPT_TOKENS_ATTRIBUTE = 'ai.usage.promptTokens';
// =============================================================================
// TOOL CALL SPANS
// =============================================================================
/**
* Tool call spans
* `ai.toolCall` span
*
* The name of the tool
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans
*/
const AI_TOOL_CALL_NAME_ATTRIBUTE = 'ai.toolCall.name';
/**
* Tool call spans
* `ai.toolCall` span
*
* The id of the tool call
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans
*/
const AI_TOOL_CALL_ID_ATTRIBUTE = 'ai.toolCall.id';
/**
* Tool call spans
* `ai.toolCall` span
*
* The parameters of the tool call
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans
*/
const AI_TOOL_CALL_ARGS_ATTRIBUTE = 'ai.toolCall.args';
/**
* Tool call spans
* `ai.toolCall` span
*
* The result of the tool call
* @see https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans
*/
const AI_TOOL_CALL_RESULT_ATTRIBUTE = 'ai.toolCall.result';
// =============================================================================
// PROVIDER METADATA
// =============================================================================
/**
* OpenAI Provider Metadata
* @see https://ai-sdk.dev/providers/ai-sdk-providers/openai
* @see https://github.com/vercel/ai/blob/65e042afde6aad4da9d7a62526ece839eb34f9a5/packages/openai/src/openai-chat-language-model.ts#L397-L416
* @see https://github.com/vercel/ai/blob/65e042afde6aad4da9d7a62526ece839eb34f9a5/packages/openai/src/responses/openai-responses-language-model.ts#L377C7-L384
*/
exports.AI_MODEL_ID_ATTRIBUTE = AI_MODEL_ID_ATTRIBUTE;
exports.AI_OPERATION_ID_ATTRIBUTE = AI_OPERATION_ID_ATTRIBUTE;
exports.AI_PROMPT_ATTRIBUTE = AI_PROMPT_ATTRIBUTE;
exports.AI_PROMPT_MESSAGES_ATTRIBUTE = AI_PROMPT_MESSAGES_ATTRIBUTE;
exports.AI_PROMPT_TOOLS_ATTRIBUTE = AI_PROMPT_TOOLS_ATTRIBUTE;
exports.AI_RESPONSE_OBJECT_ATTRIBUTE = AI_RESPONSE_OBJECT_ATTRIBUTE;
exports.AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE = AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE;
exports.AI_RESPONSE_TEXT_ATTRIBUTE = AI_RESPONSE_TEXT_ATTRIBUTE;
exports.AI_RESPONSE_TOOL_CALLS_ATTRIBUTE = AI_RESPONSE_TOOL_CALLS_ATTRIBUTE;
exports.AI_SCHEMA_ATTRIBUTE = AI_SCHEMA_ATTRIBUTE;
exports.AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE = AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE;
exports.AI_TOOL_CALL_ARGS_ATTRIBUTE = AI_TOOL_CALL_ARGS_ATTRIBUTE;
exports.AI_TOOL_CALL_ID_ATTRIBUTE = AI_TOOL_CALL_ID_ATTRIBUTE;
exports.AI_TOOL_CALL_NAME_ATTRIBUTE = AI_TOOL_CALL_NAME_ATTRIBUTE;
exports.AI_TOOL_CALL_RESULT_ATTRIBUTE = AI_TOOL_CALL_RESULT_ATTRIBUTE;
exports.AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE = AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE;
exports.AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE = AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE;
exports.AI_USAGE_PROMPT_TOKENS_ATTRIBUTE = AI_USAGE_PROMPT_TOKENS_ATTRIBUTE;
exports.OPERATION_NAME_ATTRIBUTE = OPERATION_NAME_ATTRIBUTE;
//# sourceMappingURL=vercel-ai-attributes.js.map

View File

@@ -0,0 +1,4 @@
import type { FindOneArgs, TypeWithID } from 'payload';
import type { DrizzleAdapter } from './types.js';
export declare function findOne<T extends TypeWithID>(this: DrizzleAdapter, { collection, draftsEnabled, joins, locale, req, select, where }: FindOneArgs): Promise<null | T>;
//# sourceMappingURL=findOne.d.ts.map

View File

@@ -0,0 +1,567 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const {
JAVASCRIPT_MODULE_TYPE_AUTO,
JAVASCRIPT_MODULE_TYPE_DYNAMIC,
JAVASCRIPT_MODULE_TYPE_ESM
} = require("./ModuleTypeConstants");
const CachedConstDependency = require("./dependencies/CachedConstDependency");
const ConstDependency = require("./dependencies/ConstDependency");
const { evaluateToString } = require("./javascript/JavascriptParserHelpers");
const { parseResource } = require("./util/identifier");
/** @typedef {import("estree").AssignmentProperty} AssignmentProperty */
/** @typedef {import("estree").Expression} Expression */
/** @typedef {import("estree").Identifier} Identifier */
/** @typedef {import("estree").Pattern} Pattern */
/** @typedef {import("estree").SourceLocation} SourceLocation */
/** @typedef {import("estree").Statement} Statement */
/** @typedef {import("estree").Super} Super */
/** @typedef {import("estree").VariableDeclaration} VariableDeclaration */
/** @typedef {import("./Compiler")} Compiler */
/** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */
/** @typedef {import("./javascript/JavascriptParser").Range} Range */
/** @typedef {Set<string>} Declarations */
/**
* @param {Declarations} declarations set of declarations
* @param {Identifier | Pattern} pattern pattern to collect declarations from
*/
const collectDeclaration = (declarations, pattern) => {
const stack = [pattern];
while (stack.length > 0) {
const node = /** @type {Pattern} */ (stack.pop());
switch (node.type) {
case "Identifier":
declarations.add(node.name);
break;
case "ArrayPattern":
for (const element of node.elements) {
if (element) {
stack.push(element);
}
}
break;
case "AssignmentPattern":
stack.push(node.left);
break;
case "ObjectPattern":
for (const property of node.properties) {
stack.push(/** @type {AssignmentProperty} */ (property).value);
}
break;
case "RestElement":
stack.push(node.argument);
break;
}
}
};
/**
* @param {Statement} branch branch to get hoisted declarations from
* @param {boolean} includeFunctionDeclarations whether to include function declarations
* @returns {string[]} hoisted declarations
*/
const getHoistedDeclarations = (branch, includeFunctionDeclarations) => {
/** @type {Declarations} */
const declarations = new Set();
/** @type {(Statement | null | undefined)[]} */
const stack = [branch];
while (stack.length > 0) {
const node = stack.pop();
// Some node could be `null` or `undefined`.
if (!node) continue;
switch (node.type) {
// Walk through control statements to look for hoisted declarations.
// Some branches are skipped since they do not allow declarations.
case "BlockStatement":
for (const stmt of node.body) {
stack.push(stmt);
}
break;
case "IfStatement":
stack.push(node.consequent);
stack.push(node.alternate);
break;
case "ForStatement":
stack.push(/** @type {VariableDeclaration} */ (node.init));
stack.push(node.body);
break;
case "ForInStatement":
case "ForOfStatement":
stack.push(/** @type {VariableDeclaration} */ (node.left));
stack.push(node.body);
break;
case "DoWhileStatement":
case "WhileStatement":
case "LabeledStatement":
stack.push(node.body);
break;
case "SwitchStatement":
for (const cs of node.cases) {
for (const consequent of cs.consequent) {
stack.push(consequent);
}
}
break;
case "TryStatement":
stack.push(node.block);
if (node.handler) {
stack.push(node.handler.body);
}
stack.push(node.finalizer);
break;
case "FunctionDeclaration":
if (includeFunctionDeclarations) {
collectDeclaration(declarations, /** @type {Identifier} */ (node.id));
}
break;
case "VariableDeclaration":
if (node.kind === "var") {
for (const decl of node.declarations) {
collectDeclaration(declarations, decl.id);
}
}
break;
}
}
return [...declarations];
};
const PLUGIN_NAME = "ConstPlugin";
class ConstPlugin {
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
const cachedParseResource = parseResource.bindCache(compiler.root);
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory }) => {
compilation.dependencyTemplates.set(
ConstDependency,
new ConstDependency.Template()
);
compilation.dependencyTemplates.set(
CachedConstDependency,
new CachedConstDependency.Template()
);
/**
* @param {JavascriptParser} parser the parser
*/
const handler = (parser) => {
parser.hooks.terminate.tap(PLUGIN_NAME, (_statement) => true);
parser.hooks.statementIf.tap(PLUGIN_NAME, (statement) => {
if (parser.scope.isAsmJs) return;
const param = parser.evaluateExpression(statement.test);
const bool = param.asBool();
if (typeof bool === "boolean") {
if (!param.couldHaveSideEffects()) {
const dep = new ConstDependency(
`${bool}`,
/** @type {Range} */ (param.range)
);
dep.loc = /** @type {SourceLocation} */ (statement.loc);
parser.state.module.addPresentationalDependency(dep);
} else {
parser.walkExpression(statement.test);
}
const branchToRemove = bool
? statement.alternate
: statement.consequent;
if (branchToRemove) {
this.eliminateUnusedStatement(parser, branchToRemove, true);
}
return bool;
}
});
parser.hooks.unusedStatement.tap(PLUGIN_NAME, (statement) => {
if (
parser.scope.isAsmJs ||
// Check top level scope here again
parser.scope.topLevelScope === true
) {
return;
}
this.eliminateUnusedStatement(parser, statement, false);
return true;
});
parser.hooks.expressionConditionalOperator.tap(
PLUGIN_NAME,
(expression) => {
if (parser.scope.isAsmJs) return;
const param = parser.evaluateExpression(expression.test);
const bool = param.asBool();
if (typeof bool === "boolean") {
if (!param.couldHaveSideEffects()) {
const dep = new ConstDependency(
` ${bool}`,
/** @type {Range} */ (param.range)
);
dep.loc = /** @type {SourceLocation} */ (expression.loc);
parser.state.module.addPresentationalDependency(dep);
} else {
parser.walkExpression(expression.test);
}
// Expressions do not hoist.
// It is safe to remove the dead branch.
//
// Given the following code:
//
// false ? someExpression() : otherExpression();
//
// the generated code is:
//
// false ? 0 : otherExpression();
//
const branchToRemove = bool
? expression.alternate
: expression.consequent;
const dep = new ConstDependency(
"0",
/** @type {Range} */ (branchToRemove.range)
);
dep.loc = /** @type {SourceLocation} */ (branchToRemove.loc);
parser.state.module.addPresentationalDependency(dep);
return bool;
}
}
);
parser.hooks.expressionLogicalOperator.tap(
PLUGIN_NAME,
(expression) => {
if (parser.scope.isAsmJs) return;
if (
expression.operator === "&&" ||
expression.operator === "||"
) {
const param = parser.evaluateExpression(expression.left);
const bool = param.asBool();
if (typeof bool === "boolean") {
// Expressions do not hoist.
// It is safe to remove the dead branch.
//
// ------------------------------------------
//
// Given the following code:
//
// falsyExpression() && someExpression();
//
// the generated code is:
//
// falsyExpression() && false;
//
// ------------------------------------------
//
// Given the following code:
//
// truthyExpression() && someExpression();
//
// the generated code is:
//
// true && someExpression();
//
// ------------------------------------------
//
// Given the following code:
//
// truthyExpression() || someExpression();
//
// the generated code is:
//
// truthyExpression() || false;
//
// ------------------------------------------
//
// Given the following code:
//
// falsyExpression() || someExpression();
//
// the generated code is:
//
// false && someExpression();
//
const keepRight =
(expression.operator === "&&" && bool) ||
(expression.operator === "||" && !bool);
if (
!param.couldHaveSideEffects() &&
(param.isBoolean() || keepRight)
) {
// for case like
//
// return'development'===process.env.NODE_ENV&&'foo'
//
// we need a space before the bool to prevent result like
//
// returnfalse&&'foo'
//
const dep = new ConstDependency(
` ${bool}`,
/** @type {Range} */ (param.range)
);
dep.loc = /** @type {SourceLocation} */ (expression.loc);
parser.state.module.addPresentationalDependency(dep);
} else {
parser.walkExpression(expression.left);
}
if (!keepRight) {
const dep = new ConstDependency(
"0",
/** @type {Range} */ (expression.right.range)
);
dep.loc = /** @type {SourceLocation} */ (expression.loc);
parser.state.module.addPresentationalDependency(dep);
}
return keepRight;
}
} else if (expression.operator === "??") {
const param = parser.evaluateExpression(expression.left);
const keepRight = param.asNullish();
if (typeof keepRight === "boolean") {
// ------------------------------------------
//
// Given the following code:
//
// nonNullish ?? someExpression();
//
// the generated code is:
//
// nonNullish ?? 0;
//
// ------------------------------------------
//
// Given the following code:
//
// nullish ?? someExpression();
//
// the generated code is:
//
// null ?? someExpression();
//
if (!param.couldHaveSideEffects() && keepRight) {
// cspell:word returnnull
// for case like
//
// return('development'===process.env.NODE_ENV&&null)??'foo'
//
// we need a space before the bool to prevent result like
//
// returnnull??'foo'
//
const dep = new ConstDependency(
" null",
/** @type {Range} */ (param.range)
);
dep.loc = /** @type {SourceLocation} */ (expression.loc);
parser.state.module.addPresentationalDependency(dep);
} else {
const dep = new ConstDependency(
"0",
/** @type {Range} */ (expression.right.range)
);
dep.loc = /** @type {SourceLocation} */ (expression.loc);
parser.state.module.addPresentationalDependency(dep);
parser.walkExpression(expression.left);
}
return keepRight;
}
}
}
);
parser.hooks.optionalChaining.tap(PLUGIN_NAME, (expr) => {
/** @type {Expression[]} */
const optionalExpressionsStack = [];
/** @type {Expression | Super} */
let next = expr.expression;
while (
next.type === "MemberExpression" ||
next.type === "CallExpression"
) {
if (next.type === "MemberExpression") {
if (next.optional) {
// SuperNode can not be optional
optionalExpressionsStack.push(
/** @type {Expression} */ (next.object)
);
}
next = next.object;
} else {
if (next.optional) {
// SuperNode can not be optional
optionalExpressionsStack.push(
/** @type {Expression} */ (next.callee)
);
}
next = next.callee;
}
}
while (optionalExpressionsStack.length) {
const expression = optionalExpressionsStack.pop();
const evaluated = parser.evaluateExpression(
/** @type {Expression} */ (expression)
);
if (evaluated.asNullish()) {
// ------------------------------------------
//
// Given the following code:
//
// nullishMemberChain?.a.b();
//
// the generated code is:
//
// undefined;
//
// ------------------------------------------
//
const dep = new ConstDependency(
" undefined",
/** @type {Range} */ (expr.range)
);
dep.loc = /** @type {SourceLocation} */ (expr.loc);
parser.state.module.addPresentationalDependency(dep);
return true;
}
}
});
parser.hooks.evaluateIdentifier
.for("__resourceQuery")
.tap(PLUGIN_NAME, (expr) => {
if (parser.scope.isAsmJs) return;
if (!parser.state.module) return;
return evaluateToString(
cachedParseResource(parser.state.module.resource).query
)(expr);
});
parser.hooks.expression
.for("__resourceQuery")
.tap(PLUGIN_NAME, (expr) => {
if (parser.scope.isAsmJs) return;
if (!parser.state.module) return;
const dep = new CachedConstDependency(
JSON.stringify(
cachedParseResource(parser.state.module.resource).query
),
/** @type {Range} */ (expr.range),
"__resourceQuery"
);
dep.loc = /** @type {SourceLocation} */ (expr.loc);
parser.state.module.addPresentationalDependency(dep);
return true;
});
parser.hooks.evaluateIdentifier
.for("__resourceFragment")
.tap(PLUGIN_NAME, (expr) => {
if (parser.scope.isAsmJs) return;
if (!parser.state.module) return;
return evaluateToString(
cachedParseResource(parser.state.module.resource).fragment
)(expr);
});
parser.hooks.expression
.for("__resourceFragment")
.tap(PLUGIN_NAME, (expr) => {
if (parser.scope.isAsmJs) return;
if (!parser.state.module) return;
const dep = new CachedConstDependency(
JSON.stringify(
cachedParseResource(parser.state.module.resource).fragment
),
/** @type {Range} */ (expr.range),
"__resourceFragment"
);
dep.loc = /** @type {SourceLocation} */ (expr.loc);
parser.state.module.addPresentationalDependency(dep);
return true;
});
};
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_AUTO)
.tap(PLUGIN_NAME, handler);
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_DYNAMIC)
.tap(PLUGIN_NAME, handler);
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_ESM)
.tap(PLUGIN_NAME, handler);
}
);
}
/**
* Eliminate an unused statement.
* @param {JavascriptParser} parser the parser
* @param {Statement} statement the statement to remove
* @param {boolean} alwaysInBlock whether to always generate curly brackets
* @returns {void}
*/
eliminateUnusedStatement(parser, statement, alwaysInBlock) {
// Before removing the unused branch, the hoisted declarations
// must be collected.
//
// Given the following code:
//
// if (true) f() else g()
// if (false) {
// function f() {}
// const g = function g() {}
// if (someTest) {
// let a = 1
// var x, {y, z} = obj
// }
// } else {
// …
// }
//
// the generated code is:
//
// if (true) f() else {}
// if (false) {
// var f, x, y, z; (in loose mode)
// var x, y, z; (in strict mode)
// } else {
// …
// }
//
// NOTE: When code runs in strict mode, `var` declarations
// are hoisted but `function` declarations don't.
//
const declarations = parser.scope.isStrict
? getHoistedDeclarations(statement, false)
: getHoistedDeclarations(statement, true);
const inBlock = alwaysInBlock || statement.type === "BlockStatement";
let replacement = inBlock ? "{" : "";
replacement +=
declarations.length > 0 ? ` var ${declarations.join(", ")}; ` : "";
replacement += inBlock ? "}" : "";
const dep = new ConstDependency(
`// removed by dead control flow\n${replacement}`,
/** @type {Range} */ (statement.range)
);
dep.loc = /** @type {SourceLocation} */ (statement.loc);
parser.state.module.addPresentationalDependency(dep);
}
}
module.exports = ConstPlugin;

View File

@@ -0,0 +1,57 @@
'use strict';
const { parseContentType } = require('./utils.js');
function getInstance(cfg) {
const headers = cfg.headers;
const conType = parseContentType(headers['content-type']);
if (!conType)
throw new Error('Malformed content type');
for (const type of TYPES) {
const matched = type.detect(conType);
if (!matched)
continue;
const instanceCfg = {
limits: cfg.limits,
headers,
conType,
highWaterMark: undefined,
fileHwm: undefined,
defCharset: undefined,
defParamCharset: undefined,
preservePath: false,
};
if (cfg.highWaterMark)
instanceCfg.highWaterMark = cfg.highWaterMark;
if (cfg.fileHwm)
instanceCfg.fileHwm = cfg.fileHwm;
instanceCfg.defCharset = cfg.defCharset;
instanceCfg.defParamCharset = cfg.defParamCharset;
instanceCfg.preservePath = cfg.preservePath;
return new type(instanceCfg);
}
throw new Error(`Unsupported content type: ${headers['content-type']}`);
}
// Note: types are explicitly listed here for easier bundling
// See: https://github.com/mscdex/busboy/issues/121
const TYPES = [
require('./types/multipart'),
require('./types/urlencoded'),
].filter(function(typemod) { return typeof typemod.detect === 'function'; });
module.exports = (cfg) => {
if (typeof cfg !== 'object' || cfg === null)
cfg = {};
if (typeof cfg.headers !== 'object'
|| cfg.headers === null
|| typeof cfg.headers['content-type'] !== 'string') {
throw new Error('Missing Content-Type');
}
return getInstance(cfg);
};

View File

@@ -0,0 +1,13 @@
import { Tracer } from './tracer';
import { TracerOptions } from './tracer_options';
import { TracerProvider } from './tracer_provider';
/**
* An implementation of the {@link TracerProvider} which returns an impotent
* Tracer for all calls to `getTracer`.
*
* All operations are no-op.
*/
export declare class NoopTracerProvider implements TracerProvider {
getTracer(_name?: string, _version?: string, _options?: TracerOptions): Tracer;
}
//# sourceMappingURL=NoopTracerProvider.d.ts.map

View File

@@ -0,0 +1,4 @@
export declare const previousThursday: import("./types.js").FPFn1<
Date,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","names":[],"sources":["../../../src/views/Edit/types.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from 'payload'\n\nexport type IndexProps = {\n collection: SanitizedCollectionConfig\n isEditing?: boolean\n}\n"],"mappings":"AAEA","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","React","useTranslation","Button","baseClass","ListSelection_v4","t0","$","count","ListActions","SelectionActions","t","t1","_jsxs","className","children","_jsx","label","length","Fragment","ListSelectionButton","props","buttonStyle","filter","Boolean","join"],"sources":["../../../src/elements/ListSelection/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport type { Props as ButtonProps } from '../Button/types.js'\n\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { Button } from '../Button/index.js'\nimport './index.scss'\n\nconst baseClass = 'list-selection'\n\ntype ListSelection_v4Props = {\n /**\n * The count of selected items\n */\n readonly count: number\n /**\n * Actions that apply to the list as a whole\n *\n * @example select all, clear selection\n */\n readonly ListActions?: React.ReactNode[]\n /**\n * Actions that apply to the selected items\n *\n * @example edit, delete, publish, unpublish\n */\n readonly SelectionActions?: React.ReactNode[]\n}\nexport function ListSelection_v4({ count, ListActions, SelectionActions }: ListSelection_v4Props) {\n const { t } = useTranslation()\n\n return (\n <div className={baseClass}>\n <span>{t('general:selectedCount', { count, label: '' })}</span>\n {ListActions && ListActions.length > 0 && (\n <React.Fragment>\n <span>&mdash;</span>\n <div className={`${baseClass}__actions`}>{ListActions}</div>\n </React.Fragment>\n )}\n {SelectionActions && SelectionActions.length > 0 && (\n <React.Fragment>\n <span>&mdash;</span>\n <div className={`${baseClass}__actions`}>{SelectionActions}</div>\n </React.Fragment>\n )}\n </div>\n )\n}\n\ntype ListSelectionButtonProps = {} & ButtonProps\nexport function ListSelectionButton({ children, className, ...props }: ListSelectionButtonProps) {\n return (\n <Button\n {...props}\n buttonStyle=\"none\"\n className={[`${baseClass}__button`, className].filter(Boolean).join(' ')}\n >\n {children}\n </Button>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,MAAW;AAIlB,SAASC,cAAc,QAAQ;AAC/B,SAASC,MAAM,QAAQ;AACvB,OAAO;AAEP,MAAMC,SAAA,GAAY;AAoBlB,OAAO,SAAAC,iBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAA0B;IAAAQ,KAAA;IAAAC,WAAA;IAAAC;EAAA,IAAAJ,EAA+D;EAC9F;IAAAK;EAAA,IAAcT,cAAA;EAAA,IAAAU,EAAA;EAAA,IAAAL,CAAA,QAAAE,WAAA,IAAAF,CAAA,QAAAG,gBAAA,IAAAH,CAAA,QAAAC,KAAA,IAAAD,CAAA,QAAAI,CAAA;IAGZC,EAAA,GAAAC,KAAA,CAAC;MAAAC,SAAA,EAAAV,SAAA;MAAAW,QAAA,GACCC,IAAA,CAAC;QAAAD,QAAA,EAAMJ,CAAA,CAAE;UAAAH,KAAA;UAAAS,KAAA,EAAyC;QAAA,CAAG;MAAA,C,GACpDR,WAAA,IAAeA,WAAA,CAAAS,MAAA,IAAqB,IACnCL,KAAA,CAAAZ,KAAA,CAAAkB,QAAA;QAAAJ,QAAA,GACEC,IAAA,CAAC;UAAAD,QAAA,EAAK;QAAA,C,GACNC,IAAA,CAAC;UAAAF,SAAA,EAAe,GAAAV,SAAA,WAAuB;UAAAW,QAAA,EAAGN;QAAA,C;UAG7CC,gBAAA,IAAoBA,gBAAA,CAAAQ,MAAA,IAA0B,IAC7CL,KAAA,CAAAZ,KAAA,CAAAkB,QAAA;QAAAJ,QAAA,GACEC,IAAA,CAAC;UAAAD,QAAA,EAAK;QAAA,C,GACNC,IAAA,CAAC;UAAAF,SAAA,EAAe,GAAAV,SAAA,WAAuB;UAAAW,QAAA,EAAGL;QAAA,C;;;;;;;;;;;SAXhDE,E;;AAmBJ,OAAO,SAASQ,oBAAoB;EAAEL,QAAQ;EAAED,SAAS;EAAE,GAAGO;AAAA,CAAiC;EAC7F,oBACEL,IAAA,CAACb,MAAA;IACE,GAAGkB,KAAK;IACTC,WAAA,EAAY;IACZR,SAAA,EAAW,CAAC,GAAGV,SAAA,UAAmB,EAAEU,SAAA,CAAU,CAACS,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;cAEnEV;;AAGP","ignoreList":[]}

View File

@@ -0,0 +1,39 @@
import type { Interval, StepOptions } from "./types.js";
/**
* The {@link eachMonthOfInterval} function options.
*/
export interface EachMonthOfIntervalOptions extends StepOptions {}
/**
* @name eachMonthOfInterval
* @category Interval Helpers
* @summary Return the array of months within the specified time interval.
*
* @description
* Return the array of months within the specified time interval.
*
* @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 interval - The interval
*
* @returns The array with starts of months from the month of the interval start to the month of the interval end
*
* @example
* // Each month between 6 February 2014 and 10 August 2014:
* const result = eachMonthOfInterval({
* start: new Date(2014, 1, 6),
* end: new Date(2014, 7, 10)
* })
* //=> [
* // Sat Feb 01 2014 00:00:00,
* // Sat Mar 01 2014 00:00:00,
* // Tue Apr 01 2014 00:00:00,
* // Thu May 01 2014 00:00:00,
* // Sun Jun 01 2014 00:00:00,
* // Tue Jul 01 2014 00:00:00,
* // Fri Aug 01 2014 00:00:00
* // ]
*/
export declare function eachMonthOfInterval<DateType extends Date>(
interval: Interval<DateType>,
options?: EachMonthOfIntervalOptions,
): DateType[];

View File

@@ -0,0 +1,781 @@
"use strict";
exports.formatters = void 0;
var _index = require("../../getDayOfYear.js");
var _index2 = require("../../getISOWeek.js");
var _index3 = require("../../getISOWeekYear.js");
var _index4 = require("../../getWeek.js");
var _index5 = require("../../getWeekYear.js");
var _index6 = require("../addLeadingZeros.js");
var _index7 = require("./lightFormatters.js");
const dayPeriodEnum = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
};
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | Milliseconds in day |
* | b | AM, PM, noon, midnight | B | Flexible day period |
* | c | Stand-alone local day of week | C* | Localized hour w/ day period |
* | d | Day of month | D | Day of year |
* | e | Local day of week | E | Day of week |
* | f | | F* | Day of week in month |
* | g* | Modified Julian day | G | Era |
* | h | Hour [1-12] | H | Hour [0-23] |
* | i! | ISO day of week | I! | ISO week of year |
* | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
* | k | Hour [1-24] | K | Hour [0-11] |
* | l* | (deprecated) | L | Stand-alone month |
* | m | Minute | M | Month |
* | n | | N | |
* | o! | Ordinal number modifier | O | Timezone (GMT) |
* | p! | Long localized time | P! | Long localized date |
* | q | Stand-alone quarter | Q | Quarter |
* | r* | Related Gregorian year | R! | ISO week-numbering year |
* | s | Second | S | Fraction of second |
* | t! | Seconds timestamp | T! | Milliseconds timestamp |
* | u | Extended year | U* | Cyclic year |
* | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
* | w | Local week of year | W* | Week of month |
* | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
* | y | Year (abs) | Y | Local week-numbering year |
* | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*
* Letters marked by ! are non-standard, but implemented by date-fns:
* - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
* - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
* i.e. 7 for Sunday, 1 for Monday, etc.
* - `I` is ISO week of year, as opposed to `w` which is local week of year.
* - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
* `R` is supposed to be used in conjunction with `I` and `i`
* for universal ISO week-numbering date, whereas
* `Y` is supposed to be used in conjunction with `w` and `e`
* for week-numbering date specific to the locale.
* - `P` is long localized date format
* - `p` is long localized time format
*/
const formatters = (exports.formatters = {
// Era
G: function (date, token, localize) {
const era = date.getFullYear() > 0 ? 1 : 0;
switch (token) {
// AD, BC
case "G":
case "GG":
case "GGG":
return localize.era(era, { width: "abbreviated" });
// A, B
case "GGGGG":
return localize.era(era, { width: "narrow" });
// Anno Domini, Before Christ
case "GGGG":
default:
return localize.era(era, { width: "wide" });
}
},
// Year
y: function (date, token, localize) {
// Ordinal number
if (token === "yo") {
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return localize.ordinalNumber(year, { unit: "year" });
}
return _index7.lightFormatters.y(date, token);
},
// Local week-numbering year
Y: function (date, token, localize, options) {
const signedWeekYear = (0, _index5.getWeekYear)(date, options);
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
// Two digit year
if (token === "YY") {
const twoDigitYear = weekYear % 100;
return (0, _index6.addLeadingZeros)(twoDigitYear, 2);
}
// Ordinal number
if (token === "Yo") {
return localize.ordinalNumber(weekYear, { unit: "year" });
}
// Padding
return (0, _index6.addLeadingZeros)(weekYear, token.length);
},
// ISO week-numbering year
R: function (date, token) {
const isoWeekYear = (0, _index3.getISOWeekYear)(date);
// Padding
return (0, _index6.addLeadingZeros)(isoWeekYear, token.length);
},
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 | 1 | 1 |
// | BC 1 | 1 | 0 |
// | BC 2 | 2 | -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function (date, token) {
const year = date.getFullYear();
return (0, _index6.addLeadingZeros)(year, token.length);
},
// Quarter
Q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "Q":
return String(quarter);
// 01, 02, 03, 04
case "QQ":
return (0, _index6.addLeadingZeros)(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "Qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "QQQ":
return localize.quarter(quarter, {
width: "abbreviated",
context: "formatting",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "QQQQQ":
return localize.quarter(quarter, {
width: "narrow",
context: "formatting",
});
// 1st quarter, 2nd quarter, ...
case "QQQQ":
default:
return localize.quarter(quarter, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone quarter
q: function (date, token, localize) {
const quarter = Math.ceil((date.getMonth() + 1) / 3);
switch (token) {
// 1, 2, 3, 4
case "q":
return String(quarter);
// 01, 02, 03, 04
case "qq":
return (0, _index6.addLeadingZeros)(quarter, 2);
// 1st, 2nd, 3rd, 4th
case "qo":
return localize.ordinalNumber(quarter, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "qqq":
return localize.quarter(quarter, {
width: "abbreviated",
context: "standalone",
});
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "qqqqq":
return localize.quarter(quarter, {
width: "narrow",
context: "standalone",
});
// 1st quarter, 2nd quarter, ...
case "qqqq":
default:
return localize.quarter(quarter, {
width: "wide",
context: "standalone",
});
}
},
// Month
M: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
case "M":
case "MM":
return _index7.lightFormatters.M(date, token);
// 1st, 2nd, ..., 12th
case "Mo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "MMM":
return localize.month(month, {
width: "abbreviated",
context: "formatting",
});
// J, F, ..., D
case "MMMMM":
return localize.month(month, {
width: "narrow",
context: "formatting",
});
// January, February, ..., December
case "MMMM":
default:
return localize.month(month, { width: "wide", context: "formatting" });
}
},
// Stand-alone month
L: function (date, token, localize) {
const month = date.getMonth();
switch (token) {
// 1, 2, ..., 12
case "L":
return String(month + 1);
// 01, 02, ..., 12
case "LL":
return (0, _index6.addLeadingZeros)(month + 1, 2);
// 1st, 2nd, ..., 12th
case "Lo":
return localize.ordinalNumber(month + 1, { unit: "month" });
// Jan, Feb, ..., Dec
case "LLL":
return localize.month(month, {
width: "abbreviated",
context: "standalone",
});
// J, F, ..., D
case "LLLLL":
return localize.month(month, {
width: "narrow",
context: "standalone",
});
// January, February, ..., December
case "LLLL":
default:
return localize.month(month, { width: "wide", context: "standalone" });
}
},
// Local week of year
w: function (date, token, localize, options) {
const week = (0, _index4.getWeek)(date, options);
if (token === "wo") {
return localize.ordinalNumber(week, { unit: "week" });
}
return (0, _index6.addLeadingZeros)(week, token.length);
},
// ISO week of year
I: function (date, token, localize) {
const isoWeek = (0, _index2.getISOWeek)(date);
if (token === "Io") {
return localize.ordinalNumber(isoWeek, { unit: "week" });
}
return (0, _index6.addLeadingZeros)(isoWeek, token.length);
},
// Day of the month
d: function (date, token, localize) {
if (token === "do") {
return localize.ordinalNumber(date.getDate(), { unit: "date" });
}
return _index7.lightFormatters.d(date, token);
},
// Day of year
D: function (date, token, localize) {
const dayOfYear = (0, _index.getDayOfYear)(date);
if (token === "Do") {
return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
}
return (0, _index6.addLeadingZeros)(dayOfYear, token.length);
},
// Day of week
E: function (date, token, localize) {
const dayOfWeek = date.getDay();
switch (token) {
// Tue
case "E":
case "EE":
case "EEE":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "EEEEE":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "EEEEEE":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "EEEE":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Local day of week
e: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (Nth day of week with current locale or weekStartsOn)
case "e":
return String(localDayOfWeek);
// Padded numerical value
case "ee":
return (0, _index6.addLeadingZeros)(localDayOfWeek, 2);
// 1st, 2nd, ..., 7th
case "eo":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "eee":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "eeeee":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "eeeeee":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "eeee":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// Stand-alone local day of week
c: function (date, token, localize, options) {
const dayOfWeek = date.getDay();
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
// Numerical value (same as in `e`)
case "c":
return String(localDayOfWeek);
// Padded numerical value
case "cc":
return (0, _index6.addLeadingZeros)(localDayOfWeek, token.length);
// 1st, 2nd, ..., 7th
case "co":
return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
case "ccc":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "standalone",
});
// T
case "ccccc":
return localize.day(dayOfWeek, {
width: "narrow",
context: "standalone",
});
// Tu
case "cccccc":
return localize.day(dayOfWeek, {
width: "short",
context: "standalone",
});
// Tuesday
case "cccc":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "standalone",
});
}
},
// ISO day of week
i: function (date, token, localize) {
const dayOfWeek = date.getDay();
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
switch (token) {
// 2
case "i":
return String(isoDayOfWeek);
// 02
case "ii":
return (0, _index6.addLeadingZeros)(isoDayOfWeek, token.length);
// 2nd
case "io":
return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
// Tue
case "iii":
return localize.day(dayOfWeek, {
width: "abbreviated",
context: "formatting",
});
// T
case "iiiii":
return localize.day(dayOfWeek, {
width: "narrow",
context: "formatting",
});
// Tu
case "iiiiii":
return localize.day(dayOfWeek, {
width: "short",
context: "formatting",
});
// Tuesday
case "iiii":
default:
return localize.day(dayOfWeek, {
width: "wide",
context: "formatting",
});
}
},
// AM or PM
a: function (date, token, localize) {
const hours = date.getHours();
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "aaa":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "aaaaa":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "aaaa":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// AM, PM, midnight, noon
b: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours === 12) {
dayPeriodEnumValue = dayPeriodEnum.noon;
} else if (hours === 0) {
dayPeriodEnumValue = dayPeriodEnum.midnight;
} else {
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
}
switch (token) {
case "b":
case "bb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "bbb":
return localize
.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
})
.toLowerCase();
case "bbbbb":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "bbbb":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function (date, token, localize) {
const hours = date.getHours();
let dayPeriodEnumValue;
if (hours >= 17) {
dayPeriodEnumValue = dayPeriodEnum.evening;
} else if (hours >= 12) {
dayPeriodEnumValue = dayPeriodEnum.afternoon;
} else if (hours >= 4) {
dayPeriodEnumValue = dayPeriodEnum.morning;
} else {
dayPeriodEnumValue = dayPeriodEnum.night;
}
switch (token) {
case "B":
case "BB":
case "BBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting",
});
case "BBBBB":
return localize.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting",
});
case "BBBB":
default:
return localize.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting",
});
}
},
// Hour [1-12]
h: function (date, token, localize) {
if (token === "ho") {
let hours = date.getHours() % 12;
if (hours === 0) hours = 12;
return localize.ordinalNumber(hours, { unit: "hour" });
}
return _index7.lightFormatters.h(date, token);
},
// Hour [0-23]
H: function (date, token, localize) {
if (token === "Ho") {
return localize.ordinalNumber(date.getHours(), { unit: "hour" });
}
return _index7.lightFormatters.H(date, token);
},
// Hour [0-11]
K: function (date, token, localize) {
const hours = date.getHours() % 12;
if (token === "Ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return (0, _index6.addLeadingZeros)(hours, token.length);
},
// Hour [1-24]
k: function (date, token, localize) {
let hours = date.getHours();
if (hours === 0) hours = 24;
if (token === "ko") {
return localize.ordinalNumber(hours, { unit: "hour" });
}
return (0, _index6.addLeadingZeros)(hours, token.length);
},
// Minute
m: function (date, token, localize) {
if (token === "mo") {
return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
}
return _index7.lightFormatters.m(date, token);
},
// Second
s: function (date, token, localize) {
if (token === "so") {
return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
}
return _index7.lightFormatters.s(date, token);
},
// Fraction of second
S: function (date, token) {
return _index7.lightFormatters.S(date, token);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
if (timezoneOffset === 0) {
return "Z";
}
switch (token) {
// Hours and optional minutes
case "X":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XX`
case "XXXX":
case "XX": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `XXX`
case "XXXXX":
case "XXX": // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ":");
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Hours and optional minutes
case "x":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
// Hours, minutes and optional seconds without `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xx`
case "xxxx":
case "xx": // Hours and minutes without `:` delimiter
return formatTimezone(timezoneOffset);
// Hours, minutes and optional seconds with `:` delimiter
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
// so this token always has the same output as `xxx`
case "xxxxx":
case "xxx": // Hours and minutes with `:` delimiter
default:
return formatTimezone(timezoneOffset, ":");
}
},
// Timezone (GMT)
O: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "O":
case "OO":
case "OOO":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
// Long
case "OOOO":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
// Timezone (specific non-location)
z: function (date, token, _localize) {
const timezoneOffset = date.getTimezoneOffset();
switch (token) {
// Short
case "z":
case "zz":
case "zzz":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
// Long
case "zzzz":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
// Seconds timestamp
t: function (date, token, _localize) {
const timestamp = Math.trunc(date.getTime() / 1000);
return (0, _index6.addLeadingZeros)(timestamp, token.length);
},
// Milliseconds timestamp
T: function (date, token, _localize) {
const timestamp = date.getTime();
return (0, _index6.addLeadingZeros)(timestamp, token.length);
},
});
function formatTimezoneShort(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = Math.trunc(absOffset / 60);
const minutes = absOffset % 60;
if (minutes === 0) {
return sign + String(hours);
}
return (
sign + String(hours) + delimiter + (0, _index6.addLeadingZeros)(minutes, 2)
);
}
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
if (offset % 60 === 0) {
const sign = offset > 0 ? "-" : "+";
return sign + (0, _index6.addLeadingZeros)(Math.abs(offset) / 60, 2);
}
return formatTimezone(offset, delimiter);
}
function formatTimezone(offset, delimiter = "") {
const sign = offset > 0 ? "-" : "+";
const absOffset = Math.abs(offset);
const hours = (0, _index6.addLeadingZeros)(Math.trunc(absOffset / 60), 2);
const minutes = (0, _index6.addLeadingZeros)(absOffset % 60, 2);
return sign + hours + delimiter + minutes;
}

View File

@@ -0,0 +1,53 @@
var pump = require('./index')
var rs = require('fs').createReadStream('/dev/random')
var ws = require('fs').createWriteStream('/dev/null')
var toHex = function () {
var reverse = new (require('stream').Transform)()
reverse._transform = function (chunk, enc, callback) {
reverse.push(chunk.toString('hex'))
callback()
}
return reverse
}
var wsClosed = false
var rsClosed = false
var callbackCalled = false
var check = function () {
if (wsClosed && rsClosed && callbackCalled) {
console.log('test-node.js passes')
clearTimeout(timeout)
}
}
ws.on('close', function () {
wsClosed = true
check()
})
rs.on('close', function () {
rsClosed = true
check()
})
var res = pump(rs, toHex(), toHex(), toHex(), ws, function () {
callbackCalled = true
check()
})
if (res !== ws) {
throw new Error('should return last stream')
}
setTimeout(function () {
rs.destroy()
}, 1000)
var timeout = setTimeout(function () {
throw new Error('timeout')
}, 5000)

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["notFound","renderListView","TrashView","args","List","TrashList","enableRowSelections","trash","viewType","error","message","console"],"sources":["../../../src/views/CollectionTrash/index.tsx"],"sourcesContent":["import type { AdminViewServerProps, ListQuery } from 'payload'\nimport type React from 'react'\n\nimport { notFound } from 'next/navigation.js'\n\nimport { renderListView } from '../List/index.js'\n\ntype RenderTrashViewArgs = {\n customCellProps?: Record<string, any>\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n disableQueryPresets?: boolean\n drawerSlug?: string\n enableRowSelections: boolean\n overrideEntityVisibility?: boolean\n query: ListQuery\n redirectAfterDelete?: boolean\n redirectAfterDuplicate?: boolean\n redirectAfterRestore?: boolean\n} & AdminViewServerProps\n\nexport const TrashView: React.FC<Omit<RenderTrashViewArgs, 'enableRowSelections'>> = async (\n args,\n) => {\n try {\n const { List: TrashList } = await renderListView({\n ...args,\n enableRowSelections: true,\n trash: true,\n viewType: 'trash',\n })\n\n return TrashList\n } catch (error) {\n if (error.message === 'not-found') {\n notFound()\n }\n console.error(error) // eslint-disable-line no-console\n }\n}\n"],"mappings":"AAGA,SAASA,QAAQ,QAAQ;AAEzB,SAASC,cAAc,QAAQ;AAgB/B,OAAO,MAAMC,SAAA,GAAwE,MACnFC,IAAA;EAEA,IAAI;IACF,MAAM;MAAEC,IAAA,EAAMC;IAAS,CAAE,GAAG,MAAMJ,cAAA,CAAe;MAC/C,GAAGE,IAAI;MACPG,mBAAA,EAAqB;MACrBC,KAAA,EAAO;MACPC,QAAA,EAAU;IACZ;IAEA,OAAOH,SAAA;EACT,EAAE,OAAOI,KAAA,EAAO;IACd,IAAIA,KAAA,CAAMC,OAAO,KAAK,aAAa;MACjCV,QAAA;IACF;IACAW,OAAA,CAAQF,KAAK,CAACA,KAAA,GAAO;EACvB;AACF","ignoreList":[]}

View File

@@ -0,0 +1,83 @@
import { generateTraceId, generateSpanId } from '../utils/propagationContext.js';
import { TRACE_FLAG_NONE } from '../utils/spanUtils.js';
/**
* A Sentry Span that is non-recording, meaning it will not be sent to Sentry.
*/
class SentryNonRecordingSpan {
constructor(spanContext = {}) {
this._traceId = spanContext.traceId || generateTraceId();
this._spanId = spanContext.spanId || generateSpanId();
}
/** @inheritdoc */
spanContext() {
return {
spanId: this._spanId,
traceId: this._traceId,
traceFlags: TRACE_FLAG_NONE,
};
}
/** @inheritdoc */
end(_timestamp) {}
/** @inheritdoc */
setAttribute(_key, _value) {
return this;
}
/** @inheritdoc */
setAttributes(_values) {
return this;
}
/** @inheritdoc */
setStatus(_status) {
return this;
}
/** @inheritdoc */
updateName(_name) {
return this;
}
/** @inheritdoc */
isRecording() {
return false;
}
/** @inheritdoc */
addEvent(
_name,
_attributesOrStartTime,
_startTime,
) {
return this;
}
/** @inheritDoc */
addLink(_link) {
return this;
}
/** @inheritDoc */
addLinks(_links) {
return this;
}
/**
* This should generally not be used,
* but we need it for being compliant with the OTEL Span interface.
*
* @hidden
* @internal
*/
recordException(_exception, _time) {
// noop
}
}
export { SentryNonRecordingSpan };
//# sourceMappingURL=sentryNonRecordingSpan.js.map

View File

@@ -0,0 +1 @@
Prism.languages["firestore-security-rules"]=Prism.languages.extend("clike",{comment:/\/\/.*/,keyword:/\b(?:allow|function|if|match|null|return|rules_version|service)\b/,operator:/&&|\|\||[<>!=]=?|[-+*/%]|\b(?:in|is)\b/}),delete Prism.languages["firestore-security-rules"]["class-name"],Prism.languages.insertBefore("firestore-security-rules","keyword",{path:{pattern:/(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/,lookbehind:!0,greedy:!0,inside:{variable:{pattern:/\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/,inside:{operator:/=/,keyword:/\*\*/,punctuation:/[.$(){}]/}},punctuation:/\//}},method:{pattern:/(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/,lookbehind:!0,alias:"builtin",inside:{punctuation:/,/}}});

View File

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

View File

@@ -0,0 +1,8 @@
import { InstrumentationConfig } from '@opentelemetry/instrumentation';
export interface KnexInstrumentationConfig extends InstrumentationConfig {
/** max query length in db.statement attribute ".." is added to the end when query is truncated */
maxQueryLength?: number;
/** only create spans if part of an existing trace */
requireParentSpan?: boolean;
}
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1,32 @@
"use strict";
exports.endOfQuarter = endOfQuarter;
var _index = require("./toDate.js");
/**
* @name endOfQuarter
* @category Quarter Helpers
* @summary Return the end of a year quarter for the given date.
*
* @description
* Return the end of a year quarter for the given date.
* The result will be in the local timezone.
*
* @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 original date
*
* @returns The end of a quarter
*
* @example
* // The end of a quarter for 2 September 2014 11:55:00:
* const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0))
* //=> Tue Sep 30 2014 23:59:59.999
*/
function endOfQuarter(date) {
const _date = (0, _index.toDate)(date);
const currentMonth = _date.getMonth();
const month = currentMonth - (currentMonth % 3) + 3;
_date.setMonth(month, 0);
_date.setHours(23, 59, 59, 999);
return _date;
}

View File

@@ -0,0 +1,2 @@
import{throwIfEmpty as e}from"../../utils/throw-if-empty.js";const t=e=>()=>({path:`/dashboards`,params:e??{},method:`GET`}),n=(t,n)=>()=>(e(String(t),`Key cannot be empty`),{path:`/dashboards/${t}`,params:n??{},method:`GET`});export{n as readDashboard,t as readDashboards};
//# sourceMappingURL=dashboards.js.map

View File

@@ -0,0 +1,106 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "ALIAS_KEYS", {
enumerable: true,
get: function () {
return _utils.ALIAS_KEYS;
}
});
Object.defineProperty(exports, "BUILDER_KEYS", {
enumerable: true,
get: function () {
return _utils.BUILDER_KEYS;
}
});
Object.defineProperty(exports, "DEPRECATED_ALIASES", {
enumerable: true,
get: function () {
return _deprecatedAliases.DEPRECATED_ALIASES;
}
});
Object.defineProperty(exports, "DEPRECATED_KEYS", {
enumerable: true,
get: function () {
return _utils.DEPRECATED_KEYS;
}
});
Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
enumerable: true,
get: function () {
return _utils.FLIPPED_ALIAS_KEYS;
}
});
Object.defineProperty(exports, "NODE_FIELDS", {
enumerable: true,
get: function () {
return _utils.NODE_FIELDS;
}
});
Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", {
enumerable: true,
get: function () {
return _utils.NODE_PARENT_VALIDATIONS;
}
});
Object.defineProperty(exports, "NODE_UNION_SHAPES__PRIVATE", {
enumerable: true,
get: function () {
return _utils.NODE_UNION_SHAPES__PRIVATE;
}
});
Object.defineProperty(exports, "PLACEHOLDERS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS;
}
});
Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS_ALIAS;
}
});
Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", {
enumerable: true,
get: function () {
return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
}
});
exports.TYPES = void 0;
Object.defineProperty(exports, "VISITOR_KEYS", {
enumerable: true,
get: function () {
return _utils.VISITOR_KEYS;
}
});
require("./core.js");
require("./flow.js");
require("./jsx.js");
require("./misc.js");
require("./experimental.js");
require("./typescript.js");
var _utils = require("./utils.js");
var _placeholders = require("./placeholders.js");
var _deprecatedAliases = require("./deprecated-aliases.js");
Object.keys(_deprecatedAliases.DEPRECATED_ALIASES).forEach(deprecatedAlias => {
_utils.FLIPPED_ALIAS_KEYS[deprecatedAlias] = _utils.FLIPPED_ALIAS_KEYS[_deprecatedAliases.DEPRECATED_ALIASES[deprecatedAlias]];
});
for (const {
types,
set
} of _utils.allExpandedTypes) {
for (const type of types) {
const aliases = _utils.FLIPPED_ALIAS_KEYS[type];
if (aliases) {
aliases.forEach(set.add, set);
} else {
set.add(type);
}
}
}
const TYPES = exports.TYPES = [].concat(Object.keys(_utils.VISITOR_KEYS), Object.keys(_utils.FLIPPED_ALIAS_KEYS), Object.keys(_utils.DEPRECATED_KEYS));
//# sourceMappingURL=index.js.map

View File

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

View File

@@ -0,0 +1,183 @@
'use strict'
const { describe, test } = require('node:test')
const filterLog = require('./filter-log')
const context = {
includeKeys: undefined,
ignoreKeys: undefined
}
const logData = {
level: 30,
time: 1522431328992,
data1: {
data2: { 'data-3': 'bar' },
error: new Error('test')
}
}
const logData2 = Object.assign({
'logging.domain.corp/operation': {
id: 'foo',
producer: 'bar'
}
}, logData)
describe('#filterLog with an ignoreKeys option', () => {
test('filterLog removes single entry', t => {
const result = filterLog({
log: logData,
context: {
...context,
ignoreKeys: ['data1.data2.data-3']
}
})
t.assert.deepStrictEqual(result, { level: 30, time: 1522431328992, data1: { data2: { }, error: new Error('test') } })
})
test('filterLog removes multiple entries', t => {
const result = filterLog({
log: logData,
context: {
...context,
ignoreKeys: ['time', 'data1']
}
})
t.assert.deepStrictEqual(result, { level: 30 })
})
test('filterLog keeps error instance', t => {
const result = filterLog({
log: logData,
context: {
...context,
ignoreKeys: []
}
})
t.assert.strictEqual(logData.data1.error, result.data1.error)
})
test('filterLog removes entry with escape sequence', t => {
const result = filterLog({
log: logData2,
context: {
...context,
ignoreKeys: ['data1', 'logging\\.domain\\.corp/operation']
}
})
t.assert.deepStrictEqual(result, { level: 30, time: 1522431328992 })
})
test('filterLog removes entry with escape sequence nested', t => {
const result = filterLog({
log: logData2,
context: {
...context,
ignoreKeys: ['data1', 'logging\\.domain\\.corp/operation.producer']
}
})
t.assert.deepStrictEqual(result, { level: 30, time: 1522431328992, 'logging.domain.corp/operation': { id: 'foo' } })
})
})
for (const ignoreKeys of [
undefined,
['level'],
['level', 'data1.data2.data-3']
]) {
describe(`#filterLog with an includeKeys option when the ignoreKeys being ${ignoreKeys}`, () => {
test('filterLog include nothing', t => {
const result = filterLog({
log: logData,
context: {
...context,
ignoreKeys,
includeKeys: []
}
})
t.assert.deepStrictEqual(result, {})
})
test('filterLog include single entry', t => {
const result = filterLog({
log: logData,
context: {
...context,
ignoreKeys,
includeKeys: ['time']
}
})
t.assert.deepStrictEqual(result, { time: 1522431328992 })
})
test('filterLog include multiple entries', t => {
const result = filterLog({
log: logData,
context: {
...context,
ignoreKeys,
includeKeys: ['time', 'data1']
}
})
t.assert.deepStrictEqual(result, {
time: 1522431328992,
data1: {
data2: { 'data-3': 'bar' },
error: new Error('test')
}
})
})
})
}
describe('#filterLog with circular references', () => {
const logData = {
level: 30,
time: 1522431328992,
data1: 'test'
}
logData.circular = logData
test('filterLog removes single entry', t => {
const result = filterLog({
log: logData,
context: {
...context,
ignoreKeys: ['data1']
}
})
t.assert.deepStrictEqual(result.circular.level, result.level)
t.assert.deepStrictEqual(result.circular.time, result.time)
delete result.circular
t.assert.deepStrictEqual(result, { level: 30, time: 1522431328992 })
})
test('filterLog includes single entry', t => {
const result = filterLog({
log: logData,
context: {
...context,
includeKeys: ['data1']
}
})
t.assert.deepStrictEqual(result, { data1: 'test' })
})
test('filterLog includes circular keys', t => {
const result = filterLog({
log: logData,
context: {
...context,
includeKeys: ['level', 'circular']
}
})
t.assert.deepStrictEqual(result.circular.level, logData.level)
t.assert.deepStrictEqual(result.circular.time, logData.time)
delete result.circular
t.assert.deepStrictEqual(result, { level: 30 })
})
})

View File

@@ -0,0 +1,162 @@
'use strict';
var parseCst = require('./parse-cst.js');
var Document = require('./Document-9b4560a1.js');
require('./PlainValue-ec8e588e.js');
require('./resolveSeq-d03cb037.js');
require('./Schema-88e323a7.js');
require('./warnings-1000a372.js');
function testEvents(src, options) {
const opt = Object.assign({
keepCstNodes: true,
keepNodeTypes: true,
version: '1.2'
}, options);
const docs = parseCst.parse(src).map(cstDoc => new Document.Document(opt).parse(cstDoc));
const errDoc = docs.find(doc => doc.errors.length > 0);
const error = errDoc ? errDoc.errors[0].message : null;
const events = ['+STR'];
try {
for (let i = 0; i < docs.length; ++i) {
const doc = docs[i];
let root = doc.contents;
if (Array.isArray(root)) root = root[0];
const [rootStart, rootEnd] = doc.range || [0, 0];
let e = doc.errors[0] && doc.errors[0].source;
if (e && e.type === 'SEQ_ITEM') e = e.node;
if (e && (e.type === 'DOCUMENT' || e.range.start < rootStart)) throw new Error();
let docStart = '+DOC';
const pre = src.slice(0, rootStart);
const explicitDoc = /---\s*$/.test(pre);
if (explicitDoc) docStart += ' ---';else if (!doc.contents) continue;
events.push(docStart);
addEvents(events, doc, e, root);
if (doc.contents && doc.contents.length > 1) throw new Error();
let docEnd = '-DOC';
if (rootEnd) {
const post = src.slice(rootEnd);
if (/^\.\.\./.test(post)) docEnd += ' ...';
}
events.push(docEnd);
}
} catch (e) {
return {
events,
error: error || e
};
}
events.push('-STR');
return {
events,
error
};
}
function addEvents(events, doc, e, node) {
if (!node) {
events.push('=VAL :');
return;
}
if (e && node.cstNode === e) throw new Error();
let props = '';
let anchor = doc.anchors.getName(node);
if (anchor) {
if (/\d$/.test(anchor)) {
const alt = anchor.replace(/\d$/, '');
if (doc.anchors.getNode(alt)) anchor = alt;
}
props = ` &${anchor}`;
}
if (node.cstNode && node.cstNode.tag) {
const {
handle,
suffix
} = node.cstNode.tag;
props += handle === '!' && !suffix ? ' <!>' : ` <${node.tag}>`;
}
let scalar = null;
switch (node.type) {
case 'ALIAS':
{
let alias = doc.anchors.getName(node.source);
if (/\d$/.test(alias)) {
const alt = alias.replace(/\d$/, '');
if (doc.anchors.getNode(alt)) alias = alt;
}
events.push(`=ALI${props} *${alias}`);
}
break;
case 'BLOCK_FOLDED':
scalar = '>';
break;
case 'BLOCK_LITERAL':
scalar = '|';
break;
case 'PLAIN':
scalar = ':';
break;
case 'QUOTE_DOUBLE':
scalar = '"';
break;
case 'QUOTE_SINGLE':
scalar = "'";
break;
case 'PAIR':
events.push(`+MAP${props}`);
addEvents(events, doc, e, node.key);
addEvents(events, doc, e, node.value);
events.push('-MAP');
break;
case 'FLOW_SEQ':
case 'SEQ':
events.push(`+SEQ${props}`);
node.items.forEach(item => {
addEvents(events, doc, e, item);
});
events.push('-SEQ');
break;
case 'FLOW_MAP':
case 'MAP':
events.push(`+MAP${props}`);
node.items.forEach(({
key,
value
}) => {
addEvents(events, doc, e, key);
addEvents(events, doc, e, value);
});
events.push('-MAP');
break;
default:
throw new Error(`Unexpected node type ${node.type}`);
}
if (scalar) {
const value = node.cstNode.strValue.replace(/\\/g, '\\\\').replace(/\0/g, '\\0').replace(/\x07/g, '\\a').replace(/\x08/g, '\\b').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\v/g, '\\v').replace(/\f/g, '\\f').replace(/\r/g, '\\r').replace(/\x1b/g, '\\e');
events.push(`=VAL${props} ${scalar}${value}`);
}
}
exports.testEvents = testEvents;

View File

@@ -0,0 +1,3 @@
import type { RenderFieldMethod } from './types.js';
export declare const renderField: RenderFieldMethod;
//# sourceMappingURL=renderField.d.ts.map

View File

@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CircleCheck = createLucideIcon("CircleCheck", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
]);
export { CircleCheck as default };
//# sourceMappingURL=circle-check.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"step-back.js","sources":["../../../src/icons/step-back.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name StepBack\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iMTgiIHgyPSIxOCIgeTE9IjIwIiB5Mj0iNCIgLz4KICA8cG9seWdvbiBwb2ludHM9IjE0LDIwIDQsMTIgMTQsNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/step-back\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 StepBack = createLucideIcon('StepBack', [\n ['line', { x1: '18', x2: '18', y1: '20', y2: '4', key: 'cun8e5' }],\n ['polygon', { points: '14,20 4,12 14,4', key: 'ypakod' }],\n]);\n\nexport default StepBack;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAC5C,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACjE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,342 @@
/**
* Original by Aaron Harun: http://aahacreative.com/2012/07/31/php-syntax-highlighting-prism/
* Modified by Miles Johnson: http://milesj.me
* Rewritten by Tom Pavelec
*
* Supports PHP 5.3 - 8.0
*/
(function (Prism) {
var comment = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/;
var constant = [
{
pattern: /\b(?:false|true)\b/i,
alias: 'boolean'
},
{
pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,
greedy: true,
lookbehind: true,
},
{
pattern: /(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,
greedy: true,
lookbehind: true,
},
/\b(?:null)\b/i,
/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/,
];
var number = /\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i;
var operator = /<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/;
var punctuation = /[{}\[\](),:;]/;
Prism.languages.php = {
'delimiter': {
pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i,
alias: 'important'
},
'comment': comment,
'variable': /\$+(?:\w+\b|(?=\{))/,
'package': {
pattern: /(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
lookbehind: true,
inside: {
'punctuation': /\\/
}
},
'class-name-definition': {
pattern: /(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,
lookbehind: true,
alias: 'class-name'
},
'function-definition': {
pattern: /(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,
lookbehind: true,
alias: 'function'
},
'keyword': [
{
pattern: /(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,
alias: 'type-casting',
greedy: true,
lookbehind: true
},
{
pattern: /([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,
alias: 'type-hint',
greedy: true,
lookbehind: true
},
{
pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,
alias: 'return-type',
greedy: true,
lookbehind: true
},
{
pattern: /\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,
alias: 'type-declaration',
greedy: true
},
{
pattern: /(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,
alias: 'type-declaration',
greedy: true,
lookbehind: true
},
{
pattern: /\b(?:parent|self|static)(?=\s*::)/i,
alias: 'static-context',
greedy: true
},
{
// yield from
pattern: /(\byield\s+)from\b/i,
lookbehind: true
},
// `class` is always a keyword unlike other keywords
/\bclass\b/i,
{
// https://www.php.net/manual/en/reserved.keywords.php
//
// keywords cannot be preceded by "->"
// the complex lookbehind means `(?<!(?:->|::)\s*)`
pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,
lookbehind: true
}
],
'argument-name': {
pattern: /([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,
lookbehind: true
},
'class-name': [
{
pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,
greedy: true,
lookbehind: true
},
{
pattern: /(\|\s*)\b[a-z_]\w*(?!\\)\b/i,
greedy: true,
lookbehind: true
},
{
pattern: /\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,
greedy: true
},
{
pattern: /(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,
alias: 'class-name-fully-qualified',
greedy: true,
lookbehind: true,
inside: {
'punctuation': /\\/
}
},
{
pattern: /(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,
alias: 'class-name-fully-qualified',
greedy: true,
inside: {
'punctuation': /\\/
}
},
{
pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
alias: 'class-name-fully-qualified',
greedy: true,
lookbehind: true,
inside: {
'punctuation': /\\/
}
},
{
pattern: /\b[a-z_]\w*(?=\s*\$)/i,
alias: 'type-declaration',
greedy: true
},
{
pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
alias: ['class-name-fully-qualified', 'type-declaration'],
greedy: true,
inside: {
'punctuation': /\\/
}
},
{
pattern: /\b[a-z_]\w*(?=\s*::)/i,
alias: 'static-context',
greedy: true
},
{
pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,
alias: ['class-name-fully-qualified', 'static-context'],
greedy: true,
inside: {
'punctuation': /\\/
}
},
{
pattern: /([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,
alias: 'type-hint',
greedy: true,
lookbehind: true
},
{
pattern: /([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
alias: ['class-name-fully-qualified', 'type-hint'],
greedy: true,
lookbehind: true,
inside: {
'punctuation': /\\/
}
},
{
pattern: /(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,
alias: 'return-type',
greedy: true,
lookbehind: true
},
{
pattern: /(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
alias: ['class-name-fully-qualified', 'return-type'],
greedy: true,
lookbehind: true,
inside: {
'punctuation': /\\/
}
}
],
'constant': constant,
'function': {
pattern: /(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,
lookbehind: true,
inside: {
'punctuation': /\\/
}
},
'property': {
pattern: /(->\s*)\w+/,
lookbehind: true
},
'number': number,
'operator': operator,
'punctuation': punctuation
};
var string_interpolation = {
pattern: /\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,
lookbehind: true,
inside: Prism.languages.php
};
var string = [
{
pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,
alias: 'nowdoc-string',
greedy: true,
inside: {
'delimiter': {
pattern: /^<<<'[^']+'|[a-z_]\w*;$/i,
alias: 'symbol',
inside: {
'punctuation': /^<<<'?|[';]$/
}
}
}
},
{
pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,
alias: 'heredoc-string',
greedy: true,
inside: {
'delimiter': {
pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,
alias: 'symbol',
inside: {
'punctuation': /^<<<"?|[";]$/
}
},
'interpolation': string_interpolation
}
},
{
pattern: /`(?:\\[\s\S]|[^\\`])*`/,
alias: 'backtick-quoted-string',
greedy: true
},
{
pattern: /'(?:\\[\s\S]|[^\\'])*'/,
alias: 'single-quoted-string',
greedy: true
},
{
pattern: /"(?:\\[\s\S]|[^\\"])*"/,
alias: 'double-quoted-string',
greedy: true,
inside: {
'interpolation': string_interpolation
}
}
];
Prism.languages.insertBefore('php', 'variable', {
'string': string,
'attribute': {
pattern: /#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,
greedy: true,
inside: {
'attribute-content': {
pattern: /^(#\[)[\s\S]+(?=\]$)/,
lookbehind: true,
// inside can appear subset of php
inside: {
'comment': comment,
'string': string,
'attribute-class-name': [
{
pattern: /([^:]|^)\b[a-z_]\w*(?!\\)\b/i,
alias: 'class-name',
greedy: true,
lookbehind: true
},
{
pattern: /([^:]|^)(?:\\?\b[a-z_]\w*)+/i,
alias: [
'class-name',
'class-name-fully-qualified'
],
greedy: true,
lookbehind: true,
inside: {
'punctuation': /\\/
}
}
],
'constant': constant,
'number': number,
'operator': operator,
'punctuation': punctuation
}
},
'delimiter': {
pattern: /^#\[|\]$/,
alias: 'punctuation'
}
}
},
});
Prism.hooks.add('before-tokenize', function (env) {
if (!/<\?/.test(env.code)) {
return;
}
var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;
Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern);
});
Prism.hooks.add('after-tokenize', function (env) {
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php');
});
}(Prism));

View File

@@ -0,0 +1,4 @@
import type { DefaultTranslationsObject, Language } from '../types.js';
export declare const rsLatinTranslations: DefaultTranslationsObject;
export declare const rsLatin: Language;
//# sourceMappingURL=rsLatin.d.ts.map

View File

@@ -0,0 +1,18 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types_internal.js.map

View File

@@ -0,0 +1,246 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.alloc = alloc;
exports.free = free;
exports.resize = resize;
exports.readInt = readInt;
exports.readUInt = readUInt;
exports.writeInt64 = writeInt64;
exports.writeUInt64 = writeUInt64;
// Copyright 2012 The Obvious Corporation.
/*
* bufs: Buffer utilities.
*/
/*
* Module variables
*/
/** Pool of buffers, where `bufPool[x].length === x`. */
var bufPool = [];
/** Maximum length of kept temporary buffers. */
var TEMP_BUF_MAXIMUM_LENGTH = 20;
/** Minimum exactly-representable 64-bit int. */
var MIN_EXACT_INT64 = -0x8000000000000000;
/** Maximum exactly-representable 64-bit int. */
var MAX_EXACT_INT64 = 0x7ffffffffffffc00;
/** Maximum exactly-representable 64-bit uint. */
var MAX_EXACT_UINT64 = 0xfffffffffffff800;
/**
* The int value consisting just of a 1 in bit #32 (that is, one more
* than the maximum 32-bit unsigned value).
*/
var BIT_32 = 0x100000000;
/**
* The int value consisting just of a 1 in bit #64 (that is, one more
* than the maximum 64-bit unsigned value).
*/
var BIT_64 = 0x10000000000000000;
/*
* Helper functions
*/
/**
* Masks off all but the lowest bit set of the given number.
*/
function lowestBit(num) {
return num & -num;
}
/**
* Gets whether trying to add the second number to the first is lossy
* (inexact). The first number is meant to be an accumulated result.
*/
function isLossyToAdd(accum, num) {
if (num === 0) {
return false;
}
var lowBit = lowestBit(num);
var added = accum + lowBit;
if (added === accum) {
return true;
}
if (added - lowBit !== accum) {
return true;
}
return false;
}
/*
* Exported functions
*/
/**
* Allocates a buffer of the given length, which is initialized
* with all zeroes. This returns a buffer from the pool if it is
* available, or a freshly-allocated buffer if not.
*/
function alloc(length) {
var result = bufPool[length];
if (result) {
bufPool[length] = undefined;
} else {
result = new Uint8Array(length);
}
result.fill(0);
return result;
}
/**
* Releases a buffer back to the pool.
*/
function free(buffer) {
var length = buffer.length;
if (length < TEMP_BUF_MAXIMUM_LENGTH) {
bufPool[length] = buffer;
}
}
/**
* Resizes a buffer, returning a new buffer. Returns the argument if
* the length wouldn't actually change. This function is only safe to
* use if the given buffer was allocated within this module (since
* otherwise the buffer might possibly be shared externally).
*/
function resize(buffer, length) {
if (length === buffer.length) {
return buffer;
}
var newBuf = alloc(length);
for (var i = 0; i <= buffer.length; i++) {
newBuf[i] = buffer[i];
}
free(buffer);
return newBuf;
}
/**
* Reads an arbitrary signed int from a buffer.
*/
function readInt(buffer) {
var length = buffer.length;
var positive = buffer[length - 1] < 0x80;
var result = positive ? 0 : -1;
var lossy = false; // Note: We can't use bit manipulation here, since that stops
// working if the result won't fit in a 32-bit int.
if (length < 7) {
// Common case which can't possibly be lossy (because the result has
// no more than 48 bits, and loss only happens with 54 or more).
for (var i = length - 1; i >= 0; i--) {
result = result * 0x100 + buffer[i];
}
} else {
for (var _i = length - 1; _i >= 0; _i--) {
var one = buffer[_i];
result *= 0x100;
if (isLossyToAdd(result, one)) {
lossy = true;
}
result += one;
}
}
return {
value: result,
lossy: lossy
};
}
/**
* Reads an arbitrary unsigned int from a buffer.
*/
function readUInt(buffer) {
var length = buffer.length;
var result = 0;
var lossy = false; // Note: See above in re bit manipulation.
if (length < 7) {
// Common case which can't possibly be lossy (see above).
for (var i = length - 1; i >= 0; i--) {
result = result * 0x100 + buffer[i];
}
} else {
for (var _i2 = length - 1; _i2 >= 0; _i2--) {
var one = buffer[_i2];
result *= 0x100;
if (isLossyToAdd(result, one)) {
lossy = true;
}
result += one;
}
}
return {
value: result,
lossy: lossy
};
}
/**
* Writes a little-endian 64-bit signed int into a buffer.
*/
function writeInt64(value, buffer) {
if (value < MIN_EXACT_INT64 || value > MAX_EXACT_INT64) {
throw new Error("Value out of range.");
}
if (value < 0) {
value += BIT_64;
}
writeUInt64(value, buffer);
}
/**
* Writes a little-endian 64-bit unsigned int into a buffer.
*/
function writeUInt64(value, buffer) {
if (value < 0 || value > MAX_EXACT_UINT64) {
throw new Error("Value out of range.");
}
var lowWord = value % BIT_32;
var highWord = Math.floor(value / BIT_32);
buffer[0] = lowWord & 0xff;
buffer[1] = lowWord >> 8 & 0xff;
buffer[2] = lowWord >> 16 & 0xff;
buffer[3] = lowWord >> 24 & 0xff;
buffer[4] = highWord & 0xff;
buffer[5] = highWord >> 8 & 0xff;
buffer[6] = highWord >> 16 & 0xff;
buffer[7] = highWord >> 24 & 0xff;
}

View File

@@ -0,0 +1,13 @@
export * from "./alias.js";
export * from "./columns/index.js";
export * from "./db.js";
export * from "./dialect.js";
export * from "./indexes.js";
export * from "./primary-keys.js";
export * from "./query-builders/index.js";
export * from "./schema.js";
export * from "./session.js";
export * from "./subquery.js";
export * from "./table.js";
export * from "./unique-constraint.js";
export * from "./utils.js";

View File

@@ -0,0 +1,13 @@
import { AnimationFeature } from './animation/index.mjs';
import { ExitAnimationFeature } from './animation/exit.mjs';
const animations = {
animation: {
Feature: AnimationFeature,
},
exit: {
Feature: ExitAnimationFeature,
},
};
export { animations };

View File

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

View File

@@ -0,0 +1,2 @@
export declare function mapAsync<T, U>(arr: T[], callbackfn: (item: T, index: number, array: T[]) => Promise<U>): Promise<U[]>;
//# sourceMappingURL=mapAsync.d.ts.map

View File

@@ -0,0 +1,2 @@
import type { ClientRect } from '../../types';
export declare function getWindowClientRect(element: typeof window): ClientRect;

View File

@@ -0,0 +1 @@
{"version":3,"file":"getRequestLanguage.d.ts","sourceRoot":"","sources":["../../src/utilities/getRequestLanguage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iEAAiE,CAAA;AAE7G,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,sBAAsB,CAAA;IACrD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,kBAAkB,2CAI5B,sBAAsB,KAAG,MAS3B,CAAA"}

View File

@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const BookHeadphones = createLucideIcon("BookHeadphones", [
[
"path",
{
d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",
key: "k3hazp"
}
],
["path", { d: "M8 12v-2a4 4 0 0 1 8 0v2", key: "1vsqkj" }],
["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }]
]);
export { BookHeadphones as default };
//# sourceMappingURL=book-headphones.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"square-kanban.js","sources":["../../../src/icons/square-kanban.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareKanban\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik04IDd2NyIgLz4KICA8cGF0aCBkPSJNMTIgN3Y0IiAvPgogIDxwYXRoIGQ9Ik0xNiA3djkiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/square-kanban\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 SquareKanban = createLucideIcon('SquareKanban', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M8 7v7', key: '1x2jlm' }],\n ['path', { d: 'M12 7v4', key: 'xawao1' }],\n ['path', { d: 'M16 7v9', key: '1hp2iy' }],\n]);\n\nexport default SquareKanban;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,17 @@
import { isolateObjectProperty, restoreVersionOperation } from 'payload';
export function restoreVersionResolver(collection) {
async function resolver(_, args, context) {
const options = {
id: args.id,
collection,
depth: 0,
draft: args.draft,
req: isolateObjectProperty(context.req, 'transactionID')
};
const result = await restoreVersionOperation(options);
return result;
}
return resolver;
}
//# sourceMappingURL=restoreVersion.js.map

View File

@@ -0,0 +1,8 @@
import type { PayloadRequest } from '../types/index.js';
type CorsArgs = {
headers: Headers;
req: Partial<PayloadRequest>;
};
export declare const headersWithCors: ({ headers, req }: CorsArgs) => Headers;
export {};
//# sourceMappingURL=headersWithCors.d.ts.map

View File

@@ -0,0 +1,24 @@
import { APIError } from '../../../errors/index.js';
import { createLocalReq } from '../../../utilities/createLocalReq.js';
import { findVersionByIDOperation } from '../findVersionByID.js';
export async function findVersionByIDLocal(payload, options) {
const { id, collection: collectionSlug, depth, disableErrors = false, overrideAccess = true, populate, select, showHiddenFields, trash = false } = options;
const collection = payload.collections[collectionSlug];
if (!collection) {
throw new APIError(`The collection with slug ${String(collectionSlug)} can't be found. Find Version By ID Operation.`);
}
return findVersionByIDOperation({
id,
collection,
depth,
disableErrors,
overrideAccess,
populate,
req: await createLocalReq(options, payload),
select,
showHiddenFields,
trash
});
}
//# sourceMappingURL=findVersionByID.js.map

View File

@@ -0,0 +1,209 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["לפנה״ס", "לספירה"],
abbreviated: ["לפנה״ס", "לספירה"],
wide: ["לפני הספירה", "לספירה"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["רבעון 1", "רבעון 2", "רבעון 3", "רבעון 4"],
};
const monthValues = {
narrow: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
abbreviated: [
"ינו׳",
"פבר׳",
"מרץ",
"אפר׳",
"מאי",
"יוני",
"יולי",
"אוג׳",
"ספט׳",
"אוק׳",
"נוב׳",
"דצמ׳",
],
wide: [
"ינואר",
"פברואר",
"מרץ",
"אפריל",
"מאי",
"יוני",
"יולי",
"אוגוסט",
"ספטמבר",
"אוקטובר",
"נובמבר",
"דצמבר",
],
};
const dayValues = {
narrow: ["א׳", "ב׳", "ג׳", "ד׳", "ה׳", "ו׳", "ש׳"],
short: ["א׳", "ב׳", "ג׳", "ד׳", "ה׳", "ו׳", "ש׳"],
abbreviated: [
"יום א׳",
"יום ב׳",
"יום ג׳",
"יום ד׳",
"יום ה׳",
"יום ו׳",
"שבת",
],
wide: [
"יום ראשון",
"יום שני",
"יום שלישי",
"יום רביעי",
"יום חמישי",
"יום שישי",
"יום שבת",
],
};
const dayPeriodValues = {
narrow: {
am: "לפנה״צ",
pm: "אחה״צ",
midnight: "חצות",
noon: "צהריים",
morning: "בוקר",
afternoon: "אחר הצהריים",
evening: "ערב",
night: "לילה",
},
abbreviated: {
am: "לפנה״צ",
pm: "אחה״צ",
midnight: "חצות",
noon: "צהריים",
morning: "בוקר",
afternoon: "אחר הצהריים",
evening: "ערב",
night: "לילה",
},
wide: {
am: "לפנה״צ",
pm: "אחה״צ",
midnight: "חצות",
noon: "צהריים",
morning: "בוקר",
afternoon: "אחר הצהריים",
evening: "ערב",
night: "לילה",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "לפנה״צ",
pm: "אחה״צ",
midnight: "חצות",
noon: "צהריים",
morning: "בבוקר",
afternoon: "בצהריים",
evening: "בערב",
night: "בלילה",
},
abbreviated: {
am: "לפנה״צ",
pm: "אחה״צ",
midnight: "חצות",
noon: "צהריים",
morning: "בבוקר",
afternoon: "אחר הצהריים",
evening: "בערב",
night: "בלילה",
},
wide: {
am: "לפנה״צ",
pm: "אחה״צ",
midnight: "חצות",
noon: "צהריים",
morning: "בבוקר",
afternoon: "אחר הצהריים",
evening: "בערב",
night: "בלילה",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
// We only show words till 10
if (number <= 0 || number > 10) return String(number);
const unit = String(options?.unit);
const isFemale = ["year", "hour", "minute", "second"].indexOf(unit) >= 0;
const male = [
"ראשון",
"שני",
"שלישי",
"רביעי",
"חמישי",
"שישי",
"שביעי",
"שמיני",
"תשיעי",
"עשירי",
];
const female = [
"ראשונה",
"שנייה",
"שלישית",
"רביעית",
"חמישית",
"שישית",
"שביעית",
"שמינית",
"תשיעית",
"עשירית",
];
const index = number - 1;
return isFemale ? female[index] : male[index];
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/fields/Password/input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAQpD,OAAO,cAAc,CAAA;AAErB,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgFtD,CAAA"}

View File

@@ -0,0 +1,10 @@
export { AccountView } from '../views/Account/index.js';
export { CreateFirstUserView } from '../views/CreateFirstUser/index.js';
export { DefaultDashboard } from '../views/Dashboard/Default/index.js';
export { DashboardView } from '../views/Dashboard/index.js';
export { ListView, renderListView } from '../views/List/index.js';
export { LoginView } from '../views/Login/index.js';
export { NotFoundPage } from '../views/NotFound/index.js';
export { RootPage } from '../views/Root/index.js';
export { generatePageMetadata } from '../views/Root/metadata.js';
//# sourceMappingURL=views.js.map

View File

@@ -0,0 +1,10 @@
export declare const DistinctSymbol: unique symbol;
/**
* You can use this to inject a raw query to where
*/
export declare const rawConstraint: (value: unknown) => {
type: symbol;
value: unknown;
};
export declare const isRawConstraint: (value: unknown) => value is ReturnType<typeof rawConstraint>;
//# sourceMappingURL=rawConstraint.d.ts.map

View File

@@ -0,0 +1,352 @@
import { expect, test } from "vitest";
import * as z from "zod/v4";
test("continuability", () => {
/**
* | $ZodGUID
| $ZodUUID
| $ZodEmail
| $ZodURL
| $ZodEmoji
| $ZodNanoID
| $ZodCUID
| $ZodCUID2
| $ZodULID
| $ZodXID
| $ZodKSUID
| $ZodISODateTime
| $ZodISODate
| $ZodISOTime
| $ZodISODuration
| $ZodIPv4
| $ZodIPv6
| $ZodCIDRv4
| $ZodCIDRv6
| $ZodBase64
| $ZodBase64URL
| $ZodE164
| $ZodJWT;
*/
expect(
z
.email()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "email",
"message": "Invalid email address",
"origin": "string",
"path": [],
"pattern": "/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.uuid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "uuid",
"message": "Invalid UUID",
"origin": "string",
"path": [],
"pattern": "/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.url()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "url",
"message": "Invalid URL",
"path": [],
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.jwt()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "jwt",
"message": "Invalid JWT",
"path": [],
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.cidrv4()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "cidrv4",
"message": "Invalid IPv4 range",
"origin": "string",
"path": [],
"pattern": "/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.cidrv6()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "cidrv6",
"message": "Invalid IPv6 range",
"path": [],
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.ipv4()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "ipv4",
"message": "Invalid IPv4 address",
"origin": "string",
"path": [],
"pattern": "/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.ipv6()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "ipv6",
"message": "Invalid IPv6 address",
"path": [],
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.emoji()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "emoji",
"message": "Invalid emoji",
"origin": "string",
"path": [],
"pattern": "/^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$/u",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.nanoid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "nanoid",
"message": "Invalid nanoid",
"origin": "string",
"path": [],
"pattern": "/^[a-zA-Z0-9_-]{21}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.cuid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "cuid",
"message": "Invalid cuid",
"origin": "string",
"path": [],
"pattern": "/^[cC][^\\s-]{8,}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.cuid2()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "cuid2",
"message": "Invalid cuid2",
"origin": "string",
"path": [],
"pattern": "/^[0-9a-z]+$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.ulid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "ulid",
"message": "Invalid ULID",
"origin": "string",
"path": [],
"pattern": "/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.xid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "xid",
"message": "Invalid XID",
"origin": "string",
"path": [],
"pattern": "/^[0-9a-vA-V]{20}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
expect(
z
.ksuid()
.refine(() => false)
.safeParse("invalid_value").error!.issues
).toMatchInlineSnapshot(`
[
{
"code": "invalid_format",
"format": "ksuid",
"message": "Invalid KSUID",
"origin": "string",
"path": [],
"pattern": "/^[A-Za-z0-9]{27}$/",
},
{
"code": "custom",
"message": "Invalid input",
"path": [],
},
]
`);
});

View File

@@ -0,0 +1,41 @@
/** Options for the EventFilters integration */
export interface EventFiltersOptions {
allowUrls: Array<string | RegExp>;
denyUrls: Array<string | RegExp>;
ignoreErrors: Array<string | RegExp>;
ignoreTransactions: Array<string | RegExp>;
ignoreInternal: boolean;
disableErrorDefaults: boolean;
}
/**
* An integration that filters out events (errors and transactions) based on:
*
* - (Errors) A curated list of known low-value or irrelevant errors (see {@link DEFAULT_IGNORE_ERRORS})
* - (Errors) A list of error messages or urls/filenames passed in via
* - Top level Sentry.init options (`ignoreErrors`, `denyUrls`, `allowUrls`)
* - The same options passed to the integration directly via @param options
* - (Transactions/Spans) A list of root span (transaction) names passed in via
* - Top level Sentry.init option (`ignoreTransactions`)
* - The same option passed to the integration directly via @param options
*
* Events filtered by this integration will not be sent to Sentry.
*/
export declare const eventFiltersIntegration: (options?: Partial<EventFiltersOptions> | undefined) => import("../types-hoist/integration").Integration;
/**
* An integration that filters out events (errors and transactions) based on:
*
* - (Errors) A curated list of known low-value or irrelevant errors (see {@link DEFAULT_IGNORE_ERRORS})
* - (Errors) A list of error messages or urls/filenames passed in via
* - Top level Sentry.init options (`ignoreErrors`, `denyUrls`, `allowUrls`)
* - The same options passed to the integration directly via @param options
* - (Transactions/Spans) A list of root span (transaction) names passed in via
* - Top level Sentry.init option (`ignoreTransactions`)
* - The same option passed to the integration directly via @param options
*
* Events filtered by this integration will not be sent to Sentry.
*
* @deprecated this integration was renamed and will be removed in a future major version.
* Use `eventFiltersIntegration` instead.
*/
export declare const inboundFiltersIntegration: (options?: Partial<EventFiltersOptions> | undefined) => import("../types-hoist/integration").Integration;
//# sourceMappingURL=eventFilters.d.ts.map

View File

@@ -0,0 +1,45 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import { type Writable } from "../../utils.js";
import { PgColumn, PgColumnBuilder } from "./common.js";
export type PgCharBuilderInitial<TName extends string, TEnum extends [string, ...string[]], TLength extends number | undefined> = PgCharBuilder<{
name: TName;
dataType: 'string';
columnType: 'PgChar';
data: TEnum[number];
enumValues: TEnum;
driverParam: string;
length: TLength;
}>;
export declare class PgCharBuilder<T extends ColumnBuilderBaseConfig<'string', 'PgChar'> & {
length?: number | undefined;
}> extends PgColumnBuilder<T, {
length: T['length'];
enumValues: T['enumValues'];
}, {
length: T['length'];
}> {
static readonly [entityKind]: string;
constructor(name: T['name'], config: PgCharConfig<T['enumValues'], T['length']>);
}
export declare class PgChar<T extends ColumnBaseConfig<'string', 'PgChar'> & {
length?: number | undefined;
}> extends PgColumn<T, {
length: T['length'];
enumValues: T['enumValues'];
}, {
length: T['length'];
}> {
static readonly [entityKind]: string;
readonly length: T["length"];
readonly enumValues: T["enumValues"];
getSQLType(): string;
}
export interface PgCharConfig<TEnum extends readonly string[] | string[] | undefined = readonly string[] | string[] | undefined, TLength extends number | undefined = number | undefined> {
enum?: TEnum;
length?: TLength;
}
export declare function char(): PgCharBuilderInitial<'', [string, ...string[]], undefined>;
export declare function char<U extends string, T extends Readonly<[U, ...U[]]>, L extends number | undefined>(config?: PgCharConfig<T | Writable<T>, L>): PgCharBuilderInitial<'', Writable<T>, L>;
export declare function char<TName extends string, U extends string, T extends Readonly<[U, ...U[]]>, L extends number | undefined>(name: TName, config?: PgCharConfig<T | Writable<T>, L>): PgCharBuilderInitial<TName, Writable<T>, L>;

View File

@@ -0,0 +1,116 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var numeric_exports = {};
__export(numeric_exports, {
SQLiteNumeric: () => SQLiteNumeric,
SQLiteNumericBigInt: () => SQLiteNumericBigInt,
SQLiteNumericBigIntBuilder: () => SQLiteNumericBigIntBuilder,
SQLiteNumericBuilder: () => SQLiteNumericBuilder,
SQLiteNumericNumber: () => SQLiteNumericNumber,
SQLiteNumericNumberBuilder: () => SQLiteNumericNumberBuilder,
numeric: () => numeric
});
module.exports = __toCommonJS(numeric_exports);
var import_entity = require("../../entity.cjs");
var import_utils = require("../../utils.cjs");
var import_common = require("./common.cjs");
class SQLiteNumericBuilder extends import_common.SQLiteColumnBuilder {
static [import_entity.entityKind] = "SQLiteNumericBuilder";
constructor(name) {
super(name, "string", "SQLiteNumeric");
}
/** @internal */
build(table) {
return new SQLiteNumeric(
table,
this.config
);
}
}
class SQLiteNumeric extends import_common.SQLiteColumn {
static [import_entity.entityKind] = "SQLiteNumeric";
mapFromDriverValue(value) {
if (typeof value === "string") return value;
return String(value);
}
getSQLType() {
return "numeric";
}
}
class SQLiteNumericNumberBuilder extends import_common.SQLiteColumnBuilder {
static [import_entity.entityKind] = "SQLiteNumericNumberBuilder";
constructor(name) {
super(name, "number", "SQLiteNumericNumber");
}
/** @internal */
build(table) {
return new SQLiteNumericNumber(
table,
this.config
);
}
}
class SQLiteNumericNumber extends import_common.SQLiteColumn {
static [import_entity.entityKind] = "SQLiteNumericNumber";
mapFromDriverValue(value) {
if (typeof value === "number") return value;
return Number(value);
}
mapToDriverValue = String;
getSQLType() {
return "numeric";
}
}
class SQLiteNumericBigIntBuilder extends import_common.SQLiteColumnBuilder {
static [import_entity.entityKind] = "SQLiteNumericBigIntBuilder";
constructor(name) {
super(name, "bigint", "SQLiteNumericBigInt");
}
/** @internal */
build(table) {
return new SQLiteNumericBigInt(
table,
this.config
);
}
}
class SQLiteNumericBigInt extends import_common.SQLiteColumn {
static [import_entity.entityKind] = "SQLiteNumericBigInt";
mapFromDriverValue = BigInt;
mapToDriverValue = String;
getSQLType() {
return "numeric";
}
}
function numeric(a, b) {
const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
const mode = config?.mode;
return mode === "number" ? new SQLiteNumericNumberBuilder(name) : mode === "bigint" ? new SQLiteNumericBigIntBuilder(name) : new SQLiteNumericBuilder(name);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SQLiteNumeric,
SQLiteNumericBigInt,
SQLiteNumericBigIntBuilder,
SQLiteNumericBuilder,
SQLiteNumericNumber,
SQLiteNumericNumberBuilder,
numeric
});
//# sourceMappingURL=numeric.cjs.map

View File

@@ -0,0 +1,38 @@
"use strict";
exports.endOfQuarter = endOfQuarter;
var _index = require("./toDate.cjs");
/**
* The {@link endOfQuarter} function options.
*/
/**
* @name endOfQuarter
* @category Quarter Helpers
* @summary Return the end of a year quarter for the given date.
*
* @description
* Return the end of a year quarter for the given date.
* The result will be in the local timezone.
*
* @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).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The end of a quarter
*
* @example
* // The end of a quarter for 2 September 2014 11:55:00:
* const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0))
* //=> Tue Sep 30 2014 23:59:59.999
*/
function endOfQuarter(date, options) {
const _date = (0, _index.toDate)(date, options?.in);
const currentMonth = _date.getMonth();
const month = currentMonth - (currentMonth % 3) + 3;
_date.setMonth(month, 0);
_date.setHours(23, 59, 59, 999);
return _date;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"minus.js","sources":["../../../src/icons/minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Minus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAxMmgxNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/minus\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 Minus = createLucideIcon('Minus', [['path', { d: 'M5 12h14', key: '1ays0h' }]]);\n\nexport default Minus;\n"],"names":[],"mappings":";;;;;;;;;AAaA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,OAAS,CAAA,CAAA,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,EAAE,CAAA,CAAA,CAAG,UAAY,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,3 @@
import type { QueryDrafts } from 'payload';
export declare const queryDrafts: QueryDrafts;
//# sourceMappingURL=queryDrafts.d.ts.map

View File

@@ -0,0 +1,65 @@
"use strict";
exports.buildLocalizeFn = buildLocalizeFn; /* eslint-disable no-unused-vars */
/**
* 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,3 @@
import { GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql';
export declare const GraphQLIPCPatentConfig: GraphQLScalarTypeConfig<string, string>;
export declare const GraphQLIPCPatent: GraphQLScalarType<string, string>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"egg-fried.js","sources":["../../../src/icons/egg-fried.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name EggFried\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMS41IiBjeT0iMTIuNSIgcj0iMy41IiAvPgogIDxwYXRoIGQ9Ik0zIDhjMC0zLjUgMi41LTYgNi41LTYgNSAwIDQuODMgMyA3LjUgNXM1IDIgNSA2YzAgNC41LTIuNSA2LjUtNyA2LjUtMi41IDAtMi41IDIuNS02IDIuNXMtNy0yLTctNS41YzAtMyAxLjUtMyAxLjUtNUMzLjUgMTAgMyA5IDMgOFoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/egg-fried\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 EggFried = createLucideIcon('EggFried', [\n ['circle', { cx: '11.5', cy: '12.5', r: '3.5', key: '1cl1mi' }],\n [\n 'path',\n {\n d: 'M3 8c0-3.5 2.5-6 6.5-6 5 0 4.83 3 7.5 5s5 2 5 6c0 4.5-2.5 6.5-7 6.5-2.5 0-2.5 2.5-6 2.5s-7-2-7-5.5c0-3 1.5-3 1.5-5C3.5 10 3 9 3 8Z',\n key: '165ef9',\n },\n ],\n]);\n\nexport default EggFried;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAC5C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAI,CAAA,CAAA,CAAA,MAAA,CAAQ,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAC9D,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

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

View File

@@ -0,0 +1,20 @@
import { JOSENotSupported } from '../util/errors.js';
import random from '../runtime/random.js';
export function bitLength(alg) {
switch (alg) {
case 'A128GCM':
case 'A128GCMKW':
case 'A192GCM':
case 'A192GCMKW':
case 'A256GCM':
case 'A256GCMKW':
return 96;
case 'A128CBC-HS256':
case 'A192CBC-HS384':
case 'A256CBC-HS512':
return 128;
default:
throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`);
}
}
export default (alg) => random(new Uint8Array(bitLength(alg) >> 3));

View File

@@ -0,0 +1,11 @@
export { useSensor } from './useSensor';
export { useSensors } from './useSensors';
export { AbstractPointerSensor, PointerSensor } from './pointer';
export type { AbstractPointerSensorOptions, AbstractPointerSensorProps, PointerActivationConstraint, PointerEventHandlers, PointerSensorOptions, PointerSensorProps, } from './pointer';
export { MouseSensor } from './mouse';
export type { MouseSensorOptions, MouseSensorProps } from './mouse';
export { TouchSensor } from './touch';
export type { TouchSensorOptions, TouchSensorProps } from './touch';
export { KeyboardSensor, KeyboardCode, defaultKeyboardCoordinateGetter, } from './keyboard';
export type { KeyboardCoordinateGetter, KeyboardSensorOptions, KeyboardSensorProps, KeyboardCodes, } from './keyboard';
export type { Activator, Activators, Response as SensorResponse, Sensor, Sensors, SensorActivatorFunction, SensorDescriptor, SensorContext, SensorHandler, SensorInstance, SensorOptions, SensorProps, } from './types';

View File

@@ -0,0 +1,24 @@
/**
* @license React
* react-dom-test-utils.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 () {
var React = require("react"),
didWarnAboutUsingAct = !1;
exports.act = function (callback) {
!1 === didWarnAboutUsingAct &&
((didWarnAboutUsingAct = !0),
console.error(
"`ReactDOMTestUtils.act` is deprecated in favor of `React.act`. Import `act` from `react` instead of `react-dom/test-utils`. See https://react.dev/warnings/react-dom-test-utils for more info."
));
return React.act(callback);
};
})();

View File

@@ -0,0 +1,6 @@
function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
export { _arrayLikeToArray as default };

View File

@@ -0,0 +1,41 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';
const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;
const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;
const VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);
const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;
const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;
/**
* Key is opaque string up to 256 characters printable. It MUST begin with a
* lowercase letter, and can only contain lowercase letters a-z, digits 0-9,
* underscores _, dashes -, asterisks *, and forward slashes /.
* For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the
* vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.
* see https://www.w3.org/TR/trace-context/#key
*/
export function validateKey(key) {
return VALID_KEY_REGEX.test(key);
}
/**
* Value is opaque string up to 256 characters printable ASCII RFC0020
* characters (i.e., the range 0x20 to 0x7E) except comma , and =.
*/
export function validateValue(value) {
return (VALID_VALUE_BASE_REGEX.test(value) &&
!INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));
}
//# sourceMappingURL=validators.js.map

View File

@@ -0,0 +1,11 @@
import type { I18nClient } from '@payloadcms/translations';
import type { Metadata } from 'next';
import type { AdminViewConfig, SanitizedCollectionConfig, SanitizedConfig, SanitizedGlobalConfig } from 'payload';
export declare const generateCustomViewMetadata: (args: {
collectionConfig?: SanitizedCollectionConfig;
config: SanitizedConfig;
globalConfig?: SanitizedGlobalConfig;
i18n: I18nClient;
viewConfig: AdminViewConfig;
}) => Promise<Metadata>;
//# sourceMappingURL=generateCustomViewMetadata.d.ts.map

View File

@@ -0,0 +1,20 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Symbol used to make BaggageEntryMetadata an opaque type
*/
export var baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');
//# sourceMappingURL=symbol.js.map

View File

@@ -0,0 +1,14 @@
import type { Match } from "../../../locale/types.js";
import { Parser } from "../Parser.js";
import type { ParseFlags, ParseResult } from "../types.js";
export declare class QuarterParser extends Parser<number> {
priority: number;
parse(dateString: string, token: string, match: Match): ParseResult<number>;
validate<DateType extends Date>(_date: DateType, value: number): boolean;
set<DateType extends Date>(
date: DateType,
_flags: ParseFlags,
value: number,
): DateType;
incompatibleTokens: string[];
}

View File

@@ -0,0 +1,38 @@
import { cache } from 'react';
// Module-scoped cache container that holds all cached, stable containers
// - these may hold the stable value, or a promise to the stable value
const globalCacheContainer = {};
/**
* Creates a selective cache function that provides more control over React's request-level caching behavior.
*
* @param namespace - A namespace to group related cached values
* @returns A function that manages cached values within the specified namespace
*/
export function selectiveCache(namespace) {
// Create a stable namespace container if it doesn't exist
if (!globalCacheContainer[namespace]) {
globalCacheContainer[namespace] = cache((...args) => ({
value: null
}));
}
/**
* Gets or creates a cached value for a specific key within the namespace
*
* @param key - The key to identify the cached value
* @param factory - A function that produces the value if not cached
* @returns The cached or newly created value
*/
const getCached = async (factory, ...cacheArgs) => {
const stableObjectFn = globalCacheContainer[namespace];
const stableObject = stableObjectFn(...cacheArgs);
if (stableObject?.value && 'then' in stableObject.value && typeof stableObject.value?.then === 'function') {
return await stableObject.value;
}
stableObject.value = factory();
return await stableObject.value;
};
return {
get: getCached
};
}
//# sourceMappingURL=selectiveCache.js.map

View File

@@ -0,0 +1,29 @@
# MIT License
Copyright (c) 2024, Sentry
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1 @@
{"version":3,"file":"tracer.js","sourceRoot":"","sources":["../../../src/trace/tracer.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 { Context } from '../context/types';\nimport { Span } from './span';\nimport { SpanOptions } from './SpanOptions';\n\n/**\n * Tracer provides an interface for creating {@link Span}s.\n */\nexport interface Tracer {\n /**\n * Starts a new {@link Span}. Start the span without setting it on context.\n *\n * This method do NOT modify the current Context.\n *\n * @param name The name of the span\n * @param [options] SpanOptions used for span creation\n * @param [context] Context to use to extract parent\n * @returns Span The newly created span\n * @example\n * const span = tracer.startSpan('op');\n * span.setAttribute('key', 'value');\n * span.end();\n */\n startSpan(name: string, options?: SpanOptions, context?: Context): Span;\n\n /**\n * Starts a new {@link Span} and calls the given function passing it the\n * created span as first argument.\n * Additionally the new span gets set in context and this context is activated\n * for the duration of the function call.\n *\n * @param name The name of the span\n * @param [options] SpanOptions used for span creation\n * @param [context] Context to use to extract parent\n * @param fn function called in the context of the span and receives the newly created span as an argument\n * @returns return value of fn\n * @example\n * const something = tracer.startActiveSpan('op', span => {\n * try {\n * do some work\n * span.setStatus({code: SpanStatusCode.OK});\n * return something;\n * } catch (err) {\n * span.setStatus({\n * code: SpanStatusCode.ERROR,\n * message: err.message,\n * });\n * throw err;\n * } finally {\n * span.end();\n * }\n * });\n *\n * @example\n * const span = tracer.startActiveSpan('op', span => {\n * try {\n * do some work\n * return span;\n * } catch (err) {\n * span.setStatus({\n * code: SpanStatusCode.ERROR,\n * message: err.message,\n * });\n * throw err;\n * }\n * });\n * do some more work\n * span.end();\n */\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n fn: F\n ): ReturnType<F>;\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n fn: F\n ): ReturnType<F>;\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n context: Context,\n fn: F\n ): ReturnType<F>;\n}\n"]}

View File

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

View File

@@ -0,0 +1,5 @@
const TableName = Symbol.for("drizzle:Name");
export {
TableName
};
//# sourceMappingURL=table.utils.js.map

View File

@@ -0,0 +1,74 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Authors Simen Brekken @simenbrekken, Einar Löve @einarlove
*/
"use strict";
const DefinePlugin = require("./DefinePlugin");
const WebpackError = require("./WebpackError");
/** @typedef {import("./Compiler")} Compiler */
/** @typedef {import("./DefinePlugin").CodeValue} CodeValue */
const PLUGIN_NAME = "EnvironmentPlugin";
class EnvironmentPlugin {
/**
* @param {(string | string[] | Record<string, EXPECTED_ANY>)[]} keys keys
*/
constructor(...keys) {
if (keys.length === 1 && Array.isArray(keys[0])) {
/** @type {string[]} */
this.keys = keys[0];
this.defaultValues = {};
} else if (keys.length === 1 && keys[0] && typeof keys[0] === "object") {
this.keys = Object.keys(keys[0]);
this.defaultValues =
/** @type {Record<string, EXPECTED_ANY>} */
(keys[0]);
} else {
this.keys = /** @type {string[]} */ (keys);
this.defaultValues = {};
}
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
const definePlugin = new DefinePlugin({});
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
/** @type {Record<string, CodeValue>} */
const definitions = {};
for (const key of this.keys) {
const value =
process.env[key] !== undefined
? process.env[key]
: this.defaultValues[key];
if (value === undefined) {
const error = new WebpackError(
`${PLUGIN_NAME} - ${key} environment variable is undefined.\n\n` +
"You can pass an object with default values to suppress this warning.\n" +
"See https://webpack.js.org/plugins/environment-plugin for example."
);
error.name = "EnvVariableNotDefinedError";
compilation.errors.push(error);
}
const defValue =
value === undefined ? "undefined" : JSON.stringify(value);
definitions[`process.env.${key}`] = defValue;
definitions[`import.meta.env.${key}`] = defValue;
}
definePlugin.definitions = definitions;
});
definePlugin.apply(compiler);
}
}
module.exports = EnvironmentPlugin;

View File

@@ -0,0 +1,34 @@
export const getQueuesWithSchedules = ({ jobsConfig })=>{
const tasksWithSchedules = jobsConfig.tasks?.filter((task)=>{
return task.schedule?.length;
}) ?? [];
const workflowsWithSchedules = jobsConfig.workflows?.filter((workflow)=>{
return workflow.schedule?.length;
}) ?? [];
const queuesWithSchedules = {};
for (const task of tasksWithSchedules){
for (const schedule of task.schedule ?? []){
;
(queuesWithSchedules[schedule.queue] ??= {
schedules: []
}).schedules.push({
scheduleConfig: schedule,
taskConfig: task
});
}
}
for (const workflow of workflowsWithSchedules){
for (const schedule of workflow.schedule ?? []){
;
(queuesWithSchedules[schedule.queue] ??= {
schedules: []
}).schedules.push({
scheduleConfig: schedule,
workflowConfig: workflow
});
}
}
return queuesWithSchedules;
};
//# sourceMappingURL=getQueuesWithSchedules.js.map

View File

@@ -0,0 +1,9 @@
/**
* @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.
*/
export { default } from './rows-3.js';
//# sourceMappingURL=panels-top-bottom.js.map

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"names":["_applyDecoratedDescriptor","target","property","decorators","descriptor","context","desc","Object","keys","forEach","key","enumerable","configurable","initializer","writable","slice","reverse","reduce","decorator","value","call","defineProperty"],"sources":["../../src/helpers/applyDecoratedDescriptor.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\ninterface DescriptorWithInitializer extends PropertyDescriptor {\n initializer?: () => any;\n}\n\ndeclare const Object: Omit<typeof globalThis.Object, \"keys\"> & {\n keys<T>(o: T): (keyof T)[];\n};\n\nexport default function _applyDecoratedDescriptor<T>(\n target: T,\n property: PropertyKey,\n decorators: ((\n t: T,\n p: PropertyKey,\n desc: DescriptorWithInitializer,\n ) => any)[],\n descriptor: DescriptorWithInitializer,\n context: DecoratorContext,\n) {\n var desc: DescriptorWithInitializer = {};\n Object.keys(descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if (\"value\" in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators\n .slice()\n .reverse()\n .reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = void 0;\n }\n\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n return null;\n }\n\n return desc;\n}\n"],"mappings":";;;;;;AAUe,SAASA,yBAAyBA,CAC/CC,MAAS,EACTC,QAAqB,EACrBC,UAIW,EACXC,UAAqC,EACrCC,OAAyB,EACzB;EACA,IAAIC,IAA+B,GAAG,CAAC,CAAC;EACxCC,MAAM,CAACC,IAAI,CAACJ,UAAU,CAAC,CAACK,OAAO,CAAC,UAAUC,GAAG,EAAE;IAC7CJ,IAAI,CAACI,GAAG,CAAC,GAAGN,UAAU,CAACM,GAAG,CAAC;EAC7B,CAAC,CAAC;EACFJ,IAAI,CAACK,UAAU,GAAG,CAAC,CAACL,IAAI,CAACK,UAAU;EACnCL,IAAI,CAACM,YAAY,GAAG,CAAC,CAACN,IAAI,CAACM,YAAY;EACvC,IAAI,OAAO,IAAIN,IAAI,IAAIA,IAAI,CAACO,WAAW,EAAE;IACvCP,IAAI,CAACQ,QAAQ,GAAG,IAAI;EACtB;EAEAR,IAAI,GAAGH,UAAU,CACdY,KAAK,CAAC,CAAC,CACPC,OAAO,CAAC,CAAC,CACTC,MAAM,CAAC,UAAUX,IAAI,EAAEY,SAAS,EAAE;IACjC,OAAOA,SAAS,CAACjB,MAAM,EAAEC,QAAQ,EAAEI,IAAI,CAAC,IAAIA,IAAI;EAClD,CAAC,EAAEA,IAAI,CAAC;EAEV,IAAID,OAAO,IAAIC,IAAI,CAACO,WAAW,KAAK,KAAK,CAAC,EAAE;IAC1CP,IAAI,CAACa,KAAK,GAAGb,IAAI,CAACO,WAAW,GAAGP,IAAI,CAACO,WAAW,CAACO,IAAI,CAACf,OAAO,CAAC,GAAG,KAAK,CAAC;IACvEC,IAAI,CAACO,WAAW,GAAG,KAAK,CAAC;EAC3B;EAEA,IAAIP,IAAI,CAACO,WAAW,KAAK,KAAK,CAAC,EAAE;IAC/BN,MAAM,CAACc,cAAc,CAACpB,MAAM,EAAEC,QAAQ,EAAEI,IAAI,CAAC;IAC7C,OAAO,IAAI;EACb;EAEA,OAAOA,IAAI;AACb","ignoreList":[]}

View File

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

View File

@@ -0,0 +1,13 @@
import { type IntlConfig, type Locale, _createIntlFormatters } from 'use-intl/core';
declare function getConfigImpl(localeOverride?: Locale): Promise<{
locale: IntlConfig['locale'];
formats?: NonNullable<IntlConfig['formats']>;
timeZone: NonNullable<IntlConfig['timeZone']>;
onError: NonNullable<IntlConfig['onError']>;
getMessageFallback: NonNullable<IntlConfig['getMessageFallback']>;
messages?: NonNullable<IntlConfig['messages']>;
now?: NonNullable<IntlConfig['now']>;
_formatters: ReturnType<typeof _createIntlFormatters>;
}>;
declare const getConfig: typeof getConfigImpl;
export default getConfig;

View File

@@ -0,0 +1,52 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Haijie Xie @hai-x
*/
"use strict";
const HarmonyImportDependency = require("../dependencies/HarmonyImportDependency");
/** @typedef {import("../ModuleGraph")} ModuleGraph */
/** @typedef {import("../Module")} Module */
/** @typedef {Set<Module>} Modules */
/**
* @param {ModuleGraph} moduleGraph module graph
* @param {Module} module module
* @returns {Modules} set of modules
*/
const getOutgoingAsyncModules = (moduleGraph, module) => {
/** @type {Modules} */
const set = new Set();
/** @type {Modules} */
const seen = new Set();
(function g(module) {
if (!moduleGraph.isAsync(module) || seen.has(module)) return;
seen.add(module);
if (module.buildMeta && module.buildMeta.async) {
set.add(module);
} else {
const outgoingConnectionMap =
moduleGraph.getOutgoingConnectionsByModule(module);
if (outgoingConnectionMap) {
for (const [module, connections] of outgoingConnectionMap) {
if (
connections.some(
(c) =>
c.dependency instanceof HarmonyImportDependency &&
c.isTargetActive(undefined)
) &&
module
) {
g(module);
}
}
}
}
})(module);
return set;
};
module.exports.getOutgoingAsyncModules = getOutgoingAsyncModules;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/singlestore-core/view-base.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport type { ColumnsSelection } from '~/sql/sql.ts';\nimport { View } from '~/sql/sql.ts';\n\nexport abstract class SingleStoreViewBase<\n\tTName extends string = string,\n\tTExisting extends boolean = boolean,\n\tTSelectedFields extends ColumnsSelection = ColumnsSelection,\n> extends View<TName, TExisting, TSelectedFields> {\n\tstatic override readonly [entityKind]: string = 'SingleStoreViewBase';\n\n\tdeclare readonly _: View<TName, TExisting, TSelectedFields>['_'] & {\n\t\treadonly viewBrand: 'SingleStoreViewBase';\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAE3B,iBAAqB;AAEd,MAAe,4BAIZ,gBAAwC;AAAA,EACjD,QAA0B,wBAAU,IAAY;AAKjD;","names":[]}

View File

@@ -0,0 +1,36 @@
"use strict";
exports.SecondParser = void 0;
var _constants = require("../constants.js");
var _Parser = require("../Parser.js");
var _utils = require("../utils.js");
class SecondParser extends _Parser.Parser {
priority = 50;
parse(dateString, token, match) {
switch (token) {
case "s":
return (0, _utils.parseNumericPattern)(
_constants.numericPatterns.second,
dateString,
);
case "so":
return match.ordinalNumber(dateString, { unit: "second" });
default:
return (0, _utils.parseNDigits)(token.length, dateString);
}
}
validate(_date, value) {
return value >= 0 && value <= 59;
}
set(date, _flags, value) {
date.setSeconds(value, 0);
return date;
}
incompatibleTokens = ["t", "T"];
}
exports.SecondParser = SecondParser;

View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "y年M月d日EEEE",
long: "y年M月d日",
medium: "y/MM/dd",
short: "y/MM/dd",
};
const timeFormats = {
full: "H時mm分ss秒 zzzz",
long: "H:mm:ss z",
medium: "H:mm:ss",
short: "H:mm",
};
const dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};

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