@dvaji/cheerox 0.1.3 → 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.
- package/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/cheerox.darwin-arm64.node +0 -0
- package/cheerox.darwin-x64.node +0 -0
- package/cheerox.linux-arm64-gnu.node +0 -0
- package/cheerox.linux-arm64-musl.node +0 -0
- package/cheerox.linux-x64-gnu.node +0 -0
- package/cheerox.linux-x64-musl.node +0 -0
- package/cheerox.win32-arm64-msvc.node +0 -0
- package/cheerox.win32-x64-msvc.node +0 -0
- package/dist/{cheerio-compat-8HucV2qE.cjs → cheerio-compat-BeDR8TQZ.cjs} +2 -2
- package/dist/cheerio-compat-BeDR8TQZ.cjs.map +1 -0
- package/dist/{cheerio-compat-BnFvIIuE.d.ts → cheerio-compat-C6M5aNE9.d.cts} +13 -2
- package/dist/{cheerio-compat-BnFvIIuE.d.cts → cheerio-compat-C6M5aNE9.d.ts} +13 -2
- package/dist/{cheerio-compat-Dwarm-h8.mjs → cheerio-compat-CVs7vojA.mjs} +2 -2
- package/dist/cheerio-compat-CVs7vojA.mjs.map +1 -0
- package/dist/{cheerio-compat-BM4_lqVU.d.mts → cheerio-compat-WDud2pl9.d.mts} +13 -2
- package/dist/cheerio-compat.cjs +1 -1
- package/dist/cheerio-compat.d.cts +2 -2
- package/dist/cheerio-compat.d.mts +2 -2
- package/dist/cheerio-compat.d.ts +2 -2
- package/dist/cheerio-compat.mjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/cheerio-compat/types.ts +12 -0
- package/src/cheerio-compat.ts +1 -1
- package/src/index.ts +1 -0
- package/dist/cheerio-compat-8HucV2qE.cjs.map +0 -1
- package/dist/cheerio-compat-Dwarm-h8.mjs.map +0 -1
package/Cargo.lock
CHANGED
package/Cargo.toml
CHANGED
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -4,7 +4,7 @@ This file preserves third-party license and attribution notices for the Rust nat
|
|
|
4
4
|
|
|
5
5
|
Generated by `node scripts/generate-notices.mjs` from `cargo metadata --locked`, crate license files, and the pinned supplemental sources recorded in `scripts/notices/sources.json`. It includes build dependencies and dependencies for all target platforms; a particular binary may use a subset. Identical notice texts are reproduced once and referenced below. The html5ever, markup5ever and html5gum crates contain local observer-hook and opt-in UTF-16 transport patches, and the scraper crate carries a vector-backed attribute store; their complete patched source and original notices are included in `native/vendor`. Other dependency source files are unmodified.
|
|
6
6
|
|
|
7
|
-
Cargo.lock SHA-256: `
|
|
7
|
+
Cargo.lock SHA-256: `ede430f273e952696056568699486e756cdd90b4f3d222657952e017f72732da`.
|
|
8
8
|
|
|
9
9
|
## Source availability
|
|
10
10
|
|
|
Binary file
|
package/cheerox.darwin-x64.node
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -251,7 +251,7 @@ function renderText(elem, opts, parentName) {
|
|
|
251
251
|
return data;
|
|
252
252
|
}
|
|
253
253
|
// package.json
|
|
254
|
-
var version = "0.1.
|
|
254
|
+
var version = "0.1.4";
|
|
255
255
|
// src/cheerio-compat.ts
|
|
256
256
|
/**
|
|
257
257
|
* The Cheerio 0.22.0 facade, backed by the Rust engine.
|
|
@@ -1718,4 +1718,4 @@ Object.defineProperty(exports, "update", {
|
|
|
1718
1718
|
}
|
|
1719
1719
|
});
|
|
1720
1720
|
|
|
1721
|
-
//# sourceMappingURL=cheerio-compat-
|
|
1721
|
+
//# sourceMappingURL=cheerio-compat-BeDR8TQZ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cheerio-compat-BeDR8TQZ.cjs","names":["isTag","nodeBinding","operation","routeDocument","requireNative","cleanParserOptions","getNodesOfType","getNode","importNodes","rootNode","operation","viewId","nodeBinding","viewIdIn","hasMaterializedAttributes","hasParserHooks","hasMaterializedChildren","packageVersion"],"sources":["../src/cheerio-compat/css.ts","../src/cheerio-compat/selectors.ts","../src/cheerio-compat/render.ts","../package.json","../src/cheerio-compat.ts"],"sourcesContent":["// Cheerio 0.22 style attribute parsing and mutation.\nimport type { LegacyNode } from './types.js';\n\nexport function setCss(el: LegacyNode, prop: any, val: any, idx: number): void {\n if (typeof prop === 'string') {\n const styles = parseStyles(el.attribs?.style);\n if (typeof val === 'function') {\n val = val.call(el, idx, styles[prop]);\n }\n\n if (val === '') {\n delete styles[prop];\n } else if (val != null) {\n styles[prop] = val;\n }\n\n el.attribs!.style = stringifyStyles(styles);\n } else if (typeof prop === 'object') {\n for (const key of Object.keys(prop)) {\n setCss(el, key, prop[key], idx);\n }\n }\n}\n\nexport function getCss(el: LegacyNode | undefined, prop?: any): any {\n const styles = parseStyles(el?.attribs?.style);\n if (typeof prop === 'string') {\n return styles[prop];\n } else if (Array.isArray(prop)) {\n return pick(styles, prop);\n } else {\n return styles;\n }\n}\n\nfunction pick(obj: Record<string, string>, props: string[]): Record<string, string> {\n const result: Record<string, string> = {};\n for (const prop of props) if (prop in obj) result[prop] = obj[prop];\n return result;\n}\n\nfunction stringifyStyles(obj: Record<string, string>): string {\n return Object.keys(obj).reduce((str, prop) => `${str}${str ? ' ' : ''}${prop}: ${obj[prop]};`, '');\n}\n\nfunction parseStyles(styles: string | undefined): Record<string, string> {\n styles = (styles || '').trim();\n\n if (!styles) return {};\n\n return styles.split(';').reduce<Record<string, string>>((obj, str) => {\n const n = str.indexOf(':');\n // skip if there is no :, or if it is the first/last character\n if (n < 1 || n === str.length - 1) return obj;\n obj[str.slice(0, n).trim()] = str.slice(n + 1).trim();\n return obj;\n }, {});\n}\n","/**\n * The pseudo-classes css-select 1.2.0 (Cheerio 0.22.0's selector engine)\n * understands; anything else throws, exactly as the original library did.\n */\nconst legacyPseudos = new Set([\n // filters\n 'nth-child', 'nth-last-child', 'nth-of-type', 'nth-last-of-type',\n 'first-child', 'last-child', 'first-of-type', 'last-of-type',\n 'only-of-type', 'only-child',\n // pseudos and jQuery extensions of the time\n 'empty', 'link', 'visited', 'selected', 'disabled', 'enabled', 'checked',\n 'required', 'optional', 'parent', 'header', 'button', 'input', 'text',\n 'contains', 'icontains', 'checkbox', 'file', 'password', 'radio', 'reset',\n 'image', 'submit', 'root', 'not', 'has', 'matches', 'scope',\n]);\n\n/** Reject pseudo-classes that only exist in later Cheerio lines. */\nexport function validateLegacySelector(selector: string): void {\n let depth = 0;\n let quote = '';\n let escape = false;\n for (let i = 0; i < selector.length; i++) {\n const character = selector[i];\n if (escape) { escape = false; continue; }\n if (character === '\\\\') { escape = true; continue; }\n if (quote) { if (character === quote) quote = ''; continue; }\n if (character === '\"' || character === \"'\") { quote = character; continue; }\n if (character === '[') { depth++; continue; }\n if (character === ']') { depth = Math.max(0, depth - 1); continue; }\n if (depth || character !== ':') continue;\n const match = /^:([a-zA-Z][a-zA-Z0-9-]*)/.exec(selector.slice(i));\n if (!match) continue;\n if (!legacyPseudos.has(match[1])) {\n throw new SyntaxError(`unmatched pseudo-class ${match[0]}`);\n }\n // Skip a balanced argument so nested selectors are not scanned twice.\n if (selector[i + match[0].length] === '(') {\n let parens = 0;\n let innerQuote = '';\n for (let j = i + match[0].length; j < selector.length; j++) {\n const inner = selector[j];\n if (innerQuote) { if (inner === innerQuote) innerQuote = ''; continue; }\n if (inner === '\"' || inner === \"'\") { innerQuote = inner; continue; }\n if (inner === '(') parens++;\n else if (inner === ')') { parens--; if (!parens) { i = j; break; } }\n }\n } else {\n i += match[0].length;\n }\n }\n}\n","import { nodeBinding, operation } from '../nodes.js';\nimport type { LegacyNode, LegacyOptions } from './types.js';\n\nconst isTag = (node: LegacyNode): boolean => node.type === 'tag' || node.type === 'script' || node.type === 'style';\n\n/*\n * dom-serializer 0.1.0, over node views.\n */\n\nconst unencodedElements: Record<string, boolean | undefined> = { style: true, script: true, xmp: true, iframe: true, noembed: true, noframes: true, plaintext: true, noscript: true };\n\nconst singleTag: Record<string, boolean | undefined> = {\n area: true, base: true, basefont: true, br: true, col: true, command: true, embed: true, frame: true,\n hr: true, img: true, input: true, isindex: true, keygen: true, link: true, meta: true, param: true,\n source: true, track: true, wbr: true,\n};\n\nconst xmlReplacements: Record<string, string> = { '&': '&', \"'\": ''', '>': '>', '<': '<', '\"': '"' };\nconst encodeXmlRegex = /[&'><\"]/g;\nconst nonAsciiRegex = /[^\\0-\\x7F]/g;\nconst astralRegex = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\nfunction codePointReplacement(c: string): string {\n return `&#x${c.codePointAt(0)!.toString(16).toUpperCase()};`;\n}\n\n/** entities 1.1 `encodeXML`: the five XML characters plus every non-ASCII rune. */\nfunction encodeXML(data: string): string {\n return data\n .replace(encodeXmlRegex, (c) => xmlReplacements[c])\n .replace(astralRegex, codePointReplacement)\n .replace(nonAsciiRegex, codePointReplacement);\n}\n\nfunction formatAttrs(attribs: Record<string, string> | undefined, opts: LegacyOptions): string {\n if (!attribs) return '';\n let output = '';\n for (const key of Object.keys(attribs)) {\n const value = attribs[key];\n if (output) output += ' ';\n output += key;\n if ((value !== null && value !== '') || opts.xmlMode) {\n output += `=\"${opts.decodeEntities ? encodeXML(value) : value}\"`;\n }\n }\n return output;\n}\n\n/**\n * dom-serializer 0.1.x rules run natively (one call per document); nodes\n * outside the engine, or spanning several documents, fall back to the port.\n */\nexport function renderWith(opts: LegacyOptions, dom: unknown, parentName?: string): string {\n const nodes = Array.isArray(dom) || (dom && typeof dom === 'object' && 'length' in (dom as object))\n ? Array.from(dom as ArrayLike<LegacyNode>)\n : [dom as LegacyNode];\n void parentName;\n if (nodes.length) {\n const bindings = nodes.map((node) => nodeBinding(node));\n const document = bindings[0]?.document;\n if (document && bindings.every((binding) => binding?.document === document)) {\n return operation<string>(document, 'render', {\n ids: bindings.map((binding) => binding!.id),\n // The options go through exactly as 0.22.0's render received them:\n // defaults already applied by the static, `decodeEntities` possibly\n // absent (bare-module `cheerio.xml()` leaves text raw).\n options: { ...opts, _useHtmlParser2: true, legacySerializer: true },\n }) as string;\n }\n }\n let output = '';\n for (const elem of nodes) {\n if (!elem || !elem.type) continue;\n if (elem.type === 'root') output += renderWith(opts, elem.children);\n else if (isTag(elem)) output += renderTag(elem, opts);\n else if (elem.type === 'directive') output += `<${elem.data}>`;\n else if (elem.type === 'comment') output += `<!--${elem.data}-->`;\n else if (elem.type === 'cdata') output += `<![CDATA[${elem.children && elem.children[0] ? elem.children[0].data : ''}]]>`;\n else output += renderText(elem, opts, parentName);\n }\n return output;\n}\n\nfunction renderTag(elem: LegacyNode, opts: LegacyOptions): string {\n // Handle SVG as in 0.22.0: it renders like XML.\n const effective = elem.name === 'svg' ? ({ decodeEntities: opts.decodeEntities, xmlMode: true } as LegacyOptions) : opts;\n let tag = `<${elem.name}`;\n const attribs = formatAttrs(elem.attribs, effective);\n if (attribs) tag += ` ${attribs}`;\n if (effective.xmlMode && (!elem.children || elem.children.length === 0)) {\n tag += '/>';\n } else {\n tag += '>';\n if (elem.children) tag += renderWith(effective, elem.children, elem.name);\n if (!singleTag[elem.name as string] || effective.xmlMode) tag += `</${elem.name}>`;\n }\n return tag;\n}\n\nfunction renderText(elem: LegacyNode, opts: LegacyOptions, parentName?: string): string {\n let data = elem.data || '';\n if (opts.decodeEntities && !(parentName !== undefined && parentName in unencodedElements)) {\n data = encodeXML(data);\n }\n return data;\n}\n","","/**\n * The Cheerio 0.22.0 facade, backed by the Rust engine.\n *\n * Every public behavior is ported from cheerio@0.22.0 (commit\n * 49b477e7fe98b74f61f77acd06a0ef4edb5c333e): lib/cheerio.js, lib/static.js,\n * lib/parse.js, lib/utils.js and lib/api/*.js. DOM storage, parsing and\n * selection stay in the native arena; this file supplies the legacy object\n * model (plain field semantics, `root` references, 0.22.0 serialization and\n * css-select 1.2.0 selection semantics) on top of it.\n *\n * Structural rule: sibling and parent links are owned by the engine. All\n * tree surgery installs whole child lists (see writeChildren), which rebuilds\n * the links exactly as 0.22.0's raw `prev`/`next`/`parent` writes did\n * observably; raw pointer writes on attached nodes would fight the engine's\n * own invariants.\n */\nimport { requireNative, type NativeDocument } from './native.js';\nimport { getCss, setCss } from './cheerio-compat/css.js';\nimport { validateLegacySelector } from './cheerio-compat/selectors.js';\nimport { renderWith } from './cheerio-compat/render.js';\nimport { getNode, getNodesOfType, hasMaterializedAttributes, hasMaterializedChildren, importNodes, nodeBinding, operation, rootNode, setRootIfCached, viewId, viewIdIn } from './nodes.js';\nimport { routeDocument } from './router.js';\nimport { cleanParserOptions, hasParserHooks } from './hooks.js';\nimport type { LegacyOptions, LegacyNode, CheerioInstance, CheerioConstructor, CheerioPrototype, CheerioStatic } from './cheerio-compat/types.js';\nexport type { CheerioStatic, CheerioAPI, Cheerio, Element, AnyNode, Document } from './cheerio-compat/types.js';\nimport { version as packageVersion } from '../package.json';\n\n/** Cheerio.prototype.options — the exact 0.22.0 defaults. */\nconst defaultOpts: LegacyOptions = {\n withDomLvl1: true,\n normalizeWhitespace: false,\n xmlMode: false,\n decodeEntities: true,\n};\n\n/** lodash.defaults semantics: fill undefined keys from the sources. */\nfunction defaults<T extends object>(target: T, ...sources: (object | undefined | null)[]): T {\n for (const source of sources) {\n if (!source) continue;\n for (const key of Object.keys(source)) {\n const value = (source as Record<string, unknown>)[key];\n if ((target as Record<string, unknown>)[key] === undefined && value !== undefined) {\n (target as Record<string, unknown>)[key] = value;\n }\n }\n }\n return target;\n}\n\ntype AttributeDocument = NativeDocument & {\n setAttribute?: (ids: number[], name: string, value: string | null) => void;\n addClass?: (ids: number[], name: string) => void;\n insertHtml?: (targetIds: number[], html: string, position: string) => number[] | undefined;\n remove?: (ids: number[]) => void;\n};\n\nconst isTag = (elem: unknown): boolean => {\n const type = typeof elem === 'object' && elem !== null ? (elem as { type?: string }).type : elem;\n return (type !== undefined && (tags as Record<string, boolean>)[type as string]) || false;\n};\nconst tags: Record<string, boolean> = { tag: true, script: true, style: true };\n\nconst camelCase = (str: string): string => str.replace(/[_.-](\\w|$)/g, (_, x: string) => x.toUpperCase());\nconst cssCase = (str: string): string => str.replace(/[A-Z]/g, '-$&').toLowerCase();\n\nconst domEach = <T, C = unknown>(cheerio: { length: number; [index: number]: T }, fn: (this: C, i: number, el: T) => unknown): typeof cheerio => {\n let i = 0;\n const len = cheerio.length;\n while (i < len && fn.call(cheerio as unknown as C, i, cheerio[i]) !== false) ++i;\n return cheerio;\n};\n\n/** Create a deep copy by rendering and re-parsing, as 0.22.0 does. */\nfunction cloneDom(dom: LegacyNode[], options: LegacyOptions): LegacyNode[] {\n return evaluate(renderWith(options, dom), options);\n}\n\nconst quickExpr = /^(?:[^#<]*(<[\\w\\W]+>)[^>]*$|#([\\w\\-]*)$)/;\nconst simpleTagExpr = /^\\s*([A-Za-z][\\w-]*)\\s*$/;\n// These selectors can only return elements of their final explicit tag.\nconst finalTagExpr = /^\\s*(?:[A-Za-z][\\w-]*\\s+)*([A-Za-z][\\w-]*)(?:\\[[\\w-]+\\])?\\s*$/;\nconst specialTagExpr = /^(?:script|style)$/i;\n\nconst isHtml = (str: string): boolean => {\n if (str.charAt(0) === '<' && str.charAt(str.length - 1) === '>' && str.length >= 3) return true;\n const match = quickExpr.exec(str);\n return !!(match && match[1]);\n};\n\n/*\n * parse.js\n */\n\n/** Legacy options with the native parser mode folded in. */\nfunction legacyOptions(options?: LegacyOptions | null): LegacyOptions {\n return defaults({ ...(options ?? {}) } as LegacyOptions, defaultOpts, { _useHtmlParser2: true, _legacyDom: true });\n}\n\nfunction newDocument(options: LegacyOptions): NativeDocument {\n return routeDocument(new (requireNative().NativeDocument)('', false, JSON.stringify(cleanParserOptions(options))), options);\n}\n\n/** As nodes under the legacy model: views that read like plain objects. */\nfunction asNodes(document: NativeDocument, ids: number[], knownType?: string): LegacyNode[] {\n if (knownType) return getNodesOfType(document, ids, knownType) as LegacyNode[];\n return ids.map((id) => getNode(document, id) as LegacyNode);\n}\n\n/**\n * htmlparser2 3.9.1's `normalizeWhitespace`: collapse whitespace runs in\n * regular text nodes to single spaces (script/style contents stay raw).\n */\nfunction normalizeWhitespace(nodes: LegacyNode[]): void {\n for (const node of nodes) {\n if (node.type === 'text') {\n if (/\\s\\s|\\s$|^\\s/.test(node.data ?? '')) node.data = (node.data ?? '').replace(/\\s+/g, ' ');\n } else if (node.type !== 'script' && node.type !== 'style' && node.children) {\n normalizeWhitespace(node.children);\n }\n }\n}\n\n/** htmlparser.parseDOM(content, options): the parsed children, without a root wrapper. */\nexport function evaluate(content: string | Buffer | ArrayLike<LegacyNode> | LegacyNode, options?: LegacyOptions | null): LegacyNode[] {\n const opts = legacyOptions(options);\n if (typeof content !== 'string' && !Buffer.isBuffer(content)) {\n // A pre-parsed DOM passes through, as in 0.22.0's parse.evaluate: the\n // nodes are imported once and keep their object identities.\n const document = newDocument(opts);\n const nodes = Array.isArray(content) || (content && typeof content === 'object' && 'length' in (content as object))\n ? Array.from(content as ArrayLike<LegacyNode>)\n : [content as LegacyNode];\n return asNodes(document, importNodes(document, nodes));\n }\n const document = routeDocument(\n new (requireNative().NativeDocument)(Buffer.isBuffer(content) ? content.toString() : content, false, JSON.stringify(cleanParserOptions(opts))),\n opts,\n );\n const root = rootNode(document, document.rootId());\n const children = Array.from((root as LegacyNode).children ?? []) as LegacyNode[];\n if (opts.normalizeWhitespace) normalizeWhitespace(children);\n return children;\n}\n\n/** One native write that installs a parent's child list and sibling links. */\nfunction writeChildren(parent: LegacyNode, list: LegacyNode[]): void {\n const binding = bindingOf(parent);\n if (!binding) return;\n operation(binding.document, 'setNode', { id: binding.id, field: 'children', value: importNodes(binding.document, list) });\n}\n\n/**\n * Update the dom structure for one changed layer — lib/parse.js `update`.\n * The new level is installed with one children write per changed parent;\n * the engine rebuilds the `prev`/`next`/`parent` links.\n */\nexport function update(arrInput: unknown, parent: LegacyNode | null): LegacyNode | null {\n const arr: LegacyNode[] = Array.isArray(arrInput) ? (arrInput as LegacyNode[]) : [arrInput as LegacyNode];\n // Capture the previous parents before the install re-parents the nodes.\n const oldParents = arr.map((node) => node.parent || node.root);\n if (parent) {\n writeChildren(parent, arr);\n }\n for (let i = 0; i < arr.length; i++) {\n const node = arr[i];\n const oldParent = oldParents[i];\n // 0.22.0 installs `arr` on `parent` first, so members of the new list\n // skip the removal pass by the `oldSiblings !== arr` identity check.\n if (oldParent && oldParent !== parent) {\n const list = Array.from(oldParent.children ?? []);\n const index = list.indexOf(node);\n if (index >= 0) writeChildren(oldParent, list.filter((item, at) => at !== index));\n }\n if (parent && parent.type === 'root') {\n node.root = parent;\n } else {\n node.root = null;\n }\n }\n return parent;\n}\n\n/** lib/parse.js: parse into a fresh document and return its `<root>` node. */\nexport function parse(content: string | Buffer | ArrayLike<LegacyNode> | LegacyNode, options?: LegacyOptions | null, isDocument?: boolean): LegacyNode {\n const opts = legacyOptions(options);\n let document: NativeDocument;\n let root: LegacyNode;\n if (typeof content === 'string' || Buffer.isBuffer(content)) {\n document = routeDocument(\n new (requireNative().NativeDocument)(Buffer.isBuffer(content) ? content.toString() : content, isDocument ?? false, JSON.stringify(cleanParserOptions(opts))),\n opts,\n );\n root = rootNode(document, document.rootId()) as LegacyNode;\n } else {\n // A pre-parsed DOM: 0.22.0 wraps it in the synthetic root via update().\n document = newDocument(opts);\n const nodes = Array.isArray(content) || (content && typeof content === 'object' && 'length' in (content as object))\n ? Array.from(content as ArrayLike<LegacyNode>)\n : [content as LegacyNode];\n root = rootNode(document, document.rootId()) as LegacyNode;\n writeChildren(root, nodes);\n }\n let children: LegacyNode[];\n if (opts.normalizeWhitespace) {\n children = Array.from(root.children ?? []) as LegacyNode[];\n normalizeWhitespace(children);\n } else {\n const record = operation<{ children?: number[] }>(document, 'node', { id: viewId(root)! });\n children = asNodes(document, record.children ?? []);\n }\n for (const child of children) child.root = root;\n return root;\n}\n\n/*\n * css-select 1.2.0 scoped selection, over native matching.\n */\n\nfunction bindingOf(node: unknown): { document: NativeDocument; id: number } | undefined {\n return node && typeof node === 'object' ? nodeBinding(node) : undefined;\n}\n\nfunction idsOf(document: NativeDocument, nodes: ArrayLike<unknown>): number[] {\n const len = (nodes as any).length;\n if (typeof len !== 'number' || len < 0) return importNodes(document, nodes as unknown[]);\n const out = new Array<number>(len);\n for (let i = 0; i < len; i++) {\n const id = viewIdIn(document, (nodes as any)[i]);\n if (id === undefined) return importNodes(document, nodes as unknown[]);\n out[i] = id;\n }\n return out;\n}\n\n/**\n * css-select 1.2 `select(query, elems, options)`: candidates are the members\n * of `elems` and their descendants, in list order (domutils.findAll, with\n * removeSubsets applied). A candidate matches when it satisfies the selector\n * and is a context node or a descendant of one — the absolutized `:scope`\n * descendant rule, whose `acceptSelf` branch lets a context node match itself.\n */\nfunction scopedSelect(selector: string, elems: LegacyNode[], options: LegacyOptions): LegacyNode[] {\n if (!selector || !elems.length) return [];\n const document = bindingOf(elems[0])?.document;\n if (!document) return [];\n const context = (options.context as LegacyNode[] | undefined) ?? elems;\n const contextIds = new Set(idsOf(document, context));\n // domutils.removeSubsets: drop members that contain other members.\n const roots = elems.filter((node, index) => !elems.some((other, otherIndex) => otherIndex !== index && isAncestorOf(other, node)));\n const candidates: number[] = [];\n const seen = new Set<number>();\n for (const root of roots) {\n const rootId = viewIdIn(document, root)!;\n if (!seen.has(rootId)) { seen.add(rootId); candidates.push(rootId); }\n for (const id of document.select('*', [rootId])) {\n if (!seen.has(id)) { seen.add(id); candidates.push(id); }\n }\n }\n // css-select 1.2 absolutizes a leading combinator to `:scope >|+|~ ...`:\n // the anchor sits at the context, one relation away from the candidate.\n const leading = /^\\s*([>+~])\\s*/.exec(selector);\n let rest = selector;\n let combinator: string | undefined;\n if (leading) {\n combinator = leading[1];\n rest = selector.slice(leading[0].length);\n }\n const matched = new Set(matchesSelector(document, candidates, rest, options));\n const result: LegacyNode[] = [];\n for (const id of candidates) {\n if (!matched.has(id)) continue;\n const node = getNode(document, id) as LegacyNode;\n if (combinator && !combinatorAnchored(node, combinator, contextIds)) continue;\n if (!combinator && !withinContext(node, contextIds)) continue;\n result.push(node);\n }\n return result;\n}\n\n/**\n * The `:scope` anchor of a leading-combinator selector: the candidate's\n * parent, previous element sibling, or any earlier element sibling must be a\n * context node.\n */\nfunction combinatorAnchored(node: LegacyNode, combinator: string, contextIds: Set<number>): boolean {\n if (combinator === '>') {\n const parent = node.parent;\n return parent !== null && parent !== undefined && contextIds.has(viewId(parent) ?? NaN);\n }\n if (combinator === '+') {\n let sibling = node.prev as LegacyNode | null | undefined;\n while (sibling && !isTag(sibling)) sibling = sibling.prev as LegacyNode | null | undefined;\n return sibling !== null && sibling !== undefined && contextIds.has(viewId(sibling) ?? NaN);\n }\n // '~'\n let sibling = node.prev as LegacyNode | null | undefined;\n while (sibling) {\n if (isTag(sibling) && contextIds.has(viewId(sibling) ?? NaN)) return true;\n sibling = sibling.prev as LegacyNode | null | undefined;\n }\n return false;\n}\n\n/** Native matching for a batch of ids, with 0.22.0's SyntaxError behavior. */\nfunction matchesSelector(document: NativeDocument, ids: number[], selector: string, options: LegacyOptions): number[] {\n validateLegacySelector(selector);\n try {\n return operation<number[]>(document, 'matches', { ids, selector, options: { xmlMode: options.xmlMode } }) ?? [];\n } catch (error) {\n throw error instanceof SyntaxError ? error : new SyntaxError((error as Error)?.message ?? String(error));\n }\n}\n\n/** Whether the node or one of its ancestors belongs to the context set. */\nfunction withinContext(node: LegacyNode, contextIds: Set<number>): boolean {\n for (let current: LegacyNode | null = node; current; ) {\n const id = viewId(current);\n if (id !== undefined && contextIds.has(id)) return true;\n const parent: LegacyNode | null | undefined = current.parent;\n if (parent === null || parent === current) {\n // Top-level nodes carry their document root in `.root` (0.22.0 model).\n const root = current.root as LegacyNode | null | undefined;\n return root !== null && root !== undefined && contextIds.has(viewId(root) ?? NaN);\n }\n current = parent!;\n }\n return false;\n}\n\nfunction isAncestorOf(ancestor: LegacyNode, node: LegacyNode | null | undefined): boolean {\n if (node === ancestor) return false;\n for (let current = node?.parent; current; current = current.parent) {\n if (current === ancestor) return true;\n if (current.parent === current) break;\n }\n return false;\n}\n\n/** htmlparser2 DomUtils.uniqueSort over views: document order, deduplicated. */\nfunction uniqueSort(nodes: LegacyNode[]): LegacyNode[] {\n const grouped = new Map<NativeDocument, { id: number; node: LegacyNode }[]>();\n for (const node of nodes) {\n const binding = bindingOf(node);\n if (!binding) continue;\n let list = grouped.get(binding.document);\n if (!list) grouped.set(binding.document, list = []);\n list.push({ id: binding.id, node });\n }\n const sorted: LegacyNode[] = [];\n for (const [document, list] of grouped) {\n const order = operation<number[]>(document, 'uniqueSort', { ids: list.map((entry) => entry.id) });\n for (const id of order ?? []) {\n const entry = list.find((candidate) => candidate.id === id);\n if (entry) sorted.push(entry.node);\n }\n }\n return sorted;\n}\n\n/*\n * lib/cheerio.js\n */\n\nconst isNode = (obj: unknown): boolean => {\n if (viewId(obj) !== undefined) return true;\n const node = obj as LegacyNode;\n return !!(obj && typeof obj === 'object' && (node.name || node.type === 'text' || node.type === 'comment'));\n};\n\nfunction makeCheerio(): CheerioConstructor {\n const Cheerio = function (this: CheerioInstance, selector?: any, context?: any, root?: any, options?: LegacyOptions) {\n if (!(this instanceof Cheerio)) {\n return new Cheerio(selector, context, root, options);\n }\n\n this.options = defaults(options || {}, this.options);\n\n // $(), $(null), $(undefined), $(false)\n if (!selector) return this;\n\n if (root) {\n if (typeof root === 'string') root = parse(root, this.options);\n this._root = Cheerio.call(this, root);\n }\n\n // $($)\n if (selector.cheerio) return selector;\n\n // $(dom)\n if (isNode(selector)) selector = [selector];\n\n // $([dom])\n if (Array.isArray(selector)) {\n selector.forEach((elem: LegacyNode, idx: number) => {\n this[idx] = elem;\n });\n this.length = selector.length;\n return this;\n }\n\n // $(<html>)\n if (typeof selector === 'string' && isHtml(selector)) {\n return Cheerio.call(this, (parse(selector, this.options) as LegacyNode).children ?? []);\n }\n\n // If we don't have a context, maybe we have a root, from loading\n if (!context) {\n context = this._root;\n } else if (typeof context === 'string') {\n if (isHtml(context)) {\n // $('li', '<ul>...</ul>')\n context = Cheerio.call(this, parse(context, this.options));\n } else {\n // $('li', 'ul')\n selector = [context, selector].join(' ');\n context = this._root;\n }\n // $('li', node), $('li', [nodes])\n } else if (!context.cheerio) {\n context = Cheerio.call(this, context);\n }\n\n // If we still don't have a context, return\n if (!context) return this;\n\n // #id, .class, tag\n return context.find(selector);\n } as unknown as CheerioStatic;\n\n Cheerio.prototype.cheerio = '[cheerio object]';\n Cheerio.prototype.options = defaultOpts;\n Cheerio.prototype.length = 0;\n Cheerio.prototype.splice = Array.prototype.splice;\n\n Cheerio.prototype._make = function (this: CheerioInstance, dom: any, context?: any): CheerioInstance {\n const cheerio = new (this.constructor as CheerioConstructor)(dom, context, this._root, this.options);\n cheerio.prevObject = this;\n return cheerio;\n };\n\n Cheerio.prototype.toArray = function (this: CheerioInstance): LegacyNode[] {\n return this.get() as LegacyNode[];\n };\n\n return Cheerio;\n}\n\n/*\n * api/attributes.js\n */\n\nconst hasOwn = Object.prototype.hasOwnProperty;\nconst rspace = /\\s+/;\nconst dataAttrPrefix = 'data-';\nconst primitives: Record<string, unknown> = { null: null, true: true, false: false };\nconst rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i;\nconst rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/;\n\nfunction getAttr(elem: LegacyNode | undefined, name?: string): unknown {\n if (!elem || !isTag(elem)) return;\n\n if (!elem.attribs) {\n elem.attribs = {};\n }\n\n // Return the entire attribs object if no attribute specified\n if (!name) {\n return elem.attribs;\n }\n\n if (hasOwn.call(elem.attribs, name)) {\n // Get the (decoded) attribute\n return rboolean.test(name) ? name : elem.attribs[name];\n }\n\n // Mimic the DOM and return text content as value for `option's`\n if (elem.name === 'option' && name === 'value') {\n return staticText((elem.children ?? []) as unknown as ArrayLike<LegacyNode>);\n }\n\n // Mimic DOM with default value for radios/checkboxes\n if (elem.name === 'input' && (elem.attribs.type === 'radio' || elem.attribs.type === 'checkbox') && name === 'value') {\n return 'on';\n }\n}\n\nfunction setAttr(el: LegacyNode, name: string, value: unknown): void {\n if (value === null) {\n removeAttribute(el, name);\n return;\n }\n const stringValue = value + '';\n const binding = bindingOf(el);\n const document = binding?.document as AttributeDocument | undefined;\n if (binding && document?.setAttribute) {\n document.setAttribute([binding.id], name, stringValue);\n } else {\n el.attribs![name] = stringValue;\n }\n}\n\nfunction removeAttribute(elem: LegacyNode, name: string): void {\n if (!elem.attribs || !hasOwn.call(elem.attribs, name)) return;\n const binding = bindingOf(elem);\n const document = binding?.document as AttributeDocument | undefined;\n if (binding && document?.setAttribute) {\n document.setAttribute([binding.id], name, null);\n } else {\n delete elem.attribs[name];\n }\n}\n\nconst splitClass = (className?: string): string[] => (className ? className.trim().split(rspace) : []);\n\nfunction setDataStore(el: LegacyNode): Record<string, unknown> {\n if (!el.data || typeof el.data !== 'object') (el as any).data = {};\n return (el as any).data;\n}\n\nfunction readData(el: LegacyNode, name?: string): unknown {\n const readAll = arguments.length < 2;\n let domNames: string[], jsNames: string[];\n\n if (readAll) {\n domNames = Object.keys(el.attribs ?? {}).filter((attrName) => attrName.slice(0, dataAttrPrefix.length) === dataAttrPrefix);\n jsNames = domNames.map((domName) => camelCase(domName.slice(dataAttrPrefix.length)));\n } else {\n domNames = [dataAttrPrefix + cssCase(name!)];\n jsNames = [name!];\n }\n\n let value: unknown;\n const store = setDataStore(el);\n for (let idx = 0; idx < domNames.length; ++idx) {\n const domName = domNames[idx];\n const jsName = jsNames[idx];\n if (hasOwn.call(el.attribs ?? {}, domName)) {\n value = el.attribs![domName];\n\n if (hasOwn.call(primitives, value as string)) {\n value = primitives[value as string];\n } else if (value === String(Number(value))) {\n value = Number(value);\n } else if (rbrace.test(value as string)) {\n try {\n value = JSON.parse(value as string);\n } catch { /* keep the string */ }\n }\n\n store[jsName] = value;\n }\n }\n\n return readAll ? store : value;\n}\n\nconst getProp = (el: LegacyNode, name: string): unknown => {\n if (!el || !isTag(el)) return;\n return hasOwn.call(el, name)\n ? (el as any)[name]\n : rboolean.test(name)\n ? getAttr(el, name) !== undefined\n : getAttr(el, name);\n};\n\nconst setProp = (el: LegacyNode, name: string, value: unknown): void => {\n (el as any)[name] = rboolean.test(name) ? !!value : value;\n};\n\nconst attributesApi: CheerioPrototype = {\n attr(this: CheerioInstance, name?: any, value?: any) {\n // Set the value (with attr map support)\n if (typeof name === 'object' || value !== undefined) {\n if (typeof value === 'function') {\n return domEach(this, function (i, el) {\n setAttr(el, name, value.call(el, i, el.attribs![name]));\n });\n }\n if (typeof name === 'string') {\n if (this.length === 1 && isTag(this[0])) {\n setAttr(this[0], name, value);\n return this;\n }\n // Batch the plain set across the selection: one native call instead\n // of one per element. `null` removes, as in setAttr.\n const groups = new Map<NativeDocument, Array<{ id: number; name: string; value: string | null }>>();\n let usable = this.length > 0;\n for (let i = 0; i < this.length; i++) {\n const el = this[i];\n if (!isTag(el)) continue;\n if (!el.attribs) el.attribs = {};\n const binding = bindingOf(el);\n if (!binding) { usable = false; break; }\n let group = groups.get(binding.document);\n if (!group) groups.set(binding.document, group = []);\n group.push({ id: binding.id, name, value: value === null ? null : value + '' });\n }\n if (usable) {\n for (const [document, writes] of groups) {\n const attributeDocument = document as AttributeDocument;\n const firstValue = writes[0]?.value;\n if (attributeDocument.setAttribute && writes.every((write) => write.value === firstValue)) {\n attributeDocument.setAttribute(writes.map((write) => write.id), name, firstValue ?? null);\n } else {\n operation(document, 'setAttrs', { writes });\n }\n }\n return this;\n }\n }\n return domEach(this, function (_i, el) {\n if (!isTag(el)) return;\n if (typeof name === 'object') {\n for (const key of Object.keys(name)) setAttr(el, key, name[key]);\n } else {\n setAttr(el, name, value);\n }\n });\n }\n\n return getAttr(this[0], name);\n },\n\n prop(this: CheerioInstance, name?: any, value?: any) {\n if (typeof name === 'string' && value === undefined) {\n switch (name) {\n case 'style': {\n const property = this.css() as Record<string, unknown>;\n let i = 0;\n for (const p of Object.keys(property)) {\n property[i++] = p;\n }\n property.length = i;\n return property;\n }\n case 'tagName':\n case 'nodeName':\n return this[0].name!.toUpperCase();\n // As in cheerio 1.x: these render through the facade's serializer so\n // the current render options apply.\n case 'innerHTML':\n return this[0] && isTag(this[0])\n ? staticHtml.call(this, (this[0] as LegacyNode).children, this.options)\n : null;\n case 'outerHTML':\n return this[0] && isTag(this[0])\n ? staticHtml.call(this, [this[0] as LegacyNode], this.options)\n : null;\n default:\n return getProp(this[0], name);\n }\n }\n\n if (typeof name === 'object' || value !== undefined) {\n if (typeof value === 'function') {\n return domEach(this, function (i, el) {\n setProp(el, name, value.call(el, i, getProp(el, name)));\n });\n }\n return domEach(this, function (_i, el) {\n if (!isTag(el)) return;\n if (typeof name === 'object') {\n for (const key of Object.keys(name)) setProp(el, key, name[key]);\n } else {\n setProp(el, name, value);\n }\n });\n }\n },\n\n data(this: CheerioInstance, name?: any, value?: any) {\n const elem = this[0] as LegacyNode;\n\n if (!elem || !isTag(elem)) return;\n\n // Return the entire data object if no data specified\n if (!name) {\n return readData(elem);\n }\n\n // Set the value (with attr map support)\n if (typeof name === 'object' || value !== undefined) {\n domEach(this, function (_i, el) {\n const store = setDataStore(el);\n if (typeof name === 'object') Object.assign(store, name);\n else store[name] = value;\n });\n return this;\n } else if (hasOwn.call(setDataStore(elem), name)) {\n return setDataStore(elem)[name];\n }\n\n return readData(elem, name);\n },\n\n val(this: CheerioInstance, value?: any) {\n const querying = arguments.length === 0;\n const element = this[0] as LegacyNode;\n\n if (!element) return;\n\n switch (element.name) {\n case 'textarea':\n return this.text(value);\n case 'input':\n switch (this.attr('type')) {\n case 'radio':\n if (querying) {\n return this.attr('value');\n } else {\n this.attr('value', value);\n return this;\n }\n default:\n return this.attr('value', value);\n }\n case 'select': {\n const option = this.find('option:selected') as CheerioInstance | undefined;\n let returnValue: unknown;\n if (option === undefined) return undefined;\n if (!querying) {\n if (!(this.attr() as any).hasOwnProperty('multiple') && typeof value === 'object') {\n return this;\n }\n if (typeof value !== 'object') {\n value = [value];\n }\n this.find('option').removeAttr('selected');\n for (let i = 0; i < value.length; i++) {\n this.find(`option[value=\"${value[i]}\"]`).attr('selected', '');\n }\n return this;\n }\n returnValue = option.attr('value');\n if ((this.attr() as any).hasOwnProperty('multiple')) {\n returnValue = [];\n domEach(option, function (_i, el) {\n (returnValue as unknown[]).push(getAttr(el, 'value'));\n });\n }\n return returnValue;\n }\n case 'option':\n if (!querying) {\n this.attr('value', value);\n return this;\n }\n return this.attr('value');\n }\n },\n\n removeAttr(this: CheerioInstance, name: string) {\n domEach(this, function (_i, elem) {\n removeAttribute(elem, name);\n });\n return this;\n },\n\n hasClass(this: CheerioInstance, className: string): boolean {\n for (let i = 0; i < this.length; i++) {\n const elem = this[i];\n const attrs = elem.attribs;\n const clazz = attrs && attrs['class'];\n let idx = -1;\n let end: number;\n\n if (clazz) {\n while ((idx = clazz.indexOf(className, idx + 1)) > -1) {\n end = idx + className.length;\n if ((idx === 0 || rspace.test(clazz[idx - 1])) && (end === clazz.length || rspace.test(clazz[end]))) {\n return true;\n }\n }\n }\n }\n return false;\n },\n\n addClass(this: CheerioInstance, value?: any) {\n // Support functions\n if (typeof value === 'function') {\n return domEach(this, function (i, el) {\n const className = el.attribs!['class'] || '';\n attributesApi.addClass.call([el] as unknown as CheerioInstance, value.call(el, i, className));\n });\n }\n\n // Return if no value or not a string or function\n if (!value || typeof value !== 'string') return this;\n\n const numElements = this.length;\n if (numElements === 1 && isTag(this[0]) && !hasMaterializedAttributes(this[0])) {\n const binding = bindingOf(this[0]);\n const document = binding?.document as AttributeDocument | undefined;\n if (binding && document?.addClass) {\n document.addClass([binding.id], value);\n return this;\n }\n }\n const groups = new Map<AttributeDocument, number[]>();\n let native = true;\n for (let i = 0; i < numElements; i++) {\n if (!isTag(this[i])) continue;\n const binding = bindingOf(this[i]);\n const document = binding?.document as AttributeDocument | undefined;\n if (!binding || !document?.addClass || hasMaterializedAttributes(this[i])) { native = false; break; }\n const ids = groups.get(document);\n if (ids) ids.push(binding.id);\n else groups.set(document, [binding.id]);\n }\n if (native) {\n for (const [document, ids] of groups) document.addClass!(ids, value);\n return this;\n }\n\n const classNames = value.split(rspace);\n for (let i = 0; i < numElements; i++) {\n // If selected element isn't a tag, move on\n if (!isTag(this[i])) continue;\n\n // If we don't already have classes\n const className = getAttr(this[i], 'class') as string | undefined;\n\n if (!className) {\n setAttr(this[i], 'class', classNames.join(' ').trim());\n } else {\n let setClass = ` ${className} `;\n const numClasses = classNames.length;\n\n // Check if class already exists\n for (let j = 0; j < numClasses; j++) {\n const appendClass = `${classNames[j]} `;\n if (setClass.indexOf(` ${appendClass}`) < 0) setClass += appendClass;\n }\n\n setAttr(this[i], 'class', setClass.trim());\n }\n }\n\n return this;\n },\n\n removeClass(this: CheerioInstance, value?: any) {\n // Handle if value is a function\n if (typeof value === 'function') {\n return domEach(this, function (i, el) {\n attributesApi.removeClass.call([el] as unknown as CheerioInstance, value.call(el, i, el.attribs!['class'] || ''));\n });\n }\n\n const classes = splitClass(value);\n const numClasses = classes.length;\n const removeAll = arguments.length === 0;\n\n return domEach(this, function (_i, el) {\n if (!isTag(el)) return;\n\n if (removeAll) {\n // Short circuit the remove all case as this is the nice one\n el.attribs!.class = '';\n } else {\n const elClasses = splitClass(el.attribs!.class);\n let changed: boolean | undefined;\n\n for (let j = 0; j < numClasses; j++) {\n const index = elClasses.indexOf(classes[j]);\n\n if (index >= 0) {\n elClasses.splice(index, 1);\n changed = true;\n\n // We have to do another pass to ensure that there are not duplicate\n // classes listed\n j--;\n }\n }\n if (changed) {\n el.attribs!.class = elClasses.join(' ');\n }\n }\n });\n },\n\n toggleClass(this: CheerioInstance, value?: any, stateVal?: boolean) {\n // Support functions\n if (typeof value === 'function') {\n return domEach(this, function (i, el) {\n attributesApi.toggleClass.call([el] as unknown as CheerioInstance, value.call(el, i, el.attribs!['class'] || '', stateVal), stateVal);\n });\n }\n\n // Return if no value or not a string or function\n if (!value || typeof value !== 'string') return this;\n\n const classNames = value.split(rspace);\n const numClasses = classNames.length;\n const state = typeof stateVal === 'boolean' ? (stateVal ? 1 : -1) : 0;\n const numElements = this.length;\n\n for (let i = 0; i < numElements; i++) {\n // If selected element isn't a tag, move on\n if (!isTag(this[i])) continue;\n\n const elementClasses = splitClass(this[i].attribs!.class);\n\n // Check if class already exists\n for (let j = 0; j < numClasses; j++) {\n // Check if the class name is currently defined\n const index = elementClasses.indexOf(classNames[j]);\n\n // Add if stateValue === true or we are toggling and there is no value\n if (state >= 0 && index < 0) {\n elementClasses.push(classNames[j]);\n } else if (state <= 0 && index >= 0) {\n // Otherwise remove but only if the item exists\n elementClasses.splice(index, 1);\n }\n }\n\n this[i].attribs!.class = elementClasses.join(' ');\n }\n\n return this;\n },\n\n is(this: CheerioInstance, selector?: any): boolean {\n if (selector) {\n return (traversingApi.filter as any).call(this, selector).length > 0;\n }\n return false;\n },\n};\n\n/*\n * api/traversing.js\n */\n\nconst traversingApi: CheerioPrototype = {\n find(this: CheerioInstance, selectorOrHaystack?: any) {\n const self = this;\n if (selectorOrHaystack && typeof selectorOrHaystack !== 'string') {\n const haystack: LegacyNode[] = selectorOrHaystack.cheerio ? selectorOrHaystack.get() : [selectorOrHaystack];\n const contains = (self.constructor as any).contains;\n return this._make(haystack.filter(function (elem: LegacyNode) {\n for (let idx = 0, len = self.length; idx < len; ++idx) {\n if (contains(self[idx], elem)) return true;\n }\n return false;\n }));\n }\n\n // The native within-select covers the 0.22.0 candidate set (every\n // descendant of the matched elements) in one call, at any document size.\n const binding = bindingOf(this[0]);\n const document = binding?.document;\n if (document && selectorOrHaystack) {\n const contexts = this.length === 1 && binding ? [binding.id] : idsOf(document, this.toArray());\n if (contexts.length) {\n try {\n const simpleTag = simpleTagExpr.exec(selectorOrHaystack);\n if (!simpleTag) validateLegacySelector(selectorOrHaystack);\n const finalTag = simpleTag ?? finalTagExpr.exec(selectorOrHaystack);\n const knownType = finalTag && !specialTagExpr.test(finalTag[1]) ? 'tag' : undefined;\n const found = document.select(selectorOrHaystack, contexts);\n if (found) return this._make(asNodes(document, found, knownType) as LegacyNode[]);\n } catch (error) {\n throw error instanceof SyntaxError ? error : new SyntaxError((error as Error)?.message ?? String(error));\n }\n }\n }\n\n const elems: LegacyNode[] = [];\n for (let i = 0; i < this.length; i++) {\n for (const child of this[i].children ?? []) if (isTag(child)) elems.push(child);\n }\n\n const options = { ...this.options, context: this.toArray() } as LegacyOptions;\n return this._make(scopedSelect(selectorOrHaystack, elems, options));\n },\n\n parent(this: CheerioInstance, selector?: any) {\n const set: LegacyNode[] = [];\n\n domEach(this, function (_idx, elem) {\n const parentElem = elem.parent;\n if (parentElem && set.indexOf(parentElem) < 0) {\n set.push(parentElem);\n }\n });\n\n const filtered = arguments.length ? (traversingApi.filter as any).call(set as unknown as CheerioInstance, selector, this) : set;\n return this._make(filtered as LegacyNode[]);\n },\n\n parents(this: CheerioInstance, selector?: any) {\n const parentNodes: LegacyNode[] = [];\n\n // When multiple DOM elements are in the original set, the resulting set\n // will be in *reverse* order of the original elements as well, with\n // duplicates removed.\n this.get().reverse().forEach(function (this: CheerioInstance, elem: LegacyNode) {\n traverseParents(this, elem.parent, selector, Infinity).forEach((node) => {\n if (parentNodes.indexOf(node) === -1) {\n parentNodes.push(node);\n }\n });\n }, this);\n\n return this._make(parentNodes);\n },\n\n parentsUntil(this: CheerioInstance, selector?: any, filter?: any) {\n const parentNodes: LegacyNode[] = [];\n let untilNode: LegacyNode | undefined;\n let untilNodes: LegacyNode[] | undefined;\n\n if (typeof selector === 'string') {\n untilNode = scopedSelect(selector, this.parents().toArray() as LegacyNode[], this.options)[0];\n } else if (selector && selector.cheerio) {\n untilNodes = selector.toArray();\n } else if (selector) {\n untilNode = selector;\n }\n\n this.toArray().reverse().forEach(function (elem: LegacyNode) {\n while ((elem = elem.parent as LegacyNode)) {\n if ((untilNode && elem !== untilNode) ||\n (untilNodes && untilNodes.indexOf(elem) === -1) ||\n (!untilNode && !untilNodes)) {\n if (isTag(elem) && parentNodes.indexOf(elem) === -1) parentNodes.push(elem);\n } else {\n break;\n }\n }\n });\n\n return this._make((filter ? scopedSelect(filter, parentNodes, this.options) : parentNodes) as LegacyNode[]);\n },\n\n closest(this: CheerioInstance, selector?: any) {\n const set: LegacyNode[] = [];\n\n if (!selector) {\n return this._make(set);\n }\n\n domEach(this, function (this: CheerioInstance, _idx, elem) {\n const closestElem = traverseParents(this, elem, selector, 1)[0];\n\n // Do not add duplicate elements to the set\n if (closestElem && set.indexOf(closestElem) < 0) {\n set.push(closestElem);\n }\n });\n\n return this._make(set);\n },\n\n next(this: CheerioInstance, selector?: any) {\n if (!this[0]) return this;\n const elems: LegacyNode[] = [];\n\n for (let i = 0; i < this.length; i++) {\n let elem: LegacyNode = this[i];\n while ((elem = elem.next as LegacyNode)) {\n if (isTag(elem)) {\n elems.push(elem);\n break;\n }\n }\n }\n\n return selector ? (traversingApi.filter as any).call(elems as unknown as CheerioInstance, selector, this) : this._make(elems);\n },\n\n nextAll(this: CheerioInstance, selector?: any) {\n if (!this[0]) return this;\n const elems: LegacyNode[] = [];\n\n for (let i = 0; i < this.length; i++) {\n let elem: LegacyNode = this[i];\n while ((elem = elem.next as LegacyNode)) {\n if (isTag(elem) && elems.indexOf(elem) === -1) {\n elems.push(elem);\n }\n }\n }\n\n return selector ? (traversingApi.filter as any).call(elems as unknown as CheerioInstance, selector, this) : this._make(elems);\n },\n\n nextUntil(this: CheerioInstance, selector?: any, filterSelector?: any) {\n if (!this[0]) return this;\n const elems: LegacyNode[] = [];\n let untilNode: LegacyNode | undefined;\n let untilNodes: LegacyNode[] | undefined;\n\n if (typeof selector === 'string') {\n untilNode = scopedSelect(selector, this.nextAll().get() as LegacyNode[], this.options)[0];\n } else if (selector && selector.cheerio) {\n untilNodes = selector.get();\n } else if (selector) {\n untilNode = selector;\n }\n\n for (let i = 0; i < this.length; i++) {\n let elem: LegacyNode = this[i];\n while ((elem = elem.next as LegacyNode)) {\n if ((untilNode && elem !== untilNode) ||\n (untilNodes && untilNodes.indexOf(elem) === -1) ||\n (!untilNode && !untilNodes)) {\n if (isTag(elem) && elems.indexOf(elem) === -1) {\n elems.push(elem);\n }\n } else {\n break;\n }\n }\n }\n\n return filterSelector ? (traversingApi.filter as any).call(elems as unknown as CheerioInstance, filterSelector, this) : this._make(elems);\n },\n\n prev(this: CheerioInstance, selector?: any) {\n if (!this[0]) return this;\n const elems: LegacyNode[] = [];\n\n for (let i = 0; i < this.length; i++) {\n let elem: LegacyNode = this[i];\n while ((elem = elem.prev as LegacyNode)) {\n if (isTag(elem)) {\n elems.push(elem);\n break;\n }\n }\n }\n\n return selector ? (traversingApi.filter as any).call(elems as unknown as CheerioInstance, selector, this) : this._make(elems);\n },\n\n prevAll(this: CheerioInstance, selector?: any) {\n if (!this[0]) return this;\n const elems: LegacyNode[] = [];\n\n for (let i = 0; i < this.length; i++) {\n let elem: LegacyNode = this[i];\n while ((elem = elem.prev as LegacyNode)) {\n if (isTag(elem) && elems.indexOf(elem) === -1) {\n elems.push(elem);\n }\n }\n }\n\n return selector ? (traversingApi.filter as any).call(elems as unknown as CheerioInstance, selector, this) : this._make(elems);\n },\n\n prevUntil(this: CheerioInstance, selector?: any, filterSelector?: any) {\n if (!this[0]) return this;\n const elems: LegacyNode[] = [];\n let untilNode: LegacyNode | undefined;\n let untilNodes: LegacyNode[] | undefined;\n\n if (typeof selector === 'string') {\n untilNode = scopedSelect(selector, this.prevAll().get() as LegacyNode[], this.options)[0];\n } else if (selector && selector.cheerio) {\n untilNodes = selector.get();\n } else if (selector) {\n untilNode = selector;\n }\n\n for (let i = 0; i < this.length; i++) {\n let elem: LegacyNode = this[i];\n while ((elem = elem.prev as LegacyNode)) {\n if ((untilNode && elem !== untilNode) ||\n (untilNodes && untilNodes.indexOf(elem) === -1) ||\n (!untilNode && !untilNodes)) {\n if (isTag(elem) && elems.indexOf(elem) === -1) {\n elems.push(elem);\n }\n } else {\n break;\n }\n }\n }\n\n return filterSelector ? (traversingApi.filter as any).call(elems as unknown as CheerioInstance, filterSelector, this) : this._make(elems);\n },\n\n siblingsAndMe(this: CheerioInstance) {\n const elems: LegacyNode[] = [];\n const parent = this[0] ? this[0].parent || this[0].root : undefined;\n if (parent) for (const sibling of parent.children ?? []) elems.push(sibling);\n return this._make(elems);\n },\n\n siblings(this: CheerioInstance, selector?: any) {\n const parent = this.parent() as CheerioInstance;\n\n const source = parent.length ? parent.children() : this.siblingsAndMe();\n const elems: LegacyNode[] = (source as CheerioInstance).toArray().filter((elem: LegacyNode) => isTag(elem) && !this.is(elem));\n\n if (selector !== undefined) {\n return (traversingApi.filter as any).call(elems as unknown as CheerioInstance, selector, this);\n } else {\n return this._make(elems);\n }\n },\n\n children(this: CheerioInstance, selector?: any) {\n const elems: LegacyNode[] = [];\n for (let i = 0; i < this.length; i++) {\n for (const child of this[i].children ?? []) if (isTag(child)) elems.push(child);\n }\n\n if (selector === undefined) return this._make(elems);\n\n return (traversingApi.filter as any).call(elems as unknown as CheerioInstance, selector, this);\n },\n\n contents(this: CheerioInstance) {\n const all: LegacyNode[] = [];\n for (let i = 0; i < this.length; i++) {\n all.push(...(this[i].children ?? []));\n }\n return this._make(all);\n },\n\n each(this: CheerioInstance, fn: (this: LegacyNode, i: number, el: LegacyNode) => unknown) {\n let i = 0;\n const len = this.length;\n while (i < len && fn.call(this[i], i, this[i]) !== false) ++i;\n return this;\n },\n\n map(this: CheerioInstance, fn: (this: LegacyNode, i: number, el: LegacyNode) => any) {\n const memo: unknown[] = [];\n for (let i = 0; i < this.length; i++) {\n const el = this[i];\n const val = fn.call(el, i, el);\n if (val != null) {\n if (Array.isArray(val)) memo.push(...val);\n else memo.push(val);\n }\n }\n return this._make(memo as LegacyNode[]);\n },\n\n filter(this: CheerioInstance, match?: any, container?: CheerioInstance) {\n return makeFilterMethod((list, testFn) => list.filter((el, i) => testFn(el, i))).call(this, match, container);\n },\n\n not(this: CheerioInstance, match?: any, container?: CheerioInstance) {\n return makeFilterMethod((list, testFn) => list.filter((el, i) => !testFn(el, i))).call(this, match, container);\n },\n\n has(this: CheerioInstance, selectorOrHaystack?: any) {\n const that = this;\n return traversingApi.filter.call(this, function (this: LegacyNode) {\n return that._make(this).find(selectorOrHaystack).length > 0;\n }) as CheerioInstance;\n },\n\n first(this: CheerioInstance) {\n return this.length > 1 ? this._make(this[0]) : this;\n },\n\n last(this: CheerioInstance) {\n return this.length > 1 ? this._make(this[this.length - 1]) : this;\n },\n\n eq(this: CheerioInstance, i: number) {\n i = +i;\n\n // Use the first identity optimization if possible\n if (i === 0 && this.length <= 1) return this;\n\n if (i < 0) i = this.length + i;\n return this[i] ? this._make(this[i]) : this._make([]);\n },\n\n get(this: CheerioInstance, i?: number) {\n if (i == null) {\n return Array.prototype.slice.call(this);\n } else {\n return this[i < 0 ? this.length + i : i];\n }\n },\n\n index(this: CheerioInstance, selectorOrNeedle?: any) {\n let $haystack: CheerioInstance, needle: unknown;\n\n if (arguments.length === 0) {\n $haystack = this.parent().children() as CheerioInstance;\n needle = this[0];\n } else if (typeof selectorOrNeedle === 'string') {\n $haystack = this._make(selectorOrNeedle);\n needle = this[0];\n } else {\n $haystack = this;\n needle = selectorOrNeedle.cheerio ? selectorOrNeedle[0] : selectorOrNeedle;\n }\n\n return ($haystack.get() as unknown[]).indexOf(needle);\n },\n\n slice(this: CheerioInstance, ...args: any[]) {\n return this._make((Array.prototype.slice as any).apply(this, args));\n },\n\n end(this: CheerioInstance) {\n return this.prevObject || this._make([]);\n },\n\n add(this: CheerioInstance, other?: any, context?: any) {\n const selection = this._make(other, context);\n const merged = uniqueSort(selection.get().concat(this.get()));\n for (let i = 0; i < merged.length; ++i) {\n selection[i] = merged[i];\n }\n selection.length = merged.length;\n return selection;\n },\n\n addBack(this: CheerioInstance, selector?: any) {\n return this.add(arguments.length ? this.prevObject!.filter(selector) : this.prevObject);\n },\n};\n\nfunction makeFilterMethod(filterFn: (list: LegacyNode[], testFn: (el: LegacyNode, i: number) => boolean) => LegacyNode[]) {\n return function (this: CheerioInstance | ArrayLike<LegacyNode>, match: any, container?: CheerioInstance) {\n let testFn: (el: LegacyNode, i: number) => boolean;\n const self = this as CheerioInstance;\n const list: LegacyNode[] = typeof (this as CheerioInstance).toArray === 'function'\n ? (this as CheerioInstance).toArray()\n : Array.from(this as ArrayLike<LegacyNode>);\n container = container || (typeof (this as CheerioInstance)._make === 'function' ? self : undefined);\n\n if (typeof match === 'string') {\n const binding = bindingOf(list[0] ?? (container as CheerioInstance | undefined)?.[0]);\n let compiled: Set<number> | undefined;\n testFn = (el: LegacyNode) => {\n if (!binding) return false;\n if (!compiled) {\n const ids = idsOf(binding.document, list);\n compiled = new Set(matchesSelector(binding.document, ids, match, { xmlMode: container?.options?.xmlMode } as LegacyOptions));\n }\n const id = viewId(el);\n return id !== undefined && compiled.has(id);\n };\n } else if (typeof match === 'function') {\n testFn = (el: LegacyNode, i: number) => !!match.call(el, i, el);\n } else if (match.cheerio) {\n testFn = (el: LegacyNode) => match.toArray().includes(el);\n } else {\n testFn = (el: LegacyNode) => match === el;\n }\n\n if (!container) {\n // 0.22.0 would call `container._make` on the plain list and crash; be\n // more robust and wrap through the module constructor instead.\n const constructor = ((this as any).constructor && (this as any).constructor.prototype?._make ? (this as any).constructor : moduleCheerio) as CheerioConstructor;\n return new constructor(filterFn(list, testFn)) as CheerioInstance;\n }\n\n return container._make(filterFn(list, testFn));\n };\n}\n\nfunction traverseParents(self: CheerioInstance, elem: LegacyNode | null | undefined, selector: any, limit: number): LegacyNode[] {\n const elems: LegacyNode[] = [];\n while (elem && elems.length < limit) {\n if (!selector || (traversingApi.filter as any).call([elem] as unknown as CheerioInstance, selector, self).length) {\n elems.push(elem);\n }\n elem = elem.parent;\n }\n return elems;\n}\n\nfunction insertAdjacentStatic(this: CheerioInstance, elems: any[], position: 'before' | 'after'): boolean {\n if (elems.length !== 1 || typeof elems[0] !== 'string') return false;\n const options = legacyOptions(this.options);\n if (options.normalizeWhitespace || hasParserHooks(options)) return false;\n\n let document: NativeDocument | undefined;\n const targetIds: number[] = [];\n for (let i = 0; i < this.length; i++) {\n const el = this[i];\n if (!isTag(el)) return false;\n const binding = bindingOf(el);\n if (!binding || (document && binding.document !== document)) return false;\n document ??= binding.document;\n const parent = el.parent || el.root;\n if (!parent || bindingOf(parent)?.document !== document || hasMaterializedChildren(parent)) return false;\n targetIds.push(binding.id);\n }\n if (!document) return false;\n\n const fused = (document as AttributeDocument).insertHtml?.(targetIds, elems[0], position);\n if (fused) {\n for (let i = 0; i < fused.length; i++) setRootIfCached(document, fused[i], null);\n return true;\n }\n\n const nodeIds = operation<number[]>(document, 'create', { html: elems[0], options });\n if (!nodeIds.length) return true;\n const inserted = operation<number[]>(document, 'insert', { targetIds, nodeIds, position });\n for (let i = 0; i < inserted.length; i++) setRootIfCached(document, inserted[i], null);\n return true;\n}\n\nfunction removeNative(elems: CheerioInstance): boolean {\n const groups = new Map<NativeDocument, { ids: number[]; nodes: LegacyNode[] }>();\n for (let i = 0; i < elems.length; i++) {\n const el = elems[i];\n const binding = bindingOf(el);\n if (!binding) return false;\n const parent = el.parent || el.root;\n if (!parent) continue;\n if (bindingOf(parent)?.document !== binding.document || hasMaterializedChildren(parent)) return false;\n let group = groups.get(binding.document);\n if (!group) groups.set(binding.document, group = { ids: [], nodes: [] });\n group.ids.push(binding.id);\n group.nodes.push(el);\n }\n for (const [document, group] of groups) {\n const nativeDocument = document as AttributeDocument;\n if (nativeDocument.remove) nativeDocument.remove(group.ids);\n else operation(document, 'remove', { ids: group.ids });\n for (const node of group.nodes) node.root = null;\n }\n return true;\n}\n\n/*\n * api/manipulation.js\n */\n\nconst manipulationApi: CheerioPrototype = {\n _makeDomArray(this: CheerioInstance, elem: any, clone?: boolean): LegacyNode[] {\n if (elem == null) {\n return [];\n } else if (elem.cheerio) {\n return clone ? cloneDom(elem.get(), elem.options) : elem.get();\n } else if (Array.isArray(elem)) {\n return elem.reduce<LegacyNode[]>((memo, el) => memo.concat(this._makeDomArray(el, clone)), []);\n } else if (typeof elem === 'string') {\n return evaluate(elem, this.options);\n } else {\n return clone ? cloneDom([elem], this.options) : [elem];\n }\n },\n\n appendTo(this: CheerioInstance, target: any) {\n if (!target.cheerio) {\n target = (this.constructor as CheerioConstructor).call(this.constructor, target, null, this._originalRoot);\n }\n target.append(this);\n return this;\n },\n\n prependTo(this: CheerioInstance, target: any) {\n if (!target.cheerio) {\n target = (this.constructor as CheerioConstructor).call(this.constructor, target, null, this._originalRoot);\n }\n target.prepend(this);\n return this;\n },\n\n append(this: CheerioInstance, ...elems: any[]) {\n return insert.call(this, (dom: LegacyNode[], children: LegacyNode[], parent: LegacyNode) => {\n uniqueSplice(children, children.length, 0, dom, parent);\n }, elems);\n },\n\n prepend(this: CheerioInstance, ...elems: any[]) {\n return insert.call(this, (dom: LegacyNode[], children: LegacyNode[], parent: LegacyNode) => {\n uniqueSplice(children, 0, 0, dom, parent);\n }, elems);\n },\n\n wrap(this: CheerioInstance, wrapper: any) {\n const wrapperFn = typeof wrapper === 'function' && wrapper;\n const lastIdx = this.length - 1;\n\n for (let i = 0; i < this.length; i++) {\n const el = this[i];\n const parent = el.parent || el.root;\n\n if (!parent) {\n continue;\n }\n const siblings = Array.from(parent.children ?? []);\n\n let currentWrapper = wrapper;\n if (wrapperFn) {\n currentWrapper = wrapperFn.call(el, i);\n }\n\n if (typeof currentWrapper === 'string' && !isHtml(currentWrapper)) {\n currentWrapper = this.parents().last().find(currentWrapper).clone();\n }\n\n const dom = this._makeDomArray(currentWrapper, i < lastIdx).slice(0, 1);\n const index = siblings.indexOf(el);\n\n update([el], dom[0]);\n // The previous operation removed the current element from the\n // `siblings` list, so the `dom` array can be inserted without\n // removing any additional elements.\n siblings.splice(siblings.indexOf(el), 1);\n uniqueSplice(siblings, index, 0, dom, parent);\n }\n\n return this;\n },\n\n after(this: CheerioInstance, ...elems: any[]) {\n if (insertAdjacentStatic.call(this, elems, 'after')) return this;\n const lastIdx = this.length - 1;\n\n domEach(this, function (this: CheerioInstance, i, el) {\n const parent = el.parent || el.root;\n if (!parent) {\n return;\n }\n\n const siblings = Array.from(parent.children ?? []);\n const index = siblings.indexOf(el);\n let domSrc: any;\n let dom: LegacyNode[];\n\n // If not found, move on\n if (index < 0) return;\n\n if (typeof elems[0] === 'function') {\n domSrc = elems[0].call(el, i, staticHtml.call(this, el.children));\n } else {\n domSrc = elems;\n }\n dom = this._makeDomArray(domSrc, i < lastIdx);\n\n // Add element after `this` element\n uniqueSplice(siblings, index + 1, 0, dom, parent);\n });\n\n return this;\n },\n\n insertAfter(this: CheerioInstance, target: any) {\n const self = this;\n if (typeof target === 'string') {\n target = (this.constructor as CheerioConstructor).call(this.constructor, target, null, this._originalRoot);\n }\n const targetNodes = this._makeDomArray(target);\n self.remove();\n const clones: LegacyNode[][] = [];\n domEach(targetNodes as unknown as { length: number; [index: number]: LegacyNode }, function (this: CheerioInstance, _i, el) {\n const clonedSelf = self._makeDomArray(self.clone());\n const parent = el.parent || el.root;\n if (!parent) {\n return;\n }\n\n const siblings = Array.from(parent.children ?? []);\n const index = siblings.indexOf(el);\n\n // If not found, move on\n if (index < 0) return;\n\n // Add cloned `this` element(s) after target element\n uniqueSplice(siblings, index + 1, 0, clonedSelf, parent);\n clones.push(clonedSelf);\n });\n return (this.constructor as CheerioConstructor).call(this.constructor, this._makeDomArray(clones as any)) as CheerioInstance;\n },\n\n before(this: CheerioInstance, ...elems: any[]) {\n if (insertAdjacentStatic.call(this, elems, 'before')) return this;\n const lastIdx = this.length - 1;\n\n domEach(this, function (this: CheerioInstance, i, el) {\n const parent = el.parent || el.root;\n if (!parent) {\n return;\n }\n\n const siblings = Array.from(parent.children ?? []);\n const index = siblings.indexOf(el);\n let domSrc: any;\n let dom: LegacyNode[];\n\n // If not found, move on\n if (index < 0) return;\n\n if (typeof elems[0] === 'function') {\n domSrc = elems[0].call(el, i, staticHtml.call(this, el.children));\n } else {\n domSrc = elems;\n }\n\n dom = this._makeDomArray(domSrc, i < lastIdx);\n\n // Add element before `el` element\n uniqueSplice(siblings, index, 0, dom, parent);\n });\n\n return this;\n },\n\n insertBefore(this: CheerioInstance, target: any) {\n const self = this;\n if (typeof target === 'string') {\n target = (this.constructor as CheerioConstructor).call(this.constructor, target, null, this._originalRoot);\n }\n const targetNodes = this._makeDomArray(target);\n self.remove();\n const clones: LegacyNode[][] = [];\n domEach(targetNodes as unknown as { length: number; [index: number]: LegacyNode }, function (this: CheerioInstance, _i, el) {\n const clonedSelf = self._makeDomArray(self.clone());\n const parent = el.parent || el.root;\n if (!parent) {\n return;\n }\n\n const siblings = Array.from(parent.children ?? []);\n const index = siblings.indexOf(el);\n\n // If not found, move on\n if (index < 0) return;\n\n // Add cloned `this` element(s) after target element\n uniqueSplice(siblings, index, 0, clonedSelf, parent);\n clones.push(clonedSelf);\n });\n return (this.constructor as CheerioConstructor).call(this.constructor, this._makeDomArray(clones as any)) as CheerioInstance;\n },\n\n remove(this: CheerioInstance, selector?: any) {\n const elems: CheerioInstance = selector ? this.filter(selector) : this;\n if (removeNative(elems)) return this;\n\n domEach(elems, function (_i, el) {\n const parent = el.parent || el.root;\n if (!parent) {\n return;\n }\n\n const siblings = Array.from(parent.children ?? []);\n const index = siblings.indexOf(el);\n\n if (index < 0) return;\n\n writeChildren(parent, siblings.filter((item, at) => at !== index));\n // The rebuild above cleared the arena links; drop the legacy root ref.\n el.root = null;\n });\n\n return this;\n },\n\n replaceWith(this: CheerioInstance, content: any) {\n const self = this;\n\n domEach(this, function (this: CheerioInstance, i, el) {\n const parent = el.parent || el.root;\n if (!parent) {\n return;\n }\n\n const siblings = Array.from(parent.children ?? []);\n const dom = self._makeDomArray(typeof content === 'function' ? content.call(el, i, el) : content);\n const index = siblings.indexOf(el);\n\n // In the case that `dom` contains nodes that already exist in other\n // structures, ensure those nodes are properly removed.\n for (const node of dom) update(node, null);\n\n // Completely remove old element\n uniqueSplice(siblings, index, 1, dom, parent);\n el.root = null;\n });\n\n return this;\n },\n\n empty(this: CheerioInstance) {\n domEach(this, function (_i, el) {\n writeChildren(el, []);\n });\n return this;\n },\n\n html(this: CheerioInstance, str?: any) {\n if (str === undefined) {\n if (!this[0] || !this[0].children) return null;\n return staticHtml.call(this, this[0].children, this.options);\n }\n\n const opts = this.options;\n\n domEach(this, function (this: CheerioInstance, _i, el) {\n const content = str.cheerio ? str.clone().get() : evaluate(`${str}`, opts);\n update(content, el);\n });\n\n return this;\n },\n\n toString(this: CheerioInstance): string {\n return staticHtml.call(this, this as unknown as LegacyNode[], this.options);\n },\n\n text(this: CheerioInstance, str?: any) {\n // If `str` is undefined, act as a \"getter\"\n if (str === undefined) {\n return staticText.call(this, this as unknown as ArrayLike<LegacyNode>);\n } else if (typeof str === 'function') {\n // Function support\n return domEach(this, function (this: CheerioInstance, i, el) {\n const $el = [el] as unknown as CheerioInstance;\n return manipulationApi.text.call($el, str.call(el, i, staticText($el)));\n });\n }\n\n // Append text node to each selected elements\n domEach(this, function (this: CheerioInstance, _i, el) {\n const document = bindingOf(el)!.document;\n const textId = operation<number>(document, 'createNode', { type: 'text', data: `${str}`, options: legacyOptions(this.options) });\n const elem = getNode(document, textId) as LegacyNode;\n update(elem, el);\n });\n\n return this;\n },\n\n clone(this: CheerioInstance) {\n return this._make(cloneDom(this.get(), this.options));\n },\n};\n\nfunction insert(this: CheerioInstance, concatenator: (dom: LegacyNode[], children: LegacyNode[], parent: LegacyNode) => void, elems: any[]) {\n const lastIdx = this.length - 1;\n\n return domEach(this, function (this: CheerioInstance, i, el) {\n let domSrc: any;\n let dom: LegacyNode[];\n\n if (typeof elems[0] === 'function') {\n domSrc = elems[0].call(el, i, staticHtml.call(this, el.children));\n } else {\n domSrc = elems;\n }\n\n dom = this._makeDomArray(domSrc, i < lastIdx);\n concatenator(dom, el.children!, el as LegacyNode);\n });\n}\n\n/**\n * Modify an array in-place, removing some number of elements and adding new\n * elements directly following them — lib/api/manipulation.js `uniqueSplice`.\n * Structural changes install whole child lists (see writeChildren); the\n * engine rebuilds the sibling links.\n */\nfunction uniqueSplice(array: LegacyNode[], spliceIdx: number, spliceCount: number, newElems: LegacyNode[], parent: LegacyNode): void {\n const current = Array.from(array);\n\n // Before splicing in new elements, ensure they do not already appear in the\n // current array.\n for (let idx = 0; idx < newElems.length; ++idx) {\n const node = newElems[idx];\n const oldParent = node.parent || node.root;\n const prevIdx = oldParent ? Array.from(oldParent.children ?? []).indexOf(node) : -1;\n\n if (oldParent && prevIdx > -1) {\n if (oldParent === parent) {\n // 0.22.0 splices the node out of the same list and compensates the\n // splice index for the shift.\n current.splice(prevIdx, 1);\n if (spliceIdx > prevIdx) spliceIdx--;\n } else {\n writeChildren(oldParent, Array.from(oldParent.children ?? []).filter((item, at) => at !== prevIdx));\n }\n }\n\n node.root = null;\n }\n\n const merged = current.slice(0, spliceIdx).concat(newElems, current.slice(spliceIdx + spliceCount));\n writeChildren(parent, merged);\n}\n\n/*\n * api/css.js\n */\n\nconst cssApi: CheerioPrototype = {\n css(this: CheerioInstance, prop?: any, val?: any) {\n if (arguments.length === 2 || (Object.prototype.toString.call(prop) === '[object Object]')) {\n return domEach(this, function (idx, el) {\n setCss(el, prop, val, idx);\n });\n } else {\n return getCss(this[0], prop);\n }\n },\n};\n\n/*\n * api/forms.js\n */\n\nconst submittableSelector = 'input,select,textarea,keygen';\nconst r20 = /%20/g;\nconst rCRLF = /\\r?\\n/g;\n\nconst formsApi: CheerioPrototype = {\n serialize(this: CheerioInstance): string {\n // Convert form elements into name/value objects\n const arr = formsApi.serializeArray.call(this);\n\n // Serialize each element into a key/value string\n const retArr = arr.map((data: { name: string; value: string }) => `${encodeURIComponent(data.name)}=${encodeURIComponent(data.value)}`);\n\n // Return the resulting serialization\n return retArr.join('&').replace(r20, '+');\n },\n\n serializeArray(this: CheerioInstance): Array<{ name: string; value: string }> {\n // Resolve all form elements from either forms or collections of form elements\n const Cheerio = this.constructor as CheerioConstructor;\n return (this.map(function (this: LegacyNode) {\n const elem = this;\n const $elem = Cheerio(elem);\n if (elem.name === 'form') {\n return ($elem.find(submittableSelector) as CheerioInstance).toArray();\n } else {\n return $elem.filter(submittableSelector).toArray();\n }\n }) as CheerioInstance)\n .filter(\n // Verify elements have a name (`attr.name`) and are not disabled (`:disabled`)\n '[name!=\"\"]:not(:disabled)'\n // and cannot be clicked (`[type=submit]`) or are used in `x-www-form-urlencoded` (`[type=file]`)\n + ':not(:submit, :button, :image, :reset, :file)'\n // and are either checked/don't have a checkable state\n + ':matches([checked], :not(:checkbox, :radio))')\n .map(function (_i: number, elem: LegacyNode) {\n const $elem = Cheerio(elem);\n const name = $elem.attr('name') as string;\n const val = $elem.val();\n\n // If there is no value set (e.g. `undefined`, `null`), then return nothing\n if (val == null) {\n return null;\n } else {\n // If we have an array of values (e.g. `<select multiple>`), return an array of key/value pairs\n if (Array.isArray(val)) {\n return val.map((value: string) => ({\n name,\n value: value.replace(rCRLF, '\\r\\n'),\n }));\n // Otherwise (e.g. `<input type=\"text\">`, return only one key/value pair\n } else {\n return { name, value: (val as string).replace(rCRLF, '\\r\\n') };\n }\n }\n })\n .get() as Array<{ name: string; value: string }>;\n },\n};\n\n/*\n * lib/static.js\n */\n\nfunction render(that: { _root?: CheerioInstance }, dom: any, options: LegacyOptions): string {\n if (!dom) {\n if (that._root && (that._root as unknown as LegacyNode).children) {\n dom = (that._root as unknown as LegacyNode).children;\n } else {\n return '';\n }\n } else if (typeof dom === 'string') {\n const roots = ((that._root ?? {}) as unknown as LegacyNode).children ?? [];\n dom = scopedSelect(dom, roots, { ...options, context: roots });\n }\n\n return renderWith(options, dom);\n}\n\n/** $.html([selector | dom], [options]) */\nfunction staticHtml(this: any, dom?: any, options?: LegacyOptions): string {\n const Cheerio = moduleCheerio;\n\n // be flexible about parameters, sometimes we call html(),\n // with options as only parameter\n if (Object.prototype.toString.call(dom) === '[object Object]' && !options && !('length' in dom) && !('type' in dom)) {\n options = dom;\n dom = undefined;\n }\n\n // sometimes $.html() used without preloading html\n // so fallback non existing options to the default ones\n options = defaults(options ?? {}, this._options, Cheerio.prototype.options) as LegacyOptions;\n\n return render(this, dom, options);\n}\n\n/** $.xml([selector | dom]) */\nfunction staticXml(this: any, dom?: any): string {\n const options = defaults({ xmlMode: true } as LegacyOptions, this._options);\n return render(this, dom, options);\n}\n\n/** $.text(dom) */\nfunction staticText(this: any, elems?: ArrayLike<LegacyNode>): string {\n if (!elems) {\n elems = staticRoot.call(this) as unknown as ArrayLike<LegacyNode>;\n }\n const src = (elems ?? []) as ArrayLike<LegacyNode>;\n const len = (src as any).length >>> 0;\n if (len > 0) {\n const first = (src as any)[0] as LegacyNode | undefined;\n const document = bindingOf(first)?.document;\n if (document) {\n const ids = new Array<number>(len);\n let ok = true;\n for (let i = 0; i < len; i++) {\n const id = viewIdIn(document, (src as any)[i]);\n if (id === undefined) { ok = false; break; }\n ids[i] = id;\n }\n if (ok) {\n const text = document.text(ids);\n if (typeof text === 'string') return text;\n }\n }\n }\n let ret = '';\n for (let i = 0; i < len; i++) {\n const elem = (src as any)[i] as LegacyNode;\n if (elem.type === 'text') ret += elem.data;\n else if (elem.children && elem.type !== 'comment') {\n ret += staticText(elem.children);\n }\n }\n return ret;\n}\n\n/** $.parseHTML(data [, context ] [, keepScripts ]) */\nfunction staticParseHTML(this: { load: typeof load }, data?: string | null, context?: unknown, keepScripts = typeof context === 'boolean' ? context : false): LegacyNode[] | null {\n let parsed: CheerioInstance;\n\n if (!data || typeof data !== 'string') {\n return null;\n }\n\n if (typeof context === 'boolean') {\n keepScripts = context as boolean;\n }\n\n parsed = this.load(data) as unknown as CheerioInstance;\n if (!keepScripts) {\n (parsed as any)('script').remove();\n }\n\n // The `children` array is used by Cheerio internally to group elements that\n // share the same parents. When nodes created through `parseHTML` are\n // inserted into previously-existing DOM structures, they will be removed\n // from the `children` array. The results of `parseHTML` should remain\n // constant across these operations, so a shallow copy should be returned.\n return (parsed.root()[0] as LegacyNode).children!.slice();\n}\n\n/** $.root() */\nfunction staticRoot(this: any): CheerioInstance {\n return (this as unknown as CheerioConstructor)(this._root);\n}\n\n/** $.contains(container, contained) */\nfunction staticContains(container?: LegacyNode, contained?: LegacyNode): boolean {\n // According to the jQuery API, an element does not \"contain\" itself\n if (contained === container) {\n return false;\n }\n\n // Step up the descendants, stopping when the root element is reached\n // (signaled by `.parent` returning a reference to the same object)\n while (contained && contained !== contained.parent) {\n contained = contained.parent as LegacyNode;\n if (contained === container) {\n return true;\n }\n }\n\n return false;\n}\n\n/** $.load(str) */\nfunction load(content: string | Buffer | ArrayLike<LegacyNode> | LegacyNode, options?: LegacyOptions | null, isDocument?: boolean): CheerioStatic {\n const Cheerio = moduleCheerio;\n\n options = defaults({ ...(options ?? {}) }, Cheerio.prototype.options) as LegacyOptions;\n\n const root = parse(content as string | Buffer, options, isDocument ?? true);\n\n const initialize = function (this: CheerioInstance, selector?: any, context?: any, r?: any, opts?: LegacyOptions) {\n if (!(this instanceof initialize)) {\n return new (initialize as unknown as CheerioConstructor)(selector, context, r, opts);\n }\n opts = defaults(opts || {}, options);\n return Cheerio.call(this, selector, context, r || root, opts);\n } as unknown as CheerioStatic;\n\n // Ensure that selections created by the \"loaded\" `initialize` function are\n // true Cheerio instances.\n initialize.prototype = Object.create(Cheerio.prototype) as CheerioPrototype;\n initialize.prototype.constructor = initialize;\n\n // Mimic jQuery's prototype alias for plugin authors.\n (initialize as any).fn = initialize.prototype;\n\n // Keep a reference to the top-level scope so we can chain methods that\n // implicitly resolve selectors; e.g. $(\"<span>\").(\".bar\"), which otherwise\n // loses ._root\n initialize.prototype._originalRoot = root;\n\n // Add in the static methods\n Object.assign(initialize, staticExports);\n\n // Add in the root\n (initialize as any)._root = root;\n // store options\n (initialize as any)._options = options;\n\n return initialize;\n}\n\nconst staticExports = {\n load,\n html: staticHtml,\n xml: staticXml,\n text: staticText,\n parseHTML: staticParseHTML,\n root: staticRoot,\n contains: staticContains,\n};\n\n/*\n * Module assembly — the callable 0.22.0 module export.\n */\n\nconst moduleCheerio = makeCheerio() as unknown as CheerioStatic;\nfor (const api of [attributesApi, traversingApi, manipulationApi, cssApi, formsApi]) {\n Object.assign(moduleCheerio.prototype, api);\n}\nObject.assign(moduleCheerio, staticExports);\nmoduleCheerio.version = packageVersion;\n\nexport default moduleCheerio;\nexport { moduleCheerio as cheerio, load, staticHtml as html, staticXml as xml, staticText as text, staticParseHTML as parseHTML, staticRoot as root, staticContains as contains };\nexport { staticExports as legacyStatics };\nexport type { CheerioInstance, CheerioConstructor, CheerioPrototype, LegacyNode, LegacyOptions };\n"],"mappings":";;AAGA,SAAgB,OAAO,IAAgB,MAAW,KAAU,KAAmB;CAC7E,IAAI,OAAO,SAAS,UAAU;EAC5B,MAAM,SAAS,YAAY,GAAG,SAAS,KAAK;EAC5C,IAAI,OAAO,QAAQ,YACjB,MAAM,IAAI,KAAK,IAAI,KAAK,OAAO,KAAK;EAGtC,IAAI,QAAQ,IACV,OAAO,OAAO;OACT,IAAI,OAAO,MAChB,OAAO,QAAQ;EAGjB,GAAG,QAAS,QAAQ,gBAAgB,MAAM;CAC5C,OAAO,IAAI,OAAO,SAAS,UACzB,KAAK,MAAM,OAAO,OAAO,KAAK,IAAI,GAChC,OAAO,IAAI,KAAK,KAAK,MAAM,GAAG;AAGpC;AAEA,SAAgB,OAAO,IAA4B,MAAiB;CAClE,MAAM,SAAS,YAAY,IAAI,SAAS,KAAK;CAC7C,IAAI,OAAO,SAAS,UAClB,OAAO,OAAO;MACT,IAAI,MAAM,QAAQ,IAAI,GAC3B,OAAO,KAAK,QAAQ,IAAI;MAExB,OAAO;AAEX;AAEA,SAAS,KAAK,KAA6B,OAAyC;CAClF,MAAM,SAAiC,CAAC;CACxC,KAAK,MAAM,QAAQ,OAAO,IAAI,QAAQ,KAAK,OAAO,QAAQ,IAAI;CAC9D,OAAO;AACT;AAEA,SAAS,gBAAgB,KAAqC;CAC5D,OAAO,OAAO,KAAK,GAAG,CAAC,CAAC,QAAQ,KAAK,SAAS,GAAG,MAAM,MAAM,MAAM,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,EAAE;AACnG;AAEA,SAAS,YAAY,QAAoD;CACvE,UAAU,UAAU,GAAA,CAAI,KAAK;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,OAAO;AACT;AAEA,MAAM,gBAAgB;CACpB;CACA,MAAM;CACN,KAAK;CACL,MAAM;CACN,WAAW;CACX,MAAM;CACN,UAAU;AACZ;AAMA,MAAM,gBAAgB,YAAY;AAClC,KAAK,MAAM,OAAO;CAAC;CAAe;CAAe;CAAiB;CAAQ;AAAQ,GAChF,OAAO,OAAO,cAAc,WAAW,GAAG;AAE5C,OAAO,OAAO,eAAe,aAAa;AAC1C,cAAc,UAAUI"}
|
|
@@ -22,6 +22,7 @@ interface CheerioInstance {
|
|
|
22
22
|
length: number;
|
|
23
23
|
prevObject?: CheerioInstance;
|
|
24
24
|
[index: number]: LegacyNode;
|
|
25
|
+
[Symbol.iterator](): Iterator<LegacyNode>;
|
|
25
26
|
[key: string]: any;
|
|
26
27
|
}
|
|
27
28
|
type CheerioConstructor = {
|
|
@@ -30,6 +31,16 @@ type CheerioConstructor = {
|
|
|
30
31
|
prototype: CheerioPrototype;
|
|
31
32
|
};
|
|
32
33
|
type CheerioPrototype = Record<string, any>;
|
|
34
|
+
/**
|
|
35
|
+
* cheerio 1.x-compatible type aliases, so code written against rc.12
|
|
36
|
+
* type-imports (`CheerioAPI`, `Cheerio<Element>`, `Element`) keeps
|
|
37
|
+
* compiling against the 0.22 facade unchanged.
|
|
38
|
+
*/
|
|
39
|
+
type CheerioAPI = CheerioStatic;
|
|
40
|
+
type Cheerio<T = LegacyNode> = CheerioInstance;
|
|
41
|
+
type Element = LegacyNode;
|
|
42
|
+
type AnyNode = LegacyNode;
|
|
43
|
+
type Document = LegacyNode;
|
|
33
44
|
/**
|
|
34
45
|
* A loaded `$`: the callable initialize function with the static methods,
|
|
35
46
|
* the stored root and options, and `fn` for plugins — as in 0.22.0.
|
|
@@ -84,5 +95,5 @@ declare const staticExports: {
|
|
|
84
95
|
contains: typeof staticContains;
|
|
85
96
|
};
|
|
86
97
|
declare const moduleCheerio: CheerioStatic;
|
|
87
|
-
export { LegacyNode as _, staticContains as a, staticParseHTML as c, staticXml as d, update as f,
|
|
88
|
-
//# sourceMappingURL=cheerio-compat-
|
|
98
|
+
export { LegacyOptions as C, LegacyNode as S, CheerioInstance as _, staticContains as a, Document as b, staticParseHTML as c, staticXml as d, update as f, CheerioConstructor as g, CheerioAPI as h, parse as i, staticRoot as l, Cheerio as m, load as n, staticExports as o, AnyNode as p, moduleCheerio as r, staticHtml as s, evaluate as t, staticText as u, CheerioPrototype as v, Element as x, CheerioStatic as y };
|
|
99
|
+
//# sourceMappingURL=cheerio-compat-C6M5aNE9.d.cts.map
|
|
@@ -22,6 +22,7 @@ interface CheerioInstance {
|
|
|
22
22
|
length: number;
|
|
23
23
|
prevObject?: CheerioInstance;
|
|
24
24
|
[index: number]: LegacyNode;
|
|
25
|
+
[Symbol.iterator](): Iterator<LegacyNode>;
|
|
25
26
|
[key: string]: any;
|
|
26
27
|
}
|
|
27
28
|
type CheerioConstructor = {
|
|
@@ -30,6 +31,16 @@ type CheerioConstructor = {
|
|
|
30
31
|
prototype: CheerioPrototype;
|
|
31
32
|
};
|
|
32
33
|
type CheerioPrototype = Record<string, any>;
|
|
34
|
+
/**
|
|
35
|
+
* cheerio 1.x-compatible type aliases, so code written against rc.12
|
|
36
|
+
* type-imports (`CheerioAPI`, `Cheerio<Element>`, `Element`) keeps
|
|
37
|
+
* compiling against the 0.22 facade unchanged.
|
|
38
|
+
*/
|
|
39
|
+
type CheerioAPI = CheerioStatic;
|
|
40
|
+
type Cheerio<T = LegacyNode> = CheerioInstance;
|
|
41
|
+
type Element = LegacyNode;
|
|
42
|
+
type AnyNode = LegacyNode;
|
|
43
|
+
type Document = LegacyNode;
|
|
33
44
|
/**
|
|
34
45
|
* A loaded `$`: the callable initialize function with the static methods,
|
|
35
46
|
* the stored root and options, and `fn` for plugins — as in 0.22.0.
|
|
@@ -84,5 +95,5 @@ declare const staticExports: {
|
|
|
84
95
|
contains: typeof staticContains;
|
|
85
96
|
};
|
|
86
97
|
declare const moduleCheerio: CheerioStatic;
|
|
87
|
-
export { LegacyNode as _, staticContains as a, staticParseHTML as c, staticXml as d, update as f,
|
|
88
|
-
//# sourceMappingURL=cheerio-compat-
|
|
98
|
+
export { LegacyOptions as C, LegacyNode as S, CheerioInstance as _, staticContains as a, Document as b, staticParseHTML as c, staticXml as d, update as f, CheerioConstructor as g, CheerioAPI as h, parse as i, staticRoot as l, Cheerio as m, load as n, staticExports as o, AnyNode as p, moduleCheerio as r, staticHtml as s, evaluate as t, staticText as u, CheerioPrototype as v, Element as x, CheerioStatic as y };
|
|
99
|
+
//# sourceMappingURL=cheerio-compat-C6M5aNE9.d.cts.map
|
|
@@ -251,7 +251,7 @@ function renderText(elem, opts, parentName) {
|
|
|
251
251
|
return data;
|
|
252
252
|
}
|
|
253
253
|
// package.json
|
|
254
|
-
var version = "0.1.
|
|
254
|
+
var version = "0.1.4";
|
|
255
255
|
// src/cheerio-compat.ts
|
|
256
256
|
/**
|
|
257
257
|
* The Cheerio 0.22.0 facade, backed by the Rust engine.
|
|
@@ -1647,4 +1647,4 @@ Object.assign(moduleCheerio, staticExports);
|
|
|
1647
1647
|
moduleCheerio.version = version;
|
|
1648
1648
|
export { staticContains as a, staticParseHTML as c, staticXml as d, update as f, parse as i, staticRoot as l, load as n, staticExports as o, moduleCheerio as r, staticHtml as s, evaluate as t, staticText as u };
|
|
1649
1649
|
|
|
1650
|
-
//# sourceMappingURL=cheerio-compat-
|
|
1650
|
+
//# sourceMappingURL=cheerio-compat-CVs7vojA.mjs.map
|