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,23 @@
/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
/**
* Inserts wrapper `details` in a comment at the top of the `source` body.
*
* @private
* @param {string} source The source to modify.
* @returns {Array} details The details to insert.
* @returns {string} Returns the modified source.
*/
function insertWrapDetails(source, details) {
var length = details.length;
if (!length) {
return source;
}
var lastIndex = length - 1;
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
details = details.join(length > 2 ? ', ' : ' ');
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
}
module.exports = insertWrapDetails;

View File

@@ -0,0 +1,134 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)(ος|η|ο)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(πΧ|μΧ)/i,
abbreviated: /^(π\.?\s?χ\.?|π\.?\s?κ\.?\s?χ\.?|μ\.?\s?χ\.?|κ\.?\s?χ\.?)/i,
wide: /^(προ Χριστο(ύ|υ)|πριν απ(ό|ο) την Κοιν(ή|η) Χρονολογ(ί|ι)α|μετ(ά|α) Χριστ(ό|ο)ν|Κοιν(ή|η) Χρονολογ(ί|ι)α)/i,
};
const parseEraPatterns = {
any: [/^π/i, /^(μ|κ)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^τ[1234]/i,
wide: /^[1234]ο? τρ(ί|ι)μηνο/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[ιφμαμιιασονδ]/i,
abbreviated:
/^(ιαν|φεβ|μ[άα]ρ|απρ|μ[άα][ιΐ]|ιο[ύυ]ν|ιο[ύυ]λ|α[ύυ]γ|σεπ|οκτ|νο[έε]|δεκ)/i,
wide: /^(μ[άα][ιΐ]|α[ύυ]γο[υύ]στ)(ος|ου)|(ιανου[άα]ρ|φεβρου[άα]ρ|μ[άα]ρτ|απρ[ίι]λ|ιο[ύυ]ν|ιο[ύυ]λ|σεπτ[έε]μβρ|οκτ[ώω]βρ|νο[έε]μβρ|δεκ[έε]μβρ)(ιος|ίου)/i,
};
const parseMonthPatterns = {
narrow: [
/^ι/i,
/^φ/i,
/^μ/i,
/^α/i,
/^μ/i,
/^ι/i,
/^ι/i,
/^α/i,
/^σ/i,
/^ο/i,
/^ν/i,
/^δ/i,
],
any: [
/^ια/i,
/^φ/i,
/^μ[άα]ρ/i,
/^απ/i,
/^μ[άα][ιΐ]/i,
/^ιο[ύυ]ν/i,
/^ιο[ύυ]λ/i,
/^α[ύυ]/i,
/^σ/i,
/^ο/i,
/^ν/i,
/^δ/i,
],
};
const matchDayPatterns = {
narrow: /^[κδτπσ]/i,
short: /^(κυ|δε|τρ|τε|π[εέ]|π[αά]|σ[αά])/i,
abbreviated: /^(κυρ|δευ|τρι|τετ|πεμ|παρ|σαβ)/i,
wide: /^(κυριακ(ή|η)|δευτ(έ|ε)ρα|τρ(ί|ι)τη|τετ(ά|α)ρτη|π(έ|ε)μπτη|παρασκευ(ή|η)|σ(ά|α)ββατο)/i,
};
const parseDayPatterns = {
narrow: [/^κ/i, /^δ/i, /^τ/i, /^τ/i, /^π/i, /^π/i, /^σ/i],
any: [/^κ/i, /^δ/i, /^τρ/i, /^τε/i, /^π[εέ]/i, /^π[αά]/i, /^σ/i],
};
const matchDayPeriodPatterns = {
narrow:
/^(πμ|μμ|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i,
any: /^([πμ]\.?\s?μ\.?|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^πμ|π\.\s?μ\./i,
pm: /^μμ|μ\.\s?μ\./i,
midnight: /^μεσάν/i,
noon: /^μεσημ(έ|ε)/i,
morning: /πρω(ί|ι)/i,
afternoon: /απ(ό|ο)γευμα/i,
evening: /βρ(ά|α)δυ/i,
night: /ν(ύ|υ)χτα/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@@ -0,0 +1,18 @@
import { entityKind } from "./entity.cjs";
export declare class DrizzleError extends Error {
static readonly [entityKind]: string;
constructor({ message, cause }: {
message?: string;
cause?: unknown;
});
}
export declare class DrizzleQueryError extends Error {
query: string;
params: any[];
cause?: Error | undefined;
constructor(query: string, params: any[], cause?: Error | undefined);
}
export declare class TransactionRollbackError extends DrizzleError {
static readonly [entityKind]: string;
constructor();
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/More/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,cAAc,CAAA;AAErB,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAsBrD,CAAA"}

View File

@@ -0,0 +1 @@
export { default as createNavigation } from './navigation/react-server/createNavigation.js';

View File

@@ -0,0 +1,199 @@
'use strict'
const { parseSetCookie } = require('./parse')
const { stringify } = require('./util')
const { webidl } = require('../webidl')
const { Headers } = require('../fetch/headers')
const brandChecks = webidl.brandCheckMultiple([Headers, globalThis.Headers].filter(Boolean))
/**
* @typedef {Object} Cookie
* @property {string} name
* @property {string} value
* @property {Date|number} [expires]
* @property {number} [maxAge]
* @property {string} [domain]
* @property {string} [path]
* @property {boolean} [secure]
* @property {boolean} [httpOnly]
* @property {'Strict'|'Lax'|'None'} [sameSite]
* @property {string[]} [unparsed]
*/
/**
* @param {Headers} headers
* @returns {Record<string, string>}
*/
function getCookies (headers) {
webidl.argumentLengthCheck(arguments, 1, 'getCookies')
brandChecks(headers)
const cookie = headers.get('cookie')
/** @type {Record<string, string>} */
const out = {}
if (!cookie) {
return out
}
for (const piece of cookie.split(';')) {
const [name, ...value] = piece.split('=')
out[name.trim()] = value.join('=')
}
return out
}
/**
* @param {Headers} headers
* @param {string} name
* @param {{ path?: string, domain?: string }|undefined} attributes
* @returns {void}
*/
function deleteCookie (headers, name, attributes) {
brandChecks(headers)
const prefix = 'deleteCookie'
webidl.argumentLengthCheck(arguments, 2, prefix)
name = webidl.converters.DOMString(name, prefix, 'name')
attributes = webidl.converters.DeleteCookieAttributes(attributes)
// Matches behavior of
// https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
setCookie(headers, {
name,
value: '',
expires: new Date(0),
...attributes
})
}
/**
* @param {Headers} headers
* @returns {Cookie[]}
*/
function getSetCookies (headers) {
webidl.argumentLengthCheck(arguments, 1, 'getSetCookies')
brandChecks(headers)
const cookies = headers.getSetCookie()
if (!cookies) {
return []
}
return cookies.map((pair) => parseSetCookie(pair))
}
/**
* Parses a cookie string
* @param {string} cookie
*/
function parseCookie (cookie) {
cookie = webidl.converters.DOMString(cookie)
return parseSetCookie(cookie)
}
/**
* @param {Headers} headers
* @param {Cookie} cookie
* @returns {void}
*/
function setCookie (headers, cookie) {
webidl.argumentLengthCheck(arguments, 2, 'setCookie')
brandChecks(headers)
cookie = webidl.converters.Cookie(cookie)
const str = stringify(cookie)
if (str) {
headers.append('set-cookie', str, true)
}
}
webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
{
converter: webidl.nullableConverter(webidl.converters.DOMString),
key: 'path',
defaultValue: () => null
},
{
converter: webidl.nullableConverter(webidl.converters.DOMString),
key: 'domain',
defaultValue: () => null
}
])
webidl.converters.Cookie = webidl.dictionaryConverter([
{
converter: webidl.converters.DOMString,
key: 'name'
},
{
converter: webidl.converters.DOMString,
key: 'value'
},
{
converter: webidl.nullableConverter((value) => {
if (typeof value === 'number') {
return webidl.converters['unsigned long long'](value)
}
return new Date(value)
}),
key: 'expires',
defaultValue: () => null
},
{
converter: webidl.nullableConverter(webidl.converters['long long']),
key: 'maxAge',
defaultValue: () => null
},
{
converter: webidl.nullableConverter(webidl.converters.DOMString),
key: 'domain',
defaultValue: () => null
},
{
converter: webidl.nullableConverter(webidl.converters.DOMString),
key: 'path',
defaultValue: () => null
},
{
converter: webidl.nullableConverter(webidl.converters.boolean),
key: 'secure',
defaultValue: () => null
},
{
converter: webidl.nullableConverter(webidl.converters.boolean),
key: 'httpOnly',
defaultValue: () => null
},
{
converter: webidl.converters.USVString,
key: 'sameSite',
allowedValues: ['Strict', 'Lax', 'None']
},
{
converter: webidl.sequenceConverter(webidl.converters.DOMString),
key: 'unparsed',
defaultValue: () => []
}
])
module.exports = {
getCookies,
deleteCookie,
getSetCookies,
setCookie,
parseCookie
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/EmailAndUsername/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAGlF,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,cAAc,CAAA;AAIrB,KAAK,iCAAiC,GAAG;IACvC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,KAAK,GAAG,wBAAwB,CAAA;IACpD,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC/B,WAAW,CAAC,EACR;QACE,CAAC,SAAS,EAAE,MAAM,GAAG,yBAAyB,CAAA;KAC/C,GACD,IAAI,CAAA;IACR,QAAQ,EAAE,OAAO,CAAA;IACjB,CAAC,EAAE,SAAS,CAAA;CACb,CAAA;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,iCAAiC,qBA8F9E"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"ko.d.ts","sourceRoot":"","sources":["../../src/languages/ko.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtE,eAAO,MAAM,cAAc,EAAE,yBAonB5B,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,QAGhB,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/FieldDiffContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,OAAO,cAAc,CAAA;AAErB,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAM1E,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE;QACL,KAAK,CAAC,EAAE,KAAK,GAAG,aAAa,GAAG,WAAW,CAAA;QAC3C,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,EAAE,EAAE,KAAK,CAAC,SAAS,CAAA;CACpB,CA2CA,CAAA"}

View File

@@ -0,0 +1,29 @@
"use strict";
exports.isSaturday = isSaturday;
var _index = require("./toDate.cjs");
/**
* The {@link isSaturday} function options.
*/
/**
* @name isSaturday
* @category Weekday Helpers
* @summary Is the given date Saturday?
*
* @description
* Is the given date Saturday?
*
* @param date - The date to check
* @param options - An object with options
*
* @returns The date is Saturday
*
* @example
* // Is 27 September 2014 Saturday?
* const result = isSaturday(new Date(2014, 8, 27))
* //=> true
*/
function isSaturday(date, options) {
return (0, _index.toDate)(date, options?.in).getDay() === 6;
}

View File

@@ -0,0 +1,17 @@
import { RequestOptions, RequestTransformer, ResponseTransformer } from "../types/request.js";
//#region src/rest/types.d.ts
interface RestCommand<_Output extends object | unknown, _Schema> {
(): RequestOptions;
}
interface RestClient<Schema> {
request<Output>(options: RestCommand<Output, Schema>): Promise<Output>;
}
interface RestConfig {
credentials?: RequestCredentials;
onRequest?: RequestTransformer;
onResponse?: ResponseTransformer;
}
//#endregion
export { RestClient, RestCommand, RestConfig };
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1,150 @@
/*
Solarized Color Schemes originally by Ethan Schoonover
http://ethanschoonover.com/solarized
Ported for PrismJS by Hector Matos
Website: https://krakendev.io
Twitter Handle: https://twitter.com/allonsykraken)
*/
/*
SOLARIZED HEX
--------- -------
base03 #002b36
base02 #073642
base01 #586e75
base00 #657b83
base0 #839496
base1 #93a1a1
base2 #eee8d5
base3 #fdf6e3
yellow #b58900
orange #cb4b16
red #dc322f
magenta #d33682
violet #6c71c4
blue #268bd2
cyan #2aa198
green #859900
*/
code[class*="language-"],
pre[class*="language-"] {
color: #657b83; /* base00 */
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-size: 1em;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
background: #073642; /* base02 */
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
background: #073642; /* base02 */
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
border-radius: 0.3em;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background-color: #fdf6e3; /* base3 */
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #93a1a1; /* base1 */
}
.token.punctuation {
color: #586e75; /* base01 */
}
.token.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #268bd2; /* blue */
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.url,
.token.inserted {
color: #2aa198; /* cyan */
}
.token.entity {
color: #657b83; /* base00 */
background: #eee8d5; /* base2 */
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #859900; /* green */
}
.token.function,
.token.class-name {
color: #b58900; /* yellow */
}
.token.regex,
.token.important,
.token.variable {
color: #cb4b16; /* orange */
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

View File

@@ -0,0 +1,24 @@
import { TracerProvider, Tracer as ApiTracer } from '@opentelemetry/api';
import { TracerConfig } from './types';
export declare enum ForceFlushState {
'resolved' = 0,
'timeout' = 1,
'error' = 2,
'unresolved' = 3
}
/**
* This class represents a basic tracer provider which platform libraries can extend
*/
export declare class BasicTracerProvider implements TracerProvider {
private readonly _config;
private readonly _tracers;
private readonly _resource;
private readonly _activeSpanProcessor;
constructor(config?: TracerConfig);
getTracer(name: string, version?: string, options?: {
schemaUrl?: string;
}): ApiTracer;
forceFlush(): Promise<void>;
shutdown(): Promise<void>;
}
//# sourceMappingURL=BasicTracerProvider.d.ts.map

View File

@@ -0,0 +1,125 @@
import rng from './rng.js';
import { unsafeStringify } from './stringify.js';
// **`v1()` - Generate time-based UUID**
//
// Inspired by https://github.com/LiosK/UUID.js
// and http://docs.python.org/library/uuid.html
let _nodeId;
let _clockseq;
// Previous uuid creation time
let _lastMSecs = 0;
let _lastNSecs = 0;
// See https://github.com/uuidjs/uuid for API details
function v1(options, buf, offset) {
let i = buf && offset || 0;
const b = buf || new Array(16);
options = options || {};
let node = options.node;
let clockseq = options.clockseq;
// v1 only: Use cached `node` and `clockseq` values
if (!options._v6) {
if (!node) {
node = _nodeId;
}
if (clockseq == null) {
clockseq = _clockseq;
}
}
// Handle cases where we need entropy. We do this lazily to minimize issues
// related to insufficient system entropy. See #189
if (node == null || clockseq == null) {
const seedBytes = options.random || (options.rng || rng)();
// Randomize node
if (node == null) {
node = [seedBytes[0], seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
// v1 only: cache node value for reuse
if (!_nodeId && !options._v6) {
// per RFC4122 4.5: Set MAC multicast bit (v1 only)
node[0] |= 0x01; // Set multicast bit
_nodeId = node;
}
}
// Randomize clockseq
if (clockseq == null) {
// Per 4.2.2, randomize (14 bit) clockseq
clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
if (_clockseq === undefined && !options._v6) {
_clockseq = clockseq;
}
}
}
// v1 & v6 timestamps are 100 nano-second units since the Gregorian epoch,
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so time is
// handled internally as 'msecs' (integer milliseconds) and 'nsecs'
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
let msecs = options.msecs !== undefined ? options.msecs : Date.now();
// Per 4.2.1.2, use count of uuid's generated during the current clock
// cycle to simulate higher resolution clock
let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
// Time since last uuid creation (in msecs)
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000;
// Per 4.2.1.2, Bump clockseq on clock regression
if (dt < 0 && options.clockseq === undefined) {
clockseq = clockseq + 1 & 0x3fff;
}
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
// time interval
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
nsecs = 0;
}
// Per 4.2.1.2 Throw error if too many uuids are requested
if (nsecs >= 10000) {
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
}
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq;
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
msecs += 12219292800000;
// `time_low`
const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
b[i++] = tl >>> 24 & 0xff;
b[i++] = tl >>> 16 & 0xff;
b[i++] = tl >>> 8 & 0xff;
b[i++] = tl & 0xff;
// `time_mid`
const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
b[i++] = tmh >>> 8 & 0xff;
b[i++] = tmh & 0xff;
// `time_high_and_version`
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
b[i++] = tmh >>> 16 & 0xff;
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
b[i++] = clockseq >>> 8 | 0x80;
// `clock_seq_low`
b[i++] = clockseq & 0xff;
// `node`
for (let n = 0; n < 6; ++n) {
b[i + n] = node[n];
}
return buf || unsafeStringify(b);
}
export default v1;

View File

@@ -0,0 +1,13 @@
export { pathToArray as responsePathAsArray } from '../jsutils/Path.mjs';
export {
execute,
executeSync,
defaultFieldResolver,
defaultTypeResolver,
} from './execute.mjs';
export { subscribe, createSourceEventStream } from './subscribe.mjs';
export {
getArgumentValues,
getVariableValues,
getDirectiveValues,
} from './values.mjs';

View File

@@ -0,0 +1,139 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
one: "أقل من ثانية",
two: "أقل من ثانيتين",
threeToTen: "أقل من {{count}} ثواني",
other: "أقل من {{count}} ثانية",
},
xSeconds: {
one: "ثانية",
two: "ثانيتين",
threeToTen: "{{count}} ثواني",
other: "{{count}} ثانية",
},
halfAMinute: "نص دقيقة",
lessThanXMinutes: {
one: "أقل من دقيقة",
two: "أقل من دقيقتين",
threeToTen: "أقل من {{count}} دقايق",
other: "أقل من {{count}} دقيقة",
},
xMinutes: {
one: "دقيقة",
two: "دقيقتين",
threeToTen: "{{count}} دقايق",
other: "{{count}} دقيقة",
},
aboutXHours: {
one: "حوالي ساعة",
two: "حوالي ساعتين",
threeToTen: "حوالي {{count}} ساعات",
other: "حوالي {{count}} ساعة",
},
xHours: {
one: "ساعة",
two: "ساعتين",
threeToTen: "{{count}} ساعات",
other: "{{count}} ساعة",
},
xDays: {
one: "يوم",
two: "يومين",
threeToTen: "{{count}} أيام",
other: "{{count}} يوم",
},
aboutXWeeks: {
one: "حوالي أسبوع",
two: "حوالي أسبوعين",
threeToTen: "حوالي {{count}} أسابيع",
other: "حوالي {{count}} أسبوع",
},
xWeeks: {
one: "أسبوع",
two: "أسبوعين",
threeToTen: "{{count}} أسابيع",
other: "{{count}} أسبوع",
},
aboutXMonths: {
one: "حوالي شهر",
two: "حوالي شهرين",
threeToTen: "حوالي {{count}} أشهر",
other: "حوالي {{count}} شهر",
},
xMonths: {
one: "شهر",
two: "شهرين",
threeToTen: "{{count}} أشهر",
other: "{{count}} شهر",
},
aboutXYears: {
one: "حوالي سنة",
two: "حوالي سنتين",
threeToTen: "حوالي {{count}} سنين",
other: "حوالي {{count}} سنة",
},
xYears: {
one: "عام",
two: "عامين",
threeToTen: "{{count}} أعوام",
other: "{{count}} عام",
},
overXYears: {
one: "أكثر من سنة",
two: "أكثر من سنتين",
threeToTen: "أكثر من {{count}} سنين",
other: "أكثر من {{count}} سنة",
},
almostXYears: {
one: "عام تقريبًا",
two: "عامين تقريبًا",
threeToTen: "{{count}} أعوام تقريبًا",
other: "{{count}} عام تقريبًا",
},
};
const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else if (count === 2) {
result = tokenValue.two;
} else if (count <= 10) {
result = tokenValue.threeToTen.replace("{{count}}", String(count));
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return `في خلال ${result}`;
} else {
return `منذ ${result}`;
}
}
return result;
};
exports.formatDistance = formatDistance;

View File

@@ -0,0 +1,21 @@
/**
* Reserved field names for collections with auth config enabled
*/
export declare const reservedBaseAuthFieldNames: string[];
/**
* Reserved field names for auth collections with verify: true
*/
export declare const reservedVerifyFieldNames: never[];
/**
* Reserved field names for auth collections with useApiKey: true
*/
export declare const reservedAPIKeyFieldNames: never[];
/**
* Reserved field names for collections with upload config enabled
*/
export declare const reservedBaseUploadFieldNames: string[];
/**
* Reserved field names for collections with versions enabled
*/
export declare const reservedVersionsFieldNames: never[];
//# sourceMappingURL=reservedFieldNames.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"file-digit.js","sources":["../../../src/icons/file-digit.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileDigit\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMmgxNGEyIDIgMCAwIDAgMi0yVjdsLTUtNUg2YTIgMiAwIDAgMC0yIDJ2NCIgLz4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI2IiB4PSIyIiB5PSIxMiIgcng9IjIiIC8+CiAgPHBhdGggZD0iTTEwIDEyaDJ2NiIgLz4KICA8cGF0aCBkPSJNMTAgMThoNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file-digit\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 FileDigit = createLucideIcon('FileDigit', [\n ['path', { d: 'M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4', key: '1pf5j1' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['rect', { width: '4', height: '6', x: '2', y: '12', rx: '2', key: 'jm304g' }],\n ['path', { d: 'M10 12h2v6', key: '12zw74' }],\n ['path', { d: 'M10 18h4', key: '1ulq68' }],\n]);\n\nexport default FileDigit;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,142 @@
import { isValid } from "./isValid.mjs";
import { toDate } from "./toDate.mjs";
import { lightFormatters } from "./_lib/format/lightFormatters.mjs";
// Rexports of internal for libraries to use.
// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
export { lightFormatters };
// This RegExp consists of three parts separated by `|`:
// - (\w)\1* matches any sequences of the same letter
// - '' matches two quote characters in a row
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
// except a single quote symbol, which ends the sequence.
// Two quote characters do not end the sequence.
// If there is no matching single quote
// then the sequence will continue until the end of the string.
// - . matches any single character unmatched by previous parts of the RegExps
const formattingTokensRegExp = /(\w)\1*|''|'(''|[^'])+('|$)|./g;
const escapedStringRegExp = /^'([^]*?)'?$/;
const doubleQuoteRegExp = /''/g;
const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
/**
* @private
*/
/**
* @name lightFormat
* @category Common Helpers
* @summary Format the date.
*
* @description
* Return the formatted date string in the given format. Unlike `format`,
* `lightFormat` doesn't use locales and outputs date using the most popular tokens.
*
* > ⚠️ Please note that the `lightFormat` tokens differ from Moment.js and other libraries.
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* The characters wrapped between two single quotes characters (') are escaped.
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
*
* Format of the string is based on Unicode Technical Standard #35:
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
*
* Accepted patterns:
* | Unit | Pattern | Result examples |
* |---------------------------------|---------|-----------------------------------|
* | AM, PM | a..aaa | AM, PM |
* | | aaaa | a.m., p.m. |
* | | aaaaa | a, p |
* | Calendar year | y | 44, 1, 1900, 2017 |
* | | yy | 44, 01, 00, 17 |
* | | yyy | 044, 001, 000, 017 |
* | | yyyy | 0044, 0001, 1900, 2017 |
* | Month (formatting) | M | 1, 2, ..., 12 |
* | | MM | 01, 02, ..., 12 |
* | Day of month | d | 1, 2, ..., 31 |
* | | dd | 01, 02, ..., 31 |
* | Hour [1-12] | h | 1, 2, ..., 11, 12 |
* | | hh | 01, 02, ..., 11, 12 |
* | Hour [0-23] | H | 0, 1, 2, ..., 23 |
* | | HH | 00, 01, 02, ..., 23 |
* | Minute | m | 0, 1, ..., 59 |
* | | mm | 00, 01, ..., 59 |
* | Second | s | 0, 1, ..., 59 |
* | | ss | 00, 01, ..., 59 |
* | Fraction of second | S | 0, 1, ..., 9 |
* | | SS | 00, 01, ..., 99 |
* | | SSS | 000, 001, ..., 999 |
* | | SSSS | ... |
*
* @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
* @param format - The string of tokens
*
* @returns The formatted date string
*
* @throws `Invalid time value` if the date is invalid
* @throws format string contains an unescaped latin alphabet character
*
* @example
* const result = lightFormat(new Date(2014, 1, 11), 'yyyy-MM-dd')
* //=> '2014-02-11'
*/
export function lightFormat(date, formatStr) {
const _date = toDate(date);
if (!isValid(_date)) {
throw new RangeError("Invalid time value");
}
const tokens = formatStr.match(formattingTokensRegExp);
// The only case when formattingTokensRegExp doesn't match the string is when it's empty
if (!tokens) return "";
const result = tokens
.map((substring) => {
// Replace two single quote characters with one single quote character
if (substring === "''") {
return "'";
}
const firstCharacter = substring[0];
if (firstCharacter === "'") {
return cleanEscapedString(substring);
}
const formatter = lightFormatters[firstCharacter];
if (formatter) {
return formatter(_date, substring);
}
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
throw new RangeError(
"Format string contains an unescaped latin alphabet character `" +
firstCharacter +
"`",
);
}
return substring;
})
.join("");
return result;
}
function cleanEscapedString(input) {
const matches = input.match(escapedStringRegExp);
if (!matches) {
return input;
}
return matches[1].replace(doubleQuoteRegExp, "'");
}
// Fallback for modularized imports:
export default lightFormat;

