docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped

This commit is contained in:
TanTan committed 2026-11-13 09:27:07 +08:00
1 parent fa9c73363d
commit 2a69b23b47
18210 files changed
+5101211 -16

No files matched your search

@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './octagon-alert.js';
//# sourceMappingURL=alert-octagon.js.map
@@ -0,0 +1,21 @@
/// <reference types="node" />
interface MIMEType {
type: string
subtype: string
parameters: Map<string, string>
essence: string
}
/**
* Parse a string to a {@link MIMEType} object. Returns `failure` if the string
* couldn't be parsed.
* @see https://mimesniff.spec.whatwg.org/#parse-a-mime-type
*/
export function parseMIMEType (input: string): 'failure' | MIMEType
/**
* Convert a MIMEType object to a string.
* @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
*/
export function serializeAMimeType (mimeType: MIMEType): string
@@ -0,0 +1,824 @@
flf2a$ 8 7 20 -1 7
STELLAR by Ron Fritz 8/94
Figlet Release 2.0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
`..@
`..@
`..@
`. @
`. @
@
`..@
@@
`. `.@
`. `.@
@
@
@
@
@
@@
@
`.. `.. @
`...... `....@
`.. `.. @
`.. `.. @
`...... `....@
`.. `.. @
@@
`.. @
`. `.. @
`.. @
`.. @
`..@
`.. `.. @
`.. @
@@
@
`.. `.. @
`.. @
`.. @
`.. @
`.. @
`.. `.. @
@@
`. @
`.. `..@
`.. @
`... @
`.. @
`.. `..@
`. @
@@
`..@
`.@
@
@
@
@
@
@@
`..@
`.. @
`.. @
`.. @
`.. @
`.. @
`..@
@@
`.. @
`.. @
`..@
`..@
`..@
`.. @
`.. @
@@
`.. @
`.. `.. `..@
`. `. `.. @
`.... `.......@
`. `. `.. @
`.. `.. `..@
`.. @
@@
@
`.. @
`.. @
`... `.....@
`.. @
`.. @
@
@@
@
@
@
@
@
@
`..@
`.@@
@
@
@
`.....@
@
@
@
@@
@
@
@
@
@
@
`..@
@@
`..@
`.. @
`.. @
`.. @
`.. @
`.. @
`.. @
@@
@
`.. @
`.. `.. @
`.. `.. @
`.. `..@
`.. `.. @
`... @
@@
@
`.. @
`.. @
`.. @
`.. @
`.. @
`....@
@@
@
`.. `.. @
`. `..@
`.. @
`.. @
`.. @
`........ @
@@
@
`.. `.. @
`.. @
`.. @
`.. @
`..@
`..... @
@@
@
`.. @
` `.. @
`. `.. @
`.. `.. @
`.... `. `..@
`.. @
@@
@
`.. `... @
`.. @
`... @
`.. @
`..@
`... `.. @
@@
@
`.. @
`.. @
`.. @
`. `.. @
`.. `..@
`.. `.. @
@@
@
`..... `..@
`.. @
`.. @
`.. @
`.. @
`.. @
@@
@
`. @
`.. `.. @
`.. `. @
`.. `. @
`.. `..@
`.... @
@@
@
`. `.. @
`.. `..@
`. `.. @
`. `.. @
`.. @
`.. @
@@
@
@
@
@
`..@
@
`..@
@@
@
@
@
@
`..@
@
`..@
`.@@
`..@
`.. @
`.. @
`.. @
`.. @
`.. @
`..@
@@
@
@
`......@
@
`......@
@
@
@@
`.. @
`.. @
`.. @
`..@
`.. @
`.. @
`.. @
@@
`... @
`.. @
`..@
`.. @
`.. @
@
`.. @
@@
@
`... @
`. `.. @
`. `.. `..@
`.. `..` `..@
`.. ``` @
`.. @
@@
`. @
`. .. @
`. `.. @
`.. `.. @
`...... `.. @
`.. `.. @
`.. `..@
@@
`.. `.. @
`. `.. @
`. `..@
`... `. @
`. `..@
`. `.@
`.... `.. @
@@
`.. @
`.. `..@
`.. @
`.. @
`.. @
`.. `..@
`.... @
@@
`..... @
`.. `.. @
`.. `..@
`.. `..@
`.. `..@
`.. `.. @
`..... @
@@
`........@
`.. @
`.. @
`...... @
`.. @
`.. @
`........@
@@
`........@
`.. @
`.. @
`...... @
`.. @
`.. @
`.. @
@@
`.... @
`. `.. @
`.. @
`.. @
`.. `....@
`.. `. @
`..... @
@@
`.. `..@
`.. `..@
`.. `..@
`...... `..@
`.. `..@
`.. `..@
`.. `..@
@@
`..@
`..@
`..@
`..@
`..@
`..@
`..@
@@
`..@
`..@
`..@
`..@
`..@
`. `..@
`.... @
@@
`.. `.. @
`.. `.. @
`.. `.. @
`. `. @
`.. `.. @
`.. `.. @
`.. `..@
@@
`.. @
`.. @
`.. @
`.. @
`.. @
`.. @
`........@
@@
`.. `..@
`. `.. `...@
`.. `.. ` `..@
`.. `.. `..@
`.. `. `..@
`.. `..@
`.. `..@
@@
`... `..@
`. `.. `..@
`.. `.. `..@
`.. `.. `..@
`.. `. `..@
`.. `. ..@
`.. `..@
@@
`.... @
`.. `.. @
`.. `..@
`.. `..@
`.. `..@
`.. `.. @
`.... @
@@
`....... @
`.. `..@
`.. `..@
`....... @
`.. @
`.. @
`.. @
@@
`.... @
`.. `.. @
`.. `..@
`.. `..@
`.. `..@
`.. `. `.. @
`.. .. @
`. @@
`....... @
`.. `.. @
`.. `.. @
`. `.. @
`.. `.. @
`.. `.. @
`.. `..@
@@
`.. .. @
`.. `..@
`.. @
`.. @
`.. @
`.. `..@
`.. .. @
@@
`... `......@
`.. @
`.. @
`.. @
`.. @
`.. @
`.. @
@@
`.. `..@
`.. `..@
`.. `..@
`.. `..@
`.. `..@
`.. `..@
`..... @
@@
`.. `..@
`.. `.. @
`.. `.. @
`.. `.. @
`.. `.. @
`.... @
`.. @
@@
`.. `..@
`.. `..@
`.. `. `..@
`.. `.. `..@
`.. `. `.. `..@
`. `. `....@
`.. `..@
@@
`.. `..@
`.. `.. @
`.. `.. @
`.. @
`.. `.. @
`.. `.. @
`.. `..@
@@
`.. `..@
`.. `.. @
`.. `.. @
`.. @
`.. @
`.. @
`.. @
@@
`....... `..@
`.. @
`.. @
`.. @
`.. @
`.. @
`...........@
@@
`....@
`.. @
`.. @
`.. @
`.. @
`.. @
`....@
@@
`.. @
`.. @
`.. @
`.. @
`.. @
`.. @
`..@
@@
`....@
`..@
`..@
`..@
`..@
`..@
`....@
@@
`.. @
`.. `.. @
`.. `..@
@
@
@
@
@@
@
@
@
@
@
@
@
`.....@@
`..@
`. @
@
@
@
@
@
@@
@
@
`.. @
`.. `.. @
`.. `.. @
`.. `.. @
`.. `...@
@@
`.. @
`.. @
`.. @
`.. `.. @
`.. `..@
`.. `..@
`.. `.. @
@@
@
@
`...@
`.. @
`.. @
`.. @
`...@
@@
`..@
`..@
`..@
`.. `..@
`. `..@
`. `..@
`.. `..@
@@
@
@
`.. @
`. `.. @
`..... `..@
`. @
`.... @
@@
`..@
`. @
`.`. `.@
`.. @
`.. @
`.. @
`.. @
@@
@
@
`.. @
`.. `..@
`.. `..@
`.. `..@
`.. @
`.. @@
@
`.. @
`.. @
`. `. @
`.. `..@
`. `..@
`.. `..@
@@
@
`.@
@
`..@
`..@
`..@
`..@
@@
@
`..@
@
`..@
`..@
`..@
`..@
`... @@
`.. @
`.. @
`.. `..@
`.. `.. @
`.`.. @
`.. `.. @
`.. `..@
@@
`..@
`..@
`..@
`..@
`..@
`..@
`...@
@@
@
@
`... `.. `.. @
`.. `. `..@
`.. `. `..@
`.. `. `..@
`... `. `..@
@@
@
@
`.. `.. @
`.. `..@
`.. `..@
`.. `..@
`... `..@
@@
@
@
`.. @
`.. `.. @
`.. `..@
`.. `.. @
`.. @
@@
@
@
`. `.. @
`. `.. @
`. `..@
`.. `.. @
`.. @
`.. @@
@
@
`.. @
`. `.. @
`. `.. @
`..`.. @
`.. @
`...@@
@
@
`. `...@
`.. @
`.. @
`.. @
`... @
@@
@
@
`.... @
`.. @
`... @
`..@
`.. `..@
@@
`.. @
`.. @
`.`. `.@
`.. @
`.. @
`.. @
`.. @
@@
@
@
`.. `..@
`.. `..@
`.. `..@
`.. `..@
`..`..@
@@
@
@
`.. `..@
`.. `.. @
`.. `.. @
`.`.. @
`.. @
@@
@
@
`.. `...@
`.. . `..@
`.. `. `..@
`. `. `.`..@
`... `...@
@@
@
@
`.. `..@
`. `.. @
`. @
`. `.. @
`.. `..@
@@
@
@
`.. `..@
`.. `.. @
`... @
`.. @
`.. @
`.. @@
@
@
`.... `..@
`.. @
`.. @
`.. @
`........@
@@
`..@
`.. @
`.. @
`... @
`.. @
`.. @
`..@
@@
`.@
`.@
`.@
@
`.@
`.@
`.@
@@
`.. @
`.. @
`.. @
`..@
`.. @
`.. @
`.. @
@@
`.. `. @
`. `..@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@@ -0,0 +1,29 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_hono_base = require("./hono-base.js");
const require_router_reg_exp_router_router = require("./router/reg-exp-router/router.js");
require("./router/reg-exp-router/index.js");
const require_router_smart_router_router = require("./router/smart-router/router.js");
const require_router_trie_router_router = require("./router/trie-router/router.js");
require("./router/trie-router/index.js");
//#region src/hono.ts
/**
* The Hono class extends the functionality of the HonoBase class.
* It sets up routing and allows for custom options to be passed.
*
* @template E - The environment type.
* @template S - The schema type.
* @template BasePath - The base path type.
*/
var Hono = class extends require_hono_base.HonoBase {
/**
* Creates an instance of the Hono class.
*
* @param options - Optional configuration options for the Hono instance.
*/
constructor(options = {}) {
super(options);
this.router = options.router ?? new require_router_smart_router_router.SmartRouter({ routers: [new require_router_reg_exp_router_router.RegExpRouter(), new require_router_trie_router_router.TrieRouter()] });
}
};
//#endregion
exports.Hono = Hono;
@@ -0,0 +1,6 @@
import { ESLintUtils } from '@typescript-eslint/utils';
export type MessageIds = 'unusedPrivateClassMember';
declare const _default: ESLintUtils.RuleModule<"unusedPrivateClassMember", [], import("../../rules").ESLintPluginDocs, ESLintUtils.RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"2":"_I","676":"_K"},C:{"2":"_TK","804":"_5M _JR _BD","1828":"_p"},D:{"2":"J","676":"_7D"},E:{"2":"_e","676":"_DB"},F:{"2":"_T","676":"_a"},G:{"2":"_M"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"804":"_C"}},B:7,C:"CSS font-smooth",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"file-scan.js","sources":["../../../src/icons/file-scan.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileScan\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgMTBWN2wtNS01SDZhMiAyIDAgMCAwLTIgMnYxNmEyIDIgMCAwIDAgMiAyaDQiIC8+CiAgPHBhdGggZD0iTTE0IDJ2NGEyIDIgMCAwIDAgMiAyaDQiIC8+CiAgPHBhdGggZD0iTTE2IDE0YTIgMiAwIDAgMC0yIDIiIC8+CiAgPHBhdGggZD0iTTIwIDE0YTIgMiAwIDAgMSAyIDIiIC8+CiAgPHBhdGggZD0iTTIwIDIyYTIgMiAwIDAgMCAyLTIiIC8+CiAgPHBhdGggZD0iTTE2IDIyYTIgMiAwIDAgMS0yLTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/file-scan\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 FileScan = createLucideIcon('FileScan', [\n ['path', { d: 'M20 10V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h4', key: '1rdf37' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['path', { d: 'M16 14a2 2 0 0 0-2 2', key: 'ceaadl' }],\n ['path', { d: 'M20 14a2 2 0 0 1 2 2', key: '1ny6zw' }],\n ['path', { d: 'M20 22a2 2 0 0 0 2-2', key: '1l9q4k' }],\n ['path', { d: 'M16 22a2 2 0 0 1-2-2', key: '1wqh5n' }],\n]);\n\nexport default FileScan;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACjF,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,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwB,CAAA,CAAA,CAAA,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,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwB,CAAA,CAAA,CAAA,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,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwB,CAAA,CAAA,CAAA,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,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwB,CAAA,CAAA,CAAA,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;AACvD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,113 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleScroll = exports.locationCouldBeScrolled = void 0;
var alwaysContainsScroll = function (node) {
// textarea will always _contain_ scroll inside self. It only can be hidden
return node.tagName === 'TEXTAREA';
};
var elementCanBeScrolled = function (node, overflow) {
if (!(node instanceof Element)) {
return false;
}
var styles = window.getComputedStyle(node);
return (
// not-not-scrollable
styles[overflow] !== 'hidden' &&
// contains scroll inside self
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
};
var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
var locationCouldBeScrolled = function (axis, node) {
var ownerDocument = node.ownerDocument;
var current = node;
do {
// Skip over shadow root
if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
current = current.host;
}
var isScrollable = elementCouldBeScrolled(axis, current);
if (isScrollable) {
var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
if (scrollHeight > clientHeight) {
return true;
}
}
current = current.parentNode;
} while (current && current !== ownerDocument.body);
return false;
};
exports.locationCouldBeScrolled = locationCouldBeScrolled;
var getVScrollVariables = function (_a) {
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
return [
scrollTop,
scrollHeight,
clientHeight,
];
};
var getHScrollVariables = function (_a) {
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
return [
scrollLeft,
scrollWidth,
clientWidth,
];
};
var elementCouldBeScrolled = function (axis, node) {
return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
};
var getScrollVariables = function (axis, node) {
return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
};
var getDirectionFactor = function (axis, direction) {
/**
* If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
* and then increasingly negative as you scroll towards the end of the content.
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
*/
return axis === 'h' && direction === 'rtl' ? -1 : 1;
};
var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
var delta = directionFactor * sourceDelta;
// find scrollable target
var target = event.target;
var targetInLock = endTarget.contains(target);
var shouldCancelScroll = false;
var isDeltaPositive = delta > 0;
var availableScroll = 0;
var availableScrollTop = 0;
do {
if (!target) {
break;
}
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
var elementScroll = scroll_1 - capacity - directionFactor * position;
if (position || elementScroll) {
if (elementCouldBeScrolled(axis, target)) {
availableScroll += elementScroll;
availableScrollTop += position;
}
}
var parent_1 = target.parentNode;
// we will "bubble" from ShadowDom in case we are, or just to the parent in normal case
// this is the same logic used in focus-lock
target = (parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1);
} while (
// portaled content
(!targetInLock && target !== document.body) ||
// self content
(targetInLock && (endTarget.contains(target) || endTarget === target)));
// handle epsilon around 0 (non standard zoom levels)
if (isDeltaPositive &&
((noOverscroll && Math.abs(availableScroll) < 1) || (!noOverscroll && delta > availableScroll))) {
shouldCancelScroll = true;
}
else if (!isDeltaPositive &&
((noOverscroll && Math.abs(availableScrollTop) < 1) || (!noOverscroll && -delta > availableScrollTop))) {
shouldCancelScroll = true;
}
return shouldCancelScroll;
};
exports.handleScroll = handleScroll;
@@ -0,0 +1,3 @@
import {expect} from './index.js';
globalThis.expect = expect;
@@ -0,0 +1,18 @@
#!/usr/bin/env node
var spawn = require('child_process').spawn
var path = require('path')
var prog = path.resolve(process.argv[2])
var progArgs = process.argv.slice(3)
console.log('probing program', prog)
var nodeArgs = [
'-r',
path.join(__dirname, 'include.js')
]
var nodeOpts = { stdio: 'inherit' }
var child = spawn('node', nodeArgs.concat(prog).concat(progArgs), nodeOpts)
console.log('kill -SIGUSR1', child.pid, 'for logging')
@@ -0,0 +1,625 @@
flf2a$ 6 5 11 0 12
This font is (c) Michel Eftimakis 1995 -- Version 1.0 -- 11 may 1995
____________________________________________________________ /`____
| Michel Eftimakis | "Ascii-Artist" '\/ |
| Michel.Eftimakis@vlsi.com | Boo)- (00) ||
| | (_`'_) ||
|___________________________________|____ FRANCE ___________ _!!_ ____||
|_____________________________________________________________________|
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$$@
$$@
$$@
$$@
$$@
$$@@
_ @
( )@
|_|@
_ @
/_\@
@@
@
()()@
$ @
$ @
$ @
@@
@
_ _ @
_| |_| |_@
( ) ( ) @
-/_|-|_\-@
@@
_ @
( ) @
/ __|@
\_ \@
(___/@
|_| @@
_ _ @
(_)/ )@
/ / @
( /_ @
/_/(_)@
@@
__ @
( o) @
)( @
/ o`')@
\__/\\@
@@
__@
/_/@
$ @
$ @
$ @
@@
_ @
/ )@
| |$@
( )$@
| \$@
\_\@@
_ @
( \ @
$| |@
$( )@
$/ |@
/_/ @@
. . @
_\`'/_@
)_ _(@
/'`\ @
@
@@
@
_ @
_| |_ @
(_ _)@
/_\ @
@@
@
@
@
_ @
(_)@
/' @@
@
@
___ @
(___)@
@
@@
@
@
@
_ @
(_)@
@@
_ @
/ )@
/ / @
( / @
/_/ @
@@
@
_ @
/ \ @
( 0 )@
\_/ @
@@
@
__ @
/_ |@
$( )@
$/_\@
@@
@
__ @
|_ | @
/(_ @
/___\@
@@
@
___@
|_ /@
__))@
\__/@
@@
@
. @
/| @
/o) @
/___\@
@@
@
___@
| _/@
) \@
/__/@
@@
@
_ @
// @
(o \@
\__/@
@@
@
____@
|_ /@
)) @
/_\ @
@@
@
__ @
(o )@
/o \@
\__/@
@@
@
__ @
/o \@
\_ )@
/_/@
@@
@
@
_ @
(_)@
(_)@
@@
@
@
_ @
(_)@
(_)@
/' @@
_ @
/ )@
/ /$@
( \$@
\_\@
@@
@
@
____ @
(____)@
(____)@
@@
_ @
( \ @
$\ \@
$/ )@
/_/ @
@@
___ @
(_, )@
// @
(_) @
$_ @
(_) @@
@
__ @
/_ \ @
((O)_)@
$\___/@
@@
__ @
( ) @
/o \ @
( __ )@
/_\/_\@
@@
___ @
( o ) @
| \ @
( O )@
/___/ @
@@
___ @
( _)@
| | @
( )_ @
/___\@
@@
__ @
( ) @
| \ @
( O )@
/___/ @
@@
____ @
( __)@
| |_ @
( _) @
/____\@
@@
____ @
( __)@
| |_ @
( __) @
/_\ @
@@
____ @
( __)@
| | _ @
( )_))@
/____\@
@@
_ _ @
( )( )@
| L| |@
( __ )@
/_\/_\@
@@
_ @
( )@
| |@
( )@
/_\@
@@
_ @
( )@
_ | |@
((_( )@
\__/ @
@@
_ @
( ) __@
| |/ /@
( _ ( @
/_\\_|@
@@
_ @
( ) @
| | @
( )_ @
/___\@
@@
_ _ @
( `-' )@
| \_/ |@
( ) ( )@
/_\ /_\@
@@
_ _ @
( \ ( )@
| \\| |@
( )\\ )@
/_\ \_\@
@@
__ @
( ) @
/ \ @
( O )@
\__/ @
@@
___ @
( ) @
| O |@
( __/ @
/_\ @
@@
__ @
( ) @
/ \ @
( O )@
\__\\@
~@@
___ @
( ) @
| O |@
( _ ( @
/_\\_|@
@@
___ @
/ _) @
\_"-. @
__) )@
/___/ @
@@
_____ @
(_ _)@
| | @
( ) @
/_\ @
@@
_ _ @
( )( )@
| || |@
( L| )@
/____\@
@@
_ _ @
( )( )@
| || |@
( \/ )@
\__/ @
@@
_ _ @
( ) ( )@
| |__| |@
( ' ` )@
\_/\_/ @
@@
_ _ @
( \/ )@
\ / @
( ) @
/_/\_\@
@@
_ _ @
( \_/ )@
\ / @
( ) @
|_| @
@@
___ @
(__ )@
// @
((_ @
/___\@
@@
___ @
( __)@
| |$ @
( )$ @
| \_ @
|___|@@
_ @
( \ @
\ \ @
\ ) @
\_\@
@@
___ @
(__ )@
$| |@
$( )@
_/ |@
|___|@@
___ @
,;`;;;,@
;; o o|@
(; _" |@
|\__/ @
@@
@
@
@
@
____ @
|____|@@
__ @
\_\@
$ @
$ @
$ @
@@
@
@
___ @
( o )@
/_^_\@
@@
_ @
( ) @
| |_ @
( o \@
/___/@
@@
@
@
__@
/ /@
\_\@
@@
_ @
( )@
_| |@
/ o )@
\___\@
@@
@
@
___ @
( o_)@
\( @
@@
_ @
,'_)@
| | @
( _)@
/_\ @
@@
@
@
__ @
/o )@
\__\@
_|/@@
_ @
( ) @
| |_ @
( _ )@
/_\||@
@@
_ @
(_)@
_ @
( )@
/_\@
@@
_ @
(_)@
_ @
( )@
| |@
/_/@@
_ @
( ) @
| | _ @
( _'( @
/_\\_|@
@@
_ @
( )@
| |@
( )@
/_\@
@@
@
@
__ __ @
( _`'_ )@
/_\`'/_\@
@@
@
@
____ @
( __ )@
/_\/_\@
@@
@
@
___ @
( o )@
\_/ @
@@
@
@
___ @
( o \@
/ __/@
|_| @@
@
@
___ @
/ o )@
\__ \@
|_|@@
@
@
__ @
( _)@
/_\$@
@@
@
@
__ @
(_' @
/__)@
@@
_ @
( ) @
| | @
( _)@
/_\ @
@@
@
@
_ _ @
( U )@
/___\@
@@
@
@
_ _ @
( V )@
\_/ @
@@
@
@
_ _ _ @
( V V )@
\_^_/ @
@@
@
@
__ __@
\ V /@
/_^_\@
@@
@
@
_ _ @
( V )@
) / @
/_/ @@
@
@
__ @
(_ ) @
/__\@
@@
_ @
/ )@
_) )@
(_ ( @
) )@
\_\@@
_ @
( )@
| |@
( )@
| \@
|_|@@
_ @
( \ @
( (_ @
) _)@
( ( @
/_/ @@
__ __ @
(_(\)_)@
$$ @
$$ @
$$ @
@@
()() @
( ) @
/o \ @
( __ )@
/_\/_\@
@@
()() @
( ) @
/ \ @
( O )@
\__/ @
@@
()() @
( )( )@
| || |@
( L| )@
/____\@
@@
@
O O @
___ @
( o )@
/_^_\@
@@
@
O O @
___ @
( o )@
\_/ @
@@
@
O O @
_ _ @
( U )@
/___\@
@@
___ @
( o ) @
| \ @
( O )@
/ _/ @
|_| @@
@@ -0,0 +1,9 @@
import SemVer = require("../classes/semver");
import semver = require("../index");
/**
* v1 != v2 The opposite of eq.
*/
declare function neq(v1: string | SemVer, v2: string | SemVer, optionsOrLoose?: boolean | semver.Options): boolean;
export = neq;
@@ -0,0 +1,45 @@
/**
* The utility consumer functions provide common options for consuming
* streams.
* @since v16.7.0
*/
declare module "stream/consumers" {
import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer";
import { ReadableStream as WebReadableStream } from "node:stream/web";
/**
* @since v16.7.0
* @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream.
*/
function arrayBuffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<ArrayBuffer>;
/**
* @since v16.7.0
* @returns Fulfills with a `Blob` containing the full contents of the stream.
*/
function blob(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<NodeBlob>;
/**
* @since v16.7.0
* @returns Fulfills with a `Buffer` containing the full contents of the stream.
*/
function buffer(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<NonSharedBuffer>;
/**
* @since v24.14.0
* @returns Fulfills with a `Uint8Array` containing the full contents of the stream.
*/
function bytes(
stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>,
): Promise<NodeJS.NonSharedUint8Array>;
/**
* @since v16.7.0
* @returns Fulfills with the contents of the stream parsed as a
* UTF-8 encoded string that is then passed through `JSON.parse()`.
*/
function json(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<unknown>;
/**
* @since v16.7.0
* @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string.
*/
function text(stream: WebReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<string>;
}
declare module "node:stream/consumers" {
export * from "stream/consumers";
}
@@ -0,0 +1 @@
{"version":3,"file":"mails.js","sources":["../../../src/icons/mails.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Mails\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTYiIGhlaWdodD0iMTMiIHg9IjYiIHk9IjQiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Im0yMiA3LTcuMSAzLjc4Yy0uNTcuMy0xLjIzLjMtMS44IDBMNiA3IiAvPgogIDxwYXRoIGQ9Ik0yIDh2MTFjMCAxLjEuOSAyIDIgMmgxNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/mails\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 Mails = createLucideIcon('Mails', [\n ['rect', { width: '16', height: '13', x: '6', y: '4', rx: '2', key: '1drq3f' }],\n ['path', { d: 'm22 7-7.1 3.78c-.57.3-1.23.3-1.8 0L6 7', key: 'xn252p' }],\n ['path', { d: 'M2 8v11c0 1.1.9 2 2 2h14', key: 'n13cji' }],\n]);\n\nexport default Mails;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC3D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,128 @@
'use strict';
var types = require('../../types.cjs');
var index = require('../../scoring/index.cjs');
/*
*-------------------------------------------------------------------------------
* repeats (aaa, abcabcabc) ------------------------------
*-------------------------------------------------------------------------------
*/
class MatchRepeat extends types.MatcherBaseClass {
constructor(options) {
super(options);
this.scoring = new index(options);
}
// eslint-disable-next-line max-statements
match({
password,
omniMatch
}) {
const matches = [];
let lastIndex = 0;
while (lastIndex < password.length) {
const greedyMatch = this.getGreedyMatch(password, lastIndex);
const lazyMatch = this.getLazyMatch(password, lastIndex);
if (greedyMatch == null) {
break;
}
const {
match,
baseToken
} = this.setMatchToken(greedyMatch, lazyMatch);
if (match) {
const j = match.index + match[0].length - 1;
const baseGuesses = this.getBaseGuesses(baseToken, omniMatch);
matches.push(this.normalizeMatch(baseToken, j, match, baseGuesses));
lastIndex = j + 1;
}
}
const hasPromises = matches.some(match => {
return match instanceof Promise;
});
if (hasPromises) {
// eslint-disable-next-line @typescript-eslint/await-thenable
return Promise.all(matches);
}
return matches;
}
// eslint-disable-next-line max-params
normalizeMatch(baseToken, j, match, baseGuesses) {
const baseMatch = {
pattern: 'repeat',
i: match.index,
j,
token: match[0],
baseToken,
baseGuesses: 0,
repeatCount: match[0].length / baseToken.length
};
if (baseGuesses instanceof Promise) {
return baseGuesses.then(resolvedBaseGuesses => {
return {
...baseMatch,
baseGuesses: resolvedBaseGuesses
};
});
}
return {
...baseMatch,
baseGuesses
};
}
getGreedyMatch(password, lastIndex) {
const greedy = /(.+)\1+/g;
greedy.lastIndex = lastIndex;
return greedy.exec(password);
}
getLazyMatch(password, lastIndex) {
const lazy = /(.+?)\1+/g;
lazy.lastIndex = lastIndex;
return lazy.exec(password);
}
setMatchToken(greedyMatch, lazyMatch) {
const lazyAnchored = /^(.+?)\1+$/;
let match;
let baseToken = '';
if (lazyMatch && greedyMatch[0].length > lazyMatch[0].length) {
// greedy beats lazy for 'aabaab'
// greedy: [aabaab, aab]
// lazy: [aa, a]
match = greedyMatch;
// greedy's repeated string might itself be repeated, eg.
// aabaab in aabaabaabaab.
// run an anchored lazy match on greedy's repeated string
// to find the shortest repeated string
const temp = lazyAnchored.exec(match[0]);
if (temp) {
baseToken = temp[1];
}
} else {
// lazy beats greedy for 'aaaaa'
// greedy: [aaaa, aa]
// lazy: [aaaaa, a]
match = lazyMatch;
if (match) {
baseToken = match[1];
}
}
return {
match,
baseToken
};
}
getBaseGuesses(baseToken, omniMatch) {
const matches = omniMatch.match(baseToken);
if (matches instanceof Promise) {
return matches.then(resolvedMatches => {
const baseAnalysis = this.scoring.mostGuessableMatchSequence(baseToken, resolvedMatches);
return baseAnalysis.guesses;
});
}
const baseAnalysis = this.scoring.mostGuessableMatchSequence(baseToken, matches);
return baseAnalysis.guesses;
}
}
module.exports = MatchRepeat;
//# sourceMappingURL=matching.cjs.map
@@ -0,0 +1 @@
"use strict";var f=Object.defineProperty;var r=(e,n)=>f(e,"name",{value:n,configurable:!0});var p=require("node:net"),u=require("./get-pipe-path-BoR10qr8.cjs");const g=r(()=>new Promise(e=>{const n=u.getPipePath(process.ppid),t=p.createConnection(n,()=>{e(r(a=>{const o=Buffer.from(JSON.stringify(a)),c=Buffer.alloc(4);c.writeInt32BE(o.length,0),t.write(Buffer.concat([c,o]))},"sendToParent"))});t.on("error",()=>{e()}),t.unref()}),"connectToServer"),s={send:void 0},i=g();i.then(e=>{s.send=e},()=>{}),exports.connectingToServer=i,exports.parent=s;
@@ -0,0 +1 @@
{"version":3,"file":"clipboard-check.js","sources":["../../../src/icons/clipboard-check.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ClipboardCheck\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI0IiB4PSI4IiB5PSIyIiByeD0iMSIgcnk9IjEiIC8+CiAgPHBhdGggZD0iTTE2IDRoMmEyIDIgMCAwIDEgMiAydjE0YTIgMiAwIDAgMS0yIDJINmEyIDIgMCAwIDEtMi0yVjZhMiAyIDAgMCAxIDItMmgyIiAvPgogIDxwYXRoIGQ9Im05IDE0IDIgMiA0LTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/clipboard-check\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 ClipboardCheck = createLucideIcon('ClipboardCheck', [\n ['rect', { width: '8', height: '4', x: '8', y: '2', rx: '1', ry: '1', key: 'tgr4d6' }],\n [\n 'path',\n {\n d: 'M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2',\n key: '116196',\n },\n ],\n ['path', { d: 'm9 14 2 2 4-4', key: 'df797q' }],\n]);\n\nexport default ClipboardCheck;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,KAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,EAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,KAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAA,EAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAU,CAAA,CAAA;AAAA,CACrF,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"_b"},B:{"1":"_J"},C:{"1":"_QI","2":"_g","132":"_Y _YU"},D:{"1":"_Q"},E:{"1":"_DB","2":"_e"},F:{"1":"_a","2":"_T"},G:{"1":"_eB","2":"lC"},H:{"2":"1D"},I:{"1":"_SB","2":"_m"},J:{"1":"_B"},K:{"1":"_CB","2":"A"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:6,C:"MP3 audio format",D:true};
@@ -0,0 +1,48 @@
// @ts-check
const req = require('./req.js')
/**
* Load Options
*
* @private
* @method options
*
* @param {Object} config PostCSS Config
*
* @return {Promise<Object>} options PostCSS Options
*/
async function options(config, file) {
if (config.parser && typeof config.parser === 'string') {
try {
config.parser = await req(config.parser, file)
} catch (err) {
throw new Error(
`Loading PostCSS Parser failed: ${err.message}\n\n(@${file})`
)
}
}
if (config.syntax && typeof config.syntax === 'string') {
try {
config.syntax = await req(config.syntax, file)
} catch (err) {
throw new Error(
`Loading PostCSS Syntax failed: ${err.message}\n\n(@${file})`
)
}
}
if (config.stringifier && typeof config.stringifier === 'string') {
try {
config.stringifier = await req(config.stringifier, file)
} catch (err) {
throw new Error(
`Loading PostCSS Stringifier failed: ${err.message}\n\n(@${file})`
)
}
}
return config
}
module.exports = options
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
(function(a,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],i):(a=typeof globalThis<"u"?globalThis:a||self,i(a.LucideReact={},a.react))})(this,function(a,i){"use strict";const Em=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wm=(...n)=>n.filter((y,Ta,Ua)=>!!y&&y.trim()!==""&&Ua.indexOf(y)===Ta).join(" ").trim();var Xm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const sm=i.forwardRef(({color:n="currentColor",size:y=24,strokeWidth:Ta=2,absoluteStrokeWidth:Ua,className:Gm="",children:Oa,iconNode:Km,...Jm},Qm)=>i.createElement("svg",{ref:Qm,...Xm,width:y,height:y,stroke:n,strokeWidth:Ua?Number(Ta)*24/Number(y):Ta,className:Wm("lucide",Gm),...Jm},[...Km.map(([Ym,_m])=>i.createElement(Ym,_m)),...Array.isArray(Oa)?Oa:[Oa]])),e=(n,y)=>{const Ta=i.forwardRef(({className:Ua,...Gm},Oa)=>i.createElement(sm,{ref:Oa,iconNode:y,className:Wm(`lucide-${Em(n)}`,Ua),...Gm}));return Ta.displayName=`${n}`,Ta},Za=e("AArrowDown",[["path",{d:"M3.5 13h6",key:"p1my2r"}],["path",{d:"m2 16 4.5-9 4.5 9",key:"ndf0b3"}],["path",{d:"M18 7v9",key:"pknjwm"}],["path",{d:"m14 12 4 4 4-4",key:"buelq4"}]]),Ga=e("AArrowUp",[["path",{d:"M3.5 13h6",key:"p1my2r"}],["path",{d:"m2 16 4.5-9 4.5 9",key:"ndf0b3"}],["path",{d:"M18 16V7",key:"ty0viw"}],["path",{d:"m14 11 4-4 4 4",key:"1pu57t"}]]),Wa=e("ALargeSmall",[["path",{d:"M21 14h-5",key:"1vh23k"}],["path",{d:"M16 16v-3.5a2.5 2.5 0 0 1 5 0V16",key:"1wh10o"}],["path",{d:"M4.5 13h6",key:"dfilno"}],["path",{d:"m3 16 4.5-9 4.5 9",key:"2dxa0e"}]]),sa=e("Accessibility",[["circle",{cx:"16",cy:"4",r:"1",key:"1grugj"}],["path",{d:"m18 19 1-7-6 1",key:"r0i19z"}],["path",{d:"m5 8 3-3 5.5 3-2.36 3.5",key:"9ptxx2"}],["path",{d:"M4.24 14.5a5 5 0 0 0 6.88 6",key:"10kmtu"}],["path",{d:"M13.76 17.5a5 5 0 0 0-6.88-6",key:"2qq6rc"}]]),Ea=e("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),Xa=e("AirVent",[["path",{d:"M6 12H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"larmp2"}],["path",{d:"M6 8h12",key:"6g4wlu"}],["path",{d:"M18.3 17.7a2.5 2.5 0 0 1-3.16 3.83 2.53 2.53 0 0 1-1.14-2V12",key:"1bo8pg"}],["path",{d:"M6.6 15.6A2 2 0 1 0 10 17v-5",key:"t9h90c"}]]),Na=e("Airplay",[["path",{d:"M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",key:"ns4c3b"}],["path",{d:"m12 15 5 6H7Z",key:"14qnn2"}]]),t=e("AlarmClockCheck",[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}],["path",{d:"m9 13 2 2 4-4",key:"6343dt"}]]),k=e("AlarmClockMinus",[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}],["path",{d:"M9 13h6",key:"1uhe8q"}]]),Ka=e("AlarmClockOff",[["path",{d:"M6.87 6.87a8 8 0 1 0 11.26 11.26",key:"3on8tj"}],["path",{d:"M19.9 14.25a8 8 0 0 0-9.15-9.15",key:"15ghsc"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.26 18.67 4 21",key:"yzmioq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M4 4 2 6",key:"1ycko6"}]]),l=e("AlarmClockPlus",[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}]]),Ja=e("AlarmClock",[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M12 9v4l2 2",key:"1c63tq"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}]]),Qa=e("AlarmSmoke",[["path",{d:"M11 21c0-2.5 2-2.5 2-5",key:"1sicvv"}],["path",{d:"M16 21c0-2.5 2-2.5 2-5",key:"1o3eny"}],["path",{d:"m19 8-.8 3a1.25 1.25 0 0 1-1.2 1H7a1.25 1.25 0 0 1-1.2-1L5 8",key:"1bvca4"}],["path",{d:"M21 3a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a1 1 0 0 1 1-1z",key:"x3qr1j"}],["path",{d:"M6 21c0-2.5 2-2.5 2-5",key:"i3w1gp"}]]),Ya=e("Album",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["polyline",{points:"11 3 11 11 14 8 17 11 17 3",key:"1wcwz3"}]]),_a=e("AlignCenterHorizontal",[["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4",key:"11f1s0"}],["path",{d:"M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4",key:"t14dx9"}],["path",{d:"M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1",key:"1w07xs"}],["path",{d:"M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1",key:"1apec2"}]]),xa=e("AlignCenterVertical",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"M8Line truncated
//# sourceMappingURL=lucide-react.min.js.map
@@ -0,0 +1,42 @@
'use strict';
module.exports = function generate_allOf(it, $keyword, $ruleType) {
var out = ' ';
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $it = it.util.copy(it);
var $closingBraces = '';
$it.level++;
var $nextValid = 'valid' + $it.level;
var $currentBaseId = $it.baseId,
$allSchemasEmpty = true;
var arr1 = $schema;
if (arr1) {
var $sch, $i = -1,
l1 = arr1.length - 1;
while ($i < l1) {
$sch = arr1[$i += 1];
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
$allSchemasEmpty = false;
$it.schema = $sch;
$it.schemaPath = $schemaPath + '[' + $i + ']';
$it.errSchemaPath = $errSchemaPath + '/' + $i;
out += ' ' + (it.validate($it)) + ' ';
$it.baseId = $currentBaseId;
if ($breakOnError) {
out += ' if (' + ($nextValid) + ') { ';
$closingBraces += '}';
}
}
}
}
if ($breakOnError) {
if ($allSchemasEmpty) {
out += ' if (true) { ';
} else {
out += ' ' + ($closingBraces.slice(0, -1)) + ' ';
}
}
return out;
}
@@ -0,0 +1,527 @@
flf2a$ 5 4 99 0 16
_____ _____ ____ ___ _____ _____
/ ___>/ __ \/ _/ /___\/ __\/ __\
|___ || __|| |---| || __|| __|
<_____/\__/ \_____/\___/\__/ \__/
#-> spliff : by nathan bloomfield (xzovik@gmail.com)
#-> based on the letters a,i,j,m,n,r,u, seen on the web, by E.DUB
#->
#-> History:
#-> 5-3-2008 : version 1.1
#-> Added umlauts (to make the file valid) and small letters ~Markus Gebhard
#-> 5-10-2007 : version 1.0
#->
#-> You are free to make changes- just note them in the history.
#->
#-> (end comments)
$$@
$$@
$$@
$$@
$$@@
___ @
/ \@
\___/@
<___>@
@@
_ _ @
| | | @
\_|_/ @
@
@@
_ _ @
_| |_|_ @
|_|_|___|@
|___| |_|@
|_|_| @@
_/_/@
/ __>@
\__ \@
<___/@
/_/ @@
_ __ @
<_>/ / @
/ /_ @
/_/<_>@
@@
___ @
< _ > @
/ _ \/@
\__\ \@
/@@
_ @
< >@
|/ @
@
@@
___@
/ /@
| | @
\__\@
@@
___ @
\ \@
| |@
/__/@
@@
__A__@
\ /@
/_ _\@
V @
@@
_ @
_| |_ @
|_ _|@
|_| @
@@
@
@
_ @
< >@
|/ @@
@
___ @
<___>@
@
@@
@
@
_ @
<_>@
@@
___@
/ /@
/ / @
/__/ @
@@
_____ @
/ _ \@
| | |@
\_____/@
@@
___ @
/ | @
| | @
<____>@
@@
_____ @
<___ \@
/ __/@
<_____|@
@@
_____ @
/ _ \@
>-<_ <@
\_____/@
@@
__ __ @
/ | \@
\_ |@
\___/@
@@
_____ @
| ___|@
|___ \@
<_____/@
@@
____ @
/ __| @
| _ \@
\_____/@
@@
_____ @
<__ \@
/ /@
<___/ @
@@
_____ @
/ _ \@
> _ <@
\_____/@
@@
_____ @
/ _ \@
\___ |@
|_____/@
@@
_ @
<_>@
_ @
<_>@
@@
_ @
<_>@
_ @
< >@
|/ @@
___@
/ /@
< < @
\__\@
@@
@
___ @
<___> @
<___> @
@@
___ @
\ \ @
> >@
/__/ @
@@
_____ @
<___ \@
|__ /@
<___> @
@@
_____ @
/ __ \@
| |___|@
\_____/@
@@
_____ @
/ _ \@
| _ |@
\__|__/@
@@
_____ @
/ _ \@
| _ <@
\_____/@
@@
_____ @
/ \@
| |--|@
\_____/@
@@
_____ @
| _ \@
| | |@
|_____/@
@@
_____ @
/ __\@
| __|@
\_____/@
@@
_____ @
/ __\@
| __|@
\__/ @
@@
_____ @
/ __\@
| |_ |@
\_____/@
@@
__ __ @
/ | \@
| _ |@
\__|__/@
@@
___ @
/___\@
| |@
\___/@
@@
____ @
\_ \@
---| |@
\_____/@
@@
__ ___@
| | /@
| _ < @
|__|__\@
@@
____ @
/ _/ @
| |---@
\_____/@
@@
__ __ @
/ \/ \@
| \/ |@
\__ \__/@
@@
_____ @
/ _ \@
| | |@
\__|__/@
@@
_____ @
/ _ \@
| | |@
\_____/@
@@
_____ @
/ _ \@
| __/@
\__/ @
@@
_____ @
/ _ \@
| | |@
\___\ \@
/@@
_____ @
/ _ \@
| _ <@
\__|\_/@
@@
_____ @
/ ___>@
|___ |@
<_____/@
@@
____ @
/ \@
\- -/@
|__| @
@@
__ __ @
/ | \@
| | |@
\_____/@
@@
__ __ @
/ | \@
\ | /@
\___/ @
@@
__ __ @
/ / \@
| /\ |@
\__/\__/@
@@
__ __ @
/ \/ \@
>- -<@
\__/\__/@
@@
___ ___@
\ | /@
| | @
\___/ @
@@
_____ @
|__ /@
/ _/ @
/_____|@
@@
___ @
| _|@
| |_ @
|___|@
@@
___ @
\ \ @
\ \ @
\__\@
@@
___ @
|_ |@
_| |@
|___|@
@@
__ @
/ \ @
/_/\_\@
@
@@
@
@
@
____ @
<____>@@
_ @
< >@
\|@
@
@@
_____ @
/ _ \@
| _ |@
\__|__/@
@@
_____ @
/ _ \@
| _ <@
\_____/@
@@
_____ @
/ \@
| |--|@
\_____/@
@@
_____ @
| _ \@
| | |@
|_____/@
@@
_____ @
/ __\@
| __|@
\_____/@
@@
_____ @
/ __\@
| __|@
\__/ @
@@
_____ @
/ __\@
| |_ |@
\_____/@
@@
__ __ @
/ | \@
| _ |@
\__|__/@
@@
___ @
/___\@
| |@
\___/@
@@
____ @
\_ \@
---| |@
\_____/@
@@
__ ___@
| | /@
| _ < @
|__|__\@
@@
____ @
/ _/ @
| |---@
\_____/@
@@
__ __ @
/ \/ \@
| \/ |@
\__ \__/@
@@
_____ @
/ _ \@
| | |@
\__|__/@
@@
_____ @
/ _ \@
| | |@
\_____/@
@@
_____ @
/ _ \@
| __/@
\__/ @
@@
_____ @
/ _ \@
| | |@
\___\ \@
/@@
_____ @
/ _ \@
| _ <@
\__|\_/@
@@
_____ @
/ ___>@
|___ |@
<_____/@
@@
____ @
/ \@
\- -/@
|__| @
@@
__ __ @
/ | \@
| | |@
\_____/@
@@
__ __ @
/ | \@
\ | /@
\___/ @
@@
__ __ @
/ / \@
| /\ |@
\__/\__/@
@@
__ __ @
/ \/ \@
>- -<@
\__/\__/@
@@
___ ___@
\ | /@
| | @
\___/ @
@@
_____ @
|__ /@
/ _/ @
/_____|@
@@
___@
| /@
< | @
|__\@
@@
_ @
| |@
| |@
|_|@
@@
___ @
\ | @
| >@
/__| @
@@
_ _ @
/ \/ >@
<_/\_/ @
@
@@
/_\_/_\@
/ _ \@
| _ |@
\__|__/@
@@
/_\_/_\@
/ _ \@
| | |@
\_____/@
@@
/_\ /_\@
/ | \@
| | |@
\_____/@
@@
/_\_/_\@
/ _ \@
| _ |@
\__|__/@
@@
/_\_/_\@
/ _ \@
| | |@
\_____/@
@@
/_\ /_\@
/ | \@
| | |@
\_____/@
@@
ß@
@
@
@
@@
@@ -0,0 +1 @@
{"version":3,"file":"square-function.js","sources":["../../../src/icons/square-function.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareFunction\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiByeT0iMiIgLz4KICA8cGF0aCBkPSJNOSAxN2MyIDAgMi44LTEgMi44LTIuOFYxMGMwLTIgMS0zLjMgMy4yLTMiIC8+CiAgPHBhdGggZD0iTTkgMTEuMmg1LjciIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/square-function\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 SquareFunction = createLucideIcon('SquareFunction', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2', key: '1m3agn' }],\n ['path', { d: 'M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3', key: 'm1af9g' }],\n ['path', { d: 'M9 11.2h5.7', key: '3zgcl2' }],\n]);\n\nexport default SquareFunction;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,KAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,EAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,KAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAA,EAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAU,CAAA,CAAA;AAAA,CAAA,CACvF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC3E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC9C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,65 @@
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [0.1.6](https://github.com/istanbuljs/schema/compare/v0.1.5...v0.1.6) (2026-04-13)
### Bug Fixes
* Undo change to schema in 0.1.x series ([440f977](https://github.com/istanbuljs/schema/commit/440f977adc826fa51aa5eba06ee4d89065ca4261))
## [0.1.5](https://github.com/istanbuljs/schema/compare/v0.1.4...v0.1.5) (2026-04-13)
### Bug Fixes
* Re-add release-please ([7c25461](https://github.com/istanbuljs/schema/commit/7c25461ac00d69b843d6a3e112a279164fc972b9))
## [0.1.4](https://github.com/istanbuljs/schema/compare/v0.1.3...v0.1.4) (2026-04-13)
### Bug Fixes
* Remove development dependencies ([a24b4c1](https://github.com/istanbuljs/schema/commit/a24b4c1bccf65f63e7f1fe6bd82bed82e57abc80))
### [0.1.3](https://github.com/istanbuljs/schema/compare/v0.1.2...v0.1.3) (2021-02-13)
### Features
* Add `classPrivateMethods` and `topLevelAwait` default support ([#17](https://github.com/istanbuljs/schema/issues/17)) ([e732889](https://github.com/istanbuljs/schema/commit/e7328894ddeb61da256c1f13c2c2cc2e04f181df)), closes [#16](https://github.com/istanbuljs/schema/issues/16)
* Add `numericSeparator` to default `parserPlugins` ([#12](https://github.com/istanbuljs/schema/issues/12)) ([fe32f00](https://github.com/istanbuljs/schema/commit/fe32f002f54c61467b1c1a487081f51c85ec8d10)), closes [#5](https://github.com/istanbuljs/schema/issues/5)
* Add babel.config.mjs to default exclude ([#10](https://github.com/istanbuljs/schema/issues/10)) ([a4dbeaa](https://github.com/istanbuljs/schema/commit/a4dbeaa7045490a4d46754801ac71f5d99c9bd79))
### Bug Fixes
* Exclude tests with `tsx` or `jsx` extensions ([#13](https://github.com/istanbuljs/schema/issues/13)) ([c7747f7](https://github.com/istanbuljs/schema/commit/c7747f7a7df8a2b770036834af77dfd0ee445733)), closes [#11](https://github.com/istanbuljs/schema/issues/11)
### [0.1.2](https://github.com/istanbuljs/schema/compare/v0.1.1...v0.1.2) (2019-12-05)
### Features
* Ignore *.d.ts ([#6](https://github.com/istanbuljs/schema/issues/6)) ([d867eaf](https://github.com/istanbuljs/schema/commit/d867eaff6ca4abcd4301990e2bdcdf53e438e9c4))
* Update default exclude of dev tool configurations ([#7](https://github.com/istanbuljs/schema/issues/7)) ([c89f818](https://github.com/istanbuljs/schema/commit/c89f8185f30879bcdf8d2f1c3b7aba0ac7056fa9))
## [0.1.1](https://github.com/istanbuljs/schema/compare/v0.1.0...v0.1.1) (2019-10-07)
### Bug Fixes
* Add missing `instrument` option ([#3](https://github.com/istanbuljs/schema/issues/3)) ([bf1217d](https://github.com/istanbuljs/schema/commit/bf1217d))
### Features
* Add `use-spawn-wrap` nyc option ([#4](https://github.com/istanbuljs/schema/issues/4)) ([b2ce2e8](https://github.com/istanbuljs/schema/commit/b2ce2e8))
## 0.1.0 (2019-10-05)
### Features
* Initial implementation ([99bd3a5](https://github.com/istanbuljs/schema/commit/99bd3a5))
@@ -0,0 +1 @@
module.exports={C:{"52":0.03444,"56":0.0246,"66":0.00492,"78":0.00492,"113":0.00492,"115":0.369,"120":0.00492,"121":0.01476,"123":0.00492,"124":0.00492,"127":0.0246,"128":0.00984,"129":0.00492,"132":0.00984,"133":0.00492,"135":0.00492,"136":0.01476,"137":0.10824,"138":0.00492,"139":0.00492,"140":0.12792,"141":0.00492,"142":0.00984,"143":0.01476,"144":0.00984,"145":0.00984,"146":0.01476,"147":0.00984,"148":0.01476,"149":0.00984,"150":0.0246,"151":0.0246,"152":0.13284,"153":0.14268,"154":0.5658,"155":2.3124,"156":1.968,"157":0.05412,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 57 58 59 60 61 62 63 64 65 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 114 116 117 118 119 122 125 126 130 131 134 158 159 160 3.5 3.6"},D:{"49":0.00984,"70":0.0246,"79":0.00492,"81":0.00492,"84":0.00492,"88":0.00492,"101":0.00492,"103":0.01968,"104":0.00984,"105":0.00984,"106":0.02952,"107":0.00492,"108":0.00984,"109":0.615,"110":0.00492,"111":0.01476,"112":0.00984,"114":0.00492,"115":0.01476,"116":0.03444,"117":0.00492,"118":0.02952,"119":0.0246,"120":0.03936,"121":0.00984,"122":0.03936,"123":0.00984,"124":0.01476,"125":0.00492,"126":0.00984,"127":0.00492,"128":0.0246,"129":0.00492,"130":0.00984,"131":0.02952,"132":0.05904,"133":0.06888,"134":0.07872,"135":0.0738,"136":0.06888,"137":0.1968,"138":0.12792,"139":0.0738,"140":0.13776,"141":0.15744,"142":0.23124,"143":0.04428,"144":0.03444,"145":0.0492,"146":0.06396,"147":0.07872,"148":0.1476,"149":0.15252,"150":0.30504,"151":1.61376,"152":9.92364,"153":9.29388,"154":1.89912,"155":0.0246,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 71 72 73 74 75 76 77 78 80 83 85 86 87 89 90 91 92 93 94 95 96 97 98 99 100 102 113 156 157"},F:{"36":0.00492,"46":0.00492,"84":0.00492,"85":0.01968,"95":0.03936,"101":0.0246,"102":0.00492,"105":0.00984,"106":0.00492,"107":0.00492,"126":0.00492,"131":0.00492,"132":0.00492,"133":0.25584,"134":0.16728,"135":1.81548,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 86 87 88 89 90 91 92 93 94 96 97 98 99 100 103 104 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 127 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"107":0.00492,"108":0.00492,"109":0.03936,"119":0.00492,"120":0.00492,"122":0.00492,"128":0.00492,"131":0.00492,"134":0.00492,"135":0.00492,"136":0.00492,"137":0.00492,"138":0.00984,"139":0.0246,"140":0.00492,"141":0.00984,"142":0.00984,"143":0.00492,"144":0.00984,"145":0.00492,"146":0.01476,"147":0.02952,"148":0.0492,"149":0.01968,"150":0.11316,"151":0.3936,"152":3.29148,"153":3.92616,"154":0.9102,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 110 111 112 113 114 115 116 117 118 121 123 124 125 126 127 129 130 132 133"},E:{"14":0.00984,"27":0.2214,_:"4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 15.1 15.2-15.3 15.5 16.4 27.1 TP","14.1":0.00984,"15.4":0.00492,"15.6":0.05412,"16.0":0.00492,"16.1":0.00492,"16.2":0.00492,"16.3":0.00984,"16.5":0.00492,"16.6":0.1722,"17.0":0.00984,"17.1":0.08364,"17.2":0.00984,"17.3":0.00984,"17.4":0.00984,"17.5":0.01476,"17.6":0.06888,"18.0":0.03936,"18.1":0.01476,"18.2":0.00492,"18.3":0.01968,"18.4":0.00984,"18.5-18.7":0.02952,"26.0":0.01476,"26.1":0.01476,"26.2":0.0492,"26.3":0.06396,"26.4":0.05412,"26.5":0.30012,"26.6":1.2054,"27.2":0.00492},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00111,"5.0-5.1":0.00111,"6.0-6.1":0,"7.0-7.1":0.00221,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01105,"11.0-11.2":0.00111,"11.3-11.4":0.00221,"12.0-12.1":0,"12.2-12.5":0.02873,"13.0-13.1":0,"13.2":0.00553,"13.3":0,"13.4-13.7":0.00111,"14.0-14.4":0.00442,"14.5-14.8":0.00663,"15.0-15.1":0.00663,"15.2-15.3":0.00442,"15.4":0.00553,"15.5":0.00663,"15.6-15.8":0.14367,"16.0":0.01105,"16.1":0.01989,"16.2":0.01105,"16.3":0.02431,"16.4":0.00553,"16.5":0.00884,"16.6-16.7":0.20003,"17.0":0.00774,"17.1":0.01105,"17.2":0.01105,"17.3":0.01658,"17.4":0.02321,"17.5":0.04531,"17.6-17.7":0.11714,"18.0":0.02431,"18.1":0.04863,"18.2":0.06631,"18.3":0.11493,"18.4":0.07183,"18.5-18.7":1.48417,"26.0":0.07183,"26.1":0.07294,"26.2":0.19008,"26.3":0.20555,"26.4":0.1503,"26.5":1.00676,"26.6":6.21187,"27.0":0.47631,"27.1":0,"27.2":0.01216},P:{"4":0.00943,"21":0.00943,"22":0.00943,"23":0.00943,"24":0.00943,"25":0.00943,"26":0.01886,"27":0.02829,"28":0.05657,"29":0.09429,"30":2.55521,_:"20 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.09139,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-Line truncated
@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.469.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 KeyboardOff = createLucideIcon("KeyboardOff", [
["path", { d: "M 20 4 A2 2 0 0 1 22 6", key: "1g1fkt" }],
["path", { d: "M 22 6 L 22 16.41", key: "1qjg3w" }],
["path", { d: "M 7 16 L 16 16", key: "n0yqwb" }],
["path", { d: "M 9.69 4 L 20 4", key: "kbpcgx" }],
["path", { d: "M14 8h.01", key: "1primd" }],
["path", { d: "M18 8h.01", key: "emo2bl" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
["path", { d: "M20 20H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2", key: "s23sx2" }],
["path", { d: "M6 8h.01", key: "x9i8wu" }],
["path", { d: "M8 12h.01", key: "czm47f" }]
]);
export { KeyboardOff as default };
//# sourceMappingURL=keyboard-off.js.map
@@ -0,0 +1,6 @@
function absFloor(v) {
return v < 0 ? Math.ceil(v) || 0 : Math.floor(v);
}
export {
absFloor as a
};
@@ -0,0 +1,3 @@
import * as ts from 'typescript';
/*** Indicates whether identifiers require the use of quotation marks when accessing property definitions and dot notation. */
export declare function requiresQuoting(name: string, target?: ts.ScriptTarget): boolean;
@@ -0,0 +1 @@
{"version":3,"file":"plug-2.js","sources":["../../../src/icons/plug-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Plug2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOSAydjYiIC8+CiAgPHBhdGggZD0iTTE1IDJ2NiIgLz4KICA8cGF0aCBkPSJNMTIgMTd2NSIgLz4KICA8cGF0aCBkPSJNNSA4aDE0IiAvPgogIDxwYXRoIGQ9Ik02IDExVjhoMTJ2M2E2IDYgMCAxIDEtMTIgMFoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/plug-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Plug2 = createLucideIcon('Plug2', [\n ['path', { d: 'M9 2v6', key: '17ngun' }],\n ['path', { d: 'M15 2v6', key: 's7yy2p' }],\n ['path', { d: 'M12 17v5', key: 'bb1du9' }],\n ['path', { d: 'M5 8h14', key: 'pcz4l3' }],\n ['path', { d: 'M6 11V8h12v3a6 6 0 1 1-12 0Z', key: 'wtfw2c' }],\n]);\n\nexport default Plug2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC/D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.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 Forklift = createLucideIcon("Forklift", [
["path", { d: "M12 12H5a2 2 0 0 0-2 2v5", key: "7zsz91" }],
["circle", { cx: "13", cy: "19", r: "2", key: "wjnkru" }],
["circle", { cx: "5", cy: "19", r: "2", key: "v8kfzx" }],
["path", { d: "M8 19h3m5-17v17h6M6 12V7c0-1.1.9-2 2-2h3l5 5", key: "13bk1p" }]
]);
export { Forklift as default };
//# sourceMappingURL=forklift.js.map
@@ -0,0 +1 @@
{"version":3,"file":"transformer.cjs","names":[],"sources":["../../../../src/ssr/serializer/transformer.ts"],"sourcesContent":["import { createPlugin } from 'seroval'\nimport { GLOBAL_TSR } from '../constants'\nimport type { Plugin, PluginInfo, SerovalNode } from 'seroval'\nimport type {\n RegisteredConfigType,\n RegisteredSsr,\n SSROption,\n} from '../../router'\nimport type { LooseReturnType } from '../../utils'\nimport type { AnyRoute, ResolveAllSSR } from '../../route'\nimport type { RawStream } from './RawStream'\n\ndeclare const TSR_SERIALIZABLE: unique symbol\nexport type TSR_SERIALIZABLE = typeof TSR_SERIALIZABLE\n\nexport type TsrSerializable = { [TSR_SERIALIZABLE]: true }\n\nexport interface DefaultSerializable {\n number: number\n string: string\n boolean: boolean\n null: null\n undefined: undefined\n bigint: bigint\n Date: Date\n Uint8Array: Uint8Array\n RawStream: RawStream\n TsrSerializable: TsrSerializable\n void: void\n}\n\nexport interface SerializableExtensions extends DefaultSerializable {}\n\nexport type Serializable = SerializableExtensions[keyof SerializableExtensions]\n\nexport type UnionizeSerializationAdaptersInput<\n TAdapters extends ReadonlyArray<AnySerializationAdapter>,\n> = TAdapters[number]['~types']['input']\n\n/**\n * Create a strongly-typed serialization adapter for SSR hydration.\n * Use to register custom types with the router serializer.\n */\nexport function createSerializationAdapter<\n TInput = unknown,\n TOutput = unknown,\n const TExtendsAdapters extends\n | ReadonlyArray<AnySerializationAdapter>\n | never = never,\n>(\n opts: CreateSerializationAdapterOptions<TInput, TOutput, TExtendsAdapters>,\n): SerializationAdapter<TInput, TOutput, TExtendsAdapters> {\n return opts as unknown as SerializationAdapter<\n TInput,\n TOutput,\n TExtendsAdapters\n >\n}\n\nexport interface CreateSerializationAdapterOptions<\n TInput,\n TOutput,\n TExtendsAdapters extends ReadonlyArray<AnySerializationAdapter> | never,\n> {\n key: string\n extends?: TExtendsAdapters\n test: (value: unknown) => value is TInput\n toSerializable: (\n value: TInput,\n ) => ValidateSerializable<\n TOutput,\n Serializable | UnionizeSerializationAdaptersInput<TExtendsAdapters>\n >\n fromSerializable: (value: TOutput) => TInput\n}\n\nexport type ValidateSerializable<T, TSerializable> = T extends TSerializable\n ? T\n : T extends (...args: Array<any>) => any\n ? SerializationError<'Function may not be serializable'>\n : T extends RegisteredReadableStream\n ? SerializationError<'JSX is not be serializable'>\n : T extends ReadonlyArray<any>\n ? ValidateSerializableArray<T, TSerializable>\n : T extends Promise<any>\n ? ValidateSerializablePromise<T, TSerializable>\n : T extends ReadableStream<any>\n ? ValidateReadableStream<T, TSerializable>\n : T extends Set<any>\n ? ValidateSerializableSet<T, TSerializable>\n : T extends Map<any, any>\n ? ValidateSerializableMap<T, TSerializable>\n : T extends AsyncGenerator<any, any>\n ? ValidateSerializableAsyncGenerator<T, TSerializable>\n : T extends object\n ? ValidateSerializableMapped<T, TSerializable>\n : SerializationError<'Type may not be serializable'>\n\nexport type ValidateSerializableAsyncGenerator<T, TSerializable> =\n T extends AsyncGenerator<infer T, infer TReturn, infer TNext>\n ? AsyncGenerator<\n ValidateSerializable<T, TSerializable>,\n ValidateSerializable<TReturn, TSerializable>,\n TNext\n >\n : never\n\nexport type ValidateSerializablePromise<T, TSerializable> =\n T extends Promise<infer TAwaited>\n ? Promise<ValidateSerializable<TAwaited, TSerializable>>\n : never\n\nexport type ValidateReadableStream<T, TSerializable> =\n T extends ReadableStream<infer TStreamed>\n ? ReadableStream<ValidateSerializable<TStreamed, TSerializable>>\n : never\n\nexport type ValidateSerializableSet<T, TSerializable> =\n T extends Set<infer TItem>\n ? Set<ValidateSerializable<TItem, TSerializable>>\n : never\n\nexport type ValidateSerializableMap<T, TSerializable> =\n T extends Map<infer TKey, infer TValue>\n ? Map<\n ValidateSerializable<TKey, TSerializable>,\n ValidateSerializable<TValue, TSerializable>\n >\n : never\n\nexport type ValidateSerializableArray<T, TSerializable> = T extends readonly [\n any,\n ...Array<any>,\n]\n ? ValidateSerializableMapped<T, TSerializable>\n : T extends Array<infer U>\n ? Array<ValidateSerializable<U, TSerializable>>\n : T extends ReadonlyArray<infer U>\n ? ReadonlyArray<ValidateSerializable<U, TSerializable>>\n : never\n\nexport type ValidateSerializableMapped<T, TSerializable> = {\n [K in keyof T]: ValidateSerializable<T[K], TSerializable>\n}\n\nconst SERIALIZATION_ERROR = Symbol.for('TSRLine truncated
@@ -0,0 +1,39 @@
import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {usePattern} from "../code"
import {useFunc} from "../../compile/util"
import {_, str} from "../../compile/codegen"
export type PatternError = ErrorObject<"pattern", {pattern: string}, string | {$data: string}>
const error: KeywordErrorDefinition = {
message: ({schemaCode}) => str`must match pattern "${schemaCode}"`,
params: ({schemaCode}) => _`{pattern: ${schemaCode}}`,
}
const def: CodeKeywordDefinition = {
keyword: "pattern",
type: "string",
schemaType: "string",
$data: true,
error,
code(cxt: KeywordCxt) {
const {gen, data, $data, schema, schemaCode, it} = cxt
const u = it.opts.unicodeRegExp ? "u" : ""
if ($data) {
const {regExp} = it.opts.code
const regExpCode = regExp.code === "new RegExp" ? _`new RegExp` : useFunc(gen, regExp)
const valid = gen.let("valid")
gen.try(
() => gen.assign(valid, _`${regExpCode}(${schemaCode}, ${u}).test(${data})`),
() => gen.assign(valid, false)
)
cxt.fail$data(_`!${valid}`)
} else {
const regExp = usePattern(cxt, schema)
cxt.fail$data(_`!${regExp}.test(${data})`)
}
},
}
export default def
@@ -0,0 +1,33 @@
import { CursorOptions, CursorResult, Options, SupportInfo } from "./index.js";
/**
* formatWithCursor both formats the code, and translates a cursor position from unformatted code to formatted code.
* This is useful for editor integrations, to prevent the cursor from moving when code is formatted
*
* The cursorOffset option should be provided, to specify where the cursor is.
*
* ```js
* await prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: "babel" });
* ```
* `-> { formatted: "1;\n", cursorOffset: 1 }`
*/
export function formatWithCursor(
source: string,
options: CursorOptions,
): Promise<CursorResult>;
/**
* `format` is used to format text using Prettier. [Options](https://prettier.io/docs/options) may be provided to override the defaults.
*/
export function format(source: string, options?: Options): Promise<string>;
/**
* `check` checks to see if the file has been formatted with Prettier given those options and returns a `Boolean`.
* This is similar to the `--list-different` parameter in the CLI and is useful for running Prettier in CI scenarios.
*/
export function check(source: string, options?: Options): Promise<boolean>;
/**
* Returns an object representing the parsers, languages and file types Prettier supports for the current version.
*/
export function getSupportInfo(): Promise<SupportInfo>;
@@ -0,0 +1,123 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "અક્ષર", verb: "હોવા જોઈએ" },
file: { unit: "બાયટ", verb: "હોવા જોઈએ" },
array: { unit: "આઇટમ", verb: "હોવા જોઈએ" },
set: { unit: "આઇટમ", verb: "હોવા જોઈએ" },
map: { unit: "એન્ટ્રી", verb: "હોવા જોઈએ" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "ઇનપુટ",
email: "ઈમેઇલ એડ્રેસ",
url: "URL",
emoji: "ઇમોજી",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO તારીખ અને સમય",
date: "ISO તારીખ",
time: "ISO સમય",
duration: "ISO અવધિ",
ipv4: "IPv4 એડ્રેસ",
ipv6: "IPv6 એડ્રેસ",
mac: "MAC એડ્રેસ",
cidrv4: "IPv4 શ્રેણી",
cidrv6: "IPv6 શ્રેણી",
base64: "base64-એન્કોડેડ સ્ટ્રિંગ",
base64url: "base64url-એન્કોડેડ સ્ટ્રિંગ",
json_string: "JSON સ્ટ્રિંગ",
e164: "E.164 નંબર",
credit_card: "ક્રેડિટ કાર્ડ નંબર",
currency_code: "ચલણ કોડ",
iban: "IBAN",
jwt: "JWT",
template_literal: "ઇનપુટ",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
return `અમાન્ય ઇનપુટ: અપેક્ષિત ${expected}, પ્રાપ્ત ${received}`;
}
case "invalid_value":
if (issue.values.length === 1) return `અમાન્ય ઇનપુટ: અપેક્ષિત ${util.stringifyPrimitive(issue.values[0])}`;
return `અમાન્ય વિકલ્પ: ${util.joinValues(issue.values, " | ")} માધ્યમથી એક અપેક્ષિત`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `ખૂબ મોટું: ${issue.origin ?? "મૂલ્ય"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "એલિમેન્ટ"} હોવા જોઈએ`;
return `ખૂબ મોટું: ${issue.origin ?? "મૂલ્ય"} ${adj}${issue.maximum.toString()} હોવું જોઈએ`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `ખૂબ નાનું: ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} હોવા જોઈએ`;
}
return `ખૂબ નાનું: ${issue.origin} ${adj}${issue.minimum.toString()} હોવું જોઈએ`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") {
return `અમાન્ય સ્ટ્રિંગ: "${_issue.prefix}" થી શરૂ થવું જોઈએ`;
}
if (_issue.format === "ends_with") return `અમાન્ય સ્ટ્રિંગ: "${_issue.suffix}" પર સમાપ્ત થવું જોઈએ`;
if (_issue.format === "includes") return `અમાન્ય સ્ટ્રિંગ: "${_issue.includes}" શામેલ હોવું જોઈએ`;
if (_issue.format === "regex") return `અમાન્ય સ્ટ્રિંગ: પેટર્ન ${_issue.pattern} સાથે મેળ ખાવું જોઈએ`;
return `અમાન્ય ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `અમાન્ય નંબર: ${issue.divisor} નો ગુણાંક હોવો જોઈએ`;
case "unrecognized_keys":
return `ઓળખી શકાતા નહીં તે કી${issue.keys.length > 1 ? "ઓ" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `${issue.origin} માં અમાન્ય કી`;
case "invalid_union":
if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) {
const opts = issue.options.map((o) => `'${o}'`).join(" | ");
return `અમાન્ય ડિસ્ક્રિમિનેટર મૂલ્ય. અપેક્ષિત ${opts}`;
}
return "અમાન્ય ઇનપુટ";
case "invalid_element":
return `${issue.origin} માં અમાન્ય મૂલ્ય`;
default:
return "અમાન્ય ઇનપુટ";
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -0,0 +1,301 @@
/**
* @fileoverview Disallows or enforces spaces inside of array brackets.
* @author Jamund Ferguson
* @deprecated in ESLint v8.53.0
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "array-bracket-spacing",
url: "https://eslint.style/rules/array-bracket-spacing",
},
},
],
},
type: "layout",
docs: {
description: "Enforce consistent spacing inside array brackets",
recommended: false,
url: "https://eslint.org/docs/latest/rules/array-bracket-spacing",
},
fixable: "whitespace",
schema: [
{
enum: ["always", "never"],
},
{
type: "object",
properties: {
singleValue: {
type: "boolean",
},
objectsInArrays: {
type: "boolean",
},
arraysInArrays: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
unexpectedSpaceAfter:
"There should be no space after '{{tokenValue}}'.",
unexpectedSpaceBefore:
"There should be no space before '{{tokenValue}}'.",
missingSpaceAfter: "A space is required after '{{tokenValue}}'.",
missingSpaceBefore: "A space is required before '{{tokenValue}}'.",
},
},
create(context) {
const spaced = context.options[0] === "always",
sourceCode = context.sourceCode;
/**
* Determines whether an option is set, relative to the spacing option.
* If spaced is "always", then check whether option is set to false.
* If spaced is "never", then check whether option is set to true.
* @param {Object} option The option to exclude.
* @returns {boolean} Whether or not the property is excluded.
*/
function isOptionSet(option) {
return context.options[1]
? context.options[1][option] === !spaced
: false;
}
const options = {
spaced,
singleElementException: isOptionSet("singleValue"),
objectsInArraysException: isOptionSet("objectsInArrays"),
arraysInArraysException: isOptionSet("arraysInArrays"),
};
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Reports that there shouldn't be a space after the first token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportNoBeginningSpace(node, token) {
const nextToken = sourceCode.getTokenAfter(token);
context.report({
node,
loc: { start: token.loc.end, end: nextToken.loc.start },
messageId: "unexpectedSpaceAfter",
data: {
tokenValue: token.value,
},
fix(fixer) {
return fixer.removeRange([
token.range[1],
nextToken.range[0],
]);
},
});
}
/**
* Reports that there shouldn't be a space before the last token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportNoEndingSpace(node, token) {
const previousToken = sourceCode.getTokenBefore(token);
context.report({
node,
loc: { start: previousToken.loc.end, end: token.loc.start },
messageId: "unexpectedSpaceBefore",
data: {
tokenValue: token.value,
},
fix(fixer) {
return fixer.removeRange([
previousToken.range[1],
token.range[0],
]);
},
});
}
/**
* Reports that there should be a space after the first token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportRequiredBeginningSpace(node, token) {
context.report({
node,
loc: token.loc,
messageId: "missingSpaceAfter",
data: {
tokenValue: token.value,
},
fix(fixer) {
return fixer.insertTextAfter(token, " ");
},
});
}
/**
* Reports that there should be a space before the last token
* @param {ASTNode} node The node to report in the event of an error.
* @param {Token} token The token to use for the report.
* @returns {void}
*/
function reportRequiredEndingSpace(node, token) {
context.report({
node,
loc: token.loc,
messageId: "missingSpaceBefore",
data: {
tokenValue: token.value,
},
fix(fixer) {
return fixer.insertTextBefore(token, " ");
},
});
}
/**
* Determines if a node is an object type
* @param {ASTNode} node The node to check.
* @returns {boolean} Whether or not the node is an object type.
*/
function isObjectType(node) {
return (
node &&
(node.type === "ObjectExpression" ||
node.type === "ObjectPattern")
);
}
/**
* Determines if a node is an array type
* @param {ASTNode} node The node to check.
* @returns {boolean} Whether or not the node is an array type.
*/
function isArrayType(node) {
return (
node &&
(node.type === "ArrayExpression" ||
node.type === "ArrayPattern")
);
}
/**
* Validates the spacing around array brackets
* @param {ASTNode} node The node we're checking for spacing
* @returns {void}
*/
function validateArraySpacing(node) {
if (options.spaced && node.elements.length === 0) {
return;
}
const first = sourceCode.getFirstToken(node),
second = sourceCode.getFirstToken(node, 1),
last = node.typeAnnotation
? sourceCode.getTokenBefore(node.typeAnnotation)
: sourceCode.getLastToken(node),
penultimate = sourceCode.getTokenBefore(last),
firstElement = node.elements[0],
lastElement = node.elements.at(-1);
const openingBracketMustBeSpaced =
(options.objectsInArraysException &&
isObjectType(firstElement)) ||
(options.arraysInArraysException &&
isArrayType(firstElement)) ||
(options.singleElementException && node.elements.length === 1)
? !options.spaced
: options.spaced;
const closingBracketMustBeSpaced =
(options.objectsInArraysException &&
isObjectType(lastElement)) ||
(options.arraysInArraysException && isArrayType(lastElement)) ||
(options.singleElementException && node.elements.length === 1)
? !options.spaced
: options.spaced;
if (astUtils.isTokenOnSameLine(first, second)) {
if (
openingBracketMustBeSpaced &&
!sourceCode.isSpaceBetween(first, second)
) {
reportRequiredBeginningSpace(node, first);
}
if (
!openingBracketMustBeSpaced &&
sourceCode.isSpaceBetween(first, second)
) {
reportNoBeginningSpace(node, first);
}
}
if (
first !== penultimate &&
astUtils.isTokenOnSameLine(penultimate, last)
) {
if (
closingBracketMustBeSpaced &&
!sourceCode.isSpaceBetween(penultimate, last)
) {
reportRequiredEndingSpace(node, last);
}
if (
!closingBracketMustBeSpaced &&
sourceCode.isSpaceBetween(penultimate, last)
) {
reportNoEndingSpace(node, last);
}
}
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
ArrayPattern: validateArraySpacing,
ArrayExpression: validateArraySpacing,
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"slash-square.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../../src/motion/features/animation/index.ts"],"sourcesContent":["import {\n createAnimationState,\n Feature,\n isAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\n\nexport class AnimationFeature extends Feature<unknown> {\n unmountControls?: () => void\n\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node: VisualElement) {\n super(node)\n node.animationState ||= createAnimationState(node)\n }\n\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps()\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node)\n }\n }\n\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription()\n }\n\n update() {\n const { animate } = this.node.getProps()\n const { animate: prevAnimate } = this.node.prevProps || {}\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription()\n }\n }\n\n unmount() {\n this.node.animationState!.reset()\n this.unmountControls?.()\n }\n}\n"],"names":[],"mappings":";;AAOM,MAAO,gBAAiB,SAAQ,OAAgB,CAAA;AAGlD;;;;AAIG;AACH,IAAA,WAAA,CAAY,IAAmB,EAAA;QAC3B,KAAK,CAAC,IAAI,CAAC;QACX,IAAI,CAAC,cAAc,KAAnB,IAAI,CAAC,cAAc,GAAK,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACtD;IAEA,mCAAmC,GAAA;QAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AACxC,QAAA,IAAI,mBAAmB,CAAC,OAAO,CAAC,EAAE;YAC9B,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QACvD;IACJ;AAEA;;AAEG;IACH,KAAK,GAAA;QACD,IAAI,CAAC,mCAAmC,EAAE;IAC9C;IAEA,MAAM,GAAA;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AACxC,QAAA,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE;AAC1D,QAAA,IAAI,OAAO,KAAK,WAAW,EAAE;YACzB,IAAI,CAAC,mCAAmC,EAAE;QAC9C;IACJ;IAEA,OAAO,GAAA;AACH,QAAA,IAAI,CAAC,IAAI,CAAC,cAAe,CAAC,KAAK,EAAE;AACjC,QAAA,IAAI,CAAC,eAAe,IAAI;IAC5B;AACH;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"tower-control.js","sources":["../../../src/icons/tower-control.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TowerControl\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTguMiAxMi4yNyAyMCA2SDRsMS44IDYuMjdhMSAxIDAgMCAwIC45NS43M2gxMC41YTEgMSAwIDAgMCAuOTYtLjczWiIgLz4KICA8cGF0aCBkPSJNOCAxM3Y5IiAvPgogIDxwYXRoIGQ9Ik0xNiAyMnYtOSIgLz4KICA8cGF0aCBkPSJtOSA2IDEgNyIgLz4KICA8cGF0aCBkPSJtMTUgNi0xIDciIC8+CiAgPHBhdGggZD0iTTEyIDZWMiIgLz4KICA8cGF0aCBkPSJNMTMgMmgtMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/tower-control\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 TowerControl = createLucideIcon('TowerControl', [\n [\n 'path',\n { d: 'M18.2 12.27 20 6H4l1.8 6.27a1 1 0 0 0 .95.73h10.5a1 1 0 0 0 .96-.73Z', key: '1pledb' },\n ],\n ['path', { d: 'M8 13v9', key: 'hmv0ci' }],\n ['path', { d: 'M16 22v-9', key: 'ylnf1u' }],\n ['path', { d: 'm9 6 1 7', key: 'dpdgam' }],\n ['path', { d: 'm15 6-1 7', key: 'ls7zgu' }],\n ['path', { d: 'M12 6V2', key: '1pj48d' }],\n ['path', { d: 'M13 2h-2', key: 'mj6ths' }],\n]);\n\nexport default TowerControl;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CACpD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC7F,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,98 @@
import {
isBlockScopedDeclaration,
isFunctionScopedDeclaration,
isNonTopLevelDeclaration,
} from "./parser/tokenizer";
import {TokenType as tt} from "./parser/tokenizer/types";
/**
* Traverse the given tokens and modify them if necessary to indicate that some names shadow global
* variables.
*/
export default function identifyShadowedGlobals(
tokens,
scopes,
globalNames,
) {
if (!hasShadowedGlobals(tokens, globalNames)) {
return;
}
markShadowedGlobals(tokens, scopes, globalNames);
}
/**
* We can do a fast up-front check to see if there are any declarations to global names. If not,
* then there's no point in computing scope assignments.
*/
// Exported for testing.
export function hasShadowedGlobals(tokens, globalNames) {
for (const token of tokens.tokens) {
if (
token.type === tt.name &&
!token.isType &&
isNonTopLevelDeclaration(token) &&
globalNames.has(tokens.identifierNameForToken(token))
) {
return true;
}
}
return false;
}
function markShadowedGlobals(
tokens,
scopes,
globalNames,
) {
const scopeStack = [];
let scopeIndex = scopes.length - 1;
// Scopes were generated at completion time, so they're sorted by end index, so we can maintain a
// good stack by going backwards through them.
for (let i = tokens.tokens.length - 1; ; i--) {
while (scopeStack.length > 0 && scopeStack[scopeStack.length - 1].startTokenIndex === i + 1) {
scopeStack.pop();
}
while (scopeIndex >= 0 && scopes[scopeIndex].endTokenIndex === i + 1) {
scopeStack.push(scopes[scopeIndex]);
scopeIndex--;
}
// Process scopes after the last iteration so we can make sure we pop all of them.
if (i < 0) {
break;
}
const token = tokens.tokens[i];
const name = tokens.identifierNameForToken(token);
if (scopeStack.length > 1 && !token.isType && token.type === tt.name && globalNames.has(name)) {
if (isBlockScopedDeclaration(token)) {
markShadowedForScope(scopeStack[scopeStack.length - 1], tokens, name);
} else if (isFunctionScopedDeclaration(token)) {
let stackIndex = scopeStack.length - 1;
while (stackIndex > 0 && !scopeStack[stackIndex].isFunctionScope) {
stackIndex--;
}
if (stackIndex < 0) {
throw new Error("Did not find parent function scope.");
}
markShadowedForScope(scopeStack[stackIndex], tokens, name);
}
}
}
if (scopeStack.length > 0) {
throw new Error("Expected empty scope stack after processing file.");
}
}
function markShadowedForScope(scope, tokens, name) {
for (let i = scope.startTokenIndex; i < scope.endTokenIndex; i++) {
const token = tokens.tokens[i];
if (
(token.type === tt.name || token.type === tt.jsxName) &&
tokens.identifierNameForToken(token) === name
) {
token.shadowsGlobal = true;
}
}
}
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = addComments;
function addComments(node, type, comments) {
if (!comments || !node) return node;
const key = `${type}Comments`;
if (node[key]) {
if (type === "leading") {
node[key] = comments.concat(node[key]);
} else {
node[key].push(...comments);
}
} else {
node[key] = comments;
}
return node;
}
//# sourceMappingURL=addComments.js.map
@@ -0,0 +1,7 @@
export {
prerender,
prerenderToNodeStream,
resumeAndPrerender,
resumeAndPrerenderToNodeStream,
version,
} from "./static";
@@ -0,0 +1 @@
{"version":3,"names":["originalGetModuleName","getModuleName","exports","default","rootOpts","pluginOpts","_pluginOpts$moduleId","_pluginOpts$moduleIds","_pluginOpts$getModule","_pluginOpts$moduleRoo","moduleId","moduleIds","getModuleId","moduleRoot","filename","filenameRelative","sourceRoot","moduleName","sourceRootReplacer","RegExp","replace"],"sources":["../src/get-module-name.ts"],"sourcesContent":["type RootOptions = {\n filename?: string;\n filenameRelative?: string;\n sourceRoot?: string;\n};\n\nexport type PluginOptions = {\n moduleId?: string;\n moduleIds?: boolean;\n getModuleId?: (moduleName: string) => string | null | undefined;\n moduleRoot?: string;\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n const originalGetModuleName = getModuleName;\n\n // @ts-expect-error TS doesn't like reassigning a function.\n getModuleName = function getModuleName(\n rootOpts: RootOptions & PluginOptions,\n pluginOpts: PluginOptions,\n ): string | null {\n return originalGetModuleName(rootOpts, {\n moduleId: pluginOpts.moduleId ?? rootOpts.moduleId,\n moduleIds: pluginOpts.moduleIds ?? rootOpts.moduleIds,\n getModuleId: pluginOpts.getModuleId ?? rootOpts.getModuleId,\n moduleRoot: pluginOpts.moduleRoot ?? rootOpts.moduleRoot,\n });\n };\n}\n\nexport default function getModuleName(\n rootOpts: RootOptions,\n pluginOpts: PluginOptions,\n): string | null {\n const {\n filename,\n filenameRelative = filename,\n sourceRoot = pluginOpts.moduleRoot,\n } = rootOpts;\n\n const {\n moduleId,\n moduleIds = !!moduleId,\n\n getModuleId,\n\n moduleRoot = sourceRoot,\n } = pluginOpts;\n\n if (!moduleIds) return null;\n\n // moduleId is n/a if a `getModuleId()` is provided\n if (moduleId != null && !getModuleId) {\n return moduleId;\n }\n\n let moduleName = moduleRoot != null ? moduleRoot + \"/\" : \"\";\n\n if (filenameRelative) {\n const sourceRootReplacer =\n sourceRoot != null ? new RegExp(\"^\" + sourceRoot + \"/?\") : \"\";\n\n moduleName += filenameRelative\n // remove sourceRoot from filename\n .replace(sourceRootReplacer, \"\")\n // remove extension\n .replace(/\\.\\w*$/, \"\");\n }\n\n // normalize path separators\n moduleName = moduleName.replace(/\\\\/g, \"/\");\n\n if (getModuleId) {\n // If return is falsy, assume they want us to use our generated default name\n return getModuleId(moduleName) || moduleName;\n } else {\n return moduleName;\n }\n}\n"],"mappings":";;;;;;AAcE,MAAMA,qBAAqB,GAAGC,aAAa;AAG3CC,OAAA,CAAAC,OAAA,GAAAF,aAAa,GAAG,SAASA,aAAaA,CACpCG,QAAqC,EACrCC,UAAyB,EACV;EAAA,IAAAC,oBAAA,EAAAC,qBAAA,EAAAC,qBAAA,EAAAC,qBAAA;EACf,OAAOT,qBAAqB,CAACI,QAAQ,EAAE;IACrCM,QAAQ,GAAAJ,oBAAA,GAAED,UAAU,CAACK,QAAQ,YAAAJ,oBAAA,GAAIF,QAAQ,CAACM,QAAQ;IAClDC,SAAS,GAAAJ,qBAAA,GAAEF,UAAU,CAACM,SAAS,YAAAJ,qBAAA,GAAIH,QAAQ,CAACO,SAAS;IACrDC,WAAW,GAAAJ,qBAAA,GAAEH,UAAU,CAACO,WAAW,YAAAJ,qBAAA,GAAIJ,QAAQ,CAACQ,WAAW;IAC3DC,UAAU,GAAAJ,qBAAA,GAAEJ,UAAU,CAACQ,UAAU,YAAAJ,qBAAA,GAAIL,QAAQ,CAACS;EAChD,CAAC,CAAC;AACJ,CAAC;AAGY,SAASZ,aAAaA,CACnCG,QAAqB,EACrBC,UAAyB,EACV;EACf,MAAM;IACJS,QAAQ;IACRC,gBAAgB,GAAGD,QAAQ;IAC3BE,UAAU,GAAGX,UAAU,CAACQ;EAC1B,CAAC,GAAGT,QAAQ;EAEZ,MAAM;IACJM,QAAQ;IACRC,SAAS,GAAG,CAAC,CAACD,QAAQ;IAEtBE,WAAW;IAEXC,UAAU,GAAGG;EACf,CAAC,GAAGX,UAAU;EAEd,IAAI,CAACM,SAAS,EAAE,OAAO,IAAI;EAG3B,IAAID,QAAQ,IAAI,IAAI,IAAI,CAACE,WAAW,EAAE;IACpC,OAAOF,QAAQ;EACjB;EAEA,IAAIO,UAAU,GAAGJ,UAAU,IAAI,IAAI,GAAGA,UAAU,GAAG,GAAG,GAAG,EAAE;EAE3D,IAAIE,gBAAgB,EAAE;IACpB,MAAMG,kBAAkB,GACtBF,UAAU,IAAI,IAAI,GAAG,IAAIG,MAAM,CAAC,GAAG,GAAGH,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE;IAE/DC,UAAU,IAAIF,gBAAgB,CAE3BK,OAAO,CAACF,kBAAkB,EAAE,EAAE,CAAC,CAE/BE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;EAC1B;EAGAH,UAAU,GAAGA,UAAU,CAACG,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;EAE3C,IAAIR,WAAW,EAAE;IAEf,OAAOA,WAAW,CAACK,UAAU,CAAC,IAAIA,UAAU;EAC9C,CAAC,MAAM;IACL,OAAOA,UAAU;EACnB;AACF","ignoreList":[]}
@@ -0,0 +1,462 @@
/**
* dd-draggable.ts 12.6.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/
import { DDManager } from './dd-manager';
import { Utils } from './utils';
import { DDBaseImplement } from './dd-base-impl';
import { isTouch, touchend, touchmove, touchstart, pointerdown, DDTouch } from './dd-touch';
// make sure we are not clicking on known object that handles mouseDown
const skipMouseDown = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
// let count = 0; // TEST
class DDDraggable extends DDBaseImplement {
constructor(el, option = {}) {
super();
this.el = el;
this.option = option;
/** @internal */
this.dragTransform = {
xScale: 1,
yScale: 1,
xOffset: 0,
yOffset: 0
};
/** @internal single tick of the auto-scroll animation loop */
this._autoScrollTick = () => {
const el = this.helper;
const scrollCont = this._autoScrollContainer;
if (!el || !scrollCont) {
this._stopScrolling();
return;
}
const clipping = this._getClipping(el, scrollCont);
if (clipping === 0) {
this._stopScrolling();
return;
}
if (!this._autoScrollMaxSpeed) {
const viewportH = window.innerHeight || document.documentElement.clientHeight;
this._autoScrollMaxSpeed = Math.max(viewportH / 150, 4);
}
const absPx = Math.abs(clipping);
const speed = Math.min(absPx * 0.5, this._autoScrollMaxSpeed);
const scrollAmount = clipping > 0 ? speed : -speed;
const prevScroll = scrollCont.scrollTop;
scrollCont.scrollTop += scrollAmount;
if (scrollCont.scrollTop === prevScroll) {
this._stopScrolling();
return;
}
if (this.dragging && this.lastDrag) {
this._dragFollow(this.lastDrag);
this._callDrag(this.lastDrag);
}
this._autoScrollAnimId = requestAnimationFrame(this._autoScrollTick);
};
// get the element that is actually supposed to be dragged by
const handleName = option?.handle?.substring(1);
const n = el.gridstackNode;
this.dragEls = !handleName || el.classList.contains(handleName) ? [el] : (n?.subGrid ? [el.querySelector(option.handle) || el] : this.getAllHandles());
if (this.dragEls.length === 0) {
this.dragEls = [el];
}
// create var event binding so we can easily remove and still look like TS methods (unlike anonymous functions)
this._mouseDown = this._mouseDown.bind(this);
this._mouseMove = this._mouseMove.bind(this);
this._mouseUp = this._mouseUp.bind(this);
this._keyEvent = this._keyEvent.bind(this);
this.enable();
}
/** return all handles omitting other nested `.grid-stack-item` children (in case node.subGrid isn't set for some reason) */
getAllHandles() {
return Array.from(this.el.querySelectorAll(this.option.handle)).filter((node) => {
if (!(node instanceof HTMLElement))
return false;
const owner = node.closest('.grid-stack-item');
return owner === this.el || !owner;
});
}
on(event, callback) {
super.on(event, callback);
}
off(event) {
super.off(event);
}
enable() {
if (this.disabled === false)
return;
super.enable();
this.dragEls.forEach(dragEl => {
dragEl.addEventListener('mousedown', this._mouseDown);
if (isTouch) {
dragEl.addEventListener('touchstart', touchstart);
dragEl.addEventListener('pointerdown', pointerdown);
// dragEl.style.touchAction = 'none'; // not needed unlike pointerdown doc comment
}
});
this.el.classList.remove('ui-draggable-disabled');
}
disable(forDestroy = false) {
if (this.disabled === true)
return;
super.disable();
this.dragEls.forEach(dragEl => {
dragEl.removeEventListener('mousedown', this._mouseDown);
if (isTouch) {
dragEl.removeEventListener('touchstart', touchstart);
dragEl.removeEventListener('pointerdown', pointerdown);
}
});
if (!forDestroy)
this.el.classList.add('ui-draggable-disabled');
}
destroy() {
if (this.dragTimeout)
window.clearTimeout(this.dragTimeout);
delete this.dragTimeout;
if (this.mouseDownEvent)
this._mouseUp(this.mouseDownEvent);
this.disable(true);
delete this.el;
delete this.helper;
delete this.option;
super.destroy();
}
updateOption(opts) {
Object.keys(opts).forEach(key => this.option[key] = opts[key]);
return this;
}
/** @internal call when mouse goes down before a dragstart happens */
_mouseDown(e) {
// if real brower event (trusted:true vs false for our simulated ones) and we didn't correctly clear the last touch event, clear things up
if (DDTouch.touchHandled && e.isTrusted)
DDTouch.touchHandled = false;
// don't let more than one widget handle mouseStart
if (DDManager.mouseHandled)
return;
if (e.button !== 0)
return true; // only left click
// make sure we are not clicking on known object that handles mouseDown, or ones supplied by the user
if (!this.dragEls.find(el => el === e.target) && e.target.closest(skipMouseDown))
return true;
if (this.option.cancel) {
if (e.target.closest(this.option.cancel))
return true;
}
this.mouseDownEvent = e;
delete this.dragging;
delete DDManager.dragElement;
delete DDManager.dropElement;
delete this._autoScrollMaxSpeed;
delete this._autoScrollContainer;
// document handler so we can continue receiving moves as the item is 'fixed' position, and capture=true so WE get a first crack
document.addEventListener('mousemove', this._mouseMove, { capture: true, passive: true }); // true=capture, not bubble
document.addEventListener('mouseup', this._mouseUp, true);
if (isTouch) {
e.currentTarget.addEventListener('touchmove', touchmove);
e.currentTarget.addEventListener('touchend', touchend);
}
e.preventDefault();
// preventDefault() prevents blur event which occurs just after mousedown event.
// if an editable content has focus, then blur must be call
if (document.activeElement)
document.activeElement.blur();
DDManager.mouseHandled = true;
return true;
}
/** @internal method to call actual drag event */
_callDrag(e) {
if (!this.dragging)
return;
const ev = Utils.initEvent(e, { target: this.el, type: 'drag' });
if (this.option.drag) {
this.option.drag(ev, this.ui());
}
this.triggerEvent('drag', ev);
}
/** @internal called when the main page (after successful mousedown) receives a move event to drag the item around the screen */
_mouseMove(e) {
// console.log(`${count++} move ${e.x},${e.y}`)
const s = this.mouseDownEvent;
this.lastDrag = e;
if (this.dragging) {
this._dragFollow(e);
// delay actual grid handling drag until we pause for a while if set
if (DDManager.pauseDrag) {
const pause = Number.isInteger(DDManager.pauseDrag) ? DDManager.pauseDrag : 100;
if (this.dragTimeout)
window.clearTimeout(this.dragTimeout);
this.dragTimeout = window.setTimeout(() => this._callDrag(e), pause);
}
else {
this._callDrag(e);
}
}
else if (Math.abs(e.x - s.x) + Math.abs(e.y - s.y) > 3) {
/**
* don't start unless we've moved at least 3 pixels
*/
this.dragging = true;
DDManager.dragElement = this;
// if we're dragging an actual grid item, set the current drop as the grid (to detect enter/leave)
const grid = this.el.gridstackNode?.grid;
if (grid) {
DDManager.dropElement = grid.el.ddElement.ddDroppable;
}
else {
delete DDManager.dropElement;
}
this.helper = this._createHelper();
this._setupHelperContainmentStyle();
this.dragTransform = Utils.getValuesFromTransformedElement(this.helperContainment);
this.dragOffset = this._getDragOffset(e, this.el, this.helperContainment);
this._setupHelperStyle(e);
const ev = Utils.initEvent(e, { target: this.el, type: 'dragstart' });
if (this.option.start) {
this.option.start(ev, this.ui());
}
this.triggerEvent('dragstart', ev);
// now track keyboard events to cancel or rotate
document.addEventListener('keydown', this._keyEvent);
}
// e.preventDefault(); // passive = true. OLD: was needed otherwise we get text sweep text selection as we drag around
return true;
}
/** @internal call when the mouse gets released to drop the item at current location */
_mouseUp(e) {
this._stopScrolling();
document.removeEventListener('mousemove', this._mouseMove, true);
document.removeEventListener('mouseup', this._mouseUp, true);
if (isTouch && e.currentTarget) { // destroy() during nested grid call us again wit fake _mouseUp
e.currentTarget.removeEventListener('touchmove', touchmove, true);
e.currentTarget.removeEventListener('touchend', touchend, true);
}
if (this.dragging) {
delete this.dragging;
delete this.el.gridstackNode?._origRotate;
document.removeEventListener('keydown', this._keyEvent);
// reset the drop target if dragging over ourself (already parented, just moving during stop callback below)
if (DDManager.dropElement?.el === this.el.parentElement) {
delete DDManager.dropElement;
}
this.helperContainment.style.position = this.parentOriginStylePosition || null;
if (this.helper !== this.el)
this.helper.remove(); // hide now
this._removeHelperStyle();
const ev = Utils.initEvent(e, { target: this.el, type: 'dragstop' });
if (this.option.stop) {
this.option.stop(ev); // NOTE: destroy() will be called when removing item, so expect NULL ptr after!
}
this.triggerEvent('dragstop', ev);
// call the droppable method to receive the item
if (DDManager.dropElement) {
DDManager.dropElement.drop(e);
}
}
delete this.helper;
delete this.mouseDownEvent;
delete DDManager.dragElement;
delete DDManager.dropElement;
delete DDManager.mouseHandled;
e.preventDefault();
}
/** @internal call when keys are being pressed - use Esc to cancel, R to rotate */
_keyEvent(e) {
const n = this.el.gridstackNode;
const grid = n?.grid || DDManager.dropElement?.el?.gridstack;
if (e.key === 'Escape') {
if (n && n._origRotate) {
n._orig = n._origRotate;
delete n._origRotate;
}
grid?.cancelDrag();
this._mouseUp(this.mouseDownEvent);
}
else if (n && grid && (e.key === 'r' || e.key === 'R')) {
if (!Utils.canBeRotated(n))
return;
n._origRotate = n._origRotate || { ...n._orig }; // store the real orig size in case we Esc after doing rotation
delete n._moving; // force rotate to happen (move waits for >50% coverage otherwise)
grid.setAnimation(false) // immediate rotate so _getDragOffset() gets the right dom size below
.rotate(n.el, {
top: -this.dragOffset.offsetTop,
left: -this.dragOffset.offsetX
})
.setAnimation();
n._moving = true;
this.dragOffset = this._getDragOffset(this.lastDrag, n.el, this.helperContainment);
this.helper.style.width = this.dragOffset.width + 'px';
this.helper.style.height = this.dragOffset.height + 'px';
Utils.swap(n._orig, 'w', 'h');
delete n._rect;
this._mouseMove(this.lastDrag);
}
}
/** @internal create a clone copy (or user defined method) of the original drag item if set */
_createHelper() {
let helper = this.el;
if (typeof this.option.helper === 'function') {
helper = this.option.helper(this.el);
}
else if (this.option.helper === 'clone') {
helper = Utils.cloneNode(this.el);
}
if (!helper.parentElement) {
Utils.appendTo(helper, this.option.appendTo === 'parent' ? this.el.parentElement : this.option.appendTo);
}
this.dragElementOriginStyle = DDDraggable.originStyleProp.map(prop => this.el.style[prop]);
return helper;
}
/** @internal set the fix position of the dragged item */
_setupHelperStyle(e) {
this.helper.classList.add('ui-draggable-dragging');
this.el.gridstackNode?.grid?.el.classList.add('grid-stack-dragging');
// TODO: set all at once with style.cssText += ... ? https://stackoverflow.com/questions/3968593
const style = this.helper.style;
style.pointerEvents = 'none'; // needed for over items to get enter/leave
// style.cursor = 'move'; // TODO: can't set with pointerEvents=none ! (no longer in CSS either as no-op)
style.width = this.dragOffset.width + 'px';
style.height = this.dragOffset.height + 'px';
style.willChange = 'left, right, top';
style.position = 'fixed'; // let us drag between grids by not clipping as parent .grid-stack is position: 'relative'
this._dragFollow(e); // now position it
style.transition = 'none'; // show up instantly
setTimeout(() => {
if (this.helper) {
style.transition = null; // recover animation
}
}, 0);
return this;
}
/** @internal restore back the original style before dragging */
_removeHelperStyle() {
this.helper.classList.remove('ui-draggable-dragging');
this.el.gridstackNode?.grid?.el.classList.remove('grid-stack-dragging');
const node = this.helper?.gridstackNode;
// don't bother restoring styles if we're gonna remove anyway...
if (!node?._isAboutToRemove && this.dragElementOriginStyle) {
const helper = this.helper;
// don't animate, otherwise we animate offseted when switching back to 'absolute' from 'fixed'.
// TODO: this also removes resizing animation which doesn't have this issue, but others.
// Ideally both would animate ('move' would immediately restore 'absolute' and adjust coordinate to match,
// then trigger a delay (repaint) to restore to final dest with animate) but then we need to make sure 'resizestop'
// is called AFTER 'transitionend' event is received (see https://github.com/gridstack/gridstack.js/issues/2033)
const transition = this.dragElementOriginStyle['transition'] || null;
helper.style.transition = this.dragElementOriginStyle['transition'] = 'none'; // can't be NULL #1973
DDDraggable.originStyleProp.forEach(prop => helper.style[prop] = this.dragElementOriginStyle[prop] || null);
setTimeout(() => helper.style.transition = transition, 50); // recover animation from saved vars after a pause (0 isn't enough #1973)
}
delete this.dragElementOriginStyle;
return this;
}
/** @internal updates the top/left position to follow the mouse */
_dragFollow(e) {
const style = this.helper.style;
const offset = this.dragOffset;
if (this.option.rtl) {
style.right = ((window.innerWidth - e.clientX) + offset.offsetX) * this.dragTransform.xScale + 'px';
if (style.left)
style.left = '';
}
else {
style.left = (e.clientX + offset.offsetX) * this.dragTransform.xScale + 'px';
if (style.right)
style.right = '';
}
style.top = (e.clientY + offset.offsetTop) * this.dragTransform.yScale + 'px';
}
/** @internal */
_setupHelperContainmentStyle() {
this.helperContainment = this.helper.parentElement;
if (this.helper.style.position !== 'fixed') {
this.parentOriginStylePosition = this.helperContainment.style.position;
if (getComputedStyle(this.helperContainment).position.match(/static/)) {
this.helperContainment.style.position = 'relative';
}
}
return this;
}
/** @internal */
_getDragOffset(event, el, parent) {
// in case ancestor has transform/perspective css properties that change the viewpoint
let xformOffsetX = 0;
let xformOffsetY = 0;
if (parent) {
xformOffsetX = this.dragTransform.xOffset;
xformOffsetY = this.dragTransform.yOffset;
}
const targetOffset = el.getBoundingClientRect();
let x = this.option.rtl ? targetOffset.right : targetOffset.left;
let offsetX = this.option.rtl
? (event.clientX - targetOffset.right + xformOffsetX)
: (-event.clientX + targetOffset.left - xformOffsetX);
return {
x,
top: targetOffset.top,
offsetX,
offsetTop: -event.clientY + targetOffset.top - xformOffsetY,
width: targetOffset.width * this.dragTransform.xScale,
height: targetOffset.height * this.dragTransform.yScale
};
}
/** @internal starts or continues auto-scroll when the dragged helper is clipped by the scroll container.
* Takes the grid's own element to find the scroll container so external/sidebar drags work too (#2074). */
updateScrollPosition(gridEl) {
this._autoScrollContainer = Utils.getScrollElement(gridEl); // always use latest active grid
const clipping = this._getClipping(this.helper, this._autoScrollContainer);
if (clipping === 0) {
this._stopScrolling();
}
else if (!this._autoScrollAnimId) {
this._autoScrollAnimId = requestAnimationFrame(this._autoScrollTick);
}
}
/** @internal compute how many pixels the element is clipped: negative = above, positive = below, 0 = fully inside OR outside (stop scrolling) */
_getClipping(el, scrollEl) {
const elRect = el.getBoundingClientRect();
const scrollRect = scrollEl.getBoundingClientRect();
const viewportH = window.innerHeight || document.documentElement.clientHeight;
if (elRect.bottom < scrollRect.top || elRect.top > scrollRect.bottom)
return 0; // fully outside
const clippedBelow = elRect.bottom - Math.min(scrollRect.bottom, viewportH);
const clippedAbove = elRect.top - Math.max(scrollRect.top, 0);
if (clippedAbove < 0)
return clippedAbove;
if (clippedBelow > 0)
return clippedBelow;
return 0;
}
/** @internal stop any active auto-scroll animation */
_stopScrolling() {
if (this._autoScrollAnimId) {
cancelAnimationFrame(this._autoScrollAnimId);
delete this._autoScrollAnimId;
}
}
/** @internal TODO: set to public as called by DDDroppable! */
ui() {
const containmentEl = this.el.parentElement;
const containmentRect = containmentEl.getBoundingClientRect();
const offset = this.helper.getBoundingClientRect();
// RTL: GridStack measures column positions from the right side of the container,
// so we report `left` as the distance between the helper's right edge and the
// container's right edge (both in viewport-left coordinates via getBoundingClientRect).
const leftPos = this.option.rtl
? (containmentRect.right - offset.right) * this.dragTransform.xScale
: (offset.left - containmentRect.left) * this.dragTransform.xScale;
return {
position: {
top: (offset.top - containmentRect.top) * this.dragTransform.yScale,
left: leftPos
}
/* not used by GridStack for now...
helper: [this.helper], //The object arr representing the helper that's being dragged.
offset: { top: offset.top, left: offset.left } // Current offset position of the helper as { top, left } object.
*/
};
}
}
/** @internal properties we change during dragging, and restore back */
DDDraggable.originStyleProp = ['width', 'height', 'transform', 'transform-origin', 'transition', 'pointerEvents', 'position', 'left', 'right', 'top', 'minWidth', 'willChange'];
export { DDDraggable };
//# sourceMappingURL=dd-draggable.js.map
@@ -0,0 +1,29 @@
(function(t){function e(){var o=t();return o.default||o}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var f=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};f.prettier=e()}})(function(){"use strict";var yt=Object.defineProperty;var Ru=Object.getOwnPropertyDescriptor;var vu=Object.getOwnPropertyNames;var Lu=Object.prototype.hasOwnProperty;var At=(t,e)=>{for(var r in e)yt(t,r,{get:e[r],enumerable:!0})},Mu=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of vu(e))!Lu.call(t,u)&&u!==r&&yt(t,u,{get:()=>e[u],enumerable:!(n=Ru(e,u))||n.enumerable});return t};var Yu=t=>Mu(yt({},"__esModule",{value:!0}),t);var Ji={};At(Ji,{__debug:()=>Hi,check:()=>Gi,doc:()=>cr,format:()=>Su,formatWithCursor:()=>Pu,getSupportInfo:()=>Ki,util:()=>lr,version:()=>_u});var X=(t,e)=>(r,n,...u)=>r|1&&n==null?void 0:(e.call(n)??n[t]).apply(n,u);var ju=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},Uu=X("replaceAll",function(){if(typeof this=="string")return ju}),ne=Uu;var Ne=class{diff(e,r,n={}){let u;typeof n=="function"?(u=n,n={}):"callback"in n&&(u=n.callback);let o=this.castInput(e,n),i=this.castInput(r,n),D=this.removeEmpty(this.tokenize(o,n)),s=this.removeEmpty(this.tokenize(i,n));return this.diffWithOptionsObj(D,s,n,u)}diffWithOptionsObj(e,r,n,u){var o;let i=C=>{if(C=this.postProcess(C,n),u){setTimeout(function(){u(C)},0);return}else return C},D=r.length,s=e.length,a=1,c=D+s;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let p=(o=n.timeout)!==null&&o!==void 0?o:1/0,l=Date.now()+p,m=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(m[0],r,e,0,n);if(m[0].oldPos+1>=s&&f+1>=D)return i(this.buildValues(m[0].lastComponent,r,e));let F=-1/0,d=1/0,E=()=>{for(let C=Math.max(F,-a);C<=Math.min(d,a);C+=2){let h,_=m[C-1],P=m[C+1];_&&(m[C-1]=void 0);let A=!1;if(P){let J=P.oldPos-C;A=P&&0<=J&&J<D}let B=_&&_.oldPos+1<s;if(!A&&!B){m[C]=void 0;continue}if(!B||A&&_.oldPos<P.oldPos?h=this.addToPath(P,!0,!1,0,n):h=this.addToPath(_,!1,!0,1,n),f=this.extractCommon(h,r,e,C,n),h.oldPos+1>=s&&f+1>=D)return i(this.buildValues(h.lastComponent,r,e))||!0;m[C]=h,h.oldPos+1>=s&&(d=Math.min(d,C-1)),f+1>=D&&(F=Math.max(F,C+1))}a++};if(u)(function C(){setTimeout(function(){if(a>c||Date.now()>l)return u(void 0);E()||C()},0)})();else for(;a<=c&&Date.now()<=l;){let C=E();if(C)return C}}addToPath(e,r,n,u,o){let i=e.lastComponent;return i&&!o.oneChangePerToken&&i.added===r&&i.removed===n?{oldPos:e.oldPos+u,lastComponent:{count:i.count+1,added:r,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+u,lastComponent:{count:1,added:r,removed:n,previousComponent:i}}}extractCommon(e,r,n,u,o){let i=r.length,D=n.length,s=e.oldPos,a=s-u,c=0;for(;a+1<i&&s+1<D&&this.equals(n[s+1],r[a+1],o);)a++,s++,c++,o.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!o.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,a}equals(e,r,n){return n.comparator?n.comparator(e,r):e===r||!!n.ignoreCase&&e.toLowerCase()===r.toLowerCase()}removeEmpty(e){let r=[];for(let n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r}castInput(e,r){return e}tokenize(e,r){return Array.from(e)}join(e){return e.join("")}postProcess(e,r){return e}get useLongestToken(){return!1}buildValues(e,r,n){let u=[],o;for(;e;)u.push(e),o=e.previousComponent,delete e.previousComponent,e=o;u.reverse();let i=u.length,D=0,s=0,a=0;for(;D<i;D++){let c=u[D];if(c.removed)c.value=this.join(n.slice(a,a+c.count)),a+=c.count;else{if(!c.added&&this.useLongestToken){let p=r.slice(s,s+c.count);p=p.map(function(l,m){let f=n[a+m];return f.length>l.length?f:l}),c.value=this.join(p)}else c.value=this.join(r.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}return u}};var xt=class extends Ne{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}},mr=new xt;function Bt(t,e,r){return mr.diff(t,e,r)}var Vu=()=>{},k=Vu;var Fr="cr",Er="crlf",Wu="lf",$u=Wu,Tt="\r",Cr=`\r
`,ze=`
`,zu=ze;function hr(t){let e=t.indexOf(Tt);return e!==-1?t.charAt(e+1)===ze?Er:Fr:$u}function we(t){return t===Fr?Tt:t===Er?Cr:zu}var Gu=new Map([[ze,/\n/g],[Tt,/\r/g],[Cr,/\r\n/g]]);function Nt(t,e){let r=Gu.get(e);return t.match(r)?.length??0}var Ku=/\r\n?/g;function gr(t){return ne(0,t,Ku,ze)}var ue=Symbol.for("comments");function Hu(t){return this[t<0?this.length+t:t]}var Ju=X("at",function(){if(Array.isArray(this)||typeof this=="string")return Hu}),y=Ju;var G="string",U="array",V="cursor",I="indent",R="align",v="trim",x="group",S="fill",T="if-break",L="indent-if-break",M="line-suffix",Y="line-suffix-boundary",g="line",b="label",N="break-parent",Ge=new Set([V,I,R,v,x,S,T,L,M,Y,g,b,N]);function _r(t){let e=t.length;for(;e>0&&(t[e-1]==="\r"||t[e-1]===`
`);)e--;return e<t.length?t.slice(0,e):t}function Fe(t,e,r){if(!t.has(e)){let n=r(e);t.set(e,n)}return t.get(e)}function qu(t){if(typeof t=="string")return G;if(Array.isArray(t))return U;if(!t)return;let{type:e}=t;if(Ge.has(e))return e}var q=qu;var Xu=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Qu(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
Expected it to be 'string' or 'object'.`;if(q(t))throw new Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=Xu([...Ge].map(u=>`'${u}'`));return`Unexpected doc.type '${t.type}'.
Expected it to be ${n}.`}var wt=class extends Error{name="InvalidDocError";constructor(e){super(Qu(e)),this.doc=e}},Z=wt;var yr={};function Zu(t,e,r,n){let u=[t];for(;u.length>0;){let o=u.pop();if(o===yr){r(u.pop());continue}r&&u.push(o,yr);let i=q(o);if(!i)throw new Z(o);if(e?.(o)!==!1)switch(i){case U:case S:{let D=i===U?o:o.parts;for(let s=D.length,a=s-1;a>=0;--a)u.push(D[a]);break}case T:u.push(o.flatContents,o.breakContents);break;case x:if(n&&o.expandedStates)for(let D=o.expandedStates.length,s=D-1;s>=0;--s)u.push(o.expandedStates[s]);else u.push(o.contents);break;case R:case I:case L:case b:case M:u.push(o.contents);break;case G:case V:case v:case Y:case g:case N:break;default:throw new Z(o)}}}var Oe=Zu;function Se(t,e){if(typeof t=="string")return e(t);let r=new Map;return n(t);function n(o){return Fe(r,o,u)}function u(o){switch(q(o)){case U:return e(o.map(n));case S:return e({...o,parts:o.parts.map(n)});case T:return e({...o,breakContents:n(o.breakContents),flatContents:n(o.flatContents)});case x:{let{expandedStates:i,contents:D}=o;return i?(i=i.map(n),D=i[0]):D=n(D),e({...o,contents:D,expandedStates:i})}case R:case I:case L:case b:case M:return e({...o,contents:n(o.contents)});case G:case V:case v:case Y:case g:case N:return e(o);default:throw new Z(o)}}}function Ke(t,e,r){let n=r,u=!1;function o(i){if(u)return!1;let D=e(i);D!==void 0&&(u=!0,n=D)}return Oe(t,o),n}function eo(t){if(t.type===x&&t.break||t.type===g&&t.hard||t.type===N)return!0}function Br(t){return Ke(t,eo,!1)}function Ar(t){if(t.length>0){let e=y(0,t,-1);!e.expandedStates&&!e.break&&(e.break="propagated")}return null}function Tr(t){let e=new Set,r=[];function n(o){if(o.type===N&&Ar(r),o.type===x){if(r.push(o),e.has(o))return!1;e.add(o)}}function u(o){o.type===x&&r.pop().break&&Ar(r)}Oe(t,n,u,!0)}function to(t){return t.type===g&&!t.hard?t.soft?"":" ":t.type===T?t.flatContents:t}function Nr(t){return Se(t,to)}function xr(t){for(t=[...t];t.length>=2&&y(0,t,-2).type===g&&y(0,t,-1).type===N;)t.length-=2;if(t.length>0){let e=Pe(y(0,t,-1));t[t.length-1]=e}return t}function Pe(t){switch(q(t)){case I:case L:case x:case M:case b:{let e=Pe(t.contents);return{...t,contents:e}}case T:return{...t,breakContents:Pe(t.breakContents),flatContents:Pe(t.flatContents)};case S:return{...t,parts:xr(t.parts)};case U:return xr(t);case G:return _r(t);case R:case V:case v:case Y:case g:case N:break;default:throw new Z(t)}return t}function He(t){return Pe(no(t))}function ro(t){switch(q(t)){case S:{let{parts:e}=t;if(e.every(r=>r===""))return"";if(e.length===1)return e[0];break}case x:if(!t.contents&&!t.id&&!t.break&&!t.expandedStates)return"";if(t.contents.type===x&&t.contents.id===t.id&&t.contents.break===t.break&&t.contents.expandedStates===t.expandedStates)return t.contents;break;case R:case I:case L:case M:if(!t.contents)return"";break;case T:if(!t.flatContents&&!t.breakContents)return"";break;case U:{let e=[];for(let r of t){if(!r)continue;let[n,...u]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof y(0,e,-1)=="string"?e[e.length-1]+=n:e.push(n),e.push(...u)}return e.length===0?"":e.length===1?e[0]:e}case G:case V:case v:case Y:case g:case b:case N:break;default:throw new Z(t)}return t}function no(t){return Se(t,e=>ro(e))}function wr(t,e=Je){return Se(t,r=>typeof r=="string"?be(e,r.split(`
`)):r)}function uo(t){if(t.type===g)return!0}function Or(t){return Ke(t,uo,!1)}function Ee(t,e){return t.type===b?{...t,contents:e(t.contents)}:e(t)}var w=k,qe=k,Pr=k,Sr=k;function oe(t){return w(t),{type:I,contents:t}}function De(t,e){return Sr(t),w(e),{type:R,contents:e,n:t}}function br(t){return De(Number.NEGATIVE_INFINITY,t)}function Xe(t){return De({type:"root"},t)}function kr(t){return De(-1,t)}function Qe(t,e,r){w(t);let n=t;if(e>0){for(let u=0;u<Math.floor(e/r);++u)n=oe(n);n=De(e%r,n),n=De(Number.NEGATIVE_INFINITY,n)}return n}var ae={type:N};var ee={type:V};function Ir(t){return Pr(t),{type:S,parts:t}}function Ot(t,e={}){return w(t),qe(e.expandedStates,!0),{type:x,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function Rr(t,e){return Ot(t[0],{...e,expandedStates:t})}function vr(t,e="",r={}){return w(t),e!==""&&w(e),{type:T,breakContents:t,flatContents:e,groupId:r.groupId}}function Lr(t,e){return w(t),{type:L,contents:t,groupId:e.groupId,negate:e.negate}}function be(t,e){w(t),qe(e);let r=[];for(let n=0;n<e.length;n++)n!==0&&r.push(t),r.push(e[n]);return r}function Mr(t,e){return w(e),t?{type:b,label:t,contents:e}:e}var Ze={type:g},Yr={type:g,soft:!0},ke={type:g,hard:!0},W=[ke,ae],Pt={type:g,hard:!0,literal:!0},Je=[Pt,ae];function Ie(t){return w(t),{type:M,contents:t}}var jr={type:Y};var Ur={type:v};function te(t){if(!t)return"";if(Array.isArray(t)){let e=[];for(let r of t)if(Array.isArray(r))e.push(...te(r));else{let n=te(r);n!==""&&e.push(n)}return e}return t.type===T?{...t,breakContents:te(t.breakContents),flatContents:te(t.flatContents)}:t.type===x?{...t,contents:te(t.contents),expandedStates:t.expandedStates?.map(te)}:t.type===S?{type:"fill",parts:t.parts.map(te)}:t.contents?{...t,contents:te(t.contents)}:t}function Vr(t){let e=Object.create(null),r=new Set;return n(te(t));function n(o,i,D){if(typeof o=="string")return JSON.stringify(o);if(Array.isArray(o)){let s=o.map(n).filter(Boolean);return s.length===1?s[0]:`[${s.join(", ")}]`}if(o.type===g){let s=D?.[i+1]?.type===N;return o.literal?s?"literalline":"literallineWithoutBreakParent":o.hard?s?"hardline":"hardlineWithoutBreakParent":o.soft?"softline":"line"}if(o.type===N)return D?.[i-1]?.type===g&&D[i-1].hard?void 0:"breakParent";if(o.type===v)return"trim";if(o.type===I)return"indent("+n(o.contents)+")";if(o.type===R)return o.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+n(o.contents)+")":o.n<0?"dedent("+n(o.contents)+")":o.n.type==="root"?"markAsRoot("+n(o.contents)+")":"align("+JSON.stringify(o.n)+", "+n(o.contents)+")";if(o.type===T)return"ifBreak("+n(o.breakContents)+(o.flatContents?", "+n(o.flatContents):"")+(o.groupId?(o.flatContents?"":', ""')+`, { groupId: ${u(o.groupId)} }`:"")+")";if(o.type===L){let s=[];o.negate&&s.push("negate: true"),o.groupId&&s.push(`groupId: ${u(o.groupId)}`);let a=s.length>0?`, { ${s.join(", ")} }`:"";return`indentIfBreak(${n(o.contents)}${a})`}if(o.type===x){let s=[];o.break&&o.break!=="propagated"&&s.push("shouldBreak: true"),o.id&&s.push(`id: ${u(o.id)}`);let a=s.length>0?`, { ${s.join(", ")} }`:"";return o.expandedStates?`conditionalGroup([${o.expandedStates.map(c=>n(c)).join(",")}]${a})`:`group(${n(o.contents)}${a})`}if(o.type===S)return`fill([${o.parts.map(s=>n(s)).join(", ")}])`;if(o.type===M)return"lineSuffix("+n(o.contents)+")";if(o.type===Y)return"lineSuffixBoundary";if(o.type===b)return`label(${JSON.stringify(o.label)}, ${n(o.contents)})`;if(o.type===V)return"cursor";throw new Error("Unknown doc type "+o.type)}function u(o){if(typeof o!="symbol")return JSON.stringify(String(o));if(o in e)return e[o];let i=o.description||"symbol";for(let D=0;;D++){let s=i+(D>0?` #${D}`:"");if(!r.has(s))return r.add(s),e[o]=`Symbol.for(${JSON.stringify(s)})`}}}var Wr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uLine truncated
`?ne(0,d,`
`,u):d;E&&(a.write(E),i.length>0&&(o+=Re(E)));break}case U:for(let E=d.length-1;E>=0;E--)i.push({indent:f,mode:F,doc:d[E]});break;case V:a.markPosition();break;case I:i.push({indent:Zr(f,e),mode:F,doc:d.contents});break;case R:i.push({indent:Qr(f,d.n,e),mode:F,doc:d.contents});break;case v:o-=a.trim();break;case x:{let E=(function(){if(F===Q&&!D)return{indent:f,mode:d.break?K:Q,doc:d.contents};D=!1;let h=n-o,_=s.length>0,P={indent:f,mode:Q,doc:d.contents};if(!d.break&&tt(P,i,h,_,r))return P;if(!d.expandedStates)return{indent:f,mode:K,doc:d.contents};if(!d.break)for(let A=1;A<d.expandedStates.length-1;A++){let B={indent:f,mode:Q,doc:d.expandedStates[A]};if(tt(B,i,h,_,r))return B}return{indent:f,mode:K,doc:y(0,d.expandedStates,-1)}})();i.push(E),d.id&&(r[d.id]=E.mode);break}case S:{let E=n-o,C=d[Lt]??0,{parts:h}=d,_=h.length-C;if(_===0)break;let P=h[C+0],A=h[C+1],B={indent:f,mode:Q,doc:P},J={indent:f,mode:K,doc:P},$e=tt(B,[],E,s.length>0,r,!0);if(_===1){$e?i.push(B):i.push(J);break}let pr={indent:f,mode:Q,doc:A},_t={indent:f,mode:K,doc:A};if(_===2){$e?i.push(pr,B):i.push(_t,J);break}let bu=h[C+2],ku={indent:f,mode:F,doc:{...d,[Lt]:C+2}},Iu=tt({indent:f,mode:Q,doc:[P,A,bu]},[],E,s.length>0,r,!0);i.push(ku),Iu?i.push(pr,B):$e?i.push(_t,B):i.push(_t,J);break}case T:case L:{let E=d.groupId?r[d.groupId]:F;if(E===K){let C=d.type===T?d.breakContents:d.negate?d.contents:oe(d.contents);C&&i.push({indent:f,mode:F,doc:C})}if(E===Q){let C=d.type===T?d.flatContents:d.negate?oe(d.contents):d.contents;C&&i.push({indent:f,mode:F,doc:C})}break}case M:s.push({indent:f,mode:F,doc:d.contents});break;case Y:s.length>0&&i.push({indent:f,mode:F,doc:ke});break;case g:switch(F){case Q:if(!d.hard){d.soft||(a.write(" "),o+=1);break}D=!0;case K:if(s.length>0){i.push({indent:f,mode:F,doc:d},...s.reverse()),s.length=0;break}d.literal?(a.write(u),o=0,f.root&&(f.root.value&&a.write(f.root.value),o=f.root.length)):(a.trim(),a.write(u+f.value),o=f.length);break}break;case b:i.push({indent:f,mode:F,doc:d.contents});break;case N:break;default:throw new Z(d)}i.length===0&&s.length>0&&(i.push(...s.reverse()),s.length=0)}let{text:c,positions:p}=a.finish();if(p.length!==2)return{formatted:c};let[l,m]=p;return{formatted:c,cursorNodeStart:l,cursorNodeText:c.slice(l,m)}}function mo(t,e,r=0){let n=0;for(let u=r;u<t.length;++u)t[u]===" "?n=n+e-n%e:n++;return n}var he=mo;var Mt=class{constructor(e){this.stack=[e]}get key(){let{stack:e,siblings:r}=this;return y(0,e,r===null?-2:-4)??null}get index(){return this.siblings===null?null:y(0,this.stack,-2)}get node(){return y(0,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:e}=this,r=y(0,e,-3);return Array.isArray(r)?r:null}get next(){let{siblings:e}=this;return e===null?null:e[this.index+1]}get previous(){let{siblings:e}=this;return e===null?null:e[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:e,index:r}=this;return e!==null&&r===e.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...this.#e()]}getName(){let{stack:e}=this,{length:r}=e;return r>1?y(0,e,-2):null}getValue(){return y(0,this.stack,-1)}getNode(e=0){let r=this.#t(e);return r===-1?null:this.stack[r]}getParentNode(e=0){return this.getNode(e+1)}#t(e){let{stack:r}=this;for(let n=r.length-1;n>=0;n-=2)if(!Array.isArray(r[n])&&--e<0)return n;return-1}call(e,...r){let{stack:n}=this,{length:u}=n,o=y(0,n,-1);for(let i of r)o=o?.[i],n.push(i,o);try{return e(this)}finally{n.length=u}}callParent(e,r=0){let n=this.#t(r+1),u=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...u)}}each(e,...r){let{stack:n}=this,{length:u}=n,o=y(0,n,-1);for(let i of r)o=o[i],n.push(i,o);try{for(let i=0;i<o.length;++i)n.push(i,o[i]),e(this,i,o),n.length-=2}finally{n.length=u}}map(e,...r){let n=[];return this.each((u,o,i)=>{n[o]=e(u,o,i)},...r),n}match(...e){let r=this.stack.length-1,n=null,u=this.stack[r--];for(let o of e){if(u===void 0)return!1;let i=null;if(typeof n=="number"&&(i=n,n=this.stack[r--],u=this.stack[r--]),o&&!o(u,n,i))return!1;n=this.stack[r--],u=this.stack[r--]}return!0}findAncestor(e){for(let r of this.#e())if(e(r))return r}hasAncestor(e){for(let r of this.#e())if(e(r))return!0;return!1}*#e(){let{stack:e}=this;for(let r=e.length-3;r>=0;r-=2){let n=e[r];Array.isArray(n)||(yield n)}}},tn=Mt;function Fo(t){return Array.isArray(t)&&t.length>0}var rt=Fo;function Eo(t){return t!==null&&typeof t=="object"}var ge=Eo;function _e(t){return(e,r,n)=>{if(r===!1)return!1;let u=!!n?.backwards,{length:o}=e,i=r;for(;i>=0&&i<o;){let D=e.charAt(i);if(t instanceof RegExp){if(!t.test(D))return i}else if(!t.includes(D))return i;u?i--:i++}return i===-1||i===o?i:!1}}var rn=_e(/\s/),j=_e(" "),nt=_e(",; "),ut=_e(/[^\n\r]/);var nn=t=>t===`
`||t==="\r"||t==="\u2028"||t==="\u2029";function Co(t,e,r){if(e===!1)return!1;let n=!!r?.backwards,u=t.charAt(e);if(n){if(t.charAt(e-1)==="\r"&&u===`
`)return e-2;if(nn(u))return e-1}else{if(u==="\r"&&t.charAt(e+1)===`
`)return e+2;if(nn(u))return e+1}return e}var $=Co;function ho(t,e,r={}){let n=j(t,r.backwards?e-1:e,r),u=$(t,n,r);return n!==u}var H=ho;function*ye(t,e){let{getVisitorKeys:r,filter:n=()=>!0}=e,u=o=>ge(o)&&n(o);for(let o of r(t)){let i=t[o];if(Array.isArray(i))for(let D of i)u(D)&&(yield D);else u(i)&&(yield i)}}function*un(t,e){let r=[t];for(let n=0;n<r.length;n++){let u=r[n];for(let o of ye(u,e))yield o,r.push(o)}}function on(t,e){return ye(t,e).next().done}function go(t,e,r){let{filter:n}=r;if(!n)return[];let u,o=(r.getChildren?.(t,r)??[...ye(t,{getVisitorKeys:r.getVisitorKeys})]).flatMap(s=>(u??(u=[t,...e]),n(s,u)?[s]:sn(s,u,r))),{locStart:i,locEnd:D}=r;return o.sort((s,a)=>i(s)-i(a)||D(s)-D(a)),o}function sn(t,e,r){return Fe(r.cache,t,n=>go(n,e,r))}var ot=sn;function _o(t){let e=t.type||t.kind||"(unknown type)",r=String(t.name||t.id&&(typeof t.id=="object"?t.id.name:t.id)||t.key&&(typeof t.key=="object"?t.key.name:t.key)||t.value&&(typeof t.value=="object"?"":String(t.value))||t.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),e+(r?" "+r:"")}function Yt(t,e){(t.comments??(t.comments=[])).push(e),e.printed=!1,e.nodeDescription=_o(t)}function ce(t,e){e.leading=!0,e.trailing=!1,Yt(t,e)}function re(t,e,r){e.leading=!1,e.trailing=!1,r&&(e.marker=r),Yt(t,e)}function fe(t,e){e.leading=!1,e.trailing=!0,Yt(t,e)}var Vt=new WeakMap;function an(t,e,r,n,u=[]){let{locStart:o,locEnd:i}=r,D=o(e),s=i(e),a=ot(t,u,{cache:Vt,locStart:o,locEnd:i,getVisitorKeys:r.getVisitorKeys,filter:r.printer.canAttachComment,getChildren:r.printer.getCommentChildNodes}),c,p,l=0,m=a.length;for(;l<m;){let f=l+m>>1,F=a[f],d=o(F),E=i(F);if(d<=D&&s<=E)return an(F,e,r,F,[F,...u]);if(E<=D){c=F,l=f+1;continue}if(s<=d){p=F,m=f;continue}throw new Error("Comment location overlaps with node location")}if(n?.type==="TemplateLiteral"){let{quasis:f}=n,F=Ut(f,e,r);c&&Ut(f,c,r)!==F&&(c=null),p&&Ut(f,p,r)!==F&&(p=null)}return{enclosingNode:n,precedingNode:c,followingNode:p}}var jt=()=>!1;function cn(t,e){let{comments:r}=t;if(delete t.comments,!rt(r)||!e.printer.canAttachComment)return;let n=[],{printer:{features:{experimental_avoidAstMutation:u},handleComments:o={}},originalText:i}=e,{ownLine:D=jt,endOfLine:s=jt,remaining:a=jt}=o,c=r.map((l,m)=>({...an(t,l,e),comment:l,text:i,options:e,ast:t,isLastComment:r.length-1===m,placement:void 0})),p=!u;for(let[l,m]of c.entries()){let{comment:f,precedingNode:F,enclosingNode:d,followingNode:E,text:C,options:h,ast:_,isLastComment:P}=m,A=yo(C,h,c,l)?"ownLine":Ao(C,h,c,l)?"endOfLine":"remaining",B;if(u?(m.placement=A,B=[m]):B=[f,C,h,_,P],p&&(f.enclosingNode=d,f.precedingNode=F,f.followingNode=E),f.placement=A,A==="ownLine")D(...B)||(E?ce(E,f):F?fe(F,f):d?re(d,f):re(_,f));else if(A==="endOfLine")s(...B)||(F?fe(F,f):E?ce(E,f):d?re(d,f):re(_,f));else if(!a(...B))if(F&&E){let J=n.length;J>0&&n[J-1].followingNode!==E&&Dn(n,h),n.push(m)}else F?fe(F,f):E?ce(E,f):d?re(d,f):re(_,f)}if(Dn(n,e),p)for(let l of r)delete l.precedingNode,delete l.enclosingNode,delete l.followingNode}var fn=t=>!/[\S\n\u2028\u2029]/.test(t);function yo(t,e,r,n){let{comment:u,precedingNode:o}=r[n],{locStart:i,locEnd:D}=e,s=i(u);if(o)for(let a=n-1;a>=0;a--){let{comment:c,precedingNode:p}=r[a];if(p!==o||!fn(t.slice(D(c),s)))break;s=i(c)}return H(t,s,{backwards:!0})}function Ao(t,e,r,n){let{comment:u,followingNode:o}=r[n],{locStart:i,locEnd:D}=e,s=D(u);if(o)for(let a=n+1;a<r.length;a++){let{comment:c,followingNode:p}=r[a];if(p!==o||!fn(t.slice(s,i(c))))break;s=D(c)}return H(t,s)}function Dn(t,e){let r=t.length;if(r===0)return;let{precedingNode:n,followingNode:u}=t[0],o=e.locStart(u),i;for(i=r;i>0;--i){let{comment:D,precedingNode:s,followingNode:a}=t[i-1];k(s,n),k(a,u);let c=e.originalText.slice(e.locEnd(D),o);if(e.printer.isGap?.(c,e)??/^[\s(]*$/.test(c))o=e.locStart(D);else break}for(let[D,{comment:s}]of t.entries())D<i?fe(n,s):ce(u,s);for(let D of[n,u])D.comments&&D.comments.length>1&&D.comments.sort((s,a)=>e.locStart(s)-e.locStart(a));t.length=0}function Ut(t,e,r){let n=r.locStart(e)-1;for(let u=1;u<t.length;++u)if(n<r.locStart(t[u]))return u-1;return 0}function xo(t,e){let r=e-1;r=j(t,r,{backwards:!0}),r=$(t,r,{backwards:!0}),r=j(t,r,{backwards:!0});let n=$(t,r,{backwards:!0});return r!==n}var ve=xo;var ln=()=>!0;function pn(t,e){let r=t.node;return r.printed=!0,e.printer.printComment(t,e)}function Bo(t,e){let r=t.node,n=[pn(t,e)],{printer:u,originalText:o,locStart:i,locEnd:D}=e;if(u.isBlockComment?.(r)){let c=" ";H(o,D(r))&&(H(o,i(r),{backwards:!0})?c=W:c=Ze),n.push(c)}else n.push(W);let a=$(o,j(o,D(r)));return a!==!1&&H(o,a)&&n.push(W),n}function To(t,e,r){let n=t.node,u=pn(t,e),{printer:o,originalText:i,locStart:D}=e,s=o.isBlockComment?.(n);if(r?.hasLineSuffix&&!r?.isBlock||H(i,D(n),{backwards:!0})){let a=ve(i,D(n));return{doc:Ie([W,a?W:"",u]),isBlock:s,hasLineSuffix:!0}}return!s||r?.hasLineSuffix?{doc:[Ie([" ",u]),ae],isBlock:s,hasLineSuffix:!0}:{doc:[" ",u],isBlock:s,hasLineSuffix:!1}}function No(t,e,r){let n=e[Symbol.for("printedCommLine truncated
(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:t=>typeof t=="string"||typeof t=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:t=>typeof t=="string"||typeof t=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function it({plugins:t=[],showDeprecated:e=!1}={}){let r=t.flatMap(u=>u.languages??[]),n=[];for(let u of So(Object.assign({},...t.map(({options:o})=>o),En)))!e&&u.deprecated||(Array.isArray(u.choices)&&(e||(u.choices=u.choices.filter(o=>!o.deprecated)),u.name==="parser"&&(u.choices=[...u.choices,...Po(u.choices,r,t)])),u.pluginDefaults=Object.fromEntries(t.filter(o=>o.defaultOptions?.[u.name]!==void 0).map(o=>[o.name,o.defaultOptions[u.name]])),n.push(u));return{languages:r,options:n}}function*Po(t,e,r){let n=new Set(t.map(u=>u.value));for(let u of e)if(u.parsers){for(let o of u.parsers)if(!n.has(o)){n.add(o);let i=r.find(s=>s.parsers&&le(s.parsers,o)),D=u.name;i?.name&&(D+=` (plugin: ${i.name})`),yield{value:o,description:D}}}}function So(t){let e=[];for(let[r,n]of Object.entries(t)){let u={name:r,...n};Array.isArray(u.default)&&(u.default=y(0,u.default,-1).value),e.push(u)}return e}var bo=Array.prototype.toReversed??function(){return[...this].reverse()},ko=X("toReversed",function(){if(Array.isArray(this))return bo}),Cn=ko;function Io(){let t=globalThis,e=t.process?.platform;if(typeof e=="string")return e.startsWith("win");let r=t.Deno?.build?.os;return typeof r=="string"?r==="windows":t.navigator?.platform?.startsWith("Win")??!1}var Ro=Io();function hn(t){if(t=t instanceof URL?t:new URL(t),t.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${t.protocol}"`);return t}function vo(t){return t=hn(t),decodeURIComponent(t.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function Lo(t){t=hn(t);let e=decodeURIComponent(t.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return t.hostname!==""&&(e=`\\\\${t.hostname}${e}`),e}function Wt(t){return Ro?Lo(t):vo(t)}var gn=t=>String(t).split(/[/\\]/).pop(),_n=t=>String(t).startsWith("file:");function yn(t,e){if(!e)return;let r=gn(e).toLowerCase();return t.find(({filenames:n})=>n?.some(u=>u.toLowerCase()===r))??t.find(({extensions:n})=>n?.some(u=>r.endsWith(u)))}function Mo(t,e){if(e)return t.find(({name:r})=>r.toLowerCase()===e)??t.find(({aliases:r})=>r?.includes(e))??t.find(({extensions:r})=>r?.includes(`.${e}`))}var Yo=void 0;function An(t,e){if(e){if(_n(e))try{e=Wt(e)}catch{return}if(typeof e=="string")return t.find(({isSupported:r})=>r?.({filepath:e}))}}function jo(t,e){let r=Cn(0,t.plugins).flatMap(u=>u.languages??[]);return(Mo(r,e.language)??yn(r,e.physicalFile)??yn(r,e.file)??An(r,e.physicalFile)??An(r,e.file)??Yo?.(r,e.physicalFile))?.parsers[0]}var st=jo;var ie={key:t=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(t)?t:JSON.stringify(t),value(t){if(t===null||typeof t!="object")return JSON.stringify(t);if(Array.isArray(t))return`[${t.map(r=>ie.value(r)).join(", ")}]`;let e=Object.keys(t);return e.length===0?"{}":`{ ${e.map(r=>`${ie.key(r)}: ${ie.value(t[r])}`).join(", ")} }`},pair:({key:t,value:e})=>ie.value({[t]:e})};var xn=new Proxy(String,{get:()=>xn}),z=xn;var Bn=(t,e,{descriptor:r})=>{let n=[`${z.yellow(typeof t=="string"?r.key(t):r.pair(t))} is deprecated`];return e&&n.push(`we now treat it as ${z.blue(typeof e=="string"?r.key(e):r.pair(e))}`),n.join("; ")+"."};var Dt=Symbol.for("vnopts.VALUE_NOT_EXIST"),Ae=Symbol.for("vnopts.VALUE_UNCHANGED");var Tn=" ".repeat(2),wn=(t,e,r)=>{let{text:n,list:u}=r.normalizeExpectedResult(r.schemas[t].expected(r)),o=[];return n&&o.push(Nn(t,e,n,r.descriptor)),u&&o.push([Nn(t,e,u.title,r.descriptor)].concat(u.values.map(i=>On(i,r.loggerPrintWidth))).join(`
`)),Pn(o,r.loggerPrintWidth)};function Nn(t,e,r,n){return[`Invalid ${z.red(n.key(t))} value.`,`Expected ${z.blue(r)},`,`but received ${e===Dt?z.gray("nothing"):z.red(n.value(e))}.`].join(" ")}function On({text:t,list:e},r){let n=[];return t&&n.push(`- ${z.blue(t)}`),e&&n.push([`- ${z.blue(e.title)}:`].concat(e.values.map(u=>On(u,r-Tn.length).replace(/^|\n/g,`$&${Tn}`))).join(`
`)),Pn(n,r)}function Pn(t,e){if(t.length===1)return t[0];let[r,n]=t,[u,o]=t.map(i=>i.split(`
`,1)[0].length);return u>e&&u>o?n:r}var xe=[],$t=[];function at(t,e,r){if(t===e)return 0;let n=r?.maxDistance,u=t;t.length>e.length&&(t=e,e=u);let o=t.length,i=e.length;for(;o>0&&t.charCodeAt(~-o)===e.charCodeAt(~-i);)o--,i--;let D=0;for(;D<o&&t.charCodeAt(D)===e.charCodeAt(D);)D++;if(o-=D,i-=D,n!==void 0&&i-o>n)return n;if(o===0)return n!==void 0&&i>n?n:i;let s,a,c,p,l=0,m=0;for(;l<o;)$t[l]=t.charCodeAt(D+l),xe[l]=++l;for(;m<i;){for(s=e.charCodeAt(D+m),c=m++,a=m,l=0;l<o;l++)p=s===$t[l]?c:c+1,c=xe[l],a=xe[l]=c>a?p>a?a+1:p:p>c?c+1:p;if(n!==void 0){let f=a;for(l=0;l<o;l++)xe[l]<f&&(f=xe[l]);if(f>n)return n}}return xe.length=o,$t.length=o,n!==void 0&&a>n?n:a}function Sn(t,e,r){if(!Array.isArray(e)||e.length===0)return;let n=r?.maxDistance,u=t.length;for(let s of e)if(s===t)return s;if(n===0)return;let o,i=Number.POSITIVE_INFINITY,D=new Set;for(let s of e){if(D.has(s))continue;D.add(s);let a=Math.abs(s.length-u);if(a>=i||n!==void 0&&a>n)continue;let c=Number.isFinite(i)?n===void 0?i:Math.min(i,n):n,p=c===void 0?at(t,s):at(t,s,{maxDistance:c});if(n!==void 0&&p>n)continue;let l=p;if(c!==void 0&&p===c&&c===n&&(l=at(t,s)),l<i&&(i=l,o=s,i===0))break}if(!(n!==void 0&&i>n))return o}var ct=(t,e,{descriptor:r,logger:n,schemas:u})=>{let o=[`Ignored unknown option ${z.yellow(r.pair({key:t,value:e}))}.`],i=Sn(t,Object.keys(u),{maxDistance:3});i&&o.push(`Did you mean ${z.blue(r.key(i))}?`),n.warn(o.join(" "))};var Uo=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function Vo(t,e){let r=new t(e),n=Object.create(r);for(let u of Uo)u in e&&(n[u]=Wo(e[u],r,O.prototype[u].length));return n}var O=class{static create(e){return Vo(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,r){return!1}deprecated(e,r){return!1}forward(e,r){}redirect(e,r){}overlap(e,r,n){return e}preprocess(e,r){return e}postprocess(e,r){return Ae}};function Wo(t,e,r){return typeof t=="function"?(...n)=>t(...n.slice(0,r-1),e,...n.slice(r-1)):()=>t}var ft=class extends O{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,r){return r.schemas[this._sourceName].validate(e,r)}redirect(e,r){return this._sourceName}};var lt=class extends O{expected(){return"anything"}validate(){return!0}};var pt=class extends O{constructor({valueSchema:e,name:r=e.name,...n}){super({...n,name:r}),this._valueSchema=e}expected(e){let{text:r,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:r&&`an array of ${r}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,r){if(!Array.isArray(e))return!1;let n=[];for(let u of e){let o=r.normalizeValidateResult(this._valueSchema.validate(u,r),u);o!==!0&&n.push(o.value)}return n.length===0?!0:{value:n}}deprecated(e,r){let n=[];for(let u of e){let o=r.normalizeDeprecatedResult(this._valueSchema.deprecated(u,r),u);o!==!1&&n.push(...o.map(({value:i})=>({value:[i]})))}return n}forward(e,r){let n=[];for(let u of e){let o=r.normalizeForwardResult(this._valueSchema.forward(u,r),u);n.push(...o.map(bn))}return n}redirect(e,r){let n=[],u=[];for(let o of e){let i=r.normalizeRedirectResult(this._valueSchema.redirect(o,r),o);"remain"in i&&n.push(i.remain),u.push(...i.redirect.map(bn))}return n.length===0?{redirect:u}:{redirect:u,remain:n}}overlap(e,r){return e.concat(r)}};function bn({from:t,to:e}){return{from:[t],to:e}}var mt=class extends O{expected(){return"true or false"}validate(e){return typeof e=="boolean"}};function In(t,e){let r=Object.create(null);for(let n of t){let u=n[e];if(r[u])throw new Error(`Duplicate ${e} ${JSON.stringify(u)}`);r[u]=n}return r}function Rn(t,e){let r=new Map;for(let n of t){let u=n[e];if(r.has(u))throw new Error(`Duplicate ${e} ${JSON.stringify(u)}`);r.set(u,n)}return r}function vn(){let t=Object.create(null);return e=>{let r=JSON.stringify(e);return t[r]?!0:(t[r]=!0,!1)}}function Ln(t,e){let r=[],n=[];for(let u of t)e(u)?r.push(u):n.push(u);return[r,n]}function Mn(t){return t===Math.floor(t)}function Yn(t,e){if(t===e)return 0;let r=typeof t,n=typeof e,u=["undefined","object","boolean","number","string"];return r!==n?u.indexOf(r)-u.indexOf(n):r!=="string"?Number(t)-Number(e):t.localeCompare(e)}function jn(t){return(...e)=>{let r=t(...e);return typeof r=="string"?new Error(r):r}}function zt(t){return t===void 0?{}:t}function Gt(t){if(typeof t=="string")return{text:t};let{text:e,list:r}=t;return $o((e||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:e,list:{title:r.title,values:r.values.map(Gt)}}:{text:e}}function Kt(t,e){return t===!0?!0:t===!1?{value:e}:t}function Ht(t,e,r=!1){return t===!1?!1:t===!0?r?!0:[{value:e}]:"value"in t?[t]:t.length===0?!1:t}function kn(t,e){return typeof t=="string"||"key"in t?{from:e,to:t}:"from"in t?{from:t.from,to:t.to}:{from:e,to:t.to}}function dt(t,e){return t===void 0?[]:Array.isArray(t)?t.map(r=>kn(r,e)):[kn(t,e)]}function Jt(t,eLine truncated
`,u.gutter(h.replace(/\d/g," "))," ",B,u.marker("^").repeat(J)].join(""),P&&r.message&&(A+=" "+u.message(r.message))}return[u.marker(">"),u.gutter(h),F.length>0?` ${F}`:"",A].join("")}else return` ${u.gutter(h)}${F.length>0?` ${F}`:""}`}).join(`
`);return r.message&&!p&&(f=`${" ".repeat(l+1)}${r.message}
${f}`),u.reset(f)}function eu(t,e,r={}){return Zn(t,e,r)}async function ci(t,e){let r=await Ue(e),n=r.preprocess?await r.preprocess(t,e):t;e.originalText=n;let u;try{u=await r.parse(n,e,e)}catch(o){fi(o,t)}return{text:n,ast:u}}function fi(t,e){let{loc:r}=t;if(r){let{start:n,end:u}=r;n&&(n={line:n.line,column:n.column-1}),u&&(u={line:u.line,column:u.column-1});let o=eu(e,{start:n,end:u},{highlightCode:!0});t.message+=`
`+o,t.codeFrame=o}throw t}var me=ci;async function tu(t,e,r,n,u){if(r.embeddedLanguageFormatting!=="auto")return;let{printer:o}=r,{embed:i}=o;if(!i)return;if(i.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let{hasPrettierIgnore:D}=o,{getVisitorKeys:s}=i,a=[];l();let c=t.stack;for(let{print:m,node:f,pathStack:F}of a)try{t.stack=F;let d=await m(p,e,t,r);d&&u.set(f,d)}catch(d){if(globalThis.PRETTIER_DEBUG)throw d}t.stack=c;function p(m,f){return li(m,f,r,n)}function l(){let{node:m}=t;if(m===null||typeof m!="object"||D?.(t))return;for(let F of s(m))Array.isArray(m[F])?t.each(l,F):t.call(l,F);let f=i(t,r);if(f){if(typeof f=="function"){a.push({print:f,node:m,pathStack:[...t.stack]});return}u.set(m,f)}}}async function li(t,e,r,n){let u=await se({...r,...e,parentParser:r.parser,originalText:t,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:o}=await me(t,u),i=await n(o,u);return He(i)}function pi(t,e,r,n){let{originalText:u,[ue]:o,locStart:i,locEnd:D,[Symbol.for("printedComments")]:s}=e,{node:a}=t,c=i(a),p=D(a);for(let m of o)i(m)>=c&&D(m)<=p&&s.add(m);let{printPrettierIgnored:l}=e.printer;return l?l(t,e,r,n):u.slice(c,p)}var ru=pi;async function Ve(t,e){({ast:t}=await or(t,e));let r=new Map,n=new tn(t),u=Fn(e),o=new Map;await tu(n,D,e,Ve,o);let i=await nu(n,e,D,void 0,o);if(dn(e),e.cursorOffset>=0){if(e.nodeAfterCursor&&!e.nodeBeforeCursor)return[ee,i];if(e.nodeBeforeCursor&&!e.nodeAfterCursor)return[i,ee]}return i;function D(a,c){return a===void 0||a===n?s(c):Array.isArray(a)?n.call(()=>s(c),...a):n.call(()=>s(c),a)}function s(a){u(n);let c=n.node;if(c==null)return"";let p=ge(c)&&a===void 0;if(p&&r.has(c))return r.get(c);let l=nu(n,e,D,a,o);return p&&r.set(c,l),l}}function nu(t,e,r,n,u){let{node:o}=t,{printer:i}=e,D;switch(i.hasPrettierIgnore?.(t)?D=ru(t,e,r,n):u.has(o)?D=u.get(o):D=i.print(t,e,r,n),o){case e.cursorNode:D=Ee(D,s=>[ee,s,ee]);break;case e.nodeBeforeCursor:D=Ee(D,s=>[s,ee]);break;case e.nodeAfterCursor:D=Ee(D,s=>[ee,s]);break}return i.printComment&&rt(o.comments)&&!i.willPrintOwnComments?.(t,e)&&(D=mn(t,D,e)),D}async function or(t,e){let r=t.comments??[];e[ue]=r,e[Symbol.for("printedComments")]=new Set,cn(t,e);let{printer:{preprocess:n}}=e;return t=n?await n(t,e):t,{ast:t,comments:r}}function mi(t,e){let{cursorOffset:r,locStart:n,locEnd:u,getVisitorKeys:o}=e,i=m=>n(m)<=r&&u(m)>=r,D=t,s=[t];for(let m of un(t,{getVisitorKeys:o,filter:i}))s.push(m),D=m;if(on(D,{getVisitorKeys:o}))return{cursorNode:D};let a,c,p=-1,l=Number.POSITIVE_INFINITY;for(;s.length>0&&(a===void 0||c===void 0);){D=s.pop();let m=a!==void 0,f=c!==void 0;for(let F of ye(D,{getVisitorKeys:o})){if(!m){let d=u(F);d<=r&&d>p&&(a=F,p=d)}if(!f){let d=n(F);d>=r&&d<l&&(c=F,l=d)}}}return{nodeBeforeCursor:a,nodeAfterCursor:c}}var ir=mi;function di(t,e){let{printer:r}=e,n=r.massageAstNode;if(!n)return t;let{getVisitorKeys:u}=r,{ignoredProperties:o}=n;return i(t);function i(D,s){if(!ge(D))return D;if(Array.isArray(D))return D.map(l=>i(l,s)).filter(Boolean);let a={},c=new Set(u(D));for(let l in D)!le(D,l)||o?.has(l)||(c.has(l)?a[l]=i(D[l],D):a[l]=D[l]);let p=n(D,a,s);if(p!==null)return p??a}}var uu=di;var Fi=Array.prototype.findLastIndex??function(t){for(let e=this.length-1;e>=0;e--){let r=this[e];if(t(r,e,this))return e}return-1},Ei=X("findLastIndex",function(){if(Array.isArray(this))return Fi}),ou=Ei;function Ci(t,e){return e=new Set(e),t.find(r=>Du.has(r.type)&&e.has(r))}function iu(t){let e=ou(0,t,r=>r.type!=="Program"&&r.type!=="File");return e===-1?t:t.slice(0,e+1)}function hi(t,e,{locStart:r,locEnd:n}){let[u,...o]=t,[i,...D]=e;if(u===i)return[u,i];let s=r(u);for(let c of iu(D))if(r(c)>=s)i=c;else break;let a=n(i);for(let c of iu(o)){if(n(c)<=a)u=c;else break;if(u===i)break}return[u,i]}function sr(t,e,r,n,u=[],o,i){let{locStart:D,locEnd:s}=i,a=D(t),c=s(t);if(e>c||e<a||o==="rangeEnd"&&e===a||o==="rangeStart"&&e===c)return;let p=[t,...u],l=ot(t,p,{cache:Vt,locStart:D,locEnd:s,getVisitorKeys:r.getVisitorKeys,filter:r.printer.canAttachComment,getChildren:r.printer.getCommentChildNodes});for(let m of l){let f=sr(m,e,r,n,p,o,i);if(f)return f}if(n(t,u[0]))return p}function gi(t,e){return e!=="DeclareExportDeclaration"&&t!=="TypeParameterDeclaration"&&(t==="Directive"||t==="TypeAlias"||t==="TSExportAssignment"||t.startsWith("Declare")||t.startsWith("TSDeclare")||t.endsWith("Statement")||t.endsWith("Declaration"))}var Du=new Set(["JsonRoot","ObjectExpression","ArrayExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","UnaryExpression","TemplateLiteral"]),_i=new Set(["OperationDefinition","FragmentDefinition","VariableDefinition","TypeExtensionDefinition","ObjectTypeDefinition","FieldDefinition","DirectiveDefinition","EnumTypeDefinition","EnumValueDefinition","InputValueDefinition","InputObjectTypeDefinition","SchemaDefinition","OperationTypeDefinition","InterfaceTypeDeLine truncated
`,u)+1),s=n.slice(D,u).match(/^\s*/)[0],a=he(s,e.tabWidth),c=await mu(i,{...e,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:e.cursorOffset>u&&e.cursorOffset<=o?e.cursorOffset-u:-1,endOfLine:"lf"},a),p=c.formatted.trimEnd(),{cursorOffset:l}=e;l>o?l+=p.length-i.length:c.cursorOffset>=0&&(l=c.cursorOffset+u);let m=n.slice(0,u)+p+n.slice(o);if(e.endOfLine!=="lf"){let f=we(e.endOfLine);l>=0&&f===`\r
`&&(l+=Nt(m.slice(0,l),`
`)),m=ne(0,m,`
`,f)}return{formatted:m,cursorOffset:l,comments:c.comments}}function Dr(t,e,r){return typeof e!="number"||Number.isNaN(e)||e<0||e>t.length?r:e}function fu(t,e){let{cursorOffset:r,rangeStart:n,rangeEnd:u}=e;return r=Dr(t,r,-1),n=Dr(t,n,0),u=Dr(t,u,t.length),{...e,cursorOffset:r,rangeStart:n,rangeEnd:u}}function du(t,e){let{cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:o}=fu(t,e),i=t.charAt(0)===pu;if(i&&(t=t.slice(1),r--,n--,u--),o==="auto"&&(o=hr(t)),t.includes("\r")){let D=s=>Nt(t.slice(0,Math.max(s,0)),`\r
`);r-=D(r),n-=D(n),u-=D(u),t=gr(t)}return{hasBOM:i,text:t,options:fu(t,{...e,cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:o})}}async function lu(t,e){let r=await Ue(e);return!r.hasPragma||r.hasPragma(t)}async function Ai(t,e){return(await Ue(e)).hasIgnorePragma?.(t)}async function ar(t,e){let{hasBOM:r,text:n,options:u}=du(t,await se(e));if(u.rangeStart>=u.rangeEnd&&n!==""||u.requirePragma&&!await lu(n,u)||u.checkIgnorePragma&&await Ai(n,u))return{formatted:t,cursorOffset:e.cursorOffset,comments:[]};let o;return u.rangeStart>0||u.rangeEnd<n.length?o=await yi(n,u):(!u.requirePragma&&u.insertPragma&&u.printer.insertPragma&&!await lu(n,u)&&(n=u.printer.insertPragma(n)),o=await mu(n,u)),r&&(o.formatted=pu+o.formatted,o.cursorOffset>=0&&o.cursorOffset++),o}async function Fu(t,e,r){let{text:n,options:u}=du(t,await se(e)),o=await me(n,u);return r&&(r.preprocessForPrint&&(o.ast=await or(o.ast,u)),r.massage&&(o.ast=uu(o.ast,u))),o}async function Eu(t,e){e=await se(e);let r=await Ve(t,e);return Ce(r,e)}async function Cu(t,e){let r=Vr(t),{formatted:n}=await ar(r,{...e,parser:"__js_expression"});return n}async function hu(t,e){e=await se(e);let{ast:r}=await me(t,e);return e.cursorOffset>=0&&(e={...e,...ir(r,e)}),Ve(r,e)}async function gu(t,e){return Ce(t,await se(e))}var cr={};At(cr,{builders:()=>Bi,printer:()=>Ti,utils:()=>Ni});var Bi={join:be,line:Ze,softline:Yr,hardline:W,literalline:Je,group:Ot,conditionalGroup:Rr,fill:Ir,lineSuffix:Ie,lineSuffixBoundary:jr,cursor:ee,breakParent:ae,ifBreak:vr,trim:Ur,indent:oe,indentIfBreak:Lr,align:De,addAlignmentToDoc:Qe,markAsRoot:Xe,dedentToRoot:br,dedent:kr,hardlineWithoutBreakParent:ke,literallineWithoutBreakParent:Pt,label:Mr,concat:t=>t},Ti={printDocToString:Ce},Ni={willBreak:Br,traverseDoc:Oe,findInDoc:Ke,mapDoc:Se,removeLines:Nr,stripTrailingHardline:He,replaceEndOfLine:wr,canBreak:Or};var _u="3.9.10";var lr={};At(lr,{addDanglingComment:()=>re,addLeadingComment:()=>ce,addTrailingComment:()=>fe,getAlignmentSize:()=>he,getIndentSize:()=>yu,getMaxContinuousCount:()=>Au,getNextNonSpaceNonCommentCharacter:()=>xu,getNextNonSpaceNonCommentCharacterIndex:()=>ji,getPreferredQuote:()=>Nu,getStringWidth:()=>Re,hasNewline:()=>H,hasNewlineInRange:()=>wu,hasSpaces:()=>Ou,isNextLineEmpty:()=>zi,isNextLineEmptyAfterIndex:()=>gt,isPreviousLineEmpty:()=>Vi,makeString:()=>$i,skip:()=>_e,skipEverythingButNewLine:()=>ut,skipInlineComment:()=>Be,skipNewline:()=>$,skipSpaces:()=>j,skipToLineEnd:()=>nt,skipTrailingComment:()=>Te,skipWhitespace:()=>rn});function wi(t,e){if(e===!1)return!1;if(t.charAt(e)==="/"&&t.charAt(e+1)==="*"){for(let r=e+2;r<t.length;++r)if(t.charAt(r)==="*"&&t.charAt(r+1)==="/")return r+2}return e}var Be=wi;function Oi(t,e){return e===!1?!1:t.charAt(e)==="/"&&t.charAt(e+1)==="/"?ut(t,e):e}var Te=Oi;function Pi(t,e){let r=null,n=e;for(;n!==r;)r=n,n=j(t,n),n=Be(t,n),n=Te(t,n),n=$(t,n);return n}var We=Pi;function Si(t,e){let r=null,n=e;for(;n!==r;)r=n,n=nt(t,n),n=Be(t,n),n=j(t,n);return n=Te(t,n),n=$(t,n),n!==!1&&H(t,n)}var gt=Si;function bi(t,e){let r=t.lastIndexOf(`
`);return r===-1?0:he(t.slice(r+1).match(/^[\t ]*/)[0],e)}var yu=bi;function fr(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ki(t,e){let r=t.matchAll(new RegExp(`(?:${fr(e)})+`,"g"));return r.reduce||(r=[...r]),r.reduce((n,[u])=>Math.max(n,u.length),0)/e.length}var Au=ki;function Ii(t,e){let r=We(t,e);return r===!1?"":t.charAt(r)}var xu=Ii;var Bu=Object.freeze({character:"'",codePoint:39}),Tu=Object.freeze({character:'"',codePoint:34}),Ri=Object.freeze({preferred:Bu,alternate:Tu}),vi=Object.freeze({preferred:Tu,alternate:Bu});function Nu(t,e){let{preferred:r,alternate:n}=e===!0||e==="'"?Ri:vi,{length:u}=t,o=0,i=0;for(let D=0;D<u;D++){let s=t.charCodeAt(D);s===r.codePoint?o++:s===n.codePoint&&i++}return(o>i?n:r).character}function Li(t,e,r){for(let n=e;n<r;++n)if(t.charAt(n)===`
`)return!0;return!1}var wu=Li;function Mi(t,e,r={}){return j(t,r.backwards?e-1:e,r)!==e}var Ou=Mi;function Yi(t,e,r){return We(t,r(e))}function ji(t,e){return arguments.length===2||typeof e=="number"?We(t,e):Yi(...arguments)}function Ui(t,e,r){return ve(t,r(e))}function Vi(t,e){return arguments.length===2||typeof e=="number"?ve(t,e):Ui(...arguments)}function Wi(t,e,r){return gt(t,r(e))}function $i(t,e,r){let n=e==='"'?"'":'"',o=ne(0,t,/\\(.)|(["'])/gs,(i,D,s)=>D===n?D:s===e?"\\"+s:s||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(D)?D:"\\"+D));return e+o+e}function zi(t,e){return arguments.length===2||typeof e=="number"?gt(t,e):Wi(...arguments)}function de(t,e=1){return async(...r)=>{let n=r[e]??{},u=n.plugins??[];return r[e]={...n,plugins:Array.isArray(u)?u:Object.values(u)},await t(...r)}}var Pu=de(ar);async function Su(t,e){let{formatted:r}=await Pu(t,{...e,cursorOffset:-1});return r}async function Gi(t,e){return await Su(t,e)===t}var Ki=de(it,0),Hi={parse:de(Fu),formatAST:de(Eu),formatDoc:de(Cu),printToDoc:de(hu),printDocToString:de(gu)};return Yu(Ji);});
@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.469.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 ImageDown = createLucideIcon("ImageDown", [
[
"path",
{
d: "M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",
key: "9csbqa"
}
],
["path", { d: "m14 19 3 3v-5.5", key: "9ldu5r" }],
["path", { d: "m17 22 3-3", key: "1nkfve" }],
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }]
]);
export { ImageDown as default };
//# sourceMappingURL=image-down.js.map
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './circle-arrow-out-up-left.js';
//# sourceMappingURL=arrow-up-left-from-circle.js.map
@@ -0,0 +1,961 @@
/**
* Web Standards Streamable HTTP Server Transport
*
* This is the core transport implementation using Web Standard APIs (Request, Response, ReadableStream).
* It can run on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc.
*
* For Node.js Express/HTTP compatibility, use `StreamableHTTPServerTransport` which wraps this transport.
*/
import { isJsonContentType } from '../shared/mediaType.js';
import { MAX_BATCH_SIZE, readRequestBody, requestBodyTooLargeMessage, resolveMaxRequestBodySize } from './requestBody.js';
import { armSseKeepAlive, DEFAULT_SSE_KEEP_ALIVE_MS } from './sseKeepAlive.js';
import { isInitializeRequest, isJSONRPCErrorResponse, isJSONRPCRequest, isJSONRPCResultResponse, JSONRPCMessageSchema, SUPPORTED_PROTOCOL_VERSIONS, DEFAULT_NEGOTIATED_PROTOCOL_VERSION } from '../types.js';
/**
* Server transport for Web Standards Streamable HTTP: this implements the MCP Streamable HTTP transport specification
* using Web Standard APIs (Request, Response, ReadableStream).
*
* This transport works on any runtime that supports Web Standards: Node.js 18+, Cloudflare Workers, Deno, Bun, etc.
*
* Usage example:
*
* ```typescript
* // Stateful mode - server sets the session ID
* const statefulTransport = new WebStandardStreamableHTTPServerTransport({
* sessionIdGenerator: () => crypto.randomUUID(),
* });
*
* // Stateless mode - explicitly set session ID to undefined
* const statelessTransport = new WebStandardStreamableHTTPServerTransport({
* sessionIdGenerator: undefined,
* });
*
* // Hono.js usage
* app.all('/mcp', async (c) => {
* return transport.handleRequest(c.req.raw);
* });
*
* // Cloudflare Workers usage
* export default {
* async fetch(request: Request): Promise<Response> {
* return transport.handleRequest(request);
* }
* };
* ```
*
* In stateful mode:
* - Session ID is generated and included in response headers
* - Session ID is always included in initialization responses
* - Requests with invalid session IDs are rejected with 404 Not Found
* - Non-initialization requests without a session ID are rejected with 400 Bad Request
* - State is maintained in-memory (connections, message history)
*
* In stateless mode:
* - No Session ID is included in any responses
* - No session validation is performed
*/
export class WebStandardStreamableHTTPServerTransport {
constructor(options = {}) {
this._started = false;
this._hasHandledRequest = false;
this._streamMapping = new Map();
this._requestToStreamMapping = new Map();
/**
* Request streams whose client holds a Last-Event-ID cursor (at least one
* id-bearing event was delivered on them), so a stored response can be
* replayed on resume.
*/
this._resumableStreams = new Set();
this._requestResponseMap = new Map();
this._initialized = false;
this._enableJsonResponse = false;
this._standaloneSseStreamId = '_GET_stream';
this._closed = false;
this.sessionIdGenerator = options.sessionIdGenerator;
this._enableJsonResponse = options.enableJsonResponse ?? false;
this._eventStore = options.eventStore;
this._onsessioninitialized = options.onsessioninitialized;
this._onsessionclosed = options.onsessionclosed;
this._allowedHosts = options.allowedHosts;
this._allowedOrigins = options.allowedOrigins;
this._enableDnsRebindingProtection = options.enableDnsRebindingProtection ?? false;
this._retryInterval = options.retryInterval;
this._keepAliveMs = options.keepAliveMs ?? DEFAULT_SSE_KEEP_ALIVE_MS;
this._maxRequestBodySize = resolveMaxRequestBodySize(options.maxRequestBodySize);
}
/**
* Arms a keep-alive interval for an SSE stream that periodically writes an SSE
* comment frame so intermediaries and idle timeouts don't kill the connection.
* The returned timer is owned by the stream it was armed for: the stream's
* cancel/cleanup callbacks must clear it. The interval clears itself if a
* write fails (stream already closed/cancelled).
*/
startKeepAlive(controller, encoder) {
// After close() nothing may arm: the stream cleanups have already run.
if (this._closed)
return undefined;
const timer = armSseKeepAlive(this._keepAliveMs, () => {
try {
controller.enqueue(encoder.encode(': keepalive\n\n'));
}
catch {
if (timer !== undefined)
clearInterval(timer);
}
});
return timer;
}
/**
* Starts the transport. This is required by the Transport interface but is a no-op
* for the Streamable HTTP transport as connections are managed per-request.
*/
async start() {
if (this._started) {
throw new Error('Transport already started');
}
this._started = true;
}
/**
* Helper to create a JSON error response
*/
createJsonErrorResponse(status, code, message, options) {
const error = { code, message };
if (options?.data !== undefined) {
error.data = options.data;
}
return new Response(JSON.stringify({
jsonrpc: '2.0',
error,
id: null
}), {
status,
headers: {
'Content-Type': 'application/json',
...options?.headers
}
});
}
/**
* Validates request headers for DNS rebinding protection.
* @returns Error response if validation fails, undefined if validation passes.
*/
validateRequestHeaders(req) {
// Skip validation if protection is not enabled
if (!this._enableDnsRebindingProtection) {
return undefined;
}
// Validate Host header if allowedHosts is configured
if (this._allowedHosts && this._allowedHosts.length > 0) {
const hostHeader = req.headers.get('host');
if (!hostHeader || !this._allowedHosts.includes(hostHeader)) {
const error = `Invalid Host header: ${hostHeader}`;
this.onerror?.(new Error(error));
return this.createJsonErrorResponse(403, -32000, error);
}
}
// Validate Origin header if allowedOrigins is configured
if (this._allowedOrigins && this._allowedOrigins.length > 0) {
const originHeader = req.headers.get('origin');
if (originHeader && !this._allowedOrigins.includes(originHeader)) {
const error = `Invalid Origin header: ${originHeader}`;
this.onerror?.(new Error(error));
return this.createJsonErrorResponse(403, -32000, error);
}
}
return undefined;
}
/**
* Handles an incoming HTTP request, whether GET, POST, or DELETE
* Returns a Response object (Web Standard)
*/
async handleRequest(req, options) {
if (this._closed) {
return this.createJsonErrorResponse(404, -32001, 'Session not found');
}
// In stateless mode (no sessionIdGenerator), each request must use a fresh transport.
// Reusing a stateless transport causes message ID collisions between clients.
if (!this.sessionIdGenerator && this._hasHandledRequest) {
throw new Error('Stateless transport cannot be reused across requests. Create a new transport per request.');
}
this._hasHandledRequest = true;
// Validate request headers for DNS rebinding protection
const validationError = this.validateRequestHeaders(req);
if (validationError) {
return validationError;
}
switch (req.method) {
case 'POST':
return this.handlePostRequest(req, options);
case 'GET':
return this.handleGetRequest(req);
case 'DELETE':
return this.handleDeleteRequest(req);
default:
return this.handleUnsupportedRequest();
}
}
/**
* Writes a priming event to establish resumption capability.
* Only sends if eventStore is configured (opt-in for resumability) and
* the client's protocol version supports empty SSE data (>= 2025-11-25).
*/
async writePrimingEvent(controller, encoder, streamId, protocolVersion) {
if (!this._eventStore) {
return;
}
// Priming events have empty data which older clients cannot handle.
// Only send priming events to clients with protocol version >= 2025-11-25
// which includes the fix for handling empty SSE data.
if (protocolVersion < '2025-11-25') {
return;
}
const primingEventId = await this._eventStore.storeEvent(streamId, {});
let primingEvent = `id: ${primingEventId}\ndata: \n\n`;
if (this._retryInterval !== undefined) {
primingEvent = `id: ${primingEventId}\nretry: ${this._retryInterval}\ndata: \n\n`;
}
controller.enqueue(encoder.encode(primingEvent));
this._resumableStreams.add(streamId);
}
/**
* Handles GET requests for SSE stream
*/
async handleGetRequest(req) {
// The client MUST include an Accept header, listing text/event-stream as a supported content type.
const acceptHeader = req.headers.get('accept');
if (!acceptHeader?.includes('text/event-stream')) {
this.onerror?.(new Error('Not Acceptable: Client must accept text/event-stream'));
return this.createJsonErrorResponse(406, -32000, 'Not Acceptable: Client must accept text/event-stream');
}
// If an Mcp-Session-Id is returned by the server during initialization,
// clients using the Streamable HTTP transport MUST include it
// in the Mcp-Session-Id header on all of their subsequent HTTP requests.
const sessionError = this.validateSession(req);
if (sessionError) {
return sessionError;
}
const protocolError = this.validateProtocolVersion(req);
if (protocolError) {
return protocolError;
}
// Handle resumability: check for Last-Event-ID header
if (this._eventStore) {
const lastEventId = req.headers.get('last-event-id');
if (lastEventId) {
return this.replayEvents(lastEventId);
}
}
// Check if there's already an active standalone SSE stream for this session
if (this._streamMapping.get(this._standaloneSseStreamId) !== undefined) {
// Only one GET SSE stream is allowed per session
this.onerror?.(new Error('Conflict: Only one SSE stream is allowed per session'));
return this.createJsonErrorResponse(409, -32000, 'Conflict: Only one SSE stream is allowed per session');
}
const encoder = new TextEncoder();
let streamController;
let keepAliveTimer = undefined;
// Create a ReadableStream with a controller we can use to push SSE events
const readable = new ReadableStream({
start: controller => {
streamController = controller;
},
cancel: () => {
// Stream was cancelled by client. Only tear down the mapping if it
// still points at this stream — a stale cancel arriving after a
// reconnect re-registered the id must not tear down the successor.
if (keepAliveTimer !== undefined) {
clearInterval(keepAliveTimer);
}
if (this._streamMapping.get(this._standaloneSseStreamId)?.controller === streamController) {
this._streamMapping.delete(this._standaloneSseStreamId);
}
}
});
const headers = {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache, no-transform',
Connection: 'keep-alive',
'X-Accel-Buffering': 'no'
};
// After initialization, always include the session ID if we have one
if (this.sessionId !== undefined) {
headers['mcp-session-id'] = this.sessionId;
}
// Store the stream mapping with the controller for pushing data
this._streamMapping.set(this._standaloneSseStreamId, {
controller: streamController,
encoder,
cleanup: () => {
if (keepAliveTimer !== undefined) {
clearInterval(keepAliveTimer);
}
this._streamMapping.delete(this._standaloneSseStreamId);
try {
streamController.close();
}
catch {
// Controller might already be closed
}
}
});
keepAliveTimer = this.startKeepAlive(streamController, encoder);
return new Response(readable, { headers });
}
/**
* Replays events that would have been sent after the specified event ID
* Only used when resumability is enabled
*/
async replayEvents(lastEventId) {
if (!this._eventStore) {
this.onerror?.(new Error('Event store not configured'));
return this.createJsonErrorResponse(400, -32000, 'Event store not configured');
}
try {
// If getStreamIdForEventId is available, use it for conflict checking
let streamId;
if (this._eventStore.getStreamIdForEventId) {
streamId = await this._eventStore.getStreamIdForEventId(lastEventId);
if (!streamId) {
this.onerror?.(new Error('Invalid event ID format'));
return this.createJsonErrorResponse(400, -32000, 'Invalid event ID format');
}
// Check conflict with the SAME streamId we'll use for mapping
if (this._streamMapping.get(streamId) !== undefined) {
this.onerror?.(new Error('Conflict: Stream already has an active connection'));
return this.createJsonErrorResponse(409, -32000, 'Conflict: Stream already has an active connection');
}
}
const headers = {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache, no-transform',
Connection: 'keep-alive',
'X-Accel-Buffering': 'no'
};
if (this.sessionId !== undefined) {
headers['mcp-session-id'] = this.sessionId;
}
// Create a ReadableStream with controller for SSE
const encoder = new TextEncoder();
let streamController;
let keepAliveTimer = undefined;
let replayedStreamId = undefined;
let cancelled = false;
const readable = new ReadableStream({
start: controller => {
streamController = controller;
},
cancel: () => {
// Stream was cancelled by client. Only tear down the mapping if
// it still points at this stream — a stale cancel must not tear
// down a successor registered by a later resume.
cancelled = true;
if (keepAliveTimer !== undefined) {
clearInterval(keepAliveTimer);
}
if (replayedStreamId !== undefined && this._streamMapping.get(replayedStreamId)?.controller === streamController) {
this._streamMapping.delete(replayedStreamId);
}
}
});
// Replay events - returns the streamId for backwards compatibility
const replayedEventIds = new Set();
replayedStreamId = await this._eventStore.replayEventsAfter(lastEventId, {
send: async (eventId, message) => {
const success = this.writeSSEEvent(streamController, encoder, message, eventId);
if (!success) {
this.onerror?.(new Error('Failed replay events'));
try {
streamController.close();
}
catch {
// Controller might already be closed
}
}
else {
replayedEventIds.add(eventId);
}
}
});
// close() may have run, or the stream may have been cancelled, while
// the event store was replaying: don't hand out or register a stream
// that nothing can ever clean up again.
if (this._closed || cancelled) {
try {
streamController.close();
}
catch {
// Controller might already be closed
}
return this.createJsonErrorResponse(404, -32001, 'Session not found');
}
// A reconnect re-registers the same stream id: close the predecessor
// stream cleanly (clearing its keep-alive timer) instead of leaving it
// registered nowhere with its timer still running.
this._streamMapping.get(replayedStreamId)?.cleanup();
this._streamMapping.set(replayedStreamId, {
controller: streamController,
encoder,
replayedEventIds,
cleanup: () => {
if (keepAliveTimer !== undefined) {
clearInterval(keepAliveTimer);
}
this._streamMapping.delete(replayedStreamId);
try {
streamController.close();
}
catch {
// Controller might already be closed
}
}
});
// The resume itself proves the client holds a Last-Event-ID cursor
this._resumableStreams.add(replayedStreamId);
keepAliveTimer = this.startKeepAlive(streamController, encoder);
return new Response(readable, { headers });
}
catch (error) {
this.onerror?.(error);
return this.createJsonErrorResponse(500, -32000, 'Error replaying events');
}
}
/**
* Writes an event to an SSE stream via controller with proper formatting
*/
writeSSEEvent(controller, encoder, message, eventId) {
try {
let eventData = `event: message\n`;
// Include event ID if provided - this is important for resumability
if (eventId) {
eventData += `id: ${eventId}\n`;
}
eventData += `data: ${JSON.stringify(message)}\n\n`;
controller.enqueue(encoder.encode(eventData));
return true;
}
catch (error) {
this.onerror?.(error);
return false;
}
}
/**
* Handles unsupported requests (PUT, PATCH, etc.)
*/
handleUnsupportedRequest() {
this.onerror?.(new Error('Method not allowed.'));
return new Response(JSON.stringify({
jsonrpc: '2.0',
error: {
code: -32000,
message: 'Method not allowed.'
},
id: null
}), {
status: 405,
headers: {
Allow: 'GET, POST, DELETE',
'Content-Type': 'application/json'
}
});
}
/**
* Handles POST requests containing JSON-RPC messages
*/
async handlePostRequest(req, options) {
try {
// Validate the Accept header
const acceptHeader = req.headers.get('accept');
// The client MUST include an Accept header, listing both application/json and text/event-stream as supported content types.
// Accept is a comma-separated list, so a substring check is the intended semantics here (unlike Content-Type below).
// eslint-disable-next-line no-restricted-syntax
if (!acceptHeader?.includes('application/json') || !acceptHeader.includes('text/event-stream')) {
this.onerror?.(new Error('Not Acceptable: Client must accept both application/json and text/event-stream'));
return this.createJsonErrorResponse(406, -32000, 'Not Acceptable: Client must accept both application/json and text/event-stream');
}
// Parsed media type, never a substring match — see isJsonContentType.
const ct = req.headers.get('content-type');
if (!isJsonContentType(ct)) {
this.onerror?.(new Error('Unsupported Media Type: Content-Type must be application/json'));
return this.createJsonErrorResponse(415, -32000, 'Unsupported Media Type: Content-Type must be application/json');
}
// Build request info from headers and URL
const requestInfo = {
headers: Object.fromEntries(req.headers.entries()),
url: new URL(req.url)
};
let rawMessage;
if (options?.parsedBody !== undefined) {
rawMessage = options.parsedBody;
}
else {
try {
const body = await readRequestBody(req, this._maxRequestBodySize);
if (body.tooLarge) {
const message = requestBodyTooLargeMessage(this._maxRequestBodySize);
this.onerror?.(new Error(message));
return this.createJsonErrorResponse(413, -32000, message);
}
rawMessage = JSON.parse(body.text);
}
catch {
this.onerror?.(new Error('Parse error: Invalid JSON'));
return this.createJsonErrorResponse(400, -32700, 'Parse error: Invalid JSON');
}
}
if (Array.isArray(rawMessage) && rawMessage.length > MAX_BATCH_SIZE) {
this.onerror?.(new Error(`Invalid Request: Batch must not exceed ${MAX_BATCH_SIZE} messages`));
return this.createJsonErrorResponse(400, -32600, `Invalid Request: Batch must not exceed ${MAX_BATCH_SIZE} messages`);
}
let messages;
// handle batch and single messages
try {
if (Array.isArray(rawMessage)) {
messages = rawMessage.map(msg => JSONRPCMessageSchema.parse(msg));
}
else {
messages = [JSONRPCMessageSchema.parse(rawMessage)];
}
}
catch {
this.onerror?.(new Error('Parse error: Invalid JSON-RPC message'));
return this.createJsonErrorResponse(400, -32700, 'Parse error: Invalid JSON-RPC message');
}
// close() may have run while awaiting the request body above: don't
// initialize a session (or fire onsessioninitialized) on a transport
// whose cleanups have already run.
if (this._closed) {
return this.createJsonErrorResponse(404, -32001, 'Session not found');
}
// Check if this is an initialization request
// https://spec.modelcontextprotocol.io/specification/2025-03-26/basic/lifecycle/
const isInitializationRequest = messages.some(isInitializeRequest);
if (isInitializationRequest) {
// If it's a server with session management and the session ID is already set we should reject the request
// to avoid re-initialization.
if (this._initialized && this.sessionId !== undefined) {
this.onerror?.(new Error('Invalid Request: Server already initialized'));
return this.createJsonErrorResponse(400, -32600, 'Invalid Request: Server already initialized');
}
if (messages.length > 1) {
this.onerror?.(new Error('Invalid Request: Only one initialization request is allowed'));
return this.createJsonErrorResponse(400, -32600, 'Invalid Request: Only one initialization request is allowed');
}
this.sessionId = this.sessionIdGenerator?.();
this._initialized = true;
// If we have a session ID and an onsessioninitialized handler, call it immediately
// This is needed in cases where the server needs to keep track of multiple sessions
if (this.sessionId && this._onsessioninitialized) {
await Promise.resolve(this._onsessioninitialized(this.sessionId));
}
}
if (!isInitializationRequest) {
// If an Mcp-Session-Id is returned by the server during initialization,
// clients using the Streamable HTTP transport MUST include it
// in the Mcp-Session-Id header on all of their subsequent HTTP requests.
const sessionError = this.validateSession(req);
if (sessionError) {
return sessionError;
}
// Mcp-Protocol-Version header is required for all requests after initialization.
const protocolError = this.validateProtocolVersion(req);
if (protocolError) {
return protocolError;
}
}
// close() may have run while awaiting the request body or the session
// initialization callback above: don't register streams into maps the
// close sweep has already cleared, or hand out a stream that nothing
// will ever write to.
if (this._closed) {
return this.createJsonErrorResponse(404, -32001, 'Session not found');
}
// check if it contains requests
const hasRequests = messages.some(isJSONRPCRequest);
if (!hasRequests) {
// if it only contains notifications or responses, return 202
for (const message of messages) {
this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo });
}
return new Response(null, { status: 202 });
}
// The default behavior is to use SSE streaming
// but in some cases server will return JSON responses
const streamId = crypto.randomUUID();
// Extract protocol version for priming event decision.
// For initialize requests, get from request params.
// For other requests, get from header (already validated).
const initRequest = messages.find(m => isInitializeRequest(m));
const clientProtocolVersion = initRequest
? initRequest.params.protocolVersion
: (req.headers.get('mcp-protocol-version') ?? DEFAULT_NEGOTIATED_PROTOCOL_VERSION);
if (this._enableJsonResponse) {
// For JSON response mode, return a Promise that resolves when all responses are ready
return new Promise(resolve => {
this._streamMapping.set(streamId, {
resolveJson: resolve,
cleanup: () => {
this._streamMapping.delete(streamId);
}
});
for (const message of messages) {
if (isJSONRPCRequest(message)) {
this._requestToStreamMapping.set(message.id, streamId);
}
}
for (const message of messages) {
this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo });
}
});
}
// SSE streaming mode - use ReadableStream with controller for more reliable data pushing
const encoder = new TextEncoder();
let streamController;
let keepAliveTimer = undefined;
const readable = new ReadableStream({
start: controller => {
streamController = controller;
},
cancel: () => {
// Stream was cancelled by client. Only tear down the mapping if
// it still points at this stream — a stale cancel arriving after
// a resume re-registered the id must not tear down the successor.
if (keepAliveTimer !== undefined) {
clearInterval(keepAliveTimer);
}
if (this._streamMapping.get(streamId)?.controller === streamController) {
this._streamMapping.delete(streamId);
}
}
});
const headers = {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache, no-transform',
Connection: 'keep-alive',
'X-Accel-Buffering': 'no'
};
// After initialization, always include the session ID if we have one
if (this.sessionId !== undefined) {
headers['mcp-session-id'] = this.sessionId;
}
// Store the response for this request to send messages back through this connection
// We need to track by request ID to maintain the connection
for (const message of messages) {
if (isJSONRPCRequest(message)) {
this._streamMapping.set(streamId, {
controller: streamController,
encoder,
cleanup: () => {
if (keepAliveTimer !== undefined) {
clearInterval(keepAliveTimer);
}
this._streamMapping.delete(streamId);
try {
streamController.close();
}
catch {
// Controller might already be closed
}
}
});
this._requestToStreamMapping.set(message.id, streamId);
}
}
try {
// Write priming event if event store is configured (after mapping is set up)
await this.writePrimingEvent(streamController, encoder, streamId, clientProtocolVersion);
// handle each message
for (const message of messages) {
// Build closeSSEStream callback for requests when eventStore is configured
// AND client supports resumability (protocol version >= 2025-11-25).
// Old clients can't resume if the stream is closed early because they
// didn't receive a priming event with an event ID.
let closeSSEStream;
let closeStandaloneSSEStream;
if (isJSONRPCRequest(message) && this._eventStore && clientProtocolVersion >= '2025-11-25') {
closeSSEStream = () => {
this.closeSSEStream(message.id);
};
closeStandaloneSSEStream = () => {
this.closeStandaloneSSEStream();
};
}
this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo, closeSSEStream, closeStandaloneSSEStream });
}
}
catch (error) {
// Failing before the Response is handed out means nothing can ever
// cancel this stream: release it and its request correlations here.
this._streamMapping.get(streamId)?.cleanup();
this._resumableStreams.delete(streamId);
for (const message of messages) {
if (isJSONRPCRequest(message)) {
this._requestToStreamMapping.delete(message.id);
}
}
throw error;
}
// The server SHOULD NOT close the SSE stream before sending all JSON-RPC responses
// This will be handled by the send() method when responses are ready
// Arm keep-alive only after the fallible awaits above: an error path
// returns 400 and discards the Response, so nothing could ever cancel
// the stream and clear an already-armed timer. Skip if the responses
// already completed and cleaned the stream up.
if (this._streamMapping.get(streamId)?.controller === streamController) {
keepAliveTimer = this.startKeepAlive(streamController, encoder);
}
return new Response(readable, { status: 200, headers });
}
catch (error) {
// return JSON-RPC formatted error
this.onerror?.(error);
return this.createJsonErrorResponse(400, -32700, 'Parse error', { data: String(error) });
}
}
/**
* Handles DELETE requests to terminate sessions
*/
async handleDeleteRequest(req) {
const sessionError = this.validateSession(req);
if (sessionError) {
return sessionError;
}
const protocolError = this.validateProtocolVersion(req);
if (protocolError) {
return protocolError;
}
try {
await Promise.resolve(this._onsessionclosed?.(this.sessionId));
return new Response(null, { status: 200 });
}
finally {
await this.close();
}
}
/**
* Validates session ID for non-initialization requests.
* Returns Response error if invalid, undefined otherwise
*/
validateSession(req) {
if (this.sessionIdGenerator === undefined) {
// If the sessionIdGenerator ID is not set, the session management is disabled
// and we don't need to validate the session ID
return undefined;
}
if (!this._initialized) {
// If the server has not been initialized yet, reject all requests
this.onerror?.(new Error('Bad Request: Server not initialized'));
return this.createJsonErrorResponse(400, -32000, 'Bad Request: Server not initialized');
}
const sessionId = req.headers.get('mcp-session-id');
if (!sessionId) {
// Non-initialization requests without a session ID should return 400 Bad Request
this.onerror?.(new Error('Bad Request: Mcp-Session-Id header is required'));
return this.createJsonErrorResponse(400, -32000, 'Bad Request: Mcp-Session-Id header is required');
}
if (sessionId !== this.sessionId) {
// Reject requests with invalid session ID with 404 Not Found
this.onerror?.(new Error('Session not found'));
return this.createJsonErrorResponse(404, -32001, 'Session not found');
}
return undefined;
}
/**
* Validates the MCP-Protocol-Version header on incoming requests.
*
* For initialization: Version negotiation handles unknown versions gracefully
* (server responds with its supported version).
*
* For subsequent requests with MCP-Protocol-Version header:
* - Accept if in supported list
* - 400 if unsupported
*
* For HTTP requests without the MCP-Protocol-Version header:
* - Accept and default to the version negotiated at initialization
*/
validateProtocolVersion(req) {
const protocolVersion = req.headers.get('mcp-protocol-version');
if (protocolVersion !== null && !SUPPORTED_PROTOCOL_VERSIONS.includes(protocolVersion)) {
this.onerror?.(new Error(`Bad Request: Unsupported protocol version: ${protocolVersion}` +
` (supported versions: ${SUPPORTED_PROTOCOL_VERSIONS.join(', ')})`));
return this.createJsonErrorResponse(400, -32000, `Bad Request: Unsupported protocol version: ${protocolVersion} (supported versions: ${SUPPORTED_PROTOCOL_VERSIONS.join(', ')})`);
}
return undefined;
}
async close() {
if (this._closed) {
return;
}
// Stop any deferred keep-alive arm (e.g. a replay await resolving after
// close) from creating a timer nothing can clear.
this._closed = true;
// Close all SSE connections (each cleanup clears its own keep-alive timer)
this._streamMapping.forEach(({ cleanup }) => {
cleanup();
});
this._streamMapping.clear();
// Clear any pending responses
this._requestResponseMap.clear();
this._resumableStreams.clear();
this.onclose?.();
}
/**
* Close an SSE stream for a specific request, triggering client reconnection.
* Use this to implement polling behavior during long-running operations -
* client will reconnect after the retry interval specified in the priming event.
*/
closeSSEStream(requestId) {
const streamId = this._requestToStreamMapping.get(requestId);
if (!streamId)
return;
const stream = this._streamMapping.get(streamId);
if (stream) {
stream.cleanup();
}
}
/**
* Close the standalone GET SSE stream, triggering client reconnection.
* Use this to implement polling behavior for server-initiated notifications.
*/
closeStandaloneSSEStream() {
const stream = this._streamMapping.get(this._standaloneSseStreamId);
if (stream) {
stream.cleanup();
}
}
async send(message, options) {
let requestId = options?.relatedRequestId;
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
// If the message is a response, use the request ID from the message
requestId = message.id;
}
// Check if this message should be sent on the standalone SSE stream (no request ID)
// Ignore notifications from tools (which have relatedRequestId set)
// Those will be sent via dedicated response SSE streams
if (requestId === undefined) {
// For standalone SSE streams, we can only send requests and notifications
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
throw new Error('Cannot send a response on a standalone SSE stream unless resuming a previous client request');
}
// Generate and store event ID if event store is provided
// Store even if stream is disconnected so events can be replayed on reconnect
let eventId;
if (this._eventStore) {
// Stores the event and gets the generated event ID
eventId = await this._eventStore.storeEvent(this._standaloneSseStreamId, message);
}
const standaloneSse = this._streamMapping.get(this._standaloneSseStreamId);
if (standaloneSse === undefined) {
// Stream is disconnected - event is stored for replay, nothing more to do
return;
}
// Send the message to the standalone SSE stream, unless this stream
// was registered by a replay that already delivered this event (the
// store made it visible before this call resumed).
if (standaloneSse.controller &&
standaloneSse.encoder &&
(eventId === undefined || !standaloneSse.replayedEventIds?.has(eventId))) {
this.writeSSEEvent(standaloneSse.controller, standaloneSse.encoder, message, eventId);
}
return;
}
// Get the response for this request
const streamId = this._requestToStreamMapping.get(requestId);
if (!streamId) {
throw new Error(`No connection established for request ID: ${String(requestId)}`);
}
let stream = this._streamMapping.get(streamId);
if (!this._enableJsonResponse) {
// Store the event even if the stream is disconnected (e.g. after
// closeSSEStream switched the client to polling), so it can be
// replayed on reconnect — mirroring the standalone stream path.
let eventId;
if (this._eventStore) {
eventId = await this._eventStore.storeEvent(streamId, message);
// Re-fetch after the await: a resume completing meanwhile replaces
// this stream's registration with a successor, and the message
// must go to the live stream, not the evicted one.
stream = this._streamMapping.get(streamId);
}
// Skip the write if the stream was registered by a replay that
// already delivered this event (the store made it visible before
// this call resumed).
if (stream?.controller && stream?.encoder && (eventId === undefined || !stream.replayedEventIds?.has(eventId))) {
const written = this.writeSSEEvent(stream.controller, stream.encoder, message, eventId);
// The client now holds a Last-Event-ID cursor for this stream
if (written && eventId !== undefined) {
this._resumableStreams.add(streamId);
}
}
}
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
this._requestResponseMap.set(requestId, message);
const relatedIds = Array.from(this._requestToStreamMapping.entries())
.filter(([_, sid]) => sid === streamId)
.map(([id]) => id);
// Check if we have responses for all requests using this connection
const allResponsesReady = relatedIds.every(id => this._requestResponseMap.has(id));
if (allResponsesReady) {
if (!stream) {
// close() ran while the event store write above was awaiting:
// release the entries this call re-created after the sweep,
// then treat the late completion as a no-op.
if (this._closed) {
for (const id of relatedIds) {
this._requestResponseMap.delete(id);
this._requestToStreamMapping.delete(id);
}
return;
}
if (!this._enableJsonResponse && this._eventStore && this._resumableStreams.has(streamId)) {
// The stream went away (client disconnect, or
// closeSSEStream switched the client to polling), but the
// response was stored above and will be replayed on
// resume — release the correlations rather than throwing.
for (const id of relatedIds) {
this._requestResponseMap.delete(id);
this._requestToStreamMapping.delete(id);
}
this._resumableStreams.delete(streamId);
return;
}
// Without resumability (or in JSON response mode, where the
// pending HTTP response can never be settled by a replay),
// a missing stream means the response cannot be delivered.
// Release the correlations so the entries don't outlive the
// undeliverable response.
for (const id of relatedIds) {
this._requestResponseMap.delete(id);
this._requestToStreamMapping.delete(id);
}
throw new Error(`No connection established for request ID: ${String(requestId)}`);
}
if (this._enableJsonResponse && stream.resolveJson) {
// All responses ready, send as JSON
const headers = {
'Content-Type': 'application/json'
};
if (this.sessionId !== undefined) {
headers['mcp-session-id'] = this.sessionId;
}
const responses = relatedIds.map(id => this._requestResponseMap.get(id));
if (responses.length === 1) {
stream.resolveJson(new Response(JSON.stringify(responses[0]), { status: 200, headers }));
}
else {
stream.resolveJson(new Response(JSON.stringify(responses), { status: 200, headers }));
}
}
else {
// End the SSE stream
stream.cleanup();
}
// Clean up
for (const id of relatedIds) {
this._requestResponseMap.delete(id);
this._requestToStreamMapping.delete(id);
}
this._resumableStreams.delete(streamId);
}
}
}
}
//# sourceMappingURL=webStandardStreamableHttp.js.map
@@ -0,0 +1,23 @@
import { compactDecrypt } from '../jwe/compact/decrypt.js';
import { validateClaimsSet } from '../lib/jwt_claims_set.js';
import { JWTClaimValidationFailed } from '../util/errors.js';
export async function jwtDecrypt(jwt, key, options) {
const decrypted = await compactDecrypt(jwt, key, options);
const payload = validateClaimsSet(decrypted.protectedHeader, decrypted.plaintext, options);
const { protectedHeader } = decrypted;
if (protectedHeader.iss !== undefined && protectedHeader.iss !== payload.iss) {
throw new JWTClaimValidationFailed('replicated "iss" claim header parameter mismatch', payload, 'iss', 'mismatch');
}
if (protectedHeader.sub !== undefined && protectedHeader.sub !== payload.sub) {
throw new JWTClaimValidationFailed('replicated "sub" claim header parameter mismatch', payload, 'sub', 'mismatch');
}
if (protectedHeader.aud !== undefined &&
JSON.stringify(protectedHeader.aud) !== JSON.stringify(payload.aud)) {
throw new JWTClaimValidationFailed('replicated "aud" claim header parameter mismatch', payload, 'aud', 'mismatch');
}
const result = { payload, protectedHeader };
if (typeof key === 'function') {
return { ...result, key: decrypted.key };
}
return result;
}
@@ -0,0 +1,136 @@
/**
* Custom positioning reference element.
* @see https://floating-ui.com/docs/virtual-elements
*/
const sides = ['top', 'right', 'bottom', 'left'];
const alignments = ['start', 'end'];
const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
const min = Math.min;
const max = Math.max;
const round = Math.round;
const floor = Math.floor;
const createCoords = v => ({
x: v,
y: v
});
const oppositeSideMap = {
left: 'right',
right: 'left',
bottom: 'top',
top: 'bottom'
};
function clamp(start, value, end) {
return max(start, min(value, end));
}
function evaluate(value, param) {
return typeof value === 'function' ? value(param) : value;
}
function getSide(placement) {
return placement.split('-')[0];
}
function getAlignment(placement) {
return placement.split('-')[1];
}
function getOppositeAxis(axis) {
return axis === 'x' ? 'y' : 'x';
}
function getAxisLength(axis) {
return axis === 'y' ? 'height' : 'width';
}
function getSideAxis(placement) {
const firstChar = placement[0];
return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
}
function getAlignmentAxis(placement) {
return getOppositeAxis(getSideAxis(placement));
}
function getAlignmentSides(placement, rects, rtl) {
if (rtl === void 0) {
rtl = false;
}
const alignment = getAlignment(placement);
const alignmentAxis = getAlignmentAxis(placement);
const length = getAxisLength(alignmentAxis);
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
if (rects.reference[length] > rects.floating[length]) {
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
}
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
}
function getExpandedPlacements(placement) {
const oppositePlacement = getOppositePlacement(placement);
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
}
function getOppositeAlignmentPlacement(placement) {
return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
}
const lrPlacement = ['left', 'right'];
const rlPlacement = ['right', 'left'];
const tbPlacement = ['top', 'bottom'];
const btPlacement = ['bottom', 'top'];
function getSideList(side, isStart, rtl) {
switch (side) {
case 'top':
case 'bottom':
if (rtl) return isStart ? rlPlacement : lrPlacement;
return isStart ? lrPlacement : rlPlacement;
case 'left':
case 'right':
return isStart ? tbPlacement : btPlacement;
default:
return [];
}
}
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
const alignment = getAlignment(placement);
let list = getSideList(getSide(placement), direction === 'start', rtl);
if (alignment) {
list = list.map(side => side + "-" + alignment);
if (flipAlignment) {
list = list.concat(list.map(getOppositeAlignmentPlacement));
}
}
return list;
}
function getOppositePlacement(placement) {
const side = getSide(placement);
return oppositeSideMap[side] + placement.slice(side.length);
}
function expandPaddingObject(padding) {
return {
top: 0,
right: 0,
bottom: 0,
left: 0,
...padding
};
}
function getPaddingObject(padding) {
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
top: padding,
right: padding,
bottom: padding,
left: padding
};
}
function rectToClientRect(rect) {
const {
x,
y,
width,
height
} = rect;
return {
width,
height,
top: y,
left: x,
right: x + width,
bottom: y + height,
x,
y
};
}
export { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };
@@ -0,0 +1 @@
{"version":3,"file":"code.js","sourceRoot":"","sources":["../../lib/vocabularies/code.ts"],"names":[],"mappings":";;;AAGA,gDAAoG;AACpG,0CAAuD;AACvD,4CAAgC;AAChC,0CAAuC;AACvC,SAAgB,sBAAsB,CAAC,GAAe,EAAE,IAAY;IAClE,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC3B,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE;QACpE,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,EAAE,EAAC,EAAE,IAAI,CAAC,CAAA;QAClD,GAAG,CAAC,KAAK,EAAE,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAND,wDAMC;AAED,SAAgB,gBAAgB,CAC9B,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,EAAC,IAAI,EAAC,EAAa,EACnC,UAAoB,EACpB,OAAa;IAEb,OAAO,IAAA,YAAE,EACP,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAA,aAAG,EAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,IAAA,WAAC,EAAA,GAAG,OAAO,MAAM,IAAI,EAAE,CAAC,CACpF,CACF,CAAA;AACH,CAAC;AAVD,4CAUC;AAED,SAAgB,iBAAiB,CAAC,GAAe,EAAE,OAAa;IAC9D,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,OAAO,EAAC,EAAE,IAAI,CAAC,CAAA;IAC/C,GAAG,CAAC,KAAK,EAAE,CAAA;AACb,CAAC;AAHD,8CAGC;AAED,SAAgB,WAAW,CAAC,GAAY;IACtC,OAAO,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE;QAC5B,6DAA6D;QAC7D,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,cAAc;QACpC,IAAI,EAAE,IAAA,WAAC,EAAA,iCAAiC;KACzC,CAAC,CAAA;AACJ,CAAC;AAND,kCAMC;AAED,SAAgB,aAAa,CAAC,GAAY,EAAE,IAAU,EAAE,QAAuB;IAC7E,OAAO,IAAA,WAAC,EAAA,GAAG,WAAW,CAAC,GAAG,CAAC,SAAS,IAAI,KAAK,QAAQ,GAAG,CAAA;AAC1D,CAAC;AAFD,sCAEC;AAED,SAAgB,cAAc,CAC5B,GAAY,EACZ,IAAU,EACV,QAAuB,EACvB,aAAuB;IAEvB,MAAM,IAAI,GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,GAAG,IAAA,qBAAW,EAAC,QAAQ,CAAC,gBAAgB,CAAA;IAC7D,OAAO,aAAa,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,OAAO,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACnF,CAAC;AARD,wCAQC;AAED,SAAgB,gBAAgB,CAC9B,GAAY,EACZ,IAAU,EACV,QAAuB,EACvB,aAAuB;IAEvB,MAAM,IAAI,GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,GAAG,IAAA,qBAAW,EAAC,QAAQ,CAAC,gBAAgB,CAAA;IAC7D,OAAO,aAAa,CAAC,CAAC,CAAC,IAAA,YAAE,EAAC,IAAI,EAAE,IAAA,aAAG,EAAC,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACjF,CAAC;AARD,4CAQC;AAED,SAAgB,mBAAmB,CAAC,SAAqB;IACvD,OAAO,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACjF,CAAC;AAFD,kDAEC;AAED,SAAgB,gBAAgB,CAAC,EAAa,EAAE,SAAoB;IAClE,OAAO,mBAAmB,CAAC,SAAS,CAAC,CAAC,MAAM,CAC1C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,wBAAiB,EAAC,EAAE,EAAE,SAAS,CAAC,CAAC,CAAc,CAAC,CACzD,CAAA;AACH,CAAC;AAJD,4CAIC;AAED,SAAgB,gBAAgB,CAC9B,EAAC,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,EAAC,GAAG,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAC,EAAE,EAAE,EAAa,EAClF,IAAU,EACV,OAAa,EACb,UAAoB;IAEpB,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,UAAU,KAAK,IAAI,KAAK,YAAY,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;IACjG,MAAM,MAAM,GAA4B;QACtC,CAAC,eAAC,CAAC,YAAY,EAAE,IAAA,mBAAS,EAAC,eAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QACtD,CAAC,eAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC;QAC7B,CAAC,eAAC,CAAC,kBAAkB,EAAE,EAAE,CAAC,kBAAkB,CAAC;QAC7C,CAAC,eAAC,CAAC,QAAQ,EAAE,eAAC,CAAC,QAAQ,CAAC;KACzB,CAAA;IACD,IAAI,EAAE,CAAC,IAAI,CAAC,UAAU;QAAE,MAAM,CAAC,IAAI,CAAC,CAAC,eAAC,CAAC,cAAc,EAAE,eAAC,CAAC,cAAc,CAAC,CAAC,CAAA;IACzE,MAAM,IAAI,GAAG,IAAA,WAAC,EAAA,GAAG,aAAa,KAAK,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,CAAA;IAC1D,OAAO,OAAO,KAAK,aAAG,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,SAAS,OAAO,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,IAAI,IAAI,GAAG,CAAA;AACrF,CAAC;AAhBD,4CAgBC;AAED,MAAM,SAAS,GAAG,IAAA,WAAC,EAAA,YAAY,CAAA;AAE/B,SAAgB,UAAU,CAAC,EAAC,GAAG,EAAE,EAAE,EAAE,EAAC,IAAI,EAAC,EAAa,EAAE,OAAe;IACvE,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IACvC,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;IAC1B,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;IAE7B,OAAO,GAAG,CAAC,UAAU,CAAC,SAAS,EAAE;QAC/B,GAAG,EAAE,EAAE,CAAC,QAAQ,EAAE;QAClB,GAAG,EAAE,EAAE;QACP,IAAI,EAAE,IAAA,WAAC,EAAA,GAAG,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,cAAO,EAAC,GAAG,EAAE,MAAM,CAAC,IAAI,OAAO,KAAK,CAAC,GAAG;KAC9F,CAAC,CAAA;AACJ,CAAC;AAVD,gCAUC;AAED,SAAgB,aAAa,CAAC,GAAe;IAC3C,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IACpC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC;QACjB,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QACvC,aAAa,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAA;QAChD,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACpB,aAAa,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;IAChC,OAAO,KAAK,CAAA;IAEZ,SAAS,aAAa,CAAC,QAAoB;QACzC,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,SAAS,CAAC,CAAA;QAC/C,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;YAC9B,GAAG,CAAC,SAAS,CACX;gBACE,OAAO;gBACP,QAAQ,EAAE,CAAC;gBACX,YAAY,EAAE,WAAI,CAAC,GAAG;aACvB,EACD,KAAK,CACN,CAAA;YACD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAA;QAC9B,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AA1BD,sCA0BC;AAED,SAAgB,aAAa,CAAC,GAAe;IAC3C,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IACtC,wBAAwB;IACxLine truncated
@@ -0,0 +1,25 @@
/**
* @license lucide-react v0.469.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 EthernetPort = createLucideIcon("EthernetPort", [
[
"path",
{
d: "m15 20 3-3h2a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2l3 3z",
key: "rbahqx"
}
],
["path", { d: "M6 8v1", key: "1636ez" }],
["path", { d: "M10 8v1", key: "1talb4" }],
["path", { d: "M14 8v1", key: "1rsfgr" }],
["path", { d: "M18 8v1", key: "gnkwox" }]
]);
export { EthernetPort as default };
//# sourceMappingURL=ethernet-port.js.map
@@ -0,0 +1,188 @@
# CacheStorage
<!--introduced_in=v5.22.1-->
<!--type=module-->
<!-- source_link=lib/web/cache/cachestorage.js -->
> Stability: 2 - Stable
undici provides a spec-compliant implementation of the [W3C Service Worker
`CacheStorage`][] and [`Cache`][] interfaces. A `CacheStorage` is a named
collection of [`Cache`][] objects, each of which stores `Request`/`Response`
pairs.
The class itself is not exported; instead, undici exposes a single shared
`CacheStorage` instance named `caches`. Import it from `'undici'`:
```mjs
import { caches } from 'undici'
const cache = await caches.open('v1')
```
```cjs
const { caches } = require('undici')
caches.open('v1').then((cache) => {
// ...
})
```
## `caches`
<!-- YAML
added: v5.22.1
-->
* Type: {CacheStorage}
The shared [`CacheStorage`](#class-cachestorage) instance exported by undici.
All caches opened through `caches` live for the lifetime of the process.
```mjs
import { caches } from 'undici'
await caches.open('v1')
console.log(await caches.keys()) // ['v1']
```
## Class: `CacheStorage`
<!-- YAML
added: v5.22.1
-->
Represents the storage for [`Cache`][] objects. Each `CacheStorage` keeps a
mapping of cache names to their backing list of cached responses.
The constructor is not public: attempting to instantiate `CacheStorage`
directly throws a `TypeError`. Use the exported [`caches`](#caches) instance
instead.
### `caches.match(request[, options])`
<!-- YAML
added: v5.22.1
-->
* `request` {Request|string} The request to match against. A string is treated
as a URL.
* `options` {Object} (optional)
* `ignoreSearch` {boolean} When `true`, ignores the query string of the URL
when matching. **Default:** `false`.
* `ignoreMethod` {boolean} When `true`, prevents matching operations from
validating the `Request` `http` method. **Default:** `false`.
* `ignoreVary` {boolean} When `true`, ignores the `Vary` header when matching.
**Default:** `false`.
* `cacheName` {string} When set, restricts the search to the cache with this
name. **Default:** `undefined`.
* Returns: {Promise} Fulfills with the first matching {Response}, or
`undefined` if no response matched.
Searches the caches for a response matching `request`. When `options.cacheName`
is provided, only that cache is searched; otherwise every cache is searched in
insertion order and the first match is returned.
```mjs
import { caches } from 'undici'
const response = await caches.match('https://example.com/data', {
cacheName: 'v1'
})
```
### `caches.has(cacheName)`
<!-- YAML
added: v5.22.1
-->
* `cacheName` {string} The name of the cache to look up.
* Returns: {Promise} Fulfills with `true` if a cache named `cacheName` exists,
otherwise `false`.
Checks whether a cache with the given name exists in the storage.
```mjs
import { caches } from 'undici'
await caches.open('v1')
console.log(await caches.has('v1')) // true
console.log(await caches.has('v2')) // false
```
### `caches.open(cacheName)`
<!-- YAML
added: v5.22.1
-->
* `cacheName` {string} The name of the cache to open.
* Returns: {Promise} Fulfills with the {Cache} named `cacheName`.
Opens the cache named `cacheName`, creating it if it does not already exist.
Each call returns a new [`Cache`][] object, but caches opened with the same name
share their underlying list of cached responses. As a result, a response stored
through one instance is visible through another instance with the same name.
```mjs
import { caches } from 'undici'
import assert from 'node:assert'
const cache1 = await caches.open('v1')
const cache2 = await caches.open('v1')
// open() returns distinct objects,
assert(cache1 !== cache2)
// but they share the same cached responses.
assert.deepStrictEqual(await cache1.match('/req'), await cache2.match('/req'))
```
### `caches.delete(cacheName)`
<!-- YAML
added: v5.22.1
-->
* `cacheName` {string} The name of the cache to delete.
* Returns: {Promise} Fulfills with `true` if the cache existed and was deleted,
otherwise `false`.
Removes the cache named `cacheName` from the storage. Any [`Cache`][] objects
already obtained for that name, along with the `Request`/`Response` pairs they
returned, remain usable after deletion.
```mjs
import { caches } from 'undici'
const cache = await caches.open('v1')
const response = await cache.match('/req')
await caches.delete('v1')
// The already-retrieved response is still usable.
await response.text()
```
### `caches.keys()`
<!-- YAML
added: v5.22.1
-->
* Returns: {Promise} Fulfills with a {string[]} of cache names in insertion
order.
Returns the names of all caches currently held by the storage.
```mjs
import { caches } from 'undici'
await caches.open('v1')
await caches.open('v2')
console.log(await caches.keys()) // ['v1', 'v2']
```
[W3C Service Worker `CacheStorage`]: https://w3c.github.io/ServiceWorker/#cachestorage-interface
[`Cache`]: https://w3c.github.io/ServiceWorker/#cache-interface
@@ -0,0 +1,42 @@
import { encode as b64u } from '../util/base64url.js';
import * as aeskw from './aeskw.js';
import { checkEncCryptoKey } from './crypto_key.js';
import { concat, encode } from './buffer_utils.js';
import { JWEInvalid } from '../util/errors.js';
function getCryptoKey(key, alg) {
if (key instanceof Uint8Array) {
return crypto.subtle.importKey('raw', key, 'PBKDF2', false, [
'deriveBits',
]);
}
checkEncCryptoKey(key, alg, 'deriveBits');
return key;
}
const concatSalt = (alg, p2sInput) => concat(encode(alg), Uint8Array.of(0x00), p2sInput);
async function deriveKey(p2s, alg, p2c, key) {
if (!(p2s instanceof Uint8Array) || p2s.length < 8) {
throw new JWEInvalid('PBES2 Salt Input must be 8 or more octets');
}
if (!Number.isSafeInteger(p2c) || Math.sign(p2c) !== 1) {
throw new JWEInvalid('PBES2 Count Input must be a positive integer');
}
const salt = concatSalt(alg, p2s);
const keylen = parseInt(alg.slice(13, 16), 10);
const subtleAlg = {
hash: `SHA-${alg.slice(8, 11)}`,
iterations: p2c,
name: 'PBKDF2',
salt,
};
const cryptoKey = await getCryptoKey(key, alg);
return new Uint8Array(await crypto.subtle.deriveBits(subtleAlg, cryptoKey, keylen));
}
export async function wrap(alg, key, cek, p2c = 2048, p2s = crypto.getRandomValues(new Uint8Array(16))) {
const derived = await deriveKey(p2s, alg, p2c, key);
const encryptedKey = await aeskw.wrap(alg.slice(-6), derived, cek);
return { encryptedKey, p2c, p2s: b64u(p2s) };
}
export async function unwrap(alg, key, encryptedKey, p2c, p2s) {
const derived = await deriveKey(p2s, alg, p2c, key);
return aeskw.unwrap(alg.slice(-6), derived, encryptedKey);
}
@@ -0,0 +1,490 @@
import Tokenizer, { QuoteType } from "./Tokenizer.js";
import { fromCodePoint } from "entities/decode";
const formTags = new Set([
"input",
"option",
"optgroup",
"select",
"button",
"datalist",
"textarea",
]);
const pTag = new Set(["p"]);
const tableSectionTags = new Set(["thead", "tbody"]);
const ddtTags = new Set(["dd", "dt"]);
const rtpTags = new Set(["rt", "rp"]);
const openImpliesClose = new Map([
["tr", new Set(["tr", "th", "td"])],
["th", new Set(["th"])],
["td", new Set(["thead", "th", "td"])],
["body", new Set(["head", "link", "script"])],
["li", new Set(["li"])],
["p", pTag],
["h1", pTag],
["h2", pTag],
["h3", pTag],
["h4", pTag],
["h5", pTag],
["h6", pTag],
["select", formTags],
["input", formTags],
["output", formTags],
["button", formTags],
["datalist", formTags],
["textarea", formTags],
["option", new Set(["option"])],
["optgroup", new Set(["optgroup", "option"])],
["dd", ddtTags],
["dt", ddtTags],
["address", pTag],
["article", pTag],
["aside", pTag],
["blockquote", pTag],
["details", pTag],
["div", pTag],
["dl", pTag],
["fieldset", pTag],
["figcaption", pTag],
["figure", pTag],
["footer", pTag],
["form", pTag],
["header", pTag],
["hr", pTag],
["main", pTag],
["nav", pTag],
["ol", pTag],
["pre", pTag],
["section", pTag],
["table", pTag],
["ul", pTag],
["rt", rtpTags],
["rp", rtpTags],
["tbody", tableSectionTags],
["tfoot", tableSectionTags],
]);
const voidElements = new Set([
"area",
"base",
"basefont",
"br",
"col",
"command",
"embed",
"frame",
"hr",
"img",
"input",
"isindex",
"keygen",
"link",
"meta",
"param",
"source",
"track",
"wbr",
]);
const foreignContextElements = new Set(["math", "svg"]);
const htmlIntegrationElements = new Set([
"mi",
"mo",
"mn",
"ms",
"mtext",
"annotation-xml",
"foreignobject",
"desc",
"title",
]);
const reNameEnd = /\s|\//;
export class Parser {
constructor(cbs, options = {}) {
var _a, _b, _c, _d, _e, _f;
this.options = options;
/** The start index of the last event. */
this.startIndex = 0;
/** The end index of the last event. */
this.endIndex = 0;
/**
* Store the start index of the current open tag,
* so we can update the start index for attributes.
*/
this.openTagStart = 0;
this.tagname = "";
this.attribname = "";
this.attribvalue = "";
this.attribs = null;
this.stack = [];
this.buffers = [];
this.bufferOffset = 0;
/** The index of the last written buffer. Used when resuming after a `pause()`. */
this.writeIndex = 0;
/** Indicates whether the parser has finished running / `.end` has been called. */
this.ended = false;
this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};
this.htmlMode = !this.options.xmlMode;
this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== void 0 ? _a : this.htmlMode;
this.lowerCaseAttributeNames =
(_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : this.htmlMode;
this.recognizeSelfClosing =
(_c = options.recognizeSelfClosing) !== null && _c !== void 0 ? _c : !this.htmlMode;
this.tokenizer = new ((_d = options.Tokenizer) !== null && _d !== void 0 ? _d : Tokenizer)(this.options, this);
this.foreignContext = [!this.htmlMode];
(_f = (_e = this.cbs).onparserinit) === null || _f === void 0 ? void 0 : _f.call(_e, this);
}
// Tokenizer event handlers
/** @internal */
ontext(start, endIndex) {
var _a, _b;
const data = this.getSlice(start, endIndex);
this.endIndex = endIndex - 1;
(_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, data);
this.startIndex = endIndex;
}
/** @internal */
ontextentity(cp, endIndex) {
var _a, _b;
this.endIndex = endIndex - 1;
(_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, fromCodePoint(cp));
this.startIndex = endIndex;
}
/**
* Checks if the current tag is a void element. Override this if you want
* to specify your own additional void elements.
*/
isVoidElement(name) {
return this.htmlMode && voidElements.has(name);
}
/** @internal */
onopentagname(start, endIndex) {
this.endIndex = endIndex;
let name = this.getSlice(start, endIndex);
if (this.lowerCaseTagNames) {
name = name.toLowerCase();
}
this.emitOpenTag(name);
}
emitOpenTag(name) {
var _a, _b, _c, _d;
this.openTagStart = this.startIndex;
this.tagname = name;
const impliesClose = this.htmlMode && openImpliesClose.get(name);
if (impliesClose) {
while (this.stack.length > 0 && impliesClose.has(this.stack[0])) {
const element = this.stack.shift();
(_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, element, true);
}
}
if (!this.isVoidElement(name)) {
this.stack.unshift(name);
if (this.htmlMode) {
if (foreignContextElements.has(name)) {
this.foreignContext.unshift(true);
}
else if (htmlIntegrationElements.has(name)) {
this.foreignContext.unshift(false);
}
}
}
(_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, name);
if (this.cbs.onopentag)
this.attribs = {};
}
endOpenTag(isImplied) {
var _a, _b;
this.startIndex = this.openTagStart;
if (this.attribs) {
(_b = (_a = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a, this.tagname, this.attribs, isImplied);
this.attribs = null;
}
if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) {
this.cbs.onclosetag(this.tagname, true);
}
this.tagname = "";
}
/** @internal */
onopentagend(endIndex) {
this.endIndex = endIndex;
this.endOpenTag(false);
// Set `startIndex` for next node
this.startIndex = endIndex + 1;
}
/** @internal */
onclosetag(start, endIndex) {
var _a, _b, _c, _d, _e, _f, _g, _h;
this.endIndex = endIndex;
let name = this.getSlice(start, endIndex);
if (this.lowerCaseTagNames) {
name = name.toLowerCase();
}
if (this.htmlMode &&
(foreignContextElements.has(name) ||
htmlIntegrationElements.has(name))) {
this.foreignContext.shift();
}
if (!this.isVoidElement(name)) {
const pos = this.stack.indexOf(name);
if (pos !== -1) {
for (let index = 0; index <= pos; index++) {
const element = this.stack.shift();
// We know the stack has sufficient elements.
(_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, element, index !== pos);
}
}
else if (this.htmlMode && name === "p") {
// Implicit open before close
this.emitOpenTag("p");
this.closeCurrentTag(true);
}
}
else if (this.htmlMode && name === "br") {
// We can't use `emitOpenTag` for implicit open, as `br` would be implicitly closed.
(_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, "br");
(_f = (_e = this.cbs).onopentag) === null || _f === void 0 ? void 0 : _f.call(_e, "br", {}, true);
(_h = (_g = this.cbs).onclosetag) === null || _h === void 0 ? void 0 : _h.call(_g, "br", false);
}
// Set `startIndex` for next node
this.startIndex = endIndex + 1;
}
/** @internal */
onselfclosingtag(endIndex) {
this.endIndex = endIndex;
if (this.recognizeSelfClosing || this.foreignContext[0]) {
this.closeCurrentTag(false);
// Set `startIndex` for next node
this.startIndex = endIndex + 1;
}
else {
// Ignore the fact that the tag is self-closing.
this.onopentagend(endIndex);
}
}
closeCurrentTag(isOpenImplied) {
var _a, _b;
const name = this.tagname;
this.endOpenTag(isOpenImplied);
// Self-closing tags will be on the top of the stack
if (this.stack[0] === name) {
// If the opening tag isn't implied, the closing tag has to be implied.
(_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, name, !isOpenImplied);
this.stack.shift();
}
}
/** @internal */
onattribname(start, endIndex) {
this.startIndex = start;
const name = this.getSlice(start, endIndex);
this.attribname = this.lowerCaseAttributeNames
? name.toLowerCase()
: name;
}
/** @internal */
onattribdata(start, endIndex) {
this.attribvalue += this.getSlice(start, endIndex);
}
/** @internal */
onattribentity(cp) {
this.attribvalue += fromCodePoint(cp);
}
/** @internal */
onattribend(quote, endIndex) {
var _a, _b;
this.endIndex = endIndex;
(_b = (_a = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a, this.attribname, this.attribvalue, quote === QuoteType.Double
? '"'
: quote === QuoteType.Single
? "'"
: quote === QuoteType.NoValue
? undefined
: null);
if (this.attribs &&
!Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) {
this.attribs[this.attribname] = this.attribvalue;
}
this.attribvalue = "";
}
getInstructionName(value) {
const index = value.search(reNameEnd);
let name = index < 0 ? value : value.substr(0, index);
if (this.lowerCaseTagNames) {
name = name.toLowerCase();
}
return name;
}
/** @internal */
ondeclaration(start, endIndex) {
this.endIndex = endIndex;
const value = this.getSlice(start, endIndex);
if (this.cbs.onprocessinginstruction) {
const name = this.getInstructionName(value);
this.cbs.onprocessinginstruction(`!${name}`, `!${value}`);
}
// Set `startIndex` for next node
this.startIndex = endIndex + 1;
}
/** @internal */
onprocessinginstruction(start, endIndex) {
this.endIndex = endIndex;
const value = this.getSlice(start, endIndex);
if (this.cbs.onprocessinginstruction) {
const name = this.getInstructionName(value);
this.cbs.onprocessinginstruction(`?${name}`, `?${value}`);
}
// Set `startIndex` for next node
this.startIndex = endIndex + 1;
}
/** @internal */
oncomment(start, endIndex, offset) {
var _a, _b, _c, _d;
this.endIndex = endIndex;
(_b = (_a = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a, this.getSlice(start, endIndex - offset));
(_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);
// Set `startIndex` for next node
this.startIndex = endIndex + 1;
}
/** @internal */
oncdata(start, endIndex, offset) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
this.endIndex = endIndex;
const value = this.getSlice(start, endIndex - offset);
if (!this.htmlMode || this.options.recognizeCDATA) {
(_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a);
(_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);
(_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e);
}
else {
(_h = (_g = this.cbs).oncomment) === null || _h === void 0 ? void 0 : _h.call(_g, `[CDATA[${value}]]`);
(_k = (_j = this.cbs).oncommentend) === null || _k === void 0 ? void 0 : _k.call(_j);
}
// Set `startIndex` for next node
this.startIndex = endIndex + 1;
}
/** @internal */
onend() {
var _a, _b;
if (this.cbs.onclosetag) {
// Set the end index for all remaining tags
this.endIndex = this.startIndex;
for (let index = 0; index < this.stack.length; index++) {
this.cbs.onclosetag(this.stack[index], true);
}
}
(_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a);
}
/**
* Resets the parser to a blank state, ready to parse a new HTML document
*/
reset() {
var _a, _b, _c, _d;
(_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a);
this.tokenizer.reset();
this.tagname = "";
this.attribname = "";
this.attribs = null;
this.stack.length = 0;
this.startIndex = 0;
this.endIndex = 0;
(_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this);
this.buffers.length = 0;
this.foreignContext.length = 0;
this.foreignContext.unshift(!this.htmlMode);
this.bufferOffset = 0;
this.writeIndex = 0;
this.ended = false;
}
/**
* Resets the parser, then parses a complete document and
* pushes it to the handler.
*
* @param data Document to parse.
*/
parseComplete(data) {
this.reset();
this.end(data);
}
getSlice(start, end) {
while (start - this.bufferOffset >= this.buffers[0].length) {
this.shiftBuffer();
}
let slice = this.buffers[0].slice(start - this.bufferOffset, end - this.bufferOffset);
while (end - this.bufferOffset > this.buffers[0].length) {
this.shiftBuffer();
slice += this.buffers[0].slice(0, end - this.bufferOffset);
}
return slice;
}
shiftBuffer() {
this.bufferOffset += this.buffers[0].length;
this.writeIndex--;
this.buffers.shift();
}
/**
* Parses a chunk of data and calls the corresponding callbacks.
*
* @param chunk Chunk to parse.
*/
write(chunk) {
var _a, _b;
if (this.ended) {
(_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(".write() after done!"));
return;
}
this.buffers.push(chunk);
if (this.tokenizer.running) {
this.tokenizer.write(chunk);
this.writeIndex++;
}
}
/**
* Parses the end of the buffer and clears the stack, calls onend.
*
* @param chunk Optional final chunk to parse.
*/
end(chunk) {
var _a, _b;
if (this.ended) {
(_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(".end() after done!"));
return;
}
if (chunk)
this.write(chunk);
this.ended = true;
this.tokenizer.end();
}
/**
* Pauses parsing. The parser won't emit events until `resume` is called.
*/
pause() {
this.tokenizer.pause();
}
/**
* Resumes parsing after `pause` was called.
*/
resume() {
this.tokenizer.resume();
while (this.tokenizer.running &&
this.writeIndex < this.buffers.length) {
this.tokenizer.write(this.buffers[this.writeIndex++]);
}
if (this.ended)
this.tokenizer.end();
}
/**
* Alias of `write`, for backwards compatibility.
*
* @param chunk Chunk to parse.
* @deprecated
*/
parseChunk(chunk) {
this.write(chunk);
}
/**
* Alias of `end`, for backwards compatibility.
*
* @param chunk Optional final chunk to parse.
* @deprecated
*/
done(chunk) {
this.end(chunk);
}
}
//# sourceMappingURL=Parser.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_regeneratorKeys","val","object","Object","keys","key","unshift","next","length","pop","value","done"],"sources":["../../src/helpers/regeneratorKeys.ts"],"sourcesContent":["/* @minVersion 7.27.0 */\n/* @mangleFns */\n\nexport default function _regeneratorKeys(val: unknown) {\n var object = Object(val);\n var keys: string[] = [];\n var key: string;\n // eslint-disable-next-line guard-for-in\n for (var key in object) {\n keys.unshift(key);\n }\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n key = keys.pop()!;\n if (key in object) {\n // @ts-expect-error assign to () => ...\n next.value = key;\n // @ts-expect-error assign to () => ...\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n // @ts-expect-error assign to () => ...\n next.done = true;\n return next;\n };\n}\n"],"mappings":";;;;;;AAGe,SAASA,gBAAgBA,CAACC,GAAY,EAAE;EACrD,IAAIC,MAAM,GAAGC,MAAM,CAACF,GAAG,CAAC;EACxB,IAAIG,IAAc,GAAG,EAAE;EACvB,IAAIC,GAAW;EAEf,KAAK,IAAIA,GAAG,IAAIH,MAAM,EAAE;IACtBE,IAAI,CAACE,OAAO,CAACD,GAAG,CAAC;EACnB;EAIA,OAAO,SAASE,IAAIA,CAAA,EAAG;IACrB,OAAOH,IAAI,CAACI,MAAM,EAAE;MAClBH,GAAG,GAAGD,IAAI,CAACK,GAAG,CAAC,CAAE;MACjB,IAAIJ,GAAG,IAAIH,MAAM,EAAE;QAEjBK,IAAI,CAACG,KAAK,GAAGL,GAAG;QAEhBE,IAAI,CAACI,IAAI,GAAG,KAAK;QACjB,OAAOJ,IAAI;MACb;IACF;IAMAA,IAAI,CAACI,IAAI,GAAG,IAAI;IAChB,OAAOJ,IAAI;EACb,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,69 @@
{
"name": "@radix-ui/react-presence",
"version": "1.1.5",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"dependencies": {
"@radix-ui/react-compose-refs": "1.1.2",
"@radix-ui/react-use-layout-effect": "1.1.1"
},
"devDependencies": {
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"typescript": "^5.7.3",
"@repo/typescript-config": "0.0.0",
"@repo/eslint-config": "0.0.0",
"@repo/builder": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}