Socket
Socket
Sign inDemoInstall

@edge-runtime/primitives

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edge-runtime/primitives - npm Package Compare versions

Comparing version 3.0.4 to 3.1.0

2

dist/events.js.text.js

@@ -1,1 +0,1 @@

module.exports = "\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/primitives/events.js\nvar events_exports = {};\n__export(events_exports, {\n Event: () => Event,\n EventTarget: () => EventTarget,\n FetchEvent: () => FetchEvent,\n PromiseRejectionEvent: () => PromiseRejectionEvent\n});\nmodule.exports = __toCommonJS(events_exports);\n\n// <define:process>\nvar define_process_default = { env: {}, versions: { node: \"16.6.0\" } };\n\n// ../../node_modules/.pnpm/event-target-shim@6.0.2/node_modules/event-target-shim/index.mjs\nfunction assertType(condition, message, ...args) {\n if (!condition) {\n throw new TypeError(format(message, args));\n }\n}\n__name(assertType, \"assertType\");\nfunction format(message, args) {\n let i = 0;\n return message.replace(/%[os]/gu, () => anyToString(args[i++]));\n}\n__name(format, \"format\");\nfunction anyToString(x) {\n if (typeof x !== \"object\" || x === null) {\n return String(x);\n }\n return Object.prototype.toString.call(x);\n}\n__name(anyToString, \"anyToString\");\nvar currentErrorHandler;\nfunction reportError(maybeError) {\n try {\n const error = maybeError instanceof Error ? maybeError : new Error(anyToString(maybeError));\n if (currentErrorHandler) {\n currentErrorHandler(error);\n return;\n }\n if (typeof dispatchEvent === \"function\" && typeof ErrorEvent === \"function\") {\n dispatchEvent(new ErrorEvent(\"error\", { error, message: error.message }));\n } else if (typeof define_process_default !== \"undefined\" && typeof define_process_default.emit === \"function\") {\n define_process_default.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n } catch (_a) {\n }\n}\n__name(reportError, \"reportError\");\nvar Global = typeof window !== \"undefined\" ? window : typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : typeof globalThis !== \"undefined\" ? globalThis : void 0;\nvar currentWarnHandler;\nvar _Warning = class _Warning {\n constructor(code, message) {\n this.code = code;\n this.message = message;\n }\n /**\n * Report this warning.\n * @param args The arguments of the warning.\n */\n warn(...args) {\n var _a;\n try {\n if (currentWarnHandler) {\n currentWarnHandler({ ...this, args });\n return;\n }\n const stack = ((_a = new Error().stack) !== null && _a !== void 0 ? _a : \"\").replace(/^(?:.+?\\n){2}/gu, \"\\n\");\n console.warn(this.message, ...args, stack);\n } catch (_b) {\n }\n }\n};\n__name(_Warning, \"Warning\");\nvar Warning = _Warning;\nvar InitEventWasCalledWhileDispatching = new Warning(\"W01\", \"Unable to initialize event under dispatching.\");\nvar FalsyWasAssignedToCancelBubble = new Warning(\"W02\", \"Assigning any falsy value to 'cancelBubble' property has no effect.\");\nvar TruthyWasAssignedToReturnValue = new Warning(\"W03\", \"Assigning any truthy value to 'returnValue' property has no effect.\");\nvar NonCancelableEventWasCanceled = new Warning(\"W04\", \"Unable to preventDefault on non-cancelable events.\");\nvar CanceledInPassiveListener = new Warning(\"W05\", \"Unable to preventDefault inside passive event listener invocation.\");\nvar EventListenerWasDuplicated = new Warning(\"W06\", \"An event listener wasn't added because it has been added already: %o, %o\");\nvar OptionWasIgnored = new Warning(\"W07\", \"The %o option value was abandoned because the event listener wasn't added as duplicated.\");\nvar InvalidEventListener = new Warning(\"W08\", \"The 'callback' argument must be a function or an object that has 'handleEvent' method: %o\");\nvar InvalidAttributeHandler = new Warning(\"W09\", \"Event attribute handler must be a function: %o\");\nvar _Event = class _Event {\n /**\n * @see https://dom.spec.whatwg.org/#dom-event-none\n */\n static get NONE() {\n return NONE;\n }\n /**\n * @see https://dom.spec.whatwg.org/#dom-event-capturing_phase\n */\n static get CAPTURING_PHASE() {\n return CAPTURING_PHASE;\n }\n /**\n * @see https://dom.spec.whatwg.org/#dom-event-at_target\n */\n static get AT_TARGET() {\n return AT_TARGET;\n }\n /**\n * @see https://dom.spec.whatwg.org/#dom-event-bubbling_phase\n */\n static get BUBBLING_PHASE() {\n return BUBBLING_PHASE;\n }\n /**\n * Initialize this event instance.\n * @param type The type of this event.\n * @param eventInitDict Options to initialize.\n * @see https://dom.spec.whatwg.org/#dom-event-event\n */\n constructor(type, eventInitDict) {\n Object.defineProperty(this, \"isTrusted\", {\n value: false,\n enumerable: true\n });\n const opts = eventInitDict !== null && eventInitDict !== void 0 ? eventInitDict : {};\n internalDataMap.set(this, {\n type: String(type),\n bubbles: Boolean(opts.bubbles),\n cancelable: Boolean(opts.cancelable),\n composed: Boolean(opts.composed),\n target: null,\n currentTarget: null,\n stopPropagationFlag: false,\n stopImmediatePropagationFlag: false,\n canceledFlag: false,\n inPassiveListenerFlag: false,\n dispatchFlag: false,\n timeStamp: Date.now()\n });\n }\n /**\n * The type of this event.\n * @see https://dom.spec.whatwg.org/#dom-event-type\n */\n get type() {\n return $(this).type;\n }\n /**\n * The event target of the current dispatching.\n * @see https://dom.spec.whatwg.org/#dom-event-target\n */\n get target() {\n return $(this).target;\n }\n /**\n * The event target of the current dispatching.\n * @deprecated Use the `target` property instead.\n * @see https://dom.spec.whatwg.org/#dom-event-srcelement\n */\n get srcElement() {\n return $(this).target;\n }\n /**\n * The event target of the current dispatching.\n * @see https://dom.spec.whatwg.org/#dom-event-currenttarget\n */\n get currentTarget() {\n return $(this).currentTarget;\n }\n /**\n * The event target of the current dispatching.\n * This doesn't support node tree.\n * @see https://dom.spec.whatwg.org/#dom-event-composedpath\n */\n composedPath() {\n const currentTarget = $(this).currentTarget;\n if (currentTarget) {\n return [currentTarget];\n }\n return [];\n }\n /**\n * @see https://dom.spec.whatwg.org/#dom-event-none\n */\n get NONE() {\n return NONE;\n }\n /**\n * @see https://dom.spec.whatwg.org/#dom-event-capturing_phase\n */\n get CAPTURING_PHASE() {\n return CAPTURING_PHASE;\n }\n /**\n * @see https://dom.spec.whatwg.org/#dom-event-at_target\n */\n get AT_TARGET() {\n return AT_TARGET;\n }\n /**\n * @see https://dom.spec.whatwg.org/#dom-event-bubbling_phase\n */\n get BUBBLING_PHASE() {\n return BUBBLING_PHASE;\n }\n /**\n * The current event phase.\n * @see https://dom.spec.whatwg.org/#dom-event-eventphase\n */\n get eventPhase() {\n return $(this).dispatchFlag ? 2 : 0;\n }\n /**\n * Stop event bubbling.\n * Because this shim doesn't support node tree, this merely changes the `cancelBubble` property value.\n * @see https://dom.spec.whatwg.org/#dom-event-stoppropagation\n */\n stopPropagation() {\n $(this).stopPropagationFlag = true;\n }\n /**\n * `true` if event bubbling was stopped.\n * @deprecated\n * @see https://dom.spec.whatwg.org/#dom-event-cancelbubble\n */\n get cancelBubble() {\n return $(this).stopPropagationFlag;\n }\n /**\n * Stop event bubbling if `true` is set.\n * @deprecated Use the `stopPropagation()` method instead.\n * @see https://dom.spec.whatwg.org/#dom-event-cancelbubble\n */\n set cancelBubble(value) {\n if (value) {\n $(this).stopPropagationFlag = true;\n } else {\n FalsyWasAssignedToCancelBubble.warn();\n }\n }\n /**\n * Stop event bubbling and subsequent event listener callings.\n * @see https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation\n */\n stopImmediatePropagation() {\n const data = $(this);\n data.stopPropagationFlag = data.stopImmediatePropagationFlag = true;\n }\n /**\n * `true` if this event will bubble.\n * @see https://dom.spec.whatwg.org/#dom-event-bubbles\n */\n get bubbles() {\n return $(this).bubbles;\n }\n /**\n * `true` if this event can be canceled by the `preventDefault()` method.\n * @see https://dom.spec.whatwg.org/#dom-event-cancelable\n */\n get cancelable() {\n return $(this).cancelable;\n }\n /**\n * `true` if the default behavior will act.\n * @deprecated Use the `defaultPrevented` proeprty instead.\n * @see https://dom.spec.whatwg.org/#dom-event-returnvalue\n */\n get returnValue() {\n return !$(this).canceledFlag;\n }\n /**\n * Cancel the default behavior if `false` is set.\n * @deprecated Use the `preventDefault()` method instead.\n * @see https://dom.spec.whatwg.org/#dom-event-returnvalue\n */\n set returnValue(value) {\n if (!value) {\n setCancelFlag($(this));\n } else {\n TruthyWasAssignedToReturnValue.warn();\n }\n }\n /**\n * Cancel the default behavior.\n * @see https://dom.spec.whatwg.org/#dom-event-preventdefault\n */\n preventDefault() {\n setCancelFlag($(this));\n }\n /**\n * `true` if the default behavior was canceled.\n * @see https://dom.spec.whatwg.org/#dom-event-defaultprevented\n */\n get defaultPrevented() {\n return $(this).canceledFlag;\n }\n /**\n * @see https://dom.spec.whatwg.org/#dom-event-composed\n */\n get composed() {\n return $(this).composed;\n }\n /**\n * @see https://dom.spec.whatwg.org/#dom-event-istrusted\n */\n //istanbul ignore next\n get isTrusted() {\n return false;\n }\n /**\n * @see https://dom.spec.whatwg.org/#dom-event-timestamp\n */\n get timeStamp() {\n return $(this).timeStamp;\n }\n /**\n * @deprecated Don't use this method. The constructor did initialization.\n */\n initEvent(type, bubbles = false, cancelable = false) {\n const data = $(this);\n if (data.dispatchFlag) {\n InitEventWasCalledWhileDispatching.warn();\n return;\n }\n internalDataMap.set(this, {\n ...data,\n type: String(type),\n bubbles: Boolean(bubbles),\n cancelable: Boolean(cancelable),\n target: null,\n currentTarget: null,\n stopPropagationFlag: false,\n stopImmediatePropagationFlag: false,\n canceledFlag: false\n });\n }\n};\n__name(_Event, \"Event\");\nvar Event = _Event;\nvar NONE = 0;\nvar CAPTURING_PHASE = 1;\nvar AT_TARGET = 2;\nvar BUBBLING_PHASE = 3;\nvar internalDataMap = /* @__PURE__ */ new WeakMap();\nfunction $(event, name = \"this\") {\n const retv = internalDataMap.get(event);\n assertType(retv != null, \"'%s' must be an object that Event constructor created, but got another one: %o\", name, event);\n return retv;\n}\n__name($, \"$\");\nfunction setCancelFlag(data) {\n if (data.inPassiveListenerFlag) {\n CanceledInPassiveListener.warn();\n return;\n }\n if (!data.cancelable) {\n NonCancelableEventWasCanceled.warn();\n return;\n }\n data.canceledFlag = true;\n}\n__name(setCancelFlag, \"setCancelFlag\");\nObject.defineProperty(Event, \"NONE\", { enumerable: true });\nObject.defineProperty(Event, \"CAPTURING_PHASE\", { enumerable: true });\nObject.defineProperty(Event, \"AT_TARGET\", { enumerable: true });\nObject.defineProperty(Event, \"BUBBLING_PHASE\", { enumerable: true });\nvar keys = Object.getOwnPropertyNames(Event.prototype);\nfor (let i = 0; i < keys.length; ++i) {\n if (keys[i] === \"constructor\") {\n continue;\n }\n Object.defineProperty(Event.prototype, keys[i], { enumerable: true });\n}\nif (typeof Global !== \"undefined\" && typeof Global.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, Global.Event.prototype);\n}\nfunction createInvalidStateError(message) {\n var _a;\n if (Global.DOMException) {\n return new Global.DOMException(message, \"InvalidStateError\");\n }\n if (DOMException == null) {\n DOMException = (_a = class extends Error {\n constructor(msg) {\n super(msg);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, _a);\n }\n }\n // eslint-disable-next-line class-methods-use-this\n get code() {\n return 11;\n }\n // eslint-disable-next-line class-methods-use-this\n get name() {\n return \"InvalidStateError\";\n }\n }, __name(_a, \"DOMException\"), _a);\n Object.defineProperties(DOMException.prototype, {\n code: { enumerable: true },\n name: { enumerable: true }\n });\n defineErrorCodeProperties(DOMException);\n defineErrorCodeProperties(DOMException.prototype);\n }\n return new DOMException(message);\n}\n__name(createInvalidStateError, \"createInvalidStateError\");\nvar DOMException;\nvar ErrorCodeMap = {\n INDEX_SIZE_ERR: 1,\n DOMSTRING_SIZE_ERR: 2,\n HIERARCHY_REQUEST_ERR: 3,\n WRONG_DOCUMENT_ERR: 4,\n INVALID_CHARACTER_ERR: 5,\n NO_DATA_ALLOWED_ERR: 6,\n NO_MODIFICATION_ALLOWED_ERR: 7,\n NOT_FOUND_ERR: 8,\n NOT_SUPPORTED_ERR: 9,\n INUSE_ATTRIBUTE_ERR: 10,\n INVALID_STATE_ERR: 11,\n SYNTAX_ERR: 12,\n INVALID_MODIFICATION_ERR: 13,\n NAMESPACE_ERR: 14,\n INVALID_ACCESS_ERR: 15,\n VALIDATION_ERR: 16,\n TYPE_MISMATCH_ERR: 17,\n SECURITY_ERR: 18,\n NETWORK_ERR: 19,\n ABORT_ERR: 20,\n URL_MISMATCH_ERR: 21,\n QUOTA_EXCEEDED_ERR: 22,\n TIMEOUT_ERR: 23,\n INVALID_NODE_TYPE_ERR: 24,\n DATA_CLONE_ERR: 25\n};\nfunction defineErrorCodeProperties(obj) {\n const keys2 = Object.keys(ErrorCodeMap);\n for (let i = 0; i < keys2.length; ++i) {\n const key = keys2[i];\n const value = ErrorCodeMap[key];\n Object.defineProperty(obj, key, {\n get() {\n return value;\n },\n configurable: true,\n enumerable: true\n });\n }\n}\n__name(defineErrorCodeProperties, \"defineErrorCodeProperties\");\nvar _EventWrapper = class _EventWrapper extends Event {\n /**\n * Wrap a given event object to control states.\n * @param event The event-like object to wrap.\n */\n static wrap(event) {\n return new (getWrapperClassOf(event))(event);\n }\n constructor(event) {\n super(event.type, {\n bubbles: event.bubbles,\n cancelable: event.cancelable,\n composed: event.composed\n });\n if (event.cancelBubble) {\n super.stopPropagation();\n }\n if (event.defaultPrevented) {\n super.preventDefault();\n }\n internalDataMap$1.set(this, { original: event });\n const keys2 = Object.keys(event);\n for (let i = 0; i < keys2.length; ++i) {\n const key = keys2[i];\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(event, key));\n }\n }\n }\n stopPropagation() {\n super.stopPropagation();\n const { original } = $$1(this);\n if (\"stopPropagation\" in original) {\n original.stopPropagation();\n }\n }\n get cancelBubble() {\n return super.cancelBubble;\n }\n set cancelBubble(value) {\n super.cancelBubble = value;\n const { original } = $$1(this);\n if (\"cancelBubble\" in original) {\n original.cancelBubble = value;\n }\n }\n stopImmediatePropagation() {\n super.stopImmediatePropagation();\n const { original } = $$1(this);\n if (\"stopImmediatePropagation\" in original) {\n original.stopImmediatePropagation();\n }\n }\n get returnValue() {\n return super.returnValue;\n }\n set returnValue(value) {\n super.returnValue = value;\n const { original } = $$1(this);\n if (\"returnValue\" in original) {\n original.returnValue = value;\n }\n }\n preventDefault() {\n super.preventDefault();\n const { original } = $$1(this);\n if (\"preventDefault\" in original) {\n original.preventDefault();\n }\n }\n get timeStamp() {\n const { original } = $$1(this);\n if (\"timeStamp\" in original) {\n return original.timeStamp;\n }\n return super.timeStamp;\n }\n};\n__name(_EventWrapper, \"EventWrapper\");\nvar EventWrapper = _EventWrapper;\nvar internalDataMap$1 = /* @__PURE__ */ new WeakMap();\nfunction $$1(event) {\n const retv = internalDataMap$1.get(event);\n assertType(retv != null, \"'this' is expected an Event object, but got\", event);\n return retv;\n}\n__name($$1, \"$$1\");\nvar wrapperClassCache = /* @__PURE__ */ new WeakMap();\nwrapperClassCache.set(Object.prototype, EventWrapper);\nif (typeof Global !== \"undefined\" && typeof Global.Event !== \"undefined\") {\n wrapperClassCache.set(Global.Event.prototype, EventWrapper);\n}\nfunction getWrapperClassOf(originalEvent) {\n const prototype = Object.getPrototypeOf(originalEvent);\n if (prototype == null) {\n return EventWrapper;\n }\n let wrapper = wrapperClassCache.get(prototype);\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapperClassOf(prototype), prototype);\n wrapperClassCache.set(prototype, wrapper);\n }\n return wrapper;\n}\n__name(getWrapperClassOf, \"getWrapperClassOf\");\nfunction defineWrapper(BaseEventWrapper, originalPrototype) {\n const _CustomEventWrapper = class _CustomEventWrapper extends BaseEventWrapper {\n };\n __name(_CustomEventWrapper, \"CustomEventWrapper\");\n let CustomEventWrapper = _CustomEventWrapper;\n const keys2 = Object.keys(originalPrototype);\n for (let i = 0; i < keys2.length; ++i) {\n Object.defineProperty(CustomEventWrapper.prototype, keys2[i], defineRedirectDescriptor(originalPrototype, keys2[i]));\n }\n return CustomEventWrapper;\n}\n__name(defineWrapper, \"defineWrapper\");\nfunction defineRedirectDescriptor(obj, key) {\n const d = Object.getOwnPropertyDescriptor(obj, key);\n return {\n get() {\n const original = $$1(this).original;\n const value = original[key];\n if (typeof value === \"function\") {\n return value.bind(original);\n }\n return value;\n },\n set(value) {\n const original = $$1(this).original;\n original[key] = value;\n },\n configurable: d.configurable,\n enumerable: d.enumerable\n };\n}\n__name(defineRedirectDescriptor, \"defineRedirectDescriptor\");\nfunction createListener(callback, capture, passive, once, signal, signalListener) {\n return {\n callback,\n flags: (capture ? 1 : 0) | (passive ? 2 : 0) | (once ? 4 : 0),\n signal,\n signalListener\n };\n}\n__name(createListener, \"createListener\");\nfunction setRemoved(listener) {\n listener.flags |= 8;\n}\n__name(setRemoved, \"setRemoved\");\nfunction isCapture(listener) {\n return (listener.flags & 1) === 1;\n}\n__name(isCapture, \"isCapture\");\nfunction isPassive(listener) {\n return (listener.flags & 2) === 2;\n}\n__name(isPassive, \"isPassive\");\nfunction isOnce(listener) {\n return (listener.flags & 4) === 4;\n}\n__name(isOnce, \"isOnce\");\nfunction isRemoved(listener) {\n return (listener.flags & 8) === 8;\n}\n__name(isRemoved, \"isRemoved\");\nfunction invokeCallback({ callback }, target, event) {\n try {\n if (typeof callback === \"function\") {\n callback.call(target, event);\n } else if (typeof callback.handleEvent === \"function\") {\n callback.handleEvent(event);\n }\n } catch (thrownError) {\n reportError(thrownError);\n }\n}\n__name(invokeCallback, \"invokeCallback\");\nfunction findIndexOfListener({ listeners }, callback, capture) {\n for (let i = 0; i < listeners.length; ++i) {\n if (listeners[i].callback === callback && isCapture(listeners[i]) === capture) {\n return i;\n }\n }\n return -1;\n}\n__name(findIndexOfListener, \"findIndexOfListener\");\nfunction addListener(list, callback, capture, passive, once, signal) {\n let signalListener;\n if (signal) {\n signalListener = removeListener.bind(null, list, callback, capture);\n signal.addEventListener(\"abort\", signalListener);\n }\n const listener = createListener(callback, capture, passive, once, signal, signalListener);\n if (list.cow) {\n list.cow = false;\n list.listeners = [...list.listeners, listener];\n } else {\n list.listeners.push(listener);\n }\n return listener;\n}\n__name(addListener, \"addListener\");\nfunction removeListener(list, callback, capture) {\n const index = findIndexOfListener(list, callback, capture);\n if (index !== -1) {\n return removeListenerAt(list, index);\n }\n return false;\n}\n__name(removeListener, \"removeListener\");\nfunction removeListenerAt(list, index, disableCow = false) {\n const listener = list.listeners[index];\n setRemoved(listener);\n if (listener.signal) {\n listener.signal.removeEventListener(\"abort\", listener.signalListener);\n }\n if (list.cow && !disableCow) {\n list.cow = false;\n list.listeners = list.listeners.filter((_, i) => i !== index);\n return false;\n }\n list.listeners.splice(index, 1);\n return true;\n}\n__name(removeListenerAt, \"removeListenerAt\");\nfunction createListenerListMap() {\n return /* @__PURE__ */ Object.create(null);\n}\n__name(createListenerListMap, \"createListenerListMap\");\nfunction ensureListenerList(listenerMap, type) {\n var _a;\n return (_a = listenerMap[type]) !== null && _a !== void 0 ? _a : listenerMap[type] = {\n attrCallback: void 0,\n attrListener: void 0,\n cow: false,\n listeners: []\n };\n}\n__name(ensureListenerList, \"ensureListenerList\");\nvar _EventTarget = class _EventTarget {\n /**\n * Initialize this instance.\n */\n constructor() {\n internalDataMap$2.set(this, createListenerListMap());\n }\n // Implementation\n addEventListener(type0, callback0, options0) {\n const listenerMap = $$2(this);\n const { callback, capture, once, passive, signal, type } = normalizeAddOptions(type0, callback0, options0);\n if (callback == null || (signal === null || signal === void 0 ? void 0 : signal.aborted)) {\n return;\n }\n const list = ensureListenerList(listenerMap, type);\n const i = findIndexOfListener(list, callback, capture);\n if (i !== -1) {\n warnDuplicate(list.listeners[i], passive, once, signal);\n return;\n }\n addListener(list, callback, capture, passive, once, signal);\n }\n // Implementation\n removeEventListener(type0, callback0, options0) {\n const listenerMap = $$2(this);\n const { callback, capture, type } = normalizeOptions(type0, callback0, options0);\n const list = listenerMap[type];\n if (callback != null && list) {\n removeListener(list, callback, capture);\n }\n }\n // Implementation\n dispatchEvent(e) {\n const list = $$2(this)[String(e.type)];\n if (list == null) {\n return true;\n }\n const event = e instanceof Event ? e : EventWrapper.wrap(e);\n const eventData = $(event, \"event\");\n if (eventData.dispatchFlag) {\n throw createInvalidStateError(\"This event has been in dispatching.\");\n }\n eventData.dispatchFlag = true;\n eventData.target = eventData.currentTarget = this;\n if (!eventData.stopPropagationFlag) {\n const { cow, listeners } = list;\n list.cow = true;\n for (let i = 0; i < listeners.length; ++i) {\n const listener = listeners[i];\n if (isRemoved(listener)) {\n continue;\n }\n if (isOnce(listener) && removeListenerAt(list, i, !cow)) {\n i -= 1;\n }\n eventData.inPassiveListenerFlag = isPassive(listener);\n invokeCallback(listener, this, event);\n eventData.inPassiveListenerFlag = false;\n if (eventData.stopImmediatePropagationFlag) {\n break;\n }\n }\n if (!cow) {\n list.cow = false;\n }\n }\n eventData.target = null;\n eventData.currentTarget = null;\n eventData.stopImmediatePropagationFlag = false;\n eventData.stopPropagationFlag = false;\n eventData.dispatchFlag = false;\n return !eventData.canceledFlag;\n }\n};\n__name(_EventTarget, \"EventTarget\");\nvar EventTarget = _EventTarget;\nvar internalDataMap$2 = /* @__PURE__ */ new WeakMap();\nfunction $$2(target, name = \"this\") {\n const retv = internalDataMap$2.get(target);\n assertType(retv != null, \"'%s' must be an object that EventTarget constructor created, but got another one: %o\", name, target);\n return retv;\n}\n__name($$2, \"$$2\");\nfunction normalizeAddOptions(type, callback, options) {\n var _a;\n assertCallback(callback);\n if (typeof options === \"object\" && options !== null) {\n return {\n type: String(type),\n callback: callback !== null && callback !== void 0 ? callback : void 0,\n capture: Boolean(options.capture),\n passive: Boolean(options.passive),\n once: Boolean(options.once),\n signal: (_a = options.signal) !== null && _a !== void 0 ? _a : void 0\n };\n }\n return {\n type: String(type),\n callback: callback !== null && callback !== void 0 ? callback : void 0,\n capture: Boolean(options),\n passive: false,\n once: false,\n signal: void 0\n };\n}\n__name(normalizeAddOptions, \"normalizeAddOptions\");\nfunction normalizeOptions(type, callback, options) {\n assertCallback(callback);\n if (typeof options === \"object\" && options !== null) {\n return {\n type: String(type),\n callback: callback !== null && callback !== void 0 ? callback : void 0,\n capture: Boolean(options.capture)\n };\n }\n return {\n type: String(type),\n callback: callback !== null && callback !== void 0 ? callback : void 0,\n capture: Boolean(options)\n };\n}\n__name(normalizeOptions, \"normalizeOptions\");\nfunction assertCallback(callback) {\n if (typeof callback === \"function\" || typeof callback === \"object\" && callback !== null && typeof callback.handleEvent === \"function\") {\n return;\n }\n if (callback == null || typeof callback === \"object\") {\n InvalidEventListener.warn(callback);\n return;\n }\n throw new TypeError(format(InvalidEventListener.message, [callback]));\n}\n__name(assertCallback, \"assertCallback\");\nfunction warnDuplicate(listener, passive, once, signal) {\n EventListenerWasDuplicated.warn(isCapture(listener) ? \"capture\" : \"bubble\", listener.callback);\n if (isPassive(listener) !== passive) {\n OptionWasIgnored.warn(\"passive\");\n }\n if (isOnce(listener) !== once) {\n OptionWasIgnored.warn(\"once\");\n }\n if (listener.signal !== signal) {\n OptionWasIgnored.warn(\"signal\");\n }\n}\n__name(warnDuplicate, \"warnDuplicate\");\nvar keys$1 = Object.getOwnPropertyNames(EventTarget.prototype);\nfor (let i = 0; i < keys$1.length; ++i) {\n if (keys$1[i] === \"constructor\") {\n continue;\n }\n Object.defineProperty(EventTarget.prototype, keys$1[i], { enumerable: true });\n}\nif (typeof Global !== \"undefined\" && typeof Global.EventTarget !== \"undefined\") {\n Object.setPrototypeOf(EventTarget.prototype, Global.EventTarget.prototype);\n}\n\n// src/primitives/events.js\nvar _FetchEvent = class _FetchEvent extends Event {\n constructor(request) {\n super(\"fetch\");\n this.request = request;\n this.response = null;\n this.awaiting = /* @__PURE__ */ new Set();\n }\n respondWith(response) {\n this.response = response;\n }\n waitUntil(promise) {\n this.awaiting.add(promise);\n promise.finally(() => this.awaiting.delete(promise));\n }\n};\n__name(_FetchEvent, \"FetchEvent\");\nvar FetchEvent = _FetchEvent;\nvar _PromiseRejectionEvent = class _PromiseRejectionEvent extends Event {\n constructor(type, init) {\n super(type, { cancelable: true });\n this.promise = init.promise;\n this.reason = init.reason;\n }\n};\n__name(_PromiseRejectionEvent, \"PromiseRejectionEvent\");\nvar PromiseRejectionEvent = _PromiseRejectionEvent;\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n Event,\n EventTarget,\n FetchEvent,\n PromiseRejectionEvent\n});\n"
module.exports = "\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/primitives/events.js\nvar events_exports = {};\n__export(events_exports, {\n FetchEvent: () => FetchEvent,\n PromiseRejectionEvent: () => PromiseRejectionEvent\n});\nmodule.exports = __toCommonJS(events_exports);\nvar _FetchEvent = class _FetchEvent extends Event {\n constructor(request) {\n super(\"fetch\");\n this.request = request;\n this.response = null;\n this.awaiting = /* @__PURE__ */ new Set();\n }\n respondWith(response) {\n this.response = response;\n }\n waitUntil(promise) {\n this.awaiting.add(promise);\n promise.finally(() => this.awaiting.delete(promise));\n }\n};\n__name(_FetchEvent, \"FetchEvent\");\nvar FetchEvent = _FetchEvent;\nvar _PromiseRejectionEvent = class _PromiseRejectionEvent extends Event {\n constructor(type, init) {\n super(type, { cancelable: true });\n this.promise = init.promise;\n this.reason = init.reason;\n }\n};\n__name(_PromiseRejectionEvent, \"PromiseRejectionEvent\");\nvar PromiseRejectionEvent = _PromiseRejectionEvent;\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n FetchEvent,\n PromiseRejectionEvent\n});\n"