View File

@@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildDynamicImport = buildDynamicImport;
var _core = require("@babel/core");
exports.getDynamicImportSource = function getDynamicImportSource(node) {
const [source] = node.arguments;
return _core.types.isStringLiteral(source) || _core.types.isTemplateLiteral(source) ? source : _core.template.expression.ast`\`\${${source}}\``;
};
function buildDynamicImport(node, deferToThen, wrapWithPromise, builder) {
const specifier = _core.types.isCallExpression(node) ? node.arguments[0] : node.source;
if (_core.types.isStringLiteral(specifier) || _core.types.isTemplateLiteral(specifier) && specifier.quasis.length === 0) {
if (deferToThen) {
return _core.template.expression.ast`
Promise.resolve().then(() => ${builder(specifier)})
`;
} else return builder(specifier);
}
const specifierToString = _core.types.isTemplateLiteral(specifier) ? _core.types.identifier("specifier") : _core.types.templateLiteral([_core.types.templateElement({
raw: ""
}), _core.types.templateElement({
raw: ""
})], [_core.types.identifier("specifier")]);
if (deferToThen) {
return _core.template.expression.ast`
(specifier =>
new Promise(r => r(${specifierToString}))
.then(s => ${builder(_core.types.identifier("s"))})
)(${specifier})
`;
} else if (wrapWithPromise) {
return _core.template.expression.ast`
(specifier =>
new Promise(r => r(${builder(specifierToString)}))
)(${specifier})
`;
} else {
return _core.template.expression.ast`
(specifier => ${builder(specifierToString)})(${specifier})
`;
}
}
//# sourceMappingURL=dynamic-import.js.map

View File

@@ -0,0 +1,170 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["fvt", "vt"],
abbreviated: ["f.v.t.", "v.t."],
wide: ["før vesterlandsk tidsregning", "vesterlandsk tidsregning"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1. kvt.", "2. kvt.", "3. kvt.", "4. kvt."],
wide: ["1. kvartal", "2. kvartal", "3. kvartal", "4. kvartal"],
};
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"jan.",
"feb.",
"mar.",
"apr.",
"maj",
"jun.",
"jul.",
"aug.",
"sep.",
"okt.",
"nov.",
"dec.",
],
wide: [
"januar",
"februar",
"marts",
"april",
"maj",
"juni",
"juli",
"august",
"september",
"oktober",
"november",
"december",
],
};
// Note that 'Days - abbreviated - Formatting' has periods at the end.
// https://www.unicode.org/cldr/charts/32/summary/da.html#1760
// This makes grammatical sense in danish, as most abbreviations have periods.
const dayValues = {
narrow: ["S", "M", "T", "O", "T", "F", "L"],
short: ["sø", "ma", "ti", "on", "to", "fr", "lø"],
abbreviated: ["søn.", "man.", "tir.", "ons.", "tor.", "fre.", "lør."],
wide: [
"søndag",
"mandag",
"tirsdag",
"onsdag",
"torsdag",
"fredag",
"lørdag",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "midnat",
noon: "middag",
morning: "morgen",
afternoon: "eftermiddag",
evening: "aften",
night: "nat",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnat",
noon: "middag",
morning: "morgen",
afternoon: "eftermiddag",
evening: "aften",
night: "nat",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnat",
noon: "middag",
morning: "morgen",
afternoon: "eftermiddag",
evening: "aften",
night: "nat",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "midnat",
noon: "middag",
morning: "om morgenen",
afternoon: "om eftermiddagen",
evening: "om aftenen",
night: "om natten",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnat",
noon: "middag",
morning: "om morgenen",
afternoon: "om eftermiddagen",
evening: "om aftenen",
night: "om natten",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnat",
noon: "middag",
morning: "om morgenen",
afternoon: "om eftermiddagen",
evening: "om aftenen",
night: "om natten",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + ".";
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,82 @@
import type { PaginatedDocs } from '../../../database/types.js';
import type { FindOptions, GlobalSlug, Payload, RequestContext, TypedLocale } from '../../../index.js';
import type { Document, PayloadRequest, PopulateType, SelectType, Sort, Where } from '../../../types/index.js';
import type { TypeWithVersion } from '../../../versions/types.js';
import type { DataFromGlobalSlug } from '../../config/types.js';
export type Options<TSlug extends GlobalSlug> = {
/**
* [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,
* which can be read by hooks. Useful if you want to pass additional information to the hooks which
* shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook
* to determine if it should run or not.
*/
context?: RequestContext;
/**
* [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.
*/
depth?: number;
/**
* Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.
*/
fallbackLocale?: false | TypedLocale;
/**
* The maximum related documents to be returned.
* Defaults unless `defaultLimit` is specified for the collection config
* @default 10
*/
limit?: number;
/**
* Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.
*/
locale?: 'all' | TypedLocale;
/**
* Skip access control.
* Set to `false` if you want to respect Access Control for the operation, for example when fetching data for the front-end.
* @default true
*/
overrideAccess?: boolean;
/**
* Get a specific page number
* @default 1
*/
page?: number;
/**
* Set to `false` to return all documents and avoid querying for document counts which introduces some overhead.
* You can also combine that property with a specified `limit` to limit documents but avoid the count query.
*/
pagination?: boolean;
/**
* Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.
*/
populate?: PopulateType;
/**
* The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.
* Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.
*/
req?: Partial<PayloadRequest>;
/**
* Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.
* @default false
*/
showHiddenFields?: boolean;
/**
* the Global slug to operate against.
*/
slug: TSlug;
/**
* Sort the documents, can be a string or an array of strings
* @example '-version.createdAt' // Sort DESC by createdAt
* @example ['version.group', '-version.createdAt'] // sort by 2 fields, ASC group and DESC createdAt
*/
sort?: Sort;
/**
* If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.
*/
user?: Document;
/**
* A filter [query](https://payloadcms.com/docs/queries/overview)
*/
where?: Where;
} & Pick<FindOptions<string, SelectType>, 'select'>;
export declare function findGlobalVersionsLocal<TSlug extends GlobalSlug>(payload: Payload, options: Options<TSlug>): Promise<PaginatedDocs<TypeWithVersion<DataFromGlobalSlug<TSlug>>>>;
//# sourceMappingURL=findVersions.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/Account/Settings/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAG9E,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,cAAc,CAAA;AAMrB,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IACnB,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAA;IACzC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAA;IACxC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;CAC1B,CAcA,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"version.js","sources":["../../../src/utils/version.ts"],"sourcesContent":["// This is a magic string replaced by rollup\ndeclare const __SENTRY_SDK_VERSION__: string;\n\nexport const SDK_VERSION = typeof __SENTRY_SDK_VERSION__ === 'string' ? __SENTRY_SDK_VERSION__ : '0.0.0-unknown.0';\n"],"names":[],"mappings":";;AAAA;;AAGO,MAAM,WAAA,GAA2D,SAAA;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../src/collections/endpoints/restoreVersion.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAO3D,eAAO,MAAM,qBAAqB,EAAE,cA2BnC,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/json.ts"],"sourcesContent":["import type { Column, SQL } from 'drizzle-orm'\n\nimport { sql } from 'drizzle-orm'\n\nimport type { DrizzleAdapter } from '../types.js'\n\nexport function jsonAgg(adapter: DrizzleAdapter, expression: SQL) {\n if (adapter.name === 'sqlite') {\n return sql`coalesce(json_group_array(${expression}), '[]')`\n }\n\n return sql`coalesce(json_agg(${expression}), '[]'::json)`\n}\n\n/**\n * @param shape Potential for SQL injections, so you shouldn't allow user-specified key names\n */\nexport function jsonBuildObject<T extends Record<string, Column | SQL>>(\n adapter: DrizzleAdapter,\n shape: T,\n) {\n const chunks: SQL[] = []\n\n Object.entries(shape).forEach(([key, value]) => {\n if (chunks.length > 0) {\n chunks.push(sql.raw(','))\n }\n chunks.push(sql.raw(`'${key}',`))\n chunks.push(sql`${value}`)\n })\n\n if (adapter.name === 'sqlite') {\n return sql`json_object(${sql.join(chunks)})`\n }\n\n return sql`json_build_object(${sql.join(chunks)})`\n}\n\nexport const jsonAggBuildObject = <T extends Record<string, Column | SQL>>(\n adapter: DrizzleAdapter,\n shape: T,\n) => {\n return jsonAgg(adapter, jsonBuildObject(adapter, shape))\n}\n"],"names":["sql","jsonAgg","adapter","expression","name","jsonBuildObject","shape","chunks","Object","entries","forEach","key","value","length","push","raw","join","jsonAggBuildObject"],"mappings":"AAEA,SAASA,GAAG,QAAQ,cAAa;AAIjC,OAAO,SAASC,QAAQC,OAAuB,EAAEC,UAAe;IAC9D,IAAID,QAAQE,IAAI,KAAK,UAAU;QAC7B,OAAOJ,GAAG,CAAC,0BAA0B,EAAEG,WAAW,QAAQ,CAAC;IAC7D;IAEA,OAAOH,GAAG,CAAC,kBAAkB,EAAEG,WAAW,cAAc,CAAC;AAC3D;AAEA;;CAEC,GACD,OAAO,SAASE,gBACdH,OAAuB,EACvBI,KAAQ;IAER,MAAMC,SAAgB,EAAE;IAExBC,OAAOC,OAAO,CAACH,OAAOI,OAAO,CAAC,CAAC,CAACC,KAAKC,MAAM;QACzC,IAAIL,OAAOM,MAAM,GAAG,GAAG;YACrBN,OAAOO,IAAI,CAACd,IAAIe,GAAG,CAAC;QACtB;QACAR,OAAOO,IAAI,CAACd,IAAIe,GAAG,CAAC,CAAC,CAAC,EAAEJ,IAAI,EAAE,CAAC;QAC/BJ,OAAOO,IAAI,CAACd,GAAG,CAAC,EAAEY,MAAM,CAAC;IAC3B;IAEA,IAAIV,QAAQE,IAAI,KAAK,UAAU;QAC7B,OAAOJ,GAAG,CAAC,YAAY,EAAEA,IAAIgB,IAAI,CAACT,QAAQ,CAAC,CAAC;IAC9C;IAEA,OAAOP,GAAG,CAAC,kBAAkB,EAAEA,IAAIgB,IAAI,CAACT,QAAQ,CAAC,CAAC;AACpD;AAEA,OAAO,MAAMU,qBAAqB,CAChCf,SACAI;IAEA,OAAOL,QAAQC,SAASG,gBAAgBH,SAASI;AACnD,EAAC"}

View File

@@ -0,0 +1,34 @@
var arrayEvery = require('./_arrayEvery'),
createOver = require('./_createOver');
/**
* Creates a function that checks if **all** of the `predicates` return
* truthy when invoked with the arguments it receives.
*
* Following shorthands are possible for providing predicates.
* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {...(Function|Function[])} [predicates=[_.identity]]
* The predicates to check.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.overEvery([Boolean, isFinite]);
*
* func('1');
* // => true
*
* func(null);
* // => false
*
* func(NaN);
* // => false
*/
var overEvery = createOver(arrayEvery);
module.exports = overEvery;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/rawConstraint.ts"],"sourcesContent":["const RawConstraintSymbol = Symbol('RawConstraint')\n\nexport const DistinctSymbol = Symbol('DistinctSymbol')\n\n/**\n * You can use this to inject a raw query to where\n */\nexport const rawConstraint = (value: unknown) => ({\n type: RawConstraintSymbol,\n value,\n})\n\nexport const isRawConstraint = (value: unknown): value is ReturnType<typeof rawConstraint> => {\n return value && typeof value === 'object' && 'type' in value && value.type === RawConstraintSymbol\n}\n"],"names":["RawConstraintSymbol","Symbol","DistinctSymbol","rawConstraint","value","type","isRawConstraint"],"mappings":"AAAA,MAAMA,sBAAsBC,OAAO;AAEnC,OAAO,MAAMC,iBAAiBD,OAAO,kBAAiB;AAEtD;;CAEC,GACD,OAAO,MAAME,gBAAgB,CAACC,QAAoB,CAAA;QAChDC,MAAML;QACNI;IACF,CAAA,EAAE;AAEF,OAAO,MAAME,kBAAkB,CAACF;IAC9B,OAAOA,SAAS,OAAOA,UAAU,YAAY,UAAUA,SAASA,MAAMC,IAAI,KAAKL;AACjF,EAAC"}

View File

@@ -0,0 +1,159 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const createMappingsSerializer = require("./createMappingsSerializer");
/** @typedef {import("../Source").RawSourceMap} RawSourceMap */
/** @typedef {import("../Source").SourceAndMap} SourceAndMap */
/** @typedef {import("./streamChunks").Options} Options */
/** @typedef {import("./streamChunks").StreamChunksFunction} StreamChunksFunction */
/** @typedef {{ streamChunks: StreamChunksFunction }} SourceLikeWithStreamChunks */
/**
* @param {SourceLikeWithStreamChunks} source source
* @param {Options=} options options
* @returns {RawSourceMap | null} map
*/
module.exports.getMap = (source, options) => {
let mappings = "";
/** @type {(string | null)[]} */
const potentialSources = [];
/** @type {(string | null)[]} */
const potentialSourcesContent = [];
/** @type {(string | null)[]} */
const potentialNames = [];
const addMapping = createMappingsSerializer(options);
source.streamChunks(
{ ...options, source: false, finalSource: true },
(
chunk,
generatedLine,
generatedColumn,
sourceIndex,
originalLine,
originalColumn,
nameIndex,
) => {
mappings += addMapping(
generatedLine,
generatedColumn,
sourceIndex,
originalLine,
originalColumn,
nameIndex,
);
},
(sourceIndex, source, sourceContent) => {
while (potentialSources.length < sourceIndex) {
potentialSources.push(null);
}
potentialSources[sourceIndex] = source;
if (sourceContent !== undefined) {
while (potentialSourcesContent.length < sourceIndex) {
potentialSourcesContent.push(null);
}
potentialSourcesContent[sourceIndex] = sourceContent;
}
},
(nameIndex, name) => {
while (potentialNames.length < nameIndex) {
potentialNames.push(null);
}
potentialNames[nameIndex] = name;
},
);
return mappings.length > 0
? {
version: 3,
file: "x",
mappings,
// We handle broken sources as `null`, in spec this field should be string, but no information what we should do in such cases if we change type it will be breaking change
sources: /** @type {string[]} */ (potentialSources),
sourcesContent:
potentialSourcesContent.length > 0
? /** @type {string[]} */ (potentialSourcesContent)
: undefined,
names: /** @type {string[]} */ (potentialNames),
}
: null;
};
/**
* @param {SourceLikeWithStreamChunks} inputSource input source
* @param {Options=} options options
* @returns {SourceAndMap} map
*/
module.exports.getSourceAndMap = (inputSource, options) => {
let code = "";
let mappings = "";
/** @type {(string | null)[]} */
const potentialSources = [];
/** @type {(string | null)[]} */
const potentialSourcesContent = [];
/** @type {(string | null)[]} */
const potentialNames = [];
const addMapping = createMappingsSerializer(options);
const { source } = inputSource.streamChunks(
{ ...options, finalSource: true },
(
chunk,
generatedLine,
generatedColumn,
sourceIndex,
originalLine,
originalColumn,
nameIndex,
) => {
if (chunk !== undefined) code += chunk;
mappings += addMapping(
generatedLine,
generatedColumn,
sourceIndex,
originalLine,
originalColumn,
nameIndex,
);
},
(sourceIndex, source, sourceContent) => {
while (potentialSources.length < sourceIndex) {
potentialSources.push(null);
}
potentialSources[sourceIndex] = source;
if (sourceContent !== undefined) {
while (potentialSourcesContent.length < sourceIndex) {
potentialSourcesContent.push(null);
}
potentialSourcesContent[sourceIndex] = sourceContent;
}
},
(nameIndex, name) => {
while (potentialNames.length < nameIndex) {
potentialNames.push(null);
}
potentialNames[nameIndex] = name;
},
);
return {
source: source !== undefined ? source : code,
map:
mappings.length > 0
? {
version: 3,
file: "x",
mappings,
// We handle broken sources as `null`, in spec this field should be string, but no information what we should do in such cases if we change type it will be breaking change
sources: /** @type {string[]} */ (potentialSources),
sourcesContent:
potentialSourcesContent.length > 0
? /** @type {string[]} */ (potentialSourcesContent)
: undefined,
names: /** @type {string[]} */ (potentialNames),
}
: null,
};
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/mysql-core/index.ts"],"sourcesContent":["export * from './alias.ts';\nexport * from './checks.ts';\nexport * from './columns/index.ts';\nexport * from './db.ts';\nexport * from './dialect.ts';\nexport * from './foreign-keys.ts';\nexport * from './indexes.ts';\nexport * from './primary-keys.ts';\nexport * from './query-builders/index.ts';\nexport * from './schema.ts';\nexport * from './session.ts';\nexport * from './subquery.ts';\nexport * from './table.ts';\nexport * from './unique-constraint.ts';\nexport * from './utils.ts';\nexport * from './view-common.ts';\nexport * from './view.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,uBAAd;AACA,+BAAc,wBADd;AAEA,+BAAc,+BAFd;AAGA,+BAAc,oBAHd;AAIA,+BAAc,yBAJd;AAKA,+BAAc,8BALd;AAMA,+BAAc,yBANd;AAOA,+BAAc,8BAPd;AAQA,+BAAc,sCARd;AASA,+BAAc,wBATd;AAUA,+BAAc,yBAVd;AAWA,+BAAc,0BAXd;AAYA,+BAAc,uBAZd;AAaA,+BAAc,mCAbd;AAcA,+BAAc,uBAdd;AAeA,+BAAc,6BAfd;AAgBA,+BAAc,sBAhBd;","names":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"keyboard-off.js","sources":["../../../src/icons/keyboard-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name KeyboardOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNIDIwIDQgQTIgMiAwIDAgMSAyMiA2IiAvPgogIDxwYXRoIGQ9Ik0gMjIgNiBMIDIyIDE2LjQxIiAvPgogIDxwYXRoIGQ9Ik0gNyAxNiBMIDE2IDE2IiAvPgogIDxwYXRoIGQ9Ik0gOS42OSA0IEwgMjAgNCIgLz4KICA8cGF0aCBkPSJNMTQgOGguMDEiIC8+CiAgPHBhdGggZD0iTTE4IDhoLjAxIiAvPgogIDxwYXRoIGQ9Im0yIDIgMjAgMjAiIC8+CiAgPHBhdGggZD0iTTIwIDIwSDRhMiAyIDAgMCAxLTItMlY2YTIgMiAwIDAgMSAyLTIiIC8+CiAgPHBhdGggZD0iTTYgOGguMDEiIC8+CiAgPHBhdGggZD0iTTggMTJoLjAxIiAvPgo8L3N2Zz4=) - https://lucide.dev/icons/keyboard-off\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 KeyboardOff = createLucideIcon('KeyboardOff', [\n ['path', { d: 'M 20 4 A2 2 0 0 1 22 6', key: '1g1fkt' }],\n ['path', { d: 'M 22 6 L 22 16.41', key: '1qjg3w' }],\n ['path', { d: 'M 7 16 L 16 16', key: 'n0yqwb' }],\n ['path', { d: 'M 9.69 4 L 20 4', key: 'kbpcgx' }],\n ['path', { d: 'M14 8h.01', key: '1primd' }],\n ['path', { d: 'M18 8h.01', key: 'emo2bl' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n ['path', { d: 'M20 20H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2', key: 's23sx2' }],\n ['path', { d: 'M6 8h.01', key: 'x9i8wu' }],\n ['path', { d: 'M8 12h.01', key: 'czm47f' }],\n]);\n\nexport default KeyboardOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/admin/elements/SaveDraftButton.ts"],"sourcesContent":["import type { ServerProps } from '../../config/types.js'\n\nexport type SaveDraftButtonClientProps = {}\n\nexport type SaveDraftButtonServerPropsOnly = {} & ServerProps\n\nexport type SaveDraftButtonServerProps = SaveDraftButtonClientProps & SaveDraftButtonServerPropsOnly\n"],"names":[],"mappings":"AAMA,WAAoG"}

View File

@@ -0,0 +1,302 @@
"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 view_exports = {};
__export(view_exports, {
DefaultViewBuilderCore: () => DefaultViewBuilderCore,
GelMaterializedView: () => GelMaterializedView,
GelMaterializedViewConfig: () => GelMaterializedViewConfig,
GelView: () => GelView,
ManualMaterializedViewBuilder: () => ManualMaterializedViewBuilder,
ManualViewBuilder: () => ManualViewBuilder,
MaterializedViewBuilder: () => MaterializedViewBuilder,
MaterializedViewBuilderCore: () => MaterializedViewBuilderCore,
ViewBuilder: () => ViewBuilder,
gelMaterializedViewWithSchema: () => gelMaterializedViewWithSchema,
gelViewWithSchema: () => gelViewWithSchema
});
module.exports = __toCommonJS(view_exports);
var import_entity = require("../entity.cjs");
var import_selection_proxy = require("../selection-proxy.cjs");
var import_utils = require("../utils.cjs");
var import_query_builder = require("./query-builders/query-builder.cjs");
var import_table = require("./table.cjs");
var import_view_base = require("./view-base.cjs");
var import_view_common = require("./view-common.cjs");
class DefaultViewBuilderCore {
constructor(name, schema) {
this.name = name;
this.schema = schema;
}
static [import_entity.entityKind] = "GelDefaultViewBuilderCore";
config = {};
with(config) {
this.config.with = config;
return this;
}
}
class ViewBuilder extends DefaultViewBuilderCore {
static [import_entity.entityKind] = "GelViewBuilder";
as(qb) {
if (typeof qb === "function") {
qb = qb(new import_query_builder.QueryBuilder());
}
const selectionProxy = new import_selection_proxy.SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
});
const aliasedSelection = new Proxy(qb.getSelectedFields(), selectionProxy);
return new Proxy(
new GelView({
GelConfig: this.config,
config: {
name: this.name,
schema: this.schema,
selectedFields: aliasedSelection,
query: qb.getSQL().inlineParams()
}
}),
selectionProxy
);
}
}
class ManualViewBuilder extends DefaultViewBuilderCore {
static [import_entity.entityKind] = "GelManualViewBuilder";
columns;
constructor(name, columns, schema) {
super(name, schema);
this.columns = (0, import_utils.getTableColumns)((0, import_table.gelTable)(name, columns));
}
existing() {
return new Proxy(
new GelView({
GelConfig: void 0,
config: {
name: this.name,
schema: this.schema,
selectedFields: this.columns,
query: void 0
}
}),
new import_selection_proxy.SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
})
);
}
as(query) {
return new Proxy(
new GelView({
GelConfig: this.config,
config: {
name: this.name,
schema: this.schema,
selectedFields: this.columns,
query: query.inlineParams()
}
}),
new import_selection_proxy.SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
})
);
}
}
class MaterializedViewBuilderCore {
constructor(name, schema) {
this.name = name;
this.schema = schema;
}
static [import_entity.entityKind] = "GelMaterializedViewBuilderCore";
config = {};
using(using) {
this.config.using = using;
return this;
}
with(config) {
this.config.with = config;
return this;
}
tablespace(tablespace) {
this.config.tablespace = tablespace;
return this;
}
withNoData() {
this.config.withNoData = true;
return this;
}
}
class MaterializedViewBuilder extends MaterializedViewBuilderCore {
static [import_entity.entityKind] = "GelMaterializedViewBuilder";
as(qb) {
if (typeof qb === "function") {
qb = qb(new import_query_builder.QueryBuilder());
}
const selectionProxy = new import_selection_proxy.SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
});
const aliasedSelection = new Proxy(qb.getSelectedFields(), selectionProxy);
return new Proxy(
new GelMaterializedView({
GelConfig: {
with: this.config.with,
using: this.config.using,
tablespace: this.config.tablespace,
withNoData: this.config.withNoData
},
config: {
name: this.name,
schema: this.schema,
selectedFields: aliasedSelection,
query: qb.getSQL().inlineParams()
}
}),
selectionProxy
);
}
}
class ManualMaterializedViewBuilder extends MaterializedViewBuilderCore {
static [import_entity.entityKind] = "GelManualMaterializedViewBuilder";
columns;
constructor(name, columns, schema) {
super(name, schema);
this.columns = (0, import_utils.getTableColumns)((0, import_table.gelTable)(name, columns));
}
existing() {
return new Proxy(
new GelMaterializedView({
GelConfig: {
tablespace: this.config.tablespace,
using: this.config.using,
with: this.config.with,
withNoData: this.config.withNoData
},
config: {
name: this.name,
schema: this.schema,
selectedFields: this.columns,
query: void 0
}
}),
new import_selection_proxy.SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
})
);
}
as(query) {
return new Proxy(
new GelMaterializedView({
GelConfig: {
tablespace: this.config.tablespace,
using: this.config.using,
with: this.config.with,
withNoData: this.config.withNoData
},
config: {
name: this.name,
schema: this.schema,
selectedFields: this.columns,
query: query.inlineParams()
}
}),
new import_selection_proxy.SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
})
);
}
}
class GelView extends import_view_base.GelViewBase {
static [import_entity.entityKind] = "GelView";
[import_view_common.GelViewConfig];
constructor({ GelConfig, config }) {
super(config);
if (GelConfig) {
this[import_view_common.GelViewConfig] = {
with: GelConfig.with
};
}
}
}
const GelMaterializedViewConfig = Symbol.for("drizzle:GelMaterializedViewConfig");
class GelMaterializedView extends import_view_base.GelViewBase {
static [import_entity.entityKind] = "GelMaterializedView";
[GelMaterializedViewConfig];
constructor({ GelConfig, config }) {
super(config);
this[GelMaterializedViewConfig] = {
with: GelConfig?.with,
using: GelConfig?.using,
tablespace: GelConfig?.tablespace,
withNoData: GelConfig?.withNoData
};
}
}
function gelViewWithSchema(name, selection, schema) {
if (selection) {
return new ManualViewBuilder(name, selection, schema);
}
return new ViewBuilder(name, schema);
}
function gelMaterializedViewWithSchema(name, selection, schema) {
if (selection) {
return new ManualMaterializedViewBuilder(name, selection, schema);
}
return new MaterializedViewBuilder(name, schema);
}
function gelView(name, columns) {
return gelViewWithSchema(name, columns, void 0);
}
function gelMaterializedView(name, columns) {
return gelMaterializedViewWithSchema(name, columns, void 0);
}
function isGelView(obj) {
return (0, import_entity.is)(obj, GelView);
}
function isGelMaterializedView(obj) {
return (0, import_entity.is)(obj, GelMaterializedView);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
DefaultViewBuilderCore,
GelMaterializedView,
GelMaterializedViewConfig,
GelView,
ManualMaterializedViewBuilder,
ManualViewBuilder,
MaterializedViewBuilder,
MaterializedViewBuilderCore,
ViewBuilder,
gelMaterializedViewWithSchema,
gelViewWithSchema
});
//# sourceMappingURL=view.cjs.map

View File

@@ -0,0 +1,38 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const Template = require("../Template");
const HelperRuntimeModule = require("./HelperRuntimeModule");
/** @typedef {import("../Compilation")} Compilation */
class CreateScriptRuntimeModule extends HelperRuntimeModule {
constructor() {
super("trusted types script");
}
/**
* @returns {string | null} runtime code
*/
generate() {
const compilation = /** @type {Compilation} */ (this.compilation);
const { runtimeTemplate, outputOptions } = compilation;
const { trustedTypes } = outputOptions;
const fn = RuntimeGlobals.createScript;
return Template.asString(
`${fn} = ${runtimeTemplate.returningFunction(
trustedTypes
? `${RuntimeGlobals.getTrustedTypesPolicy}().createScript(script)`
: "script",
"script"
)};`
);
}
}
module.exports = CreateScriptRuntimeModule;

View File

@@ -0,0 +1,136 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /\d+/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(нтө|нт)/i,
abbreviated: /^(нтө|нт)/i,
wide: /^(нийтийн тооллын өмнө|нийтийн тооллын)/i,
};
const parseEraPatterns = {
any: [/^(нтө|нийтийн тооллын өмнө)/i, /^(нт|нийтийн тооллын)/i],
};
const matchQuarterPatterns = {
narrow: /^(iv|iii|ii|i)/i,
abbreviated: /^(iv|iii|ii|i) улирал/i,
wide: /^[1-4]-р улирал/i,
};
const parseQuarterPatterns = {
any: [/^(i(\s|$)|1)/i, /^(ii(\s|$)|2)/i, /^(iii(\s|$)|3)/i, /^(iv(\s|$)|4)/i],
};
const matchMonthPatterns = {
narrow: /^(xii|xi|x|ix|viii|vii|vi|v|iv|iii|ii|i)/i,
abbreviated:
/^(1-р сар|2-р сар|3-р сар|4-р сар|5-р сар|6-р сар|7-р сар|8-р сар|9-р сар|10-р сар|11-р сар|12-р сар)/i,
wide: /^(нэгдүгээр сар|хоёрдугаар сар|гуравдугаар сар|дөрөвдүгээр сар|тавдугаар сар|зургаадугаар сар|долоодугаар сар|наймдугаар сар|есдүгээр сар|аравдугаар сар|арван нэгдүгээр сар|арван хоёрдугаар сар)/i,
};
const parseMonthPatterns = {
narrow: [
/^i$/i,
/^ii$/i,
/^iii$/i,
/^iv$/i,
/^v$/i,
/^vi$/i,
/^vii$/i,
/^viii$/i,
/^ix$/i,
/^x$/i,
/^xi$/i,
/^xii$/i,
],
any: [
/^(1|нэгдүгээр)/i,
/^(2|хоёрдугаар)/i,
/^(3|гуравдугаар)/i,
/^(4|дөрөвдүгээр)/i,
/^(5|тавдугаар)/i,
/^(6|зургаадугаар)/i,
/^(7|долоодугаар)/i,
/^(8|наймдугаар)/i,
/^(9|есдүгээр)/i,
/^(10|аравдугаар)/i,
/^(11|арван нэгдүгээр)/i,
/^(12|арван хоёрдугаар)/i,
],
};
const matchDayPatterns = {
narrow: /^[ндмлпбб]/i,
short: /^(ня|да|мя|лх|пү|ба|бя)/i,
abbreviated: /^(ням|дав|мяг|лха|пүр|баа|бям)/i,
wide: /^(ням|даваа|мягмар|лхагва|пүрэв|баасан|бямба)/i,
};
const parseDayPatterns = {
narrow: [/^н/i, /^д/i, /^м/i, /^л/i, /^п/i, /^б/i, /^б/i],
any: [/^ня/i, /^да/i, /^мя/i, /^лх/i, /^пү/i, /^ба/i, /^бя/i],
};
const matchDayPeriodPatterns = {
narrow: /^(ү\.ө\.|ү\.х\.|шөнө дунд|үд дунд|өглөө|өдөр|орой|шөнө)/i,
any: /^(ү\.ө\.|ү\.х\.|шөнө дунд|үд дунд|өглөө|өдөр|орой|шөнө)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^ү\.ө\./i,
pm: /^ү\.х\./i,
midnight: /^шөнө дунд/i,
noon: /^үд дунд/i,
morning: /өглөө/i,
afternoon: /өдөр/i,
evening: /орой/i,
night: /шөнө/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@@ -0,0 +1,29 @@
import { defaultValuePromise } from './promise.js';
export const iterateFields = async ({
id,
data,
fields,
locale,
req,
select,
selectMode,
siblingData,
user
}) => {
const promises = [];
fields.forEach(field => {
promises.push(defaultValuePromise({
id,
data,
field,
locale,
req,
select,
selectMode,
siblingData,
user
}));
});
await Promise.all(promises);
};
//# sourceMappingURL=iterateFields.js.map

View File

@@ -0,0 +1,18 @@
/**
* @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 Nfc = createLucideIcon("Nfc", [
["path", { d: "M6 8.32a7.43 7.43 0 0 1 0 7.36", key: "9iaqei" }],
["path", { d: "M9.46 6.21a11.76 11.76 0 0 1 0 11.58", key: "1yha7l" }],
["path", { d: "M12.91 4.1a15.91 15.91 0 0 1 .01 15.8", key: "4iu2gk" }],
["path", { d: "M16.37 2a20.16 20.16 0 0 1 0 20", key: "sap9u2" }]
]);
export { Nfc as default };
//# sourceMappingURL=nfc.js.map

View File

@@ -0,0 +1,240 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import { Drawer, LoadingOverlay, toast, useDocumentInfo, useEditDepth, useModal, useServerFunctions, useTranslation } from '@payloadcms/ui';
import { useSearchParams } from 'next/navigation.js';
import React, { useCallback, useEffect, useId, useMemo, useRef, useState } from 'react';
export const baseClass = 'version-drawer';
export const formatVersionDrawerSlug = ({
depth,
uuid
}) => `version-drawer_${depth}_${uuid}`;
export const VersionDrawerContent = props => {
const {
collectionSlug,
docID,
drawerSlug,
globalSlug
} = props;
const {
isTrashed
} = useDocumentInfo();
const {
closeModal
} = useModal();
const searchParams = useSearchParams();
const prevSearchParams = useRef(searchParams);
const {
renderDocument
} = useServerFunctions();
const [DocumentView, setDocumentView] = useState(undefined);
const [isLoading, setIsLoading] = useState(true);
const hasRenderedDocument = useRef(false);
const {
t
} = useTranslation();
const getDocumentView = useCallback(docID_0 => {
const fetchDocumentView = async () => {
setIsLoading(true);
try {
const isGlobal = Boolean(globalSlug);
const entitySlug = collectionSlug ?? globalSlug;
const result = await renderDocument({
collectionSlug: entitySlug,
docID: docID_0,
drawerSlug,
paramsOverride: {
segments: [isGlobal ? 'globals' : 'collections', entitySlug, ...(isTrashed ? ['trash'] : []), isGlobal ? undefined : String(docID_0), 'versions'].filter(Boolean)
},
redirectAfterDelete: false,
redirectAfterDuplicate: false,
searchParams: Object.fromEntries(searchParams.entries()),
versions: {
disableGutter: true,
useVersionDrawerCreatedAtCell: true
}
});
if (result?.Document) {
setDocumentView(result.Document);
setIsLoading(false);
}
} catch (error) {
toast.error(error?.message || t('error:unspecific'));
closeModal(drawerSlug);
// toast.error(data?.errors?.[0].message || t('error:unspecific'))
}
};
void fetchDocumentView();
}, [closeModal, collectionSlug, drawerSlug, globalSlug, isTrashed, renderDocument, searchParams, t]);
useEffect(() => {
if (!hasRenderedDocument.current || prevSearchParams.current !== searchParams) {
prevSearchParams.current = searchParams;
getDocumentView(docID);
hasRenderedDocument.current = true;
}
}, [docID, getDocumentView, searchParams]);
if (isLoading) {
return /*#__PURE__*/_jsx(LoadingOverlay, {});
}
return DocumentView;
};
export const VersionDrawer = props => {
const $ = _c(6);
const {
collectionSlug,
docID,
drawerSlug,
globalSlug
} = props;
const {
t
} = useTranslation();
let t0;
if ($[0] !== collectionSlug || $[1] !== docID || $[2] !== drawerSlug || $[3] !== globalSlug || $[4] !== t) {
t0 = _jsx(Drawer, {
className: baseClass,
gutter: true,
slug: drawerSlug,
title: t("version:selectVersionToCompare"),
children: _jsx(VersionDrawerContent, {
collectionSlug,
docID,
drawerSlug,
globalSlug
})
});
$[0] = collectionSlug;
$[1] = docID;
$[2] = drawerSlug;
$[3] = globalSlug;
$[4] = t;
$[5] = t0;
} else {
t0 = $[5];
}
return t0;
};
export const useVersionDrawer = t0 => {
const $ = _c(29);
const {
collectionSlug,
docID,
globalSlug
} = t0;
const drawerDepth = useEditDepth();
const uuid = useId();
const {
closeModal,
modalState,
openModal,
toggleModal
} = useModal();
const [isOpen, setIsOpen] = useState(false);
let t1;
if ($[0] !== drawerDepth || $[1] !== uuid) {
t1 = formatVersionDrawerSlug({
depth: drawerDepth,
uuid
});
$[0] = drawerDepth;
$[1] = uuid;
$[2] = t1;
} else {
t1 = $[2];
}
const drawerSlug = t1;
let t2;
let t3;
if ($[3] !== drawerSlug || $[4] !== modalState) {
t2 = () => {
setIsOpen(Boolean(modalState[drawerSlug]?.isOpen));
};
t3 = [modalState, drawerSlug];
$[3] = drawerSlug;
$[4] = modalState;
$[5] = t2;
$[6] = t3;
} else {
t2 = $[5];
t3 = $[6];
}
useEffect(t2, t3);
let t4;
if ($[7] !== drawerSlug || $[8] !== toggleModal) {
t4 = () => {
toggleModal(drawerSlug);
};
$[7] = drawerSlug;
$[8] = toggleModal;
$[9] = t4;
} else {
t4 = $[9];
}
const toggleDrawer = t4;
let t5;
if ($[10] !== closeModal || $[11] !== drawerSlug) {
t5 = () => {
closeModal(drawerSlug);
};
$[10] = closeModal;
$[11] = drawerSlug;
$[12] = t5;
} else {
t5 = $[12];
}
const closeDrawer = t5;
let t6;
if ($[13] !== drawerSlug || $[14] !== openModal) {
t6 = () => {
openModal(drawerSlug);
};
$[13] = drawerSlug;
$[14] = openModal;
$[15] = t6;
} else {
t6 = $[15];
}
const openDrawer = t6;
let t7;
if ($[16] !== collectionSlug || $[17] !== docID || $[18] !== drawerSlug || $[19] !== globalSlug) {
t7 = () => _jsx(VersionDrawer, {
collectionSlug,
docID,
drawerSlug,
globalSlug
});
$[16] = collectionSlug;
$[17] = docID;
$[18] = drawerSlug;
$[19] = globalSlug;
$[20] = t7;
} else {
t7 = $[20];
}
const MemoizedDrawer = t7;
let t8;
if ($[21] !== MemoizedDrawer || $[22] !== closeDrawer || $[23] !== drawerDepth || $[24] !== drawerSlug || $[25] !== isOpen || $[26] !== openDrawer || $[27] !== toggleDrawer) {
t8 = {
closeDrawer,
Drawer: MemoizedDrawer,
drawerDepth,
drawerSlug,
isDrawerOpen: isOpen,
openDrawer,
toggleDrawer
};
$[21] = MemoizedDrawer;
$[22] = closeDrawer;
$[23] = drawerDepth;
$[24] = drawerSlug;
$[25] = isOpen;
$[26] = openDrawer;
$[27] = toggleDrawer;
$[28] = t8;
} else {
t8 = $[28];
}
return t8;
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,50 @@
import { GraphQLScalarType, Kind } from 'graphql';
import { createGraphQLError } from '../error.js';
const ISBN_REGEX_ARR = [
/^(?:ISBN(?:-10)?:? *)?((?=\d{1,5}([ -]?)\d{1,7}\2?\d{1,6}\2?\d)(?:\d\2*){9}[\dX])$/i,
/^(?:ISBN(?:-13)?:? *)?(97(?:8|9)([ -]?)(?=\d{1,5}\2?\d{1,7}\2?\d{1,6}\2?\d)(?:\d\2*){9}\d)$/i,
];
const validate = (value, ast) => {
if (typeof value !== 'string') {
throw createGraphQLError(`Value is not string: ${value}`, ast ? { nodes: ast } : undefined);
}
let valid = false;
for (const regex of ISBN_REGEX_ARR) {
if (regex.test(value)) {
valid = true;
break;
}
}
if (!valid) {
throw createGraphQLError(`Value is not a valid ISBN number: ${value}`, ast ? { nodes: ast } : undefined);
}
return value;
};
export const GraphQLISBN = /*#__PURE__*/ new GraphQLScalarType({
name: `ISBN`,
description: `A field whose value is a ISBN-10 or ISBN-13 number: https://en.wikipedia.org/wiki/International_Standard_Book_Number.`,
serialize(value) {
return validate(value);
},
parseValue(value) {
return validate(value);
},
parseLiteral(ast) {
if (ast.kind !== Kind.STRING) {
throw createGraphQLError(`Can only validate strings as ISBN numbers but got a: ${ast.kind}`, {
nodes: ast,
});
}
return validate(ast.value, ast);
},
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'ISBN',
oneOf: ISBN_REGEX_ARR.map(regex => ({
type: 'string',
pattern: regex.source,
})),
},
},
});

View File

@@ -0,0 +1,56 @@
{
"name": "string-width",
"version": "4.2.3",
"description": "Get the visual width of a string - the number of columns required to display it",
"license": "MIT",
"repository": "sindresorhus/string-width",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"string",
"character",
"unicode",
"width",
"visual",
"column",
"columns",
"fullwidth",
"full-width",
"full",
"ansi",
"escape",
"codes",
"cli",
"command-line",
"terminal",
"console",
"cjk",
"chinese",
"japanese",
"korean",
"fixed-width"
],
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.1",
"xo": "^0.24.0"
}
}

View File

@@ -0,0 +1,159 @@
# parseley
![lint status badge](https://github.com/mxxii/parseley/workflows/lint/badge.svg)
![test status badge](https://github.com/mxxii/parseley/workflows/test/badge.svg)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/mxxii/parseley/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/v/parseley?logo=npm)](https://www.npmjs.com/package/parseley)
[![npm](https://img.shields.io/npm/dw/parseley?color=informational&logo=npm)](https://www.npmjs.com/package/parseley)
[![deno](https://img.shields.io/badge/deno.land%2Fx%2F-parseley-informational?logo=deno)](https://deno.land/x/parseley)
**Par**ser for CSS **sele**ctors.
----
## Features
* Convert CSS selector strings into objects that are easy to work with;
* Serialize back if needed;
* Get specificity for free.
## Changelog
Available here: [CHANGELOG.md](https://github.com/mxxii/parseley/blob/main/CHANGELOG.md).
## Install
### Node
```shell
> npm i parseley
```
```typescript
import * as parseley from 'parseley';
```
### Deno
```typescript
import * as parseley from 'https://deno.land/x/parseley@.../parseley.ts';
```
## Usage example
```js
import { parse1, serialize, normalize } from 'parseley';
import { inspect } from 'node:util';
const str = 'div#id1 > .class2.class1[attr1]';
const ast = parse1(str);
console.log(inspect(ast, { breakLength: 45, depth: null }));
const serialized = serialize(ast);
console.log(`Serialized: '${serialized}'`);
normalize(ast);
const normalized = serialize(ast);
console.log(`Normalized: '${normalized}'`);
```
<details><summary>Example output</summary>
```text
{
type: 'compound',
list: [
{
type: 'class',
name: 'class2',
specificity: [ 0, 1, 0 ]
},
{
type: 'class',
name: 'class1',
specificity: [ 0, 1, 0 ]
},
{
type: 'attrPresence',
name: 'attr1',
namespace: null,
specificity: [ 0, 1, 0 ]
},
{
type: 'combinator',
combinator: '>',
left: {
type: 'compound',
list: [
{
type: 'tag',
name: 'div',
namespace: null,
specificity: [ 0, 0, 1 ]
},
{
type: 'id',
name: 'id1',
specificity: [ 1, 0, 0 ]
}
],
specificity: [ 1, 0, 1 ]
},
specificity: [ 1, 0, 1 ]
}
],
specificity: [ 1, 3, 1 ]
}
Serialized: 'div#id1>.class2.class1[attr1]'
Normalized: 'div#id1>.class1.class2[attr1]'
```
</details>
## Documentation
* [Functions](https://github.com/mxxii/parseley/blob/main/docs/index.md)
* [AST types](https://github.com/mxxii/parseley/blob/main/docs/modules/Ast.md)
* [Snapshots](https://github.com/mxxii/parseley/blob/main/test/snapshots/snapshots.ts.md)
## Input reference
<https://www.w3.org/TR/selectors-4/#grammar>
<https://www.w3.org/TR/css-syntax-3/#token-diagrams>
Terminology used in this project is more or less consistent to the spec, with some exceptions made for clarity. The term "type" is way too overloaded in particular, the term "tag" is used where appropriate instead.
Any pseudo elements are left for possible future implementation. I have no immediate need for them and they require some careful consideration.
## Output AST
Consistency: overall AST shape is always the same. This makes client code simpler, at least for a certain processing tasks.
For example, always use compound selectors, even when there is only one simple selector inside.
Comma-separated selectors might not be needed for every use case. So there are two functions - one can parse commas and always returns the top-level list regardless of the comma presence in a particular selector, and the other can't parse commas and returns a compound selector AST directly.
Complex selectors are represented in the way that makes the left side to be an another condition on the right side element. This was made with the right-to-left processing direction in mind. One consequence of this is that there is no such thing as a "complex selector" node in the AST hierarchy, but there are "combinator" nodes attached to "compound selector" nodes.
All AST nodes have their specificity computed (except the top-level list of comma-separated selectors where it doesn't really make sense).
## Motivation and inspiration
| Package | Hits | Misses
| ---------- | --------- | ---------
| [parsel](https://github.com/leaverou/parsel) | Sensible AST; specificity calculation; cool name | Not friendly to node.js; based on regex
| [css-what](https://github.com/fb55/css-what) and [css-select](https://github.com/fb55/css-select) | The idea to process complex selectors in right-to-left order | `css-select` is a solution for a different problem compared to what I needed; `css-what` produces only a list of tokens
| [scalpel](https://github.com/gajus/scalpel) | Introduced me to [nearley](https://nearley.js.org/) parsing toolkit (albeit I'm not using it here anymore) | AST it produces is very far from what I can use
| [css-selector-parser](https://github.com/mdevils/css-selector-parser) | Configurable and lightweight | Again, AST is far from my needs

View File

@@ -0,0 +1,29 @@
import { formatDistance } from "./sl/_lib/formatDistance.js";
import { formatLong } from "./sl/_lib/formatLong.js";
import { formatRelative } from "./sl/_lib/formatRelative.js";
import { localize } from "./sl/_lib/localize.js";
import { match } from "./sl/_lib/match.js";
/**
* @category Locales
* @summary Slovenian locale.
* @language Slovenian
* @iso-639-2 slv
* @author Adam Stradovnik [@Neoglyph](https://github.com/Neoglyph)
* @author Mato Žgajner [@mzgajner](https://github.com/mzgajner)
*/
export const sl = {
code: "sl",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default sl;

View File

@@ -0,0 +1,3 @@
import { Options } from '.';
import { AST } from './types/AST';
export declare function optimize(ast: AST, options: Options, processed?: Set<AST>): AST;

View File

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

View File

@@ -0,0 +1,4 @@
function _initializerWarningHelper(r, e) {
throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.");
}
export { _initializerWarningHelper as default };

View File

@@ -0,0 +1,756 @@
@charset "UTF-8";
.react-datepicker__navigation-icon::before, .react-datepicker__year-read-view--down-arrow,
.react-datepicker__month-read-view--down-arrow,
.react-datepicker__month-year-read-view--down-arrow {
border-color: #ccc;
border-style: solid;
border-width: 3px 3px 0 0;
content: "";
display: block;
height: 9px;
position: absolute;
top: 6px;
width: 9px;
}
.react-datepicker-wrapper {
display: inline-block;
padding: 0;
border: 0;
}
.react-datepicker {
font-family: "Helvetica Neue", helvetica, arial, sans-serif;
font-size: 0.8rem;
background-color: #fff;
color: #000;
border: 1px solid #aeaeae;
border-radius: 0.3rem;
display: inline-block;
position: relative;
line-height: initial;
}
.react-datepicker--time-only .react-datepicker__time-container {
border-left: 0;
}
.react-datepicker--time-only .react-datepicker__time,
.react-datepicker--time-only .react-datepicker__time-box {
border-bottom-left-radius: 0.3rem;
border-bottom-right-radius: 0.3rem;
}
.react-datepicker-popper {
z-index: 1;
line-height: 0;
}
.react-datepicker-popper .react-datepicker__triangle {
stroke: #aeaeae;
}
.react-datepicker-popper[data-placement^=bottom] .react-datepicker__triangle {
fill: #f0f0f0;
color: #f0f0f0;
}
.react-datepicker-popper[data-placement^=top] .react-datepicker__triangle {
fill: #fff;
color: #fff;
}
.react-datepicker__header {
text-align: center;
background-color: #f0f0f0;
border-bottom: 1px solid #aeaeae;
border-top-left-radius: 0.3rem;
padding: 8px 0;
position: relative;
}
.react-datepicker__header--time {
padding-bottom: 8px;
padding-left: 5px;
padding-right: 5px;
}
.react-datepicker__header--time:not(.react-datepicker__header--time--only) {
border-top-left-radius: 0;
}
.react-datepicker__header:not(.react-datepicker__header--has-time-select) {
border-top-right-radius: 0.3rem;
}
.react-datepicker__year-dropdown-container--select,
.react-datepicker__month-dropdown-container--select,
.react-datepicker__month-year-dropdown-container--select,
.react-datepicker__year-dropdown-container--scroll,
.react-datepicker__month-dropdown-container--scroll,
.react-datepicker__month-year-dropdown-container--scroll {
display: inline-block;
margin: 0 15px;
}
.react-datepicker__current-month,
.react-datepicker-time__header,
.react-datepicker-year-header {
margin-top: 0;
color: #000;
font-weight: bold;
font-size: 0.944rem;
}
h2.react-datepicker__current-month {
padding: 0;
margin: 0;
}
.react-datepicker-time__header {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.react-datepicker__navigation {
align-items: center;
background: none;
display: flex;
justify-content: center;
text-align: center;
cursor: pointer;
position: absolute;
top: 2px;
padding: 0;
border: none;
z-index: 1;
height: 32px;
width: 32px;
text-indent: -999em;
overflow: hidden;
}
.react-datepicker__navigation--previous {
left: 2px;
}
.react-datepicker__navigation--next {
right: 2px;
}
.react-datepicker__navigation--next--with-time:not(.react-datepicker__navigation--next--with-today-button) {
right: 85px;
}
.react-datepicker__navigation--years {
position: relative;
top: 0;
display: block;
margin-left: auto;
margin-right: auto;
}
.react-datepicker__navigation--years-previous {
top: 4px;
}
.react-datepicker__navigation--years-upcoming {
top: -4px;
}
.react-datepicker__navigation:hover *::before {
border-color: rgb(165.75, 165.75, 165.75);
}
.react-datepicker__navigation-icon {
position: relative;
top: -1px;
font-size: 20px;
width: 0;
}
.react-datepicker__navigation-icon--next {
left: -2px;
}
.react-datepicker__navigation-icon--next::before {
transform: rotate(45deg);
left: -7px;
}
.react-datepicker__navigation-icon--previous {
right: -2px;
}
.react-datepicker__navigation-icon--previous::before {
transform: rotate(225deg);
right: -7px;
}
.react-datepicker__month-container {
float: left;
}
.react-datepicker__year {
margin: 0.4rem;
text-align: center;
}
.react-datepicker__year-wrapper {
display: flex;
flex-wrap: wrap;
max-width: 180px;
}
.react-datepicker__year .react-datepicker__year-text {
display: inline-block;
width: 4rem;
margin: 2px;
}
.react-datepicker__month {
margin: 0.4rem;
text-align: center;
}
.react-datepicker__month .react-datepicker__month-text,
.react-datepicker__month .react-datepicker__quarter-text {
display: inline-block;
width: 4rem;
margin: 2px;
}
.react-datepicker__input-time-container {
clear: both;
width: 100%;
float: left;
margin: 5px 0 10px 15px;
text-align: left;
}
.react-datepicker__input-time-container .react-datepicker-time__caption {
display: inline-block;
}
.react-datepicker__input-time-container .react-datepicker-time__input-container {
display: inline-block;
}
.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input {
display: inline-block;
margin-left: 10px;
}
.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input input {
width: auto;
}
.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input input[type=time]::-webkit-inner-spin-button,
.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input input[type=time]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input input[type=time] {
-moz-appearance: textfield;
}
.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__delimiter {
margin-left: 5px;
display: inline-block;
}
.react-datepicker__time-container {
float: right;
border-left: 1px solid #aeaeae;
width: 85px;
}
.react-datepicker__time-container--with-today-button {
display: inline;
border: 1px solid #aeaeae;
border-radius: 0.3rem;
position: absolute;
right: -87px;
top: 0;
}
.react-datepicker__time-container .react-datepicker__time {
position: relative;
background: white;
border-bottom-right-radius: 0.3rem;
}
.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box {
width: 85px;
overflow-x: hidden;
margin: 0 auto;
text-align: center;
border-bottom-right-radius: 0.3rem;
}
.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list {
list-style: none;
margin: 0;
height: calc(195px + 1.7rem / 2);
overflow-y: scroll;
padding-right: 0;
padding-left: 0;
width: 100%;
box-sizing: content-box;
}
.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item {
height: 30px;
padding: 5px 10px;
white-space: nowrap;
}
.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item:hover {
cursor: pointer;
background-color: #f0f0f0;
}
.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item--selected {
background-color: #216ba5;
color: white;
font-weight: bold;
}
.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item--selected:hover {
background-color: #216ba5;
}
.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item--disabled {
color: #ccc;
}
.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item--disabled:hover {
cursor: default;
background-color: transparent;
}
.react-datepicker__week-number {
color: #ccc;
display: inline-block;
width: 1.7rem;
line-height: 1.7rem;
text-align: center;
margin: 0.166rem;
}
.react-datepicker__week-number.react-datepicker__week-number--clickable {
cursor: pointer;
}
.react-datepicker__week-number.react-datepicker__week-number--clickable:not(.react-datepicker__week-number--selected):hover {
border-radius: 0.3rem;
background-color: #f0f0f0;
}
.react-datepicker__week-number--selected {
border-radius: 0.3rem;
background-color: #216ba5;
color: #fff;
}
.react-datepicker__week-number--selected:hover {
background-color: rgb(28.75, 93.2196969697, 143.75);
}
.react-datepicker__day-names {
white-space: nowrap;
margin-bottom: -8px;
}
.react-datepicker__week {
white-space: nowrap;
}
.react-datepicker__day-name,
.react-datepicker__day,
.react-datepicker__time-name {
color: #000;
display: inline-block;
width: 1.7rem;
line-height: 1.7rem;
text-align: center;
margin: 0.166rem;
}
.react-datepicker__day,
.react-datepicker__month-text,
.react-datepicker__quarter-text,
.react-datepicker__year-text {
cursor: pointer;
}
.react-datepicker__day:not([aria-disabled=true]):hover,
.react-datepicker__month-text:not([aria-disabled=true]):hover,
.react-datepicker__quarter-text:not([aria-disabled=true]):hover,
.react-datepicker__year-text:not([aria-disabled=true]):hover {
border-radius: 0.3rem;
background-color: #f0f0f0;
}
.react-datepicker__day--today,
.react-datepicker__month-text--today,
.react-datepicker__quarter-text--today,
.react-datepicker__year-text--today {
font-weight: bold;
}
.react-datepicker__day--highlighted,
.react-datepicker__month-text--highlighted,
.react-datepicker__quarter-text--highlighted,
.react-datepicker__year-text--highlighted {
border-radius: 0.3rem;
background-color: #3dcc4a;
color: #fff;
}
.react-datepicker__day--highlighted:not([aria-disabled=true]):hover,
.react-datepicker__month-text--highlighted:not([aria-disabled=true]):hover,
.react-datepicker__quarter-text--highlighted:not([aria-disabled=true]):hover,
.react-datepicker__year-text--highlighted:not([aria-disabled=true]):hover {
background-color: rgb(49.8551020408, 189.6448979592, 62.5632653061);
}
.react-datepicker__day--highlighted-custom-1,
.react-datepicker__month-text--highlighted-custom-1,
.react-datepicker__quarter-text--highlighted-custom-1,
.react-datepicker__year-text--highlighted-custom-1 {
color: magenta;
}
.react-datepicker__day--highlighted-custom-2,
.react-datepicker__month-text--highlighted-custom-2,
.react-datepicker__quarter-text--highlighted-custom-2,
.react-datepicker__year-text--highlighted-custom-2 {
color: green;
}
.react-datepicker__day--holidays,
.react-datepicker__month-text--holidays,
.react-datepicker__quarter-text--holidays,
.react-datepicker__year-text--holidays {
position: relative;
border-radius: 0.3rem;
background-color: #ff6803;
color: #fff;
}
.react-datepicker__day--holidays .overlay,
.react-datepicker__month-text--holidays .overlay,
.react-datepicker__quarter-text--holidays .overlay,
.react-datepicker__year-text--holidays .overlay {
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background-color: #333;
color: #fff;
padding: 4px;
border-radius: 4px;
white-space: nowrap;
visibility: hidden;
opacity: 0;
transition: visibility 0s, opacity 0.3s ease-in-out;
}
.react-datepicker__day--holidays:not([aria-disabled=true]):hover,
.react-datepicker__month-text--holidays:not([aria-disabled=true]):hover,
.react-datepicker__quarter-text--holidays:not([aria-disabled=true]):hover,
.react-datepicker__year-text--holidays:not([aria-disabled=true]):hover {
background-color: rgb(207, 82.9642857143, 0);
}
.react-datepicker__day--holidays:hover .overlay,
.react-datepicker__month-text--holidays:hover .overlay,
.react-datepicker__quarter-text--holidays:hover .overlay,
.react-datepicker__year-text--holidays:hover .overlay {
visibility: visible;
opacity: 1;
}
.react-datepicker__day--selected, .react-datepicker__day--in-selecting-range, .react-datepicker__day--in-range,
.react-datepicker__month-text--selected,
.react-datepicker__month-text--in-selecting-range,
.react-datepicker__month-text--in-range,
.react-datepicker__quarter-text--selected,
.react-datepicker__quarter-text--in-selecting-range,
.react-datepicker__quarter-text--in-range,
.react-datepicker__year-text--selected,
.react-datepicker__year-text--in-selecting-range,
.react-datepicker__year-text--in-range {
border-radius: 0.3rem;
background-color: #216ba5;
color: #fff;
}
.react-datepicker__day--selected:not([aria-disabled=true]):hover, .react-datepicker__day--in-selecting-range:not([aria-disabled=true]):hover, .react-datepicker__day--in-range:not([aria-disabled=true]):hover,
.react-datepicker__month-text--selected:not([aria-disabled=true]):hover,
.react-datepicker__month-text--in-selecting-range:not([aria-disabled=true]):hover,
.react-datepicker__month-text--in-range:not([aria-disabled=true]):hover,
.react-datepicker__quarter-text--selected:not([aria-disabled=true]):hover,
.react-datepicker__quarter-text--in-selecting-range:not([aria-disabled=true]):hover,
.react-datepicker__quarter-text--in-range:not([aria-disabled=true]):hover,
.react-datepicker__year-text--selected:not([aria-disabled=true]):hover,
.react-datepicker__year-text--in-selecting-range:not([aria-disabled=true]):hover,
.react-datepicker__year-text--in-range:not([aria-disabled=true]):hover {
background-color: rgb(28.75, 93.2196969697, 143.75);
}
.react-datepicker__day--keyboard-selected,
.react-datepicker__month-text--keyboard-selected,
.react-datepicker__quarter-text--keyboard-selected,
.react-datepicker__year-text--keyboard-selected {
border-radius: 0.3rem;
background-color: rgb(186.25, 217.0833333333, 241.25);
color: rgb(0, 0, 0);
}
.react-datepicker__day--keyboard-selected:not([aria-disabled=true]):hover,
.react-datepicker__month-text--keyboard-selected:not([aria-disabled=true]):hover,
.react-datepicker__quarter-text--keyboard-selected:not([aria-disabled=true]):hover,
.react-datepicker__year-text--keyboard-selected:not([aria-disabled=true]):hover {
background-color: rgb(28.75, 93.2196969697, 143.75);
}
.react-datepicker__day--in-selecting-range:not(.react-datepicker__day--in-range,
.react-datepicker__month-text--in-range,
.react-datepicker__quarter-text--in-range,
.react-datepicker__year-text--in-range),
.react-datepicker__month-text--in-selecting-range:not(.react-datepicker__day--in-range,
.react-datepicker__month-text--in-range,
.react-datepicker__quarter-text--in-range,
.react-datepicker__year-text--in-range),
.react-datepicker__quarter-text--in-selecting-range:not(.react-datepicker__day--in-range,
.react-datepicker__month-text--in-range,
.react-datepicker__quarter-text--in-range,
.react-datepicker__year-text--in-range),
.react-datepicker__year-text--in-selecting-range:not(.react-datepicker__day--in-range,
.react-datepicker__month-text--in-range,
.react-datepicker__quarter-text--in-range,
.react-datepicker__year-text--in-range) {
background-color: rgba(33, 107, 165, 0.5);
}
.react-datepicker__month--selecting-range .react-datepicker__day--in-range:not(.react-datepicker__day--in-selecting-range,
.react-datepicker__month-text--in-selecting-range,
.react-datepicker__quarter-text--in-selecting-range,
.react-datepicker__year-text--in-selecting-range), .react-datepicker__year--selecting-range .react-datepicker__day--in-range:not(.react-datepicker__day--in-selecting-range,
.react-datepicker__month-text--in-selecting-range,
.react-datepicker__quarter-text--in-selecting-range,
.react-datepicker__year-text--in-selecting-range),
.react-datepicker__month--selecting-range .react-datepicker__month-text--in-range:not(.react-datepicker__day--in-selecting-range,
.react-datepicker__month-text--in-selecting-range,
.react-datepicker__quarter-text--in-selecting-range,
.react-datepicker__year-text--in-selecting-range),
.react-datepicker__year--selecting-range .react-datepicker__month-text--in-range:not(.react-datepicker__day--in-selecting-range,
.react-datepicker__month-text--in-selecting-range,
.react-datepicker__quarter-text--in-selecting-range,
.react-datepicker__year-text--in-selecting-range),
.react-datepicker__month--selecting-range .react-datepicker__quarter-text--in-range:not(.react-datepicker__day--in-selecting-range,
.react-datepicker__month-text--in-selecting-range,
.react-datepicker__quarter-text--in-selecting-range,
.react-datepicker__year-text--in-selecting-range),
.react-datepicker__year--selecting-range .react-datepicker__quarter-text--in-range:not(.react-datepicker__day--in-selecting-range,
.react-datepicker__month-text--in-selecting-range,
.react-datepicker__quarter-text--in-selecting-range,
.react-datepicker__year-text--in-selecting-range),
.react-datepicker__month--selecting-range .react-datepicker__year-text--in-range:not(.react-datepicker__day--in-selecting-range,
.react-datepicker__month-text--in-selecting-range,
.react-datepicker__quarter-text--in-selecting-range,
.react-datepicker__year-text--in-selecting-range),
.react-datepicker__year--selecting-range .react-datepicker__year-text--in-range:not(.react-datepicker__day--in-selecting-range,
.react-datepicker__month-text--in-selecting-range,
.react-datepicker__quarter-text--in-selecting-range,
.react-datepicker__year-text--in-selecting-range) {
background-color: #f0f0f0;
color: #000;
}
.react-datepicker__day--disabled,
.react-datepicker__month-text--disabled,
.react-datepicker__quarter-text--disabled,
.react-datepicker__year-text--disabled {
cursor: default;
color: #ccc;
}
.react-datepicker__day--disabled .overlay,
.react-datepicker__month-text--disabled .overlay,
.react-datepicker__quarter-text--disabled .overlay,
.react-datepicker__year-text--disabled .overlay {
position: absolute;
bottom: 70%;
left: 50%;
transform: translateX(-50%);
background-color: #333;
color: #fff;
padding: 4px;
border-radius: 4px;
white-space: nowrap;
visibility: hidden;
opacity: 0;
transition: visibility 0s, opacity 0.3s ease-in-out;
}
.react-datepicker__input-container {
position: relative;
display: inline-block;
width: 100%;
}
.react-datepicker__input-container .react-datepicker__calendar-icon {
position: absolute;
padding: 0.5rem;
box-sizing: content-box;
}
.react-datepicker__view-calendar-icon input {
padding: 6px 10px 5px 25px;
}
.react-datepicker__year-read-view,
.react-datepicker__month-read-view,
.react-datepicker__month-year-read-view {
border: 1px solid transparent;
border-radius: 0.3rem;
position: relative;
}
.react-datepicker__year-read-view:hover,
.react-datepicker__month-read-view:hover,
.react-datepicker__month-year-read-view:hover {
cursor: pointer;
}
.react-datepicker__year-read-view:hover .react-datepicker__year-read-view--down-arrow,
.react-datepicker__year-read-view:hover .react-datepicker__month-read-view--down-arrow,
.react-datepicker__month-read-view:hover .react-datepicker__year-read-view--down-arrow,
.react-datepicker__month-read-view:hover .react-datepicker__month-read-view--down-arrow,
.react-datepicker__month-year-read-view:hover .react-datepicker__year-read-view--down-arrow,
.react-datepicker__month-year-read-view:hover .react-datepicker__month-read-view--down-arrow {
border-top-color: rgb(178.5, 178.5, 178.5);
}
.react-datepicker__year-read-view--down-arrow,
.react-datepicker__month-read-view--down-arrow,
.react-datepicker__month-year-read-view--down-arrow {
transform: rotate(135deg);
right: -16px;
top: 0;
}
.react-datepicker__year-dropdown,
.react-datepicker__month-dropdown,
.react-datepicker__month-year-dropdown {
background-color: #f0f0f0;
position: absolute;
width: 50%;
left: 25%;
top: 30px;
z-index: 1;
text-align: center;
border-radius: 0.3rem;
border: 1px solid #aeaeae;
}
.react-datepicker__year-dropdown:hover,
.react-datepicker__month-dropdown:hover,
.react-datepicker__month-year-dropdown:hover {
cursor: pointer;
}
.react-datepicker__year-dropdown--scrollable,
.react-datepicker__month-dropdown--scrollable,
.react-datepicker__month-year-dropdown--scrollable {
height: 150px;
overflow-y: scroll;
}
.react-datepicker__year-option,
.react-datepicker__month-option,
.react-datepicker__month-year-option {
line-height: 20px;
width: 100%;
display: block;
margin-left: auto;
margin-right: auto;
}
.react-datepicker__year-option:first-of-type,
.react-datepicker__month-option:first-of-type,
.react-datepicker__month-year-option:first-of-type {
border-top-left-radius: 0.3rem;
border-top-right-radius: 0.3rem;
}
.react-datepicker__year-option:last-of-type,
.react-datepicker__month-option:last-of-type,
.react-datepicker__month-year-option:last-of-type {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border-bottom-left-radius: 0.3rem;
border-bottom-right-radius: 0.3rem;
}
.react-datepicker__year-option:hover,
.react-datepicker__month-option:hover,
.react-datepicker__month-year-option:hover {
background-color: #ccc;
}
.react-datepicker__year-option:hover .react-datepicker__navigation--years-upcoming,
.react-datepicker__month-option:hover .react-datepicker__navigation--years-upcoming,
.react-datepicker__month-year-option:hover .react-datepicker__navigation--years-upcoming {
border-bottom-color: rgb(178.5, 178.5, 178.5);
}
.react-datepicker__year-option:hover .react-datepicker__navigation--years-previous,
.react-datepicker__month-option:hover .react-datepicker__navigation--years-previous,
.react-datepicker__month-year-option:hover .react-datepicker__navigation--years-previous {
border-top-color: rgb(178.5, 178.5, 178.5);
}
.react-datepicker__year-option--selected,
.react-datepicker__month-option--selected,
.react-datepicker__month-year-option--selected {
position: absolute;
left: 15px;
}
.react-datepicker__close-icon {
cursor: pointer;
background-color: transparent;
border: 0;
outline: 0;
padding: 0 6px 0 0;
position: absolute;
top: 0;
right: 0;
height: 100%;
display: table-cell;
vertical-align: middle;
}
.react-datepicker__close-icon::after {
cursor: pointer;
background-color: #216ba5;
color: #fff;
border-radius: 50%;
height: 16px;
width: 16px;
padding: 2px;
font-size: 12px;
line-height: 1;
text-align: center;
display: table-cell;
vertical-align: middle;
content: "×";
}
.react-datepicker__close-icon--disabled {
cursor: default;
}
.react-datepicker__close-icon--disabled::after {
cursor: default;
background-color: #ccc;
}
.react-datepicker__today-button {
background: #f0f0f0;
border-top: 1px solid #aeaeae;
cursor: pointer;
text-align: center;
font-weight: bold;
padding: 5px 0;
clear: left;
}
.react-datepicker__portal {
position: fixed;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.8);
left: 0;
top: 0;
justify-content: center;
align-items: center;
display: flex;
z-index: 2147483647;
}
.react-datepicker__portal .react-datepicker__day-name,
.react-datepicker__portal .react-datepicker__day,
.react-datepicker__portal .react-datepicker__time-name {
width: 3rem;
line-height: 3rem;
}
@media (max-width: 400px), (max-height: 550px) {
.react-datepicker__portal .react-datepicker__day-name,
.react-datepicker__portal .react-datepicker__day,
.react-datepicker__portal .react-datepicker__time-name {
width: 2rem;
line-height: 2rem;
}
}
.react-datepicker__portal .react-datepicker__current-month,
.react-datepicker__portal .react-datepicker-time__header {
font-size: 1.44rem;
}
.react-datepicker__children-container {
width: 13.8rem;
margin: 0.4rem;
padding-right: 0.2rem;
padding-left: 0.2rem;
height: auto;
}
.react-datepicker__aria-live {
position: absolute;
clip-path: circle(0);
border: 0;
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
width: 1px;
white-space: nowrap;
}
.react-datepicker__calendar-icon {
width: 1em;
height: 1em;
vertical-align: -0.125em;
}

View File

@@ -0,0 +1,200 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import React, { useEffect, useMemo, useState } from 'react';
import { useIntersect } from '../../../../../hooks/useIntersect.js';
import { useConfig } from '../../../../../providers/Config/index.js';
import { useTranslation } from '../../../../../providers/Translation/index.js';
import { canUseDOM } from '../../../../../utilities/canUseDOM.js';
import { formatDocTitle } from '../../../../../utilities/formatDocTitle/index.js';
import { useListRelationships } from '../../../RelationshipProvider/index.js';
import { FileCell } from '../File/index.js';
import './index.scss';
const baseClass = 'relationship-cell';
const totalToShow = 3;
export const RelationshipCell = t0 => {
const $ = _c(39);
const {
cellData: cellDataFromProps,
customCellProps: customCellContext,
field,
field: t1
} = t0;
const {
label
} = t1;
const relationTo = "relationTo" in field && field.relationTo || "collection" in field && field.collection;
const cellData = "collection" in field ? cellDataFromProps?.docs : cellDataFromProps;
const {
config,
getEntityConfig
} = useConfig();
const {
collections
} = config;
const [intersectionRef, entry] = useIntersect();
let t2;
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
t2 = [];
$[0] = t2;
} else {
t2 = $[0];
}
const [values, setValues] = useState(t2);
const {
documents,
getRelationships
} = useListRelationships();
const [hasRequested, setHasRequested] = useState(false);
const {
i18n,
t
} = useTranslation();
const isAboveViewport = canUseDOM ? entry?.boundingClientRect?.top < window.innerHeight : false;
let t3;
if ($[1] !== cellData || $[2] !== getRelationships || $[3] !== hasRequested || $[4] !== isAboveViewport || $[5] !== relationTo) {
t3 = () => {
if ((cellData || typeof cellData === "number") && isAboveViewport && !hasRequested) {
const formattedValues = [];
const arrayCellData = Array.isArray(cellData) ? cellData : [cellData];
arrayCellData.slice(0, arrayCellData.length < totalToShow ? arrayCellData.length : totalToShow).forEach(cell => {
if (typeof cell === "object" && "relationTo" in cell && "value" in cell) {
formattedValues.push(cell);
}
if ((typeof cell === "number" || typeof cell === "string") && typeof relationTo === "string") {
formattedValues.push({
relationTo,
value: cell
});
}
});
getRelationships(formattedValues);
setHasRequested(true);
setValues(formattedValues);
}
};
$[1] = cellData;
$[2] = getRelationships;
$[3] = hasRequested;
$[4] = isAboveViewport;
$[5] = relationTo;
$[6] = t3;
} else {
t3 = $[6];
}
let t4;
if ($[7] !== cellData || $[8] !== collections || $[9] !== getRelationships || $[10] !== hasRequested || $[11] !== isAboveViewport || $[12] !== relationTo) {
t4 = [cellData, relationTo, collections, isAboveViewport, hasRequested, getRelationships];
$[7] = cellData;
$[8] = collections;
$[9] = getRelationships;
$[10] = hasRequested;
$[11] = isAboveViewport;
$[12] = relationTo;
$[13] = t4;
} else {
t4 = $[13];
}
useEffect(t3, t4);
let t5;
if ($[14] !== hasRequested) {
t5 = () => {
if (hasRequested) {
setHasRequested(false);
}
};
$[14] = hasRequested;
$[15] = t5;
} else {
t5 = $[15];
}
let t6;
if ($[16] !== cellData) {
t6 = [cellData];
$[16] = cellData;
$[17] = t6;
} else {
t6 = $[17];
}
useEffect(t5, t6);
let t7;
if ($[18] !== cellData || $[19] !== config.admin || $[20] !== customCellContext || $[21] !== documents || $[22] !== field || $[23] !== getEntityConfig || $[24] !== i18n || $[25] !== intersectionRef || $[26] !== label || $[27] !== t || $[28] !== values) {
let t8;
if ($[30] !== config.admin || $[31] !== customCellContext || $[32] !== documents || $[33] !== field || $[34] !== getEntityConfig || $[35] !== i18n || $[36] !== t || $[37] !== values.length) {
t8 = (t9, i) => {
const {
relationTo: relationTo_0,
value
} = t9;
const document = documents[relationTo_0][value];
const relatedCollection = getEntityConfig({
collectionSlug: relationTo_0
});
const label_0 = formatDocTitle({
collectionConfig: relatedCollection,
data: document || null,
dateFormat: config.admin.dateFormat,
fallback: `${t("general:untitled")} - ID: ${value}`,
i18n
});
let fileField = null;
if (field.type === "upload") {
const fieldPreviewAllowed = "displayPreview" in field ? field.displayPreview : undefined;
const previewAllowed = fieldPreviewAllowed ?? relatedCollection.upload?.displayPreview ?? true;
if (previewAllowed && document) {
fileField = _jsx(FileCell, {
cellData: label_0,
collectionConfig: relatedCollection,
collectionSlug: relatedCollection.slug,
customCellProps: customCellContext,
field,
rowData: document
});
}
}
return _jsxs(React.Fragment, {
children: [document === false && `${t("general:untitled")} - ID: ${value}`, document === null && `${t("general:loading")}...`, document ? fileField || label_0 : null, values.length > i + 1 && ", "]
}, i);
};
$[30] = config.admin;
$[31] = customCellContext;
$[32] = documents;
$[33] = field;
$[34] = getEntityConfig;
$[35] = i18n;
$[36] = t;
$[37] = values.length;
$[38] = t8;
} else {
t8 = $[38];
}
t7 = _jsxs("div", {
className: baseClass,
ref: intersectionRef,
children: [values.map(t8), Array.isArray(cellData) && cellData.length > totalToShow && t("fields:itemsAndMore", {
count: cellData.length - totalToShow,
items: ""
}), values.length === 0 && t("general:noLabel", {
label: getTranslation(label || "", i18n)
})]
});
$[18] = cellData;
$[19] = config.admin;
$[20] = customCellContext;
$[21] = documents;
$[22] = field;
$[23] = getEntityConfig;
$[24] = i18n;
$[25] = intersectionRef;
$[26] = label;
$[27] = t;
$[28] = values;
$[29] = t7;
} else {
t7 = $[29];
}
return t7;
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,166 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import React from 'react';
import { useTranslation } from '../../../../providers/Translation/index.js';
import { ReactSelect } from '../../../ReactSelect/index.js';
import { formatOptions } from './formatOptions.js';
export const Select = t0 => {
const $ = _c(21);
const {
disabled,
field: t1,
isClearable,
onChange,
operator,
options: optionsFromProps,
value
} = t0;
const {
admin: t2
} = t1;
const {
placeholder
} = t2;
const {
i18n
} = useTranslation();
let t3;
if ($[0] !== optionsFromProps) {
t3 = formatOptions(optionsFromProps);
$[0] = optionsFromProps;
$[1] = t3;
} else {
t3 = $[1];
}
const [options, setOptions] = React.useState(t3);
let t4;
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
t4 = ["in", "not_in"];
$[2] = t4;
} else {
t4 = $[2];
}
const isMulti = t4.includes(operator);
let valueToRender;
if (isMulti && Array.isArray(value)) {
let t5;
if ($[3] !== i18n || $[4] !== options) {
t5 = val => {
const matchingOption = options.find(option => option.value === val);
return {
label: matchingOption ? getTranslation(matchingOption.label, i18n) : val,
value: matchingOption?.value ?? val
};
};
$[3] = i18n;
$[4] = options;
$[5] = t5;
} else {
t5 = $[5];
}
valueToRender = value.map(t5);
} else {
if (value) {
let t5;
if ($[6] !== value) {
t5 = option_0 => option_0.value === value;
$[6] = value;
$[7] = t5;
} else {
t5 = $[7];
}
const matchingOption_0 = options.find(t5);
valueToRender = {
label: matchingOption_0 ? getTranslation(matchingOption_0.label, i18n) : value,
value: matchingOption_0?.value ?? value
};
}
}
let t5;
if ($[8] !== isMulti || $[9] !== onChange) {
t5 = selectedOption => {
let newValue;
if (!selectedOption) {
newValue = null;
} else {
if (isMulti) {
if (Array.isArray(selectedOption)) {
newValue = selectedOption.map(_temp);
} else {
newValue = [];
}
} else {
newValue = selectedOption.value;
}
}
onChange(newValue);
};
$[8] = isMulti;
$[9] = onChange;
$[10] = t5;
} else {
t5 = $[10];
}
const onSelect = t5;
let t6;
let t7;
if ($[11] !== optionsFromProps) {
t6 = () => {
setOptions(formatOptions(optionsFromProps));
};
t7 = [optionsFromProps];
$[11] = optionsFromProps;
$[12] = t6;
$[13] = t7;
} else {
t6 = $[12];
t7 = $[13];
}
React.useEffect(t6, t7);
let t8;
let t9;
if ($[14] !== isMulti || $[15] !== onChange || $[16] !== value) {
t8 = () => {
if (!isMulti && Array.isArray(value)) {
onChange(value[0]);
}
};
t9 = [isMulti, onChange, value];
$[14] = isMulti;
$[15] = onChange;
$[16] = value;
$[17] = t8;
$[18] = t9;
} else {
t8 = $[17];
t9 = $[18];
}
React.useEffect(t8, t9);
let t10;
if ($[19] !== i18n) {
t10 = option_2 => ({
...option_2,
label: getTranslation(option_2.label, i18n)
});
$[19] = i18n;
$[20] = t10;
} else {
t10 = $[20];
}
return _jsx(ReactSelect, {
disabled,
isClearable,
isMulti,
onChange: onSelect,
options: options.map(t10),
placeholder,
value: valueToRender
});
};
function _temp(option_1) {
return option_1.value;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,131 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy
*/
"use strict";
const { SyncHook } = require("tapable");
const isValidExternalsType = require("../../schemas/plugins/container/ExternalsType.check");
const Compilation = require("../Compilation");
const SharePlugin = require("../sharing/SharePlugin");
const createSchemaValidation = require("../util/create-schema-validation");
const ContainerPlugin = require("./ContainerPlugin");
const ContainerReferencePlugin = require("./ContainerReferencePlugin");
const HoistContainerReferences = require("./HoistContainerReferencesPlugin");
/** @typedef {import("../../declarations/plugins/container/ModuleFederationPlugin").ExternalsType} ExternalsType */
/** @typedef {import("../../declarations/plugins/container/ModuleFederationPlugin").ModuleFederationPluginOptions} ModuleFederationPluginOptions */
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("../Dependency")} Dependency */
/**
* @typedef {object} CompilationHooks
* @property {SyncHook<Dependency>} addContainerEntryDependency
* @property {SyncHook<Dependency>} addFederationRuntimeDependency
*/
const validate = createSchemaValidation(
require("../../schemas/plugins/container/ModuleFederationPlugin.check"),
() => require("../../schemas/plugins/container/ModuleFederationPlugin.json"),
{
name: "Module Federation Plugin",
baseDataPath: "options"
}
);
/** @type {WeakMap<Compilation, CompilationHooks>} */
const compilationHooksMap = new WeakMap();
const PLUGIN_NAME = "ModuleFederationPlugin";
class ModuleFederationPlugin {
/**
* @param {ModuleFederationPluginOptions} options options
*/
constructor(options) {
validate(options);
this._options = options;
}
/**
* Get the compilation hooks associated with this plugin.
* @param {Compilation} compilation The compilation instance.
* @returns {CompilationHooks} The hooks for the compilation.
*/
static getCompilationHooks(compilation) {
if (!(compilation instanceof Compilation)) {
throw new TypeError(
"The 'compilation' argument must be an instance of Compilation"
);
}
let hooks = compilationHooksMap.get(compilation);
if (!hooks) {
hooks = {
addContainerEntryDependency: new SyncHook(["dependency"]),
addFederationRuntimeDependency: new SyncHook(["dependency"])
};
compilationHooksMap.set(compilation, hooks);
}
return hooks;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
const { _options: options } = this;
const library = options.library || { type: "var", name: options.name };
const remoteType =
options.remoteType ||
(options.library && isValidExternalsType(options.library.type)
? /** @type {ExternalsType} */ (options.library.type)
: "script");
if (
library &&
!compiler.options.output.enabledLibraryTypes.includes(library.type)
) {
compiler.options.output.enabledLibraryTypes.push(library.type);
}
compiler.hooks.afterPlugins.tap(PLUGIN_NAME, () => {
if (
options.exposes &&
(Array.isArray(options.exposes)
? options.exposes.length > 0
: Object.keys(options.exposes).length > 0)
) {
new ContainerPlugin({
name: /** @type {string} */ (options.name),
library,
filename: options.filename,
runtime: options.runtime,
shareScope: options.shareScope,
exposes: options.exposes
}).apply(compiler);
}
if (
options.remotes &&
(Array.isArray(options.remotes)
? options.remotes.length > 0
: Object.keys(options.remotes).length > 0)
) {
new ContainerReferencePlugin({
remoteType,
shareScope: options.shareScope,
remotes: options.remotes
}).apply(compiler);
}
if (options.shared) {
new SharePlugin({
shared: options.shared,
shareScope: options.shareScope
}).apply(compiler);
}
new HoistContainerReferences().apply(compiler);
});
}
}
module.exports = ModuleFederationPlugin;

View File

@@ -0,0 +1,28 @@
import { StateManagerProps } from './useStateManager';
import { GroupBase, OptionsOrGroups } from './types';
declare type AsyncManagedPropKeys = 'options' | 'isLoading' | 'onInputChange' | 'filterOption';
export interface AsyncAdditionalProps<Option, Group extends GroupBase<Option>> {
/**
* The default set of options to show before the user starts searching. When
* set to `true`, the results for loadOptions('') will be autoloaded.
*/
defaultOptions?: OptionsOrGroups<Option, Group> | boolean;
/**
* If cacheOptions is truthy, then the loaded data will be cached. The cache
* will remain until `cacheOptions` changes value.
*/
cacheOptions?: any;
/**
* Function that returns a promise, which is the set of options to be used
* once the promise resolves.
*/
loadOptions?: (inputValue: string, callback: (options: OptionsOrGroups<Option, Group>) => void) => Promise<OptionsOrGroups<Option, Group>> | void;
/**
* Will cause the select to be displayed in the loading state, even if the
* Async select is not currently waiting for loadOptions to resolve
*/
isLoading?: boolean;
}
export declare type AsyncProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = StateManagerProps<Option, IsMulti, Group> & AsyncAdditionalProps<Option, Group>;
export default function useAsync<Option, IsMulti extends boolean, Group extends GroupBase<Option>, AdditionalProps>({ defaultOptions: propsDefaultOptions, cacheOptions, loadOptions: propsLoadOptions, options: propsOptions, isLoading: propsIsLoading, onInputChange: propsOnInputChange, filterOption, ...restSelectProps }: AsyncProps<Option, IsMulti, Group> & AdditionalProps): StateManagerProps<Option, IsMulti, Group> & Omit<AdditionalProps, keyof AsyncAdditionalProps<Option, Group> | AsyncManagedPropKeys>;
export {};

View File

@@ -0,0 +1,837 @@
import { aliasedTable, aliasedTableColumn, mapColumnsInAliasedSQLToAlias, mapColumnsInSQLToAlias } from "../alias.js";
import { CasingCache } from "../casing.js";
import { Column } from "../column.js";
import { entityKind, is } from "../entity.js";
import { DrizzleError } from "../errors.js";
import {
getOperators,
getOrderByOperators,
Many,
normalizeRelation,
One
} from "../relations.js";
import { and, eq } from "../sql/expressions/index.js";
import { Param, SQL, sql, View } from "../sql/sql.js";
import { Subquery } from "../subquery.js";
import { getTableName, getTableUniqueName, Table } from "../table.js";
import { orderSelectedFields } from "../utils.js";
import { ViewBaseConfig } from "../view-common.js";
import { MySqlColumn } from "./columns/common.js";
import { MySqlTable } from "./table.js";
import { MySqlViewBase } from "./view-base.js";
class MySqlDialect {
static [entityKind] = "MySqlDialect";
/** @internal */
casing;
constructor(config) {
this.casing = new CasingCache(config?.casing);
}
async migrate(migrations, session, config) {
const migrationsTable = config.migrationsTable ?? "__drizzle_migrations";
const migrationTableCreate = sql`
create table if not exists ${sql.identifier(migrationsTable)} (
id serial primary key,
hash text not null,
created_at bigint
)
`;
await session.execute(migrationTableCreate);
const dbMigrations = await session.all(
sql`select id, hash, created_at from ${sql.identifier(migrationsTable)} order by created_at desc limit 1`
);
const lastDbMigration = dbMigrations[0];
await session.transaction(async (tx) => {
for (const migration of migrations) {
if (!lastDbMigration || Number(lastDbMigration.created_at) < migration.folderMillis) {
for (const stmt of migration.sql) {
await tx.execute(sql.raw(stmt));
}
await tx.execute(
sql`insert into ${sql.identifier(migrationsTable)} (\`hash\`, \`created_at\`) values(${migration.hash}, ${migration.folderMillis})`
);
}
}
});
}
escapeName(name) {
return `\`${name}\``;
}
escapeParam(_num) {
return `?`;
}
escapeString(str) {
return `'${str.replace(/'/g, "''")}'`;
}
buildWithCTE(queries) {
if (!queries?.length) return void 0;
const withSqlChunks = [sql`with `];
for (const [i, w] of queries.entries()) {
withSqlChunks.push(sql`${sql.identifier(w._.alias)} as (${w._.sql})`);
if (i < queries.length - 1) {
withSqlChunks.push(sql`, `);
}
}
withSqlChunks.push(sql` `);
return sql.join(withSqlChunks);
}
buildDeleteQuery({ table, where, returning, withList, limit, orderBy }) {
const withSql = this.buildWithCTE(withList);
const returningSql = returning ? sql` returning ${this.buildSelection(returning, { isSingleTable: true })}` : void 0;
const whereSql = where ? sql` where ${where}` : void 0;
const orderBySql = this.buildOrderBy(orderBy);
const limitSql = this.buildLimit(limit);
return sql`${withSql}delete from ${table}${whereSql}${orderBySql}${limitSql}${returningSql}`;
}
buildUpdateSet(table, set) {
const tableColumns = table[Table.Symbol.Columns];
const columnNames = Object.keys(tableColumns).filter(
(colName) => set[colName] !== void 0 || tableColumns[colName]?.onUpdateFn !== void 0
);
const setSize = columnNames.length;
return sql.join(columnNames.flatMap((colName, i) => {
const col = tableColumns[colName];
const value = set[colName] ?? sql.param(col.onUpdateFn(), col);
const res = sql`${sql.identifier(this.casing.getColumnCasing(col))} = ${value}`;
if (i < setSize - 1) {
return [res, sql.raw(", ")];
}
return [res];
}));
}
buildUpdateQuery({ table, set, where, returning, withList, limit, orderBy }) {
const withSql = this.buildWithCTE(withList);
const setSql = this.buildUpdateSet(table, set);
const returningSql = returning ? sql` returning ${this.buildSelection(returning, { isSingleTable: true })}` : void 0;
const whereSql = where ? sql` where ${where}` : void 0;
const orderBySql = this.buildOrderBy(orderBy);
const limitSql = this.buildLimit(limit);
return sql`${withSql}update ${table} set ${setSql}${whereSql}${orderBySql}${limitSql}${returningSql}`;
}
/**
* Builds selection SQL with provided fields/expressions
*
* Examples:
*
* `select <selection> from`
*
* `insert ... returning <selection>`
*
* If `isSingleTable` is true, then columns won't be prefixed with table name
*/
buildSelection(fields, { isSingleTable = false } = {}) {
const columnsLen = fields.length;
const chunks = fields.flatMap(({ field }, i) => {
const chunk = [];
if (is(field, SQL.Aliased) && field.isSelectionField) {
chunk.push(sql.identifier(field.fieldAlias));
} else if (is(field, SQL.Aliased) || is(field, SQL)) {
const query = is(field, SQL.Aliased) ? field.sql : field;
if (isSingleTable) {
chunk.push(
new SQL(
query.queryChunks.map((c) => {
if (is(c, MySqlColumn)) {
return sql.identifier(this.casing.getColumnCasing(c));
}
return c;
})
)
);
} else {
chunk.push(query);
}
if (is(field, SQL.Aliased)) {
chunk.push(sql` as ${sql.identifier(field.fieldAlias)}`);
}
} else if (is(field, Column)) {
if (isSingleTable) {
chunk.push(sql.identifier(this.casing.getColumnCasing(field)));
} else {
chunk.push(field);
}
}
if (i < columnsLen - 1) {
chunk.push(sql`, `);
}
return chunk;
});
return sql.join(chunks);
}
buildLimit(limit) {
return typeof limit === "object" || typeof limit === "number" && limit >= 0 ? sql` limit ${limit}` : void 0;
}
buildOrderBy(orderBy) {
return orderBy && orderBy.length > 0 ? sql` order by ${sql.join(orderBy, sql`, `)}` : void 0;
}
buildIndex({
indexes,
indexFor
}) {
return indexes && indexes.length > 0 ? sql` ${sql.raw(indexFor)} INDEX (${sql.raw(indexes.join(`, `))})` : void 0;
}
buildSelectQuery({
withList,
fields,
fieldsFlat,
where,
having,
table,
joins,
orderBy,
groupBy,
limit,
offset,
lockingClause,
distinct,
setOperators,
useIndex,
forceIndex,
ignoreIndex
}) {
const fieldsList = fieldsFlat ?? orderSelectedFields(fields);
for (const f of fieldsList) {
if (is(f.field, Column) && getTableName(f.field.table) !== (is(table, Subquery) ? table._.alias : is(table, MySqlViewBase) ? table[ViewBaseConfig].name : is(table, SQL) ? void 0 : getTableName(table)) && !((table2) => joins?.some(
({ alias }) => alias === (table2[Table.Symbol.IsAlias] ? getTableName(table2) : table2[Table.Symbol.BaseName])
))(f.field.table)) {
const tableName = getTableName(f.field.table);
throw new Error(
`Your "${f.path.join("->")}" field references a column "${tableName}"."${f.field.name}", but the table "${tableName}" is not part of the query! Did you forget to join it?`
);
}
}
const isSingleTable = !joins || joins.length === 0;
const withSql = this.buildWithCTE(withList);
const distinctSql = distinct ? sql` distinct` : void 0;
const selection = this.buildSelection(fieldsList, { isSingleTable });
const tableSql = (() => {
if (is(table, Table) && table[Table.Symbol.IsAlias]) {
return sql`${sql`${sql.identifier(table[Table.Symbol.Schema] ?? "")}.`.if(table[Table.Symbol.Schema])}${sql.identifier(table[Table.Symbol.OriginalName])} ${sql.identifier(table[Table.Symbol.Name])}`;
}
return table;
})();
const joinsArray = [];
if (joins) {
for (const [index, joinMeta] of joins.entries()) {
if (index === 0) {
joinsArray.push(sql` `);
}
const table2 = joinMeta.table;
const lateralSql = joinMeta.lateral ? sql` lateral` : void 0;
const onSql = joinMeta.on ? sql` on ${joinMeta.on}` : void 0;
if (is(table2, MySqlTable)) {
const tableName = table2[MySqlTable.Symbol.Name];
const tableSchema = table2[MySqlTable.Symbol.Schema];
const origTableName = table2[MySqlTable.Symbol.OriginalName];
const alias = tableName === origTableName ? void 0 : joinMeta.alias;
const useIndexSql2 = this.buildIndex({ indexes: joinMeta.useIndex, indexFor: "USE" });
const forceIndexSql2 = this.buildIndex({ indexes: joinMeta.forceIndex, indexFor: "FORCE" });
const ignoreIndexSql2 = this.buildIndex({ indexes: joinMeta.ignoreIndex, indexFor: "IGNORE" });
joinsArray.push(
sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${tableSchema ? sql`${sql.identifier(tableSchema)}.` : void 0}${sql.identifier(origTableName)}${useIndexSql2}${forceIndexSql2}${ignoreIndexSql2}${alias && sql` ${sql.identifier(alias)}`}${onSql}`
);
} else if (is(table2, View)) {
const viewName = table2[ViewBaseConfig].name;
const viewSchema = table2[ViewBaseConfig].schema;
const origViewName = table2[ViewBaseConfig].originalName;
const alias = viewName === origViewName ? void 0 : joinMeta.alias;
joinsArray.push(
sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${viewSchema ? sql`${sql.identifier(viewSchema)}.` : void 0}${sql.identifier(origViewName)}${alias && sql` ${sql.identifier(alias)}`}${onSql}`
);
} else {
joinsArray.push(
sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${table2}${onSql}`
);
}
if (index < joins.length - 1) {
joinsArray.push(sql` `);
}
}
}
const joinsSql = sql.join(joinsArray);
const whereSql = where ? sql` where ${where}` : void 0;
const havingSql = having ? sql` having ${having}` : void 0;
const orderBySql = this.buildOrderBy(orderBy);
const groupBySql = groupBy && groupBy.length > 0 ? sql` group by ${sql.join(groupBy, sql`, `)}` : void 0;
const limitSql = this.buildLimit(limit);
const offsetSql = offset ? sql` offset ${offset}` : void 0;
const useIndexSql = this.buildIndex({ indexes: useIndex, indexFor: "USE" });
const forceIndexSql = this.buildIndex({ indexes: forceIndex, indexFor: "FORCE" });
const ignoreIndexSql = this.buildIndex({ indexes: ignoreIndex, indexFor: "IGNORE" });
let lockingClausesSql;
if (lockingClause) {
const { config, strength } = lockingClause;
lockingClausesSql = sql` for ${sql.raw(strength)}`;
if (config.noWait) {
lockingClausesSql.append(sql` nowait`);
} else if (config.skipLocked) {
lockingClausesSql.append(sql` skip locked`);
}
}
const finalQuery = sql`${withSql}select${distinctSql} ${selection} from ${tableSql}${useIndexSql}${forceIndexSql}${ignoreIndexSql}${joinsSql}${whereSql}${groupBySql}${havingSql}${orderBySql}${limitSql}${offsetSql}${lockingClausesSql}`;
if (setOperators.length > 0) {
return this.buildSetOperations(finalQuery, setOperators);
}
return finalQuery;
}
buildSetOperations(leftSelect, setOperators) {
const [setOperator, ...rest] = setOperators;
if (!setOperator) {
throw new Error("Cannot pass undefined values to any set operator");
}
if (rest.length === 0) {
return this.buildSetOperationQuery({ leftSelect, setOperator });
}
return this.buildSetOperations(
this.buildSetOperationQuery({ leftSelect, setOperator }),
rest
);
}
buildSetOperationQuery({
leftSelect,
setOperator: { type, isAll, rightSelect, limit, orderBy, offset }
}) {
const leftChunk = sql`(${leftSelect.getSQL()}) `;
const rightChunk = sql`(${rightSelect.getSQL()})`;
let orderBySql;
if (orderBy && orderBy.length > 0) {
const orderByValues = [];
for (const orderByUnit of orderBy) {
if (is(orderByUnit, MySqlColumn)) {
orderByValues.push(sql.identifier(this.casing.getColumnCasing(orderByUnit)));
} else if (is(orderByUnit, SQL)) {
for (let i = 0; i < orderByUnit.queryChunks.length; i++) {
const chunk = orderByUnit.queryChunks[i];
if (is(chunk, MySqlColumn)) {
orderByUnit.queryChunks[i] = sql.identifier(this.casing.getColumnCasing(chunk));
}
}
orderByValues.push(sql`${orderByUnit}`);
} else {
orderByValues.push(sql`${orderByUnit}`);
}
}
orderBySql = sql` order by ${sql.join(orderByValues, sql`, `)} `;
}
const limitSql = typeof limit === "object" || typeof limit === "number" && limit >= 0 ? sql` limit ${limit}` : void 0;
const operatorChunk = sql.raw(`${type} ${isAll ? "all " : ""}`);
const offsetSql = offset ? sql` offset ${offset}` : void 0;
return sql`${leftChunk}${operatorChunk}${rightChunk}${orderBySql}${limitSql}${offsetSql}`;
}
buildInsertQuery({ table, values: valuesOrSelect, ignore, onConflict, select }) {
const valuesSqlList = [];
const columns = table[Table.Symbol.Columns];
const colEntries = Object.entries(columns).filter(
([_, col]) => !col.shouldDisableInsert()
);
const insertOrder = colEntries.map(([, column]) => sql.identifier(this.casing.getColumnCasing(column)));
const generatedIdsResponse = [];
if (select) {
const select2 = valuesOrSelect;
if (is(select2, SQL)) {
valuesSqlList.push(select2);
} else {
valuesSqlList.push(select2.getSQL());
}
} else {
const values = valuesOrSelect;
valuesSqlList.push(sql.raw("values "));
for (const [valueIndex, value] of values.entries()) {
const generatedIds = {};
const valueList = [];
for (const [fieldName, col] of colEntries) {
const colValue = value[fieldName];
if (colValue === void 0 || is(colValue, Param) && colValue.value === void 0) {
if (col.defaultFn !== void 0) {
const defaultFnResult = col.defaultFn();
generatedIds[fieldName] = defaultFnResult;
const defaultValue = is(defaultFnResult, SQL) ? defaultFnResult : sql.param(defaultFnResult, col);
valueList.push(defaultValue);
} else if (!col.default && col.onUpdateFn !== void 0) {
const onUpdateFnResult = col.onUpdateFn();
const newValue = is(onUpdateFnResult, SQL) ? onUpdateFnResult : sql.param(onUpdateFnResult, col);
valueList.push(newValue);
} else {
valueList.push(sql`default`);
}
} else {
if (col.defaultFn && is(colValue, Param)) {
generatedIds[fieldName] = colValue.value;
}
valueList.push(colValue);
}
}
generatedIdsResponse.push(generatedIds);
valuesSqlList.push(valueList);
if (valueIndex < values.length - 1) {
valuesSqlList.push(sql`, `);
}
}
}
const valuesSql = sql.join(valuesSqlList);
const ignoreSql = ignore ? sql` ignore` : void 0;
const onConflictSql = onConflict ? sql` on duplicate key ${onConflict}` : void 0;
return {
sql: sql`insert${ignoreSql} into ${table} ${insertOrder} ${valuesSql}${onConflictSql}`,
generatedIds: generatedIdsResponse
};
}
sqlToQuery(sql2, invokeSource) {
return sql2.toQuery({
casing: this.casing,
escapeName: this.escapeName,
escapeParam: this.escapeParam,
escapeString: this.escapeString,
invokeSource
});
}
buildRelationalQuery({
fullSchema,
schema,
tableNamesMap,
table,
tableConfig,
queryConfig: config,
tableAlias,
nestedQueryRelation,
joinOn
}) {
let selection = [];
let limit, offset, orderBy, where;
const joins = [];
if (config === true) {
const selectionEntries = Object.entries(tableConfig.columns);
selection = selectionEntries.map(([key, value]) => ({
dbKey: value.name,
tsKey: key,
field: aliasedTableColumn(value, tableAlias),
relationTableTsKey: void 0,
isJson: false,
selection: []
}));
} else {
const aliasedColumns = Object.fromEntries(
Object.entries(tableConfig.columns).map(([key, value]) => [key, aliasedTableColumn(value, tableAlias)])
);
if (config.where) {
const whereSql = typeof config.where === "function" ? config.where(aliasedColumns, getOperators()) : config.where;
where = whereSql && mapColumnsInSQLToAlias(whereSql, tableAlias);
}
const fieldsSelection = [];
let selectedColumns = [];
if (config.columns) {
let isIncludeMode = false;
for (const [field, value] of Object.entries(config.columns)) {
if (value === void 0) {
continue;
}
if (field in tableConfig.columns) {
if (!isIncludeMode && value === true) {
isIncludeMode = true;
}
selectedColumns.push(field);
}
}
if (selectedColumns.length > 0) {
selectedColumns = isIncludeMode ? selectedColumns.filter((c) => config.columns?.[c] === true) : Object.keys(tableConfig.columns).filter((key) => !selectedColumns.includes(key));
}
} else {
selectedColumns = Object.keys(tableConfig.columns);
}
for (const field of selectedColumns) {
const column = tableConfig.columns[field];
fieldsSelection.push({ tsKey: field, value: column });
}
let selectedRelations = [];
if (config.with) {
selectedRelations = Object.entries(config.with).filter((entry) => !!entry[1]).map(([tsKey, queryConfig]) => ({ tsKey, queryConfig, relation: tableConfig.relations[tsKey] }));
}
let extras;
if (config.extras) {
extras = typeof config.extras === "function" ? config.extras(aliasedColumns, { sql }) : config.extras;
for (const [tsKey, value] of Object.entries(extras)) {
fieldsSelection.push({
tsKey,
value: mapColumnsInAliasedSQLToAlias(value, tableAlias)
});
}
}
for (const { tsKey, value } of fieldsSelection) {
selection.push({
dbKey: is(value, SQL.Aliased) ? value.fieldAlias : tableConfig.columns[tsKey].name,
tsKey,
field: is(value, Column) ? aliasedTableColumn(value, tableAlias) : value,
relationTableTsKey: void 0,
isJson: false,
selection: []
});
}
let orderByOrig = typeof config.orderBy === "function" ? config.orderBy(aliasedColumns, getOrderByOperators()) : config.orderBy ?? [];
if (!Array.isArray(orderByOrig)) {
orderByOrig = [orderByOrig];
}
orderBy = orderByOrig.map((orderByValue) => {
if (is(orderByValue, Column)) {
return aliasedTableColumn(orderByValue, tableAlias);
}
return mapColumnsInSQLToAlias(orderByValue, tableAlias);
});
limit = config.limit;
offset = config.offset;
for (const {
tsKey: selectedRelationTsKey,
queryConfig: selectedRelationConfigValue,
relation
} of selectedRelations) {
const normalizedRelation = normalizeRelation(schema, tableNamesMap, relation);
const relationTableName = getTableUniqueName(relation.referencedTable);
const relationTableTsName = tableNamesMap[relationTableName];
const relationTableAlias = `${tableAlias}_${selectedRelationTsKey}`;
const joinOn2 = and(
...normalizedRelation.fields.map(
(field2, i) => eq(
aliasedTableColumn(normalizedRelation.references[i], relationTableAlias),
aliasedTableColumn(field2, tableAlias)
)
)
);
const builtRelation = this.buildRelationalQuery({
fullSchema,
schema,
tableNamesMap,
table: fullSchema[relationTableTsName],
tableConfig: schema[relationTableTsName],
queryConfig: is(relation, One) ? selectedRelationConfigValue === true ? { limit: 1 } : { ...selectedRelationConfigValue, limit: 1 } : selectedRelationConfigValue,
tableAlias: relationTableAlias,
joinOn: joinOn2,
nestedQueryRelation: relation
});
const field = sql`${sql.identifier(relationTableAlias)}.${sql.identifier("data")}`.as(selectedRelationTsKey);
joins.push({
on: sql`true`,
table: new Subquery(builtRelation.sql, {}, relationTableAlias),
alias: relationTableAlias,
joinType: "left",
lateral: true
});
selection.push({
dbKey: selectedRelationTsKey,
tsKey: selectedRelationTsKey,
field,
relationTableTsKey: relationTableTsName,
isJson: true,
selection: builtRelation.selection
});
}
}
if (selection.length === 0) {
throw new DrizzleError({ message: `No fields selected for table "${tableConfig.tsName}" ("${tableAlias}")` });
}
let result;
where = and(joinOn, where);
if (nestedQueryRelation) {
let field = sql`json_array(${sql.join(
selection.map(
({ field: field2, tsKey, isJson }) => isJson ? sql`${sql.identifier(`${tableAlias}_${tsKey}`)}.${sql.identifier("data")}` : is(field2, SQL.Aliased) ? field2.sql : field2
),
sql`, `
)})`;
if (is(nestedQueryRelation, Many)) {
field = sql`coalesce(json_arrayagg(${field}), json_array())`;
}
const nestedSelection = [{
dbKey: "data",
tsKey: "data",
field: field.as("data"),
isJson: true,
relationTableTsKey: tableConfig.tsName,
selection
}];
const needsSubquery = limit !== void 0 || offset !== void 0 || (orderBy?.length ?? 0) > 0;
if (needsSubquery) {
result = this.buildSelectQuery({
table: aliasedTable(table, tableAlias),
fields: {},
fieldsFlat: [
{
path: [],
field: sql.raw("*")
},
...((orderBy?.length ?? 0) > 0 ? [{
path: [],
field: sql`row_number() over (order by ${sql.join(orderBy, sql`, `)})`
}] : [])
],
where,
limit,
offset,
setOperators: []
});
where = void 0;
limit = void 0;
offset = void 0;
orderBy = void 0;
} else {
result = aliasedTable(table, tableAlias);
}
result = this.buildSelectQuery({
table: is(result, MySqlTable) ? result : new Subquery(result, {}, tableAlias),
fields: {},
fieldsFlat: nestedSelection.map(({ field: field2 }) => ({
path: [],
field: is(field2, Column) ? aliasedTableColumn(field2, tableAlias) : field2
})),
joins,
where,
limit,
offset,
orderBy,
setOperators: []
});
} else {
result = this.buildSelectQuery({
table: aliasedTable(table, tableAlias),
fields: {},
fieldsFlat: selection.map(({ field }) => ({
path: [],
field: is(field, Column) ? aliasedTableColumn(field, tableAlias) : field
})),
joins,
where,
limit,
offset,
orderBy,
setOperators: []
});
}
return {
tableTsKey: tableConfig.tsName,
sql: result,
selection
};
}
buildRelationalQueryWithoutLateralSubqueries({
fullSchema,
schema,
tableNamesMap,
table,
tableConfig,
queryConfig: config,
tableAlias,
nestedQueryRelation,
joinOn
}) {
let selection = [];
let limit, offset, orderBy = [], where;
if (config === true) {
const selectionEntries = Object.entries(tableConfig.columns);
selection = selectionEntries.map(([key, value]) => ({
dbKey: value.name,
tsKey: key,
field: aliasedTableColumn(value, tableAlias),
relationTableTsKey: void 0,
isJson: false,
selection: []
}));
} else {
const aliasedColumns = Object.fromEntries(
Object.entries(tableConfig.columns).map(([key, value]) => [key, aliasedTableColumn(value, tableAlias)])
);
if (config.where) {
const whereSql = typeof config.where === "function" ? config.where(aliasedColumns, getOperators()) : config.where;
where = whereSql && mapColumnsInSQLToAlias(whereSql, tableAlias);
}
const fieldsSelection = [];
let selectedColumns = [];
if (config.columns) {
let isIncludeMode = false;
for (const [field, value] of Object.entries(config.columns)) {
if (value === void 0) {
continue;
}
if (field in tableConfig.columns) {
if (!isIncludeMode && value === true) {
isIncludeMode = true;
}
selectedColumns.push(field);
}
}
if (selectedColumns.length > 0) {
selectedColumns = isIncludeMode ? selectedColumns.filter((c) => config.columns?.[c] === true) : Object.keys(tableConfig.columns).filter((key) => !selectedColumns.includes(key));
}
} else {
selectedColumns = Object.keys(tableConfig.columns);
}
for (const field of selectedColumns) {
const column = tableConfig.columns[field];
fieldsSelection.push({ tsKey: field, value: column });
}
let selectedRelations = [];
if (config.with) {
selectedRelations = Object.entries(config.with).filter((entry) => !!entry[1]).map(([tsKey, queryConfig]) => ({ tsKey, queryConfig, relation: tableConfig.relations[tsKey] }));
}
let extras;
if (config.extras) {
extras = typeof config.extras === "function" ? config.extras(aliasedColumns, { sql }) : config.extras;
for (const [tsKey, value] of Object.entries(extras)) {
fieldsSelection.push({
tsKey,
value: mapColumnsInAliasedSQLToAlias(value, tableAlias)
});
}
}
for (const { tsKey, value } of fieldsSelection) {
selection.push({
dbKey: is(value, SQL.Aliased) ? value.fieldAlias : tableConfig.columns[tsKey].name,
tsKey,
field: is(value, Column) ? aliasedTableColumn(value, tableAlias) : value,
relationTableTsKey: void 0,
isJson: false,
selection: []
});
}
let orderByOrig = typeof config.orderBy === "function" ? config.orderBy(aliasedColumns, getOrderByOperators()) : config.orderBy ?? [];
if (!Array.isArray(orderByOrig)) {
orderByOrig = [orderByOrig];
}
orderBy = orderByOrig.map((orderByValue) => {
if (is(orderByValue, Column)) {
return aliasedTableColumn(orderByValue, tableAlias);
}
return mapColumnsInSQLToAlias(orderByValue, tableAlias);
});
limit = config.limit;
offset = config.offset;
for (const {
tsKey: selectedRelationTsKey,
queryConfig: selectedRelationConfigValue,
relation
} of selectedRelations) {
const normalizedRelation = normalizeRelation(schema, tableNamesMap, relation);
const relationTableName = getTableUniqueName(relation.referencedTable);
const relationTableTsName = tableNamesMap[relationTableName];
const relationTableAlias = `${tableAlias}_${selectedRelationTsKey}`;
const joinOn2 = and(
...normalizedRelation.fields.map(
(field2, i) => eq(
aliasedTableColumn(normalizedRelation.references[i], relationTableAlias),
aliasedTableColumn(field2, tableAlias)
)
)
);
const builtRelation = this.buildRelationalQueryWithoutLateralSubqueries({
fullSchema,
schema,
tableNamesMap,
table: fullSchema[relationTableTsName],
tableConfig: schema[relationTableTsName],
queryConfig: is(relation, One) ? selectedRelationConfigValue === true ? { limit: 1 } : { ...selectedRelationConfigValue, limit: 1 } : selectedRelationConfigValue,
tableAlias: relationTableAlias,
joinOn: joinOn2,
nestedQueryRelation: relation
});
let fieldSql = sql`(${builtRelation.sql})`;
if (is(relation, Many)) {
fieldSql = sql`coalesce(${fieldSql}, json_array())`;
}
const field = fieldSql.as(selectedRelationTsKey);
selection.push({
dbKey: selectedRelationTsKey,
tsKey: selectedRelationTsKey,
field,
relationTableTsKey: relationTableTsName,
isJson: true,
selection: builtRelation.selection
});
}
}
if (selection.length === 0) {
throw new DrizzleError({
message: `No fields selected for table "${tableConfig.tsName}" ("${tableAlias}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.`
});
}
let result;
where = and(joinOn, where);
if (nestedQueryRelation) {
let field = sql`json_array(${sql.join(
selection.map(
({ field: field2 }) => is(field2, MySqlColumn) ? sql.identifier(this.casing.getColumnCasing(field2)) : is(field2, SQL.Aliased) ? field2.sql : field2
),
sql`, `
)})`;
if (is(nestedQueryRelation, Many)) {
field = sql`json_arrayagg(${field})`;
}
const nestedSelection = [{
dbKey: "data",
tsKey: "data",
field,
isJson: true,
relationTableTsKey: tableConfig.tsName,
selection
}];
const needsSubquery = limit !== void 0 || offset !== void 0 || orderBy.length > 0;
if (needsSubquery) {
result = this.buildSelectQuery({
table: aliasedTable(table, tableAlias),
fields: {},
fieldsFlat: [
{
path: [],
field: sql.raw("*")
},
...(orderBy.length > 0 ? [{
path: [],
field: sql`row_number() over (order by ${sql.join(orderBy, sql`, `)})`
}] : [])
],
where,
limit,
offset,
setOperators: []
});
where = void 0;
limit = void 0;
offset = void 0;
orderBy = void 0;
} else {
result = aliasedTable(table, tableAlias);
}
result = this.buildSelectQuery({
table: is(result, MySqlTable) ? result : new Subquery(result, {}, tableAlias),
fields: {},
fieldsFlat: nestedSelection.map(({ field: field2 }) => ({
path: [],
field: is(field2, Column) ? aliasedTableColumn(field2, tableAlias) : field2
})),
where,
limit,
offset,
orderBy,
setOperators: []
});
} else {
result = this.buildSelectQuery({
table: aliasedTable(table, tableAlias),
fields: {},
fieldsFlat: selection.map(({ field }) => ({
path: [],
field: is(field, Column) ? aliasedTableColumn(field, tableAlias) : field
})),
where,
limit,
offset,
orderBy,
setOperators: []
});
}
return {
tableTsKey: tableConfig.tsName,
sql: result,
selection
};
}
}
export {
MySqlDialect
};
//# sourceMappingURL=dialect.js.map

View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CanonicalizeLocaleList = CanonicalizeLocaleList;
/**
* http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist
* @param locales
*/
function CanonicalizeLocaleList(locales) {
return Intl.getCanonicalLocales(locales);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"BlockRow.d.ts","sourceRoot":"","sources":["../../../src/fields/Blocks/BlockRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAG/F,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gEAAgE,CAAA;AAiBhH,KAAK,gBAAgB,GAAG;IACtB,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACrE,KAAK,EAAE,WAAW,CAAA;IAClB,MAAM,EAAE,CAAC,WAAW,GAAG,MAAM,CAAC,EAAE,GAAG,WAAW,EAAE,CAAA;IAChD,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACrD,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,yBAAyB,CAAA;IACtC,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,GAAG,EAAE,GAAG,CAAA;IACR,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CACtD,GAAG,0BAA0B,CAAA;AAE9B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA+K/C,CAAA"}

View File

@@ -0,0 +1 @@
export declare function isDocument(node: Node): node is Document;

View File

@@ -0,0 +1 @@
{"version":3,"names":["_assertClassBrand","brand","receiver","returnValue","has","arguments","length","TypeError"],"sources":["../../src/helpers/assertClassBrand.ts"],"sourcesContent":["/* @minVersion 7.24.0 */\n\nexport default function _assertClassBrand(\n brand: Function | WeakMap<any, any> | WeakSet<any>,\n receiver: any,\n returnValue?: any,\n) {\n if (typeof brand === \"function\" ? brand === receiver : brand.has(receiver)) {\n return arguments.length < 3 ? receiver : returnValue;\n }\n throw new TypeError(\"Private element is not present on this object\");\n}\n"],"mappings":";;;;;;AAEe,SAASA,iBAAiBA,CACvCC,KAAkD,EAClDC,QAAa,EACbC,WAAiB,EACjB;EACA,IAAI,OAAOF,KAAK,KAAK,UAAU,GAAGA,KAAK,KAAKC,QAAQ,GAAGD,KAAK,CAACG,GAAG,CAACF,QAAQ,CAAC,EAAE;IAC1E,OAAOG,SAAS,CAACC,MAAM,GAAG,CAAC,GAAGJ,QAAQ,GAAGC,WAAW;EACtD;EACA,MAAM,IAAII,SAAS,CAAC,+CAA+C,CAAC;AACtE","ignoreList":[]}

View File

@@ -0,0 +1,46 @@
var Symbol = require('./_Symbol');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
module.exports = getRawTag;

View File

@@ -0,0 +1,2 @@
import{throwIfEmpty as e}from"../../utils/throw-if-empty.js";const t=()=>()=>({path:`/fields`,method:`GET`}),n=t=>()=>(e(t,`Collection cannot be empty`),{path:`/fields/${t}`,method:`GET`}),r=(t,n)=>()=>(e(t,`Collection cannot be empty`),e(n,`Field cannot be empty`),{path:`/fields/${t}/${n}`,method:`GET`});export{r as readField,t as readFields,n as readFieldsByCollection};
//# sourceMappingURL=fields.js.map

View File

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

View File

@@ -0,0 +1,29 @@
import { formatDistance } from "./ka/_lib/formatDistance.mjs";
import { formatLong } from "./ka/_lib/formatLong.mjs";
import { formatRelative } from "./ka/_lib/formatRelative.mjs";
import { localize } from "./ka/_lib/localize.mjs";
import { match } from "./ka/_lib/match.mjs";
/**
* @category Locales
* @summary Georgian locale.
* @language Georgian
* @iso-639-2 geo
* @author Lado Lomidze [@Landish](https://github.com/Landish)
* @author Nick Shvelidze [@shvelo](https://github.com/shvelo)
*/
export const ka = {
code: "ka",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default ka;

View File

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

View File

@@ -0,0 +1,2 @@
"use client";
import o from"next/link";import{usePathname as r}from"next/navigation";import{forwardRef as e}from"react";import{useLocale as t}from"use-intl";import i from"./syncLocaleCookie.js";import{jsx as n}from"react/jsx-runtime";function f({href:e,locale:f,localeCookie:c,onClick:m,prefetch:l,...a},p){const s=t(),u=null!=f&&f!==s,h=r();u&&(l=!1);return n(o,{ref:p,href:e,hrefLang:u?f:void 0,onClick:function(o){i(c,h,s,f),m&&m(o)},prefetch:l,...a})}var c=e(f);export{c as default};

View File

@@ -0,0 +1,74 @@
import { Socket } from 'node:net'
import { URL } from 'node:url'
import buildConnector from './connector'
import Dispatcher from './dispatcher'
declare namespace DiagnosticsChannel {
interface Request {
origin?: string | URL;
completed: boolean;
method?: Dispatcher.HttpMethod;
path: string;
headers: any;
}
interface Response {
statusCode: number;
statusText: string;
headers: Array<Buffer>;
}
interface ConnectParams {
host: URL['host'];
hostname: URL['hostname'];
protocol: URL['protocol'];
port: URL['port'];
servername: string | null;
}
type Connector = buildConnector.connector
export interface RequestCreateMessage {
request: Request;
}
export interface RequestBodySentMessage {
request: Request;
}
export interface RequestBodyChunkSentMessage {
request: Request;
chunk: Uint8Array | string;
}
export interface RequestBodyChunkReceivedMessage {
request: Request;
chunk: Buffer;
}
export interface RequestHeadersMessage {
request: Request;
response: Response;
}
export interface RequestTrailersMessage {
request: Request;
trailers: Array<Buffer>;
}
export interface RequestErrorMessage {
request: Request;
error: Error;
}
export interface ClientSendHeadersMessage {
request: Request;
headers: string;
socket: Socket;
}
export interface ClientBeforeConnectMessage {
connectParams: ConnectParams;
connector: Connector;
}
export interface ClientConnectedMessage {
socket: Socket;
connectParams: ConnectParams;
connector: Connector;
}
export interface ClientConnectErrorMessage {
error: Error;
socket: Socket;
connectParams: ConnectParams;
connector: Connector;
}
}

View File

@@ -0,0 +1,18 @@
/**
* @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 RefreshCcw = createLucideIcon("RefreshCcw", [
["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
["path", { d: "M3 3v5h5", key: "1xhq8a" }],
["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
["path", { d: "M16 16h5v5", key: "ccwih5" }]
]);
export { RefreshCcw as default };
//# sourceMappingURL=refresh-ccw.js.map

View File

@@ -0,0 +1,234 @@
import { context, trace, SpanStatusCode } from '@opentelemetry/api';
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
import { isThenable } from '@sentry/core';
import { AttributeNames, HonoTypes } from './constants.js';
const PACKAGE_NAME = '@sentry/instrumentation-hono';
const PACKAGE_VERSION = '0.0.1';
/**
* Hono instrumentation for OpenTelemetry
*/
class HonoInstrumentation extends InstrumentationBase {
constructor(config = {}) {
super(PACKAGE_NAME, PACKAGE_VERSION, config);
}
/**
* Initialize the instrumentation.
*/
init() {
return [
new InstrumentationNodeModuleDefinition('hono', ['>=4.0.0 <5'], moduleExports => this._patch(moduleExports)),
];
}
/**
* Patches the module exports to instrument Hono.
*/
_patch(moduleExports) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const instrumentation = this;
class WrappedHono extends moduleExports.Hono {
constructor(...args) {
super(...args);
instrumentation._wrap(this, 'get', instrumentation._patchHandler());
instrumentation._wrap(this, 'post', instrumentation._patchHandler());
instrumentation._wrap(this, 'put', instrumentation._patchHandler());
instrumentation._wrap(this, 'delete', instrumentation._patchHandler());
instrumentation._wrap(this, 'options', instrumentation._patchHandler());
instrumentation._wrap(this, 'patch', instrumentation._patchHandler());
instrumentation._wrap(this, 'all', instrumentation._patchHandler());
instrumentation._wrap(this, 'on', instrumentation._patchOnHandler());
instrumentation._wrap(this, 'use', instrumentation._patchMiddlewareHandler());
}
}
try {
moduleExports.Hono = WrappedHono;
} catch {
// This is a workaround for environments where direct assignment is not allowed.
return { ...moduleExports, Hono: WrappedHono };
}
return moduleExports;
}
/**
* Patches the route handler to instrument it.
*/
_patchHandler() {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const instrumentation = this;
return function (original) {
return function wrappedHandler( ...args) {
if (typeof args[0] === 'string') {
const path = args[0];
if (args.length === 1) {
return original.apply(this, [path]);
}
const handlers = args.slice(1);
return original.apply(this, [
path,
...handlers.map(handler => instrumentation._wrapHandler(handler )),
]);
}
return original.apply(
this,
args.map(handler => instrumentation._wrapHandler(handler )),
);
};
};
}
/**
* Patches the 'on' handler to instrument it.
*/
_patchOnHandler() {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const instrumentation = this;
return function (original) {
return function wrappedHandler( ...args) {
const handlers = args.slice(2);
return original.apply(this, [
...args.slice(0, 2),
...handlers.map(handler => instrumentation._wrapHandler(handler )),
]);
};
};
}
/**
* Patches the middleware handler to instrument it.
*/
_patchMiddlewareHandler() {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const instrumentation = this;
return function (original) {
return function wrappedHandler( ...args) {
if (typeof args[0] === 'string') {
const path = args[0];
if (args.length === 1) {
return original.apply(this, [path]);
}
const handlers = args.slice(1);
return original.apply(this, [
path,
...handlers.map(handler => instrumentation._wrapHandler(handler )),
]);
}
return original.apply(
this,
args.map(handler => instrumentation._wrapHandler(handler )),
);
};
};
}
/**
* Wraps a handler or middleware handler to apply instrumentation.
*/
_wrapHandler(handler) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const instrumentation = this;
return function ( c, next) {
if (!instrumentation.isEnabled()) {
return handler.apply(this, [c, next]);
}
const path = c.req.path;
const span = instrumentation.tracer.startSpan(path);
return context.with(trace.setSpan(context.active(), span), () => {
return instrumentation._safeExecute(
() => {
const result = handler.apply(this, [c, next]);
if (isThenable(result)) {
return result.then(result => {
const type = instrumentation._determineHandlerType(result);
span.setAttributes({
[AttributeNames.HONO_TYPE]: type,
[AttributeNames.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path : handler.name || 'anonymous',
});
instrumentation.getConfig().responseHook?.(span);
return result;
});
} else {
const type = instrumentation._determineHandlerType(result);
span.setAttributes({
[AttributeNames.HONO_TYPE]: type,
[AttributeNames.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path : handler.name || 'anonymous',
});
instrumentation.getConfig().responseHook?.(span);
return result;
}
},
() => span.end(),
error => {
instrumentation._handleError(span, error);
span.end();
},
);
});
};
}
/**
* Safely executes a function and handles errors.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
_safeExecute(execute, onSuccess, onFailure) {
try {
const result = execute();
if (isThenable(result)) {
result.then(
() => onSuccess(),
(error) => onFailure(error),
);
} else {
onSuccess();
}
return result;
} catch (error) {
onFailure(error);
throw error;
}
}
/**
* Determines the handler type based on the result.
* @param result
* @private
*/
_determineHandlerType(result) {
return result === undefined ? HonoTypes.MIDDLEWARE : HonoTypes.REQUEST_HANDLER;
}
/**
* Handles errors by setting the span status and recording the exception.
*/
_handleError(span, error) {
if (error instanceof Error) {
span.setStatus({
code: SpanStatusCode.ERROR,
message: error.message,
});
span.recordException(error);
}
}
}
export { HonoInstrumentation };
//# sourceMappingURL=instrumentation.js.map

View File

@@ -0,0 +1,44 @@
# License information
## Contribution License Agreement
If you contribute code to this project, you are implicitly allowing your code
to be distributed under the MIT license. You are also implicitly verifying that
all code is your original work. `</legalese>`
## Marked
Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/)
Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
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.
## Markdown
Copyright © 2004, John Gruber
http://daringfireball.net/
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 “Markdown” 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 owner 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,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { differenceInQuarters as fn } from "../differenceInQuarters.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const differenceInQuarters = convertToFP(fn, 2);
// Fallback for modularized imports:
export default differenceInQuarters;

View File

@@ -0,0 +1 @@
{"version":3,"file":"captureRequestBody.d.ts","sourceRoot":"","sources":["../../../src/utils/captureRequestBody.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAK1C;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,eAAe,EACpB,cAAc,EAAE,KAAK,EACrB,0BAA0B,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,EACzD,eAAe,EAAE,MAAM,GACtB,IAAI,CA2GN"}

View File

@@ -0,0 +1,17 @@
import type { TFunction } from '@payloadcms/translations';
import type { LoginWithUsernameOptions, SanitizedFieldPermissions } from 'payload';
import React from 'react';
import './index.scss';
type RenderEmailAndUsernameFieldsProps = {
className?: string;
loginWithUsername?: false | LoginWithUsernameOptions;
operation?: 'create' | 'update';
permissions?: {
[fieldName: string]: SanitizedFieldPermissions;
} | true;
readOnly: boolean;
t: TFunction;
};
export declare function EmailAndUsernameFields(props: RenderEmailAndUsernameFieldsProps): React.JSX.Element;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,97 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Florent Cailhol @ooflorent
*/
"use strict";
const {
compareModulesByPreOrderIndexOrIdentifier
} = require("../util/comparators");
const {
assignDeterministicIds,
getFullModuleName,
getUsedModuleIdsAndModules
} = require("./IdHelpers");
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("../Module")} Module */
/**
* @typedef {object} DeterministicModuleIdsPluginOptions
* @property {string=} context context relative to which module identifiers are computed
* @property {((module: Module) => boolean)=} test selector function for modules
* @property {number=} maxLength maximum id length in digits (used as starting point)
* @property {number=} salt hash salt for ids
* @property {boolean=} fixedLength do not increase the maxLength to find an optimal id space size
* @property {boolean=} failOnConflict throw an error when id conflicts occur (instead of rehashing)
*/
const PLUGIN_NAME = "DeterministicModuleIdsPlugin";
class DeterministicModuleIdsPlugin {
/**
* @param {DeterministicModuleIdsPluginOptions=} options options
*/
constructor(options = {}) {
this.options = options;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
compilation.hooks.moduleIds.tap(PLUGIN_NAME, () => {
const chunkGraph = compilation.chunkGraph;
const context = this.options.context
? this.options.context
: compiler.context;
const maxLength = this.options.maxLength || 3;
const failOnConflict = this.options.failOnConflict || false;
const fixedLength = this.options.fixedLength || false;
const salt = this.options.salt || 0;
let conflicts = 0;
const [usedIds, modules] = getUsedModuleIdsAndModules(
compilation,
this.options.test
);
assignDeterministicIds(
modules,
(module) => getFullModuleName(module, context, compiler.root),
failOnConflict
? () => 0
: compareModulesByPreOrderIndexOrIdentifier(
compilation.moduleGraph
),
(module, id) => {
const size = usedIds.size;
usedIds.add(`${id}`);
if (size === usedIds.size) {
conflicts++;
return false;
}
chunkGraph.setModuleId(module, id);
return true;
},
[10 ** maxLength],
fixedLength ? 0 : 10,
usedIds.size,
salt
);
if (failOnConflict && conflicts) {
throw new Error(
`Assigning deterministic module ids has lead to ${conflicts} conflict${
conflicts > 1 ? "s" : ""
}.\nIncrease the 'maxLength' to increase the id space and make conflicts less likely (recommended when there are many conflicts or application is expected to grow), or add an 'salt' number to try another hash starting value in the same id space (recommended when there is only a single conflict).`
);
}
});
});
}
}
module.exports = DeterministicModuleIdsPlugin;

View File

@@ -0,0 +1 @@
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/tracing/utils.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAE3E;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAS1D;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,IAAI,yBAAyB,CAOvG;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAOpG"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Group/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAA;AAI5D,OAAO,cAAc,CAAA;AAWrB,eAAO,MAAM,KAAK,EAAE,6BAoCnB,CAAA"}

View File

@@ -0,0 +1,5 @@
export declare const getQuarterWithOptions: import("./types.js").FPFn2<
number,
import("../getQuarter.js").GetQuarterOptions | undefined,
string | number | Date
>;

View File

@@ -0,0 +1,3 @@
import type { AuthStrategyFunctionArgs, AuthStrategyResult } from './index.js';
export declare const executeAuthStrategies: (args: AuthStrategyFunctionArgs) => Promise<AuthStrategyResult>;
//# sourceMappingURL=executeAuthStrategies.d.ts.map

View File

@@ -0,0 +1,67 @@
import { type Cache } from "../cache/core/cache.cjs";
import type { WithCacheConfig } from "../cache/core/types.cjs";
import { entityKind } from "../entity.cjs";
import type { TablesRelationalConfig } from "../relations.cjs";
import type { PreparedQuery } from "../session.cjs";
import type { Query, SQL } from "../sql/index.cjs";
import type { NeonAuthToken } from "../utils.cjs";
import { GelDatabase } from "./db.cjs";
import type { GelDialect } from "./dialect.cjs";
import type { SelectedFieldsOrdered } from "./query-builders/select.types.cjs";
export interface PreparedQueryConfig {
execute: unknown;
all: unknown;
values: unknown;
}
export declare abstract class GelPreparedQuery<T extends PreparedQueryConfig> implements PreparedQuery {
protected query: Query;
private cache?;
private queryMetadata?;
private cacheConfig?;
constructor(query: Query, cache?: Cache | undefined, queryMetadata?: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
} | undefined, cacheConfig?: WithCacheConfig | undefined);
protected authToken?: NeonAuthToken;
getQuery(): Query;
mapResult(response: unknown, _isFromBatch?: boolean): unknown;
static readonly [entityKind]: string;
abstract execute(placeholderValues?: Record<string, unknown>): Promise<T['execute']>;
}
export declare abstract class GelSession<TQueryResult extends GelQueryResultHKT = any, // TO
TFullSchema extends Record<string, unknown> = Record<string, never>, TSchema extends TablesRelationalConfig = Record<string, never>> {
protected dialect: GelDialect;
static readonly [entityKind]: string;
constructor(dialect: GelDialect);
abstract prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query, fields: SelectedFieldsOrdered | undefined, name: string | undefined, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => T['execute'], queryMetadata?: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
}, cacheConfig?: WithCacheConfig): GelPreparedQuery<T>;
execute<T>(query: SQL): Promise<T>;
all<T = unknown>(query: SQL): Promise<T[]>;
count(sql: SQL): Promise<number>;
abstract transaction<T>(transaction: (tx: GelTransaction<TQueryResult, TFullSchema, TSchema>) => Promise<T>): Promise<T>;
}
export declare abstract class GelTransaction<TQueryResult extends GelQueryResultHKT, TFullSchema extends Record<string, unknown> = Record<string, never>, TSchema extends TablesRelationalConfig = Record<string, never>> extends GelDatabase<TQueryResult, TFullSchema, TSchema> {
protected schema: {
fullSchema: Record<string, unknown>;
schema: TSchema;
tableNamesMap: Record<string, string>;
} | undefined;
static readonly [entityKind]: string;
constructor(dialect: GelDialect, session: GelSession<any, any, any>, schema: {
fullSchema: Record<string, unknown>;
schema: TSchema;
tableNamesMap: Record<string, string>;
} | undefined);
rollback(): never;
abstract transaction<T>(transaction: (tx: GelTransaction<TQueryResult, TFullSchema, TSchema>) => Promise<T>): Promise<T>;
}
export interface GelQueryResultHKT {
readonly $brand: 'GelQueryResultHKT';
readonly row: unknown;
readonly type: unknown;
}
export type GelQueryResultKind<TKind extends GelQueryResultHKT, TRow> = (TKind & {
readonly row: TRow;
})['type'];

View File

@@ -0,0 +1,9 @@
/**
* Parse a sample rate from a given value.
* This will either return a boolean or number sample rate, if the sample rate is valid (between 0 and 1).
* If a string is passed, we try to convert it to a number.
*
* Any invalid sample rate will return `undefined`.
*/
export declare function parseSampleRate(sampleRate: unknown): number | undefined;
//# sourceMappingURL=parseSampleRate.d.ts.map

View File

@@ -0,0 +1,7 @@
var config = {
paths: {
vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs'
}
};
export { config as default };

View File

@@ -0,0 +1,9 @@
//#region src/rest/utils/get-auth-endpoint.d.ts
/**
* @param provider Use a specific authentication provider
* @returns The endpoint to be used for authentication
*/
declare function getAuthEndpoint(provider?: string): string;
//#endregion
export { getAuthEndpoint };
//# sourceMappingURL=get-auth-endpoint.d.ts.map

View File

@@ -0,0 +1,107 @@
import { withIsolationScope, getCurrentScope, winterCGRequestToRequestData, getActiveSpan, getRootSpan, setCapturedScopesOnSpan, startSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, handleCallbackErrors, captureException } from '@sentry/core';
import { waitUntil, flushSafelyWithTimeout } from './utils/responseEnd.js';
/**
* Wraps Next.js middleware with Sentry error and performance instrumentation.
*
* @param middleware The middleware handler.
* @returns a wrapped middleware handler.
*/
function wrapMiddlewareWithSentry(
middleware,
) {
return new Proxy(middleware, {
apply: async (wrappingTarget, thisArg, args) => {
const tunnelRoute =
'_sentryRewritesTunnelPath' in globalThis
? (globalThis )._sentryRewritesTunnelPath
: undefined;
if (tunnelRoute && typeof tunnelRoute === 'string') {
const req = args[0];
// Check if the current request matches the tunnel route
if (req instanceof Request) {
const url = new URL(req.url);
const isTunnelRequest = url.pathname.startsWith(tunnelRoute);
if (isTunnelRequest) {
// Create a simple response that mimics NextResponse.next() so we don't need to import internals here
// which breaks next 13 apps
// https://github.com/vercel/next.js/blob/c12c9c1f78ad384270902f0890dc4cd341408105/packages/next/src/server/web/spec-extension/response.ts#L146
return new Response(null, {
status: 200,
headers: {
'x-middleware-next': '1',
},
}) ;
}
}
}
// TODO: We still should add central isolation scope creation for when our build-time instrumentation does not work anymore with turbopack.
return withIsolationScope(isolationScope => {
const req = args[0];
const currentScope = getCurrentScope();
let spanName;
let spanSource;
if (req instanceof Request) {
isolationScope.setSDKProcessingMetadata({
normalizedRequest: winterCGRequestToRequestData(req),
});
spanName = `middleware ${req.method}`;
spanSource = 'url';
} else {
spanName = 'middleware';
spanSource = 'component';
}
currentScope.setTransactionName(spanName);
const activeSpan = getActiveSpan();
if (activeSpan) {
// If there is an active span, it likely means that the automatic Next.js OTEL instrumentation worked and we can
// rely on that for parameterization.
spanName = 'middleware';
spanSource = 'component';
const rootSpan = getRootSpan(activeSpan);
if (rootSpan) {
setCapturedScopesOnSpan(rootSpan, currentScope, isolationScope);
}
}
return startSpan(
{
name: spanName,
op: 'http.server.middleware',
attributes: {
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: spanSource,
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.nextjs.wrap_middleware',
},
},
() => {
return handleCallbackErrors(
() => wrappingTarget.apply(thisArg, args),
error => {
captureException(error, {
mechanism: {
type: 'auto.function.nextjs.wrap_middleware',
handled: false,
},
});
},
() => {
waitUntil(flushSafelyWithTimeout());
},
);
},
);
});
},
});
}
export { wrapMiddlewareWithSentry };
//# sourceMappingURL=wrapMiddlewareWithSentry.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/pg-core/checks.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport type { SQL } from '~/sql/index.ts';\nimport type { PgTable } from './table.ts';\n\nexport class CheckBuilder {\n\tstatic readonly [entityKind]: string = 'PgCheckBuilder';\n\n\tprotected brand!: 'PgConstraintBuilder';\n\n\tconstructor(public name: string, public value: SQL) {}\n\n\t/** @internal */\n\tbuild(table: PgTable): Check {\n\t\treturn new Check(table, this);\n\t}\n}\n\nexport class Check {\n\tstatic readonly [entityKind]: string = 'PgCheck';\n\n\treadonly name: string;\n\treadonly value: SQL;\n\n\tconstructor(public table: PgTable, builder: CheckBuilder) {\n\t\tthis.name = builder.name;\n\t\tthis.value = builder.value;\n\t}\n}\n\nexport function check(name: string, value: SQL): CheckBuilder {\n\treturn new CheckBuilder(name, value);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAIpB,MAAM,aAAa;AAAA,EAKzB,YAAmB,MAAqB,OAAY;AAAjC;AAAqB;AAAA,EAAa;AAAA,EAJrD,QAAiB,wBAAU,IAAY;AAAA,EAE7B;AAAA;AAAA,EAKV,MAAM,OAAuB;AAC5B,WAAO,IAAI,MAAM,OAAO,IAAI;AAAA,EAC7B;AACD;AAEO,MAAM,MAAM;AAAA,EAMlB,YAAmB,OAAgB,SAAuB;AAAvC;AAClB,SAAK,OAAO,QAAQ;AACpB,SAAK,QAAQ,QAAQ;AAAA,EACtB;AAAA,EARA,QAAiB,wBAAU,IAAY;AAAA,EAE9B;AAAA,EACA;AAMV;AAEO,SAAS,MAAM,MAAc,OAA0B;AAC7D,SAAO,IAAI,aAAa,MAAM,KAAK;AACpC;","names":[]}

View File

@@ -0,0 +1,22 @@
import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
import { h as hasOwn, E as Emotion, c as createEmotionProps } from '../../dist/emotion-element-d59e098f.esm.js';
import 'react';
import '@emotion/cache';
import '@babel/runtime/helpers/extends';
import '@emotion/weak-memoize';
import '../../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js';
import 'hoist-non-react-statics';
import '@emotion/utils';
import '@emotion/serialize';
import '@emotion/use-insertion-effect-with-fallbacks';
var Fragment = ReactJSXRuntimeDev.Fragment;
var jsxDEV = function jsxDEV(type, props, key, isStaticChildren, source, self) {
if (!hasOwn.call(props, 'css')) {
return ReactJSXRuntimeDev.jsxDEV(type, props, key, isStaticChildren, source, self);
}
return ReactJSXRuntimeDev.jsxDEV(Emotion, createEmotionProps(type, props), key, isStaticChildren, source, self);
};
export { Fragment, jsxDEV };

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 HousePlus = createLucideIcon("HousePlus", [
[
"path",
{
d: "M13.22 2.416a2 2 0 0 0-2.511.057l-7 5.999A2 2 0 0 0 3 10v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7.354",
key: "5phn05"
}
],
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
["path", { d: "M15 6h6", key: "1jlkvy" }],
["path", { d: "M18 3v6", key: "x1uolp" }]
]);
export { HousePlus as default };
//# sourceMappingURL=house-plus.js.map

View File

@@ -0,0 +1,28 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link isTomorrow} function options.
*/
export interface IsTomorrowOptions extends ContextOptions<Date> {}
/**
* @name isTomorrow
* @category Day Helpers
* @summary Is the given date tomorrow?
* @pure false
*
* @description
* Is the given date tomorrow?
*
* @param date - The date to check
* @param options - An object with options
*
* @returns The date is tomorrow
*
* @example
* // If today is 6 October 2014, is 7 October 14:00:00 tomorrow?
* const result = isTomorrow(new Date(2014, 9, 7, 14, 0))
* //=> true
*/
export declare function isTomorrow(
date: DateArg<Date> & {},
options?: IsTomorrowOptions | undefined,
): boolean;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAW,MAAM,cAAc,CAAC;AAuCzD,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,UAAU,CAAC;AAI/D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,WAAW,EAAE,CA0BtD;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,UAAU,GAAG,SAAS,CAElF;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,UAAU,CAEhG;AAuED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CA0BjD"}

View File

@@ -0,0 +1,99 @@
import type Ajv from "ajv"
import type {
Plugin,
CodeKeywordDefinition,
KeywordErrorDefinition,
Code,
Name,
ErrorObject,
} from "ajv"
import type {AddedFormat} from "ajv/dist/types"
import type {Rule} from "ajv/dist/compile/rules"
import {KeywordCxt} from "ajv"
import {_, str, or, getProperty, operators} from "ajv/dist/compile/codegen"
type Kwd = "formatMaximum" | "formatMinimum" | "formatExclusiveMaximum" | "formatExclusiveMinimum"
type Comparison = "<=" | ">=" | "<" | ">"
const ops = operators
const KWDs: {[K in Kwd]: {okStr: Comparison; ok: Code; fail: Code}} = {
formatMaximum: {okStr: "<=", ok: ops.LTE, fail: ops.GT},
formatMinimum: {okStr: ">=", ok: ops.GTE, fail: ops.LT},
formatExclusiveMaximum: {okStr: "<", ok: ops.LT, fail: ops.GTE},
formatExclusiveMinimum: {okStr: ">", ok: ops.GT, fail: ops.LTE},
}
export type LimitFormatError = ErrorObject<Kwd, {limit: string; comparison: Comparison}>
const error: KeywordErrorDefinition = {
message: ({keyword, schemaCode}) => str`should be ${KWDs[keyword as Kwd].okStr} ${schemaCode}`,
params: ({keyword, schemaCode}) =>
_`{comparison: ${KWDs[keyword as Kwd].okStr}, limit: ${schemaCode}}`,
}
export const formatLimitDefinition: CodeKeywordDefinition = {
keyword: Object.keys(KWDs),
type: "string",
schemaType: "string",
$data: true,
error,
code(cxt) {
const {gen, data, schemaCode, keyword, it} = cxt
const {opts, self} = it
if (!opts.validateFormats) return
const fCxt = new KeywordCxt(it, (self.RULES.all.format as Rule).definition, "format")
if (fCxt.$data) validate$DataFormat()
else validateFormat()
function validate$DataFormat(): void {
const fmts = gen.scopeValue("formats", {
ref: self.formats,
code: opts.code.formats,
})
const fmt = gen.const("fmt", _`${fmts}[${fCxt.schemaCode}]`)
cxt.fail$data(
or(
_`typeof ${fmt} != "object"`,
_`${fmt} instanceof RegExp`,
_`typeof ${fmt}.compare != "function"`,
compareCode(fmt)
)
)
}
function validateFormat(): void {
const format = fCxt.schema as string
const fmtDef: AddedFormat | undefined = self.formats[format]
if (!fmtDef || fmtDef === true) return
if (
typeof fmtDef != "object" ||
fmtDef instanceof RegExp ||
typeof fmtDef.compare != "function"
) {
throw new Error(`"${keyword}": format "${format}" does not define "compare" function`)
}
const fmt = gen.scopeValue("formats", {
key: format,
ref: fmtDef,
code: opts.code.formats ? _`${opts.code.formats}${getProperty(format)}` : undefined,
})
cxt.fail$data(compareCode(fmt))
}
function compareCode(fmt: Name): Code {
return _`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword as Kwd].fail} 0`
}
},
dependencies: ["format"],
}
const formatLimitPlugin: Plugin<undefined> = (ajv: Ajv): Ajv => {
ajv.addKeyword(formatLimitDefinition)
return ajv
}
export default formatLimitPlugin

View File

@@ -0,0 +1,33 @@
"use strict";
exports.subMinutes = subMinutes;
var _index = require("./addMinutes.cjs");
/**
* The {@link subMinutes} function options.
*/
/**
* @name subMinutes
* @category Minute Helpers
* @summary Subtract the specified number of minutes from the given date.
*
* @description
* Subtract the specified number of minutes from the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @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 date to be changed
* @param amount - The amount of minutes to be subtracted.
* @param options - An object with options
*
* @returns The new date with the minutes subtracted
*
* @example
* // Subtract 30 minutes from 10 July 2014 12:00:00:
* const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)
* //=> Thu Jul 10 2014 11:30:00
*/
function subMinutes(date, amount, options) {
return (0, _index.addMinutes)(date, -amount, options);
}

View File

@@ -0,0 +1,89 @@
import { Span as WriteableSpan } from '@opentelemetry/api';
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import { ClientOptions, Options, SamplingContext, Scope, Span } from '@sentry/core';
import { NodeTransportOptions, OpenTelemetryServerRuntimeOptions } from '@sentry/node-core';
/**
* Base options for the Sentry Node SDK.
* Extends the common WinterTC options with OpenTelemetry support shared with Bun and other server-side SDKs.
*/
export interface BaseNodeOptions extends OpenTelemetryServerRuntimeOptions {
/**
* Sets profiling sample rate when @sentry/profiling-node is installed
*
* @deprecated
*/
profilesSampleRate?: number;
/**
* Function to compute profiling sample rate dynamically and filter unwanted profiles.
*
* Profiling is enabled if either this or `profilesSampleRate` is defined. If both are defined, `profilesSampleRate` is
* ignored.
*
* Will automatically be passed a context object of default and optional custom data.
*
* @returns A sample rate between 0 and 1 (0 drops the profile, 1 guarantees it will be sent). Returning `true` is
* equivalent to returning 1 and returning `false` is equivalent to returning 0.
*
* @deprecated
*/
profilesSampler?: (samplingContext: SamplingContext) => number | boolean;
/**
* Sets profiling session sample rate for the entire profiling session (evaluated once per SDK initialization).
*
* @default 0
*/
profileSessionSampleRate?: number;
/**
* Set the lifecycle mode of the profiler.
* - **manual**: The profiler will be manually started and stopped via `startProfiler`/`stopProfiler`.
* If a session is sampled, is dependent on the `profileSessionSampleRate`.
* - **trace**: The profiler will be automatically started when a root span exists and stopped when there are no
* more sampled root spans. Whether a session is sampled, is dependent on the `profileSessionSampleRate` and the
* existing sampling configuration for tracing (`tracesSampleRate`/`tracesSampler`).
*
* @default 'manual'
*/
profileLifecycle?: 'manual' | 'trace';
/**
* Include local variables with stack traces.
*
* Requires the `LocalVariables` integration.
*/
includeLocalVariables?: boolean;
/**
* Whether to register ESM loader hooks to automatically instrument libraries.
* This is necessary to auto instrument libraries that are loaded via ESM imports, but it can cause issues
* with certain libraries. If you run into problems running your app with this enabled,
* please raise an issue in https://github.com/getsentry/sentry-javascript.
*
* Defaults to `true`.
*/
registerEsmLoaderHooks?: boolean;
}
/**
* Configuration options for the Sentry Node SDK
* @see @sentry/core Options for more information.
*/
export interface NodeOptions extends Options<NodeTransportOptions>, BaseNodeOptions {
}
/**
* Configuration options for the Sentry Node SDK Client class
* @see NodeClient for more information.
*/
export interface NodeClientOptions extends ClientOptions<NodeTransportOptions>, BaseNodeOptions {
}
export interface CurrentScopes {
scope: Scope;
isolationScope: Scope;
}
/**
* The base `Span` type is basically a `WriteableSpan`.
* There are places where we basically want to allow passing _any_ span,
* so in these cases we type this as `AbstractSpan` which could be either a regular `Span` or a `ReadableSpan`.
* You'll have to make sur to check relevant fields before accessing them.
*
* Note that technically, the `Span` exported from `@opentelemetry/sdk-trace-base` matches this,
* but we cannot be 100% sure that we are actually getting such a span, so this type is more defensive.
*/
export type AbstractSpan = WriteableSpan | ReadableSpan | Span;
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1,64 @@
/**
* The key used to store the local variables on the error object.
*/
const LOCAL_VARIABLES_KEY = '__SENTRY_ERROR_LOCAL_VARIABLES__';
/**
* Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback
* when a timeout has occurred.
* @param maxPerSecond Maximum number of calls per second
* @param enable Callback to enable capture
* @param disable Callback to disable capture
* @returns A function to call to increment the rate limiter count
*/
function createRateLimiter(
maxPerSecond,
enable,
disable,
) {
let count = 0;
let retrySeconds = 5;
let disabledTimeout = 0;
setInterval(() => {
if (disabledTimeout === 0) {
if (count > maxPerSecond) {
retrySeconds *= 2;
disable(retrySeconds);
// Cap at one day
if (retrySeconds > 86400) {
retrySeconds = 86400;
}
disabledTimeout = retrySeconds;
}
} else {
disabledTimeout -= 1;
if (disabledTimeout === 0) {
enable();
}
}
count = 0;
}, 1000).unref();
return () => {
count += 1;
};
}
// Add types for the exception event data
/** Could this be an anonymous function? */
function isAnonymous(name) {
return name !== undefined && (name.length === 0 || name === '?' || name === '<anonymous>');
}
/** Do the function names appear to match? */
function functionNamesMatch(a, b) {
return a === b || `Object.${a}` === b || a === `Object.${b}` || (isAnonymous(a) && isAnonymous(b));
}
export { LOCAL_VARIABLES_KEY, createRateLimiter, functionNamesMatch, isAnonymous };
//# sourceMappingURL=common.js.map

View File

@@ -0,0 +1,11 @@
import { IPropertyListDescriptor } from '../IPropertyDescriptor';
import { LengthPercentage } from '../types/length-percentage';
import { StringValueToken } from '../syntax/tokenizer';
export declare enum BACKGROUND_SIZE {
AUTO = "auto",
CONTAIN = "contain",
COVER = "cover"
}
export declare type BackgroundSizeInfo = LengthPercentage | StringValueToken;
export declare type BackgroundSize = BackgroundSizeInfo[][];
export declare const backgroundSize: IPropertyListDescriptor<BackgroundSize>;

View File

@@ -0,0 +1,51 @@
import { afterEach, beforeEach } from "./test/vitest";
import { addLeadingZeros } from "./addLeadingZeros.js";
import { setDefaultOptions } from "./defaultOptions.js";
import sinon from "./test/sinon";
export function assertType(_value) {}
export function resetDefaultOptions() {
setDefaultOptions({});
}
// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran.
export function generateOffset(originalDate) {
// Add the timezone.
let offset = "";
const tzOffset = originalDate.getTimezoneOffset();
if (tzOffset !== 0) {
const absoluteOffset = Math.abs(tzOffset);
const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);
const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
// If less than 0, the sign is +, because it is ahead of time.
const sign = tzOffset < 0 ? "+" : "-";
offset = `${sign}${hourOffset}:${minuteOffset}`;
} else {
offset = "Z";
}
return offset;
}
export function fakeDate(date) {
let clock;
function fakeNow(date) {
clock?.restore();
clock = sinon.useFakeTimers(+date);
}
beforeEach(() => {
fakeNow(+date);
});
afterEach(() => {
clock?.restore();
clock = undefined;
});
return { fakeNow };
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"recursivelyBuildNestedPaths.d.ts","sourceRoot":"","sources":["../../src/schema/recursivelyBuildNestedPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAO,SAAS,EAAE,MAAM,SAAS,CAAA;AAMjE,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAA;IACrC,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,2BAA2B,4CAA6C,IAAI,QA0ExF,CAAA"}

View File

@@ -0,0 +1,31 @@
var arrayEachRight = require('./_arrayEachRight'),
baseEachRight = require('./_baseEachRight'),
castFunction = require('./_castFunction'),
isArray = require('./isArray');
/**
* This method is like `_.forEach` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @alias eachRight
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @see _.forEach
* @example
*
* _.forEachRight([1, 2], function(value) {
* console.log(value);
* });
* // => Logs `2` then `1`.
*/
function forEachRight(collection, iteratee) {
var func = isArray(collection) ? arrayEachRight : baseEachRight;
return func(collection, castFunction(iteratee));
}
module.exports = forEachRight;

View File

@@ -0,0 +1,96 @@
{
"name": "react-select",
"version": "5.9.0",
"description": "A Select control built with and for ReactJS",
"main": "dist/react-select.cjs.js",
"module": "dist/react-select.esm.js",
"types": "dist/react-select.cjs.d.ts",
"sideEffects": false,
"author": "Jed Watson",
"license": "MIT",
"repository": "https://github.com/JedWatson/react-select/tree/master/packages/react-select",
"dependencies": {
"@babel/runtime": "^7.12.0",
"@emotion/cache": "^11.4.0",
"@emotion/react": "^11.8.1",
"@floating-ui/dom": "^1.0.1",
"@types/react-transition-group": "^4.4.0",
"memoize-one": "^6.0.0",
"prop-types": "^15.6.0",
"react-transition-group": "^4.3.0",
"use-isomorphic-layout-effect": "^1.2.0"
},
"devDependencies": {
"@types/jest-in-case": "^1.0.6",
"enzyme": "^3.8.0",
"enzyme-to-json": "^3.3.0",
"jest-in-case": "^1.0.2",
"react": "^16.13.0",
"react-dom": "^16.13.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"files": [
"dist",
"base",
"animated",
"async",
"creatable",
"async-creatable"
],
"keywords": [
"combobox",
"form",
"input",
"multiselect",
"react",
"react-component",
"select",
"ui"
],
"preconstruct": {
"entrypoints": [
"index.ts",
"base/index.ts",
"animated/index.ts",
"async/index.ts",
"creatable/index.ts",
"async-creatable/index.ts"
]
},
"exports": {
".": {
"module": "./dist/react-select.esm.js",
"import": "./dist/react-select.cjs.mjs",
"default": "./dist/react-select.cjs.js"
},
"./base": {
"module": "./base/dist/react-select-base.esm.js",
"import": "./base/dist/react-select-base.cjs.mjs",
"default": "./base/dist/react-select-base.cjs.js"
},
"./async": {
"module": "./async/dist/react-select-async.esm.js",
"import": "./async/dist/react-select-async.cjs.mjs",
"default": "./async/dist/react-select-async.cjs.js"
},
"./animated": {
"module": "./animated/dist/react-select-animated.esm.js",
"import": "./animated/dist/react-select-animated.cjs.mjs",
"default": "./animated/dist/react-select-animated.cjs.js"
},
"./creatable": {
"module": "./creatable/dist/react-select-creatable.esm.js",
"import": "./creatable/dist/react-select-creatable.cjs.mjs",
"default": "./creatable/dist/react-select-creatable.cjs.js"
},
"./async-creatable": {
"module": "./async-creatable/dist/react-select-async-creatable.esm.js",
"import": "./async-creatable/dist/react-select-async-creatable.cjs.mjs",
"default": "./async-creatable/dist/react-select-async-creatable.cjs.js"
},
"./package.json": "./package.json"
}
}

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