@dvaji/cheerox 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/Cargo.lock +1 -1
  2. package/Cargo.toml +1 -1
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/cheerox.darwin-arm64.node +0 -0
  5. package/cheerox.darwin-x64.node +0 -0
  6. package/cheerox.linux-arm64-gnu.node +0 -0
  7. package/cheerox.linux-arm64-musl.node +0 -0
  8. package/cheerox.linux-x64-gnu.node +0 -0
  9. package/cheerox.linux-x64-musl.node +0 -0
  10. package/cheerox.win32-arm64-msvc.node +0 -0
  11. package/cheerox.win32-x64-msvc.node +0 -0
  12. package/dist/{cheerio-compat-DcnYK9OB.cjs → cheerio-compat-BeDR8TQZ.cjs} +9 -7
  13. package/dist/cheerio-compat-BeDR8TQZ.cjs.map +1 -0
  14. package/dist/{cheerio-compat-DRsINTwV.d.ts → cheerio-compat-C6M5aNE9.d.cts} +15 -4
  15. package/dist/{cheerio-compat-DRsINTwV.d.cts → cheerio-compat-C6M5aNE9.d.ts} +15 -4
  16. package/dist/{cheerio-compat-BKkfJEAr.mjs → cheerio-compat-CVs7vojA.mjs} +9 -7
  17. package/dist/cheerio-compat-CVs7vojA.mjs.map +1 -0
  18. package/dist/{cheerio-compat-DRLPzBdX.d.mts → cheerio-compat-WDud2pl9.d.mts} +15 -4
  19. package/dist/cheerio-compat.cjs +1 -1
  20. package/dist/cheerio-compat.d.cts +2 -2
  21. package/dist/cheerio-compat.d.mts +2 -2
  22. package/dist/cheerio-compat.d.ts +2 -2
  23. package/dist/cheerio-compat.mjs +1 -1
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.mts +2 -2
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/{modern-CvXcTn82.mjs → modern-BwcwZX6l.mjs} +2 -2
  28. package/dist/{modern-CvXcTn82.mjs.map → modern-BwcwZX6l.mjs.map} +1 -1
  29. package/dist/{modern-CHQGP0Yt.cjs → modern-DMcsyA4b.cjs} +2 -2
  30. package/dist/{modern-CHQGP0Yt.cjs.map → modern-DMcsyA4b.cjs.map} +1 -1
  31. package/dist/modern.cjs +2 -2
  32. package/dist/modern.mjs +2 -2
  33. package/dist/{nodes-jbWWhssj.cjs → nodes-Be5sB8rQ.cjs} +23 -15
  34. package/dist/nodes-Be5sB8rQ.cjs.map +1 -0
  35. package/dist/{nodes-sYxb5qyZ.mjs → nodes-C95i5k2P.mjs} +23 -15
  36. package/dist/nodes-C95i5k2P.mjs.map +1 -0
  37. package/dist/slim.cjs +1 -1
  38. package/dist/slim.mjs +1 -1
  39. package/native/src/lib.rs +507 -0
  40. package/package.json +1 -1
  41. package/src/cheerio-compat/types.ts +12 -0
  42. package/src/cheerio-compat.ts +15 -5
  43. package/src/index.ts +1 -0
  44. package/src/native.ts +23 -9
  45. package/dist/cheerio-compat-BKkfJEAr.mjs.map +0 -1
  46. package/dist/cheerio-compat-DcnYK9OB.cjs.map +0 -1
  47. package/dist/nodes-jbWWhssj.cjs.map +0 -1
  48. package/dist/nodes-sYxb5qyZ.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"modern-CvXcTn82.mjs","names":["parse","parse","request","requestHTTPS","requestHTTP","stringifyQuery","nativeDOM.Node","nativeDOM.DataNode","nativeDOM.NodeWithChildren","nativeDOM.Document","nativeDOM.Element","nativeDOM.Text","nativeDOM.Comment","nativeDOM.ProcessingInstruction","nativeDOM.CDATA","nativeDOM.ElementType","nativeDOM.isTag","nativeDOM.isText","nativeDOM.isComment","nativeDOM.isDirective","nativeDOM.isDocument","nativeDOM.isCDATA","nativeDOM.hasChildren","yieldToEventLoop"],"sources":["../src/extract-plan.ts","../src/attributes.ts","../src/parse.ts","../src/match.ts","../src/selection.ts","../src/extract.ts","../src/workers.ts","../src/io.ts","../src/modern.ts"],"sourcesContent":["import type { CheerioOptions, ExtractMap } from './types.js';\nimport { types } from 'node:util';\n\nexport interface ExtractPlanEntry {\n key: string;\n selector: string;\n all: boolean;\n value: { kind: 'property'; name: string } | { kind: 'map'; entries: ExtractPlanEntry[] };\n}\n\nexport interface ExtractPlan { version: 1; entries: ExtractPlanEntry[] }\n\n// Properties that can be returned as ordinary values. Properties returning DOM\n// views stay on the regular API so their identities and document leases survive.\nconst scalarProperties = new Set([\n 'textContent', 'innerText', 'innerHTML', 'outerHTML', 'tagName', 'nodeName',\n 'nodeType', 'id', 'class', 'className', 'title', 'href', 'src', 'alt', 'name',\n 'value', 'type', 'checked', 'selected', 'disabled', 'multiple', 'readOnly',\n 'required', 'hidden', 'open', 'autofocus', 'controls', 'loop', 'muted',\n]);\n\nfunction dataValue(object: object, key: string): { value: unknown } | undefined {\n for (let current: object | null = object; current; current = Object.getPrototypeOf(current)) {\n if (types.isProxy(current)) return undefined;\n const descriptor = Object.getOwnPropertyDescriptor(current, key);\n if (descriptor) return 'value' in descriptor ? { value: descriptor.value } : undefined;\n }\n return { value: undefined };\n}\n\n/** Compile pure extraction maps. User callbacks and accessors keep JS semantics. */\nexport function compileExtractPlan(map: ExtractMap, options: CheerioOptions): ExtractPlan | undefined {\n if (options.pseudos || options.treeAdapter || options.Tokenizer || options.xml && typeof options.xml === 'object' && options.xml.Tokenizer) return undefined;\n const ancestors = new Set<object>();\n const compile = (input: unknown): ExtractPlanEntry[] | undefined => {\n if (!input || typeof input !== 'object' || types.isProxy(input) || ancestors.has(input) || ancestors.size >= 64) return undefined;\n for (let current = Object.getPrototypeOf(input); current; current = Object.getPrototypeOf(current)) {\n if (types.isProxy(current)) return undefined;\n }\n ancestors.add(input);\n try {\n const entries: ExtractPlanEntry[] = [];\n for (const key in input) {\n // Cheerio uses an ordinary result object. Its legacy __proto__ setter\n // semantics must execute through the JavaScript path.\n if (key === '__proto__') return undefined;\n const inherited = Object.getOwnPropertyDescriptor(Object.prototype, key);\n if (inherited && (!('value' in inherited) || !inherited.writable)) return undefined;\n const slot = dataValue(input, key);\n if (!slot) return undefined;\n const all = Array.isArray(slot.value);\n if (slot.value && typeof slot.value === 'object' && types.isProxy(slot.value)) return undefined;\n const first = all ? dataValue(slot.value as object, '0') : slot;\n if (!first) return undefined;\n const descriptor = first.value;\n let selector: unknown;\n let value: unknown;\n if (typeof descriptor === 'string') { selector = descriptor; value = 'textContent'; }\n else if (descriptor && typeof descriptor === 'object') {\n if (types.isProxy(descriptor)) return undefined;\n const selectorSlot = dataValue(descriptor, 'selector');\n const valueSlot = dataValue(descriptor, 'value');\n if (!selectorSlot || !valueSlot) return undefined;\n selector = selectorSlot.value;\n value = valueSlot.value ?? 'textContent';\n } else return undefined;\n if (typeof selector !== 'string') return undefined;\n if (typeof value === 'string') {\n if (!scalarProperties.has(value) && !/^(?:data-|aria-).+/.test(value)) return undefined;\n entries.push({ key, selector, all, value: { kind: 'property', name: value } });\n } else {\n const nested = compile(value);\n if (!nested) return undefined;\n entries.push({ key, selector, all, value: { kind: 'map', entries: nested } });\n }\n }\n return entries;\n } finally { ancestors.delete(input); }\n };\n const entries = compile(map);\n return entries && { version: 1, entries };\n}\n\n/** JSON omits undefined fields; restore them recursively without changing order. */\nexport function hydrateExtractResult(result: Record<string, unknown>, entries: ExtractPlanEntry[]): void {\n const values = entries.map((entry) => Object.hasOwn(result, entry.key) ? result[entry.key] : entry.all ? [] : undefined);\n for (const entry of entries) delete result[entry.key];\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n Object.defineProperty(result, entry.key, { value: values[index], enumerable: true, configurable: true, writable: true });\n if (entry.value.kind !== 'map') continue;\n const nested = result[entry.key];\n for (const value of entry.all && Array.isArray(nested) ? nested : [nested]) {\n if (value && typeof value === 'object' && !Array.isArray(value)) hydrateExtractResult(value as Record<string, unknown>, entry.value.entries);\n }\n }\n}\n","import type { AnyNode, CheerioOptions, Element, SerializedField } from './types.js';\nimport type { Cheerio } from './selection.js';\nimport type { NativeDocument } from './native.js';\nimport { getNode, hydrateLocation, importNodes, nodeRecord } from './nodes.js';\nimport { attributeAt, DOCUMENT, plainSnapshot, recordAt, VIEW_LOCAL, VIEW_SELF, VIEW_STATE, type DocumentState } from './router.js';\n\nexport interface StyleProp {\n length: number;\n [key: string]: string | number;\n [index: number]: string;\n}\n\nexport interface AttributeMethods<T = AnyNode> {\n attr<U extends AnyNode>(this: Cheerio<U>, name: string): string | undefined;\n attr<U extends AnyNode>(this: Cheerio<U>): Record<string, string> | undefined;\n attr<U extends AnyNode>(this: Cheerio<U>, name: string, value?: string | null | ((this: Element, index: number, value: string) => string | null)): Cheerio<U>;\n attr<U extends AnyNode>(this: Cheerio<U>, values: Record<string, string | null>): Cheerio<U>;\n prop<U extends AnyNode>(this: Cheerio<U>, name: 'tagName' | 'nodeName'): string | undefined;\n prop<U extends AnyNode>(this: Cheerio<U>, name: 'innerHTML' | 'outerHTML' | 'innerText' | 'textContent'): string | null;\n prop<U extends AnyNode>(this: Cheerio<U>, name: 'style'): StyleProp | undefined;\n prop<U extends AnyNode>(this: Cheerio<U>, name: 'href' | 'src'): string | undefined;\n prop<U extends AnyNode, K extends keyof Element>(this: Cheerio<U>, name: K): Element[K];\n prop<U extends AnyNode, K extends keyof Element>(this: Cheerio<U>, name: K, value: Element[K] | ((this: Element, index: number, property: K) => Element[keyof Element])): Cheerio<U>;\n prop<U extends AnyNode>(this: Cheerio<U>, values: Record<string, string | Element[keyof Element] | boolean>): Cheerio<U>;\n prop<U extends AnyNode>(this: Cheerio<U>, name: string, value: string | boolean | null | ((this: Element, index: number, property: string) => string | boolean)): Cheerio<U>;\n prop<U extends AnyNode>(this: Cheerio<U>, name: string): string;\n data<U extends AnyNode>(this: Cheerio<U>, name: string): unknown;\n data<U extends AnyNode>(this: Cheerio<U>): Record<string, unknown>;\n data<U extends AnyNode>(this: Cheerio<U>, name: string, value: unknown): Cheerio<U>;\n data<U extends AnyNode>(this: Cheerio<U>, values: Record<string, unknown>): Cheerio<U>;\n val<U extends AnyNode>(this: Cheerio<U>): string | string[] | undefined;\n val<U extends AnyNode>(this: Cheerio<U>, value: string | string[]): Cheerio<U>;\n removeAttr<U extends AnyNode>(this: Cheerio<U>, name: string): Cheerio<U>;\n hasClass<U extends AnyNode>(this: Cheerio<U>, name: string): boolean;\n addClass<U extends AnyNode, R extends ArrayLike<U>>(this: R, name?: string | ((this: Element, index: number, current: string) => string | undefined)): R;\n removeClass<U extends AnyNode, R extends ArrayLike<U>>(this: R, name?: string | ((this: Element, index: number, current: string) => string | undefined)): R;\n toggleClass<U extends AnyNode, R extends ArrayLike<U>>(this: R, name?: string | ((this: Element, index: number, current: string, state?: boolean) => string), state?: boolean): R;\n css<U extends AnyNode>(this: Cheerio<U>, names?: string[]): Record<string, string> | undefined;\n css<U extends AnyNode>(this: Cheerio<U>, name: string): string | undefined;\n css<U extends AnyNode>(this: Cheerio<U>, name: string, value: string | ((this: Element, index: number, current: string) => string | undefined)): Cheerio<U>;\n css<U extends AnyNode>(this: Cheerio<U>, values: Record<string, string>): Cheerio<U>;\n serializeArray<U extends AnyNode>(this: Cheerio<U>): SerializedField[];\n serialize<U extends AnyNode>(this: Cheerio<U>): string;\n}\n\ntype Selection = Cheerio<AnyNode>;\ntype DataRecord = Record<string, unknown>;\ntype DataDocument = NativeDocument & {\n retainNodeData?: (id: number, data: DataRecord) => void;\n nodeData?: (id: number) => DataRecord | undefined;\n nodeDataOperation?: (id: number) => (command: string, args: unknown) => unknown;\n};\n\nconst elementTypes = new Set(['tag', 'script', 'style']);\n/** Boolean attributes read as their name in HTML, matched case-insensitively as Cheerio does. */\nconst booleanAttribute = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i;\n\nconst absent = Symbol('absent');\nconst deferred = Symbol('deferred');\n\n/**\n * Reads an attribute of the selection's first node, as Cheerio reads it from\n * `this[0]`, from cached records; `deferred` leaves the read to the native\n * `attr` operation and `absent` means there is no such attribute.\n */\nfunction readAttribute(selection: Selection, name: string): string | typeof absent | typeof deferred {\n const node = selection[0] as unknown as Record<string | symbol, unknown> | null | undefined;\n if (typeof node !== 'object' || node === null) return absent;\n const state = node[VIEW_STATE] as DocumentState | undefined;\n if (state === undefined || node[VIEW_SELF] !== node) return typeof node.type === 'string' ? deferred : absent;\n const local = node[VIEW_LOCAL] as number;\n const snapshot = plainSnapshot(state, local);\n const record = snapshot ? undefined : recordAt(state, local);\n const type = snapshot ? snapshot.typeOf(local) : record?.type;\n if (type === undefined || !elementTypes.has(type)) return absent;\n const value = attributeAt(state, local, name);\n if (value === undefined) {\n // Snapshot attributes are all strings; a record may hold another value, which the native read interprets.\n const attributes = record?.attribs as Record<string, unknown> | undefined;\n if (attributes && Object.hasOwn(attributes, name)) return deferred;\n return name === 'value' ? deferred : absent;\n }\n const options = selection.options ?? {};\n const isXml = options.xmlMode ?? (options.xml === true || (typeof options.xml === 'object' && options.xml !== null));\n return !isXml && booleanAttribute.test(name) ? name : value;\n}\n\n/** Writes one attribute through the routed document's typed path when it has one. */\nfunction setAttribute(selection: Selection, ids: number[], name: string, value: string | null): void {\n const document = selection[DOCUMENT] as NativeDocument & { setAttribute?(ids: number[], name: string, value: string | null): void };\n if (document.setAttribute) document.setAttribute(ids, name, value);\n else selection.op('attr', { ids, name, value });\n}\n\nfunction isElement(selection: Selection, id: number): boolean {\n return ['tag', 'script', 'style'].includes(nodeRecord(selection[DOCUMENT], id)?.type);\n}\n\nfunction nativeValue(value: unknown): unknown {\n // Preserve JSON's primitive normalization without serializing and parsing it.\n if (value === null || typeof value === 'string' || typeof value === 'boolean') return value;\n if (typeof value === 'number') return Number.isFinite(value) ? (value === 0 ? 0 : value) : { __nativeNumber: String(value) };\n const seen = new WeakSet<object>();\n const json = JSON.stringify(value, (_key, value: unknown) => {\n if (typeof value === 'function' || typeof value === 'symbol' || typeof value === 'bigint' || value === undefined) return { __opaqueJavaScriptValue: true };\n if (typeof value === 'number' && !Number.isFinite(value)) return { __nativeNumber: String(value) };\n if (value && typeof value === 'object') {\n if (seen.has(value)) return { __opaqueJavaScriptValue: true };\n seen.add(value);\n }\n return value;\n });\n return json === undefined ? { __opaqueJavaScriptValue: true } : JSON.parse(json);\n}\n\nfunction hydrateValue(value: any): any {\n if (value && typeof value === 'object') {\n if (Object.keys(value).length === 1 && typeof value.__nativeNumber === 'string') return Number(value.__nativeNumber);\n for (const key of Object.keys(value)) value[key] = hydrateValue(value[key]);\n }\n return value;\n}\n\nfunction dataObject(selection: Selection, id: number): Record<string, unknown> {\n // The router stores data per node and carries it along when a node moves\n // between documents, preserving data identities and callback references.\n const document = selection[DOCUMENT] as DataDocument;\n let data = document.nodeData?.(id);\n if (!data) {\n const dispatch = document.nodeDataOperation?.(id) ?? ((command: string, args: unknown) => JSON.parse(document.op(command, JSON.stringify(args))));\n const target: Record<string, unknown> = {};\n data = new Proxy(target, {\n set(object, name, value) {\n Reflect.set(object, name, value);\n if (typeof name === 'string') dispatch('data', { ids: [id], name, value: nativeValue(value) });\n return true;\n },\n defineProperty(object, name, descriptor) {\n Reflect.defineProperty(object, name, descriptor);\n if (typeof name === 'string' && 'value' in descriptor) dispatch('data', { ids: [id], name, value: nativeValue(descriptor.value) });\n return true;\n },\n deleteProperty(object, name) {\n Reflect.deleteProperty(object, name);\n if (typeof name === 'string') dispatch('removeData', { ids: [id], name });\n return true;\n },\n });\n document.retainNodeData?.(id, data);\n }\n const node = getNode(selection[DOCUMENT], id);\n // JS data can contain callbacks, cycles, and object identities. The DOM and\n // parsed data values live in Rust; the node exposes the JS values.\n if (!Object.hasOwn(node, 'data')) {\n const values = data;\n Object.defineProperty(node, 'data', { configurable: true, enumerable: true, get: () => values, set: (value: Record<string, unknown>) => { for (const key of Object.keys(values)) delete values[key]; for (const key of Object.keys(value ?? {})) values[key] = value[key]; } });\n }\n return data;\n}\n\nfunction property(selection: Selection, id: number, name: string, raw = false): any {\n const result = selection.op('prop', { ids: [id], name, ...(raw ? { raw: true } : {}) });\n if (name === 'sourceCodeLocation') return hydrateLocation(result);\n return result?.__nativeNodeProperty ? (getNode(selection[DOCUMENT], id) as any)[result.__nativeNodeProperty] : result === null ? undefined : result;\n}\n\nfunction propertyValue(selection: Selection, name: string, value: any): any {\n if (name === 'children' || name === 'childNodes') return importNodes(selection[DOCUMENT], value);\n if (['parent', 'parentNode', 'prev', 'previousSibling', 'next', 'nextSibling'].includes(name)) return value == null ? null : importNodes(selection[DOCUMENT], [value])[0] ?? null;\n return value;\n}\n\nfunction attr(this: Selection, name?: any, value?: any): any {\n if (typeof name === 'object' || value !== undefined) {\n if (typeof value === 'function') {\n if (typeof name !== 'string') throw new Error('Bad combination of arguments.');\n this.ids.forEach((id, index) => {\n if (!isElement(this, id)) return;\n const node = getNode(this[DOCUMENT], id) as Element;\n const current = node.attribs[name];\n const next = value.call(node, index, current);\n setAttribute(this, [id], name, next === null ? null : String(next));\n });\n } else if (typeof name === 'object') {\n for (const key of Object.keys(name)) setAttribute(this, this.ids, key, name[key] === null ? null : String(name[key]));\n } else {\n setAttribute(this, this.ids, name, value === null ? null : String(value));\n }\n return this;\n }\n if (arguments.length > 1) return this;\n if (typeof name === 'string') {\n const cached = readAttribute(this, name);\n if (cached === absent) return undefined;\n if (cached !== deferred) return cached;\n }\n const result = this.op('attr', { ids: this.ids, ...(typeof name === 'string' ? { name } : {}) });\n if (result === null) return undefined;\n return !name && this.ids.length ? (getNode(this[DOCUMENT], this.ids[0]) as Element).attribs : result;\n}\n\nfunction prop(this: Selection, name: any, value?: any): any {\n if (typeof name === 'string' && value === undefined) return this.ids.length ? property(this, this.ids[0], name) : undefined;\n if (typeof name === 'object' || value !== undefined) {\n if (typeof value === 'function') {\n if (typeof name === 'object') throw new TypeError('Bad combination of arguments.');\n this.ids.forEach((id, index) => {\n if (!isElement(this, id)) return;\n const next = value.call(getNode(this[DOCUMENT], id), index, property(this, id, name, true));\n this.op('prop', { ids: [id], name, value: propertyValue(this, name, next) });\n });\n } else if (typeof name === 'object') {\n for (const key of Object.keys(name)) this.op('prop', { ids: this.ids, name: key, value: propertyValue(this, key, name[key]) });\n } else {\n this.op('prop', { ids: this.ids, name, value: propertyValue(this, name, value) });\n }\n return this;\n }\n return undefined;\n}\n\nfunction data(this: Selection, name?: any, value?: unknown): any {\n const first = this.ids[0];\n if (first === undefined || !isElement(this, first)) return undefined;\n if (name != null && (typeof name === 'object' || value !== undefined)) {\n for (const id of this.ids) {\n if (!isElement(this, id)) continue;\n const record = dataObject(this, id);\n if (typeof name === 'object') for (const key of Object.keys(name)) record[key] = name[key];\n else if (typeof name === 'string') record[name] = value;\n }\n return this;\n }\n const record = dataObject(this, first);\n if (typeof name === 'string' && Object.hasOwn(record, name)) return record[name];\n const found = this.op<{ found: boolean; value?: any }>('data', { ids: [first], ...(name == null ? {} : { name }) });\n if (!found.found) return undefined;\n if (name == null) {\n for (const key of Object.keys(found.value)) if (!Object.hasOwn(record, key)) record[key] = hydrateValue(found.value[key]);\n return record;\n }\n record[name] = hydrateValue(found.value);\n return record[name];\n}\n\nfunction css(this: Selection, name?: any, value?: any): any {\n if (name != null && value != null || typeof name === 'object' && !Array.isArray(name)) {\n if (typeof name === 'object') {\n for (const [propertyIndex, key] of Object.keys(name).entries()) {\n if (typeof name[key] === 'function') {\n for (const id of this.ids) {\n if (!isElement(this, id)) continue;\n const current = this.op('css', { ids: [id], name: key }) ?? undefined;\n const next = name[key].call(getNode(this[DOCUMENT], id), propertyIndex, current);\n this.op('css', { ids: [id], name: key, value: next == null ? null : String(next) });\n }\n } else this.op('css', { ids: this.ids, name: key, value: name[key] == null ? null : String(name[key]) });\n }\n } else if (typeof name === 'string' && typeof value === 'function') {\n this.ids.forEach((id, index) => {\n if (!isElement(this, id)) return;\n const current = this.op('css', { ids: [id], name }) ?? undefined;\n const next = value.call(getNode(this[DOCUMENT], id), index, current);\n this.op('css', { ids: [id], name, value: next == null ? null : String(next) });\n });\n } else if (typeof name === 'string') this.op('css', { ids: this.ids, name, value: value == null ? null : String(value) });\n return this;\n }\n return this.op('css', { ids: this.ids, ...(name === undefined ? {} : { name }) }) ?? undefined;\n}\n\nfunction classMethod(command: 'addClass' | 'removeClass' | 'toggleClass') {\n return function(this: Selection, name?: any, state?: boolean): Selection {\n if (typeof name === 'function') {\n this.ids.forEach((id, index) => {\n if (!isElement(this, id)) return;\n const node = getNode(this[DOCUMENT], id) as Element;\n const next = command === 'toggleClass'\n ? name.call(node, index, node.attribs.class ?? '', state)\n : name.call(node, index, node.attribs.class ?? '');\n if (typeof next === 'string') this.op(command, { ids: [id], name: next, ...(typeof state === 'boolean' ? { state } : {}) });\n });\n } else if (typeof name === 'string' || command === 'removeClass' && arguments.length === 0) {\n this.op(command, { ids: this.ids, ...(typeof name === 'string' ? { name } : { all: true }), ...(typeof state === 'boolean' ? { state } : {}) });\n }\n return this;\n };\n}\n\nexport function installAttributes(CheerioClass: { prototype: object }): void {\n Object.assign(CheerioClass.prototype, {\n attr, prop, data, css,\n removeAttr(this: Selection, name: string) {\n const ids = this.ids;\n for (const single of String(name).split(/\\s+/)) if (single) setAttribute(this, ids, single, null);\n return this;\n },\n hasClass(this: Selection, name: string) { return this.op<boolean>('hasClass', { ids: this.ids, name }); },\n addClass: classMethod('addClass'), removeClass: classMethod('removeClass'), toggleClass: classMethod('toggleClass'),\n val(this: Selection, value?: unknown) {\n if (arguments.length === 0) return this.op('val', { ids: this.ids }) ?? undefined;\n const result = this.op('val', { ids: this.ids, value: value === undefined ? { __undefinedJavaScriptValue: true } : value });\n return result?.chain === false ? result.returnValue : result === false ? undefined : this;\n },\n serializeArray(this: Selection) { return this.op<SerializedField[]>('serializeArray', { ids: this.ids }); },\n serialize(this: Selection) { return this.op<string>('serialize', { ids: this.ids }); },\n });\n}\n","import { requireNative } from './native.js';\nimport { getNode, importNodes, nodeBinding, operation } from './nodes.js';\nimport { routeDocument } from './router.js';\nimport { parseNativeDocument, cleanParserOptions } from './hooks.js';\nimport type { AnyNode, Document, InternalOptions, ParentNode } from './types.js';\n\ntype ParseContent = string | Buffer | Document | AnyNode | AnyNode[];\ntype Parser = (content: string, options: InternalOptions, isDocument: boolean, context: ParentNode | null) => Document;\n\n/** Parse with the Rust HTML5 or HTML/XML engine, preserving fragment context. */\nfunction parseWithNative(content: string, options: InternalOptions, isDocument: boolean, context: ParentNode | null): Document {\n if (!isDocument && context) {\n const document = nodeBinding(context)?.document\n ?? routeDocument(new (requireNative().NativeDocument)('', false, JSON.stringify(cleanParserOptions(options))), options);\n const contextId = importNodes(document, [context])[0];\n const children = operation<number[]>(document, 'create', { html: content, contextId, options });\n const root = operation<number>(document, 'createNode', { type: 'root', options });\n operation(document, 'setNode', { id: root, field: 'children', value: children, options });\n return getNode(document, root) as Document;\n }\n const document = parseNativeDocument(content, options, isDocument);\n return getNode(document, document.rootId()) as Document;\n}\n\n/** The HTML5 adapter uses Rust's HTML5 tree builder. */\nexport function parseWithParse5(content: string, options: InternalOptions, isDocument: boolean, context: ParentNode | null): Document {\n return parseWithNative(content, { ...options, _useHtmlParser2: false, xml: false, xmlMode: false }, isDocument, context);\n}\n\n/** The htmlparser2-compatible adapter uses the Rust HTML/XML tokenizer. */\nexport function parseWithHtmlparser2(content: string, options: InternalOptions): Document {\n return parseWithNative(content, { ...options, _useHtmlParser2: true }, false, null);\n}\n\nexport { parseWithHtmlparser2 as parseDocument };\n\n/** Normalize parser inputs while keeping every DOM operation in the native arena. */\nexport function getParse(parser: Parser) {\n return function parse(content: ParseContent, options: InternalOptions, isDocument: boolean, context: ParentNode | null): Document {\n if (Buffer.isBuffer(content)) content = content.toString();\n if (typeof content === 'string') return parser(content, options, isDocument, context);\n if (!Array.isArray(content) && content.type === 'root' && nodeBinding(content)) return content;\n const document = routeDocument(new (requireNative().NativeDocument)('', false, JSON.stringify(cleanParserOptions(options))), options);\n const ids = importNodes(document, content);\n if (!Array.isArray(content) && content.type === 'root') return getNode(document, ids[0]) as Document;\n operation(document, 'setNode', { id: document.rootId(), field: 'children', value: ids, options });\n return getNode(document, document.rootId()) as Document;\n };\n}\n\nexport const parse = getParse((content, options, isDocument, context) => options._useHtmlParser2\n ? parseWithHtmlparser2(content, options)\n : parseWithParse5(content, options, isDocument, context));\n","import type { NativeDocument } from './native.js';\nimport type { CheerioOptions } from './types.js';\nimport { attributeAt, isRouted, recordAt, stateIn, structureSnapshot, type DocumentState } from './router.js';\nimport { NodeSnapshot } from './snapshot.js';\n\n/**\n * One compound selector: an optional type plus id, class and attribute-presence\n * tests. Lowercased names are kept for documents that lowercase names.\n */\ninterface Compound { tag: string | undefined; lowerTag: string | undefined; ids: string[]; classes: string[]; attributes: string[]; lowerAttributes: string[] }\n\nconst compiled = new Map<string, Compound[] | null>();\nconst compiledLimit = 512;\n\n/**\n * Matches `ids` against selectors simple enough to evaluate on cached records,\n * with the native engine's semantics; `undefined` means the caller must ask\n * the native engine (any other syntax, foreign documents or parser options).\n */\nexport function matchSimpleSelector(document: NativeDocument, ids: readonly number[], selector: string, options: CheerioOptions): number[] | undefined {\n if (!isRouted(document)) return undefined;\n const compounds = compile(selector);\n if (!compounds) return undefined;\n const isXml = isXmlMode(options);\n const isLowerCaseTags = options.lowerCaseTags ?? !isXml;\n const isLowerCaseAttributes = options.lowerCaseAttributeNames ?? !isXml;\n const result: number[] = [];\n for (const id of ids) {\n const state = stateIn(document, id);\n if (!sameMatchOptions(state.options, isXml, isLowerCaseTags, isLowerCaseAttributes)) return undefined;\n const local = id - state.base;\n for (const compound of compounds) {\n if (matchesCompound(state, local, compound, isLowerCaseTags, isLowerCaseAttributes)) { result.push(id); break; }\n }\n }\n return result;\n}\n\n/** Nodes a single `find()` walks in JavaScript before leaving larger subtrees to the native engine. */\nconst walkBudget = 4096;\n/** Documents small enough that walking all of them in JavaScript beats a native call. */\nconst smallDocumentNodes = 512;\n/** Documents small enough that taking a snapshot to walk them still beats a native call. */\nconst tinyDocumentNodes = 64;\n\n/**\n * Selects the descendants of one element, or of the root of a small\n * document, that match a simple selector, in document order, as the native\n * `select` does; `undefined` defers to it.\n */\nexport function selectSimpleWithin(document: NativeDocument, contexts: readonly number[], selector: string, options: CheerioOptions): number[] | undefined {\n if (contexts.length !== 1 || !isRouted(document)) return undefined;\n const compounds = compile(selector);\n if (!compounds) return undefined;\n const isXml = isXmlMode(options);\n const isLowerCaseTags = options.lowerCaseTags ?? !isXml;\n const isLowerCaseAttributes = options.lowerCaseAttributeNames ?? !isXml;\n const state = stateIn(document, contexts[0]);\n if (!sameMatchOptions(state.options, isXml, isLowerCaseTags, isLowerCaseAttributes)) return undefined;\n const context = contexts[0] - state.base;\n const size = Math.max(state.baseline, state.snapshotSize);\n const isDocumentRoot = context === (state.rootLocal ??= state.raw.rootId());\n const contextType = isDocumentRoot ? 'root' : typeAt(state, context);\n // After a write, walking would cost a fresh snapshot; the native engine reads the arena directly.\n // A walk reads every node: worthwhile with a current snapshot, or when a tiny unchanged document needs one.\n const isReadable = state.bulk instanceof NodeSnapshot ? size <= smallDocumentNodes : state.generation === 0 && size <= tinyDocumentNodes;\n const isSmallRoot = contextType === 'root' && isReadable;\n if (!isElementType(contextType) && !isSmallRoot) return undefined;\n const result: number[] = [];\n const stack: number[] = [];\n pushChildren(state, context, stack);\n for (let visited = 0; stack.length; visited++) {\n if (visited === walkBudget) return undefined;\n const local = stack.pop()!;\n const type = typeAt(state, local);\n // Template contents: outside an element's descendants, but selected from the document root.\n if (type === 'root') { if (isSmallRoot) return undefined; continue; }\n if (isElementType(type)) {\n for (const compound of compounds) {\n if (matchesCompound(state, local, compound, isLowerCaseTags, isLowerCaseAttributes)) { result.push(state.base + local); break; }\n }\n }\n pushChildren(state, local, stack);\n }\n return result;\n}\n\nconst isElementType = (type: string | undefined): boolean => type === 'tag' || type === 'script' || type === 'style';\n\nfunction typeAt(state: DocumentState, local: number): string | undefined {\n const snapshot = structureSnapshot(state, local);\n return snapshot ? snapshot.typeOf(local) : recordAt(state, local)?.type;\n}\n\n/** Pushes children last to first, so they pop in document order. */\nfunction pushChildren(state: DocumentState, local: number, stack: number[]): void {\n const snapshot = structureSnapshot(state, local);\n if (snapshot) {\n for (let index = snapshot.childCount(local) - 1; index >= 0; index--) stack.push(snapshot.childAt(local, index));\n return;\n }\n const children = recordAt(state, local)?.children ?? [];\n for (let index = children.length - 1; index >= 0; index--) stack.push(children[index]);\n}\n\nfunction isXmlMode(options: CheerioOptions): boolean {\n return options.xmlMode ?? (options.xml === true || typeof options.xml === 'object' && options.xml !== null);\n}\n\n/** Records were parsed with the document's options; matching must use the same name casing. */\nfunction sameMatchOptions(documentOptions: CheerioOptions, isXml: boolean, isLowerCaseTags: boolean, isLowerCaseAttributes: boolean): boolean {\n const isDocumentXml = isXmlMode(documentOptions);\n return isDocumentXml === isXml\n && (documentOptions.lowerCaseTags ?? !isDocumentXml) === isLowerCaseTags\n && (documentOptions.lowerCaseAttributeNames ?? !isDocumentXml) === isLowerCaseAttributes;\n}\n\nfunction matchesCompound(state: DocumentState, local: number, compound: Compound, isLowerCaseTags: boolean, isLowerCaseAttributes: boolean): boolean {\n const snapshot = structureSnapshot(state, local);\n const record = snapshot ? undefined : recordAt(state, local);\n if (!snapshot && !record) return false;\n if (!isElementType(snapshot ? snapshot.typeOf(local) : record!.type)) return false;\n if (compound.tag !== undefined && (snapshot ? snapshot.nameOf(local) : record!.name) !== (isLowerCaseTags ? compound.lowerTag : compound.tag)) return false;\n for (const id of compound.ids) if (attributeAt(state, local, 'id') !== id) return false;\n if (compound.classes.length) {\n const classes = attributeAt(state, local, 'class');\n if (classes === undefined) return false;\n for (const name of compound.classes) if (!hasClass(classes, name)) return false;\n }\n for (const name of isLowerCaseAttributes ? compound.lowerAttributes : compound.attributes) if (attributeAt(state, local, name) === undefined) return false;\n return true;\n}\n\nconst isAsciiWhitespace = (code: number): boolean => code === 32 || code === 9 || code === 10 || code === 12 || code === 13;\n\n/** Whether `name` is one of the ASCII-whitespace-separated tokens of `classes`. */\nfunction hasClass(classes: string, name: string): boolean {\n for (let start = classes.indexOf(name); start !== -1; start = classes.indexOf(name, start + 1)) {\n const end = start + name.length;\n if ((start === 0 || isAsciiWhitespace(classes.charCodeAt(start - 1))) && (end === classes.length || isAsciiWhitespace(classes.charCodeAt(end)))) return true;\n }\n return false;\n}\n\nfunction asciiLowerCase(value: string): string {\n return /[A-Z]/.test(value) ? value.replace(/[A-Z]/g, (letter) => letter.toLowerCase()) : value;\n}\n\nfunction compile(selector: string): Compound[] | null {\n const cached = compiled.get(selector);\n if (cached !== undefined) return cached;\n const result = parse(selector);\n if (compiled.size >= compiledLimit) compiled.clear();\n compiled.set(selector, result);\n return result;\n}\n\nconst identifierStart = /[A-Za-z_]/;\nconst identifierPart = /[A-Za-z0-9_-]/;\n\n/** Parses the supported subset; anything else (escapes, combinators, pseudos, values) yields `null`. */\nfunction parse(selector: string): Compound[] | null {\n const compounds: Compound[] = [];\n let index = 0;\n const skipSpace = (): void => { while (index < selector.length && isAsciiWhitespace(selector.charCodeAt(index))) index++; };\n const identifier = (): string | null => {\n const start = index;\n if (selector[index] === '-') index++;\n if (!identifierStart.test(selector[index] ?? '')) return null;\n while (index < selector.length && identifierPart.test(selector[index])) index++;\n return selector.slice(start, index);\n };\n for (;;) {\n skipSpace();\n const compound: Compound = { tag: undefined, lowerTag: undefined, ids: [], classes: [], attributes: [], lowerAttributes: [] };\n let hasPart = false;\n if (selector[index] === '*') { index++; hasPart = true; }\n else if (/[A-Za-z]/.test(selector[index] ?? '')) { compound.tag = identifier()!; hasPart = true; }\n for (;;) {\n const character = selector[index];\n if (character === '#' || character === '.') {\n index++;\n const name = identifier();\n if (name === null) return null;\n (character === '#' ? compound.ids : compound.classes).push(name);\n } else if (character === '[') {\n index++;\n skipSpace();\n const name = identifier();\n if (name === null) return null;\n skipSpace();\n if (selector[index] !== ']') return null;\n index++;\n compound.attributes.push(name);\n } else break;\n hasPart = true;\n }\n if (!hasPart) return null;\n compound.lowerTag = compound.tag === undefined ? undefined : asciiLowerCase(compound.tag);\n compound.lowerAttributes = compound.attributes.map(asciiLowerCase);\n compounds.push(compound);\n skipSpace();\n if (index === selector.length) return compounds;\n if (selector[index] !== ',') return null;\n index++;\n }\n}\n","import type { AnyNode, Document, Element, ParentNode, CheerioAPI, CheerioOptions, AcceptedFilters, BasicAcceptedElems, AcceptedElems, ExtractMap, ExtractedMap } from './types.js';\nimport { requireNative, type NativeDocument } from './native.js';\nimport { getNode, importNodes, nodeBinding, nodeId, nodeRecord, operation, isTag, traverseRecords, viewId } from './nodes.js';\nimport { installAttributes, type AttributeMethods } from './attributes.js';\nimport { extract } from './extract.js';\nimport { API, DOCUMENT, exposeDocumentTo, IDS, IS_PLAIN, LEASE, leaseNodes, prepareBulkViews, routeDocument, sameNodeSpace, updateLease, VALUES, type Lease } from './router.js';\nimport { parse } from './parse.js';\nimport { matchSimpleSelector, selectSimpleWithin } from './match.js';\nconst numeric = /^(?:0|[1-9]\\d*)$/;\nconst isMarkup = (value: string) => /<[a-zA-Z!/?]/.test(value);\nfunction* customPseudoArguments(selector: string, name: string): Generator<string | undefined> {\n let attributeDepth = 0;\n let quote = '';\n for (let index = 0; index < selector.length; index++) {\n const character = selector[index];\n if (character === '\\\\') {\n index++;\n continue;\n }\n if (quote) {\n if (character === quote)\n quote = '';\n continue;\n }\n if (character === '\"' || character === \"'\") {\n quote = character;\n continue;\n }\n if (character === '[') {\n attributeDepth++;\n continue;\n }\n if (character === ']') {\n attributeDepth--;\n continue;\n }\n if (attributeDepth || character !== ':' || selector[index - 1] === ':')\n continue;\n const start = index + 1;\n let end = start;\n while (/[\\w-]/.test(selector[end] ?? '') && end < selector.length)\n end++;\n if (selector.slice(start, end).toLowerCase() !== name.toLowerCase())\n continue;\n index = end - 1;\n if (selector[end] !== '(') {\n yield undefined;\n continue;\n }\n const argumentStart = end + 1;\n let depth = 1;\n let argumentQuote = '';\n for (end++; end < selector.length; end++) {\n const next = selector[end];\n if (next === '\\\\') {\n end++;\n continue;\n }\n if (argumentQuote) {\n if (next === argumentQuote)\n argumentQuote = '';\n continue;\n }\n if (next === '\"' || next === \"'\") {\n argumentQuote = next;\n continue;\n }\n if (next === '(')\n depth++;\n else if (next === ')' && --depth === 0)\n break;\n }\n if (depth)\n continue; // The native selector parser reports malformed syntax.\n yield selector.slice(argumentStart, end);\n index = end;\n }\n}\nconst isIndex = (property: string | symbol): boolean => {\n if (typeof property !== 'string') return false;\n const first = property.charCodeAt(0);\n return first >= 48 && first <= 57 && numeric.test(property);\n};\n/** Results up to this size are plain objects holding their nodes, like Cheerio's own selections. */\nconst plainSelectionLimit = 5;\nconst lengthOf = (target: Cheerio<any>): number => target[VALUES]?.length ?? target[IDS].length;\nfunction nodeAt(target: Cheerio<any>, index: number): any {\n if (target[VALUES]) return target[VALUES][index];\n const id = target[IDS][index];\n return id === undefined ? undefined : getNode(target[DOCUMENT], id);\n}\nfunction releaseIds(target: Cheerio<any>): void {\n if (target[LEASE]) updateLease(target[DOCUMENT], target[LEASE], target[VALUES] ? [] : target[IDS]);\n}\nfunction writeIndex(target: Cheerio<any>, index: number, value: any): void {\n if (target[VALUES]) target[VALUES][index] = value;\n else {\n const id = importNodes(target[DOCUMENT], [value])[0];\n if (id === undefined) {\n target[VALUES] = target[IDS].map((existing) => getNode(target[DOCUMENT], existing));\n target[VALUES][index] = value;\n }\n else target[IDS][index] = id;\n }\n releaseIds(target);\n}\n/** Large selections resolve nodes only when an index is read. */\nconst selectionHandler: ProxyHandler<Cheerio<any>> = {\n get: (target, property) => isIndex(property) ? nodeAt(target, Number(property)) : property === 'length' ? lengthOf(target) : Reflect.get(target, property),\n set: (target, property, value) => {\n if (isIndex(property)) { writeIndex(target, Number(property), value); return true; }\n if (property === 'length') {\n if (target[VALUES]) target[VALUES].length = value;\n else target[IDS].length = value;\n releaseIds(target);\n return true;\n }\n return Reflect.set(target, property, value);\n },\n has: (target, property) => isIndex(property) ? Number(property) < lengthOf(target) : property === 'length' || Reflect.has(target, property),\n ownKeys: (target) => [...Array.from({ length: lengthOf(target) }, (_, i) => String(i)), 'length', ...Reflect.ownKeys(target)],\n getOwnPropertyDescriptor: (target, property) => {\n if (isIndex(property) && Number(property) < lengthOf(target))\n return { value: nodeAt(target, Number(property)), writable: true, configurable: true, enumerable: true };\n if (property === 'length') return { value: lengthOf(target), writable: true, configurable: true, enumerable: true };\n return Reflect.getOwnPropertyDescriptor(target, property);\n },\n deleteProperty: (target, property) => {\n if (isIndex(property)) {\n if (target[VALUES])\n delete target[VALUES][Number(property)];\n else\n delete target[IDS][Number(property)];\n releaseIds(target);\n return true;\n }\n return Reflect.deleteProperty(target, property);\n },\n};\n/** An array-like selection of native nodes. */\nexport class Cheerio<T = AnyNode> implements ArrayLike<T>, Iterable<T> {\n [index: number]: T;\n /** @internal */ declare [DOCUMENT]: NativeDocument;\n /** @internal */ declare [API]: CheerioAPI;\n /** @internal */ declare [IDS]: number[];\n /** @internal */ declare [VALUES]: T[] | undefined;\n /** @internal */ declare [LEASE]: Lease | undefined;\n /** @internal Whether the selection holds its items as own index properties, as Cheerio's selections do. */ declare [IS_PLAIN]: boolean;\n /** @internal */ get _document(): NativeDocument { return this[DOCUMENT]; }\n /** @internal */ get _api(): CheerioAPI { return this[API]; }\n /** @internal */ get _ids(): number[] { return this[IDS]; }\n declare length: number;\n declare options: CheerioOptions;\n declare _root: Cheerio<Document> | null;\n declare prevObject: Cheerio<any> | undefined;\n declare cheerio: '[cheerio object]';\n constructor(api: CheerioAPI, document: NativeDocument, ids: number[] = [], root: Cheerio<Document> | null = null, options: CheerioOptions = {}, values?: T[]) {\n this[DOCUMENT] = document;\n this[API] = api;\n this[IDS] = ids;\n this[VALUES] = values;\n this[LEASE] = undefined;\n const count = values ? values.length : ids.length;\n const isPlain = count <= plainSelectionLimit;\n this[IS_PLAIN] = isPlain;\n // Own keys enumerate in Cheerio's order: length, options, _root.\n if (isPlain) this.length = count;\n this.options = options;\n this._root = root;\n if (isPlain) {\n // Each node object keeps its own node alive, so a plain selection needs no lease.\n if (values) for (let index = 0; index < count; index++) this[index] = values[index];\n else for (let index = 0; index < count; index++) this[index] = getNode(document, ids[index]) as T;\n return;\n }\n if (!values) this[LEASE] = leaseNodes(document, this, ids);\n return new Proxy(this, selectionHandler);\n }\n /** @internal Re-reads a plain selection after direct index writes or after its nodes moved documents. */\n _syncIndices(): void {\n const length = this.length;\n const values = this[VALUES];\n const ids = this[IDS];\n let isChanged = (values ?? ids).length !== length;\n for (let index = 0; !isChanged && index < length; index++) isChanged = values ? this[index] !== values[index] : viewId(this[index]) !== ids[index];\n if (!isChanged) return;\n const items: T[] = Array.from({ length }, (_unused, index) => this[index]);\n const isAllNodes = items.every((value: any) => value && typeof value === 'object' && typeof value.type === 'string');\n this[VALUES] = isAllNodes ? undefined : items;\n this[IDS] = isAllNodes ? importNodes(this[DOCUMENT], items) : [];\n }\n /** @internal */ get ids(): number[] {\n if (this[IS_PLAIN]) this._syncIndices();\n return this[VALUES] ? importNodes(this[DOCUMENT], this[VALUES]) : this[IDS];\n }\n /** @internal */ op<R = any>(command: string, args: unknown = {}): R { const values = args as Record<string, unknown>; return operation<R>(this[DOCUMENT], command, { ...values, options: values.options ?? this.options }); }\n /** @internal */ _query(command: 'select' | 'matches', args: {\n selector: string;\n ids?: number[];\n contexts?: number[];\n options?: CheerioOptions;\n }): number[] {\n const pseudos = this.options.pseudos;\n const callbacks = pseudos ? Object.entries(pseudos).filter((entry): entry is [\n string,\n (element: Element, argument?: string | null) => boolean\n ] => typeof entry[1] === 'function') : [];\n if (!callbacks.length) {\n if (command === 'matches' && args.ids) {\n const matched = matchSimpleSelector(this[DOCUMENT], args.ids, args.selector, args.options ?? this.options);\n if (matched) return matched;\n }\n if (command === 'select' && args.contexts) {\n const found = selectSimpleWithin(this[DOCUMENT], args.contexts, args.selector, args.options ?? this.options);\n if (found) return found;\n }\n return command === 'select' && !args.options ? this[DOCUMENT].select(args.selector, args.contexts) : this.op(command, args);\n }\n const pseudoMatches: Record<string, number[]> = {};\n const candidates = [...new Set([...this[DOCUMENT].select('*'), ...(args.ids ?? []), ...(args.contexts ? this[DOCUMENT].select('*', args.contexts) : [])])];\n for (const [name, callback] of callbacks) {\n for (const argument of customPseudoArguments(args.selector, name)) {\n if (argument !== undefined && callback.length < 2)\n throw new Error(`Pseudo-class :${name} doesn't have any arguments`);\n if (argument === undefined && callback.length >= 2)\n throw new Error(`Pseudo-class :${name} requires an argument`);\n pseudoMatches[`${name}(${argument ?? ''})`] = candidates.filter((id) => callback(getNode(this[DOCUMENT], id) as Element, argument ?? null));\n }\n }\n return this.op(command, { ...args, pseudoMatches });\n }\n /** @internal */ _fromIds<R = AnyNode>(ids: number[]): Cheerio<R> {\n const result = new (this[API].fn.constructor as typeof Cheerio)<R>(this[API], this[DOCUMENT], ids, this._root, this.options);\n result.prevObject = this;\n return result;\n }\n /** @internal */ _fromValues<R>(values: R[]): Cheerio<R> {\n const allNodes = values.every((value: any) => value && typeof value === 'object' && typeof value.type === 'string');\n const result = new (this[API].fn.constructor as typeof Cheerio)<R>(this[API], this[DOCUMENT], allNodes ? importNodes(this[DOCUMENT], values) : [], this._root, this.options, allNodes ? undefined : values);\n result.prevObject = this;\n return result;\n }\n _make<R>(value: ArrayLike<R> | R | string, context?: BasicAcceptedElems<AnyNode>): Cheerio<R>;\n _make<R>(value: any, context?: any): Cheerio<R> {\n const result = typeof value === 'string' || value?.cheerio ? this[API](value, context) : this._fromValues<R>(value == null ? [] : typeof value === 'object' && 'length' in value && !value.type ? Array.from(value) : [value]);\n result.prevObject = this;\n return result as Cheerio<R>;\n }\n _parse(content: any, options: CheerioOptions, isDocument: boolean, context: ParentNode | null): Document {\n return parse(content, options, isDocument, context);\n }\n _render(content: any): string { return this[DOCUMENT].outerHtml(importNodes(this[DOCUMENT], content)); }\n /** @internal */ _domIds(content: any, contextId?: number): number[] {\n if (content == null || content === false)\n return [];\n if (typeof content === 'string')\n return this.op('create', { html: content, contextId, options: this.options });\n if (content?.cheerio) {\n if (!content[DOCUMENT] || !sameNodeSpace(this[DOCUMENT], content[DOCUMENT]))\n return importNodes(this[DOCUMENT], content.toArray());\n exposeDocumentTo(this[DOCUMENT], content[DOCUMENT]);\n return content.ids;\n }\n if (typeof content === 'object' && 'length' in content && !content.type)\n return Array.from(content as ArrayLike<any>).flatMap((item) => this._domIds(item, contextId));\n return importNodes(this[DOCUMENT], [content]);\n }\n _makeDomArray<T extends AnyNode>(this: Cheerio<T>, elem?: BasicAcceptedElems<AnyNode> | BasicAcceptedElems<AnyNode>[], clone?: boolean): AnyNode[];\n _makeDomArray(this: Cheerio<any>, content: any, clone: any = false): any {\n const ids = this._domIds(content);\n return (clone ? this.op<number[]>('clone', { ids, deep: true }) : ids).map((id) => getNode(this[DOCUMENT], id));\n }\n find<T extends AnyNode>(this: Cheerio<T>, selectorOrHaystack?: string | Cheerio<Element> | Element): Cheerio<Element>;\n find(this: Cheerio<any>, selector?: any): any {\n if (!selector)\n return this._fromIds([]);\n if (typeof selector === 'string')\n return this._findBySelector(selector, Infinity);\n const ids = importNodes(this[DOCUMENT], selector);\n return this._fromIds(ids.filter((id) => this.ids.some((container) => this.op<boolean>('contains', { container, contained: id }))));\n }\n _findBySelector<T extends AnyNode>(this: Cheerio<T>, selector: string, limit: number): Cheerio<Element>;\n _findBySelector(this: Cheerio<any>, selector: any, limit: any): any {\n const ids = this._query('select', { selector, contexts: this.ids });\n return this._fromIds(Number.isFinite(limit) ? ids.slice(0, limit) : ids);\n }\n /** @internal */ _filterIds(ids: number[], selector?: any): number[] {\n if (!selector)\n return ids;\n if (typeof selector === 'string')\n return this._query('matches', { ids, selector, options: this.options });\n return ids.filter((id, index) => this._predicate(selector, getNode(this[DOCUMENT], id), index));\n }\n /** @internal */ _predicate(selector: any, node: any, index: number): boolean {\n if (typeof selector === 'function')\n return !!selector.call(node, index, node);\n if (typeof selector === 'string')\n return this._query('matches', { ids: importNodes(this[DOCUMENT], [node]), selector, options: this.options }).length > 0;\n if (selector?.cheerio)\n return selector.toArray().includes(node);\n return node === selector;\n }\n /** @internal */ _traverse(kind: string, selector?: any): Cheerio<Element> {\n let ids = traverseRecords(this[DOCUMENT], this.ids, kind) ?? this.op<number[]>('traverse', { ids: this.ids, kind });\n ids = this._filterIds(ids, selector);\n if (this.length > 1 && ids.length > 1) {\n if (kind === 'parents' || kind === 'siblings')\n ids = this.op('uniqueSort', { ids });\n else if (!['next', 'prev', 'contents'].includes(kind))\n ids = [...new Set(ids)];\n if (kind === 'parents')\n ids.reverse();\n }\n return this._fromIds(ids);\n }\n parent<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n parent(this: Cheerio<any>, selector?: any): any { return this._traverse('parent', selector); }\n parents<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n parents(this: Cheerio<any>, selector?: any): any { return this._traverse('parents', selector); }\n next<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n next(this: Cheerio<any>, selector?: any): any { return this._traverse('next', selector); }\n prev<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n prev(this: Cheerio<any>, selector?: any): any { return this._traverse('prev', selector); }\n nextAll<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n nextAll(this: Cheerio<any>, selector?: any): any { return this._traverse('nextAll', selector); }\n prevAll<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n prevAll(this: Cheerio<any>, selector?: any): any { return this._traverse('prevAll', selector); }\n siblings<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n siblings(this: Cheerio<any>, selector?: any): any { return this._traverse('siblings', selector); }\n children<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n children(this: Cheerio<any>, selector?: any): any { return this._traverse('children', selector); }\n contents<T extends AnyNode>(this: Cheerio<T>): Cheerio<AnyNode>;\n contents(this: Cheerio<any>): any { return this._traverse('contents') as any; }\n /** @internal */ _until(kind: string, until?: any, filter?: any): Cheerio<Element> {\n let ids: number[] = [];\n for (const id of this.ids)\n for (const candidate of traverseRecords(this[DOCUMENT], [id], kind) ?? this.op<number[]>('traverse', { ids: [id], kind })) {\n if (until && this._predicate(until, getNode(this[DOCUMENT], candidate), ids.length))\n break;\n ids.push(candidate);\n }\n ids = this._filterIds(ids, filter);\n if (this.length > 1 && ids.length > 1)\n ids = kind === 'parents' ? this.op<number[]>('uniqueSort', { ids }).reverse() : [...new Set(ids)];\n return this._fromIds(ids);\n }\n parentsUntil<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element> | null, filterSelector?: AcceptedFilters<Element>): Cheerio<Element>;\n parentsUntil(this: Cheerio<any>, until?: any, filter?: any): any { return this._until('parents', until, filter); }\n nextUntil<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element> | null, filterSelector?: AcceptedFilters<Element>): Cheerio<Element>;\n nextUntil(this: Cheerio<any>, until?: any, filter?: any): any { return this._until('nextAll', until, filter); }\n prevUntil<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element> | null, filterSelector?: AcceptedFilters<Element>): Cheerio<Element>;\n prevUntil(this: Cheerio<any>, until?: any, filter?: any): any { return this._until('prevAll', until, filter); }\n closest<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<AnyNode>;\n closest(this: Cheerio<any>, selector?: any): any {\n if (!selector)\n return this._fromIds([]);\n const result: number[] = [];\n for (const id of this.ids) {\n const record = nodeRecord(this[DOCUMENT], id);\n const candidates = [...(['tag', 'script', 'style'].includes(record.type) ? [id] : []), ...(traverseRecords(this[DOCUMENT], [id], 'parents') ?? this.op<number[]>('traverse', { ids: [id], kind: 'parents' }))];\n // One native match for all candidates replaces a round trip per ancestor.\n const matched = typeof selector === 'string' ? new Set(this._filterIds(candidates, selector)) : undefined;\n const match = matched ? candidates.find((candidate) => matched.has(candidate)) : candidates.find((candidate) => this._predicate(selector, getNode(this[DOCUMENT], candidate), 0));\n if (match !== undefined && !result.includes(match))\n result.push(match);\n }\n return this._fromIds(result);\n }\n each<T>(this: Cheerio<T>, fn: (this: T, i: number, el: T) => void | boolean): Cheerio<T>;\n each(this: Cheerio<any>, callback: any): any {\n if (this[IS_PLAIN]) {\n const length = this.length;\n for (let i = 0; i < length; i++)\n if (callback.call(this[i], i, this[i]) === false)\n break;\n return this;\n }\n // Reading ids directly avoids a string-keyed proxy trap per index.\n const values = this[VALUES], ids = this[IDS], document = this[DOCUMENT];\n const length = values ? values.length : ids.length;\n for (let i = 0; i < length; i++) {\n const node = values ? values[i] : getNode(document, ids[i]);\n if (callback.call(node, i, node) === false)\n break;\n }\n return this;\n }\n map<T, M>(this: Cheerio<T>, fn: (this: T, i: number, el: T) => M[] | M | null | undefined): Cheerio<M>;\n map<R>(this: Cheerio<any>, callback: any): any {\n const result: R[] = [];\n const items = this._items();\n for (let i = 0; i < items.length; i++) {\n const value = callback.call(items[i], i, items[i]);\n if (value != null)\n result.push(...(Array.isArray(value) ? value : [value]));\n }\n return this._fromValues(result);\n }\n filter<T, S extends T>(this: Cheerio<T>, match: (this: T, index: number, value: T) => value is S): Cheerio<S>;\n filter<T, S extends AcceptedFilters<T>>(this: Cheerio<T>, match: S): Cheerio<S extends string ? Element : T>;\n filter<S extends AcceptedFilters<T>>(this: Cheerio<any>, selector: any): any {\n return (typeof selector === 'string' ? this._fromIds(this._query('matches', { ids: this.ids, selector, options: this.options })) : this._fromValues(this.toArray().filter((node, i) => this._predicate(selector, node, i)))) as any;\n }\n filterArray<T>(nodes: T[], match: AcceptedFilters<T>, xmlMode?: boolean, root?: Document): Element[] | T[];\n filterArray<R>(this: Cheerio<any>, nodes: any, match: any, xmlMode?: any, root?: any): any {\n const matcher: any = match;\n if (typeof match !== 'string')\n return nodes.filter((node: any, index: number) => typeof matcher === 'function' ? matcher.call(node, index, node) : matcher?.cheerio ? matcher.toArray().includes(node) : matcher === node);\n const document = this?.[DOCUMENT] ?? nodeBinding(root)?.document ?? nodeBinding(nodes[0])?.document ?? routeDocument(new (requireNative().NativeDocument)('', false));\n const ids = importNodes(document, nodes);\n const selected = new Set(operation<number[]>(document, 'matches', { ids, selector: match, options: { xmlMode } }));\n return nodes.filter((node: any) => { const id = nodeId(node, document); return id !== undefined && selected.has(id); });\n }\n not<T extends AnyNode>(this: Cheerio<T>, match: AcceptedFilters<T>): Cheerio<T>;\n not(this: Cheerio<any>, selector: any): any {\n if (typeof selector === 'string') {\n const matched = new Set(this._query('matches', { ids: this.ids, selector, options: this.options }));\n return this._fromIds(this.ids.filter((id) => !matched.has(id)));\n }\n return this._fromValues(this.toArray().filter((node, i) => !this._predicate(selector, node, i)));\n }\n is<T>(this: Cheerio<T>, selector?: AcceptedFilters<T>): boolean;\n is(this: Cheerio<any>, selector?: any): any {\n return typeof selector === 'string' ? this._query('matches', { ids: this.ids, selector, options: this.options }).length > 0 : !!selector && this.toArray().some((node, i) => this._predicate(selector, node, i));\n }\n has(this: Cheerio<AnyNode | Element>, selectorOrHaystack: string | Cheerio<Element> | Element): Cheerio<AnyNode | Element>;\n has(this: Cheerio<any>, selector: any): any { return this.filter(((_i: number, node: any) => this._make(node).find(selector).length > 0) as any) as Cheerio<T>; }\n first<T extends AnyNode>(this: Cheerio<T>): Cheerio<T>;\n first(this: Cheerio<any>): any { return this.length > 1 ? this.slice(0, 1) : this; }\n last<T>(this: Cheerio<T>): Cheerio<T>;\n last(this: Cheerio<any>): any { return this.length > 0 ? this.slice(-1) : this; }\n eq<T>(this: Cheerio<T>, i: number): Cheerio<T>;\n eq(this: Cheerio<any>, index: any): any {\n index = +index;\n if (index === 0 && this.length <= 1)\n return this;\n if (index < 0)\n index += this.length;\n const item = this._itemAt(index);\n return this._fromValues(item === undefined ? [] : [item]);\n }\n get<T>(this: Cheerio<T>, i: number): T | undefined;\n get<T>(this: Cheerio<T>): T[];\n get(this: Cheerio<any>, index?: any): any { return index == null ? this.toArray() : this._itemAt(index < 0 ? this.length + index : index); }\n toArray<T>(this: Cheerio<T>): T[];\n toArray(this: Cheerio<any>): any { return this._items(); }\n /** @internal Every item, read without a proxy trap per index. */\n _items(): T[] {\n if (this[IS_PLAIN]) {\n const length = this.length;\n const items: T[] = new Array(length);\n for (let i = 0; i < length; i++) items[i] = this[i];\n return items;\n }\n const values = this[VALUES], ids = this[IDS], document = this[DOCUMENT];\n if (!values) prepareBulkViews(document, ids);\n return values ? values.slice() : ids.map((id) => getNode(document, id) as T);\n }\n /** @internal */ _itemAt(index: number): T | undefined {\n if (this[IS_PLAIN]) return this[index];\n const values = this[VALUES];\n if (values) return values[index];\n const id = this[IDS][index];\n return id === undefined ? undefined : getNode(this[DOCUMENT], id) as T;\n }\n slice<T>(this: Cheerio<T>, start?: number, end?: number): Cheerio<T>;\n slice(this: Cheerio<any>, start?: any, end?: any): any { const ids = this.ids; return this[VALUES] ? this._fromValues(this[VALUES].slice(start, end)) : this._fromIds(ids.slice(start, end)); }\n end<T>(this: Cheerio<T>): Cheerio<AnyNode>;\n end(this: Cheerio<any>): any { return this.prevObject ?? this._make([]); }\n add<S extends AnyNode, T extends AnyNode>(this: Cheerio<T>, other: string | Cheerio<S> | S | S[], context?: Cheerio<S> | string): Cheerio<S | T>;\n add<R extends AnyNode>(this: Cheerio<any>, other: any, context?: any): any {\n const added = this[API](other, context);\n // Ids of another copy of the package belong to its own id space.\n const addedIds = added[DOCUMENT] && sameNodeSpace(this[DOCUMENT], added[DOCUMENT]) ? added.ids : importNodes(this[DOCUMENT], added.toArray());\n return this._fromIds(this.op('uniqueSort', { ids: [...this.ids, ...addedIds] }));\n }\n addBack<T extends AnyNode>(this: Cheerio<T>, selector?: string): Cheerio<AnyNode>;\n addBack(this: Cheerio<any>, selector?: any): any { return this.prevObject ? this.add(selector ? this.prevObject.filter(selector) : this.prevObject) as any : this as any; }\n index<T extends AnyNode>(this: Cheerio<T>, selectorOrNeedle?: string | Cheerio<AnyNode> | AnyNode): number;\n index(this: Cheerio<any>, selector?: any): any { const haystack = selector == null ? this.parent().children() : typeof selector === 'string' ? this[API](selector) : this; const needle = selector == null || typeof selector === 'string' ? this[0] : selector?.cheerio ? selector[0] : selector; return haystack.toArray().indexOf(needle); }\n splice(start: number, deleteCount?: number): any[];\n splice(start: number, deleteCount: number, ...items: any[]): any[];\n splice(...args: any[]): any[] { return Reflect.apply(Array.prototype.splice, this, args); }\n [Symbol.iterator](): Iterator<T>;\n [Symbol.iterator](): IterableIterator<T> { return this._items()[Symbol.iterator](); }\n /** @internal */ _insert(position: string, content: any[]): this {\n if (typeof content[0] !== 'function') {\n // The native insert skips targets that cannot hold children, and\n // only the last listed target receives the nodes themselves.\n const ids = this.ids;\n if (ids.length) this.op('insert', { targetIds: ids, nodeIds: this._domIds(content), position });\n return this;\n }\n const targets = this.ids.filter((id) => ['root', 'tag', 'script', 'style', 'cdata'].includes(nodeRecord(this[DOCUMENT], id).type));\n if (!targets.length)\n return this;\n return (this as Cheerio<any>).each((index, node: any) => {\n if (!targets.includes(this.ids[index]))\n return;\n if ((position === 'before' || position === 'after') && nodeRecord(this[DOCUMENT], this.ids[index]).parent == null)\n return;\n const value = content[0].call(node, index, this[DOCUMENT].innerHtml(this.ids[index]));\n let nodes = this._domIds(value);\n if (index < this.length - 1)\n nodes = this.op('clone', { ids: nodes, deep: true });\n this.op('insert', { targetIds: [this.ids[index]], nodeIds: nodes, position });\n }) as this;\n }\n append<T extends AnyNode>(this: Cheerio<T>, ...elems: [\n (this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>\n ] | BasicAcceptedElems<AnyNode>[]): Cheerio<T>;\n append(this: Cheerio<any>, ...content: any[]): any { return this._insert('append', content); }\n prepend<T extends AnyNode>(this: Cheerio<T>, ...elems: [\n (this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>\n ] | BasicAcceptedElems<AnyNode>[]): Cheerio<T>;\n prepend(this: Cheerio<any>, ...content: any[]): any { return this._insert('prepend', content); }\n before<T extends AnyNode>(this: Cheerio<T>, ...elems: [\n (this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>\n ] | BasicAcceptedElems<AnyNode>[]): Cheerio<T>;\n before(this: Cheerio<any>, ...content: any[]): any { return this._insert('before', content); }\n after<T extends AnyNode>(this: Cheerio<T>, ...elems: [\n (this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>\n ] | BasicAcceptedElems<AnyNode>[]): Cheerio<T>;\n after(this: Cheerio<any>, ...content: any[]): any { return this._insert('after', content); }\n appendTo<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;\n appendTo(this: Cheerio<any>, target: any): any { this[API](target).append(this); return this; }\n prependTo<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;\n prependTo(this: Cheerio<any>, target: any): any { this[API](target).prepend(this); return this; }\n /** @internal */ _insertRelative(target: any, position: string): Cheerio<T> {\n const targets = this[API](target).ids;\n (this as Cheerio<any>).remove();\n const inserted: number[] = [];\n for (const id of targets) {\n if (nodeRecord(this[DOCUMENT], id).parent == null)\n continue;\n const clones = this.op<number[]>('clone', { ids: this.ids, deep: true });\n this.op('insert', { targetIds: [id], nodeIds: clones, position });\n inserted.push(...clones);\n }\n return this._fromIds(inserted);\n }\n insertBefore<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;\n insertBefore(this: Cheerio<any>, target: any): any { return this._insertRelative(target, 'before'); }\n insertAfter<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;\n insertAfter(this: Cheerio<any>, target: any): any { return this._insertRelative(target, 'after'); }\n remove<T extends AnyNode>(this: Cheerio<T>, selector?: string): Cheerio<T>;\n remove(this: Cheerio<any>, selector?: any): any { this.op('remove', { ids: selector ? this.filter(selector).ids : this.ids }); return this; }\n replaceWith<T extends AnyNode>(this: Cheerio<T>, content: AcceptedElems<AnyNode>): Cheerio<T>;\n replaceWith(this: Cheerio<any>, content: any): any {\n return this.each((index, node: any) => {\n if (nodeRecord(this[DOCUMENT], this.ids[index]).parent == null)\n return;\n const value = typeof content === 'function' ? content.call(node, index, node) : content;\n this.op('insert', { targetIds: [this.ids[index]], nodeIds: this._domIds(value), position: 'replace' });\n });\n }\n empty<T extends AnyNode>(this: Cheerio<T>): Cheerio<T>;\n empty(this: Cheerio<any>): any {\n for (const id of this.ids)\n this.op('setNode', { id, field: 'children', value: [] });\n return this;\n }\n html<T extends AnyNode>(this: Cheerio<T>): string | null;\n html<T extends AnyNode>(this: Cheerio<T>, str: string | Cheerio<T>): Cheerio<T>;\n html(this: Cheerio<any>, content?: any): any {\n if (content === undefined)\n return this.length && ['root', 'tag', 'script', 'style', 'cdata'].includes(nodeRecord(this[DOCUMENT], this.ids[0]).type) ? this[DOCUMENT].innerHtml(this.ids[0]) : null;\n if (!content?.cheerio) {\n this.op('html', { ids: this.ids, value: String(content) });\n return this;\n }\n for (const id of this.ids) {\n const nodes = content?.cheerio ? importNodes(this[DOCUMENT], content.toArray()) : this._domIds(String(content), id);\n this.op('setNode', { id, field: 'children', value: nodes });\n }\n return this;\n }\n text<T extends AnyNode>(this: Cheerio<T>): string;\n text<T extends AnyNode>(this: Cheerio<T>, str: string | ((this: AnyNode, i: number, text: string) => string)): Cheerio<T>;\n text(this: Cheerio<any>, content?: any): any {\n if (content === undefined)\n return this[DOCUMENT].text(this.ids);\n if (typeof content !== 'function') {\n this.op('text', { ids: this.ids, value: String(content) });\n return this;\n }\n for (let i = 0; i < this.ids.length; i++) {\n const id = this.ids[i];\n const value = typeof content === 'function' ? content.call(getNode(this[DOCUMENT], id), i, this[DOCUMENT].text([id])) : content;\n this.op('text', { ids: [id], value: String(value) });\n }\n return this;\n }\n toString<T extends AnyNode>(this: Cheerio<T>): string;\n toString(this: Cheerio<any>): any { return this[DOCUMENT].outerHtml(this.ids); }\n clone<T extends AnyNode>(this: Cheerio<T>): Cheerio<T>;\n clone(this: Cheerio<any>): any { return this._fromIds(this.op('clone', { ids: this.ids, deep: true })); }\n /** @internal */ _deepest(id: number, tagsOnly = false): number {\n for (;;) {\n const children = this.op<number[]>('traverse', { ids: [id], kind: 'children' });\n const child = tagsOnly ? children.find((candidate) => nodeRecord(this[DOCUMENT], candidate).type === 'tag') : children[0];\n if (child === undefined)\n return id;\n id = child;\n }\n }\n /** @internal */ _wrap(content: any, inner: boolean): this {\n const lastParent = (this as Cheerio<any>).parents().last();\n for (let i = 0; i < this.length; i++) {\n const id = this.ids[i];\n const node = getNode(this[DOCUMENT], id);\n const value = typeof content === 'function' ? content.call(node, i, node) : typeof content === 'string' && !isMarkup(content) ? lastParent.find(content).clone() : content;\n let wrappers = this._domIds(value);\n if (i < this.length - 1)\n wrappers = this.op('clone', { ids: wrappers, deep: true });\n const wrapper = wrappers[0];\n if (wrapper === undefined || !['root', 'tag', 'script', 'style'].includes(nodeRecord(this[DOCUMENT], wrapper).type))\n continue;\n if (inner) {\n if (!['root', 'tag', 'script', 'style', 'cdata'].includes(nodeRecord(this[DOCUMENT], id).type))\n continue;\n const contents = this.op<number[]>('traverse', { ids: [id], kind: 'contents' });\n this.op('setNode', { id: this._deepest(wrapper), field: 'children', value: contents });\n this.op('setNode', { id, field: 'children', value: [wrapper] });\n }\n else if (nodeRecord(this[DOCUMENT], id).parent != null) {\n // A wrapper from another document gets new ids when the insertion moves it here.\n const [inserted = wrapper] = this.op<number[]>('insert', { targetIds: [id], nodeIds: [wrapper], position: 'before' });\n this.op('setNode', { id: this._deepest(inserted), field: 'children', value: [id] });\n }\n }\n return this;\n }\n wrap<T extends AnyNode>(this: Cheerio<T>, wrapper: AcceptedElems<AnyNode>): Cheerio<T>;\n wrap(this: Cheerio<any>, content: any): any { return this._wrap(content, false); }\n wrapInner<T extends AnyNode>(this: Cheerio<T>, wrapper: AcceptedElems<AnyNode>): Cheerio<T>;\n wrapInner(this: Cheerio<any>, content: any): any { return this._wrap(content, true); }\n unwrap<T extends AnyNode>(this: Cheerio<T>, selector?: string): Cheerio<T>;\n unwrap(this: Cheerio<any>, selector?: any): any { this.op('remove', { ids: this.parent(selector).not('body').ids, keepChildren: true }); return this; }\n wrapAll<T extends AnyNode>(this: Cheerio<T>, wrapper: AcceptedElems<T>): Cheerio<T>;\n wrapAll(this: Cheerio<any>, content: any): any {\n if (!this.length)\n return this;\n const first = this[0];\n const wrappers = this._make(typeof content === 'function' ? content.call(first, 0, first) : content).insertBefore(first);\n const root = [...wrappers.ids].reverse().find((id) => nodeRecord(this[DOCUMENT], id).type === 'tag');\n if (root !== undefined)\n this.op('insert', { targetIds: [this._deepest(root, true)], nodeIds: this.ids, position: 'append' });\n return this;\n }\n extract<M extends ExtractMap, T extends AnyNode>(this: Cheerio<T>, map: M): ExtractedMap<M>;\n // A structurally shared object signature breaks recursive enum comparisons\n // across independent DOM declarations; calls retain the precise overload.\n extract<M extends ExtractMap, T extends AnyNode>(this: Cheerio<T>, map: M): Record<string, unknown>;\n extract<M extends ExtractMap>(this: Cheerio<any>, map: any): any { return extract.call(this as any, map) as ExtractedMap<M>; }\n}\nObject.defineProperty(Cheerio.prototype, 'cheerio', { value: '[cheerio object]', writable: true, configurable: true });\nconst inspectCustom = Symbol.for('nodejs.util.inspect.custom');\n// Inspection shows the selection's own string keys, as Cheerio's selections\n// have, without the internals stored under symbols.\nObject.defineProperty(Cheerio.prototype, inspectCustom, {\n configurable: true, writable: true,\n value(this: Cheerio<any>, depth: number, options: { stylize(text: string, style: string): string }, inspect: (value: unknown, options: object) => string): string {\n const prototype = Object.getPrototypeOf(this);\n if (depth < 0) return options.stylize(`[${prototype.constructor.name}]`, 'special');\n const shown: Record<string | symbol, unknown> = Object.create(prototype);\n Object.defineProperty(shown, inspectCustom, { value: undefined });\n for (const key of Object.keys(this)) shown[key] = (this as any)[key];\n return inspect(shown, { ...options, depth });\n },\n});\nexport interface Cheerio<T = AnyNode> extends AttributeMethods<T> {\n}\ninstallAttributes(Cheerio);\n\n/** @internal */\nexport const nativeExtractionMethods = Object.freeze({\n make: Cheerio.prototype._make,\n find: Cheerio.prototype._findBySelector,\n prop: Cheerio.prototype.prop,\n extract: Cheerio.prototype.extract,\n});\n","import { Cheerio, nativeExtractionMethods } from './selection.js';\nimport { types } from 'node:util';\nimport { compileExtractPlan, hydrateExtractResult } from './extract-plan.js';\nimport { decodeJson } from './codec.js';\nimport { DOCUMENT, writeCount } from './router.js';\nimport type { AnyNode, CheerioOptions, Element, ExtractMap, ExtractedMap, ExtractDescriptor } from './types.js';\n\ntype ExtractPlan = NonNullable<ReturnType<typeof compileExtractPlan>>;\n\nexport interface ExtractMethods<T = AnyNode> {\n extract<M extends ExtractMap>(map: M): ExtractedMap<M>;\n}\n\nfunction plainKeys(map: ExtractMap): string[] | undefined {\n return !types.isProxy(map) && (Object.getPrototypeOf(map) === Object.prototype || Object.getPrototypeOf(map) === null) ? Object.keys(map) : undefined;\n}\nfunction nativePrefix(scope: Cheerio<AnyNode>, map: ExtractMap, keys: string[] | undefined, key: string): { keys: string[]; values: Record<string, unknown> } | undefined {\n if (!keys || !hasNativeExtraction(scope)) return undefined;\n const prefix = prefixPlan(map, keys, key, scope.options);\n // A single scalar entry costs one selector call and one property call; the\n // native plan also avoids constructing an intermediate selection for each.\n if (!prefix) return undefined;\n return { keys: prefix.names, values: runPlan(scope, prefix.plan) };\n}\n\n/** The native plan for the longest run of entries from `key` on that compile to one. */\nfunction prefixPlan(map: ExtractMap, keys: string[], key: string, options: CheerioOptions): { names: string[]; plan: ExtractPlan } | undefined {\n // Pure maps are the common case. Compile the complete plan once instead of\n // recompiling each growing prefix; callbacks and inherited entries keep the\n // incremental path so they retain their observable order.\n if (keys[0] === key && keys.every((name) => {\n const slot = Object.getOwnPropertyDescriptor(map, name);\n return !!slot && slot.enumerable && 'value' in slot;\n })) {\n let count = 0;\n let sameKeys = true;\n for (const name in map) { if (name !== keys[count++]) { sameKeys = false; break; } }\n if (sameKeys && count === keys.length) {\n const complete = compileExtractPlan(map, options);\n if (complete) return { names: keys, plan: complete };\n }\n }\n const prefix: ExtractMap = Object.create(null);\n let plan: ExtractPlan | undefined;\n for (let position = keys.indexOf(key); position < keys.length; position++) {\n const name = keys[position];\n const slot = Object.getOwnPropertyDescriptor(map, name);\n if (!slot || !slot.enumerable || !('value' in slot)) break;\n Object.defineProperty(prefix, name, { value: slot.value, enumerable: true, configurable: true });\n const compiled = compileExtractPlan(prefix, options);\n if (!compiled) { delete prefix[name]; break; }\n plan = compiled;\n }\n return plan ? { names: Object.keys(prefix), plan } : undefined;\n}\n\nfunction hasNativeExtraction(scope: Cheerio<AnyNode>): boolean {\n return scope._make === nativeExtractionMethods.make && scope._findBySelector === nativeExtractionMethods.find && scope.prop === nativeExtractionMethods.prop && scope.extract === nativeExtractionMethods.extract;\n}\n\n/** Descriptor callbacks stay in JavaScript; matching and properties use Rust. */\nexport function extract<M extends ExtractMap>(this: Cheerio<AnyNode>, map: M): ExtractedMap<M> {\n const result: Record<string, unknown> = {};\n const keys = plainKeys(map);\n const processed = new Set<string>();\n for (const key in map) {\n if (processed.has(key)) continue;\n const prefix = Object.getPrototypeOf(result) === Object.prototype ? nativePrefix(this, map, keys, key) : undefined;\n if (prefix) {\n for (const name of prefix.keys) { Object.defineProperty(result, name, { value: prefix.values[name], enumerable: true, configurable: true, writable: true }); processed.add(name); }\n continue;\n }\n const entry = map[key];\n const all = Array.isArray(entry);\n const descriptor = (all ? entry[0] : entry) as string | ExtractDescriptor;\n const selector = typeof descriptor === 'string' ? descriptor : descriptor.selector;\n const value = typeof descriptor === 'string' ? 'textContent' : descriptor.value ?? 'textContent';\n const selection = this._findBySelector(selector, all ? Infinity : 1);\n const rows = typeof value === 'object' ? nativeRows(this, key, all, selector, value) : undefined;\n const read = (index: number) => {\n if (typeof value === 'function') return value(selection[index] as Element, key, result);\n const scope = this._make === nativeExtractionMethods.make\n ? this._fromIds([selection.ids[index]])\n : this._make(selection[index]);\n if (typeof value === 'string') return scope.prop(value);\n return rows ? completeRow(scope, value, rows, index) : scope.extract(value);\n };\n let extracted: unknown;\n if (all) {\n const values: unknown[] = [];\n for (let index = 0; index < selection.length; index += 1) {\n const value = read(index);\n if (value != null) values.push(...(Array.isArray(value) ? value : [value]));\n }\n extracted = values;\n } else {\n extracted = selection.length ? read(0) : undefined;\n }\n result[key] = extracted;\n }\n return result as ExtractedMap<M>;\n}\n\n/** Fields of each row that the native engine extracts, for every row in one call. */\ninterface NativeRows { keys: Set<string>; rows: Record<string, unknown>[]; writes: number }\n\n/**\n * For a nested map with callbacks, extracts the fields the native engine can\n * for every matched element in one call, instead of one call per element;\n * the remaining fields are then filled in map order, so each callback sees\n * exactly the fields before it, as in Cheerio.\n */\nfunction nativeRows(scope: Cheerio<AnyNode>, key: string, all: boolean, selector: string, map: ExtractMap): NativeRows | undefined {\n if (!hasNativeExtraction(scope)) return undefined;\n const planned = rowsPlan(key, all, selector, map, scope.options);\n if (!planned) return undefined;\n const writes = writeCount();\n const extracted = runPlan(scope, planned.plan)[key];\n const rows = (all ? extracted : extracted === undefined ? [] : [extracted]) as Record<string, unknown>[];\n return Array.isArray(rows) ? { keys: planned.nativeKeys, rows, writes } : undefined;\n}\n\n/** The native plan for the fields of `map` that compile to one, when only some do. */\nfunction rowsPlan(key: string, all: boolean, selector: string, map: ExtractMap, options: CheerioOptions): { nativeKeys: Set<string>; plan: ExtractPlan } | undefined {\n const keys = plainKeys(map);\n if (!keys) return undefined;\n const subset: ExtractMap = Object.create(null);\n const nativeKeys = new Set<string>();\n for (const name of keys) {\n const slot = Object.getOwnPropertyDescriptor(map, name);\n if (!slot || !slot.enumerable || !('value' in slot)) continue;\n const single: ExtractMap = Object.create(null);\n Object.defineProperty(single, name, { value: slot.value, enumerable: true, configurable: true });\n if (!compileExtractPlan(single, options)) continue;\n Object.defineProperty(subset, name, { value: slot.value, enumerable: true, configurable: true });\n nativeKeys.add(name);\n }\n if (!nativeKeys.size || nativeKeys.size === keys.length) return undefined;\n const outer: ExtractMap = Object.create(null);\n Object.defineProperty(outer, key, { value: all ? [{ selector, value: subset }] : { selector, value: subset }, enumerable: true, configurable: true });\n const plan = compileExtractPlan(outer, options);\n return plan ? { nativeKeys, plan } : undefined;\n}\n\n/**\n * The plans a walk of `map` from a document's root runs first, in order, so\n * a batch can run them on its parsing threads. Callbacks may change the\n * document, so later plans of the walk stay on the calling thread.\n */\nexport function rootExtractPlans(map: ExtractMap, options: CheerioOptions): ExtractPlan[] {\n // Reading a map ahead of the walk must not run code the walk would run in\n // a different order, and a malformed map fails later with the walk's own error.\n if (!isPlainData(map, 0) || hasInheritedEntryFields()) return [];\n try { return collectRootExtractPlans(map, options); } catch { return []; }\n}\n\n/** Whether reading `value` and everything it holds runs no code: no proxies, accessors or class instances. */\nfunction isPlainData(value: unknown, depth: number): boolean {\n if (typeof value !== 'object' || value === null) return true;\n if (depth > 32 || types.isProxy(value)) return false;\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== Array.prototype && prototype !== null) return false;\n for (const key of Reflect.ownKeys(value)) {\n const slot = Object.getOwnPropertyDescriptor(value, key)!;\n if (!('value' in slot) || !isPlainData(slot.value, depth + 1)) return false;\n }\n return true;\n}\n\nfunction hasInheritedEntryFields(): boolean {\n return 'selector' in Object.prototype || 'value' in Object.prototype || '0' in Array.prototype;\n}\n\nfunction collectRootExtractPlans(map: ExtractMap, options: CheerioOptions): ExtractPlan[] {\n const plans: ExtractPlan[] = [];\n const keys = plainKeys(map);\n const processed = new Set<string>();\n for (const key in map) {\n if (processed.has(key)) continue;\n const prefix = keys ? prefixPlan(map, keys, key, options) : undefined;\n if (prefix) {\n for (const name of prefix.names) processed.add(name);\n plans.push(prefix.plan);\n continue;\n }\n const entry = map[key];\n const all = Array.isArray(entry);\n const descriptor = (all ? entry[0] : entry) as string | ExtractDescriptor;\n const value = typeof descriptor === 'string' ? 'textContent' : descriptor.value ?? 'textContent';\n if (typeof value !== 'object' || value === null) continue;\n const planned = rowsPlan(key, all, typeof descriptor === 'string' ? descriptor : descriptor.selector, value, options);\n if (planned) plans.push(planned.plan);\n }\n return plans.filter((plan) => !JSON.stringify(plan).includes('innerHTML'));\n}\n\n/** Results of root plans a batch ran while parsing, valid while no document changes. */\nconst preparedPlans = new WeakMap<object, { writes: number; results: Map<string, string> }>();\n\nexport function prepareExtractPlans(document: object, plans: ExtractPlan[], results: (string | null)[] | null | undefined): void {\n if (!results) return;\n const prepared = new Map<string, string>();\n for (let index = 0; index < plans.length; index++) {\n const result = results[index];\n if (typeof result === 'string') prepared.set(JSON.stringify(plans[index]), decodeJson(result));\n }\n preparedPlans.set(document, { writes: writeCount(), results: prepared });\n}\n\nexport function releaseExtractPlans(document: object): void {\n preparedPlans.delete(document);\n}\n\nfunction runPlan(scope: Cheerio<AnyNode>, plan: ExtractPlan): Record<string, unknown> {\n const document = scope[DOCUMENT] as { rootId(): number };\n const prepared = preparedPlans.get(document);\n const isRoot = prepared !== undefined && prepared.writes === writeCount() && scope.ids.length === 1 && scope.ids[0] === document.rootId();\n const result = isRoot ? prepared.results.get(JSON.stringify(plan)) : undefined;\n const values = result !== undefined ? JSON.parse(result) as Record<string, unknown> : scope.op<Record<string, unknown>>('extractPlan', { ids: scope.ids, plan });\n hydrateExtractResult(values, plan.entries);\n return values;\n}\n\n/**\n * Builds row `index` of a nested map from its native fields and the scope's\n * JavaScript fields. Native fields extracted before a callback changed any\n * document are extracted again, as extracting row by row would see them.\n */\nfunction completeRow(scope: Cheerio<AnyNode>, map: ExtractMap, rows: NativeRows, index: number): Record<string, unknown> {\n const row: Record<string, unknown> = {};\n const native = rows.rows[index] ?? {};\n for (const name in map) {\n if (rows.keys.has(name) && writeCount() === rows.writes) { row[name] = native[name]; continue; }\n const entry: ExtractMap = Object.create(null);\n Object.defineProperty(entry, name, { value: map[name], enumerable: true, configurable: true });\n fillEntries(scope, entry, row);\n }\n return row;\n}\n\n/** Extracts `map`'s entries into `result`, which callbacks receive as built so far. */\nfunction fillEntries(scope: Cheerio<AnyNode>, map: ExtractMap, result: Record<string, unknown>): void {\n for (const key in map) {\n const entry = map[key];\n const all = Array.isArray(entry);\n const descriptor = (all ? entry[0] : entry) as string | ExtractDescriptor;\n const selector = typeof descriptor === 'string' ? descriptor : descriptor.selector;\n const value = typeof descriptor === 'string' ? 'textContent' : descriptor.value ?? 'textContent';\n const selection = scope._findBySelector(selector, all ? Infinity : 1);\n const read = (index: number) => {\n if (typeof value === 'function') return value(selection[index] as Element, key, result);\n const child = scope._make === nativeExtractionMethods.make ? scope._fromIds([selection.ids[index]]) : scope._make(selection[index]);\n return typeof value === 'string' ? child.prop(value) : child.extract(value);\n };\n if (all) {\n const values: unknown[] = [];\n for (let index = 0; index < selection.length; index += 1) {\n const extracted = read(index);\n if (extracted != null) values.push(...(Array.isArray(extracted) ? extracted : [extracted]));\n }\n result[key] = values;\n } else result[key] = selection.length ? read(0) : undefined;\n }\n}\n\nexport function installExtract(CheerioClass: { prototype: object }): void {\n Object.assign(CheerioClass.prototype, { extract });\n}\n\n/** Async batch fallback preserves callback values/order while yielding between visits. */\nexport async function extractCooperatively<M extends ExtractMap>(selection: Cheerio<AnyNode>, map: M): Promise<{ value: ExtractedMap<M> }> {\n let deadline = performance.now() + 4;\n let visits = 0;\n const checkpoint = async () => {\n if (++visits % 32 || performance.now() < deadline) return;\n await new Promise<void>((resolve) => setImmediate(resolve));\n deadline = performance.now() + 4;\n };\n const walk = async (scope: Cheerio<AnyNode>, descriptors: ExtractMap): Promise<{ value: Record<string, unknown> }> => {\n const result: Record<string, unknown> = {};\n const keys = plainKeys(descriptors);\n const processed = new Set<string>();\n for (const key in descriptors) {\n if (processed.has(key)) continue;\n const prefix = Object.getPrototypeOf(result) === Object.prototype ? nativePrefix(scope, descriptors, keys, key) : undefined;\n if (prefix) {\n for (const name of prefix.keys) { Object.defineProperty(result, name, { value: prefix.values[name], enumerable: true, configurable: true, writable: true }); processed.add(name); }\n continue;\n }\n const entry = descriptors[key];\n const all = Array.isArray(entry);\n const descriptor = (all ? entry[0] : entry) as string | ExtractDescriptor;\n const selector = typeof descriptor === 'string' ? descriptor : descriptor.selector;\n const value = typeof descriptor === 'string' ? 'textContent' : descriptor.value ?? 'textContent';\n const found = scope._findBySelector(selector, all ? Infinity : 1);\n const rows = typeof value === 'object' ? nativeRows(scope, key, all, selector, value) : undefined;\n const output: unknown[] = [];\n let single: unknown;\n const count = all ? found.length : Math.min(found.length, 1);\n for (let index = 0; index < count; index++) {\n await checkpoint();\n // Callback return values, including Promise objects, remain ordinary\n // values just as in synchronous Cheerio.extract().\n let extracted: unknown;\n if (typeof value === 'function') extracted = value(found[index] as Element, key, result);\n else {\n const child = scope._make === nativeExtractionMethods.make\n ? scope._fromIds([found.ids[index]])\n : scope._make(found[index]);\n extracted = typeof value === 'string' ? child.prop(value)\n : rows ? completeRow(child, value, rows, index)\n : child.extract === nativeExtractionMethods.extract ? (await walk(child, value)).value : child.extract(value);\n }\n if (all) { if (extracted != null) output.push(...(Array.isArray(extracted) ? extracted : [extracted])); }\n else single = extracted;\n }\n result[key] = all ? output : single;\n }\n return { value: result };\n };\n return await walk(selection, map) as { value: ExtractedMap<M> };\n}\n","import { requireNative, type NativeWorkerPoolInfo } from './native.js';\n\nexport interface WorkerOptions { threads: number }\nexport type WorkerPoolInfo = NativeWorkerPoolInfo;\n\n/** Set the process-wide native CPU-worker budget before starting async work. */\nexport function configureWorkers(options: WorkerOptions | number): WorkerPoolInfo {\n const threads = typeof options === 'number' ? options : options?.threads;\n if (!Number.isSafeInteger(threads) || threads < 1 || threads > 256) throw new RangeError('threads must be an integer from 1 to 256');\n const binding = requireNative();\n if (!binding.configureWorkerPool || !binding.workerPoolInfo) throw new Error('This native build does not support a shared worker pool');\n binding.configureWorkerPool(threads);\n return binding.workerPoolInfo();\n}\n\n/** Observe the configured budget and actual concurrent native CPU work. */\nexport function workerPoolInfo(): WorkerPoolInfo {\n const binding = requireNative();\n if (!binding.workerPoolInfo) throw new Error('This native build does not support worker pool diagnostics');\n return binding.workerPoolInfo();\n}\n","import { Readable, Writable } from 'node:stream';\nimport { request as requestHTTP } from 'node:http';\nimport { request as requestHTTPS } from 'node:https';\nimport { stringify as stringifyQuery } from 'node:querystring';\nimport type { EventEmitter } from 'node:events';\nimport { MIMEType } from 'node:util';\nimport { createAPI, flattenOptions, load } from './modern.js';\nimport { requireNative, type NativeStream } from './native.js';\nimport { createDiagnosticSession, createTokenizerSession, createTreeAdapterSession, deliverParseErrors, parserOptions } from './hooks.js';\nimport { routeDocument } from './router.js';\nimport type { CheerioAPI, CheerioOptions, CheerioRequestOptions, DecodeStreamOptions, EncodingOptions } from './types.js';\n\nexport type LoadCallback = (error: Error | null | undefined, document: CheerioAPI) => void;\n\nfunction encodingLabel(label: string | null | undefined): string | undefined {\n if (!label) return undefined;\n if (label.trim().toLowerCase() === 'x-user-defined') return 'x-user-defined';\n try { return new TextDecoder(label.trim()).encoding; } catch { return undefined; }\n}\n\n/** WHATWG decoding with BOM, transport headers, and the HTML meta prescan. */\nfunction sniffEncoding(buffer: Uint8Array, options: EncodingOptions = {}): string {\n let label: string | undefined;\n if (buffer[0] === 0xef && buffer[1] === 0xbb && buffer[2] === 0xbf) label = 'utf-8';\n else if (buffer[0] === 0xff && buffer[1] === 0xfe) label = 'utf-16le';\n else if (buffer[0] === 0xfe && buffer[1] === 0xff) label = 'utf-16be';\n label ??= encodingLabel((options as EncodingOptions & { userEncoding?: string }).userEncoding);\n label ??= encodingLabel(options.transportLayerEncodingLabel);\n if (!label && buffer[0] === 0 && buffer[1] === 0x3c && buffer[2] === 0 && buffer[3] === 0x3f && buffer[4] === 0 && buffer[5] === 0x78) label = 'utf-16be';\n if (!label && buffer[0] === 0x3c && buffer[1] === 0 && buffer[2] === 0x3f && buffer[3] === 0 && buffer[4] === 0x78 && buffer[5] === 0) label = 'utf-16le';\n if (!label) {\n const prefix = Buffer.from(buffer.subarray(0, options.maxBytes ?? 1024)).toString('latin1').replace(/<!--[\\s\\S]*?(?:-->|$)/g, '');\n for (const token of prefix.matchAll(/<meta\\b([^>]*)>/gi)) {\n const attributes: Record<string, string> = {};\n for (const attribute of token[1].matchAll(/([^\\s=/'\">]+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'>]+)))?/g)) {\n const key = attribute[1].toLowerCase();\n if (!(key in attributes)) attributes[key] = attribute[2] ?? attribute[3] ?? attribute[4] ?? '';\n }\n const declared = attributes.charset ?? (attributes['http-equiv']?.toLowerCase() === 'content-type'\n ? /\\bcharset\\s*=\\s*[\"']?([^\\s;\"']+)/i.exec(attributes.content ?? '')?.[1] : undefined);\n label = encodingLabel(declared);\n if (label) {\n if (label === 'utf-16le' || label === 'utf-16be') label = 'utf-8';\n if (label === 'x-user-defined') label = 'windows-1252';\n break;\n }\n }\n if (!label) {\n const declaration = /<\\?xml\\b[^>]*\\bencoding\\s*=\\s*[\"']([^\"']+)[\"']/i.exec(prefix);\n label = encodingLabel(declaration?.[1]);\n if (label === 'utf-16le' || label === 'utf-16be') label = 'utf-8';\n }\n }\n label ??= encodingLabel(options.defaultEncoding) ?? 'windows-1252';\n return label;\n}\n\nexport function decodeBuffer(buffer: Uint8Array, options: EncodingOptions = {}): string {\n const label = sniffEncoding(buffer, options);\n if (label === 'x-user-defined') {\n let decoded = '';\n for (const byte of buffer) decoded += String.fromCharCode(byte < 0x80 ? byte : 0xf700 + byte);\n return decoded;\n }\n return new TextDecoder(label).decode(buffer);\n}\n\nfunction decodedInput(buffer: Uint8Array, options: DecodeStreamOptions): [string, CheerioOptions] {\n const { encoding, ...parserOptions } = options;\n const xml = !!(options.xmlMode || options.xml);\n return [decodeBuffer(buffer, { defaultEncoding: xml ? 'utf-8' : 'windows-1252', ...encoding }), parserOptions];\n}\n\nexport function loadBuffer(buffer: Buffer | Uint8Array, options: DecodeStreamOptions = {}): CheerioAPI {\n return load(...decodedInput(buffer, options));\n}\n\nfunction completion(callback: LoadCallback): (error?: Error | null, document?: CheerioAPI) => void {\n let completed = false;\n return (error, document) => {\n if (completed) return;\n completed = true;\n callback(error, document as CheerioAPI);\n };\n}\n\nfunction requestHeaders(input: NonNullable<CheerioRequestOptions['requestOptions']>['headers']): Headers {\n if (!input) return new Headers();\n if (input instanceof Headers) return new Headers(input);\n const headers = new Headers();\n if (Array.isArray(input)) {\n if (input.length % 2) throw new TypeError('HTTP header arrays must contain name/value pairs');\n for (let index = 0; index < input.length; index += 2) headers.append(input[index], input[index + 1]);\n } else {\n const entries: Iterable<[string, string | string[] | undefined]> = Symbol.iterator in input\n ? input as Iterable<[string, string | string[] | undefined]> : Object.entries(input);\n for (const [name, value] of entries) {\n if (value == null) continue;\n for (const item of Array.isArray(value) ? value : [value]) headers.append(name, item);\n }\n }\n return headers;\n}\n\ninterface HTTPResponse {\n status: number;\n ok: boolean;\n headers: Headers;\n body: ReadableStream<Uint8Array> | null;\n rawHeaders?: Record<string, string | string[] | undefined>;\n}\n\n/** Node transport exposes informational responses and leaves wire headers alone. */\nasync function requestDocument(url: URL, method: string, headers: Headers, body: NonNullable<CheerioRequestOptions['requestOptions']>['body'], options: NonNullable<CheerioRequestOptions['requestOptions']>, signal: AbortSignal): Promise<HTTPResponse> {\n if (options.typeOfService != null && (!Number.isInteger(options.typeOfService) || options.typeOfService < 0 || options.typeOfService > 255)) {\n throw Object.assign(new Error('typeOfService must be an integer between 0 and 255'), { name: 'InvalidArgumentError', code: 'UND_ERR_INVALID_ARG' });\n }\n let payload: string | Uint8Array | Readable | ReadableStream<Uint8Array> | null | undefined = body as string | Uint8Array | Readable | null | undefined;\n if (body && typeof body === 'object' && !(body instanceof Uint8Array) && !(body instanceof Readable)) {\n // Request supplies Node's built-in multipart encoder for either Node or\n // Undici FormData without requiring the Undici package at runtime.\n let form: FormData;\n if (body instanceof FormData) form = body;\n else {\n form = new FormData();\n for (const [name, value] of body as import('./types.js').FormDataLike) {\n if (typeof value === 'string') form.append(name, value);\n else if ('name' in value && typeof value.name === 'string') form.append(name, value as Blob, value.name);\n else form.append(name, value as Blob);\n }\n }\n const encoded = new Request(url, { method: 'POST', body: form });\n // Node 20's encoder omits the final CRLF used by Undici 7. Keep the\n // request streaming while normalizing that suffix across Node versions.\n payload = Readable.from((async function* () {\n let previous = -1;\n let last = -1;\n for await (const chunk of Readable.fromWeb(encoded.body! as import('node:stream/web').ReadableStream<Uint8Array>)) {\n const bytes = chunk as Buffer;\n if (bytes.length >= 2) previous = bytes[bytes.length - 2];\n else if (bytes.length === 1) previous = last;\n if (bytes.length) last = bytes[bytes.length - 1];\n yield bytes;\n }\n if (previous !== 13 || last !== 10) yield Buffer.from('\\r\\n');\n })());\n if (!requestHeaders(options.headers).has('content-type')) headers.set('content-type', encoded.headers.get('content-type')!);\n }\n if (payload != null && !(payload instanceof Readable) && !(typeof payload === 'object' && 'getReader' in payload) && !headers.has('content-length') && !headers.has('transfer-encoding')) {\n headers.set('content-length', String(typeof payload === 'string' ? Buffer.byteLength(payload) : payload.byteLength));\n }\n const declaredLength = headers.has('content-length') ? Number(headers.get('content-length')) : undefined;\n const lengthError = () => Object.assign(new Error('Request body length does not match content-length header'), { name: 'RequestContentLengthMismatchError', code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' });\n const knownLength = typeof payload === 'string' ? Buffer.byteLength(payload) : payload instanceof Uint8Array ? payload.byteLength : undefined;\n if (declaredLength != null && knownLength != null && declaredLength !== knownLength) throw lengthError();\n if (options.reset === true && !headers.has('connection')) headers.set('connection', 'close');\n return new Promise<HTTPResponse>((resolve, reject) => {\n let informationalError: Error | undefined;\n const request = (url.protocol === 'https:' ? requestHTTPS : requestHTTP)(url, {\n method, headers: Object.fromEntries(headers), signal,\n ...(typeof options.highWaterMark === 'number' ? { highWaterMark: options.highWaterMark } : {}),\n }, response => {\n if (informationalError) { response.destroy(); return; }\n const rawHeaders: Record<string, string | string[]> = {};\n for (let index = 0; index < response.rawHeaders.length; index += 2) {\n const name = response.rawHeaders[index].toLowerCase();\n const value = response.rawHeaders[index + 1];\n if (!Object.hasOwn(rawHeaders, name)) Object.defineProperty(rawHeaders, name, { value, enumerable: true, writable: true, configurable: true });\n else rawHeaders[name] = [...(Array.isArray(rawHeaders[name]) ? rawHeaders[name] : [rawHeaders[name]]) as string[], value];\n }\n const responseHeaders = new Headers();\n for (const [name, value] of Object.entries(rawHeaders)) {\n if (value == null) continue;\n for (const item of Array.isArray(value) ? name === 'content-type' ? value.slice(0, 1) : value : [value]) responseHeaders.append(name, item);\n }\n const status = response.statusCode ?? 0;\n resolve({ status, ok: status >= 200 && status < 300, headers: responseHeaders, rawHeaders, body: Readable.toWeb(response) as ReadableStream<Uint8Array> });\n });\n request.once('error', error => reject(signal.aborted ? signal.reason : error));\n request.on('information', information => {\n try { options.onInfo?.({ statusCode: information.statusCode, headers: information.headers as Record<string, string | string[]> }); }\n catch (error) { informationalError = error as Error; reject(error); request.destroy(error as Error); }\n });\n request.once('socket', socket => {\n const transport = socket as typeof socket & { setTypeOfService?: (value?: number) => void };\n try {\n if (transport.setTypeOfService && options.typeOfService != null) transport.setTypeOfService(options.typeOfService);\n } catch (error) { request.destroy(error as Error); return; }\n if (socket.connecting) {\n const timer = setTimeout(() => request.destroy(Object.assign(new Error('Connect Timeout Error'), { name: 'ConnectTimeoutError', code: 'UND_ERR_CONNECT_TIMEOUT' })), 10000);\n timer.unref();\n socket.once(url.protocol === 'https:' ? 'secureConnect' : 'connect', () => clearTimeout(timer));\n request.once('close', () => clearTimeout(timer));\n }\n });\n if (payload instanceof Readable || payload && typeof payload === 'object' && 'getReader' in payload) {\n const source = payload instanceof Readable ? payload : Readable.fromWeb(payload as unknown as import('node:stream/web').ReadableStream<Uint8Array>);\n if (declaredLength != null) {\n let sent = 0;\n source.on('data', (chunk: Buffer | string) => {\n sent += typeof chunk === 'string' ? Buffer.byteLength(chunk) : chunk.byteLength;\n if (sent > declaredLength) { request.destroy(lengthError()); source.destroy(); }\n });\n source.once('end', () => { if (sent !== declaredLength) request.destroy(lengthError()); });\n }\n source.once('error', error => request.destroy(error));\n request.once('close', () => { if (!source.destroyed) source.destroy(); });\n source.pipe(request);\n } else request.end(payload);\n });\n}\n\n/** A Node writable that feeds the native parser with bounded backpressure. */\nexport function stringStream(options: CheerioOptions, callback: LoadCallback): Writable {\n const complete = completion(callback);\n const opts = flattenOptions(options);\n const xml = !!opts._useHtmlParser2;\n const binding = requireNative();\n let native: NativeStream | undefined;\n let writeNative: (chunk: string) => Promise<void>;\n let finishNative: () => Promise<CheerioAPI>;\n let abortNative: () => void;\n let carry = '';\n if (opts._useHtmlParser2 && opts.Tokenizer) {\n const session = createTokenizerSession(opts);\n // Arbitrary user tokenizers can emit offsets for any earlier input. Retain\n // their source until end rather than changing their callback contract.\n const chunks: string[] = [];\n writeNative = async (chunk) => { chunks.push(chunk); session.write(chunk); };\n finishNative = async () => {\n const document = new binding.NativeDocument(chunks.join(''), true, JSON.stringify(session.end()));\n chunks.length = 0;\n return createAPI(routeDocument(document, opts), opts);\n };\n abortNative = () => { chunks.length = 0; };\n } else if (!opts._useHtmlParser2 && opts.treeAdapter) {\n const session = createTreeAdapterSession(opts, true);\n writeNative = (chunk) => session.write(chunk);\n finishNative = async () => createAPI(await session.end(), opts);\n abortNative = () => session.abort();\n } else if (!opts._useHtmlParser2 && opts.onParseError) {\n const session = createDiagnosticSession(opts, true);\n writeNative = (chunk) => session.write(chunk);\n finishNative = async () => createAPI(await session.end(), opts);\n abortNative = () => session.abort();\n } else {\n if (!binding.NativeStream) throw new Error('This native build does not support incremental parsing');\n native = new binding.NativeStream(JSON.stringify(parserOptions('', opts)), true);\n writeNative = (chunk) => native!.write(chunk);\n finishNative = async () => {\n const document = await native!.finish();\n deliverParseErrors(document, opts);\n return createAPI(routeDocument(document, opts), opts);\n };\n abortNative = () => native!.abort();\n }\n const stream = new Writable({\n decodeStrings: false,\n write(chunk, _encoding, done) {\n if (typeof chunk !== 'string') throw new TypeError(xml ? 'Expected a string' : 'Parser can work only with string streams.');\n if (opts._useHtmlParser2 && opts.Tokenizer) { writeNative(chunk).then(() => done(), (error: Error) => done(error)); return; }\n let text = carry + chunk;\n carry = '';\n const last = text.charCodeAt(text.length - 1);\n if (last >= 0xd800 && last <= 0xdbff) { carry = text.slice(-1); text = text.slice(0, -1); }\n if (!text) { done(); return; }\n writeNative(text).then(() => done(), (error: Error) => done(error));\n },\n final(done) {\n (async () => {\n if (carry) await writeNative(carry);\n return finishNative();\n })().then((document) => {\n complete(null, document);\n done();\n }, (error: Error) => done(error));\n },\n destroy(error, done) { abortNative(); done(error); },\n });\n stream.on('error', (error) => complete(error));\n return stream;\n}\n\n/** Sniff a bounded prefix, then decode and parse each chunk as it arrives. */\nexport function decodeStream(options: DecodeStreamOptions, callback: LoadCallback): Writable {\n const complete = completion(callback);\n const { encoding = {}, ...parserOptions } = options ?? {};\n const opts = flattenOptions(parserOptions);\n const decoderOptions = { defaultEncoding: opts.xmlMode ? 'utf-8' : 'windows-1252', ...encoding };\n const maxBytes = decoderOptions.maxBytes ?? 1024;\n if (!Number.isSafeInteger(maxBytes) || maxBytes < 0) throw new RangeError('encoding.maxBytes must be a non-negative integer');\n const prefixLimit = Math.max(6, maxBytes);\n const prefix: Buffer[] = [];\n let prefixLength = 0;\n let decoder: TextDecoder | undefined;\n let userDefined = false;\n let started = false;\n const parser = stringStream(opts, (error, document) => complete(error, document));\n let downstreamError: Error | undefined;\n parser.on('error', (error) => { downstreamError = error; stream.destroy(error); });\n const writeText = (text: string): Promise<void> => new Promise((resolve, reject) => {\n if (downstreamError) { reject(downstreamError); return; }\n if (!text) { resolve(); return; }\n parser.write(text, (error?: Error | null) => error ? reject(error) : resolve());\n });\n const decode = (bytes: Uint8Array, final = false): string => {\n if (userDefined) {\n let text = '';\n for (const byte of bytes) text += String.fromCharCode(byte < 0x80 ? byte : 0xf700 + byte);\n return text;\n }\n return decoder!.decode(bytes, { stream: !final });\n };\n const start = async (): Promise<void> => {\n const bytes = Buffer.concat(prefix, prefixLength);\n const label = sniffEncoding(bytes, decoderOptions);\n userDefined = label === 'x-user-defined';\n if (!userDefined) decoder = new TextDecoder(label);\n started = true;\n prefix.length = 0;\n await writeText(decode(bytes));\n };\n const accept = async (bytes: Buffer): Promise<void> => {\n if (!started) {\n const count = Math.min(prefixLimit - prefixLength, bytes.length);\n if (count) { prefix.push(Buffer.from(bytes.subarray(0, count))); prefixLength += count; }\n bytes = bytes.subarray(count);\n const declaredEncoding = encodingLabel(decoderOptions.userEncoding) || encodingLabel(decoderOptions.transportLayerEncodingLabel);\n if (prefixLength >= prefixLimit || declaredEncoding && prefixLength >= 3) await start();\n }\n if (started && bytes.length) await writeText(decode(bytes));\n };\n const stream = new Writable({\n write(chunk: Buffer | string, encoding, done) {\n accept(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding)).then(() => done(), (error: Error) => done(error));\n },\n final(done) {\n (async () => {\n if (!started) await start();\n await writeText(decode(new Uint8Array(), true));\n await new Promise<void>((resolve, reject) => {\n parser.once('error', reject);\n parser.end(() => { parser.removeListener('error', reject); resolve(); });\n });\n })().then(() => done(), (error: Error) => done(error));\n },\n destroy(error, done) { parser.destroy(error ?? undefined); done(error); },\n });\n stream.on('error', (error) => complete(error));\n return stream;\n}\n\n/** Load HTML or XML with bounded redirects through Node's built-in transport. */\nexport async function fromURL(url: string | URL, options: CheerioRequestOptions = {}): Promise<CheerioAPI> {\n const signal = options.requestOptions?.signal;\n if (!signal) return loadURL(url, options);\n if (typeof signal !== 'object' && typeof signal !== 'function') throw new TypeError('signal must be an AbortSignal or EventEmitter');\n if ('addEventListener' in signal) return loadURL(url, options);\n if (!('once' in signal) || !('removeListener' in signal)) throw new TypeError('signal must be an AbortSignal or EventEmitter');\n const emitter = signal as EventEmitter;\n const controller = new AbortController();\n const abort = () => controller.abort();\n emitter.once('abort', abort);\n try { return await loadURL(url, { ...options, requestOptions: { ...options.requestOptions, signal: controller.signal } }); }\n finally { emitter.removeListener('abort', abort); }\n}\n\nasync function loadURL(url: string | URL, options: CheerioRequestOptions): Promise<CheerioAPI> {\n const { requestOptions = {}, encoding, ...parserOptions } = options;\n const maxRedirects = requestOptions.maxRedirections ?? 5;\n if (!Number.isInteger(maxRedirects) || maxRedirects < 0) throw new RangeError('maxRedirections must be a non-negative integer');\n const headers = requestHeaders(requestOptions.headers);\n if (!Object.hasOwn(requestOptions, 'headers')) headers.set('accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');\n let current = new URL(url);\n if (requestOptions.query) {\n if (current.search || current.hash) throw new TypeError('URL must not contain a query or fragment when requestOptions.query is supplied');\n current.search = stringifyQuery(requestOptions.query);\n }\n let method = requestOptions.method ?? 'GET';\n let body = requestOptions.body;\n let response: HTTPResponse;\n const controller = new AbortController();\n const signal = requestOptions.signal ? AbortSignal.any([requestOptions.signal as AbortSignal, controller.signal]) : controller.signal;\n const timeoutError = (kind: 'Headers' | 'Body') => Object.assign(new Error(`${kind} Timeout Error`), {\n name: `${kind}TimeoutError`, code: kind === 'Headers' ? 'UND_ERR_HEADERS_TIMEOUT' : 'UND_ERR_BODY_TIMEOUT',\n });\n for (const timeout of [requestOptions.headersTimeout, requestOptions.bodyTimeout]) {\n if (timeout != null && (!Number.isFinite(timeout) || timeout < 0)) throw new RangeError('HTTP timeouts must be non-negative finite numbers');\n }\n const suppliedDispatcher = requestOptions.dispatcher as { dispatch?: (options: unknown, handler: unknown) => boolean } | undefined;\n if (suppliedDispatcher && typeof suppliedDispatcher.dispatch !== 'function') throw new TypeError('requestOptions.dispatcher must implement dispatch');\n const dispatcher = suppliedDispatcher && {\n dispatch(dispatchOptions: Record<string, unknown>, handler: unknown) {\n // Keep fetch's URL/body/header encoding and forward the remaining Undici\n // transport options to the caller's dispatcher without an npm dependency.\n const { dispatcher: _dispatcher, throwOnError: _throwOnError, maxRedirections: _maxRedirections, query: _query, ...transport } = requestOptions;\n return suppliedDispatcher.dispatch!({ ...transport, ...dispatchOptions }, handler);\n },\n };\n for (let redirects = 0; ; redirects += 1) {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const headersTimeout = requestOptions.headersTimeout ?? 300000;\n if (headersTimeout) { timer = setTimeout(() => controller.abort(timeoutError('Headers')), headersTimeout); timer.unref(); }\n try {\n if (dispatcher) {\n const init: RequestInit & { dispatcher?: unknown; duplex?: 'half' } = { method, headers, body: body as BodyInit | undefined, redirect: 'manual', signal, dispatcher };\n if (body != null && typeof body !== 'string') init.duplex = 'half';\n response = await fetch(current, init);\n } else response = await requestDocument(current, method, headers, body, requestOptions, signal);\n } catch (error) {\n throw signal.aborted ? signal.reason : error;\n } finally { if (timer) clearTimeout(timer); }\n const location = response.headers.get('location');\n if (![300, 301, 302, 303, 307, 308].includes(response.status) || !location) break;\n const rewriteToGet = response.status === 303 && method.toUpperCase() !== 'HEAD' || (response.status === 301 || response.status === 302) && method.toUpperCase() === 'POST';\n if (body instanceof Readable && body.readableDidRead && !rewriteToGet) break;\n await response.body?.cancel();\n if (redirects >= maxRedirects) throw new Error('max redirects reached');\n const next = new URL(location, current);\n headers.delete('host');\n if (response.status === 303) for (const name of [...headers.keys()]) if (name.startsWith('content-')) headers.delete(name);\n if (next.origin !== current.origin) {\n headers.delete('authorization');\n headers.delete('cookie');\n headers.delete('proxy-authorization');\n }\n if (rewriteToGet) {\n method = 'GET';\n body = undefined;\n headers.delete('content-length');\n headers.delete('content-type');\n }\n current = next;\n }\n if (!response.ok) {\n await response.body?.cancel();\n const error = new Error('Response Error') as Error & { statusCode: number; code: string; headers: Record<string, string | string[] | undefined> };\n error.name = 'ResponseError';\n error.statusCode = response.status;\n error.code = 'UND_ERR_RESPONSE';\n error.headers = response.rawHeaders ?? Object.fromEntries(response.headers);\n throw error;\n }\n const contentType = response.headers.get('content-type') ?? 'text/html';\n let parsedType: MIMEType;\n try { parsedType = new MIMEType(contentType); }\n catch {\n await response.body?.cancel();\n throw new Error(`Could not parse MIME type string \"${contentType}\"`);\n }\n const mime = parsedType.essence;\n const xml = (parsedType.type === 'application' || parsedType.type === 'text') && parsedType.subtype === 'xml' || parsedType.subtype.endsWith('+xml');\n if (mime !== 'text/html' && !xml) {\n await response.body?.cancel();\n throw new RangeError(`The content-type \"${mime}\" is neither HTML nor XML.`);\n }\n const charset = parsedType.params.get('charset') ?? undefined;\n if (encoding) encoding.transportLayerEncodingLabel = charset;\n const streamOptions: DecodeStreamOptions = {\n xmlMode: xml,\n baseURI: current,\n ...parserOptions,\n encoding: { ...encoding, transportLayerEncodingLabel: charset },\n };\n return new Promise<CheerioAPI>((resolve, reject) => {\n const parser = decodeStream(streamOptions, (error, document) => error ? reject(error) : resolve(document));\n const reader = response.body?.getReader();\n parser.once('error', (error) => { controller.abort(error); void reader?.cancel(error).catch(() => {}); });\n (async () => {\n let received = 0;\n const maxResponseSize = requestOptions.maxResponseSize;\n if (maxResponseSize != null && (typeof maxResponseSize !== 'number' || !Number.isSafeInteger(maxResponseSize) || maxResponseSize < -1)) throw new RangeError('maxResponseSize must be -1 or a non-negative integer');\n while (reader) {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const bodyTimeout = requestOptions.bodyTimeout ?? 300000;\n if (bodyTimeout) { timer = setTimeout(() => controller.abort(timeoutError('Body')), bodyTimeout); timer.unref(); }\n let chunk: ReadableStreamReadResult<Uint8Array>;\n try { chunk = await reader.read(); }\n catch (error) { throw controller.signal.aborted ? controller.signal.reason : error; }\n finally { if (timer) clearTimeout(timer); }\n if (chunk.done) break;\n received += chunk.value.byteLength;\n if (typeof maxResponseSize === 'number' && maxResponseSize >= 0 && received > maxResponseSize) {\n throw Object.assign(new Error('Response content exceeded maxResponseSize'), { name: 'ResponseExceededMaxSizeError', code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE' });\n }\n await new Promise<void>((resolve, reject) => parser.write(Buffer.from(chunk.value.buffer, chunk.value.byteOffset, chunk.value.byteLength), (error?: Error | null) => error ? reject(error) : resolve()));\n }\n parser.end();\n })().catch((error: Error) => { parser.destroy(error); reject(error); });\n });\n}\n","import * as nativeDOM from './dom.js';\nimport { parseNativeDocument, parserOptions, deliverParseErrors, hasParserHooks, cleanParserOptions, createTreeAdapterSession } from './hooks.js';\nimport { compileExtractPlan, hydrateExtractResult } from './extract-plan.js';\nimport { extractCooperatively, prepareExtractPlans, releaseExtractPlans, rootExtractPlans } from './extract.js';\nimport { setImmediate as yieldToEventLoop } from 'node:timers/promises';\nimport { availableParallelism } from 'node:os';\nimport { requireNative, nativeStatus, type NativeDocument, type NativeQuery } from './native.js';\nimport { Cheerio } from './selection.js';\nimport { getNode, importNodes, nodeBinding, operation, rootNode, viewIdIn } from './nodes.js';\nimport { isHtml } from './utils.js';\nimport { DOCUMENT, exposeDocumentTo, resumeCollection, routeDocument, sameNodeSpace, usePreparedSnapshot } from './router.js';\nimport type { AnyNode, Document, CheerioAPI, CheerioOptions, LoadContent, ParallelOptions, ExtractMap, ExtractedMap } from './types.js';\n\nexport type * from './types.js';\nexport type { Cheerio } from './selection.js';\nexport { nativeStatus };\nexport const dom = {\n Node: nativeDOM.Node, DataNode: nativeDOM.DataNode, NodeWithChildren: nativeDOM.NodeWithChildren,\n Document: nativeDOM.Document, Element: nativeDOM.Element, Text: nativeDOM.Text,\n Comment: nativeDOM.Comment, ProcessingInstruction: nativeDOM.ProcessingInstruction, CDATA: nativeDOM.CDATA,\n ElementType: nativeDOM.ElementType, isTag: nativeDOM.isTag, isText: nativeDOM.isText,\n isComment: nativeDOM.isComment, isDirective: nativeDOM.isDirective, isDocument: nativeDOM.isDocument,\n isCDATA: nativeDOM.isCDATA, hasChildren: nativeDOM.hasChildren,\n} as const;\nexport { configureWorkers, workerPoolInfo } from './workers.js';\nexport type { WorkerOptions, WorkerPoolInfo } from './workers.js';\nexport { loadBuffer, stringStream, decodeStream, fromURL } from './io.js';\n\nconst defaultOptions: CheerioOptions = { _useHtmlParser2: false };\n\n/** Cheerio's option merge: without overrides, calls share the base options object. */\nexport function flattenOptions(options?: CheerioOptions | null, base?: CheerioOptions): CheerioOptions {\n if (!options) return base ?? defaultOptions;\n const result: CheerioOptions = { _useHtmlParser2: false, ...base, ...options };\n if (options?.xml) { result._useHtmlParser2 = true; result.xmlMode = true; if (options.xml !== true) Object.assign(result, options.xml); }\n else if (options?.xmlMode) result._useHtmlParser2 = true;\n return result;\n}\n\n/** A synchronous, constructable Cheerio factory backed by a mutable Rust DOM. */\nexport function createAPI(document: NativeDocument, options?: CheerioOptions | null, initialRoot = document.rootId()): CheerioAPI {\n const internal = flattenOptions(options);\n class LoadedCheerio<T = AnyNode> extends Cheerio<T> {}\n let api: CheerioAPI;\n const createRoot = (rootIds: number[], opts: CheerioOptions): Cheerio<Document> => {\n const rootInstance = new LoadedCheerio<Document>(api, document, rootIds, null, opts);\n rootInstance._root = rootInstance;\n return rootInstance;\n };\n const initialize = function<T = AnyNode>(selector?: any, context?: any, root?: any, override?: CheerioOptions): Cheerio<T> {\n resumeCollection(document);\n if (selector?.cheerio) { exposeDocumentTo(document, selector[DOCUMENT]); return selector; }\n const opts = flattenOptions(override, internal);\n // Each call gets its own root selection, as in Cheerio: callers may change the one `end()` returns.\n const rootInstance = createRoot(root === undefined ? [initialRoot]\n : typeof root === 'string' ? [makeRoot(document, operation(document, 'create', { html: root, options: opts }))]\n : root?.cheerio ? importNodes(document, root.toArray()) : importNodes(document, root), opts);\n if (!selector) return new LoadedCheerio<T>(api, document, [], rootInstance, opts);\n const id = viewIdIn(document, selector);\n if (id !== undefined) return new LoadedCheerio<T>(api, document, [id], rootInstance, opts);\n if (typeof selector === 'string' && isHtml(selector)) return new LoadedCheerio<T>(api, document, operation(document, 'create', { html: selector, options: opts }), rootInstance, opts);\n if (typeof selector === 'object') {\n const values = 'length' in selector && !selector.type ? Array.from(selector as ArrayLike<T>) : [selector];\n const allNodes = values.every((value: any) => value && typeof value === 'object' && typeof value.type === 'string');\n return new LoadedCheerio<T>(api, document, allNodes ? importNodes(document, values) : [], rootInstance, opts, allNodes ? undefined : values);\n }\n if (typeof selector !== 'string') throw new TypeError('Unexpected type of selector');\n let search = selector;\n let searchContext: Cheerio<any> = rootInstance;\n if (context) {\n if (typeof context === 'string') {\n if (isHtml(context)) searchContext = new LoadedCheerio<Document>(api, document, [makeRoot(document, operation(document, 'create', { html: context, options: opts }))], rootInstance, opts);\n else search = `${context} ${search}`;\n } else if (context.cheerio) searchContext = context;\n else searchContext = new LoadedCheerio(api, document, importNodes(document, context), rootInstance, opts);\n }\n return searchContext.find(search) as unknown as Cheerio<T>;\n };\n // As in Cheerio, static methods are shared by every loaded API and read the document through `this`.\n api = Object.assign(initialize, staticMethods, {\n load,\n _root: rootNode(document, initialRoot),\n _options: internal,\n fn: LoadedCheerio.prototype,\n prototype: LoadedCheerio.prototype,\n }) as unknown as CheerioAPI;\n return api;\n}\n\nconst staticMethods = {\n root(this: CheerioAPI): Cheerio<Document> { return this(this._root) as Cheerio<Document>; },\n html(this: CheerioAPI | undefined, dom?: any, renderOptions?: CheerioOptions): string {\n if (!this) return '';\n if (dom && typeof dom === 'object' && !('length' in dom) && !('type' in dom)) { renderOptions = dom; dom = undefined; }\n const nodes = dom === undefined ? [this._root] : this(dom).toArray();\n const binding = nodeBinding(this._root)!;\n const base = this._options;\n const unchanged = !renderOptions && ((!base._useHtmlParser2 && !base.xml && !base.xmlMode)\n || (base.xml === true && base.xmlMode === true && base._useHtmlParser2 === true));\n const options = unchanged ? base : flattenOptions({ ...base, ...flattenOptions(renderOptions) }, base);\n return operation(binding.document, 'render', { ids: importNodes(binding.document, nodes), options });\n },\n xml(this: CheerioAPI, dom?: any): string {\n const binding = nodeBinding(this._root)!;\n return operation(binding.document, 'render', { ids: importNodes(binding.document, dom === undefined ? [this._root] : this(dom).toArray()), options: { ...this._options, xmlMode: true, _useHtmlParser2: true } });\n },\n text(this: CheerioAPI | undefined, elements?: ArrayLike<AnyNode>): string {\n if (!elements && !this) return '';\n const nodes = elements ?? [this!._root];\n const binding = this ? nodeBinding(this._root) : nodeBinding(nodes[0]);\n if (binding) return binding.document.text(importNodes(binding.document, nodes));\n const doc = routeDocument(new (requireNative().NativeDocument)('', false));\n return doc.text(importNodes(doc, nodes));\n },\n parseHTML(this: CheerioAPI, data?: string | null, context?: unknown, keepScripts = typeof context === 'boolean' ? context : false): AnyNode[] | null {\n if (!data || typeof data !== 'string') return null;\n if (typeof context === 'boolean') keepScripts = context;\n const parsed = this.load(data, this._options, false);\n if (!keepScripts) parsed('script').remove();\n return parsed._root.children.slice();\n },\n extract<M extends ExtractMap>(this: CheerioAPI, map: M): ExtractedMap<M> { return this.root().extract(map); },\n contains,\n merge,\n};\n\nfunction makeRoot(document: NativeDocument, children: number[]): number {\n const id = operation<number>(document, 'createNode', { type: 'root' });\n operation(document, 'setNode', { id, field: 'children', value: children });\n return id;\n}\n\nexport function load(content: LoadContent, options?: CheerioOptions | null, isDocument = true): CheerioAPI {\n if (content == null) throw new Error('cheerio.load() expects a string');\n const opts = flattenOptions(options);\n const binding = requireNative();\n const string = Buffer.isBuffer(content) ? content.toString() : typeof content === 'string' ? content : undefined;\n const document = string === undefined ? routeDocument(new binding.NativeDocument('', false, JSON.stringify(cleanParserOptions(opts))), opts) : parseNativeDocument(string, opts, isDocument);\n if (string !== undefined) return createAPI(document, opts);\n const nodes = importNodes(document, content);\n if (!Array.isArray(content) && (content as AnyNode).type === 'root') return createAPI(document, opts, nodes[0]);\n operation(document, 'setNode', { id: document.rootId(), field: 'children', value: nodes });\n return createAPI(routeDocument(document, opts), opts);\n}\n\nexport async function loadAsync(content: LoadContent, options?: CheerioOptions | null, isDocument = true): Promise<CheerioAPI> {\n if (content == null) throw new Error('cheerio.load() expects a string');\n if (typeof content !== 'string' && !Buffer.isBuffer(content)) return load(content, options, isDocument);\n const binding = requireNative();\n const opts = flattenOptions(options);\n const html = String(content);\n // User parser hooks execute on JavaScript, exactly where their callbacks live.\n if (!opts._useHtmlParser2 && opts.treeAdapter) {\n const session = createTreeAdapterSession(opts, isDocument);\n try { await session.write(html); return createAPI(await session.end(), opts); }\n catch (error) { session.abort(); throw error; }\n }\n if (opts._useHtmlParser2 && opts.Tokenizer) return createAPI(parseNativeDocument(html, opts, isDocument), opts);\n const document = binding.parseAsync ? await binding.parseAsync(html, isDocument, JSON.stringify(parserOptions(html, opts))) : new binding.NativeDocument(html, isDocument, JSON.stringify(parserOptions(html, opts)));\n deliverParseErrors(document, opts);\n return createAPI(routeDocument(document, opts), opts);\n}\n\nexport function contains(container: AnyNode, contained: AnyNode): boolean {\n if (!container || !contained || container === contained) return false;\n let parent = nodeBinding(container);\n if (!parent) {\n const document = routeDocument(new (requireNative().NativeDocument)('', false));\n importNodes(document, [container]); parent = nodeBinding(container);\n }\n const child = nodeBinding(contained);\n return !!parent && !!child && sameNodeSpace(child.document, parent.document) && operation(parent.document, 'contains', { container: parent.id, contained: child.id });\n}\n\nexport function merge<T>(first: ArrayLike<T>, second: ArrayLike<T>): ArrayLike<T> | undefined {\n const arrayLike = (value: any): boolean => Array.isArray(value) || value && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && Array.from({ length: value.length }, (_unused, i) => i in value).every(Boolean);\n if (!arrayLike(first) || !arrayLike(second)) return undefined;\n const writable = first as { [key: number]: T; length: number };\n let length = first.length;\n for (let i = 0, count = +second.length; i < count; i++) writable[length++] = second[i];\n writable.length = length;\n return writable;\n}\n\nfunction parallelOptions(options?: ParallelOptions | null): { options: CheerioOptions; threads: number } {\n const { threads = Math.min(availableParallelism(), 256), ...opts } = options ?? {};\n if (!Number.isSafeInteger(threads) || threads < 1 || threads > 256) throw new RangeError('threads must be an integer from 1 to 256');\n return { options: flattenOptions(opts), threads };\n}\n\nexport async function loadAll(content: readonly string[], options?: ParallelOptions | null, isDocument = true): Promise<CheerioAPI[]> {\n return loadAllWithPlans(content, options, isDocument);\n}\n\n/**\n * Loads documents in parallel. With `plans`, the parsing threads also run\n * them on each root and build each document's snapshot, which extraction\n * with callbacks would otherwise do on the calling thread when it needs them.\n */\nasync function loadAllWithPlans(content: readonly string[], options: ParallelOptions | null | undefined, isDocument: boolean, plans?: ReturnType<typeof rootExtractPlans>): Promise<CheerioAPI[]> {\n const { options: opts, threads } = parallelOptions(options);\n if (!Array.isArray(content) || content.some((item) => typeof item !== 'string')) throw new TypeError('loadAll expects an array of HTML strings');\n if (!content.length) return [];\n const binding = requireNative();\n if (!binding.parseManyAsync || hasParserHooks(opts)) return Promise.all(content.map((html) => loadAsync(html, opts, isDocument)));\n const documents = await binding.parseManyAsync([...content], isDocument, threads, JSON.stringify(opts), plans && JSON.stringify(plans));\n return documents.map((document) => {\n const routed = routeDocument(document, opts);\n if (plans) {\n usePreparedSnapshot(routed);\n prepareExtractPlans(routed, plans, document.takePreparedPlans?.());\n }\n return createAPI(routed, opts);\n });\n}\n\nfunction nativeQueries(map: ExtractMap, options: CheerioOptions): NativeQuery[] | undefined {\n const queries: NativeQuery[] = [];\n const plainProperties = /^(?:id|class|title|href|src|alt|name|data-.+|aria-.+)$/;\n for (const key in map) {\n const entry = map[key]; const all = Array.isArray(entry); const descriptor = all ? entry[0] : entry;\n const selector = typeof descriptor === 'string' ? descriptor : descriptor.selector;\n const value = typeof descriptor === 'string' ? 'textContent' : descriptor.value ?? 'textContent';\n if (typeof value !== 'string' || value !== 'textContent' && !plainProperties.test(value) || options.baseURI && (value === 'href' || value === 'src') || options.pseudos) return undefined;\n queries.push({ key, selector, all, ...(value === 'textContent' ? {} : { attr: value }) });\n }\n return queries;\n}\n\nexport async function extractAll<M extends ExtractMap>(content: readonly string[], map: M, options?: ParallelOptions | null): Promise<ExtractedMap<M>[]> {\n const { options: opts, threads } = parallelOptions(options);\n if (!Array.isArray(content) || content.some((item) => typeof item !== 'string')) throw new TypeError('extractAll expects an array of HTML strings');\n if (!content.length) return [];\n const binding = requireNative();\n const plan = hasParserHooks(opts) ? undefined : compileExtractPlan(map, opts);\n if (binding.extractPlanManyAsync && plan) {\n const results: Record<string, unknown>[] = JSON.parse(await binding.extractPlanManyAsync([...content], JSON.stringify(plan), threads, JSON.stringify(opts)));\n for (const result of results) hydrateExtractResult(result, plan.entries);\n return results as ExtractedMap<M>[];\n }\n const queries = binding.extractPlanManyAsync || hasParserHooks(opts) ? undefined : nativeQueries(map, opts);\n if (binding.extractManyAsync && queries) {\n const results: Record<string, unknown>[] = JSON.parse(await binding.extractManyAsync([...content], queries, threads, true, JSON.stringify(opts)));\n for (const result of results) for (const query of queries) {\n if (!Object.hasOwn(result, query.key)) Object.defineProperty(result, query.key, { value: query.all ? [] : undefined, configurable: true, writable: true, enumerable: true });\n if (query.all && Array.isArray(result[query.key])) result[query.key] = (result[query.key] as unknown[]).filter((value) => value != null);\n }\n return results as ExtractedMap<M>[];\n }\n const documents = await loadAllWithPlans(content, { ...opts, threads }, true, hasParserHooks(opts) ? undefined : rootExtractPlans(map, opts));\n const results: ExtractedMap<M>[] = [];\n let yieldedAt = performance.now();\n for (const document of documents) {\n const root = document.root();\n try { results.push((await extractCooperatively(root, map)).value); } finally { releaseExtractPlans(root[DOCUMENT]); }\n if (performance.now() - yieldedAt >= 4) { await yieldToEventLoop(); yieldedAt = performance.now(); }\n }\n return results;\n}\n"],"mappings":";;;;;;;;;;AAcA,MAAM,mCAAmB,IAAI,IAAI;CAC/B;CAAe;CAAa;CAAa;CAAa;CAAW;CACjE;CAAY;CAAM;CAAS;CAAa;CAAS;CAAQ;CAAO;CAAO;CACvE;CAAS;CAAQ;CAAW;CAAY;CAAY;CAAY;CAChE;CAAY;CAAU;CAAQ;CAAa;CAAY;CAAQ;AACjE,CAAC;AAED,SAAS,UAAU,QAAgB,KAA6C;CAC9E,KAAK,IAAI,UAAyB,QAAQ,SAAS,UAAU,OAAO,eAAe,OAAO,GAAG;EAC3F,IAAI,MAAM,QAAQ,OAAO,GAAG,OAAO,KAAA;EACnC,MAAM,aAAa,OAAO,yBAAyB,SAAS,GAAG;EAC/D,IAAI,YAAY,OAAO,WAAW,aAAa,EAAE,OAAO,WAAW,MAAM,IAAI,KAAA;CAC/E;CACA,OAAO,EAAE,OAAO,KAAA,EAAU;AAC5B;;AAGA,SAAgB,mBAAmB,KAAiB,SAAkD;CACpG,IAAI,QAAQ,WAAW,QAAQ,eAAe,QAAQ,aAAa,QAAQ,OAAO,OAAO,QAAQ,QAAQ,YAAY,QAAQ,IAAI,WAAW,OAAO,KAAA;CACnJ,MAAM,4BAAY,IAAI,I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OAAO;AACT"}
1
+ {"version":3,"file":"modern-BwcwZX6l.mjs","names":["parse","parse","request","requestHTTPS","requestHTTP","stringifyQuery","nativeDOM.Node","nativeDOM.DataNode","nativeDOM.NodeWithChildren","nativeDOM.Document","nativeDOM.Element","nativeDOM.Text","nativeDOM.Comment","nativeDOM.ProcessingInstruction","nativeDOM.CDATA","nativeDOM.ElementType","nativeDOM.isTag","nativeDOM.isText","nativeDOM.isComment","nativeDOM.isDirective","nativeDOM.isDocument","nativeDOM.isCDATA","nativeDOM.hasChildren","yieldToEventLoop"],"sources":["../src/extract-plan.ts","../src/attributes.ts","../src/parse.ts","../src/match.ts","../src/selection.ts","../src/extract.ts","../src/workers.ts","../src/io.ts","../src/modern.ts"],"sourcesContent":["import type { CheerioOptions, ExtractMap } from './types.js';\nimport { types } from 'node:util';\n\nexport interface ExtractPlanEntry {\n key: string;\n selector: string;\n all: boolean;\n value: { kind: 'property'; name: string } | { kind: 'map'; entries: ExtractPlanEntry[] };\n}\n\nexport interface ExtractPlan { version: 1; entries: ExtractPlanEntry[] }\n\n// Properties that can be returned as ordinary values. Properties returning DOM\n// views stay on the regular API so their identities and document leases survive.\nconst scalarProperties = new Set([\n 'textContent', 'innerText', 'innerHTML', 'outerHTML', 'tagName', 'nodeName',\n 'nodeType', 'id', 'class', 'className', 'title', 'href', 'src', 'alt', 'name',\n 'value', 'type', 'checked', 'selected', 'disabled', 'multiple', 'readOnly',\n 'required', 'hidden', 'open', 'autofocus', 'controls', 'loop', 'muted',\n]);\n\nfunction dataValue(object: object, key: string): { value: unknown } | undefined {\n for (let current: object | null = object; current; current = Object.getPrototypeOf(current)) {\n if (types.isProxy(current)) return undefined;\n const descriptor = Object.getOwnPropertyDescriptor(current, key);\n if (descriptor) return 'value' in descriptor ? { value: descriptor.value } : undefined;\n }\n return { value: undefined };\n}\n\n/** Compile pure extraction maps. User callbacks and accessors keep JS semantics. */\nexport function compileExtractPlan(map: ExtractMap, options: CheerioOptions): ExtractPlan | undefined {\n if (options.pseudos || options.treeAdapter || options.Tokenizer || options.xml && typeof options.xml === 'object' && options.xml.Tokenizer) return undefined;\n const ancestors = new Set<object>();\n const compile = (input: unknown): ExtractPlanEntry[] | undefined => {\n if (!input || typeof input !== 'object' || types.isProxy(input) || ancestors.has(input) || ancestors.size >= 64) return undefined;\n for (let current = Object.getPrototypeOf(input); current; current = Object.getPrototypeOf(current)) {\n if (types.isProxy(current)) return undefined;\n }\n ancestors.add(input);\n try {\n const entries: ExtractPlanEntry[] = [];\n for (const key in input) {\n // Cheerio uses an ordinary result object. Its legacy __proto__ setter\n // semantics must execute through the JavaScript path.\n if (key === '__proto__') return undefined;\n const inherited = Object.getOwnPropertyDescriptor(Object.prototype, key);\n if (inherited && (!('value' in inherited) || !inherited.writable)) return undefined;\n const slot = dataValue(input, key);\n if (!slot) return undefined;\n const all = Array.isArray(slot.value);\n if (slot.value && typeof slot.value === 'object' && types.isProxy(slot.value)) return undefined;\n const first = all ? dataValue(slot.value as object, '0') : slot;\n if (!first) return undefined;\n const descriptor = first.value;\n let selector: unknown;\n let value: unknown;\n if (typeof descriptor === 'string') { selector = descriptor; value = 'textContent'; }\n else if (descriptor && typeof descriptor === 'object') {\n if (types.isProxy(descriptor)) return undefined;\n const selectorSlot = dataValue(descriptor, 'selector');\n const valueSlot = dataValue(descriptor, 'value');\n if (!selectorSlot || !valueSlot) return undefined;\n selector = selectorSlot.value;\n value = valueSlot.value ?? 'textContent';\n } else return undefined;\n if (typeof selector !== 'string') return undefined;\n if (typeof value === 'string') {\n if (!scalarProperties.has(value) && !/^(?:data-|aria-).+/.test(value)) return undefined;\n entries.push({ key, selector, all, value: { kind: 'property', name: value } });\n } else {\n const nested = compile(value);\n if (!nested) return undefined;\n entries.push({ key, selector, all, value: { kind: 'map', entries: nested } });\n }\n }\n return entries;\n } finally { ancestors.delete(input); }\n };\n const entries = compile(map);\n return entries && { version: 1, entries };\n}\n\n/** JSON omits undefined fields; restore them recursively without changing order. */\nexport function hydrateExtractResult(result: Record<string, unknown>, entries: ExtractPlanEntry[]): void {\n const values = entries.map((entry) => Object.hasOwn(result, entry.key) ? result[entry.key] : entry.all ? [] : undefined);\n for (const entry of entries) delete result[entry.key];\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n Object.defineProperty(result, entry.key, { value: values[index], enumerable: true, configurable: true, writable: true });\n if (entry.value.kind !== 'map') continue;\n const nested = result[entry.key];\n for (const value of entry.all && Array.isArray(nested) ? nested : [nested]) {\n if (value && typeof value === 'object' && !Array.isArray(value)) hydrateExtractResult(value as Record<string, unknown>, entry.value.entries);\n }\n }\n}\n","import type { AnyNode, CheerioOptions, Element, SerializedField } from './types.js';\nimport type { Cheerio } from './selection.js';\nimport type { NativeDocument } from './native.js';\nimport { getNode, hydrateLocation, importNodes, nodeRecord } from './nodes.js';\nimport { attributeAt, DOCUMENT, plainSnapshot, recordAt, VIEW_LOCAL, VIEW_SELF, VIEW_STATE, type DocumentState } from './router.js';\n\nexport interface StyleProp {\n length: number;\n [key: string]: string | number;\n [index: number]: string;\n}\n\nexport interface AttributeMethods<T = AnyNode> {\n attr<U extends AnyNode>(this: Cheerio<U>, name: string): string | undefined;\n attr<U extends AnyNode>(this: Cheerio<U>): Record<string, string> | undefined;\n attr<U extends AnyNode>(this: Cheerio<U>, name: string, value?: string | null | ((this: Element, index: number, value: string) => string | null)): Cheerio<U>;\n attr<U extends AnyNode>(this: Cheerio<U>, values: Record<string, string | null>): Cheerio<U>;\n prop<U extends AnyNode>(this: Cheerio<U>, name: 'tagName' | 'nodeName'): string | undefined;\n prop<U extends AnyNode>(this: Cheerio<U>, name: 'innerHTML' | 'outerHTML' | 'innerText' | 'textContent'): string | null;\n prop<U extends AnyNode>(this: Cheerio<U>, name: 'style'): StyleProp | undefined;\n prop<U extends AnyNode>(this: Cheerio<U>, name: 'href' | 'src'): string | undefined;\n prop<U extends AnyNode, K extends keyof Element>(this: Cheerio<U>, name: K): Element[K];\n prop<U extends AnyNode, K extends keyof Element>(this: Cheerio<U>, name: K, value: Element[K] | ((this: Element, index: number, property: K) => Element[keyof Element])): Cheerio<U>;\n prop<U extends AnyNode>(this: Cheerio<U>, values: Record<string, string | Element[keyof Element] | boolean>): Cheerio<U>;\n prop<U extends AnyNode>(this: Cheerio<U>, name: string, value: string | boolean | null | ((this: Element, index: number, property: string) => string | boolean)): Cheerio<U>;\n prop<U extends AnyNode>(this: Cheerio<U>, name: string): string;\n data<U extends AnyNode>(this: Cheerio<U>, name: string): unknown;\n data<U extends AnyNode>(this: Cheerio<U>): Record<string, unknown>;\n data<U extends AnyNode>(this: Cheerio<U>, name: string, value: unknown): Cheerio<U>;\n data<U extends AnyNode>(this: Cheerio<U>, values: Record<string, unknown>): Cheerio<U>;\n val<U extends AnyNode>(this: Cheerio<U>): string | string[] | undefined;\n val<U extends AnyNode>(this: Cheerio<U>, value: string | string[]): Cheerio<U>;\n removeAttr<U extends AnyNode>(this: Cheerio<U>, name: string): Cheerio<U>;\n hasClass<U extends AnyNode>(this: Cheerio<U>, name: string): boolean;\n addClass<U extends AnyNode, R extends ArrayLike<U>>(this: R, name?: string | ((this: Element, index: number, current: string) => string | undefined)): R;\n removeClass<U extends AnyNode, R extends ArrayLike<U>>(this: R, name?: string | ((this: Element, index: number, current: string) => string | undefined)): R;\n toggleClass<U extends AnyNode, R extends ArrayLike<U>>(this: R, name?: string | ((this: Element, index: number, current: string, state?: boolean) => string), state?: boolean): R;\n css<U extends AnyNode>(this: Cheerio<U>, names?: string[]): Record<string, string> | undefined;\n css<U extends AnyNode>(this: Cheerio<U>, name: string): string | undefined;\n css<U extends AnyNode>(this: Cheerio<U>, name: string, value: string | ((this: Element, index: number, current: string) => string | undefined)): Cheerio<U>;\n css<U extends AnyNode>(this: Cheerio<U>, values: Record<string, string>): Cheerio<U>;\n serializeArray<U extends AnyNode>(this: Cheerio<U>): SerializedField[];\n serialize<U extends AnyNode>(this: Cheerio<U>): string;\n}\n\ntype Selection = Cheerio<AnyNode>;\ntype DataRecord = Record<string, unknown>;\ntype DataDocument = NativeDocument & {\n retainNodeData?: (id: number, data: DataRecord) => void;\n nodeData?: (id: number) => DataRecord | undefined;\n nodeDataOperation?: (id: number) => (command: string, args: unknown) => unknown;\n};\n\nconst elementTypes = new Set(['tag', 'script', 'style']);\n/** Boolean attributes read as their name in HTML, matched case-insensitively as Cheerio does. */\nconst booleanAttribute = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i;\n\nconst absent = Symbol('absent');\nconst deferred = Symbol('deferred');\n\n/**\n * Reads an attribute of the selection's first node, as Cheerio reads it from\n * `this[0]`, from cached records; `deferred` leaves the read to the native\n * `attr` operation and `absent` means there is no such attribute.\n */\nfunction readAttribute(selection: Selection, name: string): string | typeof absent | typeof deferred {\n const node = selection[0] as unknown as Record<string | symbol, unknown> | null | undefined;\n if (typeof node !== 'object' || node === null) return absent;\n const state = node[VIEW_STATE] as DocumentState | undefined;\n if (state === undefined || node[VIEW_SELF] !== node) return typeof node.type === 'string' ? deferred : absent;\n const local = node[VIEW_LOCAL] as number;\n const snapshot = plainSnapshot(state, local);\n const record = snapshot ? undefined : recordAt(state, local);\n const type = snapshot ? snapshot.typeOf(local) : record?.type;\n if (type === undefined || !elementTypes.has(type)) return absent;\n const value = attributeAt(state, local, name);\n if (value === undefined) {\n // Snapshot attributes are all strings; a record may hold another value, which the native read interprets.\n const attributes = record?.attribs as Record<string, unknown> | undefined;\n if (attributes && Object.hasOwn(attributes, name)) return deferred;\n return name === 'value' ? deferred : absent;\n }\n const options = selection.options ?? {};\n const isXml = options.xmlMode ?? (options.xml === true || (typeof options.xml === 'object' && options.xml !== null));\n return !isXml && booleanAttribute.test(name) ? name : value;\n}\n\n/** Writes one attribute through the routed document's typed path when it has one. */\nfunction setAttribute(selection: Selection, ids: number[], name: string, value: string | null): void {\n const document = selection[DOCUMENT] as NativeDocument & { setAttribute?(ids: number[], name: string, value: string | null): void };\n if (document.setAttribute) document.setAttribute(ids, name, value);\n else selection.op('attr', { ids, name, value });\n}\n\nfunction isElement(selection: Selection, id: number): boolean {\n return ['tag', 'script', 'style'].includes(nodeRecord(selection[DOCUMENT], id)?.type);\n}\n\nfunction nativeValue(value: unknown): unknown {\n // Preserve JSON's primitive normalization without serializing and parsing it.\n if (value === null || typeof value === 'string' || typeof value === 'boolean') return value;\n if (typeof value === 'number') return Number.isFinite(value) ? (value === 0 ? 0 : value) : { __nativeNumber: String(value) };\n const seen = new WeakSet<object>();\n const json = JSON.stringify(value, (_key, value: unknown) => {\n if (typeof value === 'function' || typeof value === 'symbol' || typeof value === 'bigint' || value === undefined) return { __opaqueJavaScriptValue: true };\n if (typeof value === 'number' && !Number.isFinite(value)) return { __nativeNumber: String(value) };\n if (value && typeof value === 'object') {\n if (seen.has(value)) return { __opaqueJavaScriptValue: true };\n seen.add(value);\n }\n return value;\n });\n return json === undefined ? { __opaqueJavaScriptValue: true } : JSON.parse(json);\n}\n\nfunction hydrateValue(value: any): any {\n if (value && typeof value === 'object') {\n if (Object.keys(value).length === 1 && typeof value.__nativeNumber === 'string') return Number(value.__nativeNumber);\n for (const key of Object.keys(value)) value[key] = hydrateValue(value[key]);\n }\n return value;\n}\n\nfunction dataObject(selection: Selection, id: number): Record<string, unknown> {\n // The router stores data per node and carries it along when a node moves\n // between documents, preserving data identities and callback references.\n const document = selection[DOCUMENT] as DataDocument;\n let data = document.nodeData?.(id);\n if (!data) {\n const dispatch = document.nodeDataOperation?.(id) ?? ((command: string, args: unknown) => JSON.parse(document.op(command, JSON.stringify(args))));\n const target: Record<string, unknown> = {};\n data = new Proxy(target, {\n set(object, name, value) {\n Reflect.set(object, name, value);\n if (typeof name === 'string') dispatch('data', { ids: [id], name, value: nativeValue(value) });\n return true;\n },\n defineProperty(object, name, descriptor) {\n Reflect.defineProperty(object, name, descriptor);\n if (typeof name === 'string' && 'value' in descriptor) dispatch('data', { ids: [id], name, value: nativeValue(descriptor.value) });\n return true;\n },\n deleteProperty(object, name) {\n Reflect.deleteProperty(object, name);\n if (typeof name === 'string') dispatch('removeData', { ids: [id], name });\n return true;\n },\n });\n document.retainNodeData?.(id, data);\n }\n const node = getNode(selection[DOCUMENT], id);\n // JS data can contain callbacks, cycles, and object identities. The DOM and\n // parsed data values live in Rust; the node exposes the JS values.\n if (!Object.hasOwn(node, 'data')) {\n const values = data;\n Object.defineProperty(node, 'data', { configurable: true, enumerable: true, get: () => values, set: (value: Record<string, unknown>) => { for (const key of Object.keys(values)) delete values[key]; for (const key of Object.keys(value ?? {})) values[key] = value[key]; } });\n }\n return data;\n}\n\nfunction property(selection: Selection, id: number, name: string, raw = false): any {\n const result = selection.op('prop', { ids: [id], name, ...(raw ? { raw: true } : {}) });\n if (name === 'sourceCodeLocation') return hydrateLocation(result);\n return result?.__nativeNodeProperty ? (getNode(selection[DOCUMENT], id) as any)[result.__nativeNodeProperty] : result === null ? undefined : result;\n}\n\nfunction propertyValue(selection: Selection, name: string, value: any): any {\n if (name === 'children' || name === 'childNodes') return importNodes(selection[DOCUMENT], value);\n if (['parent', 'parentNode', 'prev', 'previousSibling', 'next', 'nextSibling'].includes(name)) return value == null ? null : importNodes(selection[DOCUMENT], [value])[0] ?? null;\n return value;\n}\n\nfunction attr(this: Selection, name?: any, value?: any): any {\n if (typeof name === 'object' || value !== undefined) {\n if (typeof value === 'function') {\n if (typeof name !== 'string') throw new Error('Bad combination of arguments.');\n this.ids.forEach((id, index) => {\n if (!isElement(this, id)) return;\n const node = getNode(this[DOCUMENT], id) as Element;\n const current = node.attribs[name];\n const next = value.call(node, index, current);\n setAttribute(this, [id], name, next === null ? null : String(next));\n });\n } else if (typeof name === 'object') {\n for (const key of Object.keys(name)) setAttribute(this, this.ids, key, name[key] === null ? null : String(name[key]));\n } else {\n setAttribute(this, this.ids, name, value === null ? null : String(value));\n }\n return this;\n }\n if (arguments.length > 1) return this;\n if (typeof name === 'string') {\n const cached = readAttribute(this, name);\n if (cached === absent) return undefined;\n if (cached !== deferred) return cached;\n }\n const result = this.op('attr', { ids: this.ids, ...(typeof name === 'string' ? { name } : {}) });\n if (result === null) return undefined;\n return !name && this.ids.length ? (getNode(this[DOCUMENT], this.ids[0]) as Element).attribs : result;\n}\n\nfunction prop(this: Selection, name: any, value?: any): any {\n if (typeof name === 'string' && value === undefined) return this.ids.length ? property(this, this.ids[0], name) : undefined;\n if (typeof name === 'object' || value !== undefined) {\n if (typeof value === 'function') {\n if (typeof name === 'object') throw new TypeError('Bad combination of arguments.');\n this.ids.forEach((id, index) => {\n if (!isElement(this, id)) return;\n const next = value.call(getNode(this[DOCUMENT], id), index, property(this, id, name, true));\n this.op('prop', { ids: [id], name, value: propertyValue(this, name, next) });\n });\n } else if (typeof name === 'object') {\n for (const key of Object.keys(name)) this.op('prop', { ids: this.ids, name: key, value: propertyValue(this, key, name[key]) });\n } else {\n this.op('prop', { ids: this.ids, name, value: propertyValue(this, name, value) });\n }\n return this;\n }\n return undefined;\n}\n\nfunction data(this: Selection, name?: any, value?: unknown): any {\n const first = this.ids[0];\n if (first === undefined || !isElement(this, first)) return undefined;\n if (name != null && (typeof name === 'object' || value !== undefined)) {\n for (const id of this.ids) {\n if (!isElement(this, id)) continue;\n const record = dataObject(this, id);\n if (typeof name === 'object') for (const key of Object.keys(name)) record[key] = name[key];\n else if (typeof name === 'string') record[name] = value;\n }\n return this;\n }\n const record = dataObject(this, first);\n if (typeof name === 'string' && Object.hasOwn(record, name)) return record[name];\n const found = this.op<{ found: boolean; value?: any }>('data', { ids: [first], ...(name == null ? {} : { name }) });\n if (!found.found) return undefined;\n if (name == null) {\n for (const key of Object.keys(found.value)) if (!Object.hasOwn(record, key)) record[key] = hydrateValue(found.value[key]);\n return record;\n }\n record[name] = hydrateValue(found.value);\n return record[name];\n}\n\nfunction css(this: Selection, name?: any, value?: any): any {\n if (name != null && value != null || typeof name === 'object' && !Array.isArray(name)) {\n if (typeof name === 'object') {\n for (const [propertyIndex, key] of Object.keys(name).entries()) {\n if (typeof name[key] === 'function') {\n for (const id of this.ids) {\n if (!isElement(this, id)) continue;\n const current = this.op('css', { ids: [id], name: key }) ?? undefined;\n const next = name[key].call(getNode(this[DOCUMENT], id), propertyIndex, current);\n this.op('css', { ids: [id], name: key, value: next == null ? null : String(next) });\n }\n } else this.op('css', { ids: this.ids, name: key, value: name[key] == null ? null : String(name[key]) });\n }\n } else if (typeof name === 'string' && typeof value === 'function') {\n this.ids.forEach((id, index) => {\n if (!isElement(this, id)) return;\n const current = this.op('css', { ids: [id], name }) ?? undefined;\n const next = value.call(getNode(this[DOCUMENT], id), index, current);\n this.op('css', { ids: [id], name, value: next == null ? null : String(next) });\n });\n } else if (typeof name === 'string') this.op('css', { ids: this.ids, name, value: value == null ? null : String(value) });\n return this;\n }\n return this.op('css', { ids: this.ids, ...(name === undefined ? {} : { name }) }) ?? undefined;\n}\n\nfunction classMethod(command: 'addClass' | 'removeClass' | 'toggleClass') {\n return function(this: Selection, name?: any, state?: boolean): Selection {\n if (typeof name === 'function') {\n this.ids.forEach((id, index) => {\n if (!isElement(this, id)) return;\n const node = getNode(this[DOCUMENT], id) as Element;\n const next = command === 'toggleClass'\n ? name.call(node, index, node.attribs.class ?? '', state)\n : name.call(node, index, node.attribs.class ?? '');\n if (typeof next === 'string') this.op(command, { ids: [id], name: next, ...(typeof state === 'boolean' ? { state } : {}) });\n });\n } else if (typeof name === 'string' || command === 'removeClass' && arguments.length === 0) {\n this.op(command, { ids: this.ids, ...(typeof name === 'string' ? { name } : { all: true }), ...(typeof state === 'boolean' ? { state } : {}) });\n }\n return this;\n };\n}\n\nexport function installAttributes(CheerioClass: { prototype: object }): void {\n Object.assign(CheerioClass.prototype, {\n attr, prop, data, css,\n removeAttr(this: Selection, name: string) {\n const ids = this.ids;\n for (const single of String(name).split(/\\s+/)) if (single) setAttribute(this, ids, single, null);\n return this;\n },\n hasClass(this: Selection, name: string) { return this.op<boolean>('hasClass', { ids: this.ids, name }); },\n addClass: classMethod('addClass'), removeClass: classMethod('removeClass'), toggleClass: classMethod('toggleClass'),\n val(this: Selection, value?: unknown) {\n if (arguments.length === 0) return this.op('val', { ids: this.ids }) ?? undefined;\n const result = this.op('val', { ids: this.ids, value: value === undefined ? { __undefinedJavaScriptValue: true } : value });\n return result?.chain === false ? result.returnValue : result === false ? undefined : this;\n },\n serializeArray(this: Selection) { return this.op<SerializedField[]>('serializeArray', { ids: this.ids }); },\n serialize(this: Selection) { return this.op<string>('serialize', { ids: this.ids }); },\n });\n}\n","import { requireNative } from './native.js';\nimport { getNode, importNodes, nodeBinding, operation } from './nodes.js';\nimport { routeDocument } from './router.js';\nimport { parseNativeDocument, cleanParserOptions } from './hooks.js';\nimport type { AnyNode, Document, InternalOptions, ParentNode } from './types.js';\n\ntype ParseContent = string | Buffer | Document | AnyNode | AnyNode[];\ntype Parser = (content: string, options: InternalOptions, isDocument: boolean, context: ParentNode | null) => Document;\n\n/** Parse with the Rust HTML5 or HTML/XML engine, preserving fragment context. */\nfunction parseWithNative(content: string, options: InternalOptions, isDocument: boolean, context: ParentNode | null): Document {\n if (!isDocument && context) {\n const document = nodeBinding(context)?.document\n ?? routeDocument(new (requireNative().NativeDocument)('', false, JSON.stringify(cleanParserOptions(options))), options);\n const contextId = importNodes(document, [context])[0];\n const children = operation<number[]>(document, 'create', { html: content, contextId, options });\n const root = operation<number>(document, 'createNode', { type: 'root', options });\n operation(document, 'setNode', { id: root, field: 'children', value: children, options });\n return getNode(document, root) as Document;\n }\n const document = parseNativeDocument(content, options, isDocument);\n return getNode(document, document.rootId()) as Document;\n}\n\n/** The HTML5 adapter uses Rust's HTML5 tree builder. */\nexport function parseWithParse5(content: string, options: InternalOptions, isDocument: boolean, context: ParentNode | null): Document {\n return parseWithNative(content, { ...options, _useHtmlParser2: false, xml: false, xmlMode: false }, isDocument, context);\n}\n\n/** The htmlparser2-compatible adapter uses the Rust HTML/XML tokenizer. */\nexport function parseWithHtmlparser2(content: string, options: InternalOptions): Document {\n return parseWithNative(content, { ...options, _useHtmlParser2: true }, false, null);\n}\n\nexport { parseWithHtmlparser2 as parseDocument };\n\n/** Normalize parser inputs while keeping every DOM operation in the native arena. */\nexport function getParse(parser: Parser) {\n return function parse(content: ParseContent, options: InternalOptions, isDocument: boolean, context: ParentNode | null): Document {\n if (Buffer.isBuffer(content)) content = content.toString();\n if (typeof content === 'string') return parser(content, options, isDocument, context);\n if (!Array.isArray(content) && content.type === 'root' && nodeBinding(content)) return content;\n const document = routeDocument(new (requireNative().NativeDocument)('', false, JSON.stringify(cleanParserOptions(options))), options);\n const ids = importNodes(document, content);\n if (!Array.isArray(content) && content.type === 'root') return getNode(document, ids[0]) as Document;\n operation(document, 'setNode', { id: document.rootId(), field: 'children', value: ids, options });\n return getNode(document, document.rootId()) as Document;\n };\n}\n\nexport const parse = getParse((content, options, isDocument, context) => options._useHtmlParser2\n ? parseWithHtmlparser2(content, options)\n : parseWithParse5(content, options, isDocument, context));\n","import type { NativeDocument } from './native.js';\nimport type { CheerioOptions } from './types.js';\nimport { attributeAt, isRouted, recordAt, stateIn, structureSnapshot, type DocumentState } from './router.js';\nimport { NodeSnapshot } from './snapshot.js';\n\n/**\n * One compound selector: an optional type plus id, class and attribute-presence\n * tests. Lowercased names are kept for documents that lowercase names.\n */\ninterface Compound { tag: string | undefined; lowerTag: string | undefined; ids: string[]; classes: string[]; attributes: string[]; lowerAttributes: string[] }\n\nconst compiled = new Map<string, Compound[] | null>();\nconst compiledLimit = 512;\n\n/**\n * Matches `ids` against selectors simple enough to evaluate on cached records,\n * with the native engine's semantics; `undefined` means the caller must ask\n * the native engine (any other syntax, foreign documents or parser options).\n */\nexport function matchSimpleSelector(document: NativeDocument, ids: readonly number[], selector: string, options: CheerioOptions): number[] | undefined {\n if (!isRouted(document)) return undefined;\n const compounds = compile(selector);\n if (!compounds) return undefined;\n const isXml = isXmlMode(options);\n const isLowerCaseTags = options.lowerCaseTags ?? !isXml;\n const isLowerCaseAttributes = options.lowerCaseAttributeNames ?? !isXml;\n const result: number[] = [];\n for (const id of ids) {\n const state = stateIn(document, id);\n if (!sameMatchOptions(state.options, isXml, isLowerCaseTags, isLowerCaseAttributes)) return undefined;\n const local = id - state.base;\n for (const compound of compounds) {\n if (matchesCompound(state, local, compound, isLowerCaseTags, isLowerCaseAttributes)) { result.push(id); break; }\n }\n }\n return result;\n}\n\n/** Nodes a single `find()` walks in JavaScript before leaving larger subtrees to the native engine. */\nconst walkBudget = 4096;\n/** Documents small enough that walking all of them in JavaScript beats a native call. */\nconst smallDocumentNodes = 512;\n/** Documents small enough that taking a snapshot to walk them still beats a native call. */\nconst tinyDocumentNodes = 64;\n\n/**\n * Selects the descendants of one element, or of the root of a small\n * document, that match a simple selector, in document order, as the native\n * `select` does; `undefined` defers to it.\n */\nexport function selectSimpleWithin(document: NativeDocument, contexts: readonly number[], selector: string, options: CheerioOptions): number[] | undefined {\n if (contexts.length !== 1 || !isRouted(document)) return undefined;\n const compounds = compile(selector);\n if (!compounds) return undefined;\n const isXml = isXmlMode(options);\n const isLowerCaseTags = options.lowerCaseTags ?? !isXml;\n const isLowerCaseAttributes = options.lowerCaseAttributeNames ?? !isXml;\n const state = stateIn(document, contexts[0]);\n if (!sameMatchOptions(state.options, isXml, isLowerCaseTags, isLowerCaseAttributes)) return undefined;\n const context = contexts[0] - state.base;\n const size = Math.max(state.baseline, state.snapshotSize);\n const isDocumentRoot = context === (state.rootLocal ??= state.raw.rootId());\n const contextType = isDocumentRoot ? 'root' : typeAt(state, context);\n // After a write, walking would cost a fresh snapshot; the native engine reads the arena directly.\n // A walk reads every node: worthwhile with a current snapshot, or when a tiny unchanged document needs one.\n const isReadable = state.bulk instanceof NodeSnapshot ? size <= smallDocumentNodes : state.generation === 0 && size <= tinyDocumentNodes;\n const isSmallRoot = contextType === 'root' && isReadable;\n if (!isElementType(contextType) && !isSmallRoot) return undefined;\n const result: number[] = [];\n const stack: number[] = [];\n pushChildren(state, context, stack);\n for (let visited = 0; stack.length; visited++) {\n if (visited === walkBudget) return undefined;\n const local = stack.pop()!;\n const type = typeAt(state, local);\n // Template contents: outside an element's descendants, but selected from the document root.\n if (type === 'root') { if (isSmallRoot) return undefined; continue; }\n if (isElementType(type)) {\n for (const compound of compounds) {\n if (matchesCompound(state, local, compound, isLowerCaseTags, isLowerCaseAttributes)) { result.push(state.base + local); break; }\n }\n }\n pushChildren(state, local, stack);\n }\n return result;\n}\n\nconst isElementType = (type: string | undefined): boolean => type === 'tag' || type === 'script' || type === 'style';\n\nfunction typeAt(state: DocumentState, local: number): string | undefined {\n const snapshot = structureSnapshot(state, local);\n return snapshot ? snapshot.typeOf(local) : recordAt(state, local)?.type;\n}\n\n/** Pushes children last to first, so they pop in document order. */\nfunction pushChildren(state: DocumentState, local: number, stack: number[]): void {\n const snapshot = structureSnapshot(state, local);\n if (snapshot) {\n for (let index = snapshot.childCount(local) - 1; index >= 0; index--) stack.push(snapshot.childAt(local, index));\n return;\n }\n const children = recordAt(state, local)?.children ?? [];\n for (let index = children.length - 1; index >= 0; index--) stack.push(children[index]);\n}\n\nfunction isXmlMode(options: CheerioOptions): boolean {\n return options.xmlMode ?? (options.xml === true || typeof options.xml === 'object' && options.xml !== null);\n}\n\n/** Records were parsed with the document's options; matching must use the same name casing. */\nfunction sameMatchOptions(documentOptions: CheerioOptions, isXml: boolean, isLowerCaseTags: boolean, isLowerCaseAttributes: boolean): boolean {\n const isDocumentXml = isXmlMode(documentOptions);\n return isDocumentXml === isXml\n && (documentOptions.lowerCaseTags ?? !isDocumentXml) === isLowerCaseTags\n && (documentOptions.lowerCaseAttributeNames ?? !isDocumentXml) === isLowerCaseAttributes;\n}\n\nfunction matchesCompound(state: DocumentState, local: number, compound: Compound, isLowerCaseTags: boolean, isLowerCaseAttributes: boolean): boolean {\n const snapshot = structureSnapshot(state, local);\n const record = snapshot ? undefined : recordAt(state, local);\n if (!snapshot && !record) return false;\n if (!isElementType(snapshot ? snapshot.typeOf(local) : record!.type)) return false;\n if (compound.tag !== undefined && (snapshot ? snapshot.nameOf(local) : record!.name) !== (isLowerCaseTags ? compound.lowerTag : compound.tag)) return false;\n for (const id of compound.ids) if (attributeAt(state, local, 'id') !== id) return false;\n if (compound.classes.length) {\n const classes = attributeAt(state, local, 'class');\n if (classes === undefined) return false;\n for (const name of compound.classes) if (!hasClass(classes, name)) return false;\n }\n for (const name of isLowerCaseAttributes ? compound.lowerAttributes : compound.attributes) if (attributeAt(state, local, name) === undefined) return false;\n return true;\n}\n\nconst isAsciiWhitespace = (code: number): boolean => code === 32 || code === 9 || code === 10 || code === 12 || code === 13;\n\n/** Whether `name` is one of the ASCII-whitespace-separated tokens of `classes`. */\nfunction hasClass(classes: string, name: string): boolean {\n for (let start = classes.indexOf(name); start !== -1; start = classes.indexOf(name, start + 1)) {\n const end = start + name.length;\n if ((start === 0 || isAsciiWhitespace(classes.charCodeAt(start - 1))) && (end === classes.length || isAsciiWhitespace(classes.charCodeAt(end)))) return true;\n }\n return false;\n}\n\nfunction asciiLowerCase(value: string): string {\n return /[A-Z]/.test(value) ? value.replace(/[A-Z]/g, (letter) => letter.toLowerCase()) : value;\n}\n\nfunction compile(selector: string): Compound[] | null {\n const cached = compiled.get(selector);\n if (cached !== undefined) return cached;\n const result = parse(selector);\n if (compiled.size >= compiledLimit) compiled.clear();\n compiled.set(selector, result);\n return result;\n}\n\nconst identifierStart = /[A-Za-z_]/;\nconst identifierPart = /[A-Za-z0-9_-]/;\n\n/** Parses the supported subset; anything else (escapes, combinators, pseudos, values) yields `null`. */\nfunction parse(selector: string): Compound[] | null {\n const compounds: Compound[] = [];\n let index = 0;\n const skipSpace = (): void => { while (index < selector.length && isAsciiWhitespace(selector.charCodeAt(index))) index++; };\n const identifier = (): string | null => {\n const start = index;\n if (selector[index] === '-') index++;\n if (!identifierStart.test(selector[index] ?? '')) return null;\n while (index < selector.length && identifierPart.test(selector[index])) index++;\n return selector.slice(start, index);\n };\n for (;;) {\n skipSpace();\n const compound: Compound = { tag: undefined, lowerTag: undefined, ids: [], classes: [], attributes: [], lowerAttributes: [] };\n let hasPart = false;\n if (selector[index] === '*') { index++; hasPart = true; }\n else if (/[A-Za-z]/.test(selector[index] ?? '')) { compound.tag = identifier()!; hasPart = true; }\n for (;;) {\n const character = selector[index];\n if (character === '#' || character === '.') {\n index++;\n const name = identifier();\n if (name === null) return null;\n (character === '#' ? compound.ids : compound.classes).push(name);\n } else if (character === '[') {\n index++;\n skipSpace();\n const name = identifier();\n if (name === null) return null;\n skipSpace();\n if (selector[index] !== ']') return null;\n index++;\n compound.attributes.push(name);\n } else break;\n hasPart = true;\n }\n if (!hasPart) return null;\n compound.lowerTag = compound.tag === undefined ? undefined : asciiLowerCase(compound.tag);\n compound.lowerAttributes = compound.attributes.map(asciiLowerCase);\n compounds.push(compound);\n skipSpace();\n if (index === selector.length) return compounds;\n if (selector[index] !== ',') return null;\n index++;\n }\n}\n","import type { AnyNode, Document, Element, ParentNode, CheerioAPI, CheerioOptions, AcceptedFilters, BasicAcceptedElems, AcceptedElems, ExtractMap, ExtractedMap } from './types.js';\nimport { requireNative, type NativeDocument } from './native.js';\nimport { getNode, importNodes, nodeBinding, nodeId, nodeRecord, operation, isTag, traverseRecords, viewId } from './nodes.js';\nimport { installAttributes, type AttributeMethods } from './attributes.js';\nimport { extract } from './extract.js';\nimport { API, DOCUMENT, exposeDocumentTo, IDS, IS_PLAIN, LEASE, leaseNodes, prepareBulkViews, routeDocument, sameNodeSpace, updateLease, VALUES, type Lease } from './router.js';\nimport { parse } from './parse.js';\nimport { matchSimpleSelector, selectSimpleWithin } from './match.js';\nconst numeric = /^(?:0|[1-9]\\d*)$/;\nconst isMarkup = (value: string) => /<[a-zA-Z!/?]/.test(value);\nfunction* customPseudoArguments(selector: string, name: string): Generator<string | undefined> {\n let attributeDepth = 0;\n let quote = '';\n for (let index = 0; index < selector.length; index++) {\n const character = selector[index];\n if (character === '\\\\') {\n index++;\n continue;\n }\n if (quote) {\n if (character === quote)\n quote = '';\n continue;\n }\n if (character === '\"' || character === \"'\") {\n quote = character;\n continue;\n }\n if (character === '[') {\n attributeDepth++;\n continue;\n }\n if (character === ']') {\n attributeDepth--;\n continue;\n }\n if (attributeDepth || character !== ':' || selector[index - 1] === ':')\n continue;\n const start = index + 1;\n let end = start;\n while (/[\\w-]/.test(selector[end] ?? '') && end < selector.length)\n end++;\n if (selector.slice(start, end).toLowerCase() !== name.toLowerCase())\n continue;\n index = end - 1;\n if (selector[end] !== '(') {\n yield undefined;\n continue;\n }\n const argumentStart = end + 1;\n let depth = 1;\n let argumentQuote = '';\n for (end++; end < selector.length; end++) {\n const next = selector[end];\n if (next === '\\\\') {\n end++;\n continue;\n }\n if (argumentQuote) {\n if (next === argumentQuote)\n argumentQuote = '';\n continue;\n }\n if (next === '\"' || next === \"'\") {\n argumentQuote = next;\n continue;\n }\n if (next === '(')\n depth++;\n else if (next === ')' && --depth === 0)\n break;\n }\n if (depth)\n continue; // The native selector parser reports malformed syntax.\n yield selector.slice(argumentStart, end);\n index = end;\n }\n}\nconst isIndex = (property: string | symbol): boolean => {\n if (typeof property !== 'string') return false;\n const first = property.charCodeAt(0);\n return first >= 48 && first <= 57 && numeric.test(property);\n};\n/** Results up to this size are plain objects holding their nodes, like Cheerio's own selections. */\nconst plainSelectionLimit = 5;\nconst lengthOf = (target: Cheerio<any>): number => target[VALUES]?.length ?? target[IDS].length;\nfunction nodeAt(target: Cheerio<any>, index: number): any {\n if (target[VALUES]) return target[VALUES][index];\n const id = target[IDS][index];\n return id === undefined ? undefined : getNode(target[DOCUMENT], id);\n}\nfunction releaseIds(target: Cheerio<any>): void {\n if (target[LEASE]) updateLease(target[DOCUMENT], target[LEASE], target[VALUES] ? [] : target[IDS]);\n}\nfunction writeIndex(target: Cheerio<any>, index: number, value: any): void {\n if (target[VALUES]) target[VALUES][index] = value;\n else {\n const id = importNodes(target[DOCUMENT], [value])[0];\n if (id === undefined) {\n target[VALUES] = target[IDS].map((existing) => getNode(target[DOCUMENT], existing));\n target[VALUES][index] = value;\n }\n else target[IDS][index] = id;\n }\n releaseIds(target);\n}\n/** Large selections resolve nodes only when an index is read. */\nconst selectionHandler: ProxyHandler<Cheerio<any>> = {\n get: (target, property) => isIndex(property) ? nodeAt(target, Number(property)) : property === 'length' ? lengthOf(target) : Reflect.get(target, property),\n set: (target, property, value) => {\n if (isIndex(property)) { writeIndex(target, Number(property), value); return true; }\n if (property === 'length') {\n if (target[VALUES]) target[VALUES].length = value;\n else target[IDS].length = value;\n releaseIds(target);\n return true;\n }\n return Reflect.set(target, property, value);\n },\n has: (target, property) => isIndex(property) ? Number(property) < lengthOf(target) : property === 'length' || Reflect.has(target, property),\n ownKeys: (target) => [...Array.from({ length: lengthOf(target) }, (_, i) => String(i)), 'length', ...Reflect.ownKeys(target)],\n getOwnPropertyDescriptor: (target, property) => {\n if (isIndex(property) && Number(property) < lengthOf(target))\n return { value: nodeAt(target, Number(property)), writable: true, configurable: true, enumerable: true };\n if (property === 'length') return { value: lengthOf(target), writable: true, configurable: true, enumerable: true };\n return Reflect.getOwnPropertyDescriptor(target, property);\n },\n deleteProperty: (target, property) => {\n if (isIndex(property)) {\n if (target[VALUES])\n delete target[VALUES][Number(property)];\n else\n delete target[IDS][Number(property)];\n releaseIds(target);\n return true;\n }\n return Reflect.deleteProperty(target, property);\n },\n};\n/** An array-like selection of native nodes. */\nexport class Cheerio<T = AnyNode> implements ArrayLike<T>, Iterable<T> {\n [index: number]: T;\n /** @internal */ declare [DOCUMENT]: NativeDocument;\n /** @internal */ declare [API]: CheerioAPI;\n /** @internal */ declare [IDS]: number[];\n /** @internal */ declare [VALUES]: T[] | undefined;\n /** @internal */ declare [LEASE]: Lease | undefined;\n /** @internal Whether the selection holds its items as own index properties, as Cheerio's selections do. */ declare [IS_PLAIN]: boolean;\n /** @internal */ get _document(): NativeDocument { return this[DOCUMENT]; }\n /** @internal */ get _api(): CheerioAPI { return this[API]; }\n /** @internal */ get _ids(): number[] { return this[IDS]; }\n declare length: number;\n declare options: CheerioOptions;\n declare _root: Cheerio<Document> | null;\n declare prevObject: Cheerio<any> | undefined;\n declare cheerio: '[cheerio object]';\n constructor(api: CheerioAPI, document: NativeDocument, ids: number[] = [], root: Cheerio<Document> | null = null, options: CheerioOptions = {}, values?: T[]) {\n this[DOCUMENT] = document;\n this[API] = api;\n this[IDS] = ids;\n this[VALUES] = values;\n this[LEASE] = undefined;\n const count = values ? values.length : ids.length;\n const isPlain = count <= plainSelectionLimit;\n this[IS_PLAIN] = isPlain;\n // Own keys enumerate in Cheerio's order: length, options, _root.\n if (isPlain) this.length = count;\n this.options = options;\n this._root = root;\n if (isPlain) {\n // Each node object keeps its own node alive, so a plain selection needs no lease.\n if (values) for (let index = 0; index < count; index++) this[index] = values[index];\n else for (let index = 0; index < count; index++) this[index] = getNode(document, ids[index]) as T;\n return;\n }\n if (!values) this[LEASE] = leaseNodes(document, this, ids);\n return new Proxy(this, selectionHandler);\n }\n /** @internal Re-reads a plain selection after direct index writes or after its nodes moved documents. */\n _syncIndices(): void {\n const length = this.length;\n const values = this[VALUES];\n const ids = this[IDS];\n let isChanged = (values ?? ids).length !== length;\n for (let index = 0; !isChanged && index < length; index++) isChanged = values ? this[index] !== values[index] : viewId(this[index]) !== ids[index];\n if (!isChanged) return;\n const items: T[] = Array.from({ length }, (_unused, index) => this[index]);\n const isAllNodes = items.every((value: any) => value && typeof value === 'object' && typeof value.type === 'string');\n this[VALUES] = isAllNodes ? undefined : items;\n this[IDS] = isAllNodes ? importNodes(this[DOCUMENT], items) : [];\n }\n /** @internal */ get ids(): number[] {\n if (this[IS_PLAIN]) this._syncIndices();\n return this[VALUES] ? importNodes(this[DOCUMENT], this[VALUES]) : this[IDS];\n }\n /** @internal */ op<R = any>(command: string, args: unknown = {}): R { const values = args as Record<string, unknown>; return operation<R>(this[DOCUMENT], command, { ...values, options: values.options ?? this.options }); }\n /** @internal */ _query(command: 'select' | 'matches', args: {\n selector: string;\n ids?: number[];\n contexts?: number[];\n options?: CheerioOptions;\n }): number[] {\n const pseudos = this.options.pseudos;\n const callbacks = pseudos ? Object.entries(pseudos).filter((entry): entry is [\n string,\n (element: Element, argument?: string | null) => boolean\n ] => typeof entry[1] === 'function') : [];\n if (!callbacks.length) {\n if (command === 'matches' && args.ids) {\n const matched = matchSimpleSelector(this[DOCUMENT], args.ids, args.selector, args.options ?? this.options);\n if (matched) return matched;\n }\n if (command === 'select' && args.contexts) {\n const found = selectSimpleWithin(this[DOCUMENT], args.contexts, args.selector, args.options ?? this.options);\n if (found) return found;\n }\n return command === 'select' && !args.options ? this[DOCUMENT].select(args.selector, args.contexts) : this.op(command, args);\n }\n const pseudoMatches: Record<string, number[]> = {};\n const candidates = [...new Set([...this[DOCUMENT].select('*'), ...(args.ids ?? []), ...(args.contexts ? this[DOCUMENT].select('*', args.contexts) : [])])];\n for (const [name, callback] of callbacks) {\n for (const argument of customPseudoArguments(args.selector, name)) {\n if (argument !== undefined && callback.length < 2)\n throw new Error(`Pseudo-class :${name} doesn't have any arguments`);\n if (argument === undefined && callback.length >= 2)\n throw new Error(`Pseudo-class :${name} requires an argument`);\n pseudoMatches[`${name}(${argument ?? ''})`] = candidates.filter((id) => callback(getNode(this[DOCUMENT], id) as Element, argument ?? null));\n }\n }\n return this.op(command, { ...args, pseudoMatches });\n }\n /** @internal */ _fromIds<R = AnyNode>(ids: number[]): Cheerio<R> {\n const result = new (this[API].fn.constructor as typeof Cheerio)<R>(this[API], this[DOCUMENT], ids, this._root, this.options);\n result.prevObject = this;\n return result;\n }\n /** @internal */ _fromValues<R>(values: R[]): Cheerio<R> {\n const allNodes = values.every((value: any) => value && typeof value === 'object' && typeof value.type === 'string');\n const result = new (this[API].fn.constructor as typeof Cheerio)<R>(this[API], this[DOCUMENT], allNodes ? importNodes(this[DOCUMENT], values) : [], this._root, this.options, allNodes ? undefined : values);\n result.prevObject = this;\n return result;\n }\n _make<R>(value: ArrayLike<R> | R | string, context?: BasicAcceptedElems<AnyNode>): Cheerio<R>;\n _make<R>(value: any, context?: any): Cheerio<R> {\n const result = typeof value === 'string' || value?.cheerio ? this[API](value, context) : this._fromValues<R>(value == null ? [] : typeof value === 'object' && 'length' in value && !value.type ? Array.from(value) : [value]);\n result.prevObject = this;\n return result as Cheerio<R>;\n }\n _parse(content: any, options: CheerioOptions, isDocument: boolean, context: ParentNode | null): Document {\n return parse(content, options, isDocument, context);\n }\n _render(content: any): string { return this[DOCUMENT].outerHtml(importNodes(this[DOCUMENT], content)); }\n /** @internal */ _domIds(content: any, contextId?: number): number[] {\n if (content == null || content === false)\n return [];\n if (typeof content === 'string')\n return this.op('create', { html: content, contextId, options: this.options });\n if (content?.cheerio) {\n if (!content[DOCUMENT] || !sameNodeSpace(this[DOCUMENT], content[DOCUMENT]))\n return importNodes(this[DOCUMENT], content.toArray());\n exposeDocumentTo(this[DOCUMENT], content[DOCUMENT]);\n return content.ids;\n }\n if (typeof content === 'object' && 'length' in content && !content.type)\n return Array.from(content as ArrayLike<any>).flatMap((item) => this._domIds(item, contextId));\n return importNodes(this[DOCUMENT], [content]);\n }\n _makeDomArray<T extends AnyNode>(this: Cheerio<T>, elem?: BasicAcceptedElems<AnyNode> | BasicAcceptedElems<AnyNode>[], clone?: boolean): AnyNode[];\n _makeDomArray(this: Cheerio<any>, content: any, clone: any = false): any {\n const ids = this._domIds(content);\n return (clone ? this.op<number[]>('clone', { ids, deep: true }) : ids).map((id) => getNode(this[DOCUMENT], id));\n }\n find<T extends AnyNode>(this: Cheerio<T>, selectorOrHaystack?: string | Cheerio<Element> | Element): Cheerio<Element>;\n find(this: Cheerio<any>, selector?: any): any {\n if (!selector)\n return this._fromIds([]);\n if (typeof selector === 'string')\n return this._findBySelector(selector, Infinity);\n const ids = importNodes(this[DOCUMENT], selector);\n return this._fromIds(ids.filter((id) => this.ids.some((container) => this.op<boolean>('contains', { container, contained: id }))));\n }\n _findBySelector<T extends AnyNode>(this: Cheerio<T>, selector: string, limit: number): Cheerio<Element>;\n _findBySelector(this: Cheerio<any>, selector: any, limit: any): any {\n const ids = this._query('select', { selector, contexts: this.ids });\n return this._fromIds(Number.isFinite(limit) ? ids.slice(0, limit) : ids);\n }\n /** @internal */ _filterIds(ids: number[], selector?: any): number[] {\n if (!selector)\n return ids;\n if (typeof selector === 'string')\n return this._query('matches', { ids, selector, options: this.options });\n return ids.filter((id, index) => this._predicate(selector, getNode(this[DOCUMENT], id), index));\n }\n /** @internal */ _predicate(selector: any, node: any, index: number): boolean {\n if (typeof selector === 'function')\n return !!selector.call(node, index, node);\n if (typeof selector === 'string')\n return this._query('matches', { ids: importNodes(this[DOCUMENT], [node]), selector, options: this.options }).length > 0;\n if (selector?.cheerio)\n return selector.toArray().includes(node);\n return node === selector;\n }\n /** @internal */ _traverse(kind: string, selector?: any): Cheerio<Element> {\n let ids = traverseRecords(this[DOCUMENT], this.ids, kind) ?? this.op<number[]>('traverse', { ids: this.ids, kind });\n ids = this._filterIds(ids, selector);\n if (this.length > 1 && ids.length > 1) {\n if (kind === 'parents' || kind === 'siblings')\n ids = this.op('uniqueSort', { ids });\n else if (!['next', 'prev', 'contents'].includes(kind))\n ids = [...new Set(ids)];\n if (kind === 'parents')\n ids.reverse();\n }\n return this._fromIds(ids);\n }\n parent<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n parent(this: Cheerio<any>, selector?: any): any { return this._traverse('parent', selector); }\n parents<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n parents(this: Cheerio<any>, selector?: any): any { return this._traverse('parents', selector); }\n next<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n next(this: Cheerio<any>, selector?: any): any { return this._traverse('next', selector); }\n prev<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n prev(this: Cheerio<any>, selector?: any): any { return this._traverse('prev', selector); }\n nextAll<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n nextAll(this: Cheerio<any>, selector?: any): any { return this._traverse('nextAll', selector); }\n prevAll<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n prevAll(this: Cheerio<any>, selector?: any): any { return this._traverse('prevAll', selector); }\n siblings<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n siblings(this: Cheerio<any>, selector?: any): any { return this._traverse('siblings', selector); }\n children<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<Element>;\n children(this: Cheerio<any>, selector?: any): any { return this._traverse('children', selector); }\n contents<T extends AnyNode>(this: Cheerio<T>): Cheerio<AnyNode>;\n contents(this: Cheerio<any>): any { return this._traverse('contents') as any; }\n /** @internal */ _until(kind: string, until?: any, filter?: any): Cheerio<Element> {\n let ids: number[] = [];\n for (const id of this.ids)\n for (const candidate of traverseRecords(this[DOCUMENT], [id], kind) ?? this.op<number[]>('traverse', { ids: [id], kind })) {\n if (until && this._predicate(until, getNode(this[DOCUMENT], candidate), ids.length))\n break;\n ids.push(candidate);\n }\n ids = this._filterIds(ids, filter);\n if (this.length > 1 && ids.length > 1)\n ids = kind === 'parents' ? this.op<number[]>('uniqueSort', { ids }).reverse() : [...new Set(ids)];\n return this._fromIds(ids);\n }\n parentsUntil<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element> | null, filterSelector?: AcceptedFilters<Element>): Cheerio<Element>;\n parentsUntil(this: Cheerio<any>, until?: any, filter?: any): any { return this._until('parents', until, filter); }\n nextUntil<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element> | null, filterSelector?: AcceptedFilters<Element>): Cheerio<Element>;\n nextUntil(this: Cheerio<any>, until?: any, filter?: any): any { return this._until('nextAll', until, filter); }\n prevUntil<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element> | null, filterSelector?: AcceptedFilters<Element>): Cheerio<Element>;\n prevUntil(this: Cheerio<any>, until?: any, filter?: any): any { return this._until('prevAll', until, filter); }\n closest<T extends AnyNode>(this: Cheerio<T>, selector?: AcceptedFilters<Element>): Cheerio<AnyNode>;\n closest(this: Cheerio<any>, selector?: any): any {\n if (!selector)\n return this._fromIds([]);\n const result: number[] = [];\n for (const id of this.ids) {\n const record = nodeRecord(this[DOCUMENT], id);\n const candidates = [...(['tag', 'script', 'style'].includes(record.type) ? [id] : []), ...(traverseRecords(this[DOCUMENT], [id], 'parents') ?? this.op<number[]>('traverse', { ids: [id], kind: 'parents' }))];\n // One native match for all candidates replaces a round trip per ancestor.\n const matched = typeof selector === 'string' ? new Set(this._filterIds(candidates, selector)) : undefined;\n const match = matched ? candidates.find((candidate) => matched.has(candidate)) : candidates.find((candidate) => this._predicate(selector, getNode(this[DOCUMENT], candidate), 0));\n if (match !== undefined && !result.includes(match))\n result.push(match);\n }\n return this._fromIds(result);\n }\n each<T>(this: Cheerio<T>, fn: (this: T, i: number, el: T) => void | boolean): Cheerio<T>;\n each(this: Cheerio<any>, callback: any): any {\n if (this[IS_PLAIN]) {\n const length = this.length;\n for (let i = 0; i < length; i++)\n if (callback.call(this[i], i, this[i]) === false)\n break;\n return this;\n }\n // Reading ids directly avoids a string-keyed proxy trap per index.\n const values = this[VALUES], ids = this[IDS], document = this[DOCUMENT];\n const length = values ? values.length : ids.length;\n for (let i = 0; i < length; i++) {\n const node = values ? values[i] : getNode(document, ids[i]);\n if (callback.call(node, i, node) === false)\n break;\n }\n return this;\n }\n map<T, M>(this: Cheerio<T>, fn: (this: T, i: number, el: T) => M[] | M | null | undefined): Cheerio<M>;\n map<R>(this: Cheerio<any>, callback: any): any {\n const result: R[] = [];\n const items = this._items();\n for (let i = 0; i < items.length; i++) {\n const value = callback.call(items[i], i, items[i]);\n if (value != null)\n result.push(...(Array.isArray(value) ? value : [value]));\n }\n return this._fromValues(result);\n }\n filter<T, S extends T>(this: Cheerio<T>, match: (this: T, index: number, value: T) => value is S): Cheerio<S>;\n filter<T, S extends AcceptedFilters<T>>(this: Cheerio<T>, match: S): Cheerio<S extends string ? Element : T>;\n filter<S extends AcceptedFilters<T>>(this: Cheerio<any>, selector: any): any {\n return (typeof selector === 'string' ? this._fromIds(this._query('matches', { ids: this.ids, selector, options: this.options })) : this._fromValues(this.toArray().filter((node, i) => this._predicate(selector, node, i)))) as any;\n }\n filterArray<T>(nodes: T[], match: AcceptedFilters<T>, xmlMode?: boolean, root?: Document): Element[] | T[];\n filterArray<R>(this: Cheerio<any>, nodes: any, match: any, xmlMode?: any, root?: any): any {\n const matcher: any = match;\n if (typeof match !== 'string')\n return nodes.filter((node: any, index: number) => typeof matcher === 'function' ? matcher.call(node, index, node) : matcher?.cheerio ? matcher.toArray().includes(node) : matcher === node);\n const document = this?.[DOCUMENT] ?? nodeBinding(root)?.document ?? nodeBinding(nodes[0])?.document ?? routeDocument(new (requireNative().NativeDocument)('', false));\n const ids = importNodes(document, nodes);\n const selected = new Set(operation<number[]>(document, 'matches', { ids, selector: match, options: { xmlMode } }));\n return nodes.filter((node: any) => { const id = nodeId(node, document); return id !== undefined && selected.has(id); });\n }\n not<T extends AnyNode>(this: Cheerio<T>, match: AcceptedFilters<T>): Cheerio<T>;\n not(this: Cheerio<any>, selector: any): any {\n if (typeof selector === 'string') {\n const matched = new Set(this._query('matches', { ids: this.ids, selector, options: this.options }));\n return this._fromIds(this.ids.filter((id) => !matched.has(id)));\n }\n return this._fromValues(this.toArray().filter((node, i) => !this._predicate(selector, node, i)));\n }\n is<T>(this: Cheerio<T>, selector?: AcceptedFilters<T>): boolean;\n is(this: Cheerio<any>, selector?: any): any {\n return typeof selector === 'string' ? this._query('matches', { ids: this.ids, selector, options: this.options }).length > 0 : !!selector && this.toArray().some((node, i) => this._predicate(selector, node, i));\n }\n has(this: Cheerio<AnyNode | Element>, selectorOrHaystack: string | Cheerio<Element> | Element): Cheerio<AnyNode | Element>;\n has(this: Cheerio<any>, selector: any): any { return this.filter(((_i: number, node: any) => this._make(node).find(selector).length > 0) as any) as Cheerio<T>; }\n first<T extends AnyNode>(this: Cheerio<T>): Cheerio<T>;\n first(this: Cheerio<any>): any { return this.length > 1 ? this.slice(0, 1) : this; }\n last<T>(this: Cheerio<T>): Cheerio<T>;\n last(this: Cheerio<any>): any { return this.length > 0 ? this.slice(-1) : this; }\n eq<T>(this: Cheerio<T>, i: number): Cheerio<T>;\n eq(this: Cheerio<any>, index: any): any {\n index = +index;\n if (index === 0 && this.length <= 1)\n return this;\n if (index < 0)\n index += this.length;\n const item = this._itemAt(index);\n return this._fromValues(item === undefined ? [] : [item]);\n }\n get<T>(this: Cheerio<T>, i: number): T | undefined;\n get<T>(this: Cheerio<T>): T[];\n get(this: Cheerio<any>, index?: any): any { return index == null ? this.toArray() : this._itemAt(index < 0 ? this.length + index : index); }\n toArray<T>(this: Cheerio<T>): T[];\n toArray(this: Cheerio<any>): any { return this._items(); }\n /** @internal Every item, read without a proxy trap per index. */\n _items(): T[] {\n if (this[IS_PLAIN]) {\n const length = this.length;\n const items: T[] = new Array(length);\n for (let i = 0; i < length; i++) items[i] = this[i];\n return items;\n }\n const values = this[VALUES], ids = this[IDS], document = this[DOCUMENT];\n if (!values) prepareBulkViews(document, ids);\n return values ? values.slice() : ids.map((id) => getNode(document, id) as T);\n }\n /** @internal */ _itemAt(index: number): T | undefined {\n if (this[IS_PLAIN]) return this[index];\n const values = this[VALUES];\n if (values) return values[index];\n const id = this[IDS][index];\n return id === undefined ? undefined : getNode(this[DOCUMENT], id) as T;\n }\n slice<T>(this: Cheerio<T>, start?: number, end?: number): Cheerio<T>;\n slice(this: Cheerio<any>, start?: any, end?: any): any { const ids = this.ids; return this[VALUES] ? this._fromValues(this[VALUES].slice(start, end)) : this._fromIds(ids.slice(start, end)); }\n end<T>(this: Cheerio<T>): Cheerio<AnyNode>;\n end(this: Cheerio<any>): any { return this.prevObject ?? this._make([]); }\n add<S extends AnyNode, T extends AnyNode>(this: Cheerio<T>, other: string | Cheerio<S> | S | S[], context?: Cheerio<S> | string): Cheerio<S | T>;\n add<R extends AnyNode>(this: Cheerio<any>, other: any, context?: any): any {\n const added = this[API](other, context);\n // Ids of another copy of the package belong to its own id space.\n const addedIds = added[DOCUMENT] && sameNodeSpace(this[DOCUMENT], added[DOCUMENT]) ? added.ids : importNodes(this[DOCUMENT], added.toArray());\n return this._fromIds(this.op('uniqueSort', { ids: [...this.ids, ...addedIds] }));\n }\n addBack<T extends AnyNode>(this: Cheerio<T>, selector?: string): Cheerio<AnyNode>;\n addBack(this: Cheerio<any>, selector?: any): any { return this.prevObject ? this.add(selector ? this.prevObject.filter(selector) : this.prevObject) as any : this as any; }\n index<T extends AnyNode>(this: Cheerio<T>, selectorOrNeedle?: string | Cheerio<AnyNode> | AnyNode): number;\n index(this: Cheerio<any>, selector?: any): any { const haystack = selector == null ? this.parent().children() : typeof selector === 'string' ? this[API](selector) : this; const needle = selector == null || typeof selector === 'string' ? this[0] : selector?.cheerio ? selector[0] : selector; return haystack.toArray().indexOf(needle); }\n splice(start: number, deleteCount?: number): any[];\n splice(start: number, deleteCount: number, ...items: any[]): any[];\n splice(...args: any[]): any[] { return Reflect.apply(Array.prototype.splice, this, args); }\n [Symbol.iterator](): Iterator<T>;\n [Symbol.iterator](): IterableIterator<T> { return this._items()[Symbol.iterator](); }\n /** @internal */ _insert(position: string, content: any[]): this {\n if (typeof content[0] !== 'function') {\n // The native insert skips targets that cannot hold children, and\n // only the last listed target receives the nodes themselves.\n const ids = this.ids;\n if (ids.length) this.op('insert', { targetIds: ids, nodeIds: this._domIds(content), position });\n return this;\n }\n const targets = this.ids.filter((id) => ['root', 'tag', 'script', 'style', 'cdata'].includes(nodeRecord(this[DOCUMENT], id).type));\n if (!targets.length)\n return this;\n return (this as Cheerio<any>).each((index, node: any) => {\n if (!targets.includes(this.ids[index]))\n return;\n if ((position === 'before' || position === 'after') && nodeRecord(this[DOCUMENT], this.ids[index]).parent == null)\n return;\n const value = content[0].call(node, index, this[DOCUMENT].innerHtml(this.ids[index]));\n let nodes = this._domIds(value);\n if (index < this.length - 1)\n nodes = this.op('clone', { ids: nodes, deep: true });\n this.op('insert', { targetIds: [this.ids[index]], nodeIds: nodes, position });\n }) as this;\n }\n append<T extends AnyNode>(this: Cheerio<T>, ...elems: [\n (this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>\n ] | BasicAcceptedElems<AnyNode>[]): Cheerio<T>;\n append(this: Cheerio<any>, ...content: any[]): any { return this._insert('append', content); }\n prepend<T extends AnyNode>(this: Cheerio<T>, ...elems: [\n (this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>\n ] | BasicAcceptedElems<AnyNode>[]): Cheerio<T>;\n prepend(this: Cheerio<any>, ...content: any[]): any { return this._insert('prepend', content); }\n before<T extends AnyNode>(this: Cheerio<T>, ...elems: [\n (this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>\n ] | BasicAcceptedElems<AnyNode>[]): Cheerio<T>;\n before(this: Cheerio<any>, ...content: any[]): any { return this._insert('before', content); }\n after<T extends AnyNode>(this: Cheerio<T>, ...elems: [\n (this: AnyNode, i: number, html: string) => BasicAcceptedElems<AnyNode>\n ] | BasicAcceptedElems<AnyNode>[]): Cheerio<T>;\n after(this: Cheerio<any>, ...content: any[]): any { return this._insert('after', content); }\n appendTo<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;\n appendTo(this: Cheerio<any>, target: any): any { this[API](target).append(this); return this; }\n prependTo<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;\n prependTo(this: Cheerio<any>, target: any): any { this[API](target).prepend(this); return this; }\n /** @internal */ _insertRelative(target: any, position: string): Cheerio<T> {\n const targets = this[API](target).ids;\n (this as Cheerio<any>).remove();\n const inserted: number[] = [];\n for (const id of targets) {\n if (nodeRecord(this[DOCUMENT], id).parent == null)\n continue;\n const clones = this.op<number[]>('clone', { ids: this.ids, deep: true });\n this.op('insert', { targetIds: [id], nodeIds: clones, position });\n inserted.push(...clones);\n }\n return this._fromIds(inserted);\n }\n insertBefore<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;\n insertBefore(this: Cheerio<any>, target: any): any { return this._insertRelative(target, 'before'); }\n insertAfter<T extends AnyNode>(this: Cheerio<T>, target: BasicAcceptedElems<AnyNode>): Cheerio<T>;\n insertAfter(this: Cheerio<any>, target: any): any { return this._insertRelative(target, 'after'); }\n remove<T extends AnyNode>(this: Cheerio<T>, selector?: string): Cheerio<T>;\n remove(this: Cheerio<any>, selector?: any): any { this.op('remove', { ids: selector ? this.filter(selector).ids : this.ids }); return this; }\n replaceWith<T extends AnyNode>(this: Cheerio<T>, content: AcceptedElems<AnyNode>): Cheerio<T>;\n replaceWith(this: Cheerio<any>, content: any): any {\n return this.each((index, node: any) => {\n if (nodeRecord(this[DOCUMENT], this.ids[index]).parent == null)\n return;\n const value = typeof content === 'function' ? content.call(node, index, node) : content;\n this.op('insert', { targetIds: [this.ids[index]], nodeIds: this._domIds(value), position: 'replace' });\n });\n }\n empty<T extends AnyNode>(this: Cheerio<T>): Cheerio<T>;\n empty(this: Cheerio<any>): any {\n for (const id of this.ids)\n this.op('setNode', { id, field: 'children', value: [] });\n return this;\n }\n html<T extends AnyNode>(this: Cheerio<T>): string | null;\n html<T extends AnyNode>(this: Cheerio<T>, str: string | Cheerio<T>): Cheerio<T>;\n html(this: Cheerio<any>, content?: any): any {\n if (content === undefined)\n return this.length && ['root', 'tag', 'script', 'style', 'cdata'].includes(nodeRecord(this[DOCUMENT], this.ids[0]).type) ? this[DOCUMENT].innerHtml(this.ids[0]) : null;\n if (!content?.cheerio) {\n this.op('html', { ids: this.ids, value: String(content) });\n return this;\n }\n for (const id of this.ids) {\n const nodes = content?.cheerio ? importNodes(this[DOCUMENT], content.toArray()) : this._domIds(String(content), id);\n this.op('setNode', { id, field: 'children', value: nodes });\n }\n return this;\n }\n text<T extends AnyNode>(this: Cheerio<T>): string;\n text<T extends AnyNode>(this: Cheerio<T>, str: string | ((this: AnyNode, i: number, text: string) => string)): Cheerio<T>;\n text(this: Cheerio<any>, content?: any): any {\n if (content === undefined)\n return this[DOCUMENT].text(this.ids);\n if (typeof content !== 'function') {\n this.op('text', { ids: this.ids, value: String(content) });\n return this;\n }\n for (let i = 0; i < this.ids.length; i++) {\n const id = this.ids[i];\n const value = typeof content === 'function' ? content.call(getNode(this[DOCUMENT], id), i, this[DOCUMENT].text([id])) : content;\n this.op('text', { ids: [id], value: String(value) });\n }\n return this;\n }\n toString<T extends AnyNode>(this: Cheerio<T>): string;\n toString(this: Cheerio<any>): any { return this[DOCUMENT].outerHtml(this.ids); }\n clone<T extends AnyNode>(this: Cheerio<T>): Cheerio<T>;\n clone(this: Cheerio<any>): any { return this._fromIds(this.op('clone', { ids: this.ids, deep: true })); }\n /** @internal */ _deepest(id: number, tagsOnly = false): number {\n for (;;) {\n const children = this.op<number[]>('traverse', { ids: [id], kind: 'children' });\n const child = tagsOnly ? children.find((candidate) => nodeRecord(this[DOCUMENT], candidate).type === 'tag') : children[0];\n if (child === undefined)\n return id;\n id = child;\n }\n }\n /** @internal */ _wrap(content: any, inner: boolean): this {\n const lastParent = (this as Cheerio<any>).parents().last();\n for (let i = 0; i < this.length; i++) {\n const id = this.ids[i];\n const node = getNode(this[DOCUMENT], id);\n const value = typeof content === 'function' ? content.call(node, i, node) : typeof content === 'string' && !isMarkup(content) ? lastParent.find(content).clone() : content;\n let wrappers = this._domIds(value);\n if (i < this.length - 1)\n wrappers = this.op('clone', { ids: wrappers, deep: true });\n const wrapper = wrappers[0];\n if (wrapper === undefined || !['root', 'tag', 'script', 'style'].includes(nodeRecord(this[DOCUMENT], wrapper).type))\n continue;\n if (inner) {\n if (!['root', 'tag', 'script', 'style', 'cdata'].includes(nodeRecord(this[DOCUMENT], id).type))\n continue;\n const contents = this.op<number[]>('traverse', { ids: [id], kind: 'contents' });\n this.op('setNode', { id: this._deepest(wrapper), field: 'children', value: contents });\n this.op('setNode', { id, field: 'children', value: [wrapper] });\n }\n else if (nodeRecord(this[DOCUMENT], id).parent != null) {\n // A wrapper from another document gets new ids when the insertion moves it here.\n const [inserted = wrapper] = this.op<number[]>('insert', { targetIds: [id], nodeIds: [wrapper], position: 'before' });\n this.op('setNode', { id: this._deepest(inserted), field: 'children', value: [id] });\n }\n }\n return this;\n }\n wrap<T extends AnyNode>(this: Cheerio<T>, wrapper: AcceptedElems<AnyNode>): Cheerio<T>;\n wrap(this: Cheerio<any>, content: any): any { return this._wrap(content, false); }\n wrapInner<T extends AnyNode>(this: Cheerio<T>, wrapper: AcceptedElems<AnyNode>): Cheerio<T>;\n wrapInner(this: Cheerio<any>, content: any): any { return this._wrap(content, true); }\n unwrap<T extends AnyNode>(this: Cheerio<T>, selector?: string): Cheerio<T>;\n unwrap(this: Cheerio<any>, selector?: any): any { this.op('remove', { ids: this.parent(selector).not('body').ids, keepChildren: true }); return this; }\n wrapAll<T extends AnyNode>(this: Cheerio<T>, wrapper: AcceptedElems<T>): Cheerio<T>;\n wrapAll(this: Cheerio<any>, content: any): any {\n if (!this.length)\n return this;\n const first = this[0];\n const wrappers = this._make(typeof content === 'function' ? content.call(first, 0, first) : content).insertBefore(first);\n const root = [...wrappers.ids].reverse().find((id) => nodeRecord(this[DOCUMENT], id).type === 'tag');\n if (root !== undefined)\n this.op('insert', { targetIds: [this._deepest(root, true)], nodeIds: this.ids, position: 'append' });\n return this;\n }\n extract<M extends ExtractMap, T extends AnyNode>(this: Cheerio<T>, map: M): ExtractedMap<M>;\n // A structurally shared object signature breaks recursive enum comparisons\n // across independent DOM declarations; calls retain the precise overload.\n extract<M extends ExtractMap, T extends AnyNode>(this: Cheerio<T>, map: M): Record<string, unknown>;\n extract<M extends ExtractMap>(this: Cheerio<any>, map: any): any { return extract.call(this as any, map) as ExtractedMap<M>; }\n}\nObject.defineProperty(Cheerio.prototype, 'cheerio', { value: '[cheerio object]', writable: true, configurable: true });\nconst inspectCustom = Symbol.for('nodejs.util.inspect.custom');\n// Inspection shows the selection's own string keys, as Cheerio's selections\n// have, without the internals stored under symbols.\nObject.defineProperty(Cheerio.prototype, inspectCustom, {\n configurable: true, writable: true,\n value(this: Cheerio<any>, depth: number, options: { stylize(text: string, style: string): string }, inspect: (value: unknown, options: object) => string): string {\n const prototype = Object.getPrototypeOf(this);\n if (depth < 0) return options.stylize(`[${prototype.constructor.name}]`, 'special');\n const shown: Record<string | symbol, unknown> = Object.create(prototype);\n Object.defineProperty(shown, inspectCustom, { value: undefined });\n for (const key of Object.keys(this)) shown[key] = (this as any)[key];\n return inspect(shown, { ...options, depth });\n },\n});\nexport interface Cheerio<T = AnyNode> extends AttributeMethods<T> {\n}\ninstallAttributes(Cheerio);\n\n/** @internal */\nexport const nativeExtractionMethods = Object.freeze({\n make: Cheerio.prototype._make,\n find: Cheerio.prototype._findBySelector,\n prop: Cheerio.prototype.prop,\n extract: Cheerio.prototype.extract,\n});\n","import { Cheerio, nativeExtractionMethods } from './selection.js';\nimport { types } from 'node:util';\nimport { compileExtractPlan, hydrateExtractResult } from './extract-plan.js';\nimport { decodeJson } from './codec.js';\nimport { DOCUMENT, writeCount } from './router.js';\nimport type { AnyNode, CheerioOptions, Element, ExtractMap, ExtractedMap, ExtractDescriptor } from './types.js';\n\ntype ExtractPlan = NonNullable<ReturnType<typeof compileExtractPlan>>;\n\nexport interface ExtractMethods<T = AnyNode> {\n extract<M extends ExtractMap>(map: M): ExtractedMap<M>;\n}\n\nfunction plainKeys(map: ExtractMap): string[] | undefined {\n return !types.isProxy(map) && (Object.getPrototypeOf(map) === Object.prototype || Object.getPrototypeOf(map) === null) ? Object.keys(map) : undefined;\n}\nfunction nativePrefix(scope: Cheerio<AnyNode>, map: ExtractMap, keys: string[] | undefined, key: string): { keys: string[]; values: Record<string, unknown> } | undefined {\n if (!keys || !hasNativeExtraction(scope)) return undefined;\n const prefix = prefixPlan(map, keys, key, scope.options);\n // A single scalar entry costs one selector call and one property call; the\n // native plan also avoids constructing an intermediate selection for each.\n if (!prefix) return undefined;\n return { keys: prefix.names, values: runPlan(scope, prefix.plan) };\n}\n\n/** The native plan for the longest run of entries from `key` on that compile to one. */\nfunction prefixPlan(map: ExtractMap, keys: string[], key: string, options: CheerioOptions): { names: string[]; plan: ExtractPlan } | undefined {\n // Pure maps are the common case. Compile the complete plan once instead of\n // recompiling each growing prefix; callbacks and inherited entries keep the\n // incremental path so they retain their observable order.\n if (keys[0] === key && keys.every((name) => {\n const slot = Object.getOwnPropertyDescriptor(map, name);\n return !!slot && slot.enumerable && 'value' in slot;\n })) {\n let count = 0;\n let sameKeys = true;\n for (const name in map) { if (name !== keys[count++]) { sameKeys = false; break; } }\n if (sameKeys && count === keys.length) {\n const complete = compileExtractPlan(map, options);\n if (complete) return { names: keys, plan: complete };\n }\n }\n const prefix: ExtractMap = Object.create(null);\n let plan: ExtractPlan | undefined;\n for (let position = keys.indexOf(key); position < keys.length; position++) {\n const name = keys[position];\n const slot = Object.getOwnPropertyDescriptor(map, name);\n if (!slot || !slot.enumerable || !('value' in slot)) break;\n Object.defineProperty(prefix, name, { value: slot.value, enumerable: true, configurable: true });\n const compiled = compileExtractPlan(prefix, options);\n if (!compiled) { delete prefix[name]; break; }\n plan = compiled;\n }\n return plan ? { names: Object.keys(prefix), plan } : undefined;\n}\n\nfunction hasNativeExtraction(scope: Cheerio<AnyNode>): boolean {\n return scope._make === nativeExtractionMethods.make && scope._findBySelector === nativeExtractionMethods.find && scope.prop === nativeExtractionMethods.prop && scope.extract === nativeExtractionMethods.extract;\n}\n\n/** Descriptor callbacks stay in JavaScript; matching and properties use Rust. */\nexport function extract<M extends ExtractMap>(this: Cheerio<AnyNode>, map: M): ExtractedMap<M> {\n const result: Record<string, unknown> = {};\n const keys = plainKeys(map);\n const processed = new Set<string>();\n for (const key in map) {\n if (processed.has(key)) continue;\n const prefix = Object.getPrototypeOf(result) === Object.prototype ? nativePrefix(this, map, keys, key) : undefined;\n if (prefix) {\n for (const name of prefix.keys) { Object.defineProperty(result, name, { value: prefix.values[name], enumerable: true, configurable: true, writable: true }); processed.add(name); }\n continue;\n }\n const entry = map[key];\n const all = Array.isArray(entry);\n const descriptor = (all ? entry[0] : entry) as string | ExtractDescriptor;\n const selector = typeof descriptor === 'string' ? descriptor : descriptor.selector;\n const value = typeof descriptor === 'string' ? 'textContent' : descriptor.value ?? 'textContent';\n const selection = this._findBySelector(selector, all ? Infinity : 1);\n const rows = typeof value === 'object' ? nativeRows(this, key, all, selector, value) : undefined;\n const read = (index: number) => {\n if (typeof value === 'function') return value(selection[index] as Element, key, result);\n const scope = this._make === nativeExtractionMethods.make\n ? this._fromIds([selection.ids[index]])\n : this._make(selection[index]);\n if (typeof value === 'string') return scope.prop(value);\n return rows ? completeRow(scope, value, rows, index) : scope.extract(value);\n };\n let extracted: unknown;\n if (all) {\n const values: unknown[] = [];\n for (let index = 0; index < selection.length; index += 1) {\n const value = read(index);\n if (value != null) values.push(...(Array.isArray(value) ? value : [value]));\n }\n extracted = values;\n } else {\n extracted = selection.length ? read(0) : undefined;\n }\n result[key] = extracted;\n }\n return result as ExtractedMap<M>;\n}\n\n/** Fields of each row that the native engine extracts, for every row in one call. */\ninterface NativeRows { keys: Set<string>; rows: Record<string, unknown>[]; writes: number }\n\n/**\n * For a nested map with callbacks, extracts the fields the native engine can\n * for every matched element in one call, instead of one call per element;\n * the remaining fields are then filled in map order, so each callback sees\n * exactly the fields before it, as in Cheerio.\n */\nfunction nativeRows(scope: Cheerio<AnyNode>, key: string, all: boolean, selector: string, map: ExtractMap): NativeRows | undefined {\n if (!hasNativeExtraction(scope)) return undefined;\n const planned = rowsPlan(key, all, selector, map, scope.options);\n if (!planned) return undefined;\n const writes = writeCount();\n const extracted = runPlan(scope, planned.plan)[key];\n const rows = (all ? extracted : extracted === undefined ? [] : [extracted]) as Record<string, unknown>[];\n return Array.isArray(rows) ? { keys: planned.nativeKeys, rows, writes } : undefined;\n}\n\n/** The native plan for the fields of `map` that compile to one, when only some do. */\nfunction rowsPlan(key: string, all: boolean, selector: string, map: ExtractMap, options: CheerioOptions): { nativeKeys: Set<string>; plan: ExtractPlan } | undefined {\n const keys = plainKeys(map);\n if (!keys) return undefined;\n const subset: ExtractMap = Object.create(null);\n const nativeKeys = new Set<string>();\n for (const name of keys) {\n const slot = Object.getOwnPropertyDescriptor(map, name);\n if (!slot || !slot.enumerable || !('value' in slot)) continue;\n const single: ExtractMap = Object.create(null);\n Object.defineProperty(single, name, { value: slot.value, enumerable: true, configurable: true });\n if (!compileExtractPlan(single, options)) continue;\n Object.defineProperty(subset, name, { value: slot.value, enumerable: true, configurable: true });\n nativeKeys.add(name);\n }\n if (!nativeKeys.size || nativeKeys.size === keys.length) return undefined;\n const outer: ExtractMap = Object.create(null);\n Object.defineProperty(outer, key, { value: all ? [{ selector, value: subset }] : { selector, value: subset }, enumerable: true, configurable: true });\n const plan = compileExtractPlan(outer, options);\n return plan ? { nativeKeys, plan } : undefined;\n}\n\n/**\n * The plans a walk of `map` from a document's root runs first, in order, so\n * a batch can run them on its parsing threads. Callbacks may change the\n * document, so later plans of the walk stay on the calling thread.\n */\nexport function rootExtractPlans(map: ExtractMap, options: CheerioOptions): ExtractPlan[] {\n // Reading a map ahead of the walk must not run code the walk would run in\n // a different order, and a malformed map fails later with the walk's own error.\n if (!isPlainData(map, 0) || hasInheritedEntryFields()) return [];\n try { return collectRootExtractPlans(map, options); } catch { return []; }\n}\n\n/** Whether reading `value` and everything it holds runs no code: no proxies, accessors or class instances. */\nfunction isPlainData(value: unknown, depth: number): boolean {\n if (typeof value !== 'object' || value === null) return true;\n if (depth > 32 || types.isProxy(value)) return false;\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== Array.prototype && prototype !== null) return false;\n for (const key of Reflect.ownKeys(value)) {\n const slot = Object.getOwnPropertyDescriptor(value, key)!;\n if (!('value' in slot) || !isPlainData(slot.value, depth + 1)) return false;\n }\n return true;\n}\n\nfunction hasInheritedEntryFields(): boolean {\n return 'selector' in Object.prototype || 'value' in Object.prototype || '0' in Array.prototype;\n}\n\nfunction collectRootExtractPlans(map: ExtractMap, options: CheerioOptions): ExtractPlan[] {\n const plans: ExtractPlan[] = [];\n const keys = plainKeys(map);\n const processed = new Set<string>();\n for (const key in map) {\n if (processed.has(key)) continue;\n const prefix = keys ? prefixPlan(map, keys, key, options) : undefined;\n if (prefix) {\n for (const name of prefix.names) processed.add(name);\n plans.push(prefix.plan);\n continue;\n }\n const entry = map[key];\n const all = Array.isArray(entry);\n const descriptor = (all ? entry[0] : entry) as string | ExtractDescriptor;\n const value = typeof descriptor === 'string' ? 'textContent' : descriptor.value ?? 'textContent';\n if (typeof value !== 'object' || value === null) continue;\n const planned = rowsPlan(key, all, typeof descriptor === 'string' ? descriptor : descriptor.selector, value, options);\n if (planned) plans.push(planned.plan);\n }\n return plans.filter((plan) => !JSON.stringify(plan).includes('innerHTML'));\n}\n\n/** Results of root plans a batch ran while parsing, valid while no document changes. */\nconst preparedPlans = new WeakMap<object, { writes: number; results: Map<string, string> }>();\n\nexport function prepareExtractPlans(document: object, plans: ExtractPlan[], results: (string | null)[] | null | undefined): void {\n if (!results) return;\n const prepared = new Map<string, string>();\n for (let index = 0; index < plans.length; index++) {\n const result = results[index];\n if (typeof result === 'string') prepared.set(JSON.stringify(plans[index]), decodeJson(result));\n }\n preparedPlans.set(document, { writes: writeCount(), results: prepared });\n}\n\nexport function releaseExtractPlans(document: object): void {\n preparedPlans.delete(document);\n}\n\nfunction runPlan(scope: Cheerio<AnyNode>, plan: ExtractPlan): Record<string, unknown> {\n const document = scope[DOCUMENT] as { rootId(): number };\n const prepared = preparedPlans.get(document);\n const isRoot = prepared !== undefined && prepared.writes === writeCount() && scope.ids.length === 1 && scope.ids[0] === document.rootId();\n const result = isRoot ? prepared.results.get(JSON.stringify(plan)) : undefined;\n const values = result !== undefined ? JSON.parse(result) as Record<string, unknown> : scope.op<Record<string, unknown>>('extractPlan', { ids: scope.ids, plan });\n hydrateExtractResult(values, plan.entries);\n return values;\n}\n\n/**\n * Builds row `index` of a nested map from its native fields and the scope's\n * JavaScript fields. Native fields extracted before a callback changed any\n * document are extracted again, as extracting row by row would see them.\n */\nfunction completeRow(scope: Cheerio<AnyNode>, map: ExtractMap, rows: NativeRows, index: number): Record<string, unknown> {\n const row: Record<string, unknown> = {};\n const native = rows.rows[index] ?? {};\n for (const name in map) {\n if (rows.keys.has(name) && writeCount() === rows.writes) { row[name] = native[name]; continue; }\n const entry: ExtractMap = Object.create(null);\n Object.defineProperty(entry, name, { value: map[name], enumerable: true, configurable: true });\n fillEntries(scope, entry, row);\n }\n return row;\n}\n\n/** Extracts `map`'s entries into `result`, which callbacks receive as built so far. */\nfunction fillEntries(scope: Cheerio<AnyNode>, map: ExtractMap, result: Record<string, unknown>): void {\n for (const key in map) {\n const entry = map[key];\n const all = Array.isArray(entry);\n const descriptor = (all ? entry[0] : entry) as string | ExtractDescriptor;\n const selector = typeof descriptor === 'string' ? descriptor : descriptor.selector;\n const value = typeof descriptor === 'string' ? 'textContent' : descriptor.value ?? 'textContent';\n const selection = scope._findBySelector(selector, all ? Infinity : 1);\n const read = (index: number) => {\n if (typeof value === 'function') return value(selection[index] as Element, key, result);\n const child = scope._make === nativeExtractionMethods.make ? scope._fromIds([selection.ids[index]]) : scope._make(selection[index]);\n return typeof value === 'string' ? child.prop(value) : child.extract(value);\n };\n if (all) {\n const values: unknown[] = [];\n for (let index = 0; index < selection.length; index += 1) {\n const extracted = read(index);\n if (extracted != null) values.push(...(Array.isArray(extracted) ? extracted : [extracted]));\n }\n result[key] = values;\n } else result[key] = selection.length ? read(0) : undefined;\n }\n}\n\nexport function installExtract(CheerioClass: { prototype: object }): void {\n Object.assign(CheerioClass.prototype, { extract });\n}\n\n/** Async batch fallback preserves callback values/order while yielding between visits. */\nexport async function extractCooperatively<M extends ExtractMap>(selection: Cheerio<AnyNode>, map: M): Promise<{ value: ExtractedMap<M> }> {\n let deadline = performance.now() + 4;\n let visits = 0;\n const checkpoint = async () => {\n if (++visits % 32 || performance.now() < deadline) return;\n await new Promise<void>((resolve) => setImmediate(resolve));\n deadline = performance.now() + 4;\n };\n const walk = async (scope: Cheerio<AnyNode>, descriptors: ExtractMap): Promise<{ value: Record<string, unknown> }> => {\n const result: Record<string, unknown> = {};\n const keys = plainKeys(descriptors);\n const processed = new Set<string>();\n for (const key in descriptors) {\n if (processed.has(key)) continue;\n const prefix = Object.getPrototypeOf(result) === Object.prototype ? nativePrefix(scope, descriptors, keys, key) : undefined;\n if (prefix) {\n for (const name of prefix.keys) { Object.defineProperty(result, name, { value: prefix.values[name], enumerable: true, configurable: true, writable: true }); processed.add(name); }\n continue;\n }\n const entry = descriptors[key];\n const all = Array.isArray(entry);\n const descriptor = (all ? entry[0] : entry) as string | ExtractDescriptor;\n const selector = typeof descriptor === 'string' ? descriptor : descriptor.selector;\n const value = typeof descriptor === 'string' ? 'textContent' : descriptor.value ?? 'textContent';\n const found = scope._findBySelector(selector, all ? Infinity : 1);\n const rows = typeof value === 'object' ? nativeRows(scope, key, all, selector, value) : undefined;\n const output: unknown[] = [];\n let single: unknown;\n const count = all ? found.length : Math.min(found.length, 1);\n for (let index = 0; index < count; index++) {\n await checkpoint();\n // Callback return values, including Promise objects, remain ordinary\n // values just as in synchronous Cheerio.extract().\n let extracted: unknown;\n if (typeof value === 'function') extracted = value(found[index] as Element, key, result);\n else {\n const child = scope._make === nativeExtractionMethods.make\n ? scope._fromIds([found.ids[index]])\n : scope._make(found[index]);\n extracted = typeof value === 'string' ? child.prop(value)\n : rows ? completeRow(child, value, rows, index)\n : child.extract === nativeExtractionMethods.extract ? (await walk(child, value)).value : child.extract(value);\n }\n if (all) { if (extracted != null) output.push(...(Array.isArray(extracted) ? extracted : [extracted])); }\n else single = extracted;\n }\n result[key] = all ? output : single;\n }\n return { value: result };\n };\n return await walk(selection, map) as { value: ExtractedMap<M> };\n}\n","import { requireNative, type NativeWorkerPoolInfo } from './native.js';\n\nexport interface WorkerOptions { threads: number }\nexport type WorkerPoolInfo = NativeWorkerPoolInfo;\n\n/** Set the process-wide native CPU-worker budget before starting async work. */\nexport function configureWorkers(options: WorkerOptions | number): WorkerPoolInfo {\n const threads = typeof options === 'number' ? options : options?.threads;\n if (!Number.isSafeInteger(threads) || threads < 1 || threads > 256) throw new RangeError('threads must be an integer from 1 to 256');\n const binding = requireNative();\n if (!binding.configureWorkerPool || !binding.workerPoolInfo) throw new Error('This native build does not support a shared worker pool');\n binding.configureWorkerPool(threads);\n return binding.workerPoolInfo();\n}\n\n/** Observe the configured budget and actual concurrent native CPU work. */\nexport function workerPoolInfo(): WorkerPoolInfo {\n const binding = requireNative();\n if (!binding.workerPoolInfo) throw new Error('This native build does not support worker pool diagnostics');\n return binding.workerPoolInfo();\n}\n","import { Readable, Writable } from 'node:stream';\nimport { request as requestHTTP } from 'node:http';\nimport { request as requestHTTPS } from 'node:https';\nimport { stringify as stringifyQuery } from 'node:querystring';\nimport type { EventEmitter } from 'node:events';\nimport { MIMEType } from 'node:util';\nimport { createAPI, flattenOptions, load } from './modern.js';\nimport { requireNative, type NativeStream } from './native.js';\nimport { createDiagnosticSession, createTokenizerSession, createTreeAdapterSession, deliverParseErrors, parserOptions } from './hooks.js';\nimport { routeDocument } from './router.js';\nimport type { CheerioAPI, CheerioOptions, CheerioRequestOptions, DecodeStreamOptions, EncodingOptions } from './types.js';\n\nexport type LoadCallback = (error: Error | null | undefined, document: CheerioAPI) => void;\n\nfunction encodingLabel(label: string | null | undefined): string | undefined {\n if (!label) return undefined;\n if (label.trim().toLowerCase() === 'x-user-defined') return 'x-user-defined';\n try { return new TextDecoder(label.trim()).encoding; } catch { return undefined; }\n}\n\n/** WHATWG decoding with BOM, transport headers, and the HTML meta prescan. */\nfunction sniffEncoding(buffer: Uint8Array, options: EncodingOptions = {}): string {\n let label: string | undefined;\n if (buffer[0] === 0xef && buffer[1] === 0xbb && buffer[2] === 0xbf) label = 'utf-8';\n else if (buffer[0] === 0xff && buffer[1] === 0xfe) label = 'utf-16le';\n else if (buffer[0] === 0xfe && buffer[1] === 0xff) label = 'utf-16be';\n label ??= encodingLabel((options as EncodingOptions & { userEncoding?: string }).userEncoding);\n label ??= encodingLabel(options.transportLayerEncodingLabel);\n if (!label && buffer[0] === 0 && buffer[1] === 0x3c && buffer[2] === 0 && buffer[3] === 0x3f && buffer[4] === 0 && buffer[5] === 0x78) label = 'utf-16be';\n if (!label && buffer[0] === 0x3c && buffer[1] === 0 && buffer[2] === 0x3f && buffer[3] === 0 && buffer[4] === 0x78 && buffer[5] === 0) label = 'utf-16le';\n if (!label) {\n const prefix = Buffer.from(buffer.subarray(0, options.maxBytes ?? 1024)).toString('latin1').replace(/<!--[\\s\\S]*?(?:-->|$)/g, '');\n for (const token of prefix.matchAll(/<meta\\b([^>]*)>/gi)) {\n const attributes: Record<string, string> = {};\n for (const attribute of token[1].matchAll(/([^\\s=/'\">]+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'>]+)))?/g)) {\n const key = attribute[1].toLowerCase();\n if (!(key in attributes)) attributes[key] = attribute[2] ?? attribute[3] ?? attribute[4] ?? '';\n }\n const declared = attributes.charset ?? (attributes['http-equiv']?.toLowerCase() === 'content-type'\n ? /\\bcharset\\s*=\\s*[\"']?([^\\s;\"']+)/i.exec(attributes.content ?? '')?.[1] : undefined);\n label = encodingLabel(declared);\n if (label) {\n if (label === 'utf-16le' || label === 'utf-16be') label = 'utf-8';\n if (label === 'x-user-defined') label = 'windows-1252';\n break;\n }\n }\n if (!label) {\n const declaration = /<\\?xml\\b[^>]*\\bencoding\\s*=\\s*[\"']([^\"']+)[\"']/i.exec(prefix);\n label = encodingLabel(declaration?.[1]);\n if (label === 'utf-16le' || label === 'utf-16be') label = 'utf-8';\n }\n }\n label ??= encodingLabel(options.defaultEncoding) ?? 'windows-1252';\n return label;\n}\n\nexport function decodeBuffer(buffer: Uint8Array, options: EncodingOptions = {}): string {\n const label = sniffEncoding(buffer, options);\n if (label === 'x-user-defined') {\n let decoded = '';\n for (const byte of buffer) decoded += String.fromCharCode(byte < 0x80 ? byte : 0xf700 + byte);\n return decoded;\n }\n return new TextDecoder(label).decode(buffer);\n}\n\nfunction decodedInput(buffer: Uint8Array, options: DecodeStreamOptions): [string, CheerioOptions] {\n const { encoding, ...parserOptions } = options;\n const xml = !!(options.xmlMode || options.xml);\n return [decodeBuffer(buffer, { defaultEncoding: xml ? 'utf-8' : 'windows-1252', ...encoding }), parserOptions];\n}\n\nexport function loadBuffer(buffer: Buffer | Uint8Array, options: DecodeStreamOptions = {}): CheerioAPI {\n return load(...decodedInput(buffer, options));\n}\n\nfunction completion(callback: LoadCallback): (error?: Error | null, document?: CheerioAPI) => void {\n let completed = false;\n return (error, document) => {\n if (completed) return;\n completed = true;\n callback(error, document as CheerioAPI);\n };\n}\n\nfunction requestHeaders(input: NonNullable<CheerioRequestOptions['requestOptions']>['headers']): Headers {\n if (!input) return new Headers();\n if (input instanceof Headers) return new Headers(input);\n const headers = new Headers();\n if (Array.isArray(input)) {\n if (input.length % 2) throw new TypeError('HTTP header arrays must contain name/value pairs');\n for (let index = 0; index < input.length; index += 2) headers.append(input[index], input[index + 1]);\n } else {\n const entries: Iterable<[string, string | string[] | undefined]> = Symbol.iterator in input\n ? input as Iterable<[string, string | string[] | undefined]> : Object.entries(input);\n for (const [name, value] of entries) {\n if (value == null) continue;\n for (const item of Array.isArray(value) ? value : [value]) headers.append(name, item);\n }\n }\n return headers;\n}\n\ninterface HTTPResponse {\n status: number;\n ok: boolean;\n headers: Headers;\n body: ReadableStream<Uint8Array> | null;\n rawHeaders?: Record<string, string | string[] | undefined>;\n}\n\n/** Node transport exposes informational responses and leaves wire headers alone. */\nasync function requestDocument(url: URL, method: string, headers: Headers, body: NonNullable<CheerioRequestOptions['requestOptions']>['body'], options: NonNullable<CheerioRequestOptions['requestOptions']>, signal: AbortSignal): Promise<HTTPResponse> {\n if (options.typeOfService != null && (!Number.isInteger(options.typeOfService) || options.typeOfService < 0 || options.typeOfService > 255)) {\n throw Object.assign(new Error('typeOfService must be an integer between 0 and 255'), { name: 'InvalidArgumentError', code: 'UND_ERR_INVALID_ARG' });\n }\n let payload: string | Uint8Array | Readable | ReadableStream<Uint8Array> | null | undefined = body as string | Uint8Array | Readable | null | undefined;\n if (body && typeof body === 'object' && !(body instanceof Uint8Array) && !(body instanceof Readable)) {\n // Request supplies Node's built-in multipart encoder for either Node or\n // Undici FormData without requiring the Undici package at runtime.\n let form: FormData;\n if (body instanceof FormData) form = body;\n else {\n form = new FormData();\n for (const [name, value] of body as import('./types.js').FormDataLike) {\n if (typeof value === 'string') form.append(name, value);\n else if ('name' in value && typeof value.name === 'string') form.append(name, value as Blob, value.name);\n else form.append(name, value as Blob);\n }\n }\n const encoded = new Request(url, { method: 'POST', body: form });\n // Node 20's encoder omits the final CRLF used by Undici 7. Keep the\n // request streaming while normalizing that suffix across Node versions.\n payload = Readable.from((async function* () {\n let previous = -1;\n let last = -1;\n for await (const chunk of Readable.fromWeb(encoded.body! as import('node:stream/web').ReadableStream<Uint8Array>)) {\n const bytes = chunk as Buffer;\n if (bytes.length >= 2) previous = bytes[bytes.length - 2];\n else if (bytes.length === 1) previous = last;\n if (bytes.length) last = bytes[bytes.length - 1];\n yield bytes;\n }\n if (previous !== 13 || last !== 10) yield Buffer.from('\\r\\n');\n })());\n if (!requestHeaders(options.headers).has('content-type')) headers.set('content-type', encoded.headers.get('content-type')!);\n }\n if (payload != null && !(payload instanceof Readable) && !(typeof payload === 'object' && 'getReader' in payload) && !headers.has('content-length') && !headers.has('transfer-encoding')) {\n headers.set('content-length', String(typeof payload === 'string' ? Buffer.byteLength(payload) : payload.byteLength));\n }\n const declaredLength = headers.has('content-length') ? Number(headers.get('content-length')) : undefined;\n const lengthError = () => Object.assign(new Error('Request body length does not match content-length header'), { name: 'RequestContentLengthMismatchError', code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' });\n const knownLength = typeof payload === 'string' ? Buffer.byteLength(payload) : payload instanceof Uint8Array ? payload.byteLength : undefined;\n if (declaredLength != null && knownLength != null && declaredLength !== knownLength) throw lengthError();\n if (options.reset === true && !headers.has('connection')) headers.set('connection', 'close');\n return new Promise<HTTPResponse>((resolve, reject) => {\n let informationalError: Error | undefined;\n const request = (url.protocol === 'https:' ? requestHTTPS : requestHTTP)(url, {\n method, headers: Object.fromEntries(headers), signal,\n ...(typeof options.highWaterMark === 'number' ? { highWaterMark: options.highWaterMark } : {}),\n }, response => {\n if (informationalError) { response.destroy(); return; }\n const rawHeaders: Record<string, string | string[]> = {};\n for (let index = 0; index < response.rawHeaders.length; index += 2) {\n const name = response.rawHeaders[index].toLowerCase();\n const value = response.rawHeaders[index + 1];\n if (!Object.hasOwn(rawHeaders, name)) Object.defineProperty(rawHeaders, name, { value, enumerable: true, writable: true, configurable: true });\n else rawHeaders[name] = [...(Array.isArray(rawHeaders[name]) ? rawHeaders[name] : [rawHeaders[name]]) as string[], value];\n }\n const responseHeaders = new Headers();\n for (const [name, value] of Object.entries(rawHeaders)) {\n if (value == null) continue;\n for (const item of Array.isArray(value) ? name === 'content-type' ? value.slice(0, 1) : value : [value]) responseHeaders.append(name, item);\n }\n const status = response.statusCode ?? 0;\n resolve({ status, ok: status >= 200 && status < 300, headers: responseHeaders, rawHeaders, body: Readable.toWeb(response) as ReadableStream<Uint8Array> });\n });\n request.once('error', error => reject(signal.aborted ? signal.reason : error));\n request.on('information', information => {\n try { options.onInfo?.({ statusCode: information.statusCode, headers: information.headers as Record<string, string | string[]> }); }\n catch (error) { informationalError = error as Error; reject(error); request.destroy(error as Error); }\n });\n request.once('socket', socket => {\n const transport = socket as typeof socket & { setTypeOfService?: (value?: number) => void };\n try {\n if (transport.setTypeOfService && options.typeOfService != null) transport.setTypeOfService(options.typeOfService);\n } catch (error) { request.destroy(error as Error); return; }\n if (socket.connecting) {\n const timer = setTimeout(() => request.destroy(Object.assign(new Error('Connect Timeout Error'), { name: 'ConnectTimeoutError', code: 'UND_ERR_CONNECT_TIMEOUT' })), 10000);\n timer.unref();\n socket.once(url.protocol === 'https:' ? 'secureConnect' : 'connect', () => clearTimeout(timer));\n request.once('close', () => clearTimeout(timer));\n }\n });\n if (payload instanceof Readable || payload && typeof payload === 'object' && 'getReader' in payload) {\n const source = payload instanceof Readable ? payload : Readable.fromWeb(payload as unknown as import('node:stream/web').ReadableStream<Uint8Array>);\n if (declaredLength != null) {\n let sent = 0;\n source.on('data', (chunk: Buffer | string) => {\n sent += typeof chunk === 'string' ? Buffer.byteLength(chunk) : chunk.byteLength;\n if (sent > declaredLength) { request.destroy(lengthError()); source.destroy(); }\n });\n source.once('end', () => { if (sent !== declaredLength) request.destroy(lengthError()); });\n }\n source.once('error', error => request.destroy(error));\n request.once('close', () => { if (!source.destroyed) source.destroy(); });\n source.pipe(request);\n } else request.end(payload);\n });\n}\n\n/** A Node writable that feeds the native parser with bounded backpressure. */\nexport function stringStream(options: CheerioOptions, callback: LoadCallback): Writable {\n const complete = completion(callback);\n const opts = flattenOptions(options);\n const xml = !!opts._useHtmlParser2;\n const binding = requireNative();\n let native: NativeStream | undefined;\n let writeNative: (chunk: string) => Promise<void>;\n let finishNative: () => Promise<CheerioAPI>;\n let abortNative: () => void;\n let carry = '';\n if (opts._useHtmlParser2 && opts.Tokenizer) {\n const session = createTokenizerSession(opts);\n // Arbitrary user tokenizers can emit offsets for any earlier input. Retain\n // their source until end rather than changing their callback contract.\n const chunks: string[] = [];\n writeNative = async (chunk) => { chunks.push(chunk); session.write(chunk); };\n finishNative = async () => {\n const document = new binding.NativeDocument(chunks.join(''), true, JSON.stringify(session.end()));\n chunks.length = 0;\n return createAPI(routeDocument(document, opts), opts);\n };\n abortNative = () => { chunks.length = 0; };\n } else if (!opts._useHtmlParser2 && opts.treeAdapter) {\n const session = createTreeAdapterSession(opts, true);\n writeNative = (chunk) => session.write(chunk);\n finishNative = async () => createAPI(await session.end(), opts);\n abortNative = () => session.abort();\n } else if (!opts._useHtmlParser2 && opts.onParseError) {\n const session = createDiagnosticSession(opts, true);\n writeNative = (chunk) => session.write(chunk);\n finishNative = async () => createAPI(await session.end(), opts);\n abortNative = () => session.abort();\n } else {\n if (!binding.NativeStream) throw new Error('This native build does not support incremental parsing');\n native = new binding.NativeStream(JSON.stringify(parserOptions('', opts)), true);\n writeNative = (chunk) => native!.write(chunk);\n finishNative = async () => {\n const document = await native!.finish();\n deliverParseErrors(document, opts);\n return createAPI(routeDocument(document, opts), opts);\n };\n abortNative = () => native!.abort();\n }\n const stream = new Writable({\n decodeStrings: false,\n write(chunk, _encoding, done) {\n if (typeof chunk !== 'string') throw new TypeError(xml ? 'Expected a string' : 'Parser can work only with string streams.');\n if (opts._useHtmlParser2 && opts.Tokenizer) { writeNative(chunk).then(() => done(), (error: Error) => done(error)); return; }\n let text = carry + chunk;\n carry = '';\n const last = text.charCodeAt(text.length - 1);\n if (last >= 0xd800 && last <= 0xdbff) { carry = text.slice(-1); text = text.slice(0, -1); }\n if (!text) { done(); return; }\n writeNative(text).then(() => done(), (error: Error) => done(error));\n },\n final(done) {\n (async () => {\n if (carry) await writeNative(carry);\n return finishNative();\n })().then((document) => {\n complete(null, document);\n done();\n }, (error: Error) => done(error));\n },\n destroy(error, done) { abortNative(); done(error); },\n });\n stream.on('error', (error) => complete(error));\n return stream;\n}\n\n/** Sniff a bounded prefix, then decode and parse each chunk as it arrives. */\nexport function decodeStream(options: DecodeStreamOptions, callback: LoadCallback): Writable {\n const complete = completion(callback);\n const { encoding = {}, ...parserOptions } = options ?? {};\n const opts = flattenOptions(parserOptions);\n const decoderOptions = { defaultEncoding: opts.xmlMode ? 'utf-8' : 'windows-1252', ...encoding };\n const maxBytes = decoderOptions.maxBytes ?? 1024;\n if (!Number.isSafeInteger(maxBytes) || maxBytes < 0) throw new RangeError('encoding.maxBytes must be a non-negative integer');\n const prefixLimit = Math.max(6, maxBytes);\n const prefix: Buffer[] = [];\n let prefixLength = 0;\n let decoder: TextDecoder | undefined;\n let userDefined = false;\n let started = false;\n const parser = stringStream(opts, (error, document) => complete(error, document));\n let downstreamError: Error | undefined;\n parser.on('error', (error) => { downstreamError = error; stream.destroy(error); });\n const writeText = (text: string): Promise<void> => new Promise((resolve, reject) => {\n if (downstreamError) { reject(downstreamError); return; }\n if (!text) { resolve(); return; }\n parser.write(text, (error?: Error | null) => error ? reject(error) : resolve());\n });\n const decode = (bytes: Uint8Array, final = false): string => {\n if (userDefined) {\n let text = '';\n for (const byte of bytes) text += String.fromCharCode(byte < 0x80 ? byte : 0xf700 + byte);\n return text;\n }\n return decoder!.decode(bytes, { stream: !final });\n };\n const start = async (): Promise<void> => {\n const bytes = Buffer.concat(prefix, prefixLength);\n const label = sniffEncoding(bytes, decoderOptions);\n userDefined = label === 'x-user-defined';\n if (!userDefined) decoder = new TextDecoder(label);\n started = true;\n prefix.length = 0;\n await writeText(decode(bytes));\n };\n const accept = async (bytes: Buffer): Promise<void> => {\n if (!started) {\n const count = Math.min(prefixLimit - prefixLength, bytes.length);\n if (count) { prefix.push(Buffer.from(bytes.subarray(0, count))); prefixLength += count; }\n bytes = bytes.subarray(count);\n const declaredEncoding = encodingLabel(decoderOptions.userEncoding) || encodingLabel(decoderOptions.transportLayerEncodingLabel);\n if (prefixLength >= prefixLimit || declaredEncoding && prefixLength >= 3) await start();\n }\n if (started && bytes.length) await writeText(decode(bytes));\n };\n const stream = new Writable({\n write(chunk: Buffer | string, encoding, done) {\n accept(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding)).then(() => done(), (error: Error) => done(error));\n },\n final(done) {\n (async () => {\n if (!started) await start();\n await writeText(decode(new Uint8Array(), true));\n await new Promise<void>((resolve, reject) => {\n parser.once('error', reject);\n parser.end(() => { parser.removeListener('error', reject); resolve(); });\n });\n })().then(() => done(), (error: Error) => done(error));\n },\n destroy(error, done) { parser.destroy(error ?? undefined); done(error); },\n });\n stream.on('error', (error) => complete(error));\n return stream;\n}\n\n/** Load HTML or XML with bounded redirects through Node's built-in transport. */\nexport async function fromURL(url: string | URL, options: CheerioRequestOptions = {}): Promise<CheerioAPI> {\n const signal = options.requestOptions?.signal;\n if (!signal) return loadURL(url, options);\n if (typeof signal !== 'object' && typeof signal !== 'function') throw new TypeError('signal must be an AbortSignal or EventEmitter');\n if ('addEventListener' in signal) return loadURL(url, options);\n if (!('once' in signal) || !('removeListener' in signal)) throw new TypeError('signal must be an AbortSignal or EventEmitter');\n const emitter = signal as EventEmitter;\n const controller = new AbortController();\n const abort = () => controller.abort();\n emitter.once('abort', abort);\n try { return await loadURL(url, { ...options, requestOptions: { ...options.requestOptions, signal: controller.signal } }); }\n finally { emitter.removeListener('abort', abort); }\n}\n\nasync function loadURL(url: string | URL, options: CheerioRequestOptions): Promise<CheerioAPI> {\n const { requestOptions = {}, encoding, ...parserOptions } = options;\n const maxRedirects = requestOptions.maxRedirections ?? 5;\n if (!Number.isInteger(maxRedirects) || maxRedirects < 0) throw new RangeError('maxRedirections must be a non-negative integer');\n const headers = requestHeaders(requestOptions.headers);\n if (!Object.hasOwn(requestOptions, 'headers')) headers.set('accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');\n let current = new URL(url);\n if (requestOptions.query) {\n if (current.search || current.hash) throw new TypeError('URL must not contain a query or fragment when requestOptions.query is supplied');\n current.search = stringifyQuery(requestOptions.query);\n }\n let method = requestOptions.method ?? 'GET';\n let body = requestOptions.body;\n let response: HTTPResponse;\n const controller = new AbortController();\n const signal = requestOptions.signal ? AbortSignal.any([requestOptions.signal as AbortSignal, controller.signal]) : controller.signal;\n const timeoutError = (kind: 'Headers' | 'Body') => Object.assign(new Error(`${kind} Timeout Error`), {\n name: `${kind}TimeoutError`, code: kind === 'Headers' ? 'UND_ERR_HEADERS_TIMEOUT' : 'UND_ERR_BODY_TIMEOUT',\n });\n for (const timeout of [requestOptions.headersTimeout, requestOptions.bodyTimeout]) {\n if (timeout != null && (!Number.isFinite(timeout) || timeout < 0)) throw new RangeError('HTTP timeouts must be non-negative finite numbers');\n }\n const suppliedDispatcher = requestOptions.dispatcher as { dispatch?: (options: unknown, handler: unknown) => boolean } | undefined;\n if (suppliedDispatcher && typeof suppliedDispatcher.dispatch !== 'function') throw new TypeError('requestOptions.dispatcher must implement dispatch');\n const dispatcher = suppliedDispatcher && {\n dispatch(dispatchOptions: Record<string, unknown>, handler: unknown) {\n // Keep fetch's URL/body/header encoding and forward the remaining Undici\n // transport options to the caller's dispatcher without an npm dependency.\n const { dispatcher: _dispatcher, throwOnError: _throwOnError, maxRedirections: _maxRedirections, query: _query, ...transport } = requestOptions;\n return suppliedDispatcher.dispatch!({ ...transport, ...dispatchOptions }, handler);\n },\n };\n for (let redirects = 0; ; redirects += 1) {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const headersTimeout = requestOptions.headersTimeout ?? 300000;\n if (headersTimeout) { timer = setTimeout(() => controller.abort(timeoutError('Headers')), headersTimeout); timer.unref(); }\n try {\n if (dispatcher) {\n const init: RequestInit & { dispatcher?: unknown; duplex?: 'half' } = { method, headers, body: body as BodyInit | undefined, redirect: 'manual', signal, dispatcher };\n if (body != null && typeof body !== 'string') init.duplex = 'half';\n response = await fetch(current, init);\n } else response = await requestDocument(current, method, headers, body, requestOptions, signal);\n } catch (error) {\n throw signal.aborted ? signal.reason : error;\n } finally { if (timer) clearTimeout(timer); }\n const location = response.headers.get('location');\n if (![300, 301, 302, 303, 307, 308].includes(response.status) || !location) break;\n const rewriteToGet = response.status === 303 && method.toUpperCase() !== 'HEAD' || (response.status === 301 || response.status === 302) && method.toUpperCase() === 'POST';\n if (body instanceof Readable && body.readableDidRead && !rewriteToGet) break;\n await response.body?.cancel();\n if (redirects >= maxRedirects) throw new Error('max redirects reached');\n const next = new URL(location, current);\n headers.delete('host');\n if (response.status === 303) for (const name of [...headers.keys()]) if (name.startsWith('content-')) headers.delete(name);\n if (next.origin !== current.origin) {\n headers.delete('authorization');\n headers.delete('cookie');\n headers.delete('proxy-authorization');\n }\n if (rewriteToGet) {\n method = 'GET';\n body = undefined;\n headers.delete('content-length');\n headers.delete('content-type');\n }\n current = next;\n }\n if (!response.ok) {\n await response.body?.cancel();\n const error = new Error('Response Error') as Error & { statusCode: number; code: string; headers: Record<string, string | string[] | undefined> };\n error.name = 'ResponseError';\n error.statusCode = response.status;\n error.code = 'UND_ERR_RESPONSE';\n error.headers = response.rawHeaders ?? Object.fromEntries(response.headers);\n throw error;\n }\n const contentType = response.headers.get('content-type') ?? 'text/html';\n let parsedType: MIMEType;\n try { parsedType = new MIMEType(contentType); }\n catch {\n await response.body?.cancel();\n throw new Error(`Could not parse MIME type string \"${contentType}\"`);\n }\n const mime = parsedType.essence;\n const xml = (parsedType.type === 'application' || parsedType.type === 'text') && parsedType.subtype === 'xml' || parsedType.subtype.endsWith('+xml');\n if (mime !== 'text/html' && !xml) {\n await response.body?.cancel();\n throw new RangeError(`The content-type \"${mime}\" is neither HTML nor XML.`);\n }\n const charset = parsedType.params.get('charset') ?? undefined;\n if (encoding) encoding.transportLayerEncodingLabel = charset;\n const streamOptions: DecodeStreamOptions = {\n xmlMode: xml,\n baseURI: current,\n ...parserOptions,\n encoding: { ...encoding, transportLayerEncodingLabel: charset },\n };\n return new Promise<CheerioAPI>((resolve, reject) => {\n const parser = decodeStream(streamOptions, (error, document) => error ? reject(error) : resolve(document));\n const reader = response.body?.getReader();\n parser.once('error', (error) => { controller.abort(error); void reader?.cancel(error).catch(() => {}); });\n (async () => {\n let received = 0;\n const maxResponseSize = requestOptions.maxResponseSize;\n if (maxResponseSize != null && (typeof maxResponseSize !== 'number' || !Number.isSafeInteger(maxResponseSize) || maxResponseSize < -1)) throw new RangeError('maxResponseSize must be -1 or a non-negative integer');\n while (reader) {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const bodyTimeout = requestOptions.bodyTimeout ?? 300000;\n if (bodyTimeout) { timer = setTimeout(() => controller.abort(timeoutError('Body')), bodyTimeout); timer.unref(); }\n let chunk: ReadableStreamReadResult<Uint8Array>;\n try { chunk = await reader.read(); }\n catch (error) { throw controller.signal.aborted ? controller.signal.reason : error; }\n finally { if (timer) clearTimeout(timer); }\n if (chunk.done) break;\n received += chunk.value.byteLength;\n if (typeof maxResponseSize === 'number' && maxResponseSize >= 0 && received > maxResponseSize) {\n throw Object.assign(new Error('Response content exceeded maxResponseSize'), { name: 'ResponseExceededMaxSizeError', code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE' });\n }\n await new Promise<void>((resolve, reject) => parser.write(Buffer.from(chunk.value.buffer, chunk.value.byteOffset, chunk.value.byteLength), (error?: Error | null) => error ? reject(error) : resolve()));\n }\n parser.end();\n })().catch((error: Error) => { parser.destroy(error); reject(error); });\n });\n}\n","import * as nativeDOM from './dom.js';\nimport { parseNativeDocument, parserOptions, deliverParseErrors, hasParserHooks, cleanParserOptions, createTreeAdapterSession } from './hooks.js';\nimport { compileExtractPlan, hydrateExtractResult } from './extract-plan.js';\nimport { extractCooperatively, prepareExtractPlans, releaseExtractPlans, rootExtractPlans } from './extract.js';\nimport { setImmediate as yieldToEventLoop } from 'node:timers/promises';\nimport { availableParallelism } from 'node:os';\nimport { requireNative, nativeStatus, type NativeDocument, type NativeQuery } from './native.js';\nimport { Cheerio } from './selection.js';\nimport { getNode, importNodes, nodeBinding, operation, rootNode, viewIdIn } from './nodes.js';\nimport { isHtml } from './utils.js';\nimport { DOCUMENT, exposeDocumentTo, resumeCollection, routeDocument, sameNodeSpace, usePreparedSnapshot } from './router.js';\nimport type { AnyNode, Document, CheerioAPI, CheerioOptions, LoadContent, ParallelOptions, ExtractMap, ExtractedMap } from './types.js';\n\nexport type * from './types.js';\nexport type { Cheerio } from './selection.js';\nexport { nativeStatus };\nexport const dom = {\n Node: nativeDOM.Node, DataNode: nativeDOM.DataNode, NodeWithChildren: nativeDOM.NodeWithChildren,\n Document: nativeDOM.Document, Element: nativeDOM.Element, Text: nativeDOM.Text,\n Comment: nativeDOM.Comment, ProcessingInstruction: nativeDOM.ProcessingInstruction, CDATA: nativeDOM.CDATA,\n ElementType: nativeDOM.ElementType, isTag: nativeDOM.isTag, isText: nativeDOM.isText,\n isComment: nativeDOM.isComment, isDirective: nativeDOM.isDirective, isDocument: nativeDOM.isDocument,\n isCDATA: nativeDOM.isCDATA, hasChildren: nativeDOM.hasChildren,\n} as const;\nexport { configureWorkers, workerPoolInfo } from './workers.js';\nexport type { WorkerOptions, WorkerPoolInfo } from './workers.js';\nexport { loadBuffer, stringStream, decodeStream, fromURL } from './io.js';\n\nconst defaultOptions: CheerioOptions = { _useHtmlParser2: false };\n\n/** Cheerio's option merge: without overrides, calls share the base options object. */\nexport function flattenOptions(options?: CheerioOptions | null, base?: CheerioOptions): CheerioOptions {\n if (!options) return base ?? defaultOptions;\n const result: CheerioOptions = { _useHtmlParser2: false, ...base, ...options };\n if (options?.xml) { result._useHtmlParser2 = true; result.xmlMode = true; if (options.xml !== true) Object.assign(result, options.xml); }\n else if (options?.xmlMode) result._useHtmlParser2 = true;\n return result;\n}\n\n/** A synchronous, constructable Cheerio factory backed by a mutable Rust DOM. */\nexport function createAPI(document: NativeDocument, options?: CheerioOptions | null, initialRoot = document.rootId()): CheerioAPI {\n const internal = flattenOptions(options);\n class LoadedCheerio<T = AnyNode> extends Cheerio<T> {}\n let api: CheerioAPI;\n const createRoot = (rootIds: number[], opts: CheerioOptions): Cheerio<Document> => {\n const rootInstance = new LoadedCheerio<Document>(api, document, rootIds, null, opts);\n rootInstance._root = rootInstance;\n return rootInstance;\n };\n const initialize = function<T = AnyNode>(selector?: any, context?: any, root?: any, override?: CheerioOptions): Cheerio<T> {\n resumeCollection(document);\n if (selector?.cheerio) { exposeDocumentTo(document, selector[DOCUMENT]); return selector; }\n const opts = flattenOptions(override, internal);\n // Each call gets its own root selection, as in Cheerio: callers may change the one `end()` returns.\n const rootInstance = createRoot(root === undefined ? [initialRoot]\n : typeof root === 'string' ? [makeRoot(document, operation(document, 'create', { html: root, options: opts }))]\n : root?.cheerio ? importNodes(document, root.toArray()) : importNodes(document, root), opts);\n if (!selector) return new LoadedCheerio<T>(api, document, [], rootInstance, opts);\n const id = viewIdIn(document, selector);\n if (id !== undefined) return new LoadedCheerio<T>(api, document, [id], rootInstance, opts);\n if (typeof selector === 'string' && isHtml(selector)) return new LoadedCheerio<T>(api, document, operation(document, 'create', { html: selector, options: opts }), rootInstance, opts);\n if (typeof selector === 'object') {\n const values = 'length' in selector && !selector.type ? Array.from(selector as ArrayLike<T>) : [selector];\n const allNodes = values.every((value: any) => value && typeof value === 'object' && typeof value.type === 'string');\n return new LoadedCheerio<T>(api, document, allNodes ? importNodes(document, values) : [], rootInstance, opts, allNodes ? undefined : values);\n }\n if (typeof selector !== 'string') throw new TypeError('Unexpected type of selector');\n let search = selector;\n let searchContext: Cheerio<any> = rootInstance;\n if (context) {\n if (typeof context === 'string') {\n if (isHtml(context)) searchContext = new LoadedCheerio<Document>(api, document, [makeRoot(document, operation(document, 'create', { html: context, options: opts }))], rootInstance, opts);\n else search = `${context} ${search}`;\n } else if (context.cheerio) searchContext = context;\n else searchContext = new LoadedCheerio(api, document, importNodes(document, context), rootInstance, opts);\n }\n return searchContext.find(search) as unknown as Cheerio<T>;\n };\n // As in Cheerio, static methods are shared by every loaded API and read the document through `this`.\n api = Object.assign(initialize, staticMethods, {\n load,\n _root: rootNode(document, initialRoot),\n _options: internal,\n fn: LoadedCheerio.prototype,\n prototype: LoadedCheerio.prototype,\n }) as unknown as CheerioAPI;\n return api;\n}\n\nconst staticMethods = {\n root(this: CheerioAPI): Cheerio<Document> { return this(this._root) as Cheerio<Document>; },\n html(this: CheerioAPI | undefined, dom?: any, renderOptions?: CheerioOptions): string {\n if (!this) return '';\n if (dom && typeof dom === 'object' && !('length' in dom) && !('type' in dom)) { renderOptions = dom; dom = undefined; }\n const nodes = dom === undefined ? [this._root] : this(dom).toArray();\n const binding = nodeBinding(this._root)!;\n const base = this._options;\n const unchanged = !renderOptions && ((!base._useHtmlParser2 && !base.xml && !base.xmlMode)\n || (base.xml === true && base.xmlMode === true && base._useHtmlParser2 === true));\n const options = unchanged ? base : flattenOptions({ ...base, ...flattenOptions(renderOptions) }, base);\n return operation(binding.document, 'render', { ids: importNodes(binding.document, nodes), options });\n },\n xml(this: CheerioAPI, dom?: any): string {\n const binding = nodeBinding(this._root)!;\n return operation(binding.document, 'render', { ids: importNodes(binding.document, dom === undefined ? [this._root] : this(dom).toArray()), options: { ...this._options, xmlMode: true, _useHtmlParser2: true } });\n },\n text(this: CheerioAPI | undefined, elements?: ArrayLike<AnyNode>): string {\n if (!elements && !this) return '';\n const nodes = elements ?? [this!._root];\n const binding = this ? nodeBinding(this._root) : nodeBinding(nodes[0]);\n if (binding) return binding.document.text(importNodes(binding.document, nodes));\n const doc = routeDocument(new (requireNative().NativeDocument)('', false));\n return doc.text(importNodes(doc, nodes));\n },\n parseHTML(this: CheerioAPI, data?: string | null, context?: unknown, keepScripts = typeof context === 'boolean' ? context : false): AnyNode[] | null {\n if (!data || typeof data !== 'string') return null;\n if (typeof context === 'boolean') keepScripts = context;\n const parsed = this.load(data, this._options, false);\n if (!keepScripts) parsed('script').remove();\n return parsed._root.children.slice();\n },\n extract<M extends ExtractMap>(this: CheerioAPI, map: M): ExtractedMap<M> { return this.root().extract(map); },\n contains,\n merge,\n};\n\nfunction makeRoot(document: NativeDocument, children: number[]): number {\n const id = operation<number>(document, 'createNode', { type: 'root' });\n operation(document, 'setNode', { id, field: 'children', value: children });\n return id;\n}\n\nexport function load(content: LoadContent, options?: CheerioOptions | null, isDocument = true): CheerioAPI {\n if (content == null) throw new Error('cheerio.load() expects a string');\n const opts = flattenOptions(options);\n const binding = requireNative();\n const string = Buffer.isBuffer(content) ? content.toString() : typeof content === 'string' ? content : undefined;\n const document = string === undefined ? routeDocument(new binding.NativeDocument('', false, JSON.stringify(cleanParserOptions(opts))), opts) : parseNativeDocument(string, opts, isDocument);\n if (string !== undefined) return createAPI(document, opts);\n const nodes = importNodes(document, content);\n if (!Array.isArray(content) && (content as AnyNode).type === 'root') return createAPI(document, opts, nodes[0]);\n operation(document, 'setNode', { id: document.rootId(), field: 'children', value: nodes });\n return createAPI(routeDocument(document, opts), opts);\n}\n\nexport async function loadAsync(content: LoadContent, options?: CheerioOptions | null, isDocument = true): Promise<CheerioAPI> {\n if (content == null) throw new Error('cheerio.load() expects a string');\n if (typeof content !== 'string' && !Buffer.isBuffer(content)) return load(content, options, isDocument);\n const binding = requireNative();\n const opts = flattenOptions(options);\n const html = String(content);\n // User parser hooks execute on JavaScript, exactly where their callbacks live.\n if (!opts._useHtmlParser2 && opts.treeAdapter) {\n const session = createTreeAdapterSession(opts, isDocument);\n try { await session.write(html); return createAPI(await session.end(), opts); }\n catch (error) { session.abort(); throw error; }\n }\n if (opts._useHtmlParser2 && opts.Tokenizer) return createAPI(parseNativeDocument(html, opts, isDocument), opts);\n const document = binding.parseAsync ? await binding.parseAsync(html, isDocument, JSON.stringify(parserOptions(html, opts))) : new binding.NativeDocument(html, isDocument, JSON.stringify(parserOptions(html, opts)));\n deliverParseErrors(document, opts);\n return createAPI(routeDocument(document, opts), opts);\n}\n\nexport function contains(container: AnyNode, contained: AnyNode): boolean {\n if (!container || !contained || container === contained) return false;\n let parent = nodeBinding(container);\n if (!parent) {\n const document = routeDocument(new (requireNative().NativeDocument)('', false));\n importNodes(document, [container]); parent = nodeBinding(container);\n }\n const child = nodeBinding(contained);\n return !!parent && !!child && sameNodeSpace(child.document, parent.document) && operation(parent.document, 'contains', { container: parent.id, contained: child.id });\n}\n\nexport function merge<T>(first: ArrayLike<T>, second: ArrayLike<T>): ArrayLike<T> | undefined {\n const arrayLike = (value: any): boolean => Array.isArray(value) || value && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && Array.from({ length: value.length }, (_unused, i) => i in value).every(Boolean);\n if (!arrayLike(first) || !arrayLike(second)) return undefined;\n const writable = first as { [key: number]: T; length: number };\n let length = first.length;\n for (let i = 0, count = +second.length; i < count; i++) writable[length++] = second[i];\n writable.length = length;\n return writable;\n}\n\nfunction parallelOptions(options?: ParallelOptions | null): { options: CheerioOptions; threads: number } {\n const { threads = Math.min(availableParallelism(), 256), ...opts } = options ?? {};\n if (!Number.isSafeInteger(threads) || threads < 1 || threads > 256) throw new RangeError('threads must be an integer from 1 to 256');\n return { options: flattenOptions(opts), threads };\n}\n\nexport async function loadAll(content: readonly string[], options?: ParallelOptions | null, isDocument = true): Promise<CheerioAPI[]> {\n return loadAllWithPlans(content, options, isDocument);\n}\n\n/**\n * Loads documents in parallel. With `plans`, the parsing threads also run\n * them on each root and build each document's snapshot, which extraction\n * with callbacks would otherwise do on the calling thread when it needs them.\n */\nasync function loadAllWithPlans(content: readonly string[], options: ParallelOptions | null | undefined, isDocument: boolean, plans?: ReturnType<typeof rootExtractPlans>): Promise<CheerioAPI[]> {\n const { options: opts, threads } = parallelOptions(options);\n if (!Array.isArray(content) || content.some((item) => typeof item !== 'string')) throw new TypeError('loadAll expects an array of HTML strings');\n if (!content.length) return [];\n const binding = requireNative();\n if (!binding.parseManyAsync || hasParserHooks(opts)) return Promise.all(content.map((html) => loadAsync(html, opts, isDocument)));\n const documents = await binding.parseManyAsync([...content], isDocument, threads, JSON.stringify(opts), plans && JSON.stringify(plans));\n return documents.map((document) => {\n const routed = routeDocument(document, opts);\n if (plans) {\n usePreparedSnapshot(routed);\n prepareExtractPlans(routed, plans, document.takePreparedPlans?.());\n }\n return createAPI(routed, opts);\n });\n}\n\nfunction nativeQueries(map: ExtractMap, options: CheerioOptions): NativeQuery[] | undefined {\n const queries: NativeQuery[] = [];\n const plainProperties = /^(?:id|class|title|href|src|alt|name|data-.+|aria-.+)$/;\n for (const key in map) {\n const entry = map[key]; const all = Array.isArray(entry); const descriptor = all ? entry[0] : entry;\n const selector = typeof descriptor === 'string' ? descriptor : descriptor.selector;\n const value = typeof descriptor === 'string' ? 'textContent' : descriptor.value ?? 'textContent';\n if (typeof value !== 'string' || value !== 'textContent' && !plainProperties.test(value) || options.baseURI && (value === 'href' || value === 'src') || options.pseudos) return undefined;\n queries.push({ key, selector, all, ...(value === 'textContent' ? {} : { attr: value }) });\n }\n return queries;\n}\n\nexport async function extractAll<M extends ExtractMap>(content: readonly string[], map: M, options?: ParallelOptions | null): Promise<ExtractedMap<M>[]> {\n const { options: opts, threads } = parallelOptions(options);\n if (!Array.isArray(content) || content.some((item) => typeof item !== 'string')) throw new TypeError('extractAll expects an array of HTML strings');\n if (!content.length) return [];\n const binding = requireNative();\n const plan = hasParserHooks(opts) ? undefined : compileExtractPlan(map, opts);\n if (binding.extractPlanManyAsync && plan) {\n const results: Record<string, unknown>[] = JSON.parse(await binding.extractPlanManyAsync([...content], JSON.stringify(plan), threads, JSON.stringify(opts)));\n for (const result of results) hydrateExtractResult(result, plan.entries);\n return results as ExtractedMap<M>[];\n }\n const queries = binding.extractPlanManyAsync || hasParserHooks(opts) ? undefined : nativeQueries(map, opts);\n if (binding.extractManyAsync && queries) {\n const results: Record<string, unknown>[] = JSON.parse(await binding.extractManyAsync([...content], queries, threads, true, JSON.stringify(opts)));\n for (const result of results) for (const query of queries) {\n if (!Object.hasOwn(result, query.key)) Object.defineProperty(result, query.key, { value: query.all ? [] : undefined, configurable: true, writable: true, enumerable: true });\n if (query.all && Array.isArray(result[query.key])) result[query.key] = (result[query.key] as unknown[]).filter((value) => value != null);\n }\n return results as ExtractedMap<M>[];\n }\n const documents = await loadAllWithPlans(content, { ...opts, threads }, true, hasParserHooks(opts) ? undefined : rootExtractPlans(map, opts));\n const results: ExtractedMap<M>[] = [];\n let yieldedAt = performance.now();\n for (const document of documents) {\n const root = document.root();\n try { results.push((await extractCooperatively(root, map)).value); } finally { releaseExtractPlans(root[DOCUMENT]); }\n if (performance.now() - yieldedAt >= 4) { await yieldToEventLoop(); yieldedAt = performance.now(); }\n }\n return results;\n}\n"],"mappings":";;;;;;;;;;AAcA,MAAM,mCAAmB,IAAI,IAAI;CAC/B;CAAe;CAAa;CAAa;CAAa;CAAW;CACjE;CAAY;CAAM;CAAS;CAAa;CAAS;CAAQ;CAAO;CAAO;CACvE;CAAS;CAAQ;CAAW;CAAY;CAAY;CAAY;CAChE;CAAY;CAAU;CAAQ;CAAa;CAAY;CAAQ;AACj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