@@ -39,2 +39,3 @@ "use strict";

var import_crypto = __toESM(require("crypto"));
var import_web = require("stream/web");
function requireWithFakeGlobalScope(params) {

@@ -86,2 +87,4 @@ const getModuleCode = `(function(module,exports,require,globalThis,${Object.keys(

TextEncoder,
TextEncoderStream: import_web.TextEncoderStream,
TextDecoderStream: import_web.TextDecoderStream,
atob: encodingImpl.atob,

@@ -104,4 +107,4 @@ btoa: encodingImpl.btoa

assign(context, {
Event: eventsImpl.Event,
EventTarget: eventsImpl.EventTarget,
Event,
EventTarget,
FetchEvent: eventsImpl.FetchEvent,

@@ -111,24 +114,11 @@ // @ts-expect-error we need to add this to the type definitions maybe

});
const streamsImpl = requireWithFakeGlobalScope({
context,
id: "streams.js",
sourceCode: require("./streams.js.text.js"),
scopedContext: { ...scopedContext }
});
const textEncodingStreamImpl = requireWithFakeGlobalScope({
context,
id: "text-encoding-streams.js",
sourceCode: require("./text-encoding-streams.js.text.js"),
scopedContext: { ...streamsImpl, ...scopedContext }
});
assign(context, {
ReadableStream: streamsImpl.ReadableStream,
ReadableStreamBYOBReader: streamsImpl.ReadableStreamBYOBReader,
ReadableStreamDefaultReader: streamsImpl.ReadableStreamDefaultReader,
TextDecoderStream: textEncodingStreamImpl.TextDecoderStream,
TextEncoderStream: textEncodingStreamImpl.TextEncoderStream,
TransformStream: streamsImpl.TransformStream,
WritableStream: streamsImpl.WritableStream,
WritableStreamDefaultWriter: streamsImpl.WritableStreamDefaultWriter
});
const streamsImpl = {
ReadableStream: import_web.ReadableStream,
ReadableStreamBYOBReader: import_web.ReadableStreamBYOBReader,
ReadableStreamDefaultReader: import_web.ReadableStreamDefaultReader,
TransformStream: import_web.TransformStream,
WritableStream: import_web.WritableStream,
WritableStreamDefaultWriter: import_web.WritableStreamDefaultWriter
};
assign(context, streamsImpl);
const abortControllerImpl = requireWithFakeGlobalScope({

@@ -138,3 +128,3 @@ context,

sourceCode: require("./abort-controller.js.text.js"),
scopedContext: { ...eventsImpl, ...scopedContext }
scopedContext: { ...scopedContext }
});

@@ -164,6 +154,3 @@ assign(context, {

}
const global = {
...streamsImpl,
...scopedContext
};
const global = { ...streamsImpl, ...scopedContext };
const globalGlobal = { ...global, Blob: void 0 };

@@ -202,6 +189,6 @@ Object.setPrototypeOf(globalGlobal, globalThis);

...scopedContext,
...streamsImpl,
...urlImpl,
...abortControllerImpl,
...eventsImpl,
...streamsImpl,
structuredClone: context.structuredClone

@@ -208,0 +195,0 @@ }

@@ -1,1 +0,1 @@

module.exports = "\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar __accessCheck = (obj, member, msg) => {\n if (!member.has(obj))\n throw TypeError(\"Cannot \" + msg);\n};\nvar __privateGet = (obj, member, getter) => {\n __accessCheck(obj, member, \"read from private field\");\n return getter ? getter.call(obj) : member.get(obj);\n};\nvar __privateAdd = (obj, member, value) => {\n if (member.has(obj))\n throw TypeError(\"Cannot add the same private member more than once\");\n member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n};\nvar __privateSet = (obj, member, value, setter) => {\n __accessCheck(obj, member, \"write to private field\");\n setter ? setter.call(obj, value) : member.set(obj, value);\n return value;\n};\nvar __privateMethod = (obj, member, method) => {\n __accessCheck(obj, member, \"access private method\");\n return method;\n};\n\n// src/primitives/url.js\nvar url_exports = {};\n__export(url_exports, {\n URLPattern: () => me\n});\nmodule.exports = __toCommonJS(url_exports);\n\n// ../../node_modules/.pnpm/urlpattern-polyfill@9.0.0/node_modules/urlpattern-polyfill/dist/urlpattern.js\nvar _a;\nvar k = (_a = class {\n type = 3;\n name = \"\";\n prefix = \"\";\n value = \"\";\n suffix = \"\";\n modifier = 3;\n constructor(t, r, n, o, c, l) {\n this.type = t, this.name = r, this.prefix = n, this.value = o, this.suffix = c, this.modifier = l;\n }\n hasCustomName() {\n return this.name !== \"\" && typeof this.name != \"number\";\n }\n}, __name(_a, \"k\"), _a);\nvar Pe = /[$_\\p{ID_Start}]/u;\nvar Se = /[$_\\u200C\\u200D\\p{ID_Continue}]/u;\nvar M = \".*\";\nfunction ke(e, t) {\n return (t ? /^[\\x00-\\xFF]*$/ : /^[\\x00-\\x7F]*$/).test(e);\n}\n__name(ke, \"ke\");\nfunction v(e, t = false) {\n let r = [], n = 0;\n for (; n < e.length; ) {\n let o = e[n], c = /* @__PURE__ */ __name(function(l) {\n if (!t)\n throw new TypeError(l);\n r.push({ type: \"INVALID_CHAR\", index: n, value: e[n++] });\n }, \"c\");\n if (o === \"*\") {\n r.push({ type: \"ASTERISK\", index: n, value: e[n++] });\n continue;\n }\n if (o === \"+\" || o === \"?\") {\n r.push({ type: \"OTHER_MODIFIER\", index: n, value: e[n++] });\n continue;\n }\n if (o === \"\\\\\") {\n r.push({ type: \"ESCAPED_CHAR\", index: n++, value: e[n++] });\n continue;\n }\n if (o === \"{\") {\n r.push({ type: \"OPEN\", index: n, value: e[n++] });\n continue;\n }\n if (o === \"}\") {\n r.push({ type: \"CLOSE\", index: n, value: e[n++] });\n continue;\n }\n if (o === \":\") {\n let l = \"\", s = n + 1;\n for (; s < e.length; ) {\n let i = e.substr(s, 1);\n if (s === n + 1 && Pe.test(i) || s !== n + 1 && Se.test(i)) {\n l += e[s++];\n continue;\n }\n break;\n }\n if (!l) {\n c(`Missing parameter name at ${n}`);\n continue;\n }\n r.push({ type: \"NAME\", index: n, value: l }), n = s;\n continue;\n }\n if (o === \"(\") {\n let l = 1, s = \"\", i = n + 1, a = false;\n if (e[i] === \"?\") {\n c(`Pattern cannot start with \"?\" at ${i}`);\n continue;\n }\n for (; i < e.length; ) {\n if (!ke(e[i], false)) {\n c(`Invalid character '${e[i]}' at ${i}.`), a = true;\n break;\n }\n if (e[i] === \"\\\\\") {\n s += e[i++] + e[i++];\n continue;\n }\n if (e[i] === \")\") {\n if (l--, l === 0) {\n i++;\n break;\n }\n } else if (e[i] === \"(\" && (l++, e[i + 1] !== \"?\")) {\n c(`Capturing groups are not allowed at ${i}`), a = true;\n break;\n }\n s += e[i++];\n }\n if (a)\n continue;\n if (l) {\n c(`Unbalanced pattern at ${n}`);\n continue;\n }\n if (!s) {\n c(`Missing pattern at ${n}`);\n continue;\n }\n r.push({ type: \"REGEX\", index: n, value: s }), n = i;\n continue;\n }\n r.push({ type: \"CHAR\", index: n, value: e[n++] });\n }\n return r.push({ type: \"END\", index: n, value: \"\" }), r;\n}\n__name(v, \"v\");\nfunction D(e, t = {}) {\n let r = v(e);\n t.delimiter ?? (t.delimiter = \"/#?\"), t.prefixes ?? (t.prefixes = \"./\");\n let n = `[^${x(t.delimiter)}]+?`, o = [], c = 0, l = 0, s = \"\", i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ __name((f) => {\n if (l < r.length && r[l].type === f)\n return r[l++].value;\n }, \"a\"), h = /* @__PURE__ */ __name(() => a(\"OTHER_MODIFIER\") ?? a(\"ASTERISK\"), \"h\"), p = /* @__PURE__ */ __name((f) => {\n let u = a(f);\n if (u !== void 0)\n return u;\n let { type: d, index: T } = r[l];\n throw new TypeError(`Unexpected ${d} at ${T}, expected ${f}`);\n }, \"p\"), O = /* @__PURE__ */ __name(() => {\n let f = \"\", u;\n for (; u = a(\"CHAR\") ?? a(\"ESCAPED_CHAR\"); )\n f += u;\n return f;\n }, \"O\"), xe = /* @__PURE__ */ __name((f) => f, \"xe\"), L = t.encodePart || xe, I = \"\", H = /* @__PURE__ */ __name((f) => {\n I += f;\n }, \"H\"), $ = /* @__PURE__ */ __name(() => {\n I.length && (o.push(new k(3, \"\", \"\", L(I), \"\", 3)), I = \"\");\n }, \"$\"), G = /* @__PURE__ */ __name((f, u, d, T, Y) => {\n let g = 3;\n switch (Y) {\n case \"?\":\n g = 1;\n break;\n case \"*\":\n g = 0;\n break;\n case \"+\":\n g = 2;\n break;\n }\n if (!u && !d && g === 3) {\n H(f);\n return;\n }\n if ($(), !u && !d) {\n if (!f)\n return;\n o.push(new k(3, \"\", \"\", L(f), \"\", g));\n return;\n }\n let m;\n d ? d === \"*\" ? m = M : m = d : m = n;\n let R = 2;\n m === n ? (R = 1, m = \"\") : m === M && (R = 0, m = \"\");\n let S;\n if (u ? S = u : d && (S = c++), i.has(S))\n throw new TypeError(`Duplicate name '${S}'.`);\n i.add(S), o.push(new k(R, S, L(f), m, L(T), g));\n }, \"G\");\n for (; l < r.length; ) {\n let f = a(\"CHAR\"), u = a(\"NAME\"), d = a(\"REGEX\");\n if (!u && !d && (d = a(\"ASTERISK\")), u || d) {\n let g = f ?? \"\";\n t.prefixes.indexOf(g) === -1 && (H(g), g = \"\"), $();\n let m = h();\n G(g, u, d, \"\", m);\n continue;\n }\n let T = f ?? a(\"ESCAPED_CHAR\");\n if (T) {\n H(T);\n continue;\n }\n if (a(\"OPEN\")) {\n let g = O(), m = a(\"NAME\"), R = a(\"REGEX\");\n !m && !R && (R = a(\"ASTERISK\"));\n let S = O();\n p(\"CLOSE\");\n let be = h();\n G(g, m, R, S, be);\n continue;\n }\n $(), p(\"END\");\n }\n return o;\n}\n__name(D, \"D\");\nfunction x(e) {\n return e.replace(/([.+*?^${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n__name(x, \"x\");\nfunction X(e) {\n return e && e.ignoreCase ? \"ui\" : \"u\";\n}\n__name(X, \"X\");\nfunction Z(e, t, r) {\n return F(D(e, r), t, r);\n}\n__name(Z, \"Z\");\nfunction y(e) {\n switch (e) {\n case 0:\n return \"*\";\n case 1:\n return \"?\";\n case 2:\n return \"+\";\n case 3:\n return \"\";\n }\n}\n__name(y, \"y\");\nfunction F(e, t, r = {}) {\n r.delimiter ?? (r.delimiter = \"/#?\"), r.prefixes ?? (r.prefixes = \"./\"), r.sensitive ?? (r.sensitive = false), r.strict ?? (r.strict = false), r.end ?? (r.end = true), r.start ?? (r.start = true), r.endsWith = \"\";\n let n = r.start ? \"^\" : \"\";\n for (let s of e) {\n if (s.type === 3) {\n s.modifier === 3 ? n += x(s.value) : n += `(?:${x(s.value)})${y(s.modifier)}`;\n continue;\n }\n t && t.push(s.name);\n let i = `[^${x(r.delimiter)}]+?`, a = s.value;\n if (s.type === 1 ? a = i : s.type === 0 && (a = M), !s.prefix.length && !s.suffix.length) {\n s.modifier === 3 || s.modifier === 1 ? n += `(${a})${y(s.modifier)}` : n += `((?:${a})${y(s.modifier)})`;\n continue;\n }\n if (s.modifier === 3 || s.modifier === 1) {\n n += `(?:${x(s.prefix)}(${a})${x(s.suffix)})`, n += y(s.modifier);\n continue;\n }\n n += `(?:${x(s.prefix)}`, n += `((?:${a})(?:`, n += x(s.suffix), n += x(s.prefix), n += `(?:${a}))*)${x(s.suffix)})`, s.modifier === 0 && (n += \"?\");\n }\n let o = `[${x(r.endsWith)}]|$`, c = `[${x(r.delimiter)}]`;\n if (r.end)\n return r.strict || (n += `${c}?`), r.endsWith.length ? n += `(?=${o})` : n += \"$\", new RegExp(n, X(r));\n r.strict || (n += `(?:${c}(?=${o}))?`);\n let l = false;\n if (e.length) {\n let s = e[e.length - 1];\n s.type === 3 && s.modifier === 3 && (l = r.delimiter.indexOf(s) > -1);\n }\n return l || (n += `(?=${c}|${o})`), new RegExp(n, X(r));\n}\n__name(F, \"F\");\nvar b = { delimiter: \"\", prefixes: \"\", sensitive: true, strict: true };\nvar B = { delimiter: \".\", prefixes: \"\", sensitive: true, strict: true };\nvar q = { delimiter: \"/\", prefixes: \"/\", sensitive: true, strict: true };\nfunction J(e, t) {\n return e.length ? e[0] === \"/\" ? true : !t || e.length < 2 ? false : (e[0] == \"\\\\\" || e[0] == \"{\") && e[1] == \"/\" : false;\n}\n__name(J, \"J\");\nfunction Q(e, t) {\n return e.startsWith(t) ? e.substring(t.length, e.length) : e;\n}\n__name(Q, \"Q\");\nfunction Ee(e, t) {\n return e.endsWith(t) ? e.substr(0, e.length - t.length) : e;\n}\n__name(Ee, \"Ee\");\nfunction W(e) {\n return !e || e.length < 2 ? false : e[0] === \"[\" || (e[0] === \"\\\\\" || e[0] === \"{\") && e[1] === \"[\";\n}\n__name(W, \"W\");\nvar ee = [\"ftp\", \"file\", \"http\", \"https\", \"ws\", \"wss\"];\nfunction N(e) {\n if (!e)\n return true;\n for (let t of ee)\n if (e.test(t))\n return true;\n return false;\n}\n__name(N, \"N\");\nfunction te(e, t) {\n if (e = Q(e, \"#\"), t || e === \"\")\n return e;\n let r = new URL(\"https://example.com\");\n return r.hash = e, r.hash ? r.hash.substring(1, r.hash.length) : \"\";\n}\n__name(te, \"te\");\nfunction re(e, t) {\n if (e = Q(e, \"?\"), t || e === \"\")\n return e;\n let r = new URL(\"https://example.com\");\n return r.search = e, r.search ? r.search.substring(1, r.search.length) : \"\";\n}\n__name(re, \"re\");\nfunction ne(e, t) {\n return t || e === \"\" ? e : W(e) ? j(e) : z(e);\n}\n__name(ne, \"ne\");\nfunction se(e, t) {\n if (t || e === \"\")\n return e;\n let r = new URL(\"https://example.com\");\n return r.password = e, r.password;\n}\n__name(se, \"se\");\nfunction ie(e, t) {\n if (t || e === \"\")\n return e;\n let r = new URL(\"https://example.com\");\n return r.username = e, r.username;\n}\n__name(ie, \"ie\");\nfunction ae(e, t, r) {\n if (r || e === \"\")\n return e;\n if (t && !ee.includes(t))\n return new URL(`${t}:${e}`).pathname;\n let n = e[0] == \"/\";\n return e = new URL(n ? e : \"/-\" + e, \"https://example.com\").pathname, n || (e = e.substring(2, e.length)), e;\n}\n__name(ae, \"ae\");\nfunction oe(e, t, r) {\n return _(t) === e && (e = \"\"), r || e === \"\" ? e : K(e);\n}\n__name(oe, \"oe\");\nfunction ce(e, t) {\n return e = Ee(e, \":\"), t || e === \"\" ? e : A(e);\n}\n__name(ce, \"ce\");\nfunction _(e) {\n switch (e) {\n case \"ws\":\n case \"http\":\n return \"80\";\n case \"wws\":\n case \"https\":\n return \"443\";\n case \"ftp\":\n return \"21\";\n default:\n return \"\";\n }\n}\n__name(_, \"_\");\nfunction A(e) {\n if (e === \"\")\n return e;\n if (/^[-+.A-Za-z0-9]*$/.test(e))\n return e.toLowerCase();\n throw new TypeError(`Invalid protocol '${e}'.`);\n}\n__name(A, \"A\");\nfunction le(e) {\n if (e === \"\")\n return e;\n let t = new URL(\"https://example.com\");\n return t.username = e, t.username;\n}\n__name(le, \"le\");\nfunction he(e) {\n if (e === \"\")\n return e;\n let t = new URL(\"https://example.com\");\n return t.password = e, t.password;\n}\n__name(he, \"he\");\nfunction z(e) {\n if (e === \"\")\n return e;\n if (/[\\t\\n\\r #%/:<>?@[\\]^\\\\|]/g.test(e))\n throw new TypeError(`Invalid hostname '${e}'`);\n let t = new URL(\"https://example.com\");\n return t.hostname = e, t.hostname;\n}\n__name(z, \"z\");\nfunction j(e) {\n if (e === \"\")\n return e;\n if (/[^0-9a-fA-F[\\]:]/g.test(e))\n throw new TypeError(`Invalid IPv6 hostname '${e}'`);\n return e.toLowerCase();\n}\n__name(j, \"j\");\nfunction K(e) {\n if (e === \"\" || /^[0-9]*$/.test(e) && parseInt(e) <= 65535)\n return e;\n throw new TypeError(`Invalid port '${e}'.`);\n}\n__name(K, \"K\");\nfunction fe(e) {\n if (e === \"\")\n return e;\n let t = new URL(\"https://example.com\");\n return t.pathname = e[0] !== \"/\" ? \"/-\" + e : e, e[0] !== \"/\" ? t.pathname.substring(2, t.pathname.length) : t.pathname;\n}\n__name(fe, \"fe\");\nfunction ue(e) {\n return e === \"\" ? e : new URL(`data:${e}`).pathname;\n}\n__name(ue, \"ue\");\nfunction pe(e) {\n if (e === \"\")\n return e;\n let t = new URL(\"https://example.com\");\n return t.search = e, t.search.substring(1, t.search.length);\n}\n__name(pe, \"pe\");\nfunction de(e) {\n if (e === \"\")\n return e;\n let t = new URL(\"https://example.com\");\n return t.hash = e, t.hash.substring(1, t.hash.length);\n}\n__name(de, \"de\");\nvar _i, _n, _t, _e, _s, _u, _c, _p, _d, _g, _r, r_fn, _k, k_fn, _P, P_fn, _f, f_fn, _m, m_fn, _a2, a_fn, _S, S_fn, _E, E_fn, _x, x_fn, _R, R_fn, _y, y_fn, _b, b_fn, _h, h_fn, _l, l_fn, _O, O_fn, _T, T_fn, _A, A_fn, _w, w_fn, _o, o_fn, _C, C_fn, _a3;\nvar U = (_a3 = class {\n constructor(t) {\n __privateAdd(this, _r);\n __privateAdd(this, _k);\n __privateAdd(this, _P);\n __privateAdd(this, _f);\n __privateAdd(this, _m);\n __privateAdd(this, _a2);\n __privateAdd(this, _S);\n __privateAdd(this, _E);\n __privateAdd(this, _x);\n __privateAdd(this, _R);\n __privateAdd(this, _y);\n __privateAdd(this, _b);\n __privateAdd(this, _h);\n __privateAdd(this, _l);\n __privateAdd(this, _O);\n __privateAdd(this, _T);\n __privateAdd(this, _A);\n __privateAdd(this, _w);\n __privateAdd(this, _o);\n __privateAdd(this, _C);\n __privateAdd(this, _i, void 0);\n __privateAdd(this, _n, []);\n __privateAdd(this, _t, {});\n __privateAdd(this, _e, 0);\n __privateAdd(this, _s, 1);\n __privateAdd(this, _u, 0);\n __privateAdd(this, _c, 0);\n __privateAdd(this, _p, 0);\n __privateAdd(this, _d, 0);\n __privateAdd(this, _g, false);\n __privateSet(this, _i, t);\n }\n get result() {\n return __privateGet(this, _t);\n }\n parse() {\n for (__privateSet(this, _n, v(__privateGet(this, _i), true)); __privateGet(this, _e) < __privateGet(this, _n).length; __privateSet(this, _e, __privateGet(this, _e) + __privateGet(this, _s))) {\n if (__privateSet(this, _s, 1), __privateGet(this, _n)[__privateGet(this, _e)].type === \"END\") {\n if (__privateGet(this, _c) === 0) {\n __privateMethod(this, _P, P_fn).call(this), __privateMethod(this, _l, l_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 9, 1) : __privateMethod(this, _h, h_fn).call(this) ? (__privateMethod(this, _r, r_fn).call(this, 8, 1), __privateGet(this, _t).hash = \"\") : (__privateMethod(this, _r, r_fn).call(this, 7, 0), __privateGet(this, _t).search = \"\", __privateGet(this, _t).hash = \"\");\n continue;\n } else if (__privateGet(this, _c) === 2) {\n __privateMethod(this, _f, f_fn).call(this, 5);\n continue;\n }\n __privateMethod(this, _r, r_fn).call(this, 10, 0);\n break;\n }\n if (__privateGet(this, _p) > 0)\n if (__privateMethod(this, _T, T_fn).call(this))\n __privateSet(this, _p, __privateGet(this, _p) - 1);\n else\n continue;\n if (__privateMethod(this, _O, O_fn).call(this)) {\n __privateSet(this, _p, __privateGet(this, _p) + 1);\n continue;\n }\n switch (__privateGet(this, _c)) {\n case 0:\n __privateMethod(this, _S, S_fn).call(this) && (__privateGet(this, _t).username = \"\", __privateGet(this, _t).password = \"\", __privateGet(this, _t).hostname = \"\", __privateGet(this, _t).port = \"\", __privateGet(this, _t).pathname = \"\", __privateGet(this, _t).search = \"\", __privateGet(this, _t).hash = \"\", __privateMethod(this, _f, f_fn).call(this, 1));\n break;\n case 1:\n if (__privateMethod(this, _S, S_fn).call(this)) {\n __privateMethod(this, _C, C_fn).call(this);\n let t = 7, r = 1;\n __privateGet(this, _g) && (__privateGet(this, _t).pathname = \"/\"), __privateMethod(this, _E, E_fn).call(this) ? (t = 2, r = 3) : __privateGet(this, _g) && (t = 2), __privateMethod(this, _r, r_fn).call(this, t, r);\n }\n break;\n case 2:\n __privateMethod(this, _x, x_fn).call(this) ? __privateMethod(this, _f, f_fn).call(this, 3) : (__privateMethod(this, _b, b_fn).call(this) || __privateMethod(this, _h, h_fn).call(this) || __privateMethod(this, _l, l_fn).call(this)) && __privateMethod(this, _f, f_fn).call(this, 5);\n break;\n case 3:\n __privateMethod(this, _R, R_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 4, 1) : __privateMethod(this, _x, x_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 5, 1);\n break;\n case 4:\n __privateMethod(this, _x, x_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 5, 1);\n break;\n case 5:\n __privateMethod(this, _A, A_fn).call(this) ? __privateSet(this, _d, __privateGet(this, _d) + 1) : __privateMethod(this, _w, w_fn).call(this) && __privateSet(this, _d, __privateGet(this, _d) - 1), __privateMethod(this, _y, y_fn).call(this) && !__privateGet(this, _d) ? __privateMethod(this, _r, r_fn).call(this, 6, 1) : __privateMethod(this, _b, b_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 7, 0) : __privateMethod(this, _h, h_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 8, 1) : __privateMethod(this, _l, l_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n break;\n case 6:\n __privateMethod(this, _b, b_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 7, 0) : __privateMethod(this, _h, h_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 8, 1) : __privateMethod(this, _l, l_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n break;\n case 7:\n __privateMethod(this, _h, h_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 8, 1) : __privateMethod(this, _l, l_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n break;\n case 8:\n __privateMethod(this, _l, l_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n break;\n case 9:\n break;\n case 10:\n break;\n }\n }\n }\n}, _i = new WeakMap(), _n = new WeakMap(), _t = new WeakMap(), _e = new WeakMap(), _s = new WeakMap(), _u = new WeakMap(), _c = new WeakMap(), _p = new WeakMap(), _d = new WeakMap(), _g = new WeakMap(), _r = new WeakSet(), r_fn = /* @__PURE__ */ __name(function(t, r) {\n switch (__privateGet(this, _c)) {\n case 0:\n break;\n case 1:\n __privateGet(this, _t).protocol = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 2:\n break;\n case 3:\n __privateGet(this, _t).username = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 4:\n __privateGet(this, _t).password = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 5:\n __privateGet(this, _t).hostname = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 6:\n __privateGet(this, _t).port = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 7:\n __privateGet(this, _t).pathname = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 8:\n __privateGet(this, _t).search = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 9:\n __privateGet(this, _t).hash = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 10:\n break;\n }\n __privateMethod(this, _k, k_fn).call(this, t, r);\n}, \"#r\"), _k = new WeakSet(), k_fn = /* @__PURE__ */ __name(function(t, r) {\n __privateSet(this, _c, t), __privateSet(this, _u, __privateGet(this, _e) + r), __privateSet(this, _e, __privateGet(this, _e) + r), __privateSet(this, _s, 0);\n}, \"#k\"), _P = new WeakSet(), P_fn = /* @__PURE__ */ __name(function() {\n __privateSet(this, _e, __privateGet(this, _u)), __privateSet(this, _s, 0);\n}, \"#P\"), _f = new WeakSet(), f_fn = /* @__PURE__ */ __name(function(t) {\n __privateMethod(this, _P, P_fn).call(this), __privateSet(this, _c, t);\n}, \"#f\"), _m = new WeakSet(), m_fn = /* @__PURE__ */ __name(function(t) {\n return t < 0 && (t = __privateGet(this, _n).length - t), t < __privateGet(this, _n).length ? __privateGet(this, _n)[t] : __privateGet(this, _n)[__privateGet(this, _n).length - 1];\n}, \"#m\"), _a2 = new WeakSet(), a_fn = /* @__PURE__ */ __name(function(t, r) {\n let n = __privateMethod(this, _m, m_fn).call(this, t);\n return n.value === r && (n.type === \"CHAR\" || n.type === \"ESCAPED_CHAR\" || n.type === \"INVALID_CHAR\");\n}, \"#a\"), _S = new WeakSet(), S_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \":\");\n}, \"#S\"), _E = new WeakSet(), E_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e) + 1, \"/\") && __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e) + 2, \"/\");\n}, \"#E\"), _x = new WeakSet(), x_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"@\");\n}, \"#x\"), _R = new WeakSet(), R_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \":\");\n}, \"#R\"), _y = new WeakSet(), y_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \":\");\n}, \"#y\"), _b = new WeakSet(), b_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"/\");\n}, \"#b\"), _h = new WeakSet(), h_fn = /* @__PURE__ */ __name(function() {\n if (__privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"?\"))\n return true;\n if (__privateGet(this, _n)[__privateGet(this, _e)].value !== \"?\")\n return false;\n let t = __privateMethod(this, _m, m_fn).call(this, __privateGet(this, _e) - 1);\n return t.type !== \"NAME\" && t.type !== \"REGEX\" && t.type !== \"CLOSE\" && t.type !== \"ASTERISK\";\n}, \"#h\"), _l = new WeakSet(), l_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"#\");\n}, \"#l\"), _O = new WeakSet(), O_fn = /* @__PURE__ */ __name(function() {\n return __privateGet(this, _n)[__privateGet(this, _e)].type == \"OPEN\";\n}, \"#O\"), _T = new WeakSet(), T_fn = /* @__PURE__ */ __name(function() {\n return __privateGet(this, _n)[__privateGet(this, _e)].type == \"CLOSE\";\n}, \"#T\"), _A = new WeakSet(), A_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"[\");\n}, \"#A\"), _w = new WeakSet(), w_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"]\");\n}, \"#w\"), _o = new WeakSet(), o_fn = /* @__PURE__ */ __name(function() {\n let t = __privateGet(this, _n)[__privateGet(this, _e)], r = __privateMethod(this, _m, m_fn).call(this, __privateGet(this, _u)).index;\n return __privateGet(this, _i).substring(r, t.index);\n}, \"#o\"), _C = new WeakSet(), C_fn = /* @__PURE__ */ __name(function() {\n let t = {};\n Object.assign(t, b), t.encodePart = A;\n let r = Z(__privateMethod(this, _o, o_fn).call(this), void 0, t);\n __privateSet(this, _g, N(r));\n}, \"#C\"), __name(_a3, \"U\"), _a3);\nvar V = [\"protocol\", \"username\", \"password\", \"hostname\", \"port\", \"pathname\", \"search\", \"hash\"];\nvar E = \"*\";\nfunction ge(e, t) {\n if (typeof e != \"string\")\n throw new TypeError(\"parameter 1 is not of type 'string'.\");\n let r = new URL(e, t);\n return { protocol: r.protocol.substring(0, r.protocol.length - 1), username: r.username, password: r.password, hostname: r.hostname, port: r.port, pathname: r.pathname, search: r.search !== \"\" ? r.search.substring(1, r.search.length) : void 0, hash: r.hash !== \"\" ? r.hash.substring(1, r.hash.length) : void 0 };\n}\n__name(ge, \"ge\");\nfunction P(e, t) {\n return t ? C(e) : e;\n}\n__name(P, \"P\");\nfunction w(e, t, r) {\n let n;\n if (typeof t.baseURL == \"string\")\n try {\n n = new URL(t.baseURL), e.protocol = P(n.protocol.substring(0, n.protocol.length - 1), r), e.username = P(n.username, r), e.password = P(n.password, r), e.hostname = P(n.hostname, r), e.port = P(n.port, r), e.pathname = P(n.pathname, r), e.search = P(n.search.substring(1, n.search.length), r), e.hash = P(n.hash.substring(1, n.hash.length), r);\n } catch {\n throw new TypeError(`invalid baseURL '${t.baseURL}'.`);\n }\n if (typeof t.protocol == \"string\" && (e.protocol = ce(t.protocol, r)), typeof t.username == \"string\" && (e.username = ie(t.username, r)), typeof t.password == \"string\" && (e.password = se(t.password, r)), typeof t.hostname == \"string\" && (e.hostname = ne(t.hostname, r)), typeof t.port == \"string\" && (e.port = oe(t.port, e.protocol, r)), typeof t.pathname == \"string\") {\n if (e.pathname = t.pathname, n && !J(e.pathname, r)) {\n let o = n.pathname.lastIndexOf(\"/\");\n o >= 0 && (e.pathname = P(n.pathname.substring(0, o + 1), r) + e.pathname);\n }\n e.pathname = ae(e.pathname, e.protocol, r);\n }\n return typeof t.search == \"string\" && (e.search = re(t.search, r)), typeof t.hash == \"string\" && (e.hash = te(t.hash, r)), e;\n}\n__name(w, \"w\");\nfunction C(e) {\n return e.replace(/([+*?:{}()\\\\])/g, \"\\\\$1\");\n}\n__name(C, \"C\");\nfunction Re(e) {\n return e.replace(/([.+*?^${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n__name(Re, \"Re\");\nfunction ye(e, t) {\n t.delimiter ?? (t.delimiter = \"/#?\"), t.prefixes ?? (t.prefixes = \"./\"), t.sensitive ?? (t.sensitive = false), t.strict ?? (t.strict = false), t.end ?? (t.end = true), t.start ?? (t.start = true), t.endsWith = \"\";\n let r = \".*\", n = `[^${Re(t.delimiter)}]+?`, o = /[$_\\u200C\\u200D\\p{ID_Continue}]/u, c = \"\";\n for (let l = 0; l < e.length; ++l) {\n let s = e[l];\n if (s.type === 3) {\n if (s.modifier === 3) {\n c += C(s.value);\n continue;\n }\n c += `{${C(s.value)}}${y(s.modifier)}`;\n continue;\n }\n let i = s.hasCustomName(), a = !!s.suffix.length || !!s.prefix.length && (s.prefix.length !== 1 || !t.prefixes.includes(s.prefix)), h = l > 0 ? e[l - 1] : null, p = l < e.length - 1 ? e[l + 1] : null;\n if (!a && i && s.type === 1 && s.modifier === 3 && p && !p.prefix.length && !p.suffix.length)\n if (p.type === 3) {\n let O = p.value.length > 0 ? p.value[0] : \"\";\n a = o.test(O);\n } else\n a = !p.hasCustomName();\n if (!a && !s.prefix.length && h && h.type === 3) {\n let O = h.value[h.value.length - 1];\n a = t.prefixes.includes(O);\n }\n a && (c += \"{\"), c += C(s.prefix), i && (c += `:${s.name}`), s.type === 2 ? c += `(${s.value})` : s.type === 1 ? i || (c += `(${n})`) : s.type === 0 && (!i && (!h || h.type === 3 || h.modifier !== 3 || a || s.prefix !== \"\") ? c += \"*\" : c += `(${r})`), s.type === 1 && i && s.suffix.length && o.test(s.suffix[0]) && (c += \"\\\\\"), c += C(s.suffix), a && (c += \"}\"), s.modifier !== 3 && (c += y(s.modifier));\n }\n return c;\n}\n__name(ye, \"ye\");\nvar _i2, _n2, _t2, _e2, _s2, _a4;\nvar me = (_a4 = class {\n constructor(t = {}, r, n) {\n __privateAdd(this, _i2, void 0);\n __privateAdd(this, _n2, {});\n __privateAdd(this, _t2, {});\n __privateAdd(this, _e2, {});\n __privateAdd(this, _s2, {});\n try {\n let o;\n if (typeof r == \"string\" ? o = r : n = r, typeof t == \"string\") {\n let i = new U(t);\n if (i.parse(), t = i.result, o === void 0 && typeof t.protocol != \"string\")\n throw new TypeError(\"A base URL must be provided for a relative constructor string.\");\n t.baseURL = o;\n } else {\n if (!t || typeof t != \"object\")\n throw new TypeError(\"parameter 1 is not of type 'string' and cannot convert to dictionary.\");\n if (o)\n throw new TypeError(\"parameter 1 is not of type 'string'.\");\n }\n typeof n > \"u\" && (n = { ignoreCase: false });\n let c = { ignoreCase: n.ignoreCase === true }, l = { pathname: E, protocol: E, username: E, password: E, hostname: E, port: E, search: E, hash: E };\n __privateSet(this, _i2, w(l, t, true)), _(__privateGet(this, _i2).protocol) === __privateGet(this, _i2).port && (__privateGet(this, _i2).port = \"\");\n let s;\n for (s of V) {\n if (!(s in __privateGet(this, _i2)))\n continue;\n let i = {}, a = __privateGet(this, _i2)[s];\n switch (__privateGet(this, _t2)[s] = [], s) {\n case \"protocol\":\n Object.assign(i, b), i.encodePart = A;\n break;\n case \"username\":\n Object.assign(i, b), i.encodePart = le;\n break;\n case \"password\":\n Object.assign(i, b), i.encodePart = he;\n break;\n case \"hostname\":\n Object.assign(i, B), W(a) ? i.encodePart = j : i.encodePart = z;\n break;\n case \"port\":\n Object.assign(i, b), i.encodePart = K;\n break;\n case \"pathname\":\n N(__privateGet(this, _n2).protocol) ? (Object.assign(i, q, c), i.encodePart = fe) : (Object.assign(i, b, c), i.encodePart = ue);\n break;\n case \"search\":\n Object.assign(i, b, c), i.encodePart = pe;\n break;\n case \"hash\":\n Object.assign(i, b, c), i.encodePart = de;\n break;\n }\n try {\n __privateGet(this, _s2)[s] = D(a, i), __privateGet(this, _n2)[s] = F(__privateGet(this, _s2)[s], __privateGet(this, _t2)[s], i), __privateGet(this, _e2)[s] = ye(__privateGet(this, _s2)[s], i);\n } catch {\n throw new TypeError(`invalid ${s} pattern '${__privateGet(this, _i2)[s]}'.`);\n }\n }\n } catch (o) {\n throw new TypeError(`Failed to construct 'URLPattern': ${o.message}`);\n }\n }\n test(t = {}, r) {\n let n = { pathname: \"\", protocol: \"\", username: \"\", password: \"\", hostname: \"\", port: \"\", search: \"\", hash: \"\" };\n if (typeof t != \"string\" && r)\n throw new TypeError(\"parameter 1 is not of type 'string'.\");\n if (typeof t > \"u\")\n return false;\n try {\n typeof t == \"object\" ? n = w(n, t, false) : n = w(n, ge(t, r), false);\n } catch {\n return false;\n }\n let o;\n for (o of V)\n if (!__privateGet(this, _n2)[o].exec(n[o]))\n return false;\n return true;\n }\n exec(t = {}, r) {\n let n = { pathname: \"\", protocol: \"\", username: \"\", password: \"\", hostname: \"\", port: \"\", search: \"\", hash: \"\" };\n if (typeof t != \"string\" && r)\n throw new TypeError(\"parameter 1 is not of type 'string'.\");\n if (typeof t > \"u\")\n return;\n try {\n typeof t == \"object\" ? n = w(n, t, false) : n = w(n, ge(t, r), false);\n } catch {\n return null;\n }\n let o = {};\n r ? o.inputs = [t, r] : o.inputs = [t];\n let c;\n for (c of V) {\n let l = __privateGet(this, _n2)[c].exec(n[c]);\n if (!l)\n return null;\n let s = {};\n for (let [i, a] of __privateGet(this, _t2)[c].entries())\n if (typeof a == \"string\" || typeof a == \"number\") {\n let h = l[i + 1];\n s[a] = h;\n }\n o[c] = { input: n[c] ?? \"\", groups: s };\n }\n return o;\n }\n static compareComponent(t, r, n) {\n let o = /* @__PURE__ */ __name((i, a) => {\n for (let h of [\"type\", \"modifier\", \"prefix\", \"value\", \"suffix\"]) {\n if (i[h] < a[h])\n return -1;\n if (i[h] === a[h])\n continue;\n return 1;\n }\n return 0;\n }, \"o\"), c = new k(3, \"\", \"\", \"\", \"\", 3), l = new k(0, \"\", \"\", \"\", \"\", 3), s = /* @__PURE__ */ __name((i, a) => {\n let h = 0;\n for (; h < Math.min(i.length, a.length); ++h) {\n let p = o(i[h], a[h]);\n if (p)\n return p;\n }\n return i.length === a.length ? 0 : o(i[h] ?? c, a[h] ?? c);\n }, \"s\");\n return !__privateGet(r, _e2)[t] && !__privateGet(n, _e2)[t] ? 0 : __privateGet(r, _e2)[t] && !__privateGet(n, _e2)[t] ? s(__privateGet(r, _s2)[t], [l]) : !__privateGet(r, _e2)[t] && __privateGet(n, _e2)[t] ? s([l], __privateGet(n, _s2)[t]) : s(__privateGet(r, _s2)[t], __privateGet(n, _s2)[t]);\n }\n get protocol() {\n return __privateGet(this, _e2).protocol;\n }\n get username() {\n return __privateGet(this, _e2).username;\n }\n get password() {\n return __privateGet(this, _e2).password;\n }\n get hostname() {\n return __privateGet(this, _e2).hostname;\n }\n get port() {\n return __privateGet(this, _e2).port;\n }\n get pathname() {\n return __privateGet(this, _e2).pathname;\n }\n get search() {\n return __privateGet(this, _e2).search;\n }\n get hash() {\n return __privateGet(this, _e2).hash;\n }\n}, _i2 = new WeakMap(), _n2 = new WeakMap(), _t2 = new WeakMap(), _e2 = new WeakMap(), _s2 = new WeakMap(), __name(_a4, \"me\"), _a4);\n\n// ../../node_modules/.pnpm/urlpattern-polyfill@9.0.0/node_modules/urlpattern-polyfill/index.js\nif (!globalThis.URLPattern) {\n globalThis.URLPattern = me;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n URLPattern\n});\n"
module.exports = "\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar __accessCheck = (obj, member, msg) => {\n if (!member.has(obj))\n throw TypeError(\"Cannot \" + msg);\n};\nvar __privateGet = (obj, member, getter) => {\n __accessCheck(obj, member, \"read from private field\");\n return getter ? getter.call(obj) : member.get(obj);\n};\nvar __privateAdd = (obj, member, value) => {\n if (member.has(obj))\n throw TypeError(\"Cannot add the same private member more than once\");\n member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n};\nvar __privateSet = (obj, member, value, setter) => {\n __accessCheck(obj, member, \"write to private field\");\n setter ? setter.call(obj, value) : member.set(obj, value);\n return value;\n};\nvar __privateMethod = (obj, member, method) => {\n __accessCheck(obj, member, \"access private method\");\n return method;\n};\n\n// src/primitives/url.js\nvar url_exports = {};\n__export(url_exports, {\n URLPattern: () => me\n});\nmodule.exports = __toCommonJS(url_exports);\n\n// ../../node_modules/.pnpm/urlpattern-polyfill@9.0.0/node_modules/urlpattern-polyfill/dist/urlpattern.js\nvar _a;\nvar k = (_a = class {\n type = 3;\n name = \"\";\n prefix = \"\";\n value = \"\";\n suffix = \"\";\n modifier = 3;\n constructor(t, r, n, o, c, l) {\n this.type = t, this.name = r, this.prefix = n, this.value = o, this.suffix = c, this.modifier = l;\n }\n hasCustomName() {\n return this.name !== \"\" && typeof this.name != \"number\";\n }\n}, __name(_a, \"k\"), _a);\nvar Pe = /[$_\\p{ID_Start}]/u;\nvar Se = /[$_\\u200C\\u200D\\p{ID_Continue}]/u;\nvar M = \".*\";\nfunction ke(e, t) {\n return (t ? /^[\\x00-\\xFF]*$/ : /^[\\x00-\\x7F]*$/).test(e);\n}\n__name(ke, \"ke\");\nfunction v(e, t = false) {\n let r = [], n = 0;\n for (; n < e.length; ) {\n let o = e[n], c = /* @__PURE__ */ __name(function(l) {\n if (!t)\n throw new TypeError(l);\n r.push({ type: \"INVALID_CHAR\", index: n, value: e[n++] });\n }, \"c\");\n if (o === \"*\") {\n r.push({ type: \"ASTERISK\", index: n, value: e[n++] });\n continue;\n }\n if (o === \"+\" || o === \"?\") {\n r.push({ type: \"OTHER_MODIFIER\", index: n, value: e[n++] });\n continue;\n }\n if (o === \"\\\\\") {\n r.push({ type: \"ESCAPED_CHAR\", index: n++, value: e[n++] });\n continue;\n }\n if (o === \"{\") {\n r.push({ type: \"OPEN\", index: n, value: e[n++] });\n continue;\n }\n if (o === \"}\") {\n r.push({ type: \"CLOSE\", index: n, value: e[n++] });\n continue;\n }\n if (o === \":\") {\n let l = \"\", s = n + 1;\n for (; s < e.length; ) {\n let i = e.substr(s, 1);\n if (s === n + 1 && Pe.test(i) || s !== n + 1 && Se.test(i)) {\n l += e[s++];\n continue;\n }\n break;\n }\n if (!l) {\n c(`Missing parameter name at ${n}`);\n continue;\n }\n r.push({ type: \"NAME\", index: n, value: l }), n = s;\n continue;\n }\n if (o === \"(\") {\n let l = 1, s = \"\", i = n + 1, a = false;\n if (e[i] === \"?\") {\n c(`Pattern cannot start with \"?\" at ${i}`);\n continue;\n }\n for (; i < e.length; ) {\n if (!ke(e[i], false)) {\n c(`Invalid character '${e[i]}' at ${i}.`), a = true;\n break;\n }\n if (e[i] === \"\\\\\") {\n s += e[i++] + e[i++];\n continue;\n }\n if (e[i] === \")\") {\n if (l--, l === 0) {\n i++;\n break;\n }\n } else if (e[i] === \"(\" && (l++, e[i + 1] !== \"?\")) {\n c(`Capturing groups are not allowed at ${i}`), a = true;\n break;\n }\n s += e[i++];\n }\n if (a)\n continue;\n if (l) {\n c(`Unbalanced pattern at ${n}`);\n continue;\n }\n if (!s) {\n c(`Missing pattern at ${n}`);\n continue;\n }\n r.push({ type: \"REGEX\", index: n, value: s }), n = i;\n continue;\n }\n r.push({ type: \"CHAR\", index: n, value: e[n++] });\n }\n return r.push({ type: \"END\", index: n, value: \"\" }), r;\n}\n__name(v, \"v\");\nfunction D(e, t = {}) {\n let r = v(e);\n t.delimiter ??= \"/#?\", t.prefixes ??= \"./\";\n let n = `[^${x(t.delimiter)}]+?`, o = [], c = 0, l = 0, s = \"\", i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ __name((f) => {\n if (l < r.length && r[l].type === f)\n return r[l++].value;\n }, \"a\"), h = /* @__PURE__ */ __name(() => a(\"OTHER_MODIFIER\") ?? a(\"ASTERISK\"), \"h\"), p = /* @__PURE__ */ __name((f) => {\n let u = a(f);\n if (u !== void 0)\n return u;\n let { type: d, index: T } = r[l];\n throw new TypeError(`Unexpected ${d} at ${T}, expected ${f}`);\n }, \"p\"), O = /* @__PURE__ */ __name(() => {\n let f = \"\", u;\n for (; u = a(\"CHAR\") ?? a(\"ESCAPED_CHAR\"); )\n f += u;\n return f;\n }, \"O\"), xe = /* @__PURE__ */ __name((f) => f, \"xe\"), L = t.encodePart || xe, I = \"\", H = /* @__PURE__ */ __name((f) => {\n I += f;\n }, \"H\"), $ = /* @__PURE__ */ __name(() => {\n I.length && (o.push(new k(3, \"\", \"\", L(I), \"\", 3)), I = \"\");\n }, \"$\"), G = /* @__PURE__ */ __name((f, u, d, T, Y) => {\n let g = 3;\n switch (Y) {\n case \"?\":\n g = 1;\n break;\n case \"*\":\n g = 0;\n break;\n case \"+\":\n g = 2;\n break;\n }\n if (!u && !d && g === 3) {\n H(f);\n return;\n }\n if ($(), !u && !d) {\n if (!f)\n return;\n o.push(new k(3, \"\", \"\", L(f), \"\", g));\n return;\n }\n let m;\n d ? d === \"*\" ? m = M : m = d : m = n;\n let R = 2;\n m === n ? (R = 1, m = \"\") : m === M && (R = 0, m = \"\");\n let S;\n if (u ? S = u : d && (S = c++), i.has(S))\n throw new TypeError(`Duplicate name '${S}'.`);\n i.add(S), o.push(new k(R, S, L(f), m, L(T), g));\n }, \"G\");\n for (; l < r.length; ) {\n let f = a(\"CHAR\"), u = a(\"NAME\"), d = a(\"REGEX\");\n if (!u && !d && (d = a(\"ASTERISK\")), u || d) {\n let g = f ?? \"\";\n t.prefixes.indexOf(g) === -1 && (H(g), g = \"\"), $();\n let m = h();\n G(g, u, d, \"\", m);\n continue;\n }\n let T = f ?? a(\"ESCAPED_CHAR\");\n if (T) {\n H(T);\n continue;\n }\n if (a(\"OPEN\")) {\n let g = O(), m = a(\"NAME\"), R = a(\"REGEX\");\n !m && !R && (R = a(\"ASTERISK\"));\n let S = O();\n p(\"CLOSE\");\n let be = h();\n G(g, m, R, S, be);\n continue;\n }\n $(), p(\"END\");\n }\n return o;\n}\n__name(D, \"D\");\nfunction x(e) {\n return e.replace(/([.+*?^${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n__name(x, \"x\");\nfunction X(e) {\n return e && e.ignoreCase ? \"ui\" : \"u\";\n}\n__name(X, \"X\");\nfunction Z(e, t, r) {\n return F(D(e, r), t, r);\n}\n__name(Z, \"Z\");\nfunction y(e) {\n switch (e) {\n case 0:\n return \"*\";\n case 1:\n return \"?\";\n case 2:\n return \"+\";\n case 3:\n return \"\";\n }\n}\n__name(y, \"y\");\nfunction F(e, t, r = {}) {\n r.delimiter ??= \"/#?\", r.prefixes ??= \"./\", r.sensitive ??= false, r.strict ??= false, r.end ??= true, r.start ??= true, r.endsWith = \"\";\n let n = r.start ? \"^\" : \"\";\n for (let s of e) {\n if (s.type === 3) {\n s.modifier === 3 ? n += x(s.value) : n += `(?:${x(s.value)})${y(s.modifier)}`;\n continue;\n }\n t && t.push(s.name);\n let i = `[^${x(r.delimiter)}]+?`, a = s.value;\n if (s.type === 1 ? a = i : s.type === 0 && (a = M), !s.prefix.length && !s.suffix.length) {\n s.modifier === 3 || s.modifier === 1 ? n += `(${a})${y(s.modifier)}` : n += `((?:${a})${y(s.modifier)})`;\n continue;\n }\n if (s.modifier === 3 || s.modifier === 1) {\n n += `(?:${x(s.prefix)}(${a})${x(s.suffix)})`, n += y(s.modifier);\n continue;\n }\n n += `(?:${x(s.prefix)}`, n += `((?:${a})(?:`, n += x(s.suffix), n += x(s.prefix), n += `(?:${a}))*)${x(s.suffix)})`, s.modifier === 0 && (n += \"?\");\n }\n let o = `[${x(r.endsWith)}]|$`, c = `[${x(r.delimiter)}]`;\n if (r.end)\n return r.strict || (n += `${c}?`), r.endsWith.length ? n += `(?=${o})` : n += \"$\", new RegExp(n, X(r));\n r.strict || (n += `(?:${c}(?=${o}))?`);\n let l = false;\n if (e.length) {\n let s = e[e.length - 1];\n s.type === 3 && s.modifier === 3 && (l = r.delimiter.indexOf(s) > -1);\n }\n return l || (n += `(?=${c}|${o})`), new RegExp(n, X(r));\n}\n__name(F, \"F\");\nvar b = { delimiter: \"\", prefixes: \"\", sensitive: true, strict: true };\nvar B = { delimiter: \".\", prefixes: \"\", sensitive: true, strict: true };\nvar q = { delimiter: \"/\", prefixes: \"/\", sensitive: true, strict: true };\nfunction J(e, t) {\n return e.length ? e[0] === \"/\" ? true : !t || e.length < 2 ? false : (e[0] == \"\\\\\" || e[0] == \"{\") && e[1] == \"/\" : false;\n}\n__name(J, \"J\");\nfunction Q(e, t) {\n return e.startsWith(t) ? e.substring(t.length, e.length) : e;\n}\n__name(Q, \"Q\");\nfunction Ee(e, t) {\n return e.endsWith(t) ? e.substr(0, e.length - t.length) : e;\n}\n__name(Ee, \"Ee\");\nfunction W(e) {\n return !e || e.length < 2 ? false : e[0] === \"[\" || (e[0] === \"\\\\\" || e[0] === \"{\") && e[1] === \"[\";\n}\n__name(W, \"W\");\nvar ee = [\"ftp\", \"file\", \"http\", \"https\", \"ws\", \"wss\"];\nfunction N(e) {\n if (!e)\n return true;\n for (let t of ee)\n if (e.test(t))\n return true;\n return false;\n}\n__name(N, \"N\");\nfunction te(e, t) {\n if (e = Q(e, \"#\"), t || e === \"\")\n return e;\n let r = new URL(\"https://example.com\");\n return r.hash = e, r.hash ? r.hash.substring(1, r.hash.length) : \"\";\n}\n__name(te, \"te\");\nfunction re(e, t) {\n if (e = Q(e, \"?\"), t || e === \"\")\n return e;\n let r = new URL(\"https://example.com\");\n return r.search = e, r.search ? r.search.substring(1, r.search.length) : \"\";\n}\n__name(re, \"re\");\nfunction ne(e, t) {\n return t || e === \"\" ? e : W(e) ? j(e) : z(e);\n}\n__name(ne, \"ne\");\nfunction se(e, t) {\n if (t || e === \"\")\n return e;\n let r = new URL(\"https://example.com\");\n return r.password = e, r.password;\n}\n__name(se, \"se\");\nfunction ie(e, t) {\n if (t || e === \"\")\n return e;\n let r = new URL(\"https://example.com\");\n return r.username = e, r.username;\n}\n__name(ie, \"ie\");\nfunction ae(e, t, r) {\n if (r || e === \"\")\n return e;\n if (t && !ee.includes(t))\n return new URL(`${t}:${e}`).pathname;\n let n = e[0] == \"/\";\n return e = new URL(n ? e : \"/-\" + e, \"https://example.com\").pathname, n || (e = e.substring(2, e.length)), e;\n}\n__name(ae, \"ae\");\nfunction oe(e, t, r) {\n return _(t) === e && (e = \"\"), r || e === \"\" ? e : K(e);\n}\n__name(oe, \"oe\");\nfunction ce(e, t) {\n return e = Ee(e, \":\"), t || e === \"\" ? e : A(e);\n}\n__name(ce, \"ce\");\nfunction _(e) {\n switch (e) {\n case \"ws\":\n case \"http\":\n return \"80\";\n case \"wws\":\n case \"https\":\n return \"443\";\n case \"ftp\":\n return \"21\";\n default:\n return \"\";\n }\n}\n__name(_, \"_\");\nfunction A(e) {\n if (e === \"\")\n return e;\n if (/^[-+.A-Za-z0-9]*$/.test(e))\n return e.toLowerCase();\n throw new TypeError(`Invalid protocol '${e}'.`);\n}\n__name(A, \"A\");\nfunction le(e) {\n if (e === \"\")\n return e;\n let t = new URL(\"https://example.com\");\n return t.username = e, t.username;\n}\n__name(le, \"le\");\nfunction he(e) {\n if (e === \"\")\n return e;\n let t = new URL(\"https://example.com\");\n return t.password = e, t.password;\n}\n__name(he, \"he\");\nfunction z(e) {\n if (e === \"\")\n return e;\n if (/[\\t\\n\\r #%/:<>?@[\\]^\\\\|]/g.test(e))\n throw new TypeError(`Invalid hostname '${e}'`);\n let t = new URL(\"https://example.com\");\n return t.hostname = e, t.hostname;\n}\n__name(z, \"z\");\nfunction j(e) {\n if (e === \"\")\n return e;\n if (/[^0-9a-fA-F[\\]:]/g.test(e))\n throw new TypeError(`Invalid IPv6 hostname '${e}'`);\n return e.toLowerCase();\n}\n__name(j, \"j\");\nfunction K(e) {\n if (e === \"\" || /^[0-9]*$/.test(e) && parseInt(e) <= 65535)\n return e;\n throw new TypeError(`Invalid port '${e}'.`);\n}\n__name(K, \"K\");\nfunction fe(e) {\n if (e === \"\")\n return e;\n let t = new URL(\"https://example.com\");\n return t.pathname = e[0] !== \"/\" ? \"/-\" + e : e, e[0] !== \"/\" ? t.pathname.substring(2, t.pathname.length) : t.pathname;\n}\n__name(fe, \"fe\");\nfunction ue(e) {\n return e === \"\" ? e : new URL(`data:${e}`).pathname;\n}\n__name(ue, \"ue\");\nfunction pe(e) {\n if (e === \"\")\n return e;\n let t = new URL(\"https://example.com\");\n return t.search = e, t.search.substring(1, t.search.length);\n}\n__name(pe, \"pe\");\nfunction de(e) {\n if (e === \"\")\n return e;\n let t = new URL(\"https://example.com\");\n return t.hash = e, t.hash.substring(1, t.hash.length);\n}\n__name(de, \"de\");\nvar _i, _n, _t, _e, _s, _u, _c, _p, _d, _g, _r, r_fn, _k, k_fn, _P, P_fn, _f, f_fn, _m, m_fn, _a2, a_fn, _S, S_fn, _E, E_fn, _x, x_fn, _R, R_fn, _y, y_fn, _b, b_fn, _h, h_fn, _l, l_fn, _O, O_fn, _T, T_fn, _A, A_fn, _w, w_fn, _o, o_fn, _C, C_fn, _a3;\nvar U = (_a3 = class {\n constructor(t) {\n __privateAdd(this, _r);\n __privateAdd(this, _k);\n __privateAdd(this, _P);\n __privateAdd(this, _f);\n __privateAdd(this, _m);\n __privateAdd(this, _a2);\n __privateAdd(this, _S);\n __privateAdd(this, _E);\n __privateAdd(this, _x);\n __privateAdd(this, _R);\n __privateAdd(this, _y);\n __privateAdd(this, _b);\n __privateAdd(this, _h);\n __privateAdd(this, _l);\n __privateAdd(this, _O);\n __privateAdd(this, _T);\n __privateAdd(this, _A);\n __privateAdd(this, _w);\n __privateAdd(this, _o);\n __privateAdd(this, _C);\n __privateAdd(this, _i, void 0);\n __privateAdd(this, _n, []);\n __privateAdd(this, _t, {});\n __privateAdd(this, _e, 0);\n __privateAdd(this, _s, 1);\n __privateAdd(this, _u, 0);\n __privateAdd(this, _c, 0);\n __privateAdd(this, _p, 0);\n __privateAdd(this, _d, 0);\n __privateAdd(this, _g, false);\n __privateSet(this, _i, t);\n }\n get result() {\n return __privateGet(this, _t);\n }\n parse() {\n for (__privateSet(this, _n, v(__privateGet(this, _i), true)); __privateGet(this, _e) < __privateGet(this, _n).length; __privateSet(this, _e, __privateGet(this, _e) + __privateGet(this, _s))) {\n if (__privateSet(this, _s, 1), __privateGet(this, _n)[__privateGet(this, _e)].type === \"END\") {\n if (__privateGet(this, _c) === 0) {\n __privateMethod(this, _P, P_fn).call(this), __privateMethod(this, _l, l_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 9, 1) : __privateMethod(this, _h, h_fn).call(this) ? (__privateMethod(this, _r, r_fn).call(this, 8, 1), __privateGet(this, _t).hash = \"\") : (__privateMethod(this, _r, r_fn).call(this, 7, 0), __privateGet(this, _t).search = \"\", __privateGet(this, _t).hash = \"\");\n continue;\n } else if (__privateGet(this, _c) === 2) {\n __privateMethod(this, _f, f_fn).call(this, 5);\n continue;\n }\n __privateMethod(this, _r, r_fn).call(this, 10, 0);\n break;\n }\n if (__privateGet(this, _p) > 0)\n if (__privateMethod(this, _T, T_fn).call(this))\n __privateSet(this, _p, __privateGet(this, _p) - 1);\n else\n continue;\n if (__privateMethod(this, _O, O_fn).call(this)) {\n __privateSet(this, _p, __privateGet(this, _p) + 1);\n continue;\n }\n switch (__privateGet(this, _c)) {\n case 0:\n __privateMethod(this, _S, S_fn).call(this) && (__privateGet(this, _t).username = \"\", __privateGet(this, _t).password = \"\", __privateGet(this, _t).hostname = \"\", __privateGet(this, _t).port = \"\", __privateGet(this, _t).pathname = \"\", __privateGet(this, _t).search = \"\", __privateGet(this, _t).hash = \"\", __privateMethod(this, _f, f_fn).call(this, 1));\n break;\n case 1:\n if (__privateMethod(this, _S, S_fn).call(this)) {\n __privateMethod(this, _C, C_fn).call(this);\n let t = 7, r = 1;\n __privateGet(this, _g) && (__privateGet(this, _t).pathname = \"/\"), __privateMethod(this, _E, E_fn).call(this) ? (t = 2, r = 3) : __privateGet(this, _g) && (t = 2), __privateMethod(this, _r, r_fn).call(this, t, r);\n }\n break;\n case 2:\n __privateMethod(this, _x, x_fn).call(this) ? __privateMethod(this, _f, f_fn).call(this, 3) : (__privateMethod(this, _b, b_fn).call(this) || __privateMethod(this, _h, h_fn).call(this) || __privateMethod(this, _l, l_fn).call(this)) && __privateMethod(this, _f, f_fn).call(this, 5);\n break;\n case 3:\n __privateMethod(this, _R, R_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 4, 1) : __privateMethod(this, _x, x_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 5, 1);\n break;\n case 4:\n __privateMethod(this, _x, x_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 5, 1);\n break;\n case 5:\n __privateMethod(this, _A, A_fn).call(this) ? __privateSet(this, _d, __privateGet(this, _d) + 1) : __privateMethod(this, _w, w_fn).call(this) && __privateSet(this, _d, __privateGet(this, _d) - 1), __privateMethod(this, _y, y_fn).call(this) && !__privateGet(this, _d) ? __privateMethod(this, _r, r_fn).call(this, 6, 1) : __privateMethod(this, _b, b_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 7, 0) : __privateMethod(this, _h, h_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 8, 1) : __privateMethod(this, _l, l_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n break;\n case 6:\n __privateMethod(this, _b, b_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 7, 0) : __privateMethod(this, _h, h_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 8, 1) : __privateMethod(this, _l, l_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n break;\n case 7:\n __privateMethod(this, _h, h_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 8, 1) : __privateMethod(this, _l, l_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n break;\n case 8:\n __privateMethod(this, _l, l_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n break;\n case 9:\n break;\n case 10:\n break;\n }\n }\n }\n}, _i = new WeakMap(), _n = new WeakMap(), _t = new WeakMap(), _e = new WeakMap(), _s = new WeakMap(), _u = new WeakMap(), _c = new WeakMap(), _p = new WeakMap(), _d = new WeakMap(), _g = new WeakMap(), _r = new WeakSet(), r_fn = /* @__PURE__ */ __name(function(t, r) {\n switch (__privateGet(this, _c)) {\n case 0:\n break;\n case 1:\n __privateGet(this, _t).protocol = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 2:\n break;\n case 3:\n __privateGet(this, _t).username = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 4:\n __privateGet(this, _t).password = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 5:\n __privateGet(this, _t).hostname = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 6:\n __privateGet(this, _t).port = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 7:\n __privateGet(this, _t).pathname = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 8:\n __privateGet(this, _t).search = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 9:\n __privateGet(this, _t).hash = __privateMethod(this, _o, o_fn).call(this);\n break;\n case 10:\n break;\n }\n __privateMethod(this, _k, k_fn).call(this, t, r);\n}, \"#r\"), _k = new WeakSet(), k_fn = /* @__PURE__ */ __name(function(t, r) {\n __privateSet(this, _c, t), __privateSet(this, _u, __privateGet(this, _e) + r), __privateSet(this, _e, __privateGet(this, _e) + r), __privateSet(this, _s, 0);\n}, \"#k\"), _P = new WeakSet(), P_fn = /* @__PURE__ */ __name(function() {\n __privateSet(this, _e, __privateGet(this, _u)), __privateSet(this, _s, 0);\n}, \"#P\"), _f = new WeakSet(), f_fn = /* @__PURE__ */ __name(function(t) {\n __privateMethod(this, _P, P_fn).call(this), __privateSet(this, _c, t);\n}, \"#f\"), _m = new WeakSet(), m_fn = /* @__PURE__ */ __name(function(t) {\n return t < 0 && (t = __privateGet(this, _n).length - t), t < __privateGet(this, _n).length ? __privateGet(this, _n)[t] : __privateGet(this, _n)[__privateGet(this, _n).length - 1];\n}, \"#m\"), _a2 = new WeakSet(), a_fn = /* @__PURE__ */ __name(function(t, r) {\n let n = __privateMethod(this, _m, m_fn).call(this, t);\n return n.value === r && (n.type === \"CHAR\" || n.type === \"ESCAPED_CHAR\" || n.type === \"INVALID_CHAR\");\n}, \"#a\"), _S = new WeakSet(), S_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \":\");\n}, \"#S\"), _E = new WeakSet(), E_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e) + 1, \"/\") && __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e) + 2, \"/\");\n}, \"#E\"), _x = new WeakSet(), x_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"@\");\n}, \"#x\"), _R = new WeakSet(), R_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \":\");\n}, \"#R\"), _y = new WeakSet(), y_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \":\");\n}, \"#y\"), _b = new WeakSet(), b_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"/\");\n}, \"#b\"), _h = new WeakSet(), h_fn = /* @__PURE__ */ __name(function() {\n if (__privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"?\"))\n return true;\n if (__privateGet(this, _n)[__privateGet(this, _e)].value !== \"?\")\n return false;\n let t = __privateMethod(this, _m, m_fn).call(this, __privateGet(this, _e) - 1);\n return t.type !== \"NAME\" && t.type !== \"REGEX\" && t.type !== \"CLOSE\" && t.type !== \"ASTERISK\";\n}, \"#h\"), _l = new WeakSet(), l_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"#\");\n}, \"#l\"), _O = new WeakSet(), O_fn = /* @__PURE__ */ __name(function() {\n return __privateGet(this, _n)[__privateGet(this, _e)].type == \"OPEN\";\n}, \"#O\"), _T = new WeakSet(), T_fn = /* @__PURE__ */ __name(function() {\n return __privateGet(this, _n)[__privateGet(this, _e)].type == \"CLOSE\";\n}, \"#T\"), _A = new WeakSet(), A_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"[\");\n}, \"#A\"), _w = new WeakSet(), w_fn = /* @__PURE__ */ __name(function() {\n return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), \"]\");\n}, \"#w\"), _o = new WeakSet(), o_fn = /* @__PURE__ */ __name(function() {\n let t = __privateGet(this, _n)[__privateGet(this, _e)], r = __privateMethod(this, _m, m_fn).call(this, __privateGet(this, _u)).index;\n return __privateGet(this, _i).substring(r, t.index);\n}, \"#o\"), _C = new WeakSet(), C_fn = /* @__PURE__ */ __name(function() {\n let t = {};\n Object.assign(t, b), t.encodePart = A;\n let r = Z(__privateMethod(this, _o, o_fn).call(this), void 0, t);\n __privateSet(this, _g, N(r));\n}, \"#C\"), __name(_a3, \"U\"), _a3);\nvar V = [\"protocol\", \"username\", \"password\", \"hostname\", \"port\", \"pathname\", \"search\", \"hash\"];\nvar E = \"*\";\nfunction ge(e, t) {\n if (typeof e != \"string\")\n throw new TypeError(\"parameter 1 is not of type 'string'.\");\n let r = new URL(e, t);\n return { protocol: r.protocol.substring(0, r.protocol.length - 1), username: r.username, password: r.password, hostname: r.hostname, port: r.port, pathname: r.pathname, search: r.search !== \"\" ? r.search.substring(1, r.search.length) : void 0, hash: r.hash !== \"\" ? r.hash.substring(1, r.hash.length) : void 0 };\n}\n__name(ge, \"ge\");\nfunction P(e, t) {\n return t ? C(e) : e;\n}\n__name(P, \"P\");\nfunction w(e, t, r) {\n let n;\n if (typeof t.baseURL == \"string\")\n try {\n n = new URL(t.baseURL), e.protocol = P(n.protocol.substring(0, n.protocol.length - 1), r), e.username = P(n.username, r), e.password = P(n.password, r), e.hostname = P(n.hostname, r), e.port = P(n.port, r), e.pathname = P(n.pathname, r), e.search = P(n.search.substring(1, n.search.length), r), e.hash = P(n.hash.substring(1, n.hash.length), r);\n } catch {\n throw new TypeError(`invalid baseURL '${t.baseURL}'.`);\n }\n if (typeof t.protocol == \"string\" && (e.protocol = ce(t.protocol, r)), typeof t.username == \"string\" && (e.username = ie(t.username, r)), typeof t.password == \"string\" && (e.password = se(t.password, r)), typeof t.hostname == \"string\" && (e.hostname = ne(t.hostname, r)), typeof t.port == \"string\" && (e.port = oe(t.port, e.protocol, r)), typeof t.pathname == \"string\") {\n if (e.pathname = t.pathname, n && !J(e.pathname, r)) {\n let o = n.pathname.lastIndexOf(\"/\");\n o >= 0 && (e.pathname = P(n.pathname.substring(0, o + 1), r) + e.pathname);\n }\n e.pathname = ae(e.pathname, e.protocol, r);\n }\n return typeof t.search == \"string\" && (e.search = re(t.search, r)), typeof t.hash == \"string\" && (e.hash = te(t.hash, r)), e;\n}\n__name(w, \"w\");\nfunction C(e) {\n return e.replace(/([+*?:{}()\\\\])/g, \"\\\\$1\");\n}\n__name(C, \"C\");\nfunction Re(e) {\n return e.replace(/([.+*?^${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n__name(Re, \"Re\");\nfunction ye(e, t) {\n t.delimiter ??= \"/#?\", t.prefixes ??= \"./\", t.sensitive ??= false, t.strict ??= false, t.end ??= true, t.start ??= true, t.endsWith = \"\";\n let r = \".*\", n = `[^${Re(t.delimiter)}]+?`, o = /[$_\\u200C\\u200D\\p{ID_Continue}]/u, c = \"\";\n for (let l = 0; l < e.length; ++l) {\n let s = e[l];\n if (s.type === 3) {\n if (s.modifier === 3) {\n c += C(s.value);\n continue;\n }\n c += `{${C(s.value)}}${y(s.modifier)}`;\n continue;\n }\n let i = s.hasCustomName(), a = !!s.suffix.length || !!s.prefix.length && (s.prefix.length !== 1 || !t.prefixes.includes(s.prefix)), h = l > 0 ? e[l - 1] : null, p = l < e.length - 1 ? e[l + 1] : null;\n if (!a && i && s.type === 1 && s.modifier === 3 && p && !p.prefix.length && !p.suffix.length)\n if (p.type === 3) {\n let O = p.value.length > 0 ? p.value[0] : \"\";\n a = o.test(O);\n } else\n a = !p.hasCustomName();\n if (!a && !s.prefix.length && h && h.type === 3) {\n let O = h.value[h.value.length - 1];\n a = t.prefixes.includes(O);\n }\n a && (c += \"{\"), c += C(s.prefix), i && (c += `:${s.name}`), s.type === 2 ? c += `(${s.value})` : s.type === 1 ? i || (c += `(${n})`) : s.type === 0 && (!i && (!h || h.type === 3 || h.modifier !== 3 || a || s.prefix !== \"\") ? c += \"*\" : c += `(${r})`), s.type === 1 && i && s.suffix.length && o.test(s.suffix[0]) && (c += \"\\\\\"), c += C(s.suffix), a && (c += \"}\"), s.modifier !== 3 && (c += y(s.modifier));\n }\n return c;\n}\n__name(ye, \"ye\");\nvar _i2, _n2, _t2, _e2, _s2, _a4;\nvar me = (_a4 = class {\n constructor(t = {}, r, n) {\n __privateAdd(this, _i2, void 0);\n __privateAdd(this, _n2, {});\n __privateAdd(this, _t2, {});\n __privateAdd(this, _e2, {});\n __privateAdd(this, _s2, {});\n try {\n let o;\n if (typeof r == \"string\" ? o = r : n = r, typeof t == \"string\") {\n let i = new U(t);\n if (i.parse(), t = i.result, o === void 0 && typeof t.protocol != \"string\")\n throw new TypeError(\"A base URL must be provided for a relative constructor string.\");\n t.baseURL = o;\n } else {\n if (!t || typeof t != \"object\")\n throw new TypeError(\"parameter 1 is not of type 'string' and cannot convert to dictionary.\");\n if (o)\n throw new TypeError(\"parameter 1 is not of type 'string'.\");\n }\n typeof n > \"u\" && (n = { ignoreCase: false });\n let c = { ignoreCase: n.ignoreCase === true }, l = { pathname: E, protocol: E, username: E, password: E, hostname: E, port: E, search: E, hash: E };\n __privateSet(this, _i2, w(l, t, true)), _(__privateGet(this, _i2).protocol) === __privateGet(this, _i2).port && (__privateGet(this, _i2).port = \"\");\n let s;\n for (s of V) {\n if (!(s in __privateGet(this, _i2)))\n continue;\n let i = {}, a = __privateGet(this, _i2)[s];\n switch (__privateGet(this, _t2)[s] = [], s) {\n case \"protocol\":\n Object.assign(i, b), i.encodePart = A;\n break;\n case \"username\":\n Object.assign(i, b), i.encodePart = le;\n break;\n case \"password\":\n Object.assign(i, b), i.encodePart = he;\n break;\n case \"hostname\":\n Object.assign(i, B), W(a) ? i.encodePart = j : i.encodePart = z;\n break;\n case \"port\":\n Object.assign(i, b), i.encodePart = K;\n break;\n case \"pathname\":\n N(__privateGet(this, _n2).protocol) ? (Object.assign(i, q, c), i.encodePart = fe) : (Object.assign(i, b, c), i.encodePart = ue);\n break;\n case \"search\":\n Object.assign(i, b, c), i.encodePart = pe;\n break;\n case \"hash\":\n Object.assign(i, b, c), i.encodePart = de;\n break;\n }\n try {\n __privateGet(this, _s2)[s] = D(a, i), __privateGet(this, _n2)[s] = F(__privateGet(this, _s2)[s], __privateGet(this, _t2)[s], i), __privateGet(this, _e2)[s] = ye(__privateGet(this, _s2)[s], i);\n } catch {\n throw new TypeError(`invalid ${s} pattern '${__privateGet(this, _i2)[s]}'.`);\n }\n }\n } catch (o) {\n throw new TypeError(`Failed to construct 'URLPattern': ${o.message}`);\n }\n }\n test(t = {}, r) {\n let n = { pathname: \"\", protocol: \"\", username: \"\", password: \"\", hostname: \"\", port: \"\", search: \"\", hash: \"\" };\n if (typeof t != \"string\" && r)\n throw new TypeError(\"parameter 1 is not of type 'string'.\");\n if (typeof t > \"u\")\n return false;\n try {\n typeof t == \"object\" ? n = w(n, t, false) : n = w(n, ge(t, r), false);\n } catch {\n return false;\n }\n let o;\n for (o of V)\n if (!__privateGet(this, _n2)[o].exec(n[o]))\n return false;\n return true;\n }\n exec(t = {}, r) {\n let n = { pathname: \"\", protocol: \"\", username: \"\", password: \"\", hostname: \"\", port: \"\", search: \"\", hash: \"\" };\n if (typeof t != \"string\" && r)\n throw new TypeError(\"parameter 1 is not of type 'string'.\");\n if (typeof t > \"u\")\n return;\n try {\n typeof t == \"object\" ? n = w(n, t, false) : n = w(n, ge(t, r), false);\n } catch {\n return null;\n }\n let o = {};\n r ? o.inputs = [t, r] : o.inputs = [t];\n let c;\n for (c of V) {\n let l = __privateGet(this, _n2)[c].exec(n[c]);\n if (!l)\n return null;\n let s = {};\n for (let [i, a] of __privateGet(this, _t2)[c].entries())\n if (typeof a == \"string\" || typeof a == \"number\") {\n let h = l[i + 1];\n s[a] = h;\n }\n o[c] = { input: n[c] ?? \"\", groups: s };\n }\n return o;\n }\n static compareComponent(t, r, n) {\n let o = /* @__PURE__ */ __name((i, a) => {\n for (let h of [\"type\", \"modifier\", \"prefix\", \"value\", \"suffix\"]) {\n if (i[h] < a[h])\n return -1;\n if (i[h] === a[h])\n continue;\n return 1;\n }\n return 0;\n }, \"o\"), c = new k(3, \"\", \"\", \"\", \"\", 3), l = new k(0, \"\", \"\", \"\", \"\", 3), s = /* @__PURE__ */ __name((i, a) => {\n let h = 0;\n for (; h < Math.min(i.length, a.length); ++h) {\n let p = o(i[h], a[h]);\n if (p)\n return p;\n }\n return i.length === a.length ? 0 : o(i[h] ?? c, a[h] ?? c);\n }, \"s\");\n return !__privateGet(r, _e2)[t] && !__privateGet(n, _e2)[t] ? 0 : __privateGet(r, _e2)[t] && !__privateGet(n, _e2)[t] ? s(__privateGet(r, _s2)[t], [l]) : !__privateGet(r, _e2)[t] && __privateGet(n, _e2)[t] ? s([l], __privateGet(n, _s2)[t]) : s(__privateGet(r, _s2)[t], __privateGet(n, _s2)[t]);\n }\n get protocol() {\n return __privateGet(this, _e2).protocol;\n }\n get username() {\n return __privateGet(this, _e2).username;\n }\n get password() {\n return __privateGet(this, _e2).password;\n }\n get hostname() {\n return __privateGet(this, _e2).hostname;\n }\n get port() {\n return __privateGet(this, _e2).port;\n }\n get pathname() {\n return __privateGet(this, _e2).pathname;\n }\n get search() {\n return __privateGet(this, _e2).search;\n }\n get hash() {\n return __privateGet(this, _e2).hash;\n }\n}, _i2 = new WeakMap(), _n2 = new WeakMap(), _t2 = new WeakMap(), _e2 = new WeakMap(), _s2 = new WeakMap(), __name(_a4, \"me\"), _a4);\n\n// ../../node_modules/.pnpm/urlpattern-polyfill@9.0.0/node_modules/urlpattern-polyfill/index.js\nif (!globalThis.URLPattern) {\n globalThis.URLPattern = me;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n URLPattern\n});\n"

@@ -5,3 +5,3 @@ {

"homepage": "https://edge-runtime.vercel.app/packages/primitives",
"version": "3.0.4",
"version": "3.1.0",
"main": "dist/index.js",

@@ -27,6 +27,3 @@ "repository": {

"devDependencies": {
"@peculiar/webcrypto": "1.4.3",
"@stardazed/streams-text-encoding": "1.0.2",
"@ungap/structured-clone": "1.2.0",
"aggregate-error-ponyfill": "1.1.0",
"blob-polyfill": "7.0.20220408",

@@ -40,9 +37,8 @@ "esbuild-plugin-alias": "latest",

"tsup": "7",
"undici": "5.22.1",
"undici": "5.23.0",
"urlpattern-polyfill": "9.0.0",
"web-streams-polyfill": "4.0.0-beta.3",
"@edge-runtime/format": "2.1.0"
"@edge-runtime/format": "2.2.0"
},
"engines": {
"node": ">=14"
"node": ">=16"
},

@@ -49,0 +45,0 @@ "files": [

@@ -8,5 +8,29 @@ export { AbortController, AbortSignal, DOMException } from './abort-controller.d.js';

export { File, FormData, Headers, Request, RequestInfo, RequestInit, Response, WebSocket, fetch } from './fetch.d.js';
export { ReadableStream, ReadableStreamBYOBReader, ReadableStreamDefaultReader, TransformStream, WritableStream, WritableStreamDefaultWriter } from './streams.d.js';
export { TextDecoderStream, TextEncoderStream } from './text-encoding-streams.d.js';
export { structuredClone } from './structured-clone.d.js';
export { URL, URLPattern, URLSearchParams } from './url.d.js';
/**
* The type of `ReadableStreamBYOBReader` is not included in Typescript so we
* are declaring it inline to not have to worry about bundling.
*/
declare class ReadableStreamBYOBReader {
constructor(stream: ReadableStream<Uint8Array>)
get closed(): Promise<undefined>
cancel(reason?: any): Promise<void>
read<T extends ArrayBufferView>(
view: T
): Promise<{ done: false; value: T } | { done: true; value: T | undefined }>
releaseLock(): void
}
declare const ReadableStreamConstructor: typeof ReadableStream
declare const ReadableStreamBYOBReaderConstructor: typeof ReadableStreamBYOBReader
declare const ReadableStreamDefaultReaderConstructor: typeof ReadableStreamDefaultReader
declare const TransformStreamConstructor: typeof TransformStream
declare const WritableStreamConstructor: typeof WritableStream
declare const WritableStreamDefaultWriterConstructor: typeof WritableStreamDefaultWriter
declare const TextDecoderStreamConstructor: typeof TextDecoderStream
declare const TextEncoderStreamConstructor: typeof TextEncoderStream
export { ReadableStreamConstructor as ReadableStream, ReadableStreamBYOBReaderConstructor as ReadableStreamBYOBReader, ReadableStreamDefaultReaderConstructor as ReadableStreamDefaultReader, TextDecoderStreamConstructor as TextDecoderStream, TextEncoderStreamConstructor as TextEncoderStream, TransformStreamConstructor as TransformStream, WritableStreamConstructor as WritableStream, WritableStreamDefaultWriterConstructor as WritableStreamDefaultWriter };

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